/* ==========================================================================
   SIGNAGE — the balasubramanian.us design system
   --------------------------------------------------------------------------
   Design brief: maximum legibility as the aesthetic, not a checkbox.
   Visual language: high-visibility road signage at night.
   Faces: Overpass (open-source descendant of FHWA Highway Gothic) for
   display; Atkinson Hyperlegible (Braille Institute) for body text.
   Contrast: white on near-black (~20:1), retroreflective yellow accents.
   ========================================================================== */

:root {
  /* Palette — night road */
  --asphalt: #0b0b0d;        /* page background */
  --headlight: #ffffff;      /* primary text */
  --retro-yellow: #ffd100;   /* accent: links, focus, markers */
  --lane-gray: #a9a9ad;      /* secondary text, annotations */
  --guide-green: #4cbb7f;    /* "open / live" indicators only */
  --panel: #131316;          /* sign panel fill */

  /* Type */
  --display: "Overpass", "Helvetica Neue", Arial, sans-serif;
  --body: "Atkinson Hyperlegible", "Overpass", Arial, sans-serif;
  --mono: "Overpass Mono", "SF Mono", Menlo, monospace;

  /* Signage geometry */
  --sign-border: 3px solid var(--headlight);
  --sign-radius: 22px;
  --measure: 62rem;
}

* { box-sizing: border-box; }

html {
  font-size: 21px; /* deliberately large base — nothing on this site is small */
}

body {
  margin: 0;
  background: var(--asphalt);
  color: var(--headlight);
  font-family: var(--body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* --- Typography ------------------------------------------------------- */

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: 0.01em;
  margin: 0 0 0.6em 0;
  text-wrap: balance;
}

h1 { font-size: clamp(2.6rem, 7vw, 4.6rem); }
h2 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.5rem); }

p, li { max-width: 34em; }

a {
  color: var(--retro-yellow);
  text-decoration-thickness: 0.09em;
  text-underline-offset: 0.18em;
}

a:hover { color: var(--headlight); }

strong { color: var(--headlight); }

.kicker {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--lane-gray);
  display: block;
  margin-bottom: 1rem;
}

.muted { color: var(--lane-gray); }

/* --- Layout ------------------------------------------------------------ */

.road {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 clamp(1.2rem, 4vw, 3rem);
}

section { margin: clamp(3rem, 8vw, 5.5rem) 0; }

/* --- Sign panels -------------------------------------------------------- */
/* The unit of this site: a highway guide-sign panel. */

.sign {
  display: block;
  background: var(--panel);
  border: var(--sign-border);
  border-radius: var(--sign-radius);
  padding: clamp(1.4rem, 3.5vw, 2.2rem) clamp(1.5rem, 4vw, 2.6rem);
  padding-right: clamp(3.6rem, 7vw, 4.8rem); /* clear the arrow */
  color: var(--headlight);
  text-decoration: none;
  position: relative;
  transition: transform 120ms ease, border-color 120ms ease;
}

a.sign:hover, a.sign:focus-visible {
  border-color: var(--retro-yellow);
  transform: translateY(-3px);
  color: var(--headlight);
}

a.sign:hover .sign-arrow { transform: translateX(6px); }

.sign h2, .sign h3 { margin-bottom: 0.25em; }

.sign p { margin: 0; color: var(--lane-gray); }

.sign-arrow {
  position: absolute;
  right: clamp(1.2rem, 3vw, 2rem);
  top: 50%;
  translate: 0 -50%;
  font-family: var(--display);
  font-weight: 800;
  font-size: 2rem;
  color: var(--retro-yellow);
  transition: transform 120ms ease;
}

.sign-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(21rem, 100%), 1fr));
  gap: 1.4rem;
}

/* Yellow warning-style variant (sparingly) */
.sign--warning {
  border-color: var(--retro-yellow);
  background: transparent;
}

/* --- Route marker ------------------------------------------------------- */
/* Small mono tags used like route shields / mile markers. */

.marker {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--asphalt);
  background: var(--retro-yellow);
  border-radius: 6px;
  padding: 0.2em 0.65em;
  margin-bottom: 0.9rem;
}

.marker--live { background: var(--guide-green); }

/* --- Site header / footer ---------------------------------------------- */

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 1.6rem;
  padding: 1.3rem 0;
  border-bottom: 1px solid #2a2a2e;
  font-family: var(--display);
  font-weight: 700;
}

