/* Base: tokens, type (Archivo, self-hosted; its condensed cuts echo the GREENHOUSE wordmark), HUD and player. */
@font-face { font-family: 'Archivo'; font-style: normal; font-weight: 100 900; font-stretch: 62% 125%; font-display: swap;
  src: url(../fonts/archivo-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Archivo'; font-style: normal; font-weight: 100 900; font-stretch: 62% 125%; font-display: swap;
  src: url(../fonts/archivo-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --night: #0d120e;
  --bone: #efe6d2;
  --gold: #d4a53a;
  --show: #d4a53a;
  --ui: 'Archivo', system-ui, sans-serif;
  --player-h: 76px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--night); color: var(--bone); font-family: var(--ui); }
body { overscroll-behavior: none; -webkit-font-smoothing: antialiased; }
canvas.stage { position: fixed; inset: 0; width: 100vw; height: 100dvh; display: block; z-index: 0; touch-action: pan-y; }
.scroll-spacer { position: relative; z-index: -1; pointer-events: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- Crest mark: single-colour SVG recoloured via mask */
.gh-crest {
  display: inline-block; width: 46px; aspect-ratio: 200 / 172; background: var(--gold);
  -webkit-mask: url(../img/crest.svg) center / contain no-repeat; mask: url(../img/crest.svg) center / contain no-repeat;
}

/* ---- HUD */
.gh-hud {
  position: fixed; inset: 0 0 auto 0; z-index: 10; display: flex; align-items: center; gap: 24px;
  padding: 18px clamp(16px, 3vw, 36px); pointer-events: none; mix-blend-mode: normal;
}
.gh-hud > * { pointer-events: auto; position: relative; }
/* Legibility scrim behind the HUD: a soft darkening, not a bar. */
.gh-hud::before {
  content: ''; position: absolute; inset: 0 0 -40px 0; pointer-events: none;
  background: linear-gradient(to bottom, rgb(13 18 14 / 0.62), rgb(13 18 14 / 0.28) 55%, rgb(13 18 14 / 0));
}
.gh-hud__mark { display: flex; align-items: center; gap: 12px; color: var(--bone); text-decoration: none; }
.gh-hud__name { font-stretch: 62%; font-weight: 800; font-size: 15px; letter-spacing: 0.02em; text-transform: uppercase; }
.gh-hud__protos { display: flex; gap: 18px; margin-left: auto; font-stretch: 85%; font-size: 14px; }
.gh-hud__protos a { color: color-mix(in srgb, var(--bone) 60%, transparent); text-decoration: none; }
.gh-hud__protos a[aria-current] { color: var(--bone); text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.gh-hud__opts { display: flex; gap: 10px; align-items: center; }
.gh-hud__opt {
  font: 600 13px/1 var(--ui); font-stretch: 85%; color: var(--bone); background: none; cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--bone) 35%, transparent); padding: 8px 12px;
}
.gh-hud__opt[aria-pressed="true"] { background: var(--bone); color: var(--night); }
.gh-hud__fps { font-size: 11px; font-variant-numeric: tabular-nums; opacity: 0.45; min-width: 44px; }
@media (max-width: 720px) {
  .gh-hud { flex-wrap: wrap; gap: 10px 16px; }
  .gh-hud__name { display: none; }
  .gh-hud__protos { order: 3; width: 100%; margin: 0; }
  .gh-hud__opts { margin-left: auto; }
}

/* ---- Player (the hard UI) */
.gh-player {
  position: fixed; inset: auto 0 0 0; z-index: 20; height: var(--player-h);
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; align-items: center; gap: 18px;
  padding: 0 clamp(16px, 3vw, 36px); background: var(--night); color: var(--bone);
}
.gh-player__track { position: absolute; inset: -9px 0 auto 0; height: 18px; cursor: pointer; }
.gh-player__track::before { content: ''; position: absolute; inset: 8px 0 auto; height: 2px; background: color-mix(in srgb, var(--bone) 14%, transparent); }
.gh-player__fill { position: absolute; inset: 8px 0 auto; height: 2px; background: var(--show); transform-origin: left; transform: scaleX(0); transition: transform .25s linear; }
.gh-player__track:focus-visible { outline: 2px solid var(--show); outline-offset: 2px; }
.gh-player__cover { width: 48px; height: 48px; object-fit: cover; display: block; background: var(--show); }
.gh-player__meta { min-width: 0; }
.gh-player__title { font-stretch: 62%; font-weight: 800; font-size: 22px; line-height: 1; text-transform: uppercase; letter-spacing: 0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gh-player__sub { margin-top: 5px; font-size: 12px; font-stretch: 85%; color: color-mix(in srgb, var(--bone) 62%, transparent); white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.gh-player__controls { display: flex; align-items: center; gap: 4px; }
.gh-player__btn { width: 44px; height: 44px; display: grid; place-items: center; background: none; border: 0; color: var(--bone); cursor: pointer; padding: 0; }
.gh-player__btn svg { width: 20px; height: 20px; fill: currentColor; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.gh-player__prev path:first-child, .gh-player__next path:first-child { fill: none; }
.gh-player__play { width: 52px; height: 52px; background: var(--show); color: var(--night); border-radius: 0; }
.gh-player__play svg { width: 22px; height: 22px; stroke: none; }
.gh-player__play .i-pause, .gh-player.is-playing .gh-player__play .i-play { display: none; }
.gh-player.is-playing .gh-player__play .i-pause { display: inline; }
.gh-player__btn:focus-visible, .gh-player__out:focus-visible { outline: 2px solid var(--show); outline-offset: 2px; }
.gh-player__time { font-size: 13px; font-variant-numeric: tabular-nums; color: color-mix(in srgb, var(--bone) 70%, transparent); display: flex; gap: 6px; }
.gh-player__out { font-size: 13px; font-stretch: 85%; color: var(--bone); text-underline-offset: 4px; }
.gh-player__frame { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; border: 0; left: -10px; }
@media (max-width: 720px) {
  :root { --player-h: 68px; }
  .gh-player { grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; }
  .gh-player__time, .gh-player__out, .gh-player__prev { display: none; }
  .gh-player__title { font-size: 19px; }
}

/* ---- Scene copy layer (titles that sit over the canvas) */
.gh-overlay { position: fixed; inset: 0 0 var(--player-h) 0; z-index: 5; pointer-events: none; }
.gh-overlay a, .gh-overlay button { pointer-events: auto; }
