:root {
  --bg: #0a0a0b;
  --card: #121214;
  --card2: #18181b;
  --line: #26262b;
  --text: #f2f2f0;
  --muted: #8d8d94;
  --acc: #24dfa5;
  --bad: #ff8a8a;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 16px/1.5 Inter, system-ui, sans-serif; min-height: 100vh; overflow-x: hidden; }
a { color: var(--text); text-underline-offset: 3px; }

/* cinematic example behind the hero, fading into the page */
.hero-bg { position: absolute; inset: 0 0 auto 0; height: 560px; z-index: 0; pointer-events: none;
  background: url(/hero.jpg) center 30% / cover no-repeat; filter: grayscale(.55) brightness(.5);
  -webkit-mask-image: linear-gradient(#000 35%, transparent); mask-image: linear-gradient(#000 35%, transparent); }
main { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; padding: 36px 16px 48px; }
.hero { text-align: center; margin: 0 0 22px; }
.eyebrow { display: inline-block; margin: 0 0 10px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 99px;
  font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: rgba(10, 10, 11, .6); }
h1 { margin: 0 0 6px; line-height: 0; }
h1 img { width: min(100%, 440px); height: auto; filter: drop-shadow(0 6px 24px rgba(0, 0, 0, .7)); }
.lead { margin: 6px 0 0; color: #c9c9cd; font-size: 17px; }

.card, .step { background: var(--card); border: 1px solid var(--line); border-radius: 16px; margin: 12px 0; }
.card { padding: 16px; }
h2 { font-size: 15px; font-weight: 700; margin: 0 0 12px; display: flex; align-items: baseline; gap: 10px; }

/* accordion steps: finished steps fold to one line with Edit */
.step-h { appearance: none; width: 100%; background: none; border: 0; color: var(--text); display: flex; align-items: center;
  gap: 10px; padding: 14px 16px; font: 700 15px Inter, sans-serif; text-align: left; cursor: pointer; }
.step-h .t { flex: 0 0 auto; }
.step-h .sum { flex: 1; min-width: 0; color: var(--muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-align: right; }
.step-h .sum img { width: 28px; height: 28px; border-radius: 6px; object-fit: cover; vertical-align: middle; margin-right: 8px; }
.step-h .edit { color: var(--muted); font-weight: 500; font-size: 13px; border: 1px solid var(--line); border-radius: 99px; padding: 2px 10px; display: none; }
.step[data-done="true"][data-open="false"] .edit { display: inline-block; }
.step[data-open="true"] .sum { display: none; }
.n { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; flex: 0 0 auto;
  border: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.step[data-done="true"] .n { background: var(--acc); border-color: var(--acc); color: #04150f; }
.step-b { padding: 0 16px 16px; }
.step[data-open="false"] .step-b { display: none; }

.drop { border: 1px dashed var(--line); border-radius: 12px; min-height: 160px; display: grid; place-items: center;
  text-align: center; color: var(--muted); overflow: hidden; margin-bottom: 12px; background: var(--card2); }
.drop p { margin: 0 16px; font-size: 14px; }
#preview { width: 100%; max-height: 320px; object-fit: contain; display: block; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.btn { appearance: none; border: 1px solid var(--line); background: var(--card2); border-radius: 12px; padding: 13px 16px;
  font: 700 15px Inter, sans-serif; cursor: pointer; text-align: center; text-decoration: none; display: inline-block; color: var(--text); }
.btn:hover { border-color: #3a3a41; }
.btn.primary { background: var(--acc); border-color: var(--acc); color: #04150f; width: 100%; font-size: 17px; }
.btn.primary:disabled { opacity: .3; cursor: not-allowed; }
.btn.small { padding: 10px 14px; font-size: 14px; flex: 0 0 auto; }

.looks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.look { position: relative; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; aspect-ratio: 3 / 4;
  background: var(--card2) center / cover no-repeat; cursor: pointer; padding: 0; color: var(--text); }
.look .emo { position: absolute; inset: 0; display: grid; place-items: center; font-size: 34px; font-style: normal; opacity: .9; }
.look.has-img .emo { display: none; }
.look span { position: absolute; left: 0; right: 0; bottom: 0; padding: 20px 6px 7px; font: 700 12px/1.25 Inter, sans-serif;
  background: linear-gradient(transparent, rgba(0, 0, 0, .9)); }
.look[aria-pressed="true"] { border-color: var(--acc); box-shadow: 0 0 0 2px var(--acc); }

.meta { color: var(--muted); font-size: 13px; margin: 10px 0 0; text-align: center; }
.meta.inline { display: inline; margin: 0 0 0 auto; font-weight: 400; }
.meta.ok { color: var(--acc); }
.meta.bad { color: var(--bad); }
input#code, input#key { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; color: var(--text); padding: 10px 12px;
  font: 600 16px Inter, sans-serif; min-width: 0; }
input#code { text-transform: uppercase; }
.tabs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; background: var(--bg); border: 1px solid var(--line);
  border-radius: 12px; padding: 4px; margin-bottom: 14px; }
.tabs button { appearance: none; border: 0; background: none; color: var(--muted); font: 700 13px Inter, sans-serif;
  padding: 9px 4px; border-radius: 9px; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--card2); color: var(--text); box-shadow: inset 0 -2px 0 var(--acc); }
.pane { margin-bottom: 14px; }
.pane .meta { text-align: left; }
.pool { margin: 0 0 8px; font-size: 15px; }
.pool b { font-size: 22px; color: var(--acc); }
.bar { height: 6px; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; width: 100%; background: var(--acc); transition: width .6s; }

/* output area with the stage overlay */
.out-h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.badge { font: 700 12px Inter, sans-serif; letter-spacing: .04em; text-transform: uppercase; padding: 4px 10px; border-radius: 99px;
  border: 1px solid var(--line); color: var(--muted); }
.badge.run { color: var(--acc); border-color: var(--acc); animation: breathe 1.8s ease-in-out infinite; }
.badge.ok { color: #04150f; background: var(--acc); border-color: var(--acc); }
@keyframes breathe { 50% { box-shadow: 0 0 0 6px rgba(36, 223, 165, .0), 0 0 18px rgba(36, 223, 165, .45); opacity: .6; } }
.frame { position: relative; border-radius: 12px; overflow: hidden; background: var(--card2); min-height: 280px; margin-bottom: 12px; }
.frame img { width: 100%; display: block; cursor: zoom-in; }
.frame.running img { filter: blur(14px) grayscale(.6) brightness(.5); transform: scale(1.06); cursor: default; }
.stage { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; padding: 24px; text-align: center; }
.stage-n { margin: 0; color: var(--acc); font: 700 12px Inter, sans-serif; letter-spacing: .08em; text-transform: uppercase; }
.stage-t { margin: 6px 0 14px; font: 800 22px/1.2 Inter, sans-serif; }
.stage .bar { max-width: 280px; width: 100%; margin: 0 auto; }
#outMore { margin-top: 10px; }

.err { background: rgba(255, 90, 90, .08); border: 1px solid rgba(255, 90, 90, .4); color: var(--bad); border-radius: 12px;
  padding: 12px 14px; font-size: 14px; }
.histList { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.histList a { display: block; aspect-ratio: 3 / 4; border-radius: 10px; overflow: hidden; border: 1px solid var(--line);
  background: var(--card2) center / cover no-repeat; }
footer { text-align: center; color: var(--muted); font-size: 12px; margin-top: 28px; }
footer p { margin: 4px 0; }
footer a { color: var(--muted); }

/* lightbox */
.lb { position: fixed; inset: 0; z-index: 10; background: rgba(0, 0, 0, .94); display: grid; place-items: center; touch-action: pan-y; }
.lb[hidden] { display: none; }
.lb img { max-width: 94vw; max-height: 88vh; border-radius: 10px; }
.lb button { appearance: none; position: absolute; border: 1px solid var(--line); background: rgba(18, 18, 20, .8); color: var(--text);
  border-radius: 99px; width: 44px; height: 44px; font: 400 26px/1 Inter, sans-serif; cursor: pointer; }
.lb-x { top: 14px; right: 14px; }
.lb-a { top: 50%; margin-top: -22px; }
.lb-a.prev { left: 10px; }
.lb-a.next { right: 10px; }
@media (max-width: 380px) { .looks { gap: 6px; } .tabs button { font-size: 12px; } }

/* language switch */
.langs { display: inline-flex; gap: 2px; padding: 3px; margin: 0 0 14px; border: 1px solid var(--line); border-radius: 99px;
  background: rgba(10, 10, 11, .6); }
.langs button { appearance: none; border: 0; background: none; color: var(--muted); font: 700 12px/1 Inter, sans-serif;
  letter-spacing: .04em; padding: 8px 12px; border-radius: 99px; cursor: pointer; }
.langs button[aria-pressed="true"] { background: var(--acc); color: #04150f; }
.langs button:focus-visible, .btn:focus-visible, .look:focus-visible, .tabs button:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.hero .eyebrow { display: table; margin: 0 auto 10px; }

/* the corner spider (spider.js moves it) */
.spider { position: fixed; z-index: 5; pointer-events: none; width: 44px; height: 44px;
  top: calc(env(safe-area-inset-top, 0px) - 6px); right: calc(env(safe-area-inset-right, 0px) + 18px); will-change: transform; }
.spider-body { display: block; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .8)); }
.spider-thread { position: absolute; left: 21px; bottom: 22px; width: 1px; background: #e8e8e6; opacity: 0; }
.spider.moving .legs.l { animation: legs .22s ease-in-out infinite alternate; transform-origin: -6px 0; }
.spider.moving .legs.r { animation: legs .22s ease-in-out infinite alternate-reverse; transform-origin: 6px 0; }
@keyframes legs { from { transform: rotate(-7deg); } to { transform: rotate(7deg); } }
.look span b { display: block; font-weight: 700; }
.look span small { display: block; margin-top: 2px; font: 500 11px/1.25 Inter, sans-serif; color: #c9c9cd; }

/* wider on desktop: the steps stay readable, the looks and the gallery use the room */
@media (min-width: 900px) {
  main { max-width: 1040px; padding-top: 48px; }
  .looks { grid-template-columns: repeat(6, 1fr); gap: 10px; }
  .out { max-width: 680px; margin-left: auto; margin-right: auto; }
  #preview { max-height: 420px; }
  .hero-bg { height: 640px; }
  h1 img { width: min(100%, 520px); }
}

/* explanation sections */
.explain { margin-top: 44px; }
.explain h2 { font-size: 22px; font-weight: 800; margin: 0 0 14px; }
.explain-p { color: var(--muted); margin: -6px 0 16px; font-size: 14px; }
.how { list-style: none; counter-reset: how; margin: 0 0 18px; padding: 0; display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.how li { counter-increment: how; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.how li::before { content: counter(how); display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--acc); color: #04150f; font: 700 12px Inter, sans-serif; margin-bottom: 10px; }
.how h3 { margin: 0 0 4px; font-size: 16px; }
.how p { margin: 0; color: var(--muted); font-size: 14px; }
.stampcmp { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 560px; }
.stampcmp figure { margin: 0; }
.stampcmp img { width: 100%; height: auto; display: block; border-radius: 12px; border: 1px solid var(--line); }
.stampcmp figcaption { color: var(--muted); font-size: 13px; margin-top: 6px; text-align: center; }
.gallery { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.gcard { appearance: none; text-align: left; padding: 0; cursor: pointer; color: var(--text); background: var(--card);
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; font: inherit; }
.gcard:hover { border-color: #3a3a41; }
.gcard:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.gcard img { width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; display: block; }
.gmeta { padding: 12px 14px 16px; display: grid; gap: 4px; }
.gmeta small { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.gmeta b { font-size: 16px; }
.gmeta span { color: #c9c9cd; font-size: 13px; line-height: 1.45; }
footer a { color: var(--acc); text-decoration: none; font-weight: 700; }
.consent { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; padding: 12px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--card2); font-size: 14px; line-height: 1.4; cursor: pointer; }
.consent input { width: 20px; height: 20px; margin: 0; flex: 0 0 auto; accent-color: var(--acc); }
.linkbtn { appearance: none; background: none; border: 0; color: var(--muted); font: 500 13px Inter, sans-serif; text-decoration: underline;
  text-underline-offset: 3px; cursor: pointer; display: block; margin: 12px auto 0; }
.priv { margin: 0; padding-left: 18px; display: grid; gap: 8px; color: #c9c9cd; font-size: 14px; max-width: 70ch; }

/* "Take a selfie" only on touch devices; desktops get the file picker alone */
@media (hover: hover) and (pointer: fine) { .cam-btn { display: none; } }

/* consent nudge: orange and blinking until ticked */
.consent.nudge { border-color: #ff8a1f; background: rgba(255, 138, 31, .12); color: #ffd2a6; animation: nudge 1s ease-in-out infinite; }
.consent.nudge input { accent-color: #ff8a1f; outline: 2px solid #ff8a1f; outline-offset: 2px; }
@keyframes nudge { 50% { box-shadow: 0 0 0 4px rgba(255, 138, 31, .35); border-color: #ffb066; } }
@media (prefers-reduced-motion: reduce) { .consent.nudge { animation: none; } }

/* start button: orange and pulsing once photo, consent, look and access are all set */
.btn.primary.go { background: #ff8a1f; border-color: #ff8a1f; color: #1a0b00; animation: gopulse 1.3s ease-in-out infinite; }
@keyframes gopulse { 50% { box-shadow: 0 0 0 7px rgba(255, 138, 31, .28), 0 0 26px rgba(255, 138, 31, .5); transform: scale(1.015); } }
@media (prefers-reduced-motion: reduce) { .btn.primary.go { animation: none; } }

footer .legal-links a { color: var(--muted); font-weight: 500; }
.explain-p a { color: var(--acc); }
