/* Mooku — palette and control language from Mooku-ios Theme.swift / DESIGN_DIRECTION.md */
:root {
  --kiwi: #D8F34A;
  --lime: #EAF3A2;
  --teal: #36C9DE;
  --punch: #FF6240;
  --tangerine: #FFB547;
  --paper: #EDEAE0;
  --ink: #171917;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--ink); font-family: var(--mono); font-size: 15px; line-height: 1.55; }
a { color: inherit; }
img { max-width: 100%; display: block; }

/* ---------- Paper pages ---------- */
body.paper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--paper);
  background-image:
    linear-gradient(to right, rgb(23 25 23 / 0.07) 0.5px, transparent 0.5px),
    linear-gradient(to bottom, rgb(23 25 23 / 0.07) 0.5px, transparent 0.5px);
  background-size: 28px 28px;
}
body.paper main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }

.site-header, .site-footer {
  width: 100%; max-width: 1080px; margin: 0 auto; padding: 20px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: inline-flex; align-items: flex-end; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 900; font-size: 26px; letter-spacing: 0.02em; line-height: 1; }
.site-footer { border-top: 2px solid var(--ink); font-size: 12px; font-weight: 700; flex-wrap: wrap; }
.site-footer nav { display: flex; gap: 20px; }

.label { font-weight: 700; font-size: 12px; letter-spacing: 0.12em; margin: 0 0 16px; }
.display {
  font-family: var(--display); font-weight: 900; text-transform: uppercase;
  font-size: clamp(64px, 14vw, 148px); line-height: 0.88; letter-spacing: -0.02em; margin: 24px 0;
}
.display.small { font-size: clamp(40px, 7vw, 64px); }
.lede { max-width: 34em; font-size: 16px; margin: 0 0 32px; }

.button {
  display: inline-block; padding: 14px 22px; border: 2px solid var(--ink); background: var(--paper);
  box-shadow: 4px 4px 0 var(--ink); font-family: var(--mono); font-weight: 700; font-size: 14px;
  text-transform: uppercase; letter-spacing: 0.04em; text-decoration: none; color: var(--ink); cursor: pointer;
}
.button:active { transform: translate(4px, 4px); box-shadow: none; }
.button-kiwi { background: var(--kiwi); }
.button-punch { background: var(--punch); }
.button.is-disabled { cursor: default; }
.button.is-disabled:active { transform: none; box-shadow: 4px 4px 0 var(--ink); }

.card { background: var(--paper); border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); padding: 20px; }
.card-teal { background: var(--teal); }
.card-tangerine { background: var(--tangerine); }

/* Landing */
.hero { padding: 40px 0 56px; }
.hero .mark { margin-top: 8px; }

.screens { display: flex; gap: 24px; overflow-x: auto; padding: 8px 8px 24px; margin: 0 -8px 48px; scroll-snap-type: x mandatory; }
.phone {
  flex: 0 0 auto; width: min(240px, 70vw); aspect-ratio: 9 / 19.5; margin: 0; scroll-snap-align: start;
  border: 2px solid var(--ink); border-radius: 28px; padding: 8px; background: var(--ink); box-shadow: 6px 6px 0 var(--ink);
}
.phone img, .phone-placeholder { width: 100%; height: 100%; border-radius: 20px; object-fit: cover; }
.phone-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  background: var(--kiwi); font-weight: 700; font-size: 14px; letter-spacing: 0.1em;
}
.phone-placeholder small { font-weight: 400; font-size: 11px; letter-spacing: 0; opacity: 0.7; }

.steps { padding-bottom: 64px; }
.steps ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.steps h3 { font-family: var(--display); font-weight: 900; font-size: 34px; margin: 8px 0 4px; line-height: 1; }
.steps p { margin: 0; }
.step-no { display: inline-block; background: var(--ink); color: var(--kiwi); font-weight: 700; font-size: 12px; padding: 2px 8px; }

/* Text pages */
.page { padding: 40px 0 64px; }
.narrow { max-width: 680px; }
.prose h2 { font-family: var(--display); font-weight: 900; text-transform: uppercase; font-size: 30px; margin: 36px 0 8px; line-height: 1; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: 6px; }

