/* Falpad's own pieces on top of base.css: the frame in film, the contact sheet, the pencil loop, the roll, the
   AI card, and each page's composition. Read DESIGN.md first. */

/* the pencil loop reaches past its frame: never let it widen the page */
main { overflow-x: clip; }

/* ---------- type and controls on black ---------- */
h1, h2, .display { line-height: 0.92; text-transform: uppercase; }
h1 em, h2 em, .display em, .beat.two, .accent { font-style: normal; color: var(--accent); }
.btn { border-radius: var(--r-sm); background: var(--surface); }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: none; background: var(--accent-hover); }
.btn:hover { border-color: var(--line-3); }
.chip { border-radius: var(--r-sm); background: var(--surface); }
.seg { border-radius: var(--r-sm); background: var(--bg-2); border: 0; }
.seg button, .chips button { border-radius: 3px; }
.seg button[aria-pressed="true"], .chips button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.input, .prefix { background: var(--bg-2); border-color: var(--line-3); }
.card { border-radius: var(--r-sm); background: var(--surface); }
.kicker { color: var(--ink-2); }
.kicker-dot { border-radius: 50%; background: var(--accent); }
.label { color: var(--muted); }
.flat { color: var(--ink-2); }
.down { color: var(--bad); }

/* header: the drawn wordmark */
#top { background: color-mix(in srgb, var(--bg) 90%, transparent); border-bottom: 1px solid var(--line-2); }
.brand-word { display: block; height: 30px; }
.brand-word svg { height: 100%; width: auto; overflow: visible; }
.nav a { border-radius: var(--r-sm); }
.nav a:hover, .nav a[aria-current] { background: var(--bg-2); color: var(--ink); }
.ca.small, .top-x { border-radius: var(--r-sm); }
.demo-strip { background: var(--surface); color: var(--ink-2); border-bottom: 1px solid var(--line); }
.demo-strip b { color: var(--warn); }
.demo-strip a { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- the frame: a photo in black film with edge print ---------- */
.frame { position: relative; margin: 0; }
.film { position: relative; background: var(--film); padding: 17px 6px; }
.frame.lg .film { padding: 26px 10px; }
.edge { position: absolute; left: 9px; right: 9px; font: 500 9px/1 var(--font-mono); letter-spacing: 0.16em; color: var(--edge); white-space: pre; overflow: hidden; text-overflow: clip; pointer-events: none; }
.edge.top { top: 4px; }
.edge.bottom { bottom: 4px; text-align: right; }
.frame.lg .edge { font-size: 11px; left: 14px; right: 14px; }
.frame.lg .edge.top { top: 7px; }
.frame.lg .edge.bottom { bottom: 7px; }
.window { position: relative; aspect-ratio: 1; overflow: hidden; background: #26262B; }
.window img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 360ms var(--ease); }
.window img.in { opacity: 1; }
[data-motion="off"] .window img { opacity: 1; }
.window.developing { background: #2E2E34; animation: develop 1.6s var(--ease) infinite alternate; }
@keyframes develop { from { background: #24242A; } to { background: #3A3A42; } }
.window .missed { position: absolute; inset: 0; display: grid; place-items: center; padding: 10px; text-align: center; font: 12px/1.3 var(--font-mono); color: var(--edge); }

/* the pencil loop: laid over the frame, a little bigger than it */
.loop-wrap { position: absolute; inset: -9% -8%; pointer-events: none; z-index: 2; }
.loop { width: 100%; height: 100%; overflow: visible; display: block; }
/* the stroke scales with the box: a width per frame size keeps the mark about 3 to 4 px on screen */
/* a dark under-stroke (.lpu) keeps the light blue readable over light photos */
.loop .lp { stroke-width: 0.95; }
.loop .lpu { stroke-width: 1.9; }
.frame.cell .loop .lp { stroke-width: 1.05; }
.frame.cell .loop .lpu { stroke-width: 2.1; }
.frame.lg .loop .lp { stroke-width: 0.62; }
.frame.lg .loop .lpu { stroke-width: 1.25; }
.step-n .loop .lp { stroke-width: 5; }
.step-n .loop .lpu { stroke-width: 0; }
.loop.draw path { stroke-dasharray: 1 1; stroke-dashoffset: 1; animation: draw var(--t-draw) var(--ease) 250ms forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
[data-motion="off"] .loop.draw path { stroke-dashoffset: 0; }
.pencil-note { position: absolute; z-index: 3; top: -34px; right: 0; padding: 5px 9px; font: 500 12px/1 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--on-accent); background: var(--accent); border-radius: 4px; pointer-events: none; white-space: nowrap; }
.pencil-note::before { content: '\25BC  '; }

/* ---------- the contact sheet: frames in one strip of film ---------- */
.sheet { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--film); padding: 0 5px; }
.sheet .film { padding: 18px 4px; }
.sheet .frame.picked { z-index: 2; }
.sheet-pick { display: block; padding: 0; border: 0; background: none; cursor: pointer; text-align: left; }
.sheet-pick:hover .window img { filter: brightness(1.08); }
.sheet-pick:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.blank-sheet { width: min(360px, 100%); grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------- the roll: frames of film its fees have paid for ---------- */
.roll { display: inline-flex; gap: 2px; flex: none; }
.roll i { width: 9px; height: 11px; border: 1px solid var(--line-3); border-radius: 1px; }
.roll i.on { background: var(--ink); border-color: var(--ink); }
.roll.big { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 3px; width: 100%; }
.roll.big i { width: auto; height: auto; aspect-ratio: 5 / 6; }

/* ---------- the AI card: a frame cut from its sheet, notes on the paper under it ---------- */
.contact { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 34px 22px; }
.ai-card { display: grid; gap: 10px; align-content: start; min-width: 0; transition: transform var(--t) var(--ease); }
a.ai-card:hover { transform: translateY(-3px); }
a.ai-card:hover .card-name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.card-id { display: grid; gap: 4px; min-width: 0; }
.card-name { font: 700 28px/1 var(--font-display); letter-spacing: -0.01em; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-line { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--ink); }
.card-desc { font-size: 14px; color: var(--ink-2); }
.card-roll { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ink-2); padding-top: 8px; border-top: 1px solid var(--line-2); }
.card-roll.on .mono::before, .roll-chip.on::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 7px; vertical-align: 1px; }
.card-roll.low { color: var(--warn); }
.card-roll.out, .card-roll.preview { color: var(--muted); }
.ai-card.preview .card-name { color: var(--ink); }
.ai-card.skeleton .sk { height: 14px; border-radius: 2px; background: var(--bg-2); }
.ai-card.skeleton .sk-line.short { width: 60%; }

/* ---------- home: a contact sheet on a desk ---------- */
.hero { padding-top: clamp(36px, 5.5vw, 76px); }
.hero-h1 { font-size: clamp(56px, 9.4vw, 136px); font-weight: 800; line-height: 0.86; letter-spacing: -0.015em; margin-top: 6px; }
.hero-h1 .beat { display: block; }
.hero-sheet { position: relative; margin-top: clamp(28px, 4vw, 52px); }
.hero-sheet .sheet { padding: 0 6px; }
.sheet-caption { display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; color: var(--ink-2); }
.sheet-caption b { color: var(--ink); font-weight: 500; }
.sheet-caption a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.desk { display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(24px, 5vw, 72px); align-items: start; margin-top: clamp(28px, 4vw, 48px); padding-top: 28px; border-top: 1px solid var(--line-3); }
.desk .lede b { color: var(--ink); font-weight: 600; }
.describe { display: grid; gap: 10px; }
.describe-row { display: flex; gap: 8px; }
.describe-input { height: 54px; font-size: 17px; }
.describe-examples { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.describe-examples .chip { height: 30px; font: 13px var(--font-text); color: var(--ink-2); }
.describe-examples .chip:hover { border-color: var(--line-3); color: var(--ink); }
.proof-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; margin-top: 28px; }
.proof { font-size: 13px; color: var(--ink-2); }

/* how it works as a proof list */
.proofs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line-3); }
.proofs li { display: grid; gap: 10px; align-content: start; padding: 18px 18px 22px 0; border-right: 1px solid var(--line-2); }
.proofs li + li { padding-left: 18px; }
.proofs li:last-child { border-right: 0; }
.proof-n { font: 500 12px var(--font-mono); letter-spacing: 0.08em; color: var(--muted); }
.proofs h3 { font: 700 28px/1 var(--font-display); letter-spacing: -0.01em; text-transform: uppercase; }
.proof-art { min-height: 132px; display: grid; align-items: end; }
.proof-art .sheet { width: 100%; }
.art-name .frame { width: 110px; flex: none; }
.art-name { display: flex; align-items: center; gap: 12px; font: 500 15px var(--font-mono); }
.art-name b { font-weight: 500; padding: 4px 8px; background: var(--accent); color: var(--on-accent); border-radius: 4px; }
.art-pay { display: grid; gap: 4px; font-size: 14px; }
.art-pay b { font: 700 44px/1 var(--font-display); }
.art-roll { display: grid; gap: 10px; }

