/*
 * Global Styles
 *
 * Base styles for the Opus landing page.
 * Includes CSS reset, variables, typography, and BEM component styles.
 * Mobile-first responsive design with Outfit font (matching iOS app).
 */

/* ==========================================================================
   Font Face - Outfit Variable Font (same as iOS app)
   ========================================================================== */

@font-face {
  font-family: 'Outfit';
  src: url('/fonts/Outfit-VariableFont_wght.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ==========================================================================
   CSS Reset (Modern Minimal)
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3, h4, h5, h6 {
  font-size: inherit;
  font-weight: inherit;
}

a {
  color: inherit;
  text-decoration: inherit;
}

img, svg, video {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ==========================================================================
   CSS Variables
   ========================================================================== */

:root {
  --font-primary: 'Outfit', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-serif: Georgia, 'Times New Roman', serif;

  --color-bg: #fff;
  --color-text: #1a1a1a;
  --color-text-muted: #666;
  --color-accent: #1a1a1a;
  --color-border: #e5e5e5;

  --spacing-xs: 8px;
  --spacing-sm: 16px;
  --spacing-md: 24px;
  --spacing-lg: 48px;
  --spacing-xl: 80px;

  --max-width: 680px;
}

/* ==========================================================================
   Base Styles
   ========================================================================== */

html {
  font-size: 16px;
  line-height: 1.7;
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-primary);
  color: var(--color-text);
  background: var(--color-bg);
  margin: 0;
}

/* ==========================================================================
   Landing Page Container
   ========================================================================== */

.landing {
  min-height: 100vh;
}

/* ==========================================================================
   Section Base Styles
   ========================================================================== */

section {
  padding: var(--spacing-xl) var(--spacing-md);
  border-top: 1px solid var(--color-border);
}

section:first-child {
  border-top: none;
}

section h2 {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: normal;
  margin-bottom: var(--spacing-md);
}

section p {
  color: var(--color-text-muted);
  margin-bottom: var(--spacing-sm);
  max-width: var(--max-width);
}

section p:last-child {
  margin-bottom: 0;
}

section a {
  color: var(--color-text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

section a:hover {
  opacity: 0.8;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero {
  height: 100vh;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  text-align: center;
  border-top: none;
  position: relative;
  overflow: hidden;
  /* Black on mobile, gray gradient on desktop */
  background: #000;
}

@media (min-width: 768px) {
  .hero {
    background: linear-gradient(180deg, #f0f0f0 0%, #e8e8e8 50%, #f0f0f0 100%);
    align-items: center;
    padding: var(--spacing-lg) var(--spacing-md);
  }
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 200px;
  background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.3));
  pointer-events: none;
  z-index: 5;
}

.hero__content {
  width: 100%;
  position: relative;
  z-index: 10;
  background: rgba(255, 255, 255, 1);
  padding: var(--spacing-md) var(--spacing-sm) var(--spacing-lg);
  border-radius: 0;
}

@media (min-width: 768px) {
  .hero__content {
    max-width: 700px;
    width: auto;
    padding: var(--spacing-lg) var(--spacing-xl);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }
}

.hero__logo {
  width: 80px;
  height: 80px;
  border-radius: 16px;
  margin-left: auto;
  margin-right: auto;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  position: relative;
  top: -60px;
  margin-bottom: -40px;
}

@media (min-width: 768px) {
  .hero__logo {
    top: 0;
    margin-bottom: var(--spacing-md);
  }
}

.hero__title {
  font-family: var(--font-serif);
  font-size: 32px;
  line-height: 1;
  font-weight: 300;
  margin-bottom: var(--spacing-sm);
  letter-spacing: -0.02em;
}

.hero__subtitle {
  font-size: 15px;
  color: var(--color-text-muted);
  margin-bottom: var(--spacing-md);
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.hero__subtitle strong {
  color: var(--color-text);
}

.hero__cta {
  display: inline-block;
  padding: 16px 32px;
  /* Bright iOS CTA Green */
  background: #34F07E;
  color: #000;
  font-size: 15px;
  font-weight: 500;
  /* Pill shape */
  border-radius: 99rem;
  transition: background 0.2s ease;
  text-decoration: none;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: light;
  }
}

.hero__cta:hover {
  background: #2ECC71;
}

/* ==========================================================================
   Features Section
   ========================================================================== */

.features {
  position: relative;
  padding: var(--spacing-md) 0 75vw;
  overflow: hidden;
  margin-top: -1px;
}

@media (min-width: 768px) {
  .features {
    padding: var(--spacing-md) 0 36vw;
  }
}

.features__bg {
  position: absolute;
  inset: 0;
  object-fit: cover;
  object-position: center 60%;
  z-index: 0;
}

.features__grid {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: flex-start;
  gap: var(--spacing-sm);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: var(--spacing-sm);
  padding: 0 var(--spacing-sm) var(--spacing-md);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

@media (min-width: 768px) {
  .features__grid {
    padding: var(--spacing-md) var(--spacing-sm);
  }
}

.feature:last-child {
  margin-right: var(--spacing-sm);
}

.features__grid::-webkit-scrollbar {
  display: none;
}

.feature {
  flex: 0 0 65vw;
  max-width: 260px;
  scroll-snap-align: start;
  background: var(--color-bg);
  padding: var(--spacing-md);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.feature--visible {
  opacity: 1;
  transform: translateY(0);
}

.feature__title {
  font-size: 10px;
  font-weight: 600;
  margin-bottom: var(--spacing-xs);
  color: #FF4B28;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.feature__text {
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.3;
}

@media (min-width: 768px) {
  .feature__title {
    font-size: 12px;
  }

  .feature__text {
    font-size: 15px;
  }
}


/* ==========================================================================
   Accordion Section
   ========================================================================== */

.accordion-section {
  position: relative;
  z-index: 10;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--spacing-md) var(--spacing-md) var(--spacing-lg);
  border-top: none;
  background: var(--color-bg);
  border-radius: 0;
  box-shadow: none;
}

@media (min-width: 768px) {
  .accordion-section {
    margin: 0 auto -60px;
    border-radius: 16px;
    box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.15);
  }
}

.accordion-wrapper {
  background: #f5f4f0;
  padding: var(--spacing-md) 0 0;
}

@media (min-width: 768px) {
  .accordion-wrapper {
    padding: var(--spacing-md) 0;
  }
}

.accordion-wrapper__badge {
  display: block;
  max-width: 200px;
  width: 100%;
  height: auto;
  margin: var(--spacing-md) auto 0;
  padding: 0 var(--spacing-md);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

@media (min-width: 768px) {
  .accordion-wrapper__badge {
    max-width: 280px;
    margin: var(--spacing-lg) auto 0;
  }
}

.accordion-wrapper__badge--visible {
  opacity: 1;
  transform: translateY(0);
}


.accordion-section__title {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: normal;
  text-align: center;
  margin: var(--spacing-lg) 0 var(--spacing-md);
}

.accordion {
  border-bottom: 1px solid var(--color-border);
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.accordion--visible {
  opacity: 1;
  transform: translateY(0);
}

.accordion__title {
  font-size: 16px;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-sm);
  width: 100%;
  background: none;
  border: none;
  padding: var(--spacing-sm) 0;
  text-align: left;
  font-family: inherit;
  transition: color 0.2s ease;
}

.accordion__title:hover {
  color: #FF4B28;
}

.accordion__icon {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.accordion--open .accordion__icon {
  transform: rotate(180deg);
}

.accordion__content-wrapper {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease;
}

.accordion--open .accordion__content-wrapper {
  grid-template-rows: 1fr;
}

.accordion__content {
  min-height: 0;
  overflow: hidden;
}

.accordion__content-inner {
  padding-bottom: var(--spacing-sm);
  font-size: 15px;
  color: var(--color-text-muted);
  line-height: 1.7;
}

.accordion__content-inner p {
  margin-bottom: var(--spacing-sm);
  max-width: none;
}

.accordion__content-inner p:last-child {
  margin-bottom: 0;
}

.accordion__content-inner strong {
  color: var(--color-text);
  font-weight: 500;
}

.accordion__content-inner em {
  font-style: italic;
}

.accordion__content-inner a {
  color: var(--color-text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.accordion__content-inner a:hover {
  opacity: 0.8;
}

.accordion__content-inner ul {
  margin: var(--spacing-sm) 0;
  padding-left: var(--spacing-md);
  list-style: disc;
}

.accordion__content-inner li {
  margin-bottom: var(--spacing-xs);
}


/* ==========================================================================
   Woman Reading Section
   ========================================================================== */

.woman-reading {
  padding: 0;
  border-top: none;
  height: 70vw;
  overflow: hidden;
}

@media (min-width: 768px) {
  .woman-reading {
    height: 40vw;
  }
}

.woman-reading__image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center 35%;
  transform: scale(1.6);
}

@media (min-width: 768px) {
  .woman-reading__image {
    object-position: center 40%;
    transform: scale(1);
  }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  padding: var(--spacing-xl) var(--spacing-md);
  border-top: 1px solid var(--color-border);
  text-align: center;
}

.footer__app-store {
  display: inline-block;
  margin-bottom: var(--spacing-md);
  transition: opacity 0.2s ease;
}

.footer__app-store:hover {
  opacity: 0.8;
}

.footer__app-store-badge {
  height: 54px;
  width: auto;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

.footer__link {
  font-size: 14px;
  color: var(--color-text-muted);
  transition: color 0.2s ease;
}

.footer__link:hover {
  color: var(--color-text);
}

.footer__copyright {
  font-size: 13px;
  color: var(--color-text-muted);
}

/* ==========================================================================
   Error Page
   ========================================================================== */

.error-page {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: var(--spacing-md);
  text-align: center;
}

.error-page__content {
  max-width: 480px;
}

.error-page__code {
  font-size: 80px;
  line-height: 1;
  margin-bottom: var(--spacing-sm);
  font-weight: bold;
  opacity: 0.2;
}

.error-page__title {
  font-size: 24px;
  margin-bottom: var(--spacing-sm);
  font-weight: 500;
}

.error-page__message {
  margin-bottom: var(--spacing-md);
  color: var(--color-text-muted);
}

.error-page__link {
  display: inline-block;
  padding: 12px 24px;
  background: var(--color-accent);
  color: var(--color-bg);
  border-radius: 4px;
  font-size: 15px;
  transition: opacity 0.2s ease;
}

.error-page__link:hover {
  opacity: 0.8;
}

/* ==========================================================================
   Tablet (768px+)
   ========================================================================== */

@media (min-width: 768px) {
  .hero__title {
    font-size: 32px;
  }

  .hero__subtitle {
    font-size: 16px;
  }

  .feature {
    flex: 0 0 35vw;
    max-width: 280px;
  }

  section h2 {
    font-size: 32px;
  }
}

/* ==========================================================================
   Desktop (1024px+)
   ========================================================================== */

@media (min-width: 1024px) {
  .hero__title {
    font-size: 38px;
  }
}

/* ==========================================================================
   Large Desktop (1200px+)
   ========================================================================== */

@media (min-width: 1200px) {
  .hero__title {
    font-size: 42px;
  }

  .hero__subtitle {
    font-size: 17px;
  }
}

/* ==========================================================================
   Legal Pages (Terms, Privacy)
   ========================================================================== */

.legal-page {
  min-height: 100vh;
  padding: var(--spacing-xl) var(--spacing-md);
}

.legal-page__content {
  max-width: var(--max-width);
  margin: 0 auto;
}

.legal-page__back {
  display: none;
}


.legal-page h1 {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: normal;
  margin-bottom: var(--spacing-sm);
  line-height: 1.2;
}

.legal-page h2 {
  font-size: 17px;
  font-weight: 500;
  margin-top: var(--spacing-md);
  margin-bottom: var(--spacing-xs);
}

.legal-page h3 {
  font-size: 15px;
  font-weight: 500;
  margin-top: var(--spacing-sm);
  margin-bottom: 4px;
}

.legal-page p {
  color: var(--color-text-muted);
  margin-bottom: var(--spacing-xs);
  line-height: 1.5;
}

.legal-page p em {
  font-style: normal;
}

.legal-page strong {
  font-weight: normal;
}

.legal-page ul {
  margin: var(--spacing-sm) 0;
  padding-left: var(--spacing-md);
  list-style: disc;
  color: var(--color-text-muted);
}

.legal-page li {
  margin-bottom: var(--spacing-xs);
  line-height: 1.5;
}

.legal-page a {
  color: var(--color-text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-page a:hover {
  opacity: 0.8;
}

@media (min-width: 768px) {
  .legal-page h1 {
    font-size: 32px;
  }
}
