/* FrameFib website. Colors and type follow the app design system in AGENTS.md. */
:root {
  --canvas: #f6f5fa;
  --surface: #ffffff;
  --text: #1d1b2a;
  --muted: #625d75;
  --accent: #4538b8;
  --on-accent: #ffffff;
  --accent-surface: #ebe7ff;
  --border: #d7d2e3;
  --success: #237247;
  --brand: #4538b8;
  --brand-deep: #2b2272;
  --lavender: #beb4ff;
  --ink: #120f1f;
  --radius-card: 20px;
  --radius-photo: 24px;
  --shadow: 0 24px 60px -28px rgba(29, 27, 42, 0.35);
  --font: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #15131d;
    --surface: #211e2d;
    --text: #f4f1ff;
    --muted: #bab3cc;
    --accent: #beb4ff;
    --on-accent: #17132c;
    --accent-surface: #322b4c;
    --border: #4a425c;
    --success: #84d8ac;
    --shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.7);
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}
img, picture { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--lavender); outline-offset: 3px; border-radius: 8px; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.7rem, 7vw, 5rem); font-weight: 800; }
h2 { font-size: clamp(2rem, 4.4vw, 3.1rem); font-weight: 800; }
h3 { font-size: 1.3rem; font-weight: 700; }
p { margin: 0 0 1em; }
.container { width: min(1140px, 100% - 48px); margin-inline: auto; }
.skip-link { position: absolute; left: -999px; top: 12px; z-index: 100; padding: 10px 16px; border-radius: 999px; background: var(--surface); color: var(--text); }
.skip-link:focus { left: 12px; }
.eyebrow { display: inline-block; font-size: 0.85rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.lead { font-size: clamp(1.1rem, 2.2vw, 1.3rem); color: var(--muted); max-width: 40rem; }
.section { padding: clamp(72px, 10vw, 128px) 0; }
.section-head { max-width: 46rem; margin-bottom: clamp(36px, 5vw, 56px); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head.center .lead { margin-inline: auto; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; transition: background 0.25s ease, box-shadow 0.25s ease; }
.site-header.is-scrolled, .site-header.is-solid { background: color-mix(in srgb, var(--brand-deep) 88%, transparent); backdrop-filter: saturate(160%) blur(16px); -webkit-backdrop-filter: saturate(160%) blur(16px); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 800; font-size: 1.25rem; letter-spacing: -0.01em; }
.brand img { width: 34px; height: 34px; border-radius: 9px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25); }
.nav-links { display: flex; align-items: center; gap: 28px; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: rgba(255, 255, 255, 0.86); text-decoration: none; font-weight: 600; font-size: 0.98rem; }
.nav-links a:hover { color: #fff; }
.pill { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 12px 22px; border-radius: 999px; font-weight: 700; font-size: 1rem; text-decoration: none; border: 0; cursor: pointer; transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease; }
.pill:hover { transform: translateY(-1px); }
.pill-light { background: #fff; color: var(--brand); box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.45); }
.pill-ghost { background: rgba(255, 255, 255, 0.12); color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.35); }
.pill-ghost:hover { background: rgba(255, 255, 255, 0.2); }
.pill-small { min-height: 40px; padding: 8px 16px; font-size: 0.92rem; }
.pill-soft { background: var(--accent-surface); color: var(--accent); }
.section.flush-top { padding-top: 0; }
.pill .apple { width: 18px; height: 18px; fill: currentColor; }
.soon { cursor: default; }
.soon:hover { transform: none; }

/* Hero */
.hero { position: relative; overflow: hidden; color: #fff; background: radial-gradient(1100px 600px at 12% -10%, #6457dc 0%, transparent 60%), radial-gradient(900px 600px at 100% 30%, #3a2fa6 0%, transparent 55%), linear-gradient(165deg, var(--brand) 0%, var(--brand-deep) 100%); margin-top: -68px; padding-top: 68px; }
.hero .container { display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: 48px; min-height: min(860px, 100vh); padding-block: 48px 72px; }
.hero h1 span { color: var(--lavender); display: block; }
.hero .eyebrow { color: var(--lavender); }
.hero .lead { color: rgba(255, 255, 255, 0.82); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin: 32px 0 20px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 0.95rem; color: rgba(255, 255, 255, 0.72); list-style: none; padding: 0; margin: 0; }
.hero-meta li { display: inline-flex; align-items: center; gap: 8px; }
.hero-meta li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--lavender); }
.hero-stage { position: relative; height: 640px; }
.photo-card { position: absolute; border-radius: 40px; }
.photo-card.one { width: 360px; height: 460px; left: 6%; top: 10%; background: rgba(190, 180, 255, 0.18); transform: rotate(-12deg); }
.photo-card.two { width: 340px; height: 440px; right: 0; top: 18%; background: rgba(235, 231, 255, 0.12); transform: rotate(10deg); }
.hero-stage .phone { position: absolute; }
.hero-stage .phone.front { width: 280px; left: 14%; top: 6%; transform: rotate(-6deg); z-index: 2; animation: float 7s ease-in-out infinite; }
.hero-stage .phone.back { width: 262px; right: 4%; top: 13%; transform: rotate(7deg); animation: float-back 8s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: rotate(-6deg) translateY(0); } 50% { transform: rotate(-6deg) translateY(-14px); } }
@keyframes float-back { 0%, 100% { transform: rotate(7deg) translateY(0); } 50% { transform: rotate(7deg) translateY(12px); } }

