/* PRIMELIFE — shared design system */

:root {
  --bg: #f2f3f7;
  --surface: #ffffff;
  --surface-border: rgba(26, 29, 38, 0.08);
  --accent: #6b7fd4;
  --text: #1a1d26;
  --text-secondary: #6b7289;
  --nutrition: #6b7fd4;
  --training: #6b7fd4;
  --recovery: #8b7fd4;
  --habits: #e8a830;
  --nutrition-accent: #4caf7d;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow: 0 4px 24px rgba(26, 29, 38, 0.06);
  --shadow-lg: 0 16px 48px rgba(26, 29, 38, 0.08);
  --max: 1080px;
  --max-narrow: 760px;
  --section-pad: clamp(72px, 10vw, 120px);
  --section-pad-mobile: clamp(48px, 12vw, 72px);
  --container-gutter: clamp(16px, 4vw, 24px);
  --header-height: 56px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --dur: 0.7s;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 16px);
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "SF Pro Display", system-ui, sans-serif;
  background:
    radial-gradient(ellipse 100% 45% at 50% 0%, rgba(107, 127, 212, 0.14), transparent 55%),
    radial-gradient(ellipse 85% 32% at 50% 58%, rgba(107, 127, 212, 0.05), transparent 62%),
    var(--bg);
  background-repeat: no-repeat;
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

@supports (padding: max(0px)) {
  body {
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
  }
}

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

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.container {
  width: min(100% - var(--container-gutter) * 2, var(--max));
  margin-inline: auto;
}

.section {
  padding-block: var(--section-pad);
}

.section-label {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(1.75rem, 4.5vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.section-intro {
  text-align: center;
  max-width: 36rem;
  margin-inline: auto;
  margin-bottom: clamp(32px, 5vw, 48px);
}

.section-intro p {
  margin-top: 12px;
  color: var(--text-secondary);
  font-size: 1.0625rem;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(242, 243, 247, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--surface-border);
  transition:
    background 0.3s var(--ease-smooth),
    box-shadow 0.3s var(--ease-smooth);
  padding-top: env(safe-area-inset-top, 0px);
}

.site-header.is-scrolled {
  background: rgba(242, 243, 247, 0.95);
  box-shadow: var(--shadow);
}

.header-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "brand cta"
    "nav nav";
  align-items: center;
  gap: 8px 12px;
  padding-block: 12px;
}

.brand {
  grid-area: brand;
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.header-cta {
  grid-area: cta;
  padding: 10px 16px;
  font-size: 0.8125rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.header-nav {
  grid-area: nav;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  width: 100%;
  padding-bottom: 2px;
}

.header-nav a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s ease;
  padding: 8px 4px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.header-nav a:hover {
  color: var(--text);
}

.back-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s ease;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

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

/* Buttons */

.btn-store {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 22px;
  min-height: 48px;
  border-radius: 999px;
  background: var(--text);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition:
    transform 0.2s var(--ease-out),
    box-shadow 0.2s var(--ease-out),
    opacity 0.2s ease;
  box-shadow: 0 4px 16px rgba(26, 29, 38, 0.18);
  -webkit-tap-highlight-color: transparent;
}

.btn-store svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn-store:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(26, 29, 38, 0.22);
}

.btn-store:active {
  transform: translateY(0);
}

/* Hero */

.hero {
  padding-top: clamp(32px, 6vw, 80px);
}

.hero-grid {
  display: grid;
  gap: clamp(32px, 6vw, 64px);
  align-items: center;
}

.hero-copy {
  text-align: center;
}

.hero-copy h1 {
  font-size: clamp(2rem, 8vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.08;
  margin-bottom: 16px;
}

.hero-copy p {
  font-size: clamp(1rem, 4vw, 1.125rem);
  color: var(--text-secondary);
  max-width: 28rem;
  margin-inline: auto;
  margin-bottom: 24px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  justify-content: center;
}

.hero-actions .btn-store {
  width: min(100%, 320px);
}

.hero-visual {
  display: flex;
  justify-content: center;
}

/* FAQ */

.faq-list {
  max-width: 40rem;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.faq-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 16px 18px;
  min-height: 56px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  transition: color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.faq-trigger:hover {
  color: var(--accent);
}

.faq-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  position: relative;
  color: var(--text-secondary);
  transition: transform 0.3s var(--ease-out);
}

.faq-item.is-open .faq-icon {
  transform: rotate(45deg);
}

.faq-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s var(--ease-out);
}

.faq-item.is-open .faq-panel {
  grid-template-rows: 1fr;
}

.faq-panel-inner {
  overflow: hidden;
}

.faq-panel-inner p {
  padding: 0 22px 18px;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Footer */

.footer-cta {
  text-align: center;
  padding-bottom: max(clamp(64px, 10vw, 100px), env(safe-area-inset-bottom, 0px));
}

.footer-cta .btn-store {
  margin-bottom: 40px;
  width: min(100%, 320px);
}

.wordmark {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.footer-cta h2 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
}

.footer-links a {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s ease;
  padding: 8px 4px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.footer-links a:hover {
  color: var(--text);
}

/* Reveal animations */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity var(--dur) var(--ease-out),
    transform var(--dur) var(--ease-out);
  transition-delay: var(--delay, 0ms);
}

.reveal-fade {
  opacity: 0;
  transition: opacity var(--dur) var(--ease-out);
  transition-delay: var(--delay, 0ms);
}

.reveal.is-visible,
.reveal-fade.is-visible {
  opacity: 1;
  transform: none;
}

/* Legal page */

.legal-page {
  padding: clamp(48px, 8vw, 80px) 0 clamp(64px, 10vw, 100px);
}

.legal-wrap {
  width: min(100% - var(--container-gutter) * 2, var(--max-narrow));
  margin-inline: auto;
}

.legal-intro {
  text-align: center;
  margin-bottom: 32px;
}

.legal-intro h1 {
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
}

.legal-intro p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.legal-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 28px;
}

.legal-nav a {
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow);
  color: var(--text-secondary);
  transition:
    color 0.2s ease,
    border-color 0.2s ease;
}

.legal-nav a:hover {
  color: var(--text);
  border-color: rgba(107, 127, 212, 0.35);
}

.legal-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: clamp(24px, 5vw, 40px);
}

