/* TryThisTrend design system: warm cream + night stage, prank pink to sizzle orange to gold. Mobile-first (390px). */
:root {
  --bg: #fff8f0; --bg2: #fff1e3; --card: #ffffff; --ink: #1c1328; --ink2: #4a3f57; --mute: #6f6480; --line: #efe3d6;
  --night: #140f20; --night2: #201733; --night3: #2c2142;
  --sizzle: #ff5a1f; --sizzle2: #ff8a3d; --gold: #ffc23d; --grape: #6c4bff; --mint: #20c997; --red: #e5484d;
  --grad: linear-gradient(135deg, #ff3d6e 0%, #ff5a1f 50%, #ffc23d 100%); --pink: #ff3d6e;
  --grad-cine: linear-gradient(135deg, #6c4bff 0%, #ff5a1f 100%);
  --r: 18px; --r-sm: 12px; --r-lg: 28px;
  --shadow: 0 1px 2px rgba(28,19,40,.06), 0 8px 24px rgba(28,19,40,.08);
  --shadow-lg: 0 20px 60px rgba(28,19,40,.18);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Bricolage Grotesque', 'Inter', system-ui, sans-serif;
  --ease: cubic-bezier(.2,.8,.2,1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.08; letter-spacing: -.02em; margin: 0 0 .4em; }
h1 { font-size: clamp(2.3rem, 9vw, 4.4rem); font-weight: 800; }
h2 { font-size: clamp(1.75rem, 6.5vw, 2.9rem); font-weight: 800; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1em; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.center { text-align: center; }
.mute { color: var(--mute); }
.small { font-size: .86rem; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--grape); outline-offset: 3px; border-radius: 8px; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Buttons */
.btn { --b: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 52px; padding: 0 26px; border-radius: 999px; border: 0; cursor: pointer;
  font: 700 1.02rem/1 var(--font); text-decoration: none; color: #fff; background: var(--b); transition: transform .18s var(--ease), box-shadow .2s, filter .2s; -webkit-tap-highlight-color: transparent; position: relative; overflow: hidden; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(255,90,31,.28); }
.btn:active { transform: scale(.97); }
.btn-hot { background: var(--grad); color: #2a1206; box-shadow: 0 8px 22px rgba(255,90,31,.35); }
.btn-hot::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%); transform: translateX(-120%); animation: shine 3.2s ease-in-out infinite; }
@keyframes shine { 60%, 100% { transform: translateX(120%); } }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.btn-ghost:hover { box-shadow: inset 0 0 0 2px var(--ink); }
.btn-light { background: #fff; color: var(--ink); }
.btn-block { width: 100%; }
.btn-sm { min-height: 44px; padding: 0 18px; font-size: .92rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn .arrow { transition: transform .2s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

/* Pills & chips */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: .8rem; font-weight: 700; background: var(--bg2); color: var(--ink2); }
.pill-night { background: rgba(255,255,255,.1); color: #fff; backdrop-filter: blur(8px); }
.chip { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; font: 600 .88rem var(--font); color: var(--ink2); cursor: pointer; transition: all .15s; }
.chip:hover { border-color: var(--sizzle2); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Logo */
.logo { display: inline-flex; align-items: center; gap: 9px; font: 800 1.2rem var(--display); text-decoration: none; letter-spacing: -.02em; }
.logo svg { width: 34px; height: 34px; }

/* Nav */
.nav { position: sticky; top: 0; z-index: 50; transition: background .25s, box-shadow .25s; }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.nav.dark { color: #fff; }
.nav.scrolled { background: rgba(255,248,240,.88); backdrop-filter: blur(14px); box-shadow: 0 1px 0 var(--line); color: var(--ink); }
.nav-links { display: flex; align-items: center; gap: 10px; }
.nav-login { font-weight: 600; font-size: .92rem; text-decoration: none; padding: 10px 8px; min-height: 44px; display: inline-flex; align-items: center; opacity: .9; }
.nav-login:hover { opacity: 1; text-decoration: underline; }

/* Cards */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px; }
.section { padding: 72px 0; }
.section-head { max-width: 640px; margin: 0 auto 36px; text-align: center; }
.eyebrow { display: inline-block; font: 800 .75rem var(--font); letter-spacing: .14em; text-transform: uppercase; color: #c2410c; margin-bottom: 12px; } /* darker than --sizzle: 12px caps need 4.5:1 on cream */

/* Reveal */
[data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
[data-reveal].in { opacity: 1; transform: none; }
[data-reveal][data-d="1"] { transition-delay: .08s; } [data-reveal][data-d="2"] { transition-delay: .16s; } [data-reveal][data-d="3"] { transition-delay: .24s; }

/* Recipe poster card */
.rc { position: relative; border-radius: 20px; overflow: hidden; aspect-ratio: 9/14; background: var(--night2); color: #fff; cursor: pointer; isolation: isolate; box-shadow: var(--shadow);
  transition: transform .3s var(--ease), box-shadow .3s; border: 0; padding: 0; text-align: left; font: inherit; width: 100%; }
.rc img, .rc video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.rc::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(10,6,18,.88) 100%); z-index: 1; }
.rc:hover { transform: translateY(-4px) rotate(-.4deg); box-shadow: var(--shadow-lg); }
.rc:hover img { transform: scale(1.06); }
.rc .rc-meta { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 2; }
.rc .rc-name { display: block; font: 800 1.05rem/1.15 var(--display); }
.rc .rc-photo { display: block; }
.rc .rc-tag { position: absolute; top: 10px; left: 10px; z-index: 2; font-size: .7rem; font-weight: 800; padding: 5px 9px; border-radius: 999px; background: rgba(255,255,255,.92); color: var(--ink); }
.rc .rc-photo { font-size: .72rem; opacity: .85; margin-top: 3px; }
.rc .rc-play { position: absolute; top: 10px; right: 10px; z-index: 2; width: 30px; height: 30px; border-radius: 50%; background: rgba(0,0,0,.45); display: grid; place-items: center; backdrop-filter: blur(6px); }
.rc.sel { outline: 4px solid var(--sizzle); outline-offset: 2px; }

/* Film strip decoration */
.filmstrip { height: 18px; background: repeating-linear-gradient(90deg, transparent 0 10px, rgba(255,255,255,.18) 10px 20px); mask: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent); }

/* Forms */
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-weight: 700; font-size: .88rem; margin-bottom: 6px; }
.input { width: 100%; min-height: 52px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; padding: 0 16px; font: 500 1rem var(--font); color: var(--ink); transition: border-color .15s, box-shadow .15s; }
textarea.input { padding: 14px 16px; min-height: 96px; resize: vertical; }
.input:focus { outline: none; border-color: var(--sizzle2); box-shadow: 0 0 0 4px rgba(255,138,61,.18); }
.err { color: var(--red); font-weight: 600; font-size: .9rem; min-height: 1.2em; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 600; z-index: 999; transition: transform .35s var(--ease); width: max-content; max-width: calc(100vw - 32px); text-align: center; box-shadow: var(--shadow-lg); pointer-events: none; }
.toast.show { transform: translate(-50%, 0); }

/* FAQ */
.faq details { background: #fff; border-radius: 16px; margin-bottom: 10px; box-shadow: var(--shadow); overflow: hidden; }
.faq summary { list-style: none; cursor: pointer; padding: 18px 52px 18px 18px; font-weight: 700; position: relative; min-height: 44px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-size: 1.5rem; color: var(--sizzle); transition: transform .25s; }
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { padding: 0 18px 18px; margin: 0; color: var(--ink2); }

/* Footer */
.footer { padding: 48px 0 28px; border-top: 1px solid var(--line); font-size: .92rem; color: var(--mute); background: var(--bg); }
.foot-grid { display: grid; gap: 28px; grid-template-columns: 1fr 1fr; }
.foot-brand { grid-column: 1 / -1; display: grid; gap: 12px; justify-items: start; }
.foot-brand p { margin: 0; max-width: 320px; }
.footer nav { display: grid; gap: 2px; align-content: start; }
.footer nav b { color: var(--ink); font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; }
.footer nav a { text-decoration: none; padding: 9px 0; min-height: 44px; display: flex; align-items: center; }
.footer a:hover { color: var(--ink); }
.foot-bottom { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line); font-size: .84rem; }
@media (min-width: 760px) { .foot-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } .foot-brand { grid-column: auto; } }
.ic { flex: none; display: inline-block; vertical-align: -0.18em; }
h2 .ic, h3 .ic { vertical-align: -0.12em; margin-right: 4px; }
.rc-photo .ic, .rc-tag .ic { vertical-align: -2px; }
.rc .rc-play { color: #fff; }
/* Steam / sizzle animation used in logo and loaders */
@keyframes steam { 0% { transform: translateY(4px) scaleX(1); opacity: 0; } 30% { opacity: .9; } 100% { transform: translateY(-14px) scaleX(1.4); opacity: 0; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }

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

@media (max-width: 560px) { .hide-sm { display: none !important; } }


/* Round 5: "Pick your best N seconds" trimmer (SC.trimmer), shared by preview.html and app.html */
.trim { margin-top: 10px; background: var(--night); color: #fff; border-radius: 16px; padding: 12px; }
.trim-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: .86rem; }
.trim-head b { display: inline-flex; gap: 6px; align-items: center; } .trim-head .ic { color: var(--gold); }
.trim-t { font-size: .76rem; font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; }
.trim-strip { position: relative; height: 64px; margin-top: 10px; border-radius: 10px; overflow: hidden; background: linear-gradient(90deg, #2c2142, #3a2a55); touch-action: pan-y; }
.trim-imgs { position: absolute; inset: 0; display: flex; } .trim-imgs img { flex: 1; min-width: 0; height: 100%; object-fit: cover; }
.trim-shade { position: absolute; top: 0; bottom: 0; left: 0; background: rgba(10,6,18,.68); pointer-events: none; } .trim-shade.r { left: auto; }
.trim-win { position: absolute; top: 0; bottom: 0; border: 3px solid var(--gold); border-radius: 10px; box-shadow: 0 0 0 1px rgba(0,0,0,.4); pointer-events: none; }
.trim-win i { position: absolute; top: 50%; width: 6px; height: 22px; margin-top: -11px; border-radius: 3px; background: var(--gold); } .trim-win i:first-child { left: -5px; } .trim-win i:last-child { right: -5px; }
.trim-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: grab; }
.trim-note { margin: 8px 0 0; font-size: .76rem; color: #cfc3df; }
/* Round 5: template grid tap target stays put while posters load or a filter redraws (no layout shift) */
.grid2 > .rc { display: block; width: 100%; aspect-ratio: 9/14; contain: layout paint; } .rgrid > .rc { display: block; width: 100%; contain: layout paint; }
@media (hover: none) { .rc:hover { transform: none; box-shadow: var(--shadow); } .rc:hover img { transform: none; } }