/* Groove Harbor — the brand of the music example, and the one file to edit
   to make it yours. Everything a visitor sees reads these tokens:

   - the app (music/py), loaded after examples/shared/theme.css, where the
     block below maps them onto Tyrell's --ty-* tokens;
   - the engine's sign-in, status and error pages, the bundle this directory
     is uploaded as (music/py/brand.py), which load this file on its own.

   The look is a record sleeve: bone paper, ink, one loud harbor blue;
   condensed heavy capitals, an italic serif for the human voice, mono for
   the small print. Swap the tokens, the three fonts and logo.svg, run
   brand.py again, and the whole flow is yours. Groove Harbor is invented
   for the example. */

@import url("https://fonts.googleapis.com/css2?family=Archivo:ital,wdth,wght@0,62..125,100..900;1,62..125,100..900&family=IBM+Plex+Mono:wght@400;500;600&family=Instrument+Serif:ital@0;1&display=swap");

:root {
  --gh-bone: #ebe5d9;         /* the page */
  --gh-paper: #f6f2ea;        /* sleeves, panels, fields */
  --gh-ink: #131313;          /* text, rules, the record itself */
  --gh-blue: #2a3dff;         /* the one accent: the record label, links, live */
  --gh-blue-ink: #1a28c4;     /* blue pressed, blue on bone at small sizes */
  --gh-line: #cfc7b8;         /* hairlines */
  --gh-muted: #6b665e;        /* small print */
  --gh-danger: #c8341b;

  --gh-font-body: "Archivo", ui-sans-serif, system-ui, sans-serif;
  --gh-font-display: "Archivo", ui-sans-serif, system-ui, sans-serif;
  --gh-font-serif: "Instrument Serif", ui-serif, Georgia, serif;
  --gh-font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}

/* ── type: the sleeve's three voices ─────────────────────────────────── */
.gh-display {
  font-family: var(--gh-font-display); font-weight: 850; font-stretch: 68%;
  text-transform: uppercase; letter-spacing: -0.015em; line-height: 0.86;
}
.gh-display em, .gh-serif {
  font-family: var(--gh-font-serif); font-style: italic; font-weight: 400;
  text-transform: none; letter-spacing: -0.01em; font-stretch: 100%;
}
.gh-display em { color: var(--gh-blue); }
.gh-kicker {
  font: 500 0.7rem/1.3 var(--gh-font-mono); text-transform: uppercase;
  letter-spacing: 0.16em; color: var(--gh-muted);
}
.gh-kicker b { color: var(--gh-ink); font-weight: 600; }

/* ── the record: pure CSS, so the app and the engine's pages share it ─── */
.gh-disc {
  --size: 320px;
  position: relative; width: var(--size); aspect-ratio: 1; border-radius: 50%; flex: none;
  background:
    radial-gradient(circle, var(--gh-bone) 0 2.2%, transparent 2.4%),
    radial-gradient(circle, var(--gh-blue) 0 30%, var(--gh-ink) 30.5% 32%, transparent 32.2%),
    repeating-radial-gradient(circle, #181818 0 1.5px, #262626 1.5px 2.5px, #181818 2.5px 4px);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.6);
}
.gh-disc::before {          /* the sheen across the grooves */
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 20deg, transparent 0 8%, rgba(255, 255, 255, 0.13) 12%,
    transparent 18% 52%, rgba(255, 255, 255, 0.09) 58%, transparent 64%);
}
.gh-disc::after {           /* the label's rim and its pressing ring */
  content: ""; position: absolute; inset: 35%; border-radius: 50%;
  border: 1px solid rgba(246, 242, 234, 0.35);
}
.gh-spin { animation: gh-spin 9s linear infinite; }
.gh-spin::before { animation: gh-spin 9s linear infinite reverse; }  /* the light stays put */
@keyframes gh-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .gh-spin, .gh-spin::before { animation: none; } }

.gh-logo { display: inline-block; flex-shrink: 0; }

/* ── the app: Groove Harbor in Tyrell's tokens ───────────────────────────
   Light on purpose: nothing here may look like the platform's own dark
   chrome. These override theme.css, which loads first. */
