/* Outstation website: shared base. Tokens, type, the top bar, buttons and the switch itself.
   Used by every page; the home page adds home.css.
   Backlight (--on) only ever means "this indicator is lit". */

@font-face {
  font-family: "Overpass";
  src: url("fonts/overpass-latin-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --night: #0C0E0F;
  --graphite: #1B2023;
  --steel: #2A3033;
  --trim: #6F797E;
  --soft: #B7C0C3;
  --soft-dark: #3E474B;
  --white: #F3F5F4;
  --chip: #E4E9E8;
  --on: #3FD79B;
  --on-deep: #0E8F5E;
  --on-glow: 63, 215, 155;

  --ui: "Overpass", "Helvetica Neue", Arial, sans-serif;
  --s-display: clamp(3rem, 6.6vw, 7.25rem);
  --s-head: clamp(2.25rem, 4.6vw, 4.75rem);
  --s-say: clamp(1.5rem, 2.3vw, 2.125rem);
  --s-lead: clamp(1.125rem, 1.3vw, 1.3125rem);
  --s-body: 1.0625rem;

  --m: clamp(20px, 4vw, 56px);
  --bar-h: 72px;
  --section: clamp(96px, 13vw, 200px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --fast: 160ms;

  --z-bar: 50;
  --z-skip: 60;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--bar-h); }
body {
  margin: 0; background: var(--night); color: var(--white);
  font-family: var(--ui); font-size: var(--s-body); line-height: 1.55;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; }
img { max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: var(--white); color: var(--night); }
:focus-visible { outline: 3px solid currentColor; outline-offset: 4px; border-radius: 4px; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; left: var(--m); top: 0; transform: translateY(-120%); background: var(--white); color: var(--night); padding: 12px 18px; font-weight: 700; z-index: var(--z-skip); }
.skip:focus { transform: translateY(12px); }

/* ---------- Buttons and links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px;
  border-radius: 999px; background: var(--night); color: var(--white);
  font-weight: 700; text-decoration: none; white-space: nowrap;
  transition: transform var(--fast) var(--ease), background-color var(--fast), color var(--fast);
}
.btn-light { background: var(--white); color: var(--night); }
.btn-big { min-height: 58px; padding: 0 30px; font-size: var(--s-lead); }
.btn:active { transform: scale(0.97); }
@media (hover: hover) {
  .btn:hover { background: var(--steel); }
  .btn-light:hover { background: #fff; transform: translateY(-2px); }
  .btn-light:active { transform: scale(0.97); }
}
.text-link { font-weight: 700; text-underline-offset: 6px; text-decoration-thickness: 2px; padding: 10px 0; display: inline-block; }
@media (hover: hover) { .text-link:hover { text-decoration-thickness: 4px; } }

/* ---------- Top bar ---------- */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: var(--z-bar); height: var(--bar-h);
  display: flex; align-items: center; gap: var(--m); padding: 0 var(--m);
  color: var(--white);
  transition: transform 420ms var(--ease), background-color 300ms;
}
.bar.is-solid { background: rgba(12, 14, 15, 0.86); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.bar.is-away { transform: translateY(-100%); }
.bar:has(:focus-visible) { transform: none; }
.bar-mark { display: flex; align-items: center; min-height: 44px; margin-right: auto; }
.bar-mark svg { width: clamp(150px, 15vw, 204px); height: auto; }
.bar-nav { display: flex; gap: clamp(18px, 2.4vw, 36px); }
.bar-nav a { text-decoration: none; font-weight: 600; padding: 12px 0; color: var(--soft); transition: color var(--fast); }
.bar-nav a:hover, .bar-nav a:focus-visible { color: var(--white); }
.bar-act { min-height: 44px; padding: 0 20px; }
@media (max-width: 900px) {
  :root { --bar-h: 64px; }
  .bar-nav { display: none; }
}

/* ---------- The switch: a recess in the dash with a moving cap ---------- */
.key {
  position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 0;
  border-radius: 15%; background: #060708; cursor: pointer;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.9), 0 1px 0 rgba(255, 255, 255, 0.06);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.key::after {
  content: ""; position: absolute; inset: -75%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(var(--on-glow), 0.22), rgba(var(--on-glow), 0));
  opacity: 0; transition: opacity 500ms var(--ease);
}
.key-cap {
  position: absolute; inset: 3.5%; z-index: 1; border-radius: 13%;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 17% 0 16%; color: var(--white);
  background: linear-gradient(165deg, #2c3337 0%, #1c2124 42%, #14181a 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), inset 0 -3px 6px rgba(0, 0, 0, 0.45), 0 5px 12px rgba(0, 0, 0, 0.6);
  transition: transform 140ms var(--ease), box-shadow 140ms var(--ease);
}
.key-ico { width: 56%; height: auto; fill: currentColor; transition: opacity 240ms; }
.key-led {
  width: 34%; aspect-ratio: 4.4; border-radius: 999px; background: var(--steel);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.7);
  transition: background-color 180ms, box-shadow 180ms, opacity 240ms;
}
.key:active .key-cap { transform: translateY(2.5%) scale(0.985); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 -2px 4px rgba(0, 0, 0, 0.45), 0 1px 3px rgba(0, 0, 0, 0.6); }
.key:focus-visible { outline-color: var(--white); border-radius: 15%; }

.key[data-state="on"] .key-led { background: var(--on); box-shadow: 0 0 8px rgba(var(--on-glow), 0.95), 0 0 28px rgba(var(--on-glow), 0.6); }
.key[data-state="on"]::after { opacity: 1; }

/* A spare blank: the same cap with nothing on it. Hovering previews the icon that would clip in. */
.key[data-state="blank"] .key-cap { background: linear-gradient(165deg, #1d2225 0%, #15191b 100%); }
.key[data-state="blank"] .key-ico, .key[data-state="blank"] .key-led { opacity: 0; }
@media (hover: hover) { .key[data-state="blank"]:hover .key-ico { opacity: 0.3; } }

.key.is-clipping .key-cap { animation: clipIn 560ms var(--spring) both; }
@keyframes clipIn {
  from { transform: translateY(-16%) scale(1.14); opacity: 0; }
  55% { opacity: 1; }
  to { transform: none; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
}