/* Phone frame around real app captures (1320 x 2868). */
.phone { position: relative; padding: 9px; border-radius: 46px; background: var(--ink); box-shadow: 0 40px 80px -30px rgba(10, 8, 24, 0.7), inset 0 0 0 1.5px rgba(255, 255, 255, 0.12); }
.phone img { width: 100%; height: auto; border-radius: 37px; aspect-ratio: 1320 / 2868; object-fit: cover; background: #f6f5fa; }
.phone::after { content: ""; position: absolute; left: 50%; top: calc(9px + 1.1%); width: 29%; height: 3.6%; transform: translateX(-50%); border-radius: 999px; background: #000; }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; counter-reset: step; list-style: none; padding: 0; margin: 0; }
.step { position: relative; padding: 28px 24px 26px; border-radius: var(--radius-card); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.step .icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--accent-surface); color: var(--accent); margin-bottom: 18px; }
.step .icon svg { width: 26px; height: 26px; }
.step::after { counter-increment: step; content: counter(step); position: absolute; top: 20px; right: 22px; font-size: 2.6rem; font-weight: 800; line-height: 1; color: var(--accent-surface); }
.step p { color: var(--muted); margin: 0; }

/* Try a round */
.play { background: var(--surface); border-block: 1px solid var(--border); }
.play-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(32px, 5vw, 64px); align-items: center; }
.play-photo { border-radius: 28px; overflow: hidden; box-shadow: var(--shadow); }
.play-photo img { width: 100%; }
.play-question { font-size: 1.6rem; font-weight: 800; margin: 0 0 18px; }
.stories { display: grid; gap: 12px; margin: 0 0 18px; padding: 0; list-style: none; }
.story { width: 100%; text-align: left; font: inherit; font-weight: 600; color: var(--text); padding: 16px 18px; border-radius: var(--radius-card); background: var(--canvas); border: 1.5px solid var(--border); cursor: pointer; transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease; }
.story:hover:not([disabled]) { border-color: var(--accent); transform: translateY(-1px); }
.story small { display: block; margin-top: 6px; font-size: 0.85rem; font-weight: 700; color: var(--muted); }
.story.is-truth { border-color: var(--success); border-width: 2px; }
.story.is-truth small { color: var(--success); }
.story.is-picked { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.story[disabled] { cursor: default; }
.play-result { min-height: 3.2em; font-weight: 700; margin: 0; }
.play-result.win { color: var(--success); }
.no-js-reveal { margin-top: 12px; color: var(--muted); }
.js .no-js-reveal { display: none; }

/* Scoring */
.score-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.score { padding: 32px 28px; border-radius: 28px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.score b { display: block; font-size: clamp(3rem, 7vw, 4.6rem); line-height: 1; font-weight: 800; color: var(--accent); margin-bottom: 12px; letter-spacing: -0.03em; }
.score p { margin: 0; color: var(--muted); }
.score h3 { margin-bottom: 6px; }

/* Gallery */
.gallery-wrap { position: relative; }
/* The carousel bleeds to the viewport edges while its first item lines up with the page content. */
.gallery { --inset: max(24px, calc(50vw - 570px)); display: grid; grid-auto-flow: column; grid-auto-columns: min(280px, 72vw); gap: 28px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--inset); padding: 12px var(--inset) 36px; margin: 0 calc(50% - 50vw); scrollbar-width: none; list-style: none; }
.gallery::-webkit-scrollbar { display: none; }
.gallery li { scroll-snap-align: start; }
main { overflow-x: clip; }
.gallery figure { margin: 0; }
.gallery figcaption { margin-top: 22px; }
.gallery figcaption strong { display: block; font-size: 1.15rem; line-height: 1.25; }
.gallery figcaption span { color: var(--muted); font-size: 0.98rem; }
.gallery-controls { display: flex; justify-content: flex-end; gap: 10px; margin-bottom: 12px; }
.round-button { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; transition: background 0.2s ease, transform 0.2s ease; }
.round-button:hover { transform: translateY(-1px); background: var(--accent-surface); }
.round-button svg { width: 20px; height: 20px; }
.no-js .gallery-controls { display: none; }

/* Features */
.features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.feature { display: grid; grid-template-columns: auto 1fr; gap: 18px; padding: 28px; border-radius: 28px; background: var(--surface); border: 1px solid var(--border); }
.feature .icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--accent-surface); color: var(--accent); }
.feature .icon svg { width: 26px; height: 26px; }
.feature p { color: var(--muted); margin: 0; }
.feature h3 { margin-bottom: 6px; }

