/* ============================================================
   StoryChef Media v3 — Cinematic Chrome
   Shared styles for nav, top strip, footer, film grain, and
   common section helpers. Imported by every page in the
   Cinematic redesign.
   ============================================================ */

@import url('./shared.css');

:root {
  --tc-strip-h: 36px;
  --container: 1280px;
}

/* ===== Top timecode strip ===== */
.tc-strip {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--tc-strip-h);
  background: transparent;
  border-bottom: none;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.78);
  text-shadow: 0 1px 8px rgba(0,0,0,0.85), 0 1px 2px rgba(0,0,0,0.6);
  z-index: 110;
  pointer-events: none;
}
.tc-strip .left, .tc-strip .right { pointer-events: auto; }
/* On non-hero pages the strip sits on solid bg — add a subtle backdrop so text stays readable */
body:not(.has-hero) .tc-strip {
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(35,35,35,0.6);
  text-shadow: none;
  color: var(--fg-3);
}
.tc-strip .left, .tc-strip .right { display: flex; gap: 28px; align-items: center; }
.tc-strip .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--sc-red);
  display: inline-block; margin-right: 8px;
}

/* ===== Sticky nav ===== */
.nav {
  position: fixed; top: var(--tc-strip-h); left: 0; right: 0; z-index: 100;
  background: transparent;
  transition: background 240ms ease, backdrop-filter 240ms ease, border-color 240ms ease;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(10, 10, 10, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
}
/* On internal pages the nav lives on top of solid color, so make scrolled state the default */
.nav.always-solid {
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 76px; max-width: var(--container); margin: 0 auto; padding: 0 32px;
}
.nav-logo img { height: 32px; width: auto; }
.nav-links {
  display: flex; align-items: center; gap: 36px;
  font-size: 14px; font-weight: 500;
}
.nav-links a {
  color: var(--fg-2);
  transition: color 200ms;
  white-space: nowrap;
  position: relative;
}
.nav-links a:hover { color: var(--fg-1); }
.nav-links a.active { color: var(--fg-1); }
.nav-links a.active::after {
  content: ''; position: absolute;
  left: 0; right: 0; bottom: -22px;
  height: 2px; background: var(--sc-red);
}
.nav-cta {
  padding: 10px 18px; border-radius: 6px;
  background: var(--sc-red); color: #fff; font-weight: 600;
  transition: all 200ms;
  white-space: nowrap;
}
.nav-cta:hover { background: var(--sc-red-hover); transform: translateY(-1px); color: #fff; }
.nav-cta::after { display: none !important; }

/* ===== Mobile hamburger menu (injected by chrome.js) ===== */
.nav-hamburger {
  display: none;
  width: 44px; height: 44px;
  background: transparent; border: none;
  color: var(--fg-1); cursor: pointer;
  align-items: center; justify-content: center;
  padding: 0;
  margin-right: -10px;
  border-radius: 8px;
  transition: background 200ms;
}
.nav-hamburger:hover { background: rgba(255,255,255,0.04); }
.nav-hamburger svg { width: 22px; height: 22px; }

.nav-drawer {
  position: fixed; top: 0; right: 0;
  width: 100%; max-width: 380px;
  height: 100vh;
  height: 100dvh;
  background: rgba(10, 10, 10, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-left: 1px solid var(--border);
  z-index: 200;
  transform: translateX(100%);
  transition: transform 320ms var(--ease-out);
  display: flex; flex-direction: column;
  padding: 88px 32px 40px;
  overflow-y: auto;
}
.nav-drawer.is-open { transform: translateX(0); }
.nav-drawer-close {
  position: absolute; top: 22px; right: 22px;
  width: 44px; height: 44px;
  background: transparent; border: none;
  color: var(--fg-1); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  transition: background 200ms;
}
.nav-drawer-close:hover { background: rgba(255,255,255,0.06); }
.nav-drawer-tag {
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--sc-red);
  margin-bottom: 28px;
  display: flex; align-items: center; gap: 12px;
}
.nav-drawer-tag::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.nav-drawer-list {
  display: flex; flex-direction: column;
  flex: 1;
}
.nav-drawer-list a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 0;
  font-family: var(--font-display);
  font-size: 30px; font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--fg-1);
  border-bottom: 1px solid var(--border);
  transition: color 200ms, padding-left 280ms var(--ease-out);
}
.nav-drawer-list a:hover { color: var(--sc-red); padding-left: 6px; }
.nav-drawer-list a .num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--fg-3);
  font-weight: 500;
}
.nav-drawer-list a.is-cta {
  margin-top: 28px;
  border: none;
  background: var(--sc-red);
  color: #fff;
  border-radius: 10px;
  padding: 20px 24px;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0;
}
.nav-drawer-list a.is-cta .num { display: none; }
.nav-drawer-list a.is-cta:hover { padding-left: 24px; background: var(--sc-red-hover); }
.nav-drawer-footer {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-3);
  display: flex; gap: 18px; flex-wrap: wrap;
}
.nav-drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms;
}
.nav-drawer-backdrop.is-on { opacity: 1; pointer-events: auto; }
body.drawer-open { overflow: hidden; }

