:root {
  --bg: #000000;
  --ink: #f5f5f5;
  --muted: #a3a3a3;
  --dim: #737373;
  --line: rgba(255, 255, 255, 0.14);
  --line-soft: rgba(255, 255, 255, 0.08);
  --ochre: #b88337;
  --ochre-dim: rgba(184, 131, 55, 0.22);
  --ochre-line: rgba(184, 131, 55, 0.45);
  --paper: #171717;
  --danger: #d4d4d4;
  --phone: 430px;
  --font-display: "FF Trixie Pro", "Special Elite", "Times New Roman", serif;
  --font-body: "Lumios Typewriter Used", "Lumios Typewriter Old", "Special Elite", "Courier New", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: #0a0a0a; color: var(--ink); }
body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
img { max-width: 100%; display: block; }

.shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 1100px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
}

.stage-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 24px 16px 48px;
}
.phone {
  width: min(100%, var(--phone));
  min-height: 100dvh;
  background: var(--bg);
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  box-shadow: none;
}
@media (min-width: 720px) {
  .phone {
    min-height: 844px;
    height: 844px;
    border: 1px solid var(--line);
    overflow: auto;
  }
  .stage-wrap { min-height: 100dvh; align-items: center; }
}

.screen {
  min-height: 100%;
  padding: 28px 22px 28px;
  display: flex;
  flex-direction: column;
}
.screen.padded-bottom { padding-bottom: 118px; }

.kicker {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ochre);
  margin: 0 0 14px;
}
.wordmark {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 28px;
  letter-spacing: 0.12em;
  color: var(--ochre);
  margin: 0;
}
.rule {
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 22px 0;
}
.rule.ochre { background: var(--ochre-line); width: 42px; margin: 18px 0; }

h1, h2, .title {
  font-family: var(--font-body);
  font-weight: 400;
  letter-spacing: 0.02em;
  margin: 0;
}
.title { font-size: 22px; line-height: 1.3; }
.sub {
  color: var(--muted);
  font-size: 14px;
  margin: 12px 0 0;
  overflow-wrap: anywhere;
}
.copy {
  font-size: 15px;
  color: #e7e7e7;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-wrap;
}
.copy p { margin: 0 0 14px; }
.copy p:last-child { margin-bottom: 0; }

.grow { flex: 1; }
.spacer { height: 18px; }

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
  width: 100%;
  text-align: center;
  overflow-wrap: anywhere;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn.primary {
  border-color: var(--ochre);
  color: var(--ochre);
}
.btn.primary:hover, .btn.primary.is-on {
  background: var(--ochre);
  color: #111;
}
.btn.ghost { border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { border-color: #fff; }
.btn[disabled] { opacity: 0.35; cursor: not-allowed; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-stack { display: grid; gap: 10px; }

.hint {
  font-size: 13px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* Splash */
.splash { justify-content: flex-start; text-align: center; padding-top: 36px; }
.splash .lede {
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #fff;
  margin: 0 0 8px;
}
.splash .setname {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 300;
  color: #fff;
  margin: 0 0 8px;
}
.comp-wrap {
  position: relative;
  margin: 8px auto 0;
  width: min(100%, 320px);
}
.splash .comp-wrap {
  margin-top: auto;
  margin-bottom: auto;
}
.comp-wrap img {
  width: 100%;
  height: auto;
}
.splash .comp-wrap:not(.splash-anim) img {
  animation: matrixPulse 3.6s ease-in-out infinite;
}
.comp-wrap canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.55;
}
.splash-anim {
  aspect-ratio: 510 / 680;
  overflow: hidden;
}
.splash-anim iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: none;
  overflow: hidden;
}
@keyframes matrixPulse {
  0%, 100% { opacity: 1; filter: brightness(1); }
  18% { opacity: 0.92; filter: brightness(1.25); }
  22% { opacity: 1; filter: brightness(1); }
  71% { opacity: 0.86; filter: brightness(1.45); }
  76% { opacity: 1; }
}

.tap { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim); }

/* Video frame */
.video-frame {
  border: 1px solid var(--line);
  aspect-ratio: 9 / 16;
  max-height: 36dvh;
  width: min(100%, 220px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 22px 16px;
  color: var(--muted);
  font-size: 13px;
  position: relative;
  background: #070707;
}
.video-frame strong {
  display: block;
  color: var(--ink);
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 11px;
  margin-bottom: 10px;
}
.video-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.video-controls .btn { min-height: 40px; font-size: 11px; }

.typed-box { min-height: 8em; }
.caret {
  display: inline-block;
  width: 0.55em;
  border-bottom: 1px solid var(--ochre);
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Course */
.course-no {
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ochre);
}
.composition {
  font-size: 16px;
  line-height: 1.55;
  color: #fff;
  overflow-wrap: anywhere;
  margin: 14px 0 0;
}
.idea-label {
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ochre);
  margin: 0 0 10px;
}
.idea {
  font-size: 15px;
  line-height: 1.55;
  color: #dedede;
  overflow-wrap: anywhere;
}
.progress {
  display: flex;
  gap: 6px;
  margin: 6px 0 18px;
}
.progress i {
  display: block;
  height: 1px;
  flex: 1;
  background: var(--line-soft);
}
.progress i.on { background: var(--ochre); }
.progress i.done { background: rgba(255,255,255,.45); }

.dock {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 28px -22px -28px;
  padding: 14px 22px 18px;
  background: linear-gradient(180deg, rgba(0,0,0,0), #000 28%);
  display: grid;
  gap: 10px;
}
.rate .btn.is-on.like { background: var(--ochre); color: #111; border-color: var(--ochre); }
.rate .btn.is-on.dislike { background: #fff; color: #111; border-color: #fff; }

.dialog {
  border: 1px solid var(--line);
  padding: 18px 16px;
  margin-top: 16px;
}
.line { margin: 0 0 16px; }
.line .who {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ochre);
  margin-bottom: 4px;
}
.score-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line-soft);
  padding: 14px 0;
  overflow-wrap: anywhere;
}
.score-row b { color: var(--ochre); font-weight: 400; white-space: nowrap; }
.authors li {
  list-style: none;
  border-bottom: 1px solid var(--line-soft);
  padding: 16px 0;
}
.authors { margin: 0; padding: 0; }
.authors .n { color: var(--ochre); font-size: 11px; letter-spacing: 0.18em; }
.authors .name { margin: 6px 0 8px; overflow-wrap: anywhere; }
.authors .who { color: var(--muted); font-size: 13px; }
.authors .comp { color: var(--dim); font-size: 13px; overflow-wrap: anywhere; margin-top: 6px; }

.missing {
  border: 1px dashed var(--line);
  color: var(--muted);
  font-size: 13px;
  padding: 14px;
  margin: 14px 0;
  overflow-wrap: anywhere;
}

.variant-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  pointer-events: none;
}

