@font-face { font-family: "Google Sans Flex"; src: url("fonts/google-sans-flex.woff2") format("woff2"); font-weight: 1 1000; font-display: swap; }

:root {
  --bg: #f4f4f2; --ink: #161616; --line: #e3e3df; --muted: #74746f; --card: #fff;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: "Google Sans Flex", Arial, sans-serif; overflow: hidden; -webkit-font-smoothing: antialiased; }
ul { list-style: none; }
button { font: inherit; }

/* ---------- Stage: fixed logical size, scaled to fit ---------- */
.reel { position: fixed; inset: 0; overflow: hidden; background: var(--bg); }
.stage { position: absolute; left: 50%; top: 50%; width: var(--vw); height: var(--vh); transform: translate(-50%, -50%) scale(var(--k, 1)); overflow: hidden; }
.world { position: absolute; left: 0; top: 0; width: 1620px; height: 1525px; transform-origin: 0 0; }

/* ---------- Panels ---------- */
.panel { position: absolute; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 22px 24px 24px; box-shadow: 0 1px 0 #fff inset, 0 18px 40px -24px rgba(22, 22, 22, .18); }
.panel header { display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 18px; }
.panel header span { display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 6px; border-radius: 6px; background: var(--ink); color: #fff; letter-spacing: 0; }
.panel header em { margin-left: auto; font-style: normal; font-weight: 500; letter-spacing: .02em; text-transform: none; color: var(--muted); }
.p-obj { left: 0; top: 0; width: 380px; height: 440px; }
.p-head { left: 420px; top: 0; width: 600px; height: 440px; }
.p-img { left: 1060px; top: 0; width: 560px; height: 440px; }
.p-cta { left: 0; top: 480px; width: 380px; height: 380px; }
.p-rules { left: 420px; top: 480px; width: 600px; height: 380px; }
.p-tpl { left: 1060px; top: 480px; width: 560px; height: 640px; }
.p-out { left: 0; top: 900px; width: 1020px; height: 625px; }
.p-exp { left: 1060px; top: 1160px; width: 560px; height: 365px; }

/* states shared by every library item */
.it { transition: opacity .45s var(--ease), filter .45s var(--ease), transform .45s var(--ease), background-color .3s, color .3s, border-color .3s, box-shadow .3s; transition-delay: calc(var(--k, 0) * 45ms); }
.it.off { opacity: .22; filter: grayscale(1); }
.it.pick { border-color: var(--ink) !important; box-shadow: 0 0 0 2px var(--ink); }

/* 01 objectives */
.objs { display: grid; gap: 8px; }
.objs li { display: grid; grid-template-columns: 20px 1fr; align-items: center; column-gap: 12px; row-gap: 1px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; font-size: 17px; font-weight: 500; line-height: 1.3; }
.objs li::before { content: ""; grid-row: span 2; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid #b9b9b4; transition: inherit; }
.objs li small { grid-column: 2; font-size: 12px; color: var(--muted); font-weight: 400; }
.objs li.pick { background: var(--ink); color: #fff; box-shadow: none; }
.objs li.pick::before { border: 5px solid #fff; }
.objs li.pick small { color: #b7b7b2; }

/* 02 headlines */
.heads { display: grid; gap: 7px; }
.heads li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 10px; font-size: 16.5px; font-weight: 500; }
.tags { display: flex; gap: 4px; flex: none; }
.tags i { font-style: normal; font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 3px 6px; border-radius: 5px; background: #efefec; color: #5c5c58; }

/* 03 images */
.imgs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.imgs figure { position: relative; aspect-ratio: 3 / 2.3; border-radius: 10px; overflow: hidden; border: 1px solid transparent; }
.imgs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.imgs figcaption { position: absolute; left: 6px; bottom: 6px; display: flex; gap: 3px; }
.imgs figcaption i { font-style: normal; font-size: 9.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 5px; border-radius: 4px; background: rgba(255, 255, 255, .88); }
.imgs figure.pick { box-shadow: 0 0 0 3px var(--ink); }
.imgs figure.pick::after { content: "✓"; position: absolute; right: 6px; top: 6px; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 13px; display: grid; place-items: center; }

/* 04 CTAs */
.ctas { display: flex; flex-wrap: wrap; gap: 8px; }
.ctas span { display: inline-flex; align-items: center; gap: 8px; padding: 11px 16px; border-radius: 999px; border: 1px solid var(--line); font-size: 16px; font-weight: 500; }
.ctas span::after { content: "→"; }
.ctas span.pick { background: var(--ink); color: #fff; box-shadow: none; }

/* rules matrix */
.rules { display: grid; grid-template-columns: 130px repeat(6, 1fr); gap: 6px; font-size: 12px; align-items: center; }
.rules .ch { font-size: 10.5px; line-height: 1.15; color: var(--muted); font-weight: 600; text-align: center; padding-bottom: 4px; }
.rules .rh { font-weight: 600; font-size: 13px; padding: 6px 8px; border-radius: 7px; transition: background-color .3s, color .3s; }
.rules .c { height: 34px; border-radius: 7px; background: #f3f3f0; display: grid; place-items: center; transition: background-color .35s, transform .35s var(--ease); transition-delay: calc(var(--k, 0) * 50ms); }
.rules .c.y::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #9c9c97; }
.rules .row-on.rh { background: var(--ink); color: #fff; }
.rules .row-on.c { background: #e9e9e5; }
.rules .row-on.c.y { background: var(--ink); transform: scale(1.04); }
.rules .row-on.c.y::after { background: #fff; }
.rules-note { grid-column: 1 / -1; margin-top: 10px; color: var(--muted); font-size: 12.5px; }

/* 05 template */
.tpl { display: grid; place-items: center; height: 488px; background: repeating-conic-gradient(#f1f1ee 0 25%, #f7f7f5 0 50%) 0 0 / 20px 20px; border-radius: 12px; }
.tpl .bn { transform: scale(.78); border-radius: 14px; box-shadow: 0 0 0 1.3px #d6d6d2, 0 18px 40px -20px rgba(0, 0, 0, .25); }
.gen { position: absolute; left: 24px; right: 24px; bottom: 22px; height: 58px; border: 0; border-radius: 12px; background: var(--ink); color: #fff; font-size: 18px; font-weight: 500; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; transition: transform .2s var(--ease), background-color .2s; }
.gen.press { transform: scale(.97); background: #000; }
.gen i { font-style: normal; font-size: 22px; }

/* 06 output */
.out { position: relative; height: 536px; }
.out-in { position: absolute; left: 0; top: 0; width: 1830px; height: 1000px; transform-origin: 0 0; transform: scale(.5355); }
.out-in .slot { position: absolute; }
.out-in .slot b { position: absolute; left: 0; top: -26px; font-size: 18px; font-weight: 600; color: var(--muted); letter-spacing: .02em; opacity: 0; transition: opacity .4s; transition-delay: var(--d); }
.out-in .slot.on b { opacity: 1; }
.out-in .slot .bn { border-radius: 14px; box-shadow: 0 0 0 2px #d6d6d2; }
.out-in .slot:not(.on) .bn { opacity: 0; transform: translateY(16px); }
.out-in .slot.on .bn { opacity: 1; transform: none; transition: opacity .5s var(--ease), transform .6s var(--ease); transition-delay: var(--d); }

/* 07 export */
.files { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; font-size: 13px; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.files li { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid #efefec; opacity: .25; transition: opacity .4s; transition-delay: var(--d); }
.files li::after { content: "✓"; font-family: "Google Sans Flex", sans-serif; font-weight: 700; opacity: 0; transition: opacity .3s; transition-delay: inherit; }
.files li.on { opacity: 1; }
.files li.on::after { opacity: 1; }

/* ---------- Banner (shared by template + output) ---------- */
.bn { position: relative; flex: none; overflow: hidden; background: #fff; color: #000; font-size: var(--hs); }
.bn-photo { position: absolute; background: #ececea; overflow: hidden; }
.bn-photo img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transform: scale(1.14); }
.s-photo .bn-photo img { opacity: 1; transform: none; transition: opacity .6s, transform 4.5s cubic-bezier(.15, .7, .2, 1); transition-delay: var(--d, 0s); }
.bn-copy { position: absolute; display: flex; flex-direction: column; }
.bn-logo { display: block; height: var(--ls); width: auto; fill: #000; opacity: 0; transition: opacity .5s; }
.s-logo .bn-logo { opacity: 1; transition-delay: var(--d, 0s); }
.bn-head { display: flex; flex-wrap: wrap; column-gap: .2em; }
.bn-head .w { display: block; overflow: hidden; margin-bottom: -.04em; }
.bn-head svg, .bn-cta svg { display: block; height: 1.08em; fill: currentColor; overflow: visible; }
.bn-head svg { transform: translateY(110%); }
.s-head .bn-head svg { transform: none; transition: transform .75s var(--ease); transition-delay: calc(var(--d, 0s) + .2s + var(--i) * 55ms); }
.bn-cta { align-self: flex-start; display: inline-flex; align-items: center; gap: .45em; padding: .62em .95em .6em; border-radius: .3em; background: #286bfa; color: #fff; font-size: var(--cs); opacity: 0; transform: scale(.8); transform-origin: 0 50%; }
.bn-cta .cw { display: flex; column-gap: .25em; }
.bn-cta .arr { height: .9em; width: .9em; fill: none; stroke: currentColor; stroke-width: 2.4; }
.s-cta .bn-cta { opacity: 1; transform: none; transition: opacity .4s, transform .5s cubic-bezier(.3, 1.5, .5, 1); transition-delay: calc(var(--d, 0s) + .75s); }

/* tall: copy on top, photo below */
.k-tall .bn-copy { left: 9%; right: 9%; top: 5.5%; height: 48%; gap: 1.1em; }
.k-tall .bn-head { margin-top: .4em; }
.k-tall .bn-cta { margin-top: auto; }
.k-tall .bn-photo { left: 0; right: 0; bottom: 0; height: 44%; }
/* box: photo on top, copy band below */
.k-box .bn-photo { left: 0; right: 0; top: 0; height: 54%; }
.k-box .bn-copy { left: 7%; right: 7%; top: 59%; bottom: 7%; justify-content: space-between; }
.k-box > .bn-logo { position: absolute; right: 7%; bottom: calc(7% + (var(--cs) * 2.2 - var(--ls)) / 2); }
/* wide: copy left, photo right */
.k-wide .bn-photo { right: 0; top: 0; bottom: 0; width: 46%; }
.k-wide .bn-copy { left: 4.5%; top: 11%; bottom: 11%; width: 46%; gap: .5em; }
.k-wide .bn-cta { margin-top: auto; }
/* strip: one row */
.k-strip .bn-copy { inset: 0 0 0 0; flex-direction: row; align-items: center; gap: .9em; padding: 0 .8em; }
.k-strip .bn-head { flex: 1; min-width: 0; }
.k-strip .bn-cta { align-self: center; flex: none; margin-right: var(--cr, 0); }
.k-strip .bn-photo { right: 0; top: 0; bottom: 0; width: var(--pw, 0); }

/* ---------- HUD ---------- */
.hud p { position: absolute; z-index: 3; }
.hud-title { left: 32px; top: 26px; display: flex; align-items: baseline; gap: 10px; font-size: 17px; padding: 8px 16px; background: rgba(255, 255, 255, .85); border: 1px solid var(--line); border-radius: 999px; backdrop-filter: blur(10px); }
.hud-title b { font-weight: 600; letter-spacing: -.01em; }
.hud-title span { color: var(--muted); font-size: 14px; }
.hud-clicks { right: 32px; top: 26px; display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; padding: 8px 14px; background: rgba(255, 255, 255, .85); border: 1px solid var(--line); border-radius: 999px; backdrop-filter: blur(10px); }
.dots { display: flex; gap: 4px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: #dadad6; transition: background-color .25s, transform .3s cubic-bezier(.3, 1.6, .5, 1); }
.dots i.on { background: var(--ink); transform: scale(1.15); }
.hud-step { left: 32px; bottom: 28px; display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 500; padding: 10px 18px 10px 10px; background: rgba(255, 255, 255, .9); border: 1px solid var(--line); border-radius: 999px; backdrop-filter: blur(10px); }
.step-n { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 13px; font-weight: 700; }
.step-t { display: inline-block; }
.hud-note { right: 32px; bottom: 34px; font-size: 13px; color: var(--muted); padding: 6px 12px; background: rgba(244, 244, 242, .85); border-radius: 999px; }

.cursor { position: absolute; left: 0; top: 0; z-index: 4; width: 30px; height: 30px; margin: -3px 0 0 -4px; fill: var(--ink); stroke: #fff; stroke-width: 1.6; stroke-linejoin: round; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .25)); pointer-events: none; }
.ripple { position: absolute; z-index: 3; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; border: 2px solid var(--ink); pointer-events: none; animation: ripple .6s var(--ease) forwards; }
@keyframes ripple { from { transform: scale(.2); opacity: .9; } to { transform: scale(1); opacity: 0; } }

.finale { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; background: rgba(244, 244, 242, .82); backdrop-filter: blur(14px); opacity: 0; visibility: hidden; }
.finale p { font-size: 92px; line-height: .98; letter-spacing: -.045em; font-weight: 600; text-align: left; }
.finale em { font-style: normal; color: #9a9a95; }

/* portrait layout */
.portrait .hud-note { display: none; }
.portrait .hud-step { font-size: 24px; }
.portrait .finale p { font-size: 110px; }

/* template slots: dashed placeholders until each part is filled */
.slots .bn-head { position: relative; }
.slots .bn-head::after, .slots .bn-photo::after, .slots .bn-copy::after { position: absolute; display: grid; place-items: center; border: 2px dashed rgba(0, 0, 0, .28); border-radius: 8px; font: 600 13px "Google Sans Flex", sans-serif; letter-spacing: .12em; text-transform: uppercase; color: rgba(0, 0, 0, .45); transition: opacity .35s; }
.slots .bn-head::after { content: "Headline"; inset: -.1em -.15em; }
.slots .bn-photo::after { content: "Image"; inset: 14px; }
.slots .bn-copy::after { content: "CTA"; left: 0; bottom: 0; width: 58%; height: calc(var(--cs) * 2.45); }
.slots.s-head .bn-head::after, .slots.s-photo .bn-photo::after, .slots.s-cta .bn-copy::after { opacity: 0; }

/* tall: logo on the same left edge as the headline and CTA */
.k-tall .bn-logo { align-self: flex-start; }

/* ---------- Case-page covers (?cover=1|2|3), rendered at 1600 × 1132 ---------- */
.still *, .still *::before, .still *::after { transition: none !important; animation: none !important; }
.cover .hud, .cover .cursor, .cover .finale { display: none; }
.cover-2 { background: #276ef1; }
.cover-title { position: absolute; inset: 0; z-index: 6; padding: 110px 112px; display: flex; flex-direction: column; background: #276ef1; color: #fff; overflow: hidden; }
.cv-logo { height: 70px; width: auto; fill: #fff; align-self: flex-start; }
.cover-title h1 { margin-top: auto; font-size: 150px; line-height: .95; font-weight: 600; letter-spacing: -.045em; }
.cover-title p { margin-top: 26px; max-width: 15em; font-size: 32px; line-height: 1.3; color: rgba(255, 255, 255, .78); }
.cover-art { position: absolute; right: 120px; top: 50%; width: 520px; height: 820px; transform: translateY(-50%); }
.cover-art .bn { position: absolute; border-radius: 18px; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .55); }
.cover-art .bn:nth-child(1) { right: 0; top: 0; transform: rotate(4deg) scale(1.3); transform-origin: 100% 0; }
.cover-art .bn:nth-child(2) { left: -40px; bottom: 30px; transform: rotate(-5deg) scale(1.3); transform-origin: 0 100%; }
.cover-art .bn:nth-child(3) { left: 60px; top: 330px; transform: rotate(2deg) scale(1.3); transform-origin: 0 0; }

/* nothing in the copy column may shrink: overflow must reach fitType instead */
.bn-copy > * { flex-shrink: 0; }