/* ===== Layout helpers ===== */
.container { max-width: var(--container); margin: 0 auto; padding: 0 32px; }

/* Page padding offset (TC strip + nav) */
.page-top-offset { padding-top: calc(var(--tc-strip-h) + 76px); }

/* ===== Eyebrow + section title patterns ===== */
.eyebrow {
  display: inline-block;
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--sc-red);
  margin-bottom: 24px;
}
.eyebrow::before {
  content: ''; display: inline-block;
  width: 24px; height: 1px; background: var(--sc-red);
  vertical-align: middle; margin-right: 12px; margin-bottom: 3px;
}
.section-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(40px, 5vw, 64px); line-height: 1.02;
  letter-spacing: -0.025em;
  color: var(--fg-1);
  max-width: 18ch;
  margin-bottom: 28px;
}
.section-intro {
  font-size: clamp(17px, 1.4vw, 20px);
  color: var(--fg-2);
  max-width: 60ch; line-height: 1.55;
  margin-bottom: 56px;
}

/* ===== Page hero (for internal pages — subtler than the homepage hero) ===== */
.page-hero {
  padding: calc(var(--tc-strip-h) + 76px + 90px) 0 90px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.page-hero::before {
  content: ''; position: absolute; top: 0; left: 50%;
  width: 1000px; height: 700px;
  background: radial-gradient(ellipse at top, rgba(204,51,51,0.16) 0%, transparent 60%);
  transform: translateX(-50%);
  pointer-events: none;
}
.page-hero-inner {
  position: relative; z-index: 1;
  max-width: 900px;
}
.page-hero h1 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(44px, 6vw, 88px);
  line-height: 0.98;
  letter-spacing: -0.03em;
  color: var(--fg-1);
  margin-bottom: 24px;
  max-width: 18ch;
}
.page-hero h1 .accent { color: var(--sc-red); }
.page-hero p.lead {
  font-size: clamp(18px, 1.5vw, 22px);
  color: var(--fg-2);
  max-width: 56ch;
  line-height: 1.5;
}
.page-hero .meta-row {
  margin-top: 36px;
  display: flex; gap: 32px;
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--fg-3);
}

/* ===== Long-form body content ===== */
.body-content {
  max-width: 720px; margin: 0 auto;
}
.body-content p {
  color: var(--fg-2);
  font-size: 18px;
  line-height: 1.72;
  margin-bottom: 24px;
}
.body-content p strong { color: var(--fg-1); font-weight: 600; }
.body-content h2 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(28px, 3.2vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--fg-1);
  margin: 56px 0 16px;
}
.body-content h3 {
  font-family: var(--font-display); font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.015em;
  color: var(--fg-1);
  margin: 32px 0 12px;
}