/* FAQ */
.faq { display: grid; gap: 12px; max-width: 820px; margin-inline: auto; }
.faq details { border-radius: var(--radius-card); background: var(--surface); border: 1px solid var(--border); padding: 0 22px; }
.faq summary { list-style: none; cursor: pointer; padding: 20px 36px 20px 0; font-weight: 700; font-size: 1.08rem; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-size: 1.6rem; font-weight: 600; color: var(--accent); transition: transform 0.2s ease; }
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { color: var(--muted); padding-bottom: 20px; margin: 0; }

/* CTA band and footer */
.cta { color: #fff; text-align: center; background: radial-gradient(800px 400px at 50% 0%, #6457dc 0%, transparent 65%), linear-gradient(160deg, var(--brand), var(--brand-deep)); }
.cta h2 { max-width: 18ch; margin-inline: auto; }
.cta p { color: rgba(255, 255, 255, 0.8); }
.cta .hero-actions { justify-content: center; }
.site-footer { padding: 48px 0 56px; font-size: 0.95rem; color: var(--muted); }
.footer-grid { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 32px; }
.footer-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 1.1rem; }
.footer-brand img { width: 28px; height: 28px; border-radius: 8px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 24px; list-style: none; margin: 0; padding: 0; }
.footer-links a { color: var(--muted); text-decoration: none; font-weight: 600; }
.footer-links a:hover { color: var(--text); }
.legal { flex-basis: 100%; font-size: 0.82rem; margin: 6px 0 0; }

/* Long-form pages (privacy, support) */
.page-hero { color: #fff; background: linear-gradient(165deg, var(--brand) 0%, var(--brand-deep) 100%); margin-top: -68px; padding: calc(68px + clamp(48px, 8vw, 88px)) 0 clamp(48px, 7vw, 80px); }
.page-hero .lead { color: rgba(255, 255, 255, 0.82); }
.page-hero .eyebrow { color: var(--lavender); }
.page-hero h1 { font-size: clamp(2.4rem, 5.5vw, 3.8rem); }
.prose { max-width: 760px; margin-inline: auto; padding: clamp(48px, 7vw, 80px) 0; }
.prose h2 { font-size: clamp(1.5rem, 3vw, 1.9rem); margin-top: 1.8em; }
.prose h3 { margin-top: 1.4em; }
.prose ul { padding-left: 1.25em; }
.prose li { margin-bottom: 0.5em; }
.prose .summary { padding: 24px 26px; border-radius: var(--radius-card); background: var(--accent-surface); border: 1px solid var(--border); }
.prose .summary ul { margin: 0; }
.prose .meta { color: var(--muted); font-size: 0.95rem; }
.contact-card { display: grid; gap: 6px; padding: 28px; border-radius: 28px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); margin: 8px 0 32px; }
.contact-card a { font-size: 1.3rem; font-weight: 800; }
.not-found { min-height: 100vh; display: grid; place-items: center; text-align: center; color: #fff; background: linear-gradient(165deg, var(--brand) 0%, var(--brand-deep) 100%); padding: 96px 24px; }
.not-found p { color: rgba(255, 255, 255, 0.82); }
.not-found img { margin: 0 auto 28px; border-radius: 22px; }

/* Scroll reveal (only when JavaScript runs and motion is welcome). */
.js [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.js [data-reveal].is-visible { opacity: 1; transform: none; }

@media print {
  .js [data-reveal] { opacity: 1; transform: none; }
  .site-header, .gallery-controls, .hero-stage { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
}

@media (max-width: 1020px) {
  .hero .container { grid-template-columns: 1fr; min-height: 0; padding-block: 40px 24px; text-align: center; }
  .hero .lead { margin-inline: auto; }
  .hero-actions, .hero-meta { justify-content: center; }
  .hero-stage { height: 560px; max-width: 560px; width: 100%; margin-inline: auto; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .play-grid { grid-template-columns: 1fr; }
  .score-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav-links li:not(.nav-cta) { display: none; }
  .steps, .features { grid-template-columns: 1fr; }
  .hero-stage { height: 470px; }
  .hero-stage .phone.front { width: 220px; left: 6%; }
  .hero-stage .phone.back { width: 206px; right: 2%; }
  .photo-card.one { width: 260px; height: 340px; }
  .photo-card.two { width: 240px; height: 320px; }
  .feature { grid-template-columns: 1fr; }
}