html[data-theme="light"] {
  --font-body: var(--gh-font-body);
  --font-mono: var(--gh-font-mono);
  --ty-primary-hue: 268;
  --ty-primary-chroma: 0.24;
  --ty-success-hue: 150;
  --ty-success-chroma: 0.14;

  --ty-surface-canvas: var(--gh-bone);
  --ty-surface-content: var(--gh-paper);
  --ty-surface-elevated: #e2dbcd;
  --ty-surface-floating: #fbf9f4;
  --ty-text: var(--gh-ink);
  --ty-text-soft: #3b3833;
  --ty-text-faint: var(--gh-muted);
  --ty-border: var(--gh-line);
  --ty-border-soft: #dcd5c7;

  --ty-color-primary: var(--gh-blue);
  --ty-bg-primary-soft: #dfe2ff;
  --ty-solid-primary: var(--gh-blue);
  --ty-solid-primary-hover: var(--gh-blue-ink);
  --ty-solid-primary-active: #141f9e;
  --ty-solid-primary-fg: #ffffff;
  --ty-color-danger: var(--gh-danger);

  /* square sleeves, round buttons */
  --ty-radius-sm: 2px; --ty-radius-base: 2px; --ty-radius-md: 3px; --ty-radius-lg: 4px;
  --ty-button-radius-xs: 999px; --ty-button-radius-sm: 999px; --ty-button-radius-md: 999px;
  --ty-button-radius-lg: 999px; --ty-button-radius-xl: 999px;
  --ty-input-bg: var(--gh-paper);
  --ty-input-border: #bdb4a3;
  --ty-input-border-hover: var(--gh-ink);
  --ty-input-border-focus: var(--gh-blue);
}
html[data-theme="light"] body { font-size: 14.5px; }
html[data-theme="light"] h1, html[data-theme="light"] h2, html[data-theme="light"] h3 {
  font-family: var(--gh-font-display); letter-spacing: -0.01em;
}
html[data-theme="light"] code { background: #e2dbcd; color: var(--gh-ink); border-radius: 2px; }

/* chrome: a bone masthead ruled in ink, an ink footer */
html[data-theme="light"] .topbar {
  background: var(--gh-bone); border-bottom: 2px solid var(--gh-ink); min-height: 64px;
}
html[data-theme="light"] .topbar .brand { color: var(--gh-ink); }
.gh-wordmark-sm {
  font: 850 1.35rem/0.9 var(--gh-font-display); font-stretch: 68%;
  text-transform: uppercase; letter-spacing: -0.01em;
}
html[data-theme="light"] .topbar .nav-link {
  font: 500 0.72rem/1 var(--gh-font-mono); text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--gh-muted); border-radius: 999px; padding: 8px 12px;
}
html[data-theme="light"] .topbar .nav-link:hover { color: var(--gh-ink); background: #e0d9cb; }
html[data-theme="light"] .topbar .nav-link[aria-current="page"] {
  color: var(--gh-bone); background: var(--gh-ink); font-weight: 600;
}
html[data-theme="light"] .topbar .back-link { color: var(--gh-muted); }
html[data-theme="light"] .pill {
  background: transparent; border: 1.5px solid var(--gh-ink); color: var(--gh-ink);
  font: 600 0.66rem/1 var(--gh-font-mono); letter-spacing: 0.16em; text-transform: uppercase;
}
html[data-theme="light"] .live-dot {
  background: var(--gh-blue); box-shadow: 0 0 0 3px rgba(42, 61, 255, 0.18);
  animation: gh-pulse 2s ease-in-out infinite;
}
@keyframes gh-pulse { 50% { box-shadow: 0 0 0 6px rgba(42, 61, 255, 0); } }
html[data-theme="light"] footer {
  background: var(--gh-ink); border-top: 0; color: #a39d92;
}
html[data-theme="light"] footer a { color: #c9cdff; }
html[data-theme="light"] .footer-credit {
  color: #8a857c; font: 0.68rem/1.4 var(--gh-font-mono); letter-spacing: 0.04em;
}
html[data-theme="light"] .section-title { font-family: var(--gh-font-mono); color: var(--gh-muted); }

/* ── the engine's pages: sign-in, status, error (no Tyrell there) ─────── */
.gh-page {
  margin: 0; min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, 1fr);
  background: var(--gh-bone); color: var(--gh-ink);
  font: 15px/1.55 var(--gh-font-body); -webkit-font-smoothing: antialiased;
}
.gh-page *, .gh-page *::before, .gh-page *::after { box-sizing: border-box; }

/* the left half: the sleeve's front */
.gh-poster {
  position: relative; overflow: hidden; background: var(--gh-blue); color: var(--gh-paper);
  padding: 40px 44px; display: flex; flex-direction: column; justify-content: space-between; min-height: 100vh;
}
.gh-poster .gh-disc { --size: min(64vh, 44vw); position: absolute; right: -22%; top: -14%; }
.gh-poster .gh-disc { background:
    radial-gradient(circle, var(--gh-blue) 0 2.2%, transparent 2.4%),
    radial-gradient(circle, var(--gh-paper) 0 30%, var(--gh-ink) 30.5% 32%, transparent 32.2%),
    repeating-radial-gradient(circle, #181818 0 1.5px, #262626 1.5px 2.5px, #181818 2.5px 4px); }
.gh-poster .gh-disc::after { border-color: rgba(42, 61, 255, 0.35); }
.gh-poster-top { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.gh-poster-top .gh-kicker { color: rgba(246, 242, 234, 0.75); }
.gh-poster h2 {
  position: relative; margin: 0; font-size: clamp(4rem, 11vw, 10.5rem);
}
.gh-poster h2 .gh-serif { display: block; font-size: 0.34em; line-height: 1.1; margin-top: 0.25em; color: var(--gh-paper); }

/* the right half: the form, like the back of the sleeve */
.gh-panel {
  display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(28px, 6vw, 88px);
  max-width: 560px; width: 100%;
}
.gh-panel h1 { margin: 10px 0 10px; font-size: clamp(2.6rem, 4.6vw, 3.6rem); }
.gh-panel > p, .gh-panel form + p { margin: 0 0 28px; color: #3b3833; max-width: 40ch; }
.gh-panel .gh-lede { font: 1.35rem/1.3 var(--gh-font-serif); font-style: italic; color: #3b3833; margin: 0 0 30px; }

.gh-field { display: block; margin-bottom: 18px; }
.gh-field span {
  display: block; margin-bottom: 6px;
  font: 500 0.68rem/1 var(--gh-font-mono); text-transform: uppercase; letter-spacing: 0.16em; color: var(--gh-muted);
}
.gh-field input {
  width: 100%; padding: 13px 14px; border-radius: 2px; border: 1.5px solid #bdb4a3;
  background: var(--gh-paper); color: var(--gh-ink); font: 500 1rem var(--gh-font-body);
  outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.gh-field input:hover { border-color: var(--gh-ink); }
.gh-field input:focus { border-color: var(--gh-blue); box-shadow: 0 0 0 3px rgba(42, 61, 255, 0.18); }
.gh-btn {
  display: inline-flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%;
  padding: 16px 22px; border: 0; border-radius: 999px; cursor: pointer; text-decoration: none;
  background: var(--gh-ink); color: var(--gh-paper);
  font: 600 0.78rem/1 var(--gh-font-mono); text-transform: uppercase; letter-spacing: 0.16em;
  transition: background 0.15s, transform 0.05s;
}
.gh-btn::after { content: "→"; font-size: 1.1rem; letter-spacing: 0; transition: transform 0.15s; }
.gh-btn:hover { background: var(--gh-blue); text-decoration: none; }
.gh-btn:hover::after { transform: translateX(4px); }
.gh-btn:active { transform: translateY(1px); }
.gh-btn.ghost { background: transparent; color: var(--gh-ink); border: 1.5px solid var(--gh-ink); }
.gh-btn.ghost:hover { background: var(--gh-ink); color: var(--gh-paper); }
.gh-error { min-height: 1.4em; color: var(--gh-danger); font-size: 0.9rem; font-weight: 500; margin: 0 0 14px; }
.gh-note {
  margin: 22px 0 0; padding-top: 16px; border-top: 1px solid var(--gh-line);
  font: 0.72rem/1.5 var(--gh-font-mono); color: var(--gh-muted); letter-spacing: 0.04em;
}
.gh-note b { color: var(--gh-ink); font-weight: 600; }
.gh-divider {
  display: flex; align-items: center; gap: 12px; margin: 22px 0 14px;
  font: 0.68rem var(--gh-font-mono); text-transform: uppercase; letter-spacing: 0.16em; color: var(--gh-muted);
}
.gh-divider::before, .gh-divider::after { content: ""; flex: 1; height: 1px; background: var(--gh-line); }
.gh-fed { display: flex; flex-direction: column; gap: 10px; }
.gh-code { font: 500 0.74rem/1.4 var(--gh-font-mono); color: var(--gh-muted); margin-top: 18px; }
.gh-warn {
  border: 1.5px solid var(--gh-danger); color: var(--gh-danger); border-radius: 2px;
  padding: 12px 14px; font-size: 0.9rem; font-weight: 500; margin-bottom: 18px;
}

@media (max-width: 820px) {
  .gh-page { grid-template-columns: 1fr; }
  .gh-poster { min-height: 0; padding: 22px 20px 26px; gap: 40px; }
  .gh-poster .gh-disc { --size: 240px; right: -90px; top: -110px; }
  .gh-poster h2 { font-size: 4.2rem; }
  .gh-poster-top .gh-kicker { display: none; }
  .gh-panel { padding: 32px 20px 48px; max-width: none; }
}

/* Tyrell's outlined neutral button, in ink */
html[data-theme="light"] ty-button[appearance="outlined"][flavor="neutral"] {
  --ty-button-color: var(--gh-ink); --ty-button-border: var(--gh-ink);
}