.site-nav .home {
  color: var(--headlight);
  text-decoration: none;
  margin-right: auto;
  font-size: 1.05rem;
}

.site-nav a { text-decoration: none; font-size: 0.95rem; }
.site-nav a[aria-current="page"] {
  color: var(--headlight);
  border-bottom: 3px solid var(--retro-yellow);
}

.site-footer {
  margin-top: clamp(3rem, 8vw, 6rem);
  padding: 2rem 0 3rem;
  border-top: 1px solid #2a2a2e;
  color: var(--lane-gray);
  font-size: 0.85rem;
}

.site-footer a { color: var(--lane-gray); }
.site-footer a:hover { color: var(--retro-yellow); }

kbd {
  font-family: var(--mono);
  font-size: 0.8em;
  border: 1px solid #3a3a3e;
  border-bottom-width: 3px;
  border-radius: 6px;
  padding: 0.1em 0.5em;
  color: var(--headlight);
}

/* --- Lists as lane markings --------------------------------------------- */

ul.dashed { list-style: none; padding: 0; }
ul.dashed li {
  padding: 0.55em 0 0.55em 2rem;
  position: relative;
}
ul.dashed li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.05em;
  width: 1.1rem;
  height: 0.22rem;
  background: var(--retro-yellow);
  border-radius: 2px;
}

/* --- Accessibility ------------------------------------------------------ */

.skip-link {
  position: absolute;
  left: -9999px;
  background: var(--retro-yellow);
  color: var(--asphalt);
  padding: 0.8em 1.4em;
  font-family: var(--display);
  font-weight: 800;
  border-radius: 0 0 12px 0;
  z-index: 10;
}
.skip-link:focus { left: 0; top: 0; }

:focus-visible {
  outline: 4px solid var(--retro-yellow);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: var(--retro-yellow); color: var(--asphalt); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media print {
  body { background: #fff; color: #000; }
  .sign { border-color: #000; color: #000; background: #fff; }
  a { color: #000; }
}

/* --- Link-styled button (used by the HOW I SEE toggle) ------------------ */

.link-button { background: none; border: none; padding: 0; font: inherit;
  color: var(--retro-yellow); text-decoration: underline; cursor: pointer; }

/* ==========================================================================
   HOW I SEE — Stargardt simulation overlay (scripts/how_i_see.js)
   ========================================================================== */
#his-overlay { display: none; }
.his-active #his-overlay {
  display: block; position: fixed; inset: 0; z-index: 9998;
  pointer-events: none;
  backdrop-filter: blur(16px) brightness(0.45) contrast(0.8) saturate(0.7);
  -webkit-backdrop-filter: blur(16px) brightness(0.45) contrast(0.8) saturate(0.7);
  mask-image: radial-gradient(circle 20vmin at var(--sx, 50%) var(--sy, 50%),
              black 0 55%, transparent 100%);
  -webkit-mask-image: radial-gradient(circle 20vmin at var(--sx, 50%) var(--sy, 50%),
              black 0 55%, transparent 100%);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .his-active #his-overlay {
    background: radial-gradient(circle 20vmin at var(--sx, 50%) var(--sy, 50%),
                rgba(11,11,13,0.94) 0 55%, transparent 100%);
    mask-image: none; -webkit-mask-image: none;
  }
}
#his-note { display: none; }
.his-active #his-note {
  display: block; position: fixed; left: 50%; bottom: 1.2rem;
  transform: translateX(-50%); z-index: 9999; max-width: 34rem;
  background: var(--panel); border: var(--sign-border);
  border-radius: var(--sign-radius); padding: .8rem 1.1rem;
  font-family: var(--body); font-size: 1rem;
}
#his-note button {
  font: inherit; font-family: var(--mono); margin-left: .6rem;
  background: var(--retro-yellow); color: var(--asphalt);
  border: none; border-radius: 8px; padding: .15rem .7rem; cursor: pointer;
}
@media (prefers-reduced-motion: reduce) {
  .his-active #his-overlay { transition: none; }
}

/* Externally-hosted Workshop entries (balasubramanian.org) */
.exit .host { font-family: var(--mono); font-size: .72rem;
  color: var(--retro-yellow); letter-spacing: .08em; margin-left: .4rem; }
