/* Taro Play site. Palette is tuned for the dithered hero, not copied from theme.rs. */

@font-face {
  font-family: 'Chakra Petch';
  src: url('/assets/fonts/ChakraPetch-600.ttf') format('truetype');
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: 'Chakra Petch';
  src: url('/assets/fonts/ChakraPetch-700.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: 'Saira';
  src: url('/assets/fonts/Saira-400.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Saira';
  src: url('/assets/fonts/Saira-500.ttf') format('truetype');
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: 'Saira';
  src: url('/assets/fonts/Saira-600.ttf') format('truetype');
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: 'Saira';
  src: url('/assets/fonts/Saira-700.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('/assets/fonts/JetBrainsMono-400.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('/assets/fonts/JetBrainsMono-500.ttf') format('truetype');
  font-weight: 500;
  font-display: swap;
}

:root,
:root[data-theme='dark'] {
  --ink: #0e0c11;
  --panel: #16131b;
  --panel-2: #1d1923;
  --line: #2a2530;
  --text: #efe9e1;
  --soft: #c2bab6;
  --muted: #8c8490;
  --accent: #e8956f;
  --accent-ink: #1a0f0a;
  --ok: #8fcf8a;
  --warn: #e8c46f;
  --bad: #ef6b7a;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

:root[data-theme='light'] {
  --ink: #ece6dc;
  --panel: #f7f3ec;
  --panel-2: #efe9df;
  --line: #d8d0c3;
  --text: #1b1720;
  --soft: #4a4350;
  --muted: #7a7280;
  --accent: #c4603a;
  --accent-ink: #fff7f0;
  --ok: #3f8a4a;
  --warn: #a8771c;
  --bad: #c43d4e;
  --shadow: 0 30px 70px rgba(60, 40, 20, 0.18);
  color-scheme: light;
}

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

html,
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: 'Saira', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body {
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
}

h1,
h2 {
  font-family: 'Chakra Petch', 'Saira', sans-serif;
  font-weight: 700;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Header ---------- */

.site-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 10;
}

.site-nav {
  max-width: 1160px;
  margin: 0 auto;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}

.nav-right a:hover,
.nav-right a.is-active {
  color: var(--text);
}

.theme-toggle {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  color: var(--soft);
}

.theme-toggle:hover {
  color: var(--text);
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
}

:root[data-theme='dark'] .icon-moon,
:root[data-theme='light'] .icon-sun {
  display: none;
}

/* ---------- Shared ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  height: 46px;
  padding: 0 22px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  transition: transform 120ms ease, filter 120ms ease;
}

.btn:hover {
  filter: brightness(1.06);
}

.btn:active {
  transform: translateY(1px);
}

.fineprint {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: 150px 24px 0;
}

.dither {
  position: absolute;
  inset: 0 0 auto;
  width: 100%;
  height: min(100vh, 900px);
  display: block;
  image-rendering: pixelated;
}

.hero-copy,
.window {
  position: relative;
  max-width: 1112px;
  margin: 0 auto;
}

.hero h1 {
  max-width: 13ch;
  font-size: clamp(44px, 7vw, 84px);
  line-height: 0.98;
  letter-spacing: -0.02em;
}

.lede {
  max-width: 34em;
  margin-top: 24px;
  font-size: 19px;
  color: var(--soft);
}

.hero-actions {
  margin-top: 34px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 22px;
}

/* ---------- Library window mock ---------- */

.window {
  margin-top: 72px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.window-bar {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 44px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}

.lights {
  display: flex;
  gap: 8px;
}

.lights i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--line);
}

.window-search {
  width: 260px;
  max-width: 50%;
  margin: 0 auto;
  padding: 4px 12px;
  border-radius: 7px;
  background: var(--ink);
  color: var(--muted);
  font-size: 13px;
}

.window-body {
  display: grid;
  grid-template-columns: 190px 1fr;
}

.w-sidebar {
  padding: 18px 12px;
  border-right: 1px solid var(--line);
  font-size: 14px;
}

.w-group {
  margin: 16px 10px 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.w-group:first-child {
  margin-top: 0;
}

.w-item {
  display: flex;
  justify-content: space-between;
  padding: 5px 10px;
  border-radius: 7px;
  color: var(--soft);
}

.w-item b {
  font-weight: 400;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}

.w-item.is-on {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--text);
}

.w-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 22px 18px;
  padding: 22px;
}

.cover {
  min-width: 0;
}

.cover canvas {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 6px;
  image-rendering: pixelated;
  background: var(--line);
}

.cover span {
  display: block;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cover em {
  font-style: normal;
  font-size: 12px;
  color: var(--muted);
}

/* ---------- Features ---------- */

.features {
  max-width: 1160px;
  margin: 0 auto;
  padding: 140px 24px 40px;
  scroll-margin-top: 20px;
}

.feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  padding: 56px 0;
  border-top: 1px solid var(--line);
}

.feature h2 {
  font-size: clamp(28px, 3.4vw, 40px);
  line-height: 1.05;
}

.feature-text p {
  margin-top: 16px;
  max-width: 30em;
  color: var(--soft);
}

.vignette {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  padding: 22px 24px;
}

.vignette-log p,
.vignette-splits p {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  border-bottom: 1px dashed var(--line);
}

.vignette-log p:last-child,
.vignette-splits p:last-child {
  border-bottom: 0;
}

.ok,
.ahead {
  color: var(--ok);
}

.busy {
  color: var(--warn);
}

.behind {
  color: var(--bad);
}

.vignette-splits p span:first-child {
  flex: 1;
}

.vignette-splits p span:nth-child(3) {
  width: 4.5em;
  text-align: right;
}

.vignette-splits .is-current {
  color: var(--accent);
}

.couch-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  align-items: center;
}

.couch-row .cover canvas {
  border-radius: 8px;
}

.couch-row .cover:not(.is-focus) {
  opacity: 0.55;
}

.couch-row .cover.is-focus {
  transform: scale(1.12);
}

.couch-row .cover.is-focus canvas {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.player-frame canvas {
  aspect-ratio: 16 / 10;
  border-radius: 6px;
}

.vignette-player {
  position: relative;
}

.player-bar {
  display: flex;
  gap: 6px;
  margin-top: 14px;
  font-size: 13px;
}

.player-bar span {
  padding: 4px 10px;
  border-radius: 6px;
  color: var(--soft);
}

.player-bar .is-open {
  background: var(--panel-2);
  color: var(--text);
}

.player-menu {
  position: absolute;
  left: 82px;
  bottom: 60px;
  display: flex;
  flex-direction: column;
  min-width: 150px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  box-shadow: var(--shadow);
  font-size: 13px;
}

.player-menu span {
  padding: 4px 10px;
  border-radius: 5px;
}

.player-menu span:first-child {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
}

.pitch {
  max-width: 30em;
  margin-bottom: 40px;
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 600;
  font-size: clamp(24px, 2.8vw, 32px);
  line-height: 1.25;
}

/* ---------- Help ---------- */

.help {
  max-width: 760px;
  margin: 0 auto;
  padding: 150px 24px 100px;
}

.help h1 {
  font-size: clamp(40px, 6vw, 60px);
  line-height: 1;
}

.help .lede {
  margin-bottom: 40px;
}

.help details {
  border-top: 1px solid var(--line);
}

.help details:last-of-type {
  border-bottom: 1px solid var(--line);
}

.help summary {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 0;
  font-weight: 600;
  font-size: 18px;
  cursor: pointer;
  list-style: none;
}

.help summary::-webkit-details-marker {
  display: none;
}

.help summary::after {
  content: '+';
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
}

.help details[open] summary::after {
  content: '\2212';
}

.help details ul {
  margin: 0 0 18px;
  padding-left: 20px;
  color: var(--soft);
  max-width: 40em;
}

.help details li {
  margin-bottom: 10px;
}

.help details li b {
  color: var(--text);
  font-weight: 600;
}

.help details p {
  padding: 0 0 22px;
  color: var(--soft);
  max-width: 40em;
}

.couch-hints {
  display: flex;
  gap: 22px;
  margin-top: 26px;
  font-size: 14px;
  color: var(--soft);
}

kbd {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: 6px;
  border-radius: 50%;
  border: 1px solid var(--line);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text);
}

.more {
  list-style: none;
  margin: 0;
  padding: 48px 0 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px;
  color: var(--soft);
  font-size: 16px;
}

.more b {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-weight: 600;
}

/* ---------- About & footer ---------- */

.about {
  max-width: 1160px;
  margin: 0 auto;
  padding: 80px 24px 100px;
  scroll-margin-top: 20px;
}

.about p:first-child {
  max-width: 26em;
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 600;
  font-size: clamp(24px, 2.8vw, 32px);
  line-height: 1.25;
}

.about .fineprint {
  margin-top: 24px;
}

.site-footer {
  max-width: 1160px;
  margin: 0 auto;
  padding: 28px 24px 40px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- Download ---------- */

.hero--short {
  min-height: min(100vh, 900px);
  padding-bottom: 80px;
}

.download-inner {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  padding-top: 40px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.app-icon {
  width: 96px;
  height: 96px;
  margin-bottom: 28px;
}

.download-inner h1 {
  font-size: clamp(40px, 6vw, 60px);
  line-height: 1;
  letter-spacing: -0.02em;
}

.download-inner .fineprint {
  margin: 14px 0 30px;
}

.source-link {
  margin-top: 16px;
}

.source-link, .source-downloads a {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.source-downloads h2 {
  margin: 32px 0 12px;
  scroll-margin-top: 6rem;
}

.source-downloads ul {
  margin: 16px 0;
  padding-left: 1.4em;
}

.download-note {
  margin-top: 18px;
  font-size: 14px;
  color: var(--soft);
}

code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.92em;
}

.download-alt {
  width: 100%;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--soft);
  font-size: 15px;
}

/* ---------- Small screens ---------- */

@media (max-width: 860px) {
  .feature {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .more {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .window-body {
    grid-template-columns: 1fr;
  }

  .w-sidebar {
    display: none;
  }

  .w-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .w-grid .cover:nth-child(n + 7) {
    display: none;
  }
}

@media (max-width: 560px) {
  .hero {
    padding-top: 120px;
  }

  .nav-right {
    gap: 16px;
  }

  .lede {
    font-size: 17px;
  }

  .w-grid {
    grid-template-columns: repeat(2, 1fr);
    padding: 16px;
    gap: 16px;
  }

  .w-grid .cover:nth-child(n + 5) {
    display: none;
  }
}

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