.section-head h2 { max-width: 18ch; }
.feed { border-top: 1px solid var(--line-3); }
.feed-row { border-bottom: 1px solid var(--line-2); grid-template-columns: 96px 76px 1fr auto 70px; }
.feed-kind { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.feed-row.k-launch .feed-kind, .feed-row.k-video .feed-kind { color: var(--accent); }
.feed-time { font-size: 12px; }
.band { margin-top: clamp(64px, 9vw, 120px); padding: clamp(40px, 6vw, 72px) 0 0; border-top: 1px solid var(--line-3); display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 5vw, 72px); align-items: end; }
.band h2 { font-size: clamp(44px, 6.4vw, 92px); }

/* ---------- AIs ---------- */
.live-line { font-size: 13px; }
.examples-head { margin: 56px 0 18px; }

/* ---------- coin page: the comp card ---------- */
.comp { display: grid; grid-template-columns: minmax(280px, 460px) 1fr; gap: clamp(24px, 4vw, 56px); align-items: start; padding-top: clamp(28px, 4vw, 48px); }
.comp .frame.lg { margin: 6px; }
.comp-card { display: grid; gap: 16px; align-content: start; }
.comp-card h1 { font-size: clamp(56px, 7vw, 104px); line-height: 0.9; }
.coin-persona { font-size: clamp(18px, 1.6vw, 21px); color: var(--ink-2); max-width: 30em; }
.measures { display: grid; grid-template-columns: 1fr 1.5fr 1fr 0.9fr 0.9fr; border-top: 1px solid var(--line-3); border-bottom: 1px solid var(--line-3); }
.measures .stat { padding: 12px 12px 12px 0; }
.measures .stat + .stat { padding-left: 12px; border-left: 1px solid var(--line-2); }
.measures .stat { min-width: 0; }
.measures .stat-value { font: 700 clamp(20px, 2.2vw, 30px)/1.05 var(--font-display); letter-spacing: -0.01em; white-space: nowrap; }
.roll-chip { font-size: 12px; }
.roll-chip.low { color: var(--warn); }
.coin-grid { display: grid; grid-template-columns: 1fr 360px; gap: 22px; margin-top: 36px; align-items: start; }
.coin-main, .coin-side { display: grid; gap: 22px; }
.roll-card .roll-n { font: 800 68px/0.9 var(--font-display); color: var(--accent); }
.roll-card .roll-big-row { display: flex; gap: 16px; align-items: end; margin: 6px 0 14px; }
.roll-card .roll-big-row p { padding-bottom: 6px; }
.coin-sheet { margin-top: 10px; }
.coin-sheet .sheet { max-width: 520px; }

