/* CFLOWS marketing pages: shared foundation (home + explore).
   Light first; dark uses the signed-in hub's warm glass palette ("C · Screening room"). */
:root {
  color-scheme: light;
  --bg: #FBFAF8; --bg-2: #F3F0EC; --bg-3: #ECE7E1;
  --surface: #FFFFFF; --glass: rgba(255,255,255,0.72); --glass-strong: rgba(255,255,255,0.88);
  --border: rgba(18,17,19,0.08); --border-strong: rgba(18,17,19,0.14);
  --text: #121113; --text-2: #5A544E; --text-3: #6F6861;
  --glow: rgba(255,190,130,0.34); --glow-2: rgba(255,214,168,0.20);
  --shadow-1: 0 1px 2px rgba(18,17,19,0.05), 0 8px 24px rgba(18,17,19,0.06);
  --shadow-2: 0 2px 6px rgba(18,17,19,0.06), 0 24px 60px rgba(18,17,19,0.12);
  --primary-bg: #121113; --primary-fg: #FBFAF8; --primary-hover: #2A2729;
  --secondary-bg: rgba(18,17,19,0.06); --secondary-hover: rgba(18,17,19,0.10);
  --link: #0066CC;
  --film: #0A84FF; --boards: #30B0C7; --cine: #FF9F0A; --script: #BF5AF2; --creators: #FF375F;
  --film-ink: #0066CC; --boards-ink: #0E7C8C; --cine-ink: #A85800; --script-ink: #8A3FB8; --creators-ink: #C81E4A;
  --warm: #C77A1E; --sunset: #E07A1F;
  --font: Inter, -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
  --display: 'Inter Tight', Inter, -apple-system, 'SF Pro Display', system-ui, sans-serif;
  --r-sm: 10px; --r-md: 16px; --r-lg: 24px; --r-xl: 32px;
  --ease: var(--cf-ease-expressive); /* same curve; showcase reveals keep using it, controls use --cf-ease */
  --container: 1200px;
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121113; --bg-2: #18161A; --bg-3: #1F1C20;
  --surface: #1B191C; --glass: rgba(255,255,255,0.06); --glass-strong: rgba(30,27,31,0.86);
  --border: rgba(255,255,255,0.09); --border-strong: rgba(255,255,255,0.16);
  --text: #F5F2EE; --text-2: #ABA5A0; --text-3: #9A948E;
  --glow: rgba(255,214,168,0.17); --glow-2: rgba(255,196,140,0.08);
  --shadow-1: 0 1px 2px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.3);
  --shadow-2: 0 2px 6px rgba(0,0,0,0.35), 0 30px 80px rgba(0,0,0,0.5);
  --primary-bg: #F5F2EE; --primary-fg: #121113; --primary-hover: #FFFFFF;
  --secondary-bg: rgba(255,255,255,0.09); --secondary-hover: rgba(255,255,255,0.14);
  --link: #5AB0FF;
  --film-ink: #5AB0FF; --boards-ink: #64D2FF; --cine-ink: #FFB340; --script-ink: #D69CF7; --creators-ink: #FF7A96;
  --warm: #FFC46B; --sunset: #FFB066;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.5 var(--font); -webkit-font-smoothing: antialiased; transition: background-color .4s var(--ease), color .4s var(--ease); overflow-x: hidden; }
img { display: block; max-width: 100%; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--film); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3, h4 { margin: 0; font-family: var(--display); letter-spacing: -0.03em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Layout */
.container { width: min(var(--container), calc(100% - 48px)); margin: 0 auto; }
.section { padding: clamp(80px, 12vw, 160px) 0 0; }
.display { font-size: clamp(48px, 8.4vw, 120px); line-height: .96; font-weight: 800; letter-spacing: -0.05em; }
.h2 { font-size: clamp(36px, 5.2vw, 72px); line-height: 1.02; font-weight: 800; letter-spacing: -0.045em; }
.h3 { font-size: clamp(24px, 2.4vw, 32px); line-height: 1.12; font-weight: 700; }
.lede { font-size: clamp(19px, 1.7vw, 23px); line-height: 1.45; color: var(--text-2); max-width: 640px; }
.muted { color: var(--text-2); }
.fine { font-size: 13px; color: var(--text-3); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: var(--text-2); }
.eyebrow .dot { width: 8px; height: 8px; border-radius: 4px; background: currentColor; }
.ink-film { color: var(--film-ink); } .ink-boards { color: var(--boards-ink); } .ink-cine { color: var(--cine-ink); }
.ink-script { color: var(--script-ink); } .ink-creators { color: var(--creators-ink); }
.soft { color: var(--text-3); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 24px; border-radius: 980px; border: 0; font: 600 16px/1 var(--font); cursor: pointer; white-space: nowrap; text-decoration: none !important; transition: transform var(--cf-dur-4) var(--cf-ease), background-color var(--cf-dur-4) var(--cf-ease), box-shadow var(--cf-dur-4) var(--cf-ease); }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary-bg); color: var(--primary-fg); box-shadow: var(--shadow-1); }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-secondary { background: var(--secondary-bg); color: var(--text); }
.btn-secondary:hover { background: var(--secondary-hover); }
.btn-sm { min-height: 36px; padding: 0 16px; font-size: 14px; }
.btn-link { color: var(--link); font-weight: 600; font-size: 17px; padding: 12px 0; display: inline-flex; align-items: center; gap: 4px; }
.btn-link .arrow { transition: transform var(--cf-dur-4) var(--cf-ease); }
.btn-link:hover .arrow { transform: translateX(3px); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 980px; font-size: 13px; font-weight: 600; color: var(--text-2); background: var(--secondary-bg); white-space: nowrap; }

