/* M4ART — landing (index.html): hero, listen, how it works, stories, about the AI, FAQ, CTA.
   Depends on tokens.css + base.css. Dark sections carry data-theme="dark" (brand section 18). */

/* ---------- Hero ---------- */
.hero { position: relative; overflow: clip; background: radial-gradient(90% 60% at 72% 58%, #2a2e29 0%, transparent 60%), var(--bg); }
.hero__grid { display: grid; grid-template-columns: 7fr 5fr; gap: var(--s-8) var(--col-gap); align-items: center; padding-block: var(--s-16) var(--s-24); min-height: calc(100svh - var(--header-h)); }
.hero__text { display: grid; gap: var(--s-6); }
.hero__title { font-family: var(--ff-serif); font-size: clamp(72px, 11.5vw, 168px); line-height: .9; letter-spacing: -.03em; }
.hero__title .line { display: block; overflow: hidden; padding-bottom: .04em; }
.hero__title .line > span { display: block; }
.hero__title .line--indent { padding-left: .9em; }
.hero__title .dot { color: var(--c-signal); }
.hero__lead { max-width: 44ch; color: var(--fg-muted); }
.hero .player { max-width: 600px; }
.hero__meta { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-6); padding-top: var(--s-4); border-top: 1px solid var(--line); font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--fg-muted); }
.hero__art { display: grid; gap: var(--s-3); justify-self: end; width: min(100%, 520px); }
.hero__scroll { position: absolute; left: var(--gutter); bottom: var(--s-8); display: inline-flex; align-items: center; gap: var(--s-3); font-size: var(--fs-eyebrow); font-weight: 600; letter-spacing: var(--ls-eyebrow); text-transform: uppercase; text-decoration: none; color: var(--fg-muted); }
.hero__scroll-line { position: relative; width: 48px; height: 1px; background: currentColor; overflow: hidden; }
.hero__scroll-line::after { content: ""; position: absolute; inset: 0; background: var(--c-signal); animation: slide 2.4s var(--ease) infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 60%, 100% { transform: translateX(100%); } }
@media (max-width: 1199px) {
  .hero__grid { grid-template-columns: 1fr; padding-block: var(--s-12); min-height: 0; }
  .hero__art { justify-self: start; width: min(100%, 460px); }
  .hero__scroll { display: none; }
}
@media (max-width: 767px) {
  .hero__grid { gap: var(--s-6); padding-block: var(--s-6) var(--s-12); }
  .hero__art { order: -1; width: 100%; }
  .hero__title { font-size: clamp(56px, 18vw, 72px); line-height: .95; }
  .hero__title .line--indent { padding-left: .45em; }
  .hero__lead { font-size: 17px; line-height: 26px; }
}

/* The artwork: image, camera corners that "find" the detail, found chip, credit line */
.art { position: relative; aspect-ratio: 4 / 5; border-radius: var(--r-visual); overflow: hidden; background: #202421; box-shadow: 0 60px 120px -40px rgba(0,0,0,.7), inset 0 0 0 1px rgba(245,243,237,.08); }
.art > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--focal, 50% 50%); }
.art__frame { position: absolute; left: var(--fx, 30%); top: var(--fy, 12%); width: var(--fw, 40%); height: var(--fh, 26%); color: var(--c-gallery); opacity: 0; transition: left 640ms var(--ease), top 640ms var(--ease), width 640ms var(--ease), height 640ms var(--ease), opacity var(--t-reveal); }
.art.is-finding .art__frame { opacity: 1; left: 6%; top: 6%; width: 88%; height: 88%; }
.art.is-found .art__frame { opacity: 1; }
.found { position: absolute; left: var(--s-6); right: var(--s-6); bottom: var(--s-6); display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--r-control); background: rgba(23,26,24,.78); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: var(--c-gallery); font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: 600; opacity: 0; transform: translateY(6px); transition: opacity var(--t-reveal), transform var(--t-reveal) var(--ease); }
.found .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-signal); border: 1px solid var(--c-ink); }
.art.is-found .found { opacity: 1; transform: none; }
.art__credit { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--s-4); font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--fg-muted); }
@media (max-width: 767px) {
  .art { aspect-ratio: 4 / 4.4; }
  .art > img { object-position: var(--focal-m, var(--focal, 50% 50%)); }
  .art__frame { left: var(--fxm, 28%); top: var(--fym, 10%); width: var(--fwm, 44%); height: var(--fhm, 30%); }
  .found { left: var(--s-4); right: var(--s-4); bottom: var(--s-4); }
}