/* ---------- fee split ---------- */
.split-bar { display: flex; height: 34px; border: 1px solid var(--line-3); border-radius: 4px; overflow: hidden; }
.split-seg { display: grid; place-items: center; min-width: 0; overflow: hidden; font-size: 12px; }
.split-seg + .split-seg { border-left: 1px solid var(--line-3); }
.split-seg.burn { background: var(--ink); color: var(--bg); }
.split-seg.aishare { background: repeating-linear-gradient(90deg, var(--surface) 0 10px, var(--bg-2) 10px 12px); }
.split-seg.creator { background: var(--bg-2); }
.split-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: 13.5px; color: var(--ink-2); }
.split-legend i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border: 1px solid var(--line-3); vertical-align: -1px; }
.split-legend .burn i { background: var(--ink); }
.split-legend .aishare i { background: var(--bg-2); }
.split-legend .creator i { background: var(--bg-2); }
.split-legend b { font-weight: 500; color: var(--ink); }

/* ---------- launch ---------- */
.launch-grid { grid-template-columns: 1fr 360px; gap: 28px; }
.step-card { padding: 24px; }
.step-title { font: 700 32px/1 var(--font-display); letter-spacing: -0.01em; text-transform: uppercase; gap: 14px; }
.step-title .step-n { position: relative; width: 34px; height: 34px; border: 0; font: 500 14px var(--font-mono); }
.step-title .step-n .loop-wrap { inset: -6px; }
.shoot { display: grid; gap: 14px; margin-top: 16px; }
.shoot .sheet { margin-top: 8px; }
.shoot-msg { font-size: 14.5px; color: var(--ink-2); min-height: 1.5em; }
.launch-side .ai-card.preview { max-width: 300px; }
.preview-box { display: grid; justify-items: start; }
.split-view { margin-top: 16px; }
.split-words { margin-top: 12px; font-size: 14.5px; color: var(--ink-2); }
.range { width: 100%; accent-color: var(--accent); }