/* ---------- Player (port of MookuPlayerView) ---------- */
body.player { background: var(--ink); color: #fff; height: 100vh; height: 100dvh; overflow: hidden; }

.stage {
  position: fixed; inset: 0; margin: auto;
  width: min(100vw, calc(100dvh * 9 / 16)); aspect-ratio: 9 / 16; max-height: 100dvh;
}
/* Same transform as the app: the uncropped photo, aspect-filled and centered in a 9:16 frame. */
.stage-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; }

.pin {
  position: absolute; transform: translate(-50%, -50%);
  min-width: 44px; min-height: 44px; max-width: 160px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: 6px 10px; border: 2px solid var(--ink); border-radius: 0; box-shadow: 3px 3px 0 var(--ink);
  color: var(--ink); font: 700 12px/1.2 var(--mono); cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: transform 0.25s cubic-bezier(0.34, 1.9, 0.5, 1);
}
.pin-icon { width: 13px; height: 13px; }
.pin-name { max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pin.playing { transform: translate(-50%, -50%) scale(1.08); }
.pin:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.pin-kiwi { background: var(--kiwi); }
.pin-teal { background: var(--teal); }
.pin-tangerine { background: var(--tangerine); }
.pin-punch { background: var(--punch); }
.pin-lime { background: var(--lime); }

.player-bar {
  position: fixed; left: 0; right: 0; z-index: 2; display: flex; align-items: center; gap: 12px;
  padding: 16px; background: var(--ink); color: var(--kiwi); font: 700 11px/1 var(--mono); letter-spacing: 0.04em;
}
.player-top { top: 0; padding-top: max(16px, env(safe-area-inset-top)); color: #fff; }
.player-bottom { bottom: 0; justify-content: space-between; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
.player-home { width: 44px; height: 44px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; background: var(--kiwi); }
.player-title { flex: 1; margin: 0; text-align: center; font: 700 16px/1.2 var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-spacer { width: 44px; flex: 0 0 auto; }
.wave { width: 14px; height: 11px; vertical-align: -1px; }

.report { position: fixed; right: 12px; bottom: calc(max(16px, env(safe-area-inset-bottom)) + 40px); z-index: 3; font-size: 11px; color: rgb(255 255 255 / 0.7); text-align: right; }
.report summary { cursor: pointer; list-style: none; padding: 4px 6px; background: rgb(23 25 23 / 0.7); }
.report summary::-webkit-details-marker { display: none; }
.report form {
  margin-top: 8px; width: min(300px, calc(100vw - 24px)); padding: 14px; text-align: left;
  background: var(--paper); color: var(--ink); border: 2px solid var(--ink); box-shadow: 4px 4px 0 #000;
  display: grid; gap: 10px;
}
.report label { display: grid; gap: 4px; font-weight: 700; }
.report textarea, .report input { font: 14px var(--mono); padding: 8px; border: 2px solid var(--ink); background: #fff; border-radius: 0; }

@media (prefers-reduced-motion: reduce) {
  .pin { transition: none; }
  .button:active { transform: none; }
}

/* ---------- Admin ---------- */
.admin .display.small { margin: 8px 0 24px; }
.admin-card { display: grid; gap: 16px; justify-items: start; margin-bottom: 24px; }
.admin-card label { display: grid; gap: 4px; font-weight: 700; font-size: 12px; letter-spacing: 0.08em; width: 100%; max-width: 360px; }
.admin-card input { font: 15px var(--mono); padding: 10px; border: 2px solid var(--ink); background: #fff; border-radius: 0; }
.admin-card p { margin: 0; }
.admin-fallback summary { cursor: pointer; font-weight: 700; margin-bottom: 16px; }
.admin-error { color: var(--punch); font-weight: 700; }
.admin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.admin-head form { margin-bottom: 24px; }
.admin-table-wrap { padding: 0; overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th, .admin-table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid rgb(23 25 23 / 0.2); white-space: nowrap; }
.admin-table th { background: var(--ink); color: var(--paper); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.admin-table td:first-child, .admin-table td:nth-child(4) { font-variant-numeric: tabular-nums; }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-note { font-size: 12px; margin: 12px 0 40px; }
.admin-subhead { margin-top: 0; }
.admin-passkeys { margin: 0; padding-left: 1.2em; }