/* Scan frame: four open corners, 2 px, no glow (brand section 14) */
.scan-frame { position: relative; }
.scan-frame::before, .scan-frame::after, .scan-frame i::before, .scan-frame i::after { content: ""; position: absolute; width: 24px; height: 24px; border: 2px solid currentColor; }
.scan-frame::before { left: 0; top: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 6px; }
.scan-frame::after { right: 0; top: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 6px; }
.scan-frame i::before { left: 0; bottom: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 6px; }
.scan-frame i::after { right: 0; bottom: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 6px; }

/* Entrance: title lines rise, blocks fade in (once, on load) */
@media (prefers-reduced-motion: no-preference) {
  .hero [data-enter] { opacity: 0; transform: translateY(16px); animation: enter var(--t-reveal) var(--ease) forwards; animation-delay: calc(var(--i, 0) * 100ms + 200ms); }
  .hero__title .line > span { transform: translateY(105%); animation: rise 640ms var(--ease) forwards; animation-delay: calc(var(--i, 0) * 120ms + 220ms); }
  @keyframes enter { to { opacity: 1; transform: none; } }
  @keyframes rise { to { transform: none; } }
}

/* ---------- 01 Listen: transcript + next story (components in story.css) ---------- */
.listen { display: grid; grid-template-columns: 7fr 5fr; gap: var(--s-8) var(--col-gap); align-items: start; }
@media (max-width: 1199px) { .listen { grid-template-columns: 1fr; } }

/* ---------- 02 How it works: sticky phone, scrolling steps ---------- */
.how__grid { display: grid; grid-template-columns: 5fr 7fr; gap: var(--col-gap); align-items: start; }
.how__sticky { position: sticky; top: calc(var(--header-h) + var(--s-8)); display: grid; justify-items: center; gap: var(--s-4); }
.how__step { display: grid; align-content: center; gap: var(--s-6); min-height: 56vh; padding: var(--s-12) 0 var(--s-12) clamp(0px, 6vw, 96px); border-top: 1px solid var(--line); opacity: .35; transition: opacity 480ms var(--ease); }
.how__step:first-child { border-top: 0; }
.how__step.is-live { opacity: 1; }
.how__title { font-family: var(--ff-serif); font-size: clamp(36px, 4.2vw, 56px); line-height: 1.05; letter-spacing: var(--ls-serif); }
.step__num { font-family: var(--ff-serif); font-size: clamp(72px, 8vw, 128px); line-height: .85; letter-spacing: -.03em; font-variant-numeric: lining-nums; }
.step__num::after { content: "."; color: var(--c-signal); }
.how__cta { justify-self: start; margin-top: var(--s-2); }
.phone-steps { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-2); }
.phone-steps button { min-height: 32px; padding: 0 12px; border-radius: var(--r-pill); border: 1px solid var(--line); font-size: var(--fs-eyebrow); font-weight: 600; letter-spacing: .04em; color: var(--fg-muted); transition: background-color var(--t-hover), color var(--t-hover), border-color var(--t-hover); }
.phone-steps button:hover { border-color: var(--fg); color: var(--fg); }
.phone-steps button[aria-pressed="true"] { background: var(--c-ink); border-color: var(--c-ink); color: var(--c-gallery); }
@media (max-width: 1199px) {
  .how__grid { grid-template-columns: 1fr; }
  .how__sticky { position: static; }
  .how__step { min-height: 0; padding: var(--s-8) 0; opacity: 1; }
}
@media (max-width: 767px) {
  .how__grid { gap: var(--s-8); }
  .how__step { padding: var(--s-6) 0; gap: var(--s-3); }
  .how__title { font-size: 30px; line-height: 1.08; }
  .step__num { font-size: 56px; line-height: .9; }
  .how__cta { width: 100%; }
  .phone-steps button { min-height: 44px; padding-inline: 14px; }
}

