/* ==========================================================================
   Design G, The Poll: the console's shell, shared by every page under /designg/.
   The fonts, the console's tokens, the top strip of loop keys and the base panel
   with its dataplate. Token names that the live stylesheets also use carry a g-
   prefix here, so a page can load this beside base.css without either disturbing
   the other.
   ========================================================================== */

@font-face {
  font-family: "Archivo";
  src: url("/assets/fonts/archivo-latin-wdth.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Courier Prime";
  src: url("/assets/fonts/courier-prime-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Courier Prime";
  src: url("/assets/fonts/courier-prime-latin-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Courier Prime";
  src: url("/assets/fonts/courier-prime-latin-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  /* the console's paint, and the grooves between its panels */
  --paint: #aab4a2;
  --paint-hi: #b8c1b0;
  --paint-lo: #949e8c;
  --paint-deep: #7c8676;
  --seam: #5f685b;

  /* engraving */
  --g-ink: #151914;
  --g-ink-2: #2f362e;
  --hi: rgba(236, 242, 230, 0.42);

  /* glass: bezels, screens, the phosphor on them */
  --bezel: #131613;
  --glass: #07100b;
  --phos: #cdf3da;
  --phos-2: #86c9a1;
  --phos-3: #4c7d61;

  /* lamps */
  --amber: #ffb02e;
  --amber-hot: #ffe3a3;
  --amber-off: #4d3a1a;
  --red: #ff4a30;
  --red-off: #4a1d16;
  --milk: #e4e7dc;
  --milk-hi: #f3f4ec;
  --lamp-glow: rgba(255, 176, 46, 0.55);
  --readout-glass: #0f0c07;
  --printer: #171a17;

  /* paper and the ribbon */
  --g-paper: #f1f3ec;
  --paper-bar: #d9e9d3;
  --type: #1d2024;
  --type-2: #474c52;
  --type-3: #5a5f64;

  --f-set: "Archivo", "Univers", "Helvetica Neue", Arial, sans-serif;
  --f-type: "Courier Prime", "Courier New", Courier, monospace;

  --g-gutter: clamp(1rem, 4vw, 3rem);
  --g-max: 92rem;
  --g-ease: cubic-bezier(0.16, 1, 0.3, 1);

  --screw: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Ccircle cx='6' cy='6' r='5.2' fill='%23c5ccbd' stroke='%23586152' stroke-width='0.9'/%3E%3Cpath d='M2.6 7.4 9.4 4.6' stroke='%23586152' stroke-width='1.3' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* the strip and the base carry their own type and ink, whatever page they frame */
.strip, .base {
  position: relative;
  padding-inline: max(var(--g-gutter), calc((100% - var(--g-max)) / 2));
  background:
    var(--screw) left 0.55rem top 0.55rem / 0.72rem no-repeat,
    var(--screw) right 0.55rem top 0.55rem / 0.72rem no-repeat,
    var(--screw) left 0.55rem bottom 0.55rem / 0.72rem no-repeat,
    var(--screw) right 0.55rem bottom 0.55rem / 0.72rem no-repeat,
    var(--paint);
  border-top: 2px solid var(--seam);
  box-shadow: inset 0 1px 0 var(--hi);
  color: var(--g-ink);
  font-family: var(--f-set);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: normal;
  -webkit-font-smoothing: antialiased;
}
.strip *, .base * { box-sizing: border-box; }
.strip p, .strip ul, .base p, .base ul { margin: 0; }
.strip ul, .base ul { padding: 0; list-style: none; }
.strip a, .base a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.strip :focus-visible, .base :focus-visible { outline: 2px solid var(--g-ink); outline-offset: 3px; border-radius: 2px; }
.loop-when {
  font-family: var(--f-set);
  font-stretch: 75%;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.arw { width: 1.1em; height: 0.62em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* a lamp: dark glass until it is lit */
.lamp {
  display: inline-block;
  flex: none;
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  background: var(--amber-off);
  box-shadow: 0 0 0 2px var(--bezel), inset 0 -2px 3px rgba(0, 0, 0, 0.45);
  transition: background-color 90ms linear, box-shadow 90ms linear;
}
.lamp--lit {
  background: var(--amber);
  box-shadow: 0 0 0 2px var(--bezel), inset 0 2px 3px var(--amber-hot), 0 1px 10px 1px var(--lamp-glow);
}

/* ---------- the top strip: loop keys ---------- */
.strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.9rem;
  border-top: 0;
  background: var(--paint-hi);
  box-shadow: inset 0 -2px 0 var(--seam);
}
.plate-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  font-stretch: 75%;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  --signal: var(--amber);
}
.plate-mark .mark { width: 1.9rem; height: 1.9rem; color: var(--g-ink); }
.plate-mark:hover { color: var(--g-ink-2); }

.strip-toggle {
  display: none;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.75rem;
  padding: 0.5rem 0.95rem;
  border: 0;
  border-radius: 0.3rem;
  background: var(--milk);
  color: var(--g-ink);
  font: 700 0.85rem/1 var(--f-set);
  font-stretch: 75%;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 0 0 3px var(--bezel), inset 0 -3px 0 rgba(0, 0, 0, 0.12);
}
.strip-toggle[aria-expanded="true"] .lamp { background: var(--amber); }

.loops ul { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.55rem; }
.loop {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 0.35rem;
  height: 100%;
  padding: 0.1rem 0;
  text-decoration: none;
}
.loop-when { font-size: 0.72rem; color: var(--g-ink-2); }
.loop-key {
  display: block;
  padding: 0.5rem 0.55rem 0.45rem;
  border-radius: 0.2rem;
  background: var(--milk);
  font-stretch: 72%;
  font-weight: 750;
  font-size: 0.9rem;
  line-height: 1.05;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 0 0 3px var(--bezel), inset 0 -3px 0 rgba(0, 0, 0, 0.1);
  transition: background-color 90ms linear, box-shadow 90ms linear;
}
.loop-blurb { font-size: 0.74rem; line-height: 1.3; color: var(--g-ink-2); }
.loop:hover .loop-key, .loop:focus-visible .loop-key, .loop[aria-current] .loop-key {
  background: var(--amber);
  box-shadow: 0 0 0 3px var(--bezel), inset 0 2px 4px var(--amber-hot), 0 2px 12px 0 var(--lamp-glow);
}
.loop--other .loop-key { background: var(--g-paper); font-family: var(--f-type); font-weight: 400; font-stretch: normal; letter-spacing: 0.02em; text-transform: none; font-size: 0.95rem; }

@media (min-width: 64rem) {
  .strip { align-items: start; }
  .plate-mark { max-width: 10.5rem; padding-top: 1rem; }
  .loops { flex: 1; max-width: 70rem; }
}
@media (max-width: 63.99rem) {
  html.js .strip { flex-wrap: wrap; }
  html.js .strip-toggle { display: inline-flex; }
  html.js .loops { display: none; width: 100%; }
  html.js .strip.is-open .loops { display: block; }
  .loops ul { grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); gap: 1rem 0.9rem; padding: 0.6rem 0.2rem 0.4rem; }
  .loops { width: 100%; }
}

/* ---------- the base panel ---------- */
.base {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 2rem clamp(2rem, 5vw, 5rem);
  padding-block: clamp(2.5rem, 5vw, 4rem);
  background-color: var(--paint-lo);
}
.base-title { display: grid; gap: 1rem; align-content: start; }
.base-title p { max-width: 46ch; color: var(--g-ink); line-height: 1.5; }
.base-title i { font-style: italic; }
.base-nav ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 10rem), 1fr)); gap: 0.55rem 2.2rem; }
.base-nav a {
  font-stretch: 75%;
  font-weight: 650;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
}
.base-nav a:hover { text-decoration: underline; }
@media (max-width: 48rem), (pointer: coarse) {
  .base-nav a, .plate-mark { display: inline-flex; align-items: center; min-height: 2.75rem; }
}
.dataplate {
  grid-column: 1 / -1;
  display: grid;
  gap: 0.5rem;
  padding: 1rem 2.2rem;
  border-radius: 0.2rem;
  background:
    var(--screw) left 0.55rem center / 0.72rem no-repeat,
    var(--screw) right 0.55rem center / 0.72rem no-repeat,
    linear-gradient(180deg, #c9cec3, #b9bfb3);
  box-shadow: 0 0 0 1px var(--seam), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--g-ink-2);
}
.dataplate i { font-style: italic; }
.dataplate-key { font-stretch: 80%; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; font-size: 0.72rem; }

@media (max-width: 48rem) {
  .base { grid-template-columns: minmax(0, 1fr); }
  .dataplate { padding: 1rem 2.1rem; }
}

