:root {
  --paper: #ece7df;
  --ink: #1b1612;
  --muted: #6b6158;
  --line: #cfc6ba;
  --serif: "Didot", "Bodoni 72", "Bodoni MT", "Bodoni Moda", Georgia, serif;
  --sans: -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
/* top/bottom safe areas on :root (the claude.ai preview adds the same); side gutter clears a sideways phone's bars */
:root { color-scheme: light; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); background: var(--paper); }
html, body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
main { max-width: 480px; margin: 0 auto; padding-block: 16px 24px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
[hidden] { display: none !important; }

.screen { display: flex; flex-direction: column; align-items: stretch; gap: 14px; }
.brand { text-align: center; padding-top: 8px; }
.logo { display: block; margin: 0 auto; width: 84%; max-width: 340px; height: auto; } /* the template's own lockup */
.wordmark { display: block; margin: 0 auto; width: 58%; max-width: 260px; height: auto; }
.mini .wordmark { width: 34%; max-width: 150px; }
.byline { margin: 6px 0 0; text-align: center; font-size: 12px; letter-spacing: 0.24em; color: var(--muted); }
.headline { font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 10vw, 46px); line-height: 1.02; text-align: center; margin: 10px 0 0; }
.sub { margin: 0; text-align: center; font-size: 15px; color: var(--muted); }
.note { margin: 0; text-align: center; font-size: 12px; color: var(--muted); }
.hint { margin: -4px 0 0; text-align: center; font-size: 12px; color: var(--muted); }

.fan { position: relative; height: min(92vw, 400px); margin: 6px 0 4px; }
.fan img { position: absolute; top: 8%; width: 48%; aspect-ratio: 4 / 5; object-fit: cover; box-shadow: 0 6px 18px rgba(27, 22, 18, 0.28);
  transition: transform 0.9s ease, left 0.9s ease, z-index 0s; }
.fan img:nth-child(1) { left: 3%; transform: rotate(-9deg); z-index: 1; }
.fan img:nth-child(2) { left: 22%; transform: rotate(-3deg) translateY(-4%); z-index: 2; }
.fan img:nth-child(3) { left: 44%; transform: rotate(4deg); z-index: 3; }
.fan img:nth-child(4) { left: 52%; transform: rotate(10deg) translateY(6%); z-index: 0; }

.btn { appearance: none; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); border-radius: 999px; padding: 16px 20px;
  font: 600 15px/1 var(--sans); letter-spacing: 0.08em; cursor: pointer; width: 100%; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost.light { border-color: #fff; color: #fff; }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn:focus-visible, .link:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.link { appearance: none; border: 0; background: none; color: var(--muted); font: 13px/1 var(--sans); text-decoration: underline; padding: 8px; cursor: pointer; align-self: center; }

.stage, .result { position: relative; width: 100%; aspect-ratio: 4 / 5; background: #dcd5ca; box-shadow: 0 6px 22px rgba(27, 22, 18, 0.18); }
#poster { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#poster:active { cursor: grabbing; }
#result { display: block; width: 100%; height: 100%; object-fit: contain; }
.chip { position: absolute; left: 50%; top: 9%; transform: translateX(-50%); margin: 0; padding: 7px 12px; border-radius: 999px; background: rgba(20, 16, 12, 0.72);
  color: #fff; font-size: 12px; letter-spacing: 0.04em; white-space: nowrap; pointer-events: none; transition: opacity 0.4s; }
.chip.gone { opacity: 0; }
.busy { position: absolute; inset: 0; margin: 0; display: grid; place-items: center; padding: 24px; text-align: center; font-size: 14px; color: var(--muted); }
.stage-msg { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: 24px; text-align: center; background: var(--paper); color: var(--ink); font-size: 15px; }
.stage-msg p { margin: 0; max-width: 30ch; }
.stage-msg .btn { width: auto; padding: 12px 22px; }

.controls { display: flex; flex-direction: column; gap: 12px; }
.slider { display: flex; align-items: center; gap: 12px; font-size: 13px; letter-spacing: 0.1em; color: var(--muted); }
.slider span { width: 44px; }
.slider input { flex: 1; accent-color: var(--ink); }

.banner { position: sticky; top: 0; z-index: 5; background: var(--ink); color: var(--paper); font-size: 13px; line-height: 1.35; padding: 10px 16px; text-align: center; }
.banner a { color: #fff; font-weight: 600; }

.hold { position: fixed; inset: 0; z-index: 10; background: rgba(12, 10, 8, 0.94); display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; padding: 24px; color: #fff; text-align: center; }
.hold img { max-width: 100%; max-height: 72vh; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5); -webkit-touch-callout: default; user-select: auto; }
.hold p { margin: 0; font-size: 15px; }
.hold .btn { max-width: 320px; }

@media (min-width: 700px) {
  main { max-width: 520px; padding-block: 32px 24px; }
}