/* ---------- how ---------- */
.roll-states { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.roll-states figure { margin: 0; display: grid; gap: 12px; align-content: start; }
.roll-states .frame { width: 100%; max-width: 260px; }
.roll-states figcaption { display: grid; gap: 4px; }
.roll-states figcaption b { font: 700 26px/1 var(--font-display); text-transform: uppercase; }
.fee-notes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 20px 0 14px; }
.fee-notes b { font-weight: 500; }
.risks { display: grid; gap: 8px; list-style: disc; padding-left: 20px; color: var(--ink-2); margin-top: 14px; }

/* ---------- empty, 404 ---------- */
.empty .blank-sheet { margin-bottom: 8px; }
.nf { display: grid; justify-items: center; gap: 16px; text-align: center; padding: 72px 0; }
.nf .frame { width: min(300px, 70vw); }
.nf .pencil-note { position: static; }

/* ---------- footer ---------- */
.foot-word { display: block; height: 34px; }
.foot-word svg { height: 100%; width: auto; overflow: visible; }

/* ---------- phones ---------- */
@media (max-width: 1080px) {
  .contact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .proofs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .proofs li:nth-child(2) { border-right: 0; }
  .proofs li:nth-child(3) { padding-left: 0; }
  .proofs li:nth-child(n + 3) { border-top: 1px solid var(--line-2); }
  .measures { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .measures .stat:nth-child(4) { padding-left: 0; border-left: 0; }
  .measures .stat:nth-child(n + 4) { border-top: 1px solid var(--line-2); }
}
@media (max-width: 980px) {
  .comp, .coin-grid, .launch-grid, .desk, .band { grid-template-columns: 1fr; }
  .launch-side { position: static; }
  .comp .frame.lg { max-width: 460px; }
}
@media (max-width: 860px) {
  .tabbar { border-radius: var(--r-sm); background: color-mix(in srgb, var(--surface) 94%, transparent); }
  .tabbar a { border-radius: 3px; }
  .tabbar a[aria-current] { background: var(--ink); color: var(--bg); }
  .feed-row { grid-template-columns: 72px 1fr 52px; }
  .feed-row .feed-kind { display: none; }
}
@media (max-width: 640px) {
  .contact { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 14px; }
  .card-name { font-size: 22px; }
  .card-line { flex-direction: column; gap: 2px; }
  .sheet { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .blank-sheet { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-sheet .pencil-note { display: none; }
  .proof-art .sheet { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 320px; }
  .describe-row { flex-direction: column; }
  .describe-row .btn { width: 100%; }
  .proofs { grid-template-columns: 1fr; }
  .proofs li { border-right: 0; padding-left: 0 !important; border-top: 1px solid var(--line-2); }
  .proofs li:first-child { border-top: 0; }
  .roll-states, .fee-notes { grid-template-columns: 1fr; }
  .measures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .measures .stat:nth-child(n) { padding-left: 0; border-left: 0; }
  .measures .stat:nth-child(even) { padding-left: 12px; border-left: 1px solid var(--line-2); }
  .measures .stat:nth-child(n + 3) { border-top: 1px solid var(--line-2); }
  .step-card { padding: 18px; }

}

/* footer link columns */
.foot-links { gap: 28px; }
.foot-links > div { display: grid; gap: 8px; align-content: start; font-size: 14.5px; }
.foot-links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.foot-base { align-items: center; }

/* the character type picker on the launch page: three faces, like Higgspad's Average / Bold / Extreme */
.style-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; max-width: 520px; }
.style-opt { display: grid; gap: 4px; justify-items: center; padding: 10px 8px 12px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--bg-2); color: var(--ink-2); cursor: pointer; text-align: center; transition: border-color var(--t-fast) var(--ease); }
.style-opt:hover { border-color: var(--line-3); }
.style-opt[aria-checked="true"] { border-color: var(--accent); color: var(--ink); box-shadow: inset 0 0 0 1px var(--accent); }
.style-face { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; background: #26262B; }
.style-face img { width: 100%; height: 100%; object-fit: cover; }
.style-name { font: 700 18px/1 var(--font-display); text-transform: uppercase; letter-spacing: 0.01em; margin-top: 4px; }
.style-opt[aria-checked="true"] .style-name { color: var(--accent); }
.style-text { font-size: 12.5px; color: var(--muted); }