/* ===== Footer CTA (used at the bottom of every page) ===== */
.footer-cta {
  padding: 140px 0 120px;
  position: relative;
  overflow: hidden;
  text-align: center;
  border-top: 1px solid var(--border);
}
.footer-cta::before {
  content: '';
  position: absolute; top: 50%; left: 50%;
  width: 1200px; height: 1200px;
  background: radial-gradient(circle, rgba(204,51,51,0.20) 0%, transparent 55%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: sc-pulse 10s ease-in-out infinite;
}
.footer-cta-inner { position: relative; z-index: 1; max-width: 720px; margin: 0 auto; }
.footer-cta h2 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(40px, 5.4vw, 72px);
  line-height: 0.98; letter-spacing: -0.03em;
  margin: 16px 0 24px;
  background: linear-gradient(180deg, #ffffff 0%, #c4c4c4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  max-width: 16ch; margin-left: auto; margin-right: auto;
}
.footer-cta h2 .accent { color: var(--sc-red); -webkit-text-fill-color: var(--sc-red); }
.footer-cta p {
  font-size: 18px; color: rgba(255,255,255,0.7);
  max-width: 52ch; margin: 0 auto 36px; line-height: 1.5;
}

/* ===== Footer ===== */
footer {
  border-top: 1px solid var(--border);
  padding: 80px 0 32px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 56px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--border);
}
.footer-brand img {
  height: 30px;
  width: auto;
  margin-bottom: 20px;
  display: block;
}
.footer-tagline {
  color: var(--fg-2);
  font-size: 14px;
  line-height: 1.55;
  max-width: 36ch;
  margin-bottom: 18px;
}
.footer-brand .footer-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: 18px;
}
.footer-col a {
  display: block;
  color: var(--fg-2);
  font-size: 14px;
  line-height: 1.4;
  padding: 6px 0;
  transition: color 200ms;
}
.footer-col a:hover {
  color: var(--sc-red);
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 28px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-3);
  gap: 24px;
  flex-wrap: wrap;
}
.footer-bottom a {
  color: var(--fg-3);
  transition: color 200ms;
}
.footer-bottom a:hover {
  color: var(--fg-1);
}
/* Legacy fallback for any pages that still use .footer-meta inline */
.footer-meta {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--fg-3);
}

/* ===== Video modal ===== */
.video-modal {
  position: fixed; inset: 0; z-index: 1000;
  display: none; align-items: center; justify-content: center;
  padding: 24px;
}
.video-modal.is-open { display: flex; animation: sc-fade-in 0.2s ease; }
@keyframes sc-fade-in { from { opacity: 0; } to { opacity: 1; } }
.video-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
}
.video-modal-content {
  position: relative; z-index: 1;
  width: 100%; max-width: 1100px;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 12px; overflow: hidden;
}
.video-modal-close {
  position: absolute; top: -44px; right: -4px;
  background: transparent; border: 0;
  color: #fff; font-size: 32px; line-height: 1;
  cursor: pointer; padding: 8px 12px;
  opacity: 0.7; transition: opacity 200ms;
  font-family: inherit;
}
.video-modal-close:hover { opacity: 1; }
.video-modal-iframe-wrap { position: absolute; inset: 0; }
.video-modal-iframe-wrap iframe { width: 100%; height: 100%; border: 0; }

/* ===== Film grain overlay ===== */
.grain {
  position: fixed; inset: 0;
  z-index: 2000;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.6 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: 0.07;
  mix-blend-mode: overlay;
  animation: sc-grain 0.7s steps(6) infinite;
}
@keyframes sc-grain {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-3%, -2%); }
  20% { transform: translate(2%, 4%); }
  30% { transform: translate(-4%, 3%); }
  40% { transform: translate(3%, -5%); }
  50% { transform: translate(-2%, 4%); }
  60% { transform: translate(4%, 2%); }
  70% { transform: translate(-3%, -3%); }
  80% { transform: translate(2%, -4%); }
  90% { transform: translate(-4%, 2%); }
}
body.no-grain .grain { display: none; }
@media (prefers-reduced-motion: reduce) { .grain { animation: none; } }

/* ===== Density modes ===== */
body.density-compact section { padding: 100px 0; }
body.density-compact .footer-cta { padding: 100px 0 90px; }

/* ===== Motion modes ===== */
body.motion-off .pulse,
body.motion-off .blink,
body.motion-off .marquee-track,
body.motion-off .footer-cta::before {
  animation: none !important;
}
body.motion-off .reveal { opacity: 1; transform: none; transition: none; }
body.motion-subtle .marquee { --marquee-duration: 120s; }
body.motion-subtle .pulse { animation-duration: 14s; }