.legal-section + .legal-section {
  margin-top: 48px;
  padding-top: 48px;
  border-top: 1px solid var(--surface-border);
}

.legal-section h2 {
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.legal-section .updated {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.legal-section h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 24px 0 8px;
  letter-spacing: -0.01em;
}

.legal-section p,
.legal-section li {
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.legal-section p + p {
  margin-top: 12px;
}

.legal-section ul {
  margin: 10px 0 0 20px;
}

.legal-section li + li {
  margin-top: 6px;
}

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

.legal-footer {
  text-align: center;
  margin-top: 40px;
  padding-top: 24px;
}

.legal-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.legal-footer a {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.legal-footer a:hover {
  color: var(--text);
}

/* Accessibility utility */

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Hero badge */

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent);
  background: rgba(107, 127, 212, 0.12);
  border: 1px solid rgba(107, 127, 212, 0.22);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}

/* Waitlist form */

.waitlist-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
  max-width: 30rem;
  margin-inline: auto;
}

.waitlist-input {
  flex: 1 1 220px;
  min-width: 0;
  min-height: 48px;
  padding: 13px 18px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 999px;
  box-shadow: var(--shadow);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.waitlist-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
}

.waitlist-input:focus {
  outline: none;
  border-color: rgba(107, 127, 212, 0.55);
  box-shadow: 0 0 0 3px rgba(107, 127, 212, 0.18);
}

.waitlist-submit {
  flex: 0 0 auto;
  color: #fff;
  background: linear-gradient(180deg, #4f7bff 0%, #2f63f0 100%);
  box-shadow:
    0 6px 18px rgba(47, 99, 240, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.waitlist-submit:hover {
  background: linear-gradient(180deg, #3f6dff 0%, #2557e6 100%);
  box-shadow:
    0 10px 26px rgba(47, 99, 240, 0.46),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.waitlist-submit:disabled {
  opacity: 0.65;
  cursor: progress;
  transform: none;
}

.waitlist-msg {
  flex-basis: 100%;
  min-height: 1.25rem;
  margin-top: 2px;
  padding-left: 4px;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
}

.waitlist-msg.is-success {
  color: var(--nutrition-accent);
}

.waitlist-msg.is-error {
  color: #d2453d;
}

.waitlist-msg.is-info {
  color: var(--text-secondary);
}

.waitlist-form-inline,
.waitlist-form-center {
  margin-top: 24px;
}

.waitlist-counter {
  margin-top: 18px;
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.waitlist-count {
  font-weight: 800;
  color: var(--text);
}

.waitlist-count-label {
  font-weight: 500;
}

/* Marketing posters */

.poster {
  margin: 0;
  display: flex;
  justify-content: center;
}

.poster img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--surface-border);
}

.hero-visual .poster img {
  width: min(100%, 360px);
}

.poster-feature {
  padding-block: clamp(40px, 7vw, 72px);
}

.poster-feature-alt {
  background: radial-gradient(
    ellipse 78% 78% at 50% 50%,
    rgba(107, 127, 212, 0.07),
    transparent 72%
  );
}

.poster-lg img {
  width: min(100%, 440px);
}

/* Founder section */

.founder-section {
  padding-top: clamp(48px, 8vw, 88px);
  background: radial-gradient(
    ellipse 72% 82% at 50% 45%,
    rgba(107, 127, 212, 0.06),
    transparent 70%
  );
}

.founder-card {
  max-width: 44rem;
  text-align: center;
  padding-inline: clamp(12px, 4vw, 24px);
}

.founder-logo {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  margin: 0 auto 20px;
  box-shadow: var(--shadow);
}

.founder-card .section-label {
  margin-bottom: 8px;
}

.founder-copy {
  margin-top: 16px;
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.footer-sub {
  margin-top: -8px;
  margin-bottom: 28px;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

/* Responsive */

@media (max-width: 767px) {
  .section {
    padding-block: var(--section-pad-mobile);
  }

  .section-intro {
    margin-bottom: 24px;
  }

  .section-intro p {
    font-size: 1rem;
  }

  .header-cta {
    padding: 10px 14px;
    font-size: 0.75rem;
  }
}

@media (min-width: 768px) {
  .header-inner {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 24px;
    padding-block: 16px;
  }

  .header-nav {
    width: auto;
    padding-bottom: 0;
    gap: 28px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr 1fr;
  }

  .hero-copy {
    text-align: left;
  }

  .hero-copy p {
    margin-inline: 0;
  }

  .hero-copy .waitlist-form,
  .hero-copy .waitlist-counter {
    margin-inline: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal,
  .reveal-fade {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .faq-panel {
    transition: none;
  }
}