/* Surfaces */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.glass { background: var(--glass); border: 1px solid var(--border); backdrop-filter: blur(24px) saturate(150%); -webkit-backdrop-filter: blur(24px) saturate(150%); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .glass { background: var(--glass-strong); } }
.frame { border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--border-strong); box-shadow: var(--shadow-2); background: var(--bg-3); }
.app-tile { width: 32px; height: 32px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; flex: none; color: #fff; }
.app-tile svg { width: 17px; height: 17px; }
.bg-film { background: var(--film); } .bg-boards { background: var(--boards); } .bg-cine { background: var(--cine); }
.bg-script { background: var(--script); } .bg-creators { background: var(--creators); }

/* Page glow: the signed-in hub's projector light, top-left */
.glow { position: absolute; pointer-events: none; inset: 0 0 auto 0; height: 900px; background: radial-gradient(1100px 760px at -8% -12%, var(--glow) 0%, var(--glow-2) 40%, transparent 70%); z-index: 0; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; height: 60px; transition: background-color var(--cf-dur-5) var(--cf-ease), box-shadow var(--cf-dur-5) var(--cf-ease); }
.site-header::before { content: ""; position: absolute; inset: 0; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); opacity: 0; transition: opacity var(--cf-dur-5) var(--cf-ease); border-bottom: 1px solid var(--border); }
.site-header.scrolled::before { opacity: 1; }
.site-header .bar { position: relative; height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.wordmark { color: var(--text); font: 800 19px/1 var(--display); letter-spacing: 0.06em; text-decoration: none !important; display: inline-flex; align-items: baseline; gap: 8px; }
.wordmark small { font: 500 12px var(--font); letter-spacing: 0; color: var(--text-3); }
.nav { display: flex; gap: 28px; font-size: 14px; }
.nav a { color: var(--text-2); text-decoration: none; padding: 8px 0; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }
.nav a[aria-current="page"] { font-weight: 600; }
.header-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn { width: 40px; height: 40px; border-radius: 20px; border: 0; background: transparent; color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: background-color var(--cf-dur-3) var(--cf-ease); }
.icon-btn:hover { background: var(--secondary-bg); }
.icon-btn svg { width: 19px; height: 19px; }
.theme-toggle .sun { display: none; } [data-theme="dark"] .theme-toggle .sun { display: block; } [data-theme="dark"] .theme-toggle .moon { display: none; }
.signin { color: var(--text); font-size: 14px; font-weight: 500; padding: 10px 12px; }
@media (max-width: 820px) { .nav { display: none; } .signin { display: none; } }

/* Footer */
.site-footer { margin-top: clamp(80px, 12vw, 140px); border-top: 1px solid var(--border); }
.site-footer .bar { padding: 28px 0 40px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; font-size: 13px; color: var(--text-3); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0 20px; }
.site-footer nav a { color: var(--text-2); display: inline-flex; align-items: center; min-height: 44px; }

/* Reveal (base.js animates; without JS or with reduced motion everything is visible) */
.js [data-reveal] { opacity: 0; transform: translateY(24px); }
@media (prefers-reduced-motion: reduce) { .js [data-reveal] { opacity: 1; transform: none; } }

/* Preview switcher (review only, not part of the real site) */
.preview-switch { position: fixed; left: 16px; bottom: 16px; z-index: 999; display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(18,17,19,.9); border: 1px solid rgba(255,255,255,.14); font: 600 13px var(--font); }
.preview-switch a { padding: 9px 14px; border-radius: 999px; color: #F5F2EE; text-decoration: none; }
.preview-switch a[aria-current="page"] { background: #F5F2EE; color: #121113; }
@media (max-width: 480px) { .wordmark small { display: none; } }

/* Base motion pair, same values as app/globals.css: --cf-dur / --cf-ease (hover, press, colour changes). */
:root { --cf-dur: 200ms; --cf-ease: cubic-bezier(.2, .8, .2, 1); }
@media (prefers-reduced-motion: reduce) { :root { --cf-dur: 0ms; } }
/* ── CFLOWS motion tokens (docs/MOTION.md section 3). Identical in every app; tests/motion-tokens.test.ts fails if they drift. ── */
:root {
  /* Durations */
  --cf-dur-1: 100ms;   /* hover, press, toggle, menu exit */
  --cf-dur-2: 150ms;   /* tooltip, menu/popover enter, content fade, crossfade */
  --cf-dur-3: 200ms;   /* = --cf-dur. Tabs indicator, accordion, sidebar, modal exit, list moves */
  --cf-dur-4: 250ms;   /* sheet/drawer exit, container collapse (calm alternative A: modal/toast enter) */
  --cf-dur-5: 300ms;   /* calm alternative A: drawer/sheet enter, container expand */
  --cf-dur-expand: var(--cf-dur-spring);   /* 380ms spring open */
  --cf-dur-collapse: var(--cf-dur-4);      /* 250ms tween close */
  /* Easing */
  --cf-ease-standard: cubic-bezier(0.2, 0, 0, 1);       /* moves that stay on screen (M3 Standard) */
  --cf-ease-enter:    cubic-bezier(0.05, 0.7, 0.1, 1);  /* arriving (M3 Emphasized decelerate) */
  --cf-ease-exit:     cubic-bezier(0.3, 0, 0.8, 0.15);  /* leaving for good (M3 Emphasized accelerate) */
  --cf-ease-spatial:  var(--cf-ease-spring);             /* container transform OPEN; close uses --cf-ease-standard */
  /* Springs (APPROVED Nov 19): transform/clip-path only, never opacity. Fallback first, linear() where supported (below). */
  --cf-ease-spring: cubic-bezier(0.35, 0.6, 0.05, 1.07);  /* plain fallback, least-squares fit of the spring, tiny overshoot */
  --cf-dur-spring: 380ms;        /* panels, drawers, sheets, container expand, drop settle */
  --cf-dur-spring-quick: 280ms;  /* popovers, menus, modals, toasts, list moves */
  /* new: showcase tier (Explore + Home hub hero only), = the existing local --ease in 7 places */
  --cf-ease-expressive: cubic-bezier(0.2, 0.7, 0.2, 1);
  --cf-dur-showcase: 700ms;                              /* typical; the 400–1100ms range is allowed only on marketing heroes */
  /* new: loops and timing helpers */
  --cf-dur-spin: 700ms;        /* every spinner, already consistent */
  --cf-dur-shimmer: 1300ms;    /* every skeleton sweep (hub/home2 value) */
  --cf-dur-highlight: 2000ms;  /* "this changed" background tint fading out (Film budget value) */
  --cf-delay-tooltip: 300ms;   /* first tooltip; the next ones within 300ms show instantly */
  --cf-delay-loading: 150ms;   /* don't show a skeleton/spinner before this */
  /* new: distances and scales (keep motion small) */
  --cf-move-1: 4px;  --cf-move-2: 8px;  --cf-move-3: 16px;
  --cf-scale-press: 0.97;   /* pressed buttons/cards */
  --cf-scale-pop: 0.97;     /* menus/popovers/modals start here */
}
@supports (transition-timing-function: linear(0, 1)) {
  :root { --cf-ease-spring: linear(0, 0.065, 0.209, 0.377, 0.538, 0.678, 0.789, 0.872, 0.931, 0.970, 0.994, 1.007, 1.013, 1.015, 1.014, 1.012, 1.010, 1.007, 1.005, 1.003, 1); }  /* computed damped spring: ratio 0.8, period 300ms, peak +1.5%, settles ~380ms */
}
@media (prefers-reduced-motion: reduce) {
  :root {
    --cf-dur-1: 0ms; --cf-dur-2: 0ms; --cf-dur-3: 0ms; --cf-dur-4: 0ms; --cf-dur-5: 0ms;
    --cf-dur-spring: 0ms; --cf-dur-spring-quick: 0ms;
    --cf-dur-showcase: 0ms; --cf-dur-highlight: 0ms;
    --cf-dur-spin: 2000ms;              /* spinners keep turning, slowly: they carry meaning (existing sign-in rule) */
    --cf-move-1: 0px; --cf-move-2: 0px; --cf-move-3: 0px; --cf-scale-press: 1; --cf-scale-pop: 1;
  }
}
/* ── end CFLOWS motion tokens ── */
/* New CFLOWS logos (2026-11-23) */
.cf-app-icon { flex: none; display: inline-block; object-fit: contain; align-self: center; }
.app-tile-img { background: none; object-fit: contain; border-radius: 0; }