/* ===== Cited industry-stat callout (vertical pages) ===== */
.cited-stat {
  margin: 40px 0;
  padding: 32px 36px;
  background: var(--bg-card);
  border-left: 3px solid var(--sc-red);
  border-radius: 0 12px 12px 0;
}
.cited-stat-figure {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(44px, 5vw, 64px);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--fg-1);
  margin-bottom: 16px;
}
.cited-stat-figure .accent { color: var(--sc-red); }
.cited-stat-body {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(19px, 1.8vw, 22px);
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: var(--fg-1);
  margin-bottom: 16px;
}
.cited-stat-cite {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-3);
}

/* ===== FAQ (vertical + get-started pages) ===== */
.faq { padding: 120px 0; border-bottom: 1px solid var(--border); }
.faq-list { margin-top: 60px; border-top: 1px solid var(--border); }
.faq-item {
  border-bottom: 1px solid var(--border);
  transition: padding 300ms;
}
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 28px 0;
  display: grid; grid-template-columns: 40px 1fr 28px;
  gap: 24px; align-items: center;
  transition: padding-left 400ms var(--ease-out);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item:hover summary { padding-left: 24px; }
.faq-item .q-no {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.22em; color: var(--fg-3);
}
.faq-item summary h3 {
  font-family: var(--font-display); font-weight: 600;
  font-size: 22px; letter-spacing: -0.015em;
  color: var(--fg-1); transition: color 200ms;
}
.faq-item:hover summary h3 { color: var(--sc-red); }
.faq-item .chev {
  color: var(--fg-3);
  transition: transform 280ms var(--ease-out), color 200ms;
}
.faq-item[open] .chev { transform: rotate(180deg); color: var(--sc-red); }
.faq-item .answer {
  padding: 4px 0 32px 64px;
  color: var(--fg-2); font-size: 16px; line-height: 1.65; max-width: 64ch;
}
@media (max-width: 900px) {
  .faq-item summary { grid-template-columns: 32px 1fr 24px; gap: 16px; }
  .faq-item .answer { padding-left: 48px; }
}

/* ===== Mobile ===== */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  section { padding: 72px 0; }
  .page-hero { padding: calc(var(--tc-strip-h) + 76px + 48px) 0 56px; }
  .tc-strip .left span:last-child, .tc-strip .right span:first-child { display: none; }

  /* iOS Safari backdrop-filter is unreliable during scroll — force fully
     opaque chrome on mobile so body content can't bleed through. */
  body:not(.has-hero) .tc-strip {
    background: #0a0a0a;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .nav.always-solid,
  .nav.scrolled {
    background: #0a0a0a;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}
@media (max-width: 600px) {
  .tc-strip { padding: 0 16px; font-size: 9px; letter-spacing: 0.14em; }
  .tc-strip .left, .tc-strip .right { gap: 14px; }
  .nav-inner { padding: 0 20px; height: 64px; }
  .nav-logo img { height: 26px; }
  .container { padding: 0 20px; }
  section { padding: 64px 0; }
  .footer-cta { padding: 96px 0 88px; }
  .nav-drawer { padding: 80px 24px 32px; }
  .nav-drawer-list a { font-size: 26px; padding: 20px 0; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 20px; }
  /* Footer collapses to 2 columns then 1 on small screens */
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px 32px; padding-bottom: 36px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 10px; padding-top: 24px; }
}
@media (max-width: 540px) {
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
}

/* Touch device tap states (no hover) */
@media (hover: none) and (pointer: coarse) {
  .nav-links a.active::after { bottom: -18px; }
  /* Replace hover lifts with subtle press scales */
  .work-tile, .vcard, .scard, .blog-card, .vertical-card { transition: transform 200ms var(--ease-out), border-color 300ms; }
  .work-tile:active, .vcard:active, .scard:active { transform: scale(0.99); border-color: var(--sc-red); }
  /* Always-on result reveal on work tiles for touch */
  .work-tile .result, .work-tile .line { opacity: 1; transform: none; max-height: none; }
}
