/* Crystal Heart download site. Deliberately bare: a white triangle (the
   game's menu mark) and the download interface, nothing else. */

:root {
  --bg: #101012;
  --bg-raised: #18181b;
  --bg-sunk: #0b0b0c;
  --line: #2a2a2e;
  --line-strong: #3a3a40;
  --text: #ececef;
  --text-dim: #a2a2aa;
  --text-faint: #6e6e76;
  --red: #ff4a4a;
  --focus: #ffffff;
  --radius: 10px;
  --max: 1080px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--font);
  overflow-x: hidden;
}
a { color: var(--text); text-underline-offset: 3px; text-decoration-color: var(--text-faint); }
a:hover { text-decoration-color: var(--text); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
code { font-family: var(--mono); font-size: .92em; background: var(--bg-sunk); border: 1px solid var(--line); border-radius: 5px; padding: .05em .35em; }

/* ---------------------------------------------------------------- hero */

.hero {
  min-height: 78vh; min-height: 78svh;
  padding: 48px 16px 40px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(40px, 7vh, 64px);
}
.mark { width: clamp(88px, 14vw, 132px); height: auto; display: block; }

.cta { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.button {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-radius: var(--radius);
  font-weight: 650; font-size: 1.02rem; text-decoration: none;
  border: 1px solid var(--line-strong); background: var(--bg-raised); color: var(--text);
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease;
}
.button.primary {
  background: #f4f4f6; color: #111; border-color: #f4f4f6;
  box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 10px 40px -10px rgba(255,255,255,.35);
}
.button.primary:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px rgba(255,255,255,.12), 0 14px 50px -10px rgba(255,255,255,.5); }
.button[aria-disabled="true"] { opacity: .55; pointer-events: none; }
.icon { width: 20px; height: 20px; flex: none; }
.cta-meta { margin: 0; color: var(--text-dim); font-size: .92rem; }
.cta-meta .badge { margin-right: 6px; }

/* ---------------------------------------------------------------- versions */

main > section { max-width: var(--max); margin: 0 auto; padding: 0 16px clamp(56px, 8vw, 96px); }

.section-head { display: flex; justify-content: flex-end; margin-bottom: 14px; }
.toggle { display: inline-flex; align-items: center; gap: 8px; color: var(--text-dim); cursor: pointer; user-select: none; font-size: .95rem; }
.toggle input { width: 18px; height: 18px; accent-color: #e8e8ec; margin: 0; }

.status { padding: 22px; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--text-dim); }
.status button { margin-left: 10px; font: inherit; color: var(--text); background: var(--bg-raised); border: 1px solid var(--line-strong); border-radius: 6px; padding: 4px 10px; cursor: pointer; }

.version-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.version {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, .8fr) auto;
  grid-template-areas: "title meta plays action" "notes notes notes notes";
  gap: 6px 18px; align-items: center;
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px;
}
.version.is-target { border-color: #d8d8de; box-shadow: 0 0 0 1px #d8d8de, 0 0 30px -8px rgba(255,255,255,.35); }
.version.is-yanked { opacity: .6; }
.v-title { grid-area: title; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.v-num { font-weight: 700; font-size: 1.1rem; font-family: var(--mono); overflow-wrap: anywhere; }
.v-meta { grid-area: meta; color: var(--text-dim); font-size: .92rem; }
.v-plays { grid-area: plays; color: var(--text-dim); font-size: .92rem; }
.v-plays span { color: var(--text-faint); display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.v-action { grid-area: action; justify-self: end; }
.v-action .button { padding: 9px 16px; font-size: .95rem; }
.v-notes { grid-area: notes; margin-top: 6px; }
.v-notes summary { cursor: pointer; color: var(--text-dim); font-size: .92rem; width: fit-content; }
.v-notes summary:hover { color: var(--text); }
.notes-body { white-space: pre-wrap; overflow-wrap: anywhere; margin: 10px 0 0; color: var(--text); font-size: .95rem; }
.sha { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.sha code { font-size: .78rem; overflow-wrap: anywhere; word-break: break-all; color: var(--text-dim); }
.copy { font: inherit; font-size: .8rem; color: var(--text); background: transparent; border: 1px solid var(--line-strong); border-radius: 6px; padding: 3px 9px; cursor: pointer; }
.copy:hover { background: var(--bg-sunk); }
.yank-reason { color: var(--red); font-size: .9rem; margin: 8px 0 0; }

.badge { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--text-dim); white-space: nowrap; }
.badge.latest { color: #111; background: #ececef; border-color: #ececef; }
.badge.beta { color: var(--text); border-style: dashed; }
.badge.yanked { color: var(--red); border-color: color-mix(in srgb, var(--red) 50%, transparent); }

/* ---------------------------------------------------------------- responsive */

@media (max-width: 760px) {
  .version {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "title action" "meta meta" "plays plays" "notes notes";
  }
}
@media (max-width: 480px) {
  .cta { align-self: stretch; }
  .button.primary { width: 100%; justify-content: center; }
}

/* ---------------------------------------------------------------- 404 */
.notfound { min-height: 100vh; min-height: 100svh; display: flex; align-items: center; justify-content: center; }