/* Demo phone (CSS-drawn; state via data-step) */
.phone { --pw: 320px; position: relative; width: var(--pw); aspect-ratio: 9 / 19; padding: 10px; border-radius: 44px; background: var(--c-ink); box-shadow: 0 40px 80px -32px rgba(23,26,24,.45), 0 0 0 1px rgba(23,26,24,.6), inset 0 0 0 2px #2a2e2a; }
.phone__screen { position: relative; width: 100%; height: 100%; display: grid; grid-template-rows: auto 1fr auto; border-radius: 36px; overflow: hidden; background: var(--c-dark-bg); color: var(--c-dark-text); font-size: 13px; line-height: 18px; }
.phone__notch { position: absolute; left: 50%; top: 10px; z-index: 5; width: 92px; height: 26px; transform: translateX(-50%); border-radius: 999px; background: var(--c-ink); }
.phone__bar { display: flex; justify-content: space-between; align-items: center; height: 46px; padding: 16px 22px 0; font-size: 12px; font-weight: 600; }
.phone__bar .sig { display: inline-flex; align-items: end; gap: 3px; }
.phone__bar .sig i { width: 3px; border-radius: 1px; background: currentColor; }
.phone__bar .sig i:nth-child(1) { height: 5px; } .phone__bar .sig i:nth-child(2) { height: 8px; } .phone__bar .sig i:nth-child(3) { height: 11px; } .phone__bar .sig i:nth-child(4) { height: 14px; }
.phone__cam { position: relative; overflow: hidden; background: #2a2d29; }
.phone__cam > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--focal, 50% 30%); }
.phone__cam .scan-frame { position: absolute; left: 50%; top: 46%; width: 62%; aspect-ratio: 4 / 5; transform: translate(-50%, -50%); color: var(--c-gallery); transition: opacity var(--t-reveal); }
.phone__cam .scan-line { position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--c-signal); opacity: 0; }
.phone[data-step="search"] .scan-line { opacity: .9; animation: scan 1.4s ease-in-out infinite; }
@keyframes scan { 0%, 100% { top: 4%; } 50% { top: 94%; } }
.phone[data-step="match"] .scan-frame, .phone[data-step="prepare"] .scan-frame, .phone[data-step="play"] .scan-frame { opacity: .35; }
.cam-label { position: absolute; left: 16px; right: 16px; bottom: 16px; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: rgba(23,26,24,.72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transform: translateY(6px); transition: opacity var(--t-reveal), transform var(--t-reveal) var(--ease); }
.cam-label .icon { width: 18px; height: 18px; }
.spinner { width: 14px; height: 14px; flex: none; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 1s linear infinite; }
.phone[data-step="scan"] .cam-label[data-for="scan"], .phone[data-step="search"] .cam-label[data-for="search"], .phone[data-step="match"] .cam-label[data-for="match"], .phone[data-step="prepare"] .cam-label[data-for="prepare"] { opacity: 1; transform: none; }
.phone__sheet { display: grid; gap: 10px; min-height: 132px; padding: 14px 16px 22px; border-top: 1px solid #33372f; background: var(--c-dark-surface); }
.phone__sheet [data-for] { display: none; }
.phone[data-step="scan"] [data-for="scan"], .phone[data-step="search"] [data-for="search"], .phone[data-step="match"] [data-for="match"], .phone[data-step="prepare"] [data-for="prepare"], .phone[data-step="play"] [data-for="play"] { display: grid; gap: 10px; animation: fade-in var(--t-reveal) var(--ease) both; }
.phone__sheet .title { font-family: var(--ff-serif); font-size: 20px; line-height: 24px; font-weight: 500; font-variant-numeric: lining-nums; }
.phone__sheet .meta { font-size: 12px; color: var(--c-dark-secondary); }
.phone__sheet .row { display: flex; align-items: center; gap: 12px; }
.phone__sheet .row > div { flex: 1; display: grid; gap: 6px; }
.phone__sheet .pplay { width: 48px; height: 48px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--c-ink); background: var(--c-signal); color: var(--c-ink); }
.phone__sheet .pplay .icon { width: 18px; height: 18px; }
.phone__sheet .pbtn { flex: 1; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; border: 1px solid var(--c-dark-secondary); font-weight: 600; }
.phone__sheet .pbtn--primary { background: var(--c-signal); color: var(--c-ink); border-color: var(--c-ink); }
.phone__sheet .wave { height: 28px; }
.phone__sheet .wave i { background: var(--c-dark-secondary); }
.phone__sheet .time { font-size: 12px; color: var(--c-dark-secondary); }
.phone[data-step="play"] .wave i { animation: bar 900ms ease-in-out infinite alternate; animation-delay: calc(var(--d, 0) * 1ms); }
@keyframes bar { from { height: var(--h); } to { height: calc(var(--h) * .45); } }
@media (max-width: 767px) { .phone { --pw: min(260px, 72vw); } }

/* ---------- 03 Stories ---------- */
.filters { margin-bottom: var(--s-8); }
.stories { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-12) var(--col-gap); align-items: stretch; }
.story { display: grid; grid-template-rows: auto auto auto 1fr auto auto; gap: var(--s-3); height: 100%; }
.story__media { aspect-ratio: 4 / 5; border-radius: var(--r-card); overflow: hidden; background: var(--bg-muted); }
.story__media img { width: 100%; height: 100%; object-fit: cover; object-position: var(--focal, 50% 30%); }
.story__kicker { margin-top: var(--s-2); letter-spacing: var(--ls-eyebrow); }
.story__title { font-family: var(--ff-serif); font-size: clamp(28px, 2.6vw, 36px); line-height: 1.1; letter-spacing: var(--ls-serif); min-height: 2.2em; }
.story__meta { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--fg-muted); }
.story .btn, .story__soon { justify-self: start; align-self: end; margin-top: var(--s-2); }
.story__soon { display: inline-flex; align-items: center; min-height: var(--control-h); padding: 0 var(--s-4); border-radius: var(--r-control); border: 1px dashed var(--line); color: var(--fg-muted); font-weight: 600; }
.stories + .facts { margin-top: var(--s-12); }
@media (max-width: 1199px) { .stories { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) {
  .filters { margin-bottom: var(--s-4); }
  .stories { grid-template-columns: 1fr; gap: 0; border-top: 1px solid var(--line); }
  .story { grid-template-columns: 112px 1fr; grid-template-rows: auto; grid-template-areas: "media kicker" "media title" "media meta" "body body" "cta cta"; column-gap: var(--s-4); row-gap: var(--s-1); height: auto; padding: var(--s-4) 0; border-bottom: 1px solid var(--line); }
  .story__media { grid-area: media; border-radius: var(--r-control); }
  .story__kicker { grid-area: kicker; margin-top: 0; }
  .story__title { grid-area: title; min-height: 0; font-size: 22px; line-height: 1.12; }
  .story__meta { grid-area: meta; }
  .story__text { grid-area: body; margin-top: var(--s-2); font-size: 15px; line-height: 23px; }
  .story .btn, .story__soon { grid-area: cta; width: 100%; justify-content: center; margin-top: var(--s-3); }
  .stories + .facts { margin-top: var(--s-8); }
}

/* ---------- 04 About the AI ---------- */
.ai { display: grid; grid-template-columns: 7fr 5fr; gap: var(--s-8) var(--col-gap); align-items: start; }
.ai__item { display: grid; grid-template-columns: 28px 1fr; gap: var(--s-4); padding: 20px 0; border-top: 1px solid var(--line); }
.ai__item:last-child { border-bottom: 1px solid var(--line); }
.ai__item strong { display: block; margin-bottom: 2px; font-weight: 600; }
.states { position: sticky; top: calc(var(--header-h) + var(--s-6)); display: grid; gap: var(--s-3); }
.state { display: grid; grid-template-columns: 24px 1fr auto; gap: var(--s-3); align-items: center; padding: var(--s-4); border-radius: var(--r-control); border: 1px solid var(--line); background: var(--bg-elev); }
.state { transition: border-color var(--t-reveal), background-color var(--t-reveal), transform var(--t-reveal) var(--ease); }
.state.is-live { border-color: var(--c-ink); transform: translateX(8px); }
.state--ai.is-live { background: var(--accent-soft); }
.state--error { border-color: color-mix(in srgb, var(--c-error) 50%, var(--line)); }
.state--error .state__ind { color: var(--c-error); }
.state__ind { width: 24px; height: 24px; display: grid; place-items: center; }
.state__ind .icon { width: 20px; height: 20px; }
.state__key { letter-spacing: var(--ls-eyebrow); }
@media (max-width: 1199px) { .ai { grid-template-columns: 1fr; } .states { position: static; } }

/* ---------- 05 FAQ ---------- */
.faq { max-width: 860px; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: var(--s-4); min-height: var(--control-h); padding: 20px 0; cursor: pointer; font-family: var(--ff-serif); font-size: 26px; line-height: 32px; font-weight: 500; letter-spacing: var(--ls-serif); }
.faq summary .icon { transition: transform var(--t-reveal) var(--ease); }
.faq details[open] summary .icon { transform: rotate(45deg); }
.faq__body { max-width: var(--measure); padding: 0 0 var(--s-6); color: var(--fg-muted); animation: fade-in var(--t-reveal) var(--ease) both; }
@media (max-width: 767px) { .faq summary { font-size: 20px; line-height: 26px; padding-block: var(--s-4); } }

/* ---------- CTA: the one fully Signal surface ---------- */
.cta { position: relative; overflow: clip; padding-block: clamp(56px, 7vw, 88px); background: var(--c-signal); color: var(--c-ink); }
.cta__inner { display: grid; grid-template-columns: 7fr 5fr; gap: var(--s-8) var(--col-gap); align-items: center; }
.cta__copy { display: grid; gap: var(--s-4); justify-items: start; }
.cta__copy .t-eyebrow { color: var(--c-ink); }
.cta__copy .stores { margin-top: var(--s-2); }
.cta__title { font-family: var(--ff-serif); font-size: clamp(56px, 6.4vw, 96px); line-height: .95; letter-spacing: -.03em; max-width: 10ch; }
.cta__phone { display: grid; justify-items: center; }
.phone--cta { --pw: 260px; transform: rotate(-4deg); }
@media (max-width: 1023px) { .cta__inner { grid-template-columns: 1fr; } .cta__phone { display: none; } }
@media (max-width: 767px) {
  .cta { padding-block: var(--s-12); }
  .cta__title { font-size: clamp(40px, 12vw, 52px); max-width: none; }
  .cta__copy .stores { width: 100%; }
}

/* Narrow phones */
@media (max-width: 380px) {
  .hero__title { font-size: 56px; }
  .cta__title { font-size: 40px; }
  .t-h2 { font-size: 32px; line-height: 36px; }
}
