/* KICKFLIP · palette: monochrome + one pop (KICKFLIP orange) · macrostructure: Workbench · 2026-09-30 */

@font-face {
  font-family: "Orbiter Display";
  src: url("fonts/TASAOrbiterDisplay-Black.otf") format("opentype");
  font-weight: 900;
  font-display: swap;
}
@font-face {
  font-family: "Orbiter Text";
  src: url("fonts/TASAOrbiterText-Regular.otf") format("opentype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Orbiter Text";
  src: url("fonts/TASAOrbiterText-Bold.otf") format("opentype");
  font-weight: 700;
  font-display: swap;
}

:root {
  --ink: oklch(0.17 0.004 265);
  --paper: oklch(0.995 0 0);
  --stage: oklch(0.19 0.006 265);
  --on-stage: oklch(0.97 0.003 265);
  --muted: oklch(0.46 0.008 265);
  --line: oklch(0.88 0.004 265);
  --wash: oklch(0.96 0.003 265);
  --pop: oklch(0.69 0.19 38);
  --swatch-plain: oklch(0.94 0.018 85);
  --swatch-sakura: oklch(0.86 0.055 12);
  --swatch-matcha: oklch(0.76 0.085 125);
  --display: "Orbiter Display", "Arial Black", "Helvetica Neue", sans-serif;
  --text: "Orbiter Text", "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(16px, 2.4vw, 32px);
  --rule: 1.5px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  overflow-x: clip;
}

body {
  font-family: var(--text);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.study {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(340px, 31vw, 460px);
  height: 100vh;
  height: 100dvh;
}

/* ---------- stage ---------- */

.stage {
  position: relative;
  min-width: 0;
  background: var(--stage);
  overflow: hidden;
}

#stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: default;
  outline: none;
}
#stage.over { cursor: grab; }
#stage.holding { cursor: grabbing; }

.masthead {
  position: absolute;
  left: var(--gutter);
  top: clamp(14px, 3.2vh, 34px);
  color: var(--on-stage);
  pointer-events: none;
}

.kicker {
  display: block;
  margin-bottom: 0.14em;
  font-size: clamp(18px, 2.5vw, 42px);
  line-height: 1;
  letter-spacing: 0;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(64px, 9.2vw, 156px);
  line-height: 0.9;
  letter-spacing: -0.025em;
}

.hint {
  position: absolute;
  left: var(--gutter);
  bottom: clamp(14px, 3vh, 28px);
  margin: 0;
  color: var(--on-stage);
  font-size: 16px;
  pointer-events: none;
  transition: opacity 600ms ease;
}
.hint.gone { opacity: 0; }

.fallback {
  position: absolute;
  inset: auto var(--gutter) var(--gutter) var(--gutter);
  max-width: 34rem;
  padding: 22px 24px;
  background: var(--paper);
  color: var(--ink);
  border: var(--rule) solid var(--ink);
}
.fallback[hidden] { display: none; }
.fallback p { margin: 0; text-wrap: pretty; }
.fallback-title {
  font-family: var(--display);
  font-size: clamp(26px, 3.4vw, 38px);
  line-height: 1.05;
  margin-bottom: 10px !important;
}
.no-gpu .hint, .no-gpu .controls { display: none; }

/* ---------- panel ---------- */

.panel {
  min-width: 0;
  overflow-y: auto;
  padding: 26px var(--gutter) 40px;
  display: flex;
  flex-direction: column;
  gap: 30px;
  border-left: var(--rule) solid var(--ink);
}

.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo { width: 150px; height: auto; color: var(--ink); display: block; }
.lab {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.intro p { margin: 0; text-wrap: pretty; max-width: 60ch; }
.intro p + p { margin-top: 12px; color: var(--muted); }
.lede {
  font-family: var(--display);
  font-size: clamp(26px, 2.3vw, 34px);
  line-height: 1.05;
  letter-spacing: -0.01em;
}

/* ---------- controls ---------- */

.controls { display: flex; flex-direction: column; gap: 22px; margin: 0; }
.field { border: 0; margin: 0; padding: 0; min-width: 0; }
.field legend, .field-label {
  display: block;
  padding: 0;
  margin-bottom: 10px;
  font-weight: 700;
  font-size: 16px;
}

.variety {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: var(--rule) solid var(--ink);
}
.variety label { position: relative; display: block; cursor: pointer; min-width: 0; }
.variety label + label { border-left: var(--rule) solid var(--ink); }
.variety input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.variety span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 8px 6px;
  font-weight: 700;
  font-size: 16px;
}
.variety input:checked + span { background: var(--ink); color: var(--paper); }
.variety input:focus-visible + span { outline: 3px solid var(--pop); outline-offset: -5px; }
.swatch {
  width: 14px;
  height: 14px;
  flex: none;
  border: 1px solid var(--ink);
}
.variety input:checked + span .swatch { border-color: var(--paper); }
.swatch-plain { background: var(--swatch-plain); }
.swatch-sakura { background: var(--swatch-sakura); }
.swatch-matcha { background: var(--swatch-matcha); }

input[type="range"] {
  width: 100%;
  margin: 0;
  height: 30px;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track { height: var(--rule); background: var(--ink); }
input[type="range"]::-moz-range-track { height: var(--rule); background: var(--ink); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -10px;
  background: var(--paper);
  border: var(--rule) solid var(--ink);
}
input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 0;
  background: var(--paper);
  border: var(--rule) solid var(--ink);
}
input[type="range"]:focus-visible { outline: 3px solid var(--pop); outline-offset: 4px; }
input[type="range"]:active::-webkit-slider-thumb { background: var(--pop); }

.ends {
  display: flex;
  justify-content: space-between;
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.actions { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 10px; }
.btn, .toggle {
  font: inherit;
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  background: var(--paper);
  border: var(--rule) solid var(--ink);
  border-radius: 0;
  min-height: 46px;
  padding: 10px 12px;
  cursor: pointer;
}
.btn-solid { background: var(--ink); color: var(--paper); }
.btn:hover { background: var(--ink); color: var(--paper); }
.btn-solid:hover { background: var(--pop); border-color: var(--pop); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .toggle:focus-visible { outline: 3px solid var(--pop); outline-offset: 2px; }

.toggles { display: grid; border: var(--rule) solid var(--ink); }
.toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  border: 0;
  font-weight: 400;
  text-align: left;
  padding: 10px 14px;
}
.toggle + .toggle { border-top: 1px solid var(--line); }
.toggle i {
  order: 2;
  width: 16px;
  height: 16px;
  border: var(--rule) solid var(--ink);
  flex: none;
}
.toggle:hover { background: var(--wash); }
.toggle[aria-pressed="true"] { font-weight: 700; }
.toggle[aria-pressed="true"] i { background: var(--pop); }

.keys { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.9; text-wrap: pretty; }
kbd {
  font: inherit;
  font-weight: 700;
  color: var(--ink);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  padding: 0 5px;
}

/* ---------- notes ---------- */

.how h2 {
  margin: 0 0 14px;
  font-family: var(--display);
  font-size: clamp(28px, 2.4vw, 36px);
  line-height: 1;
  letter-spacing: -0.01em;
}
.how h3 { margin: 18px 0 4px; font-size: 16px; font-weight: 700; }
.how p { margin: 0; color: var(--muted); max-width: 62ch; text-wrap: pretty; }

.foot {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
.foot p { margin: 0; }
.perf { margin-top: 6px !important; font-variant-numeric: tabular-nums; min-height: 1.5em; }

/* ---------- stacked layout ---------- */

@media (max-width: 880px) {
  .study { display: block; height: auto; }
  .stage { height: 66vh; height: min(66svh, 560px); min-height: 340px; }
  .panel { overflow: visible; border-left: 0; border-top: var(--rule) solid var(--ink); padding: 22px 16px 36px; gap: 26px; }
  h1 { font-size: clamp(58px, 17vw, 104px); }
  .logo { width: 128px; }
}

@media (max-width: 360px) {
  .actions { grid-template-columns: 1fr 1fr; }
  .actions .btn-solid { grid-column: 1 / -1; }
}

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