/* CoLead homepage: the shared layer over both scenes.
   System 4a: Literata for the wordmark and offerings, Instrument Sans for controls,
   ink on frosted glass, green as the only accent. */

:root {
  color-scheme: light only;
  --ink: #15130f;
  --ink-2: #49453d;
  --paper: #f5f4f0;
  --green: #1d7653;
  --serif: "Literata", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --pad: clamp(16px, 2.5vw, 32px);
  --shell-h: 64px;   /* the row everything sits on; the station's own top bar uses the same height */
  --glass: rgba(250, 249, 245, .32);
  --glass-blur: blur(20px) saturate(1.4);
  --glass-edge: inset 0 0 0 1px rgba(255, 255, 255, .7), 0 0 0 .5px rgba(21, 19, 15, .08);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; background: #f5f4f0; }
body {
  color: var(--ink); font-family: var(--serif); font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
html[data-scene="station"] body { background: #efe6d6; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 1.5px solid rgba(22, 20, 15, .55); outline-offset: 3px; border-radius: 6px; }

/* ── the scenes ── */
#scenes { position: fixed; inset: 0; }
.scene {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .6s var(--ease), visibility 0s linear .6s;
}
.scene.on { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .6s var(--ease), visibility 0s; z-index: 1; }

/* ── the shared top row ── */
#shell {
  position: fixed; z-index: 10; top: 0; left: 0; right: 0; height: var(--shell-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 var(--pad);
  pointer-events: none;
}
#shell > * { pointer-events: auto; }
#shell-left { display: flex; align-items: center; gap: 20px; }

#brand {
  font-size: 24px; font-weight: 400; letter-spacing: -.015em; line-height: 1;
  color: var(--ink); text-decoration: none;
  text-shadow: 0 0 18px rgba(255, 250, 240, .95);
}

/* ── the offerings: one frosted pill ── */
#offerings {
  display: flex; align-items: center; height: 34px; padding: 0 4px; border-radius: 17px;
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-edge), 0 10px 28px -16px rgba(70, 52, 24, .4);
}
#offerings button {
  height: 26px; padding: 0 13px; border-radius: 13px;
  font-size: 15px; line-height: 1; color: var(--ink); white-space: nowrap;
  transition: background-color .25s ease;
}
#offerings button:hover, #offerings button:focus-visible { background: rgba(21, 19, 15, .07); }

/* ── the scene toggle: one frosted pill, an ink thumb slides under the active name ── */
#scene-toggle {
  position: relative; display: grid; grid-template-columns: 1fr 1fr; align-items: stretch;
  height: 34px; padding: 3px; border-radius: 17px;
  font-family: var(--sans);
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-edge);
}
#scene-toggle button {
  position: relative; z-index: 1; padding: 0 14px; border-radius: 14px;
  font-size: 13.5px; font-weight: 500; line-height: 1; color: var(--ink-2);
  transition: color .3s ease;
}
#scene-toggle button:hover { color: var(--ink); }
#scene-toggle button[aria-pressed="true"] { color: var(--paper); }
#scene-toggle .thumb {
  position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: 14px;
  background: var(--ink);
  transition: transform .45s var(--ease);
}
html[data-scene="station"] #scene-toggle .thumb { transform: translateX(100%); }

/* ── a quiet line for what isn't built yet ── */
#note {
  position: fixed; z-index: 10; left: var(--pad); top: calc(var(--shell-h) + 8px); margin: 0;
  font-size: 15px; font-style: italic; color: var(--ink);
  text-shadow: 0 0 14px rgba(255, 250, 240, .95), 0 0 2px rgba(255, 250, 240, .8);
  opacity: 0; transform: translateY(-4px); pointer-events: none;
  transition: opacity .35s ease, transform .45s var(--ease);
}
#note.on { opacity: 1; transform: none; }

/* ── small screens: brand and toggle on the first row, the offerings on a second ── */
@media (max-width: 640px) {
  :root { --shell-h: 52px; --nav-h: 36px; }
  #shell {
    height: calc(var(--shell-h) + var(--nav-h)); padding: 0 16px;
    display: grid; grid-template-columns: 1fr auto; grid-template-rows: var(--shell-h) var(--nav-h); gap: 0 8px;
  }
  #shell-left { display: contents; }
  #brand { justify-self: start; font-size: 22px; }
  #scene-toggle { grid-column: 2; grid-row: 1; }
  #scene-toggle button { font-size: 13px; padding: 0 12px; }
  #offerings { grid-column: 1 / -1; grid-row: 2; justify-self: start; height: var(--nav-h); margin-left: -4px; border-radius: 18px; }
  #offerings button { height: 28px; padding: 0 12px; border-radius: 14px; }
  #note { top: calc(var(--shell-h) + var(--nav-h) + 6px); }
}

@media (prefers-reduced-motion: reduce) {
  .scene, .scene.on, #scene-toggle .thumb, #note { transition-duration: .01s !important; }
}
