/* Telly: shared chrome for the three pages (the telly, WJ Weekly, WJ Text).
   Fonts, the room palette, base rules, the tab bar and the page footer. */

@font-face {
  font-family: 'Archivo';
  src: url('../fonts/archivo.woff2') format('woff2');
  font-weight: 400 900;
  font-stretch: 100% 125%;
  font-display: swap;
}
@font-face {
  font-family: 'Bedstead';
  src: url('../fonts/bedstead.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

:root {
  --room: #060608;
  --ink: #f1ece2;
  --ink-2: #bdb6a8;
  --ink-3: #8f897d;
  --hot: #ff5b2e;
  --led: #57ff8c;
  --fx-red: #ff4a3d;
  --fx-green: #3ddc5f;
  --fx-yellow: #ffd23f;
  --fx-blue: #4f8cff;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --ui: 'Archivo', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --tt: 'Bedstead', ui-monospace, Menlo, Consolas, monospace;
  --tabs-bar: 56px;                                 /* the bar itself */
  --tabs-h: calc(var(--tabs-bar) + var(--sat));     /* the bar plus the top safe area */
  color-scheme: dark;
}
@media (min-width: 900px) { :root { --tabs-bar: 60px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--room); scroll-behavior: smooth; }
body {
  margin: 0; background: var(--room); color: var(--ink);
  font: 400 16px/1.5 var(--ui); font-stretch: 100%;
  overflow-x: hidden; -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; }
a { color: inherit; }
svg { display: block; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -80px; z-index: 60; background: var(--ink); color: #000; padding: 12px 16px; border-radius: 10px; font-weight: 700; text-decoration: none; }
.skip:focus { top: calc(var(--sat) + 8px); }
:focus-visible { outline: 3px solid #ffd23f; outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---------- the tab bar: an engraved control strip, tabs are the set's push buttons ---------- */
.tabs {
  position: relative; z-index: 20;
  display: grid; grid-template-columns: minmax(44px, 1fr) minmax(0, auto) minmax(44px, 1fr); align-items: center; gap: 6px;
  height: var(--tabs-h);
  padding: var(--sat) calc(var(--sar) + 8px) 0 calc(var(--sal) + 8px);
  background:
    linear-gradient(180deg, rgb(255 255 255 / .045), transparent 40%),
    repeating-linear-gradient(90deg, rgb(255 255 255 / .012) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, #17171b, #0f0f12);
  box-shadow: inset 0 -1px 0 rgb(0 0 0 / .9), 0 1px 0 rgb(255 255 255 / .05), 0 8px 24px -12px rgb(0 0 0 / .9);
}
.tabs-mark { /* the wordmark, engraved like the maker's badge on the set; hidden where there is no room */
  grid-column: 1; justify-self: start; display: inline-flex; align-items: center; min-width: 0; max-width: 100%; min-height: 44px;
  padding: 0 10px; border-radius: 10px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  color: #d9d3c7; text-decoration: none;
  font: 800 12px/1 var(--ui); font-stretch: 125%; letter-spacing: .16em; text-transform: uppercase;
  text-shadow: 0 1px 0 rgb(0 0 0 / .8);
  transition: color .2s, background .2s;
}
a.tabs-mark:hover { color: #fff; background: rgb(255 255 255 / .05); }
@media (max-width: 859px) { .tabs-mark { display: none; } }
.tabs-list { /* columns are named, so the tabs stay in the middle when the wordmark is hidden */
  grid-column: 2; display: flex; align-items: center; gap: 4px; margin: 0; padding: 4px; list-style: none; min-width: 0;
  border-radius: 13px; background: #08080a;
  box-shadow: inset 0 2px 5px rgb(0 0 0 / .9), inset 0 0 0 1px rgb(0 0 0 / .6), 0 1px 0 rgb(255 255 255 / .07);
}
.tabs-list li { --fx: var(--fx-red); }
.tabs-list li:nth-child(2) { --fx: var(--fx-green); }
.tabs-list li:nth-child(3) { --fx: var(--fx-yellow); }
.tab {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 14px 0 12px; border-radius: 9px; white-space: nowrap;
  color: #a9a397; text-decoration: none;
  font: 700 12px/1 var(--ui); font-stretch: 112%; letter-spacing: .1em; text-transform: uppercase;
  background: linear-gradient(180deg, #232328, #19191d);
  box-shadow: 0 2px 0 #050506, inset 0 1px 0 rgb(255 255 255 / .1);
  transition: color .2s, transform .08s, box-shadow .08s, background .2s;
}
.tab::before { /* the fastext LED */
  content: ''; width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: color-mix(in srgb, var(--fx) 30%, #111);
  box-shadow: inset 0 1px 1px rgb(0 0 0 / .6);
}
.tab::after { /* touch target to 44 px tall without growing the button */
  content: ''; position: absolute; left: 0; right: 0; top: -2px; bottom: -2px;
}
.tab:hover { color: var(--ink); }
.tab:active { transform: translateY(1px); box-shadow: 0 1px 0 #050506, inset 0 1px 0 rgb(255 255 255 / .06); }
.tab[aria-current="page"] {
  color: #fff;
  background: linear-gradient(180deg, #121215, #1b1b20);
  box-shadow: inset 0 2px 4px rgb(0 0 0 / .85), inset 0 0 0 1px rgb(255 255 255 / .05), inset 0 -2px 0 var(--fx);
}
.tab[aria-current="page"]::before { background: var(--fx); box-shadow: 0 0 6px 1px color-mix(in srgb, var(--fx) 70%, transparent), 0 0 14px 2px color-mix(in srgb, var(--fx) 30%, transparent); }
.tabs-end { grid-column: 3; justify-self: end; display: flex; align-items: center; gap: 6px; min-width: 0; }

@media (max-width: 599px) {
  .tabs { gap: 4px; padding-left: calc(var(--sal) + 6px); padding-right: calc(var(--sar) + 6px); }
  .tabs-list { gap: 3px; padding: 3px; }
  .tab { padding: 0 10px; gap: 0; font-size: 11px; letter-spacing: .06em; font-stretch: 100%; }
  .tab::before { display: none; }
}
@media (max-width: 359px) {
  .tabs { padding-left: calc(var(--sal) + 2px); padding-right: calc(var(--sar) + 2px); gap: 2px; }
  .tab { padding: 0 7px; font-size: 10.5px; letter-spacing: .03em; }
}

/* ---------- the page footer ---------- */
.g-foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 24px;
  max-width: 1180px; margin: 70px auto 0;
  padding: 18px max(16px, var(--sar)) calc(var(--sab) + 24px) max(16px, var(--sal));
  border-top: 1px solid rgb(255 255 255 / .09);
  font: 700 11px/1.4 var(--ui); font-stretch: 112%; letter-spacing: .16em; color: var(--ink-3); text-transform: uppercase;
}
.g-foot p { margin: 0; }
.g-foot-r { display: flex; flex-wrap: wrap; gap: 0 18px; align-items: center; }
.g-foot a { color: var(--ink-2); text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.g-foot a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