/* Notes rail — not guest UI */
.notes {
  display: none;
  background: #111;
  color: #d6d6d6;
  border-left: 1px solid #2a2a2a;
  padding: 22px 20px 40px;
  overflow: auto;
  max-height: 100dvh;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13.5px;
  line-height: 1.45;
}
@media (min-width: 1100px) { .notes { display: block; } }
.notes h2 {
  font-size: 16px;
  margin: 0 0 10px;
  color: #fff;
  letter-spacing: 0;
  font-family: Georgia, serif;
  font-weight: 600;
}
.notes h3 { font-size: 13px; margin: 18px 0 8px; color: var(--ochre); font-family: Georgia, serif; }
.notes p, .notes li { color: #c8c8c8; }
.notes ol, .notes ul { padding-left: 18px; margin: 0 0 10px; }
.notes .navbtns { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 14px; }
.notes .navbtns button {
  border: 1px solid #3a3a3a;
  padding: 6px 8px;
  font-size: 11px;
  font-family: system-ui, sans-serif;
  color: #ddd;
}
.notes .navbtns button.on { border-color: var(--ochre); color: var(--ochre); }
.notes .compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 8px 0 16px;
}
.notes .compare figure {
  margin: 0;
  background: #000;
  border: 1px solid #333;
  padding: 8px;
}
.notes .compare img { width: 100%; }
.notes .compare figcaption {
  font-size: 11px;
  color: #999;
  margin-top: 6px;
  font-family: system-ui, sans-serif;
}
.notes .warn { color: #e2c48a; }
body.shot .chip,
body.shot .notes { display: none !important; }
body.shot .shell { grid-template-columns: 1fr; }
body.shot .stage-wrap { padding: 0; }
body.shot .phone {
  width: 100%;
  min-height: 100dvh;
  height: auto;
  border: 0;
}

@media (max-width: 430px) {
  .screen { padding: 24px 16px 28px; }
  .screen.padded-bottom { padding-bottom: 118px; }
  .btn { font-size: 11px; letter-spacing: 0.04em; padding: 12px 8px; }
  .dock { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; }
  .composition, .idea, .copy, .hint { overflow-wrap: anywhere; word-break: break-word; }
}

.chip {
  position: fixed;
  right: 12px;
  top: 12px;
  bottom: auto;
  z-index: 20;
  background: #1a1a1a;
  border: 1px solid #444;
  color: #ccc;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 10px;
  font-family: system-ui, sans-serif;
}
@media (min-width: 1100px) { .chip { display: none; } }
.notes.open {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 30;
  max-height: none;
}
.close-notes {
  display: none;
  margin-bottom: 12px;
  border: 1px solid #444;
  padding: 8px 10px;
  font-family: system-ui, sans-serif;
  font-size: 12px;
}
.notes.open .close-notes { display: inline-block; }

.finish-note {
  margin-top: 12px;
  font-size: 12px;
  color: #c9b27a;
  border: 1px dashed var(--ochre-line);
  padding: 10px 12px;
  font-family: system-ui, sans-serif;
  letter-spacing: 0;
  text-transform: none;
}
