:root {
  color-scheme: dark;
  --bg: #21191b;
  --surface: #2b2224;
  --surface-2: #352a2c;
  --paper: #eee3d4;
  --ink: #332729;
  --text: #f7eee6;
  --muted: #c3b4ad;
  --faint: #8f7f7a;
  --line: rgba(247, 238, 230, 0.14);
  --accent: #e7a88f;
  --accent-dark: #925d50;
  --danger: #e29382;
  --success: #afc4a8;
  --radius: 18px;
  --radius-small: 12px;
  --radius-pill: 999px;
  --safe-bottom: max(20px, env(safe-area-inset-bottom));
  font-family: ui-rounded, "SF Pro Rounded", "Avenir Next", Avenir, "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--bg); scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background: linear-gradient(rgba(33, 25, 27, 0.80), rgba(33, 25, 27, 0.94)), url("assets/archive-texture.jpg") center / cover;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: 0.08;
  background-image: url("assets/archive-texture.jpg");
  background-size: 700px auto;
  mix-blend-mode: soft-light;
}

button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.skip-link {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 100;
  padding: 12px 16px;
  background: var(--accent);
  color: var(--ink);
}
.skip-link:focus { top: 16px; }

.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 8% 18%, rgba(231, 168, 143, 0.16), transparent 28%),
    radial-gradient(circle at 90% 78%, rgba(175, 196, 168, 0.07), transparent 32%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 68px;
  padding: max(10px, env(safe-area-inset-top)) 16px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(33, 25, 27, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand-button, .archive-button, .icon-button {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.brand-button { display: grid; gap: 1px; text-align: left; padding: 0; }
.brand-button span { font-weight: 750; letter-spacing: -0.025em; }
.brand-button small { color: var(--muted); font-size: 9px; letter-spacing: 0.04em; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.icon-button { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; }
.archive-button { height: 40px; padding: 0 14px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: var(--radius-pill); font-size: 10px; letter-spacing: 0.03em; }
.archive-button b { color: var(--accent); }

#app { width: min(100%, 1120px); margin: 0 auto; min-height: calc(100dvh - 68px); }

.screen {
  min-height: calc(100dvh - 68px);
  padding: 30px 18px calc(92px + var(--safe-bottom));
  animation: screen-in 560ms cubic-bezier(.16, 1, .3, 1) both;
}

.intro-screen {
  min-height: 100dvh;
  padding: max(28px, env(safe-area-inset-top)) 20px var(--safe-bottom);
  display: grid;
  align-content: space-between;
}

.intro-mast { display: flex; justify-content: space-between; align-items: flex-start; }
.classification { color: var(--accent); font-size: 11px; font-weight: 750; letter-spacing: 0.08em; }
.case-number { color: var(--muted); font-size: 10px; line-height: 1.35; text-align: right; }
.intro-center { width: 100%; max-width: 820px; margin: 30px auto; display: grid; gap: 28px; }
.hero-lockup { display: grid; gap: 8px; }
.hero-lockup .akte { color: var(--accent); font-size: clamp(4.9rem, 25vw, 11rem); font-weight: 780; letter-spacing: -0.075em; line-height: 0.76; }
.hero-lockup .thirty { font-size: clamp(4.8rem, 25vw, 11rem); font-weight: 250; letter-spacing: -0.09em; line-height: 0.84; color: transparent; -webkit-text-stroke: 1px rgba(238, 233, 223, 0.47); }
.intro-copy { max-width: 600px; display: grid; gap: 12px; }
.status-line { display: flex; align-items: center; gap: 10px; color: var(--accent); font-size: 10px; font-weight: 750; line-height: 1.2; letter-spacing: 0.06em; }
.status-line::before { content: ""; width: 24px; height: 1px; background: currentColor; }
.intro-copy h1 { margin: 0; font-size: clamp(2rem, 9vw, 4.3rem); line-height: 1.02; letter-spacing: -0.045em; max-width: 13ch; text-wrap: balance; }
.intro-copy p { margin: 2px 0 0; color: #c3bdb2; line-height: 1.6; max-width: 49ch; }
.intro-action { display: grid; gap: 16px; }
.memory-trail { height: 46px; display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.memory-trail span { width: 8px; height: 8px; border-radius: 50%; background: rgba(247,238,230,.18); animation: memory-breathe 2.8s ease-in-out infinite; }
.memory-trail span:nth-child(2) { animation-delay: 120ms; }
.memory-trail span:nth-child(3) { animation-delay: 240ms; }
.memory-trail span:nth-child(4) { animation-delay: 360ms; }
.memory-trail span:nth-child(5) { animation-delay: 480ms; }
.memory-trail span:nth-child(6) { animation-delay: 600ms; }

.primary-button, .secondary-button {
  min-height: 54px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  padding: 15px 18px;
  cursor: pointer;
  font-weight: 750;
  letter-spacing: 0.02em;
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease;
}
.primary-button { color: var(--ink); background: var(--accent); }
.primary-button:hover { background: #efbca7; }
.primary-button:active, .secondary-button:active, .icon-button:active, .archive-button:active { transform: scale(.98); }
.secondary-button { color: var(--text); background: rgba(247,238,230,.035); border-color: var(--line); }
.secondary-button:hover { border-color: rgba(231,168,143,.6); }
.primary-button[disabled] { cursor: not-allowed; opacity: .42; }

.progress-shell { margin-bottom: 28px; }
.progress-meta { display: flex; justify-content: space-between; gap: 14px; color: var(--muted); font-size: 10px; line-height: 1.2; letter-spacing: .04em; }
.progress-dots { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-top: 12px; }
.progress-dot { height: 5px; border-radius: var(--radius-pill); background: rgba(247,238,230,.13); }
.progress-dot.done { background: var(--accent); }
.progress-dot.current { background: var(--paper); animation: current-pulse 1.8s ease-in-out infinite; }

.case-layout { display: grid; gap: 26px; }
.case-copy { display: grid; align-content: start; gap: 12px; }
.micro-label { color: var(--accent); font-size: 11px; font-weight: 700; line-height: 1.3; letter-spacing: .045em; }
.case-copy h1, .final-copy h1, .interlude h1 { margin: 0; font-size: clamp(2.4rem, 11vw, 4.8rem); line-height: 1.01; letter-spacing: -.045em; text-wrap: balance; }
.case-copy p, .final-copy p { margin: 4px 0 0; color: #beb7ab; line-height: 1.55; max-width: 56ch; }

.puzzle-panel { display: grid; gap: 18px; min-width: 0; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.25; letter-spacing: .025em; }
.panel-head strong { color: var(--text); }
.feedback { min-height: 24px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.feedback.error { color: #e29a8c; }
.feedback.success { color: var(--success); }
.action-row { display: grid; gap: 10px; }

.timeline-list { display: grid; gap: 10px; }
.timeline-card {
  display: grid;
  grid-template-columns: 82px 1fr auto;
  min-height: 90px;
  align-items: center;
  background: rgba(53,42,44,.8);
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  overflow: hidden;
  touch-action: none;
}
.timeline-card.dragging { opacity: .5; border-color: var(--accent); }
.photo-thumb, .photo-frame { position: relative; background: #26231f center / cover no-repeat; overflow: hidden; }
.photo-thumb { height: 100%; min-height: 88px; }
.photo-thumb.missing::after, .photo-frame.missing::after {
  content: attr(data-placeholder);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 10px;
  color: rgba(238,233,223,.7);
  background: linear-gradient(rgba(17,16,14,.35), rgba(17,16,14,.78)), url("assets/archive-texture.jpg") center / cover;
  font: 9px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .08em;
  text-align: center;
  pointer-events: none;
}
.timeline-info { padding: 14px; display: grid; align-content: center; }
.timeline-info strong { font-size: 15px; }
.move-buttons { display: grid; height: 100%; border-left: 1px solid var(--line); }
.move-buttons button { width: 44px; border: 0; color: var(--muted); background: transparent; cursor: pointer; }
.move-buttons button + button { border-top: 1px solid var(--line); }

.quiz-card { display: grid; gap: 16px; }
.quiz-photo { height: 190px; border: 1px solid var(--line); border-radius: var(--radius); }
.quiz-navigation { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 30px; }
.question-count { color: var(--accent); font-size: 10px; font-weight: 700; line-height: 1; letter-spacing: .04em; }
.quiz-back { min-height: 30px; padding: 5px 10px; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: var(--radius-pill); font-size: 10px; font-weight: 700; letter-spacing: .035em; cursor: pointer; }
.quiz-back:hover { color: var(--text); border-color: rgba(231,168,143,.55); }
.quiz-card h2 { margin: 0; font-size: clamp(1.35rem, 6vw, 2rem); line-height: 1.15; letter-spacing: -.025em; }
.answer-list { display: grid; gap: 9px; }
.answer-button { min-height: 52px; padding: 13px 15px; text-align: left; border: 1px solid var(--line); border-radius: var(--radius-small); background: rgba(53,42,44,.72); cursor: pointer; }
.answer-button:hover, .answer-button.selected { border-color: var(--accent); background: rgba(231,168,143,.1); }
.answer-button.wrong { border-color: var(--danger); animation: nudge 240ms ease; }

.difference-wrap { display: grid; gap: 12px; }
.comparison { display: grid; grid-template-columns: 1fr; gap: 14px; }
.comparison figure { margin: 0; display: grid; gap: 7px; }
.comparison figcaption { color: var(--muted); font: 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; }
.photo-frame { aspect-ratio: 4/5; border: 1px solid var(--line); border-radius: var(--radius); background-size: cover; }
.comparison .photo-frame { aspect-ratio: 4 / 3; }
.hotspot { position: absolute; width: 48px; height: 48px; transform: translate(-50%, -50%); border: 0; border-radius: 50%; background: transparent; cursor: crosshair; }
.hotspot.found { border: 1px solid var(--accent); background: rgba(231,168,143,.14); animation: found 360ms ease both; }
.found-count { color: var(--accent); font-size: 13px; font-weight: 750; line-height: 1; font-variant-numeric: tabular-nums; }

.place-image { height: min(50vh, 420px); border: 1px solid var(--line); border-radius: var(--radius); transition: filter 600ms ease; }
.hint-list { display: grid; gap: 8px; }
.hint { margin: 0; padding: 12px 0; border-bottom: 1px solid var(--line); color: #c4bdb1; font-size: 14px; line-height: 1.45; }
.hint b { display: block; margin-bottom: 5px; color: var(--accent); font: 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .1em; }
.input-group { display: grid; gap: 8px; }
.input-group label { color: var(--muted); font-size: 12px; }
.text-input, .digit-input {
  width: 100%;
  min-height: 54px;
  border: 1px solid rgba(238,233,223,.28);
  border-radius: var(--radius-small);
  background: rgba(33,25,27,.8);
  color: var(--text);
  padding: 13px 15px;
}
.text-input::placeholder { color: #827c72; }

.word-bank { display: flex; flex-wrap: wrap; gap: 9px; min-height: 64px; padding: 12px; border: 1px dashed rgba(247,238,230,.22); border-radius: var(--radius); }
.word-chip { min-height: 44px; padding: 10px 14px; border: 1px solid rgba(247,238,230,.22); border-radius: var(--radius-pill); background: var(--surface-2); cursor: grab; }
.word-chip.selected { color: var(--ink); background: var(--accent); border-color: var(--accent); }
.phrase-line { min-height: 76px; padding: 15px; border-left: 2px solid var(--accent); background: rgba(231,168,143,.06); font-size: 20px; line-height: 1.45; }
.phrase-line .empty-copy { color: var(--faint); font-size: 14px; }

.connection-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.connection-card { min-height: 122px; padding: 16px; display: grid; align-content: space-between; text-align: left; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(53,42,44,.76); cursor: pointer; }
.connection-card .symbol { color: var(--accent); font-size: 31px; }
.connection-card span:last-child { color: #cac4b8; }
.connection-card.selected { border-color: var(--accent); background: rgba(231,168,143,.11); box-shadow: inset 0 0 0 1px rgba(231,168,143,.28); }

.interlude { min-height: calc(100dvh - 68px); padding: 32px 20px calc(40px + var(--safe-bottom)); display: grid; align-content: center; gap: 34px; }
.interlude .seal { width: 112px; height: 112px; padding: 13px; display: grid; place-items: center; border: 1px solid var(--accent); border-radius: 50%; color: var(--accent); font-size: 11px; font-weight: 750; line-height: 1.3; text-align: center; transform: rotate(-5deg); }
.interlude p { max-width: 18ch; margin: 0; color: #c8c1b5; font-size: clamp(1.25rem, 6vw, 2rem); line-height: 1.25; }

.evidence-reveal { min-height: calc(100dvh - 68px); padding: 30px 20px calc(40px + var(--safe-bottom)); display: grid; align-content: center; gap: 26px; }
.evidence-card { position: relative; padding: 26px 22px; min-height: 310px; display: grid; align-content: space-between; background: var(--paper); color: var(--ink); border-radius: var(--radius); transform: rotate(-1deg); box-shadow: 0 24px 70px rgba(44,25,28,.34); }
.evidence-card::before { content: ""; position: absolute; inset: 8px; border: 1px solid rgba(22,21,17,.18); pointer-events: none; }
.evidence-card .symbol { color: var(--accent-dark); font-size: 70px; }
.evidence-card h1 { margin: 0; max-width: 9ch; font-size: clamp(2.2rem, 11vw, 4.5rem); line-height: .92; letter-spacing: -.055em; }
.evidence-card p { margin: 10px 0 0; max-width: 34ch; color: #5b554a; line-height: 1.45; }
.evidence-number { position: absolute; right: 20px; top: 20px; color: #786965; font-size: 9px; font-weight: 700; line-height: 1; letter-spacing: .05em; }

.archive-dialog { width: min(calc(100% - 24px), 860px); max-height: calc(100dvh - 24px); padding: 0; overflow: auto; color: var(--text); background: var(--surface); border: 1px solid rgba(247,238,230,.18); border-radius: var(--radius); box-shadow: 0 30px 100px rgba(44,25,28,.62); }
.archive-dialog::backdrop { background: rgba(4,4,3,.76); backdrop-filter: blur(5px); }
.dialog-head { position: sticky; top: 0; z-index: 1; padding: 20px; display: flex; justify-content: space-between; align-items: flex-start; background: rgba(43,34,36,.96); border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 5px 0 0; font-size: 2rem; letter-spacing: -.04em; }
.evidence-grid { padding: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.mini-evidence { min-height: 164px; padding: 14px; display: grid; align-content: space-between; background: var(--paper); color: var(--ink); border-radius: var(--radius-small); }
.mini-evidence.locked { background: #352a2c; color: var(--faint); border: 1px dashed var(--line); }
.mini-evidence .symbol { color: var(--accent-dark); font-size: 29px; }
.mini-evidence.locked .symbol { color: var(--faint); }
.mini-evidence small { font: 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .07em; }
.mini-evidence strong { display: block; margin-top: 6px; font-size: 15px; line-height: 1.15; }
.mini-evidence p { margin: 7px 0 0; color: #5b554a; font-size: 11px; line-height: 1.35; }
.mini-evidence.locked p { color: var(--faint); }
.dialog-note { margin: 0; padding: 4px 20px 24px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.album-section { padding: 26px 14px 18px; border-top: 1px solid var(--line); }
.album-heading { padding: 0 6px 16px; }
.album-heading h3 { margin: 5px 0 0; font-size: clamp(1.65rem, 7vw, 2.4rem); line-height: 1; letter-spacing: -.04em; }
.photo-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.memory-photo { position: relative; min-width: 0; margin: 0; aspect-ratio: 4 / 5; overflow: hidden; border-radius: var(--radius-small); background: var(--surface-2); }
.memory-photo-wide { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
.memory-photo img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform 500ms cubic-bezier(.16,1,.3,1); }
.memory-photo:hover img { transform: scale(1.025); }
.memory-photo figcaption { position: absolute; inset: auto 0 0; padding: 34px 12px 11px; display: grid; gap: 3px; background: linear-gradient(transparent, rgba(26,18,20,.86)); }
.memory-photo figcaption span { color: var(--accent); font-size: 9px; font-weight: 750; letter-spacing: .04em; }
.memory-photo figcaption strong { font-size: 12px; line-height: 1.2; }

.final-screen { padding-bottom: calc(60px + var(--safe-bottom)); }
.final-copy { display: grid; gap: 12px; margin-bottom: 28px; }
.final-evidence { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.hint-box { margin: 22px 0; padding: 20px; border: 1px solid rgba(231,168,143,.24); border-radius: var(--radius); background: rgba(231,168,143,.07); }
.hint-box span { color: var(--accent); font-size: 10px; font-weight: 700; line-height: 1; letter-spacing: .04em; }
.hint-box p { margin: 9px 0 0; color: #d6cfc3; line-height: 1.5; }
.code-form { padding-top: 24px; display: grid; gap: 16px; border-top: 1px solid var(--line); }
.code-form h2 { margin: 0; font-size: 1.5rem; letter-spacing: -.03em; }
.digit-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.digit-input { min-height: 76px; padding: 6px; text-align: center; font-size: 2.3rem; font-weight: 650; line-height: 1; font-variant-numeric: tabular-nums; caret-color: var(--accent); }
.digit-input.invalid { border-color: var(--danger); animation: nudge 240ms ease; }

.success-screen { min-height: 100dvh; padding: max(28px, env(safe-area-inset-top)) 20px var(--safe-bottom); display: grid; align-content: center; gap: 34px; text-align: center; }
.success-mark { width: 98px; height: 98px; margin: 0 auto; display: grid; place-items: center; color: var(--success); border: 1px solid var(--success); border-radius: 50%; font-size: 38px; animation: success-pop 700ms cubic-bezier(.16,1,.3,1) both; }
.success-screen h1 { margin: 0 auto; max-width: 14ch; font-size: clamp(2.2rem, 11vw, 5rem); line-height: .94; letter-spacing: -.06em; }
.success-screen .lead { margin: 0; color: var(--accent); font-weight: 700; }
.final-code { display: flex; justify-content: center; gap: 10px; }
.final-code span { width: 68px; height: 82px; display: grid; place-items: center; color: var(--ink); background: var(--paper); border-radius: var(--radius-small); font-size: 2.6rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; box-shadow: 0 16px 40px rgba(44,25,28,.25); }
.success-body { margin: 0 auto; color: #c8c1b5; line-height: 1.58; max-width: 48ch; }
.lock-instruction { padding-top: 24px; border-top: 1px solid var(--line); }
.lock-instruction h2 { margin: 0 0 8px; color: var(--accent); font-size: clamp(1.6rem, 8vw, 2.8rem); letter-spacing: -.035em; }
.lock-instruction p { margin: 0; color: var(--muted); }
.bonus-video { width: min(100%, 760px); margin: 4px auto 0; overflow: hidden; display: grid; gap: 0; text-align: left; background: rgba(53,42,44,.78); border: 1px solid rgba(231,168,143,.34); border-radius: var(--radius); box-shadow: 0 24px 70px rgba(19,12,14,.28); }
.bonus-copy { padding: 22px; }
.bonus-copy h2 { margin: 7px 0 0; font-size: clamp(1.55rem, 7vw, 2.5rem); line-height: 1.05; letter-spacing: -.04em; }
.bonus-copy p { margin: 9px 0 0; color: var(--muted); line-height: 1.5; }
.bonus-video video { width: 100%; max-height: 70vh; display: block; background: #171214; object-fit: contain; }

.celebration-screen {
  position: relative;
  isolation: isolate;
  min-height: 100dvh;
  padding: max(48px, env(safe-area-inset-top)) 20px calc(50px + var(--safe-bottom));
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 16%, rgba(231,168,143,.28), transparent 32%),
    radial-gradient(circle at 12% 72%, rgba(175,196,168,.15), transparent 30%),
    #21191b;
}
.celebration-content { position: relative; z-index: 2; width: min(100%, 820px); display: grid; justify-items: center; gap: 24px; text-align: center; }
.celebration-heart { width: 92px; height: 92px; display: grid; place-items: center; color: #f2b7ab; border: 1px solid rgba(242,183,171,.52); border-radius: 50%; font-size: 45px; box-shadow: 0 0 70px rgba(231,168,143,.24); animation: heart-beat 1.8s ease-in-out infinite; }
.celebration-screen h1 { margin: 0; max-width: 13ch; font-size: clamp(2.8rem, 12vw, 6.8rem); line-height: .9; letter-spacing: -.065em; text-wrap: balance; }
.celebration-message { max-width: 46ch; margin: 0; color: #d8cec5; font-size: clamp(1.05rem, 4vw, 1.35rem); line-height: 1.65; text-wrap: balance; }
.celebration-signature { display: grid; gap: 7px; padding: 18px 28px; color: var(--ink); background: var(--paper); border-radius: var(--radius-pill); box-shadow: 0 16px 48px rgba(15,9,10,.24); }
.celebration-signature strong { font-size: clamp(1rem, 4.2vw, 1.22rem); }
.celebration-signature span { color: var(--accent-dark); font-size: 12px; font-weight: 700; }
.celebration-effects { position: absolute; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; }
.celebration-effects > span { position: absolute; left: var(--x); top: -12%; animation: celebration-fall var(--duration) linear var(--delay) infinite; }
.confetti-particle { width: 9px; height: 20px; border-radius: 3px; background: var(--accent); transform: rotate(var(--rotation)); }
.confetti-particle:nth-child(3n) { background: var(--success); }
.confetti-particle:nth-child(4n) { background: #eee3d4; }
.heart-particle { color: #f2b7ab; font-size: 20px; text-shadow: 0 0 18px rgba(242,183,171,.35); }

.toast { position: fixed; left: 50%; bottom: calc(18px + var(--safe-bottom)); z-index: 50; width: min(calc(100% - 32px), 440px); padding: 13px 16px; color: var(--ink); background: var(--paper); border-radius: var(--radius-pill); box-shadow: 0 18px 50px rgba(44,25,28,.42); text-align: center; font-size: 13px; transform: translate(-50%, 140%); opacity: 0; transition: transform 350ms cubic-bezier(.16,1,.3,1), opacity 250ms ease; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

@keyframes screen-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes memory-breathe { 0%, 100% { background: rgba(247,238,230,.16); transform: scale(.82); } 50% { background: var(--accent); transform: scale(1); } }
@keyframes current-pulse { 50% { opacity: .35; } }
@keyframes nudge { 33% { transform: translateX(-4px); } 66% { transform: translateX(4px); } }
@keyframes found { from { opacity: 0; transform: translate(-50%,-50%) scale(.45); } to { opacity: 1; transform: translate(-50%,-50%) scale(1); } }
@keyframes success-pop { from { opacity: 0; transform: scale(.55) rotate(-15deg); } to { opacity: 1; transform: none; } }
@keyframes celebration-fall { from { transform: translate3d(-20px,-10vh,0) rotate(0); opacity: 0; } 10% { opacity: .85; } to { transform: translate3d(55px,118vh,0) rotate(560deg); opacity: .12; } }
@keyframes heart-beat { 0%, 100% { transform: scale(1); } 48% { transform: scale(1.08); } }

@media (min-width: 768px) {
  .topbar { padding-inline: 28px; }
  .screen { padding: 54px 32px 90px; }
  .case-layout { grid-template-columns: minmax(250px, .72fr) minmax(390px, 1.28fr); gap: clamp(44px, 8vw, 110px); align-items: start; }
  .case-copy { position: sticky; top: 118px; }
  .action-row { grid-template-columns: 1fr auto; }
  .primary-button { min-width: 220px; }
  .intro-screen { padding: 38px 42px 34px; }
  .intro-center { grid-template-columns: .85fr 1.15fr; align-items: end; }
  .intro-action { grid-template-columns: 1fr auto; align-items: center; }
  .connection-grid { grid-template-columns: repeat(3, 1fr); }
  .comparison { grid-template-columns: 1fr 1fr; gap: 10px; }
  .evidence-grid { grid-template-columns: repeat(3, 1fr); }
  .photo-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .memory-photo-wide { grid-column: span 2; }
  .final-evidence { grid-template-columns: repeat(3, 1fr); }
  .evidence-reveal { width: min(100%, 720px); margin: 0 auto; }
  .evidence-card { min-height: 400px; padding: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (prefers-reduced-transparency: reduce) {
  .topbar, .archive-dialog::backdrop { backdrop-filter: none; }
  .topbar { background: var(--bg); }
}
