/* The Daily Downlink — phosphor console.
   One face, one grid, one accent pair. No cards, no boxes, no build step.
   Rules appear only where they carry structure: under the status bar, between
   log entries. Everything else is held by alignment. */

/* ---------- face ---------- */

@font-face {
  font-family: "Sometype Mono";
  src: url("/assets/fonts/sometype-mono-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Sometype Mono";
  src: url("/assets/fonts/sometype-mono-latin-italic.woff2") format("woff2");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- tokens ---------- */

:root {
  /* Two phosphors, the way terminals actually shipped: green for the record,
     amber for anything that points somewhere else. */
  --ground:      #080c0a;
  --phos:        #9ccfb0;  /* body */
  --phos-bright: #d6f5e2;  /* headings, the live entry */
  --phos-dim:    #6f9a81;  /* stamps, field labels */
  --amber:       #e0a95c;  /* links, sources */
  --amber-bright:#f6cd93;
  --phos-hot:    #eafff2;  /* beam hit harder: internal link excitation */
  --rule:        #1b2723;
  --ground-lit:  #121e19;  /* the only non-ground surface: log row under the cursor */

  --mono: "Sometype Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --rail: 8.5rem;
  --gutter: 2rem;
  --measure: 42rem;
  --pad: 1.5rem;

  /* phosphor decay: instant excitation, slow fade */
  --strike: 40ms;
  --decay: 620ms;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--ground);
  color: var(--phos);
  font-family: var(--mono);
  font-size: 1.0625rem;
  line-height: 1.7;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--phos); color: var(--ground); }

main { flex: 1 0 auto; }

/* ---------- the grid ----------
   Column 1 is the stamp rail. Column 2 is the record. Header, main and footer
   all sit on it, so the left edge never moves down the page. */

.grid {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, var(--measure));
  column-gap: var(--gutter);
  max-width: calc(var(--rail) + var(--gutter) + var(--measure) + var(--pad) * 2);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.grid > * { grid-column: 2; }
.grid > .rail { grid-column: 1; }

@media (max-width: 46rem) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .grid > *, .grid > .rail { grid-column: 1; }
}

/* ---------- links: phosphor persistence ---------- */

/* Green stays inside the record; amber leaves it. Internal links are the
   record lit brighter, outbound references are the second phosphor. */
a {
  color: var(--phos);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color var(--decay) var(--ease);
}
a:hover, a:focus-visible {
  color: var(--phos-hot);
  transition-duration: var(--strike);
}

a[href^="http"] { color: var(--amber); }
a[href^="http"]:hover,
a[href^="http"]:focus-visible { color: var(--amber-bright); }

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: -9999px;
  background: var(--ground);
  color: var(--phos-bright);
  padding: 0.6rem 1rem;
  font-size: 0.8125rem;
  z-index: 10;
}
.skip:focus { left: 0; top: 0; }

/* ---------- status bar ---------- */

.statusbar {
  border-bottom: 1px solid var(--rule);
  margin-bottom: 4rem;
}

.statusbar .grid {
  display: flex;
  align-items: baseline;
  gap: 0.75rem 1.25rem;
  flex-wrap: wrap;
  padding-block: 1.1rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--phos-bright);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: color var(--decay) var(--ease);
}
.wordmark:hover { color: var(--phos-bright); transition-duration: var(--strike); }
.wordmark .mark { color: var(--amber); flex: none; }

.station {
  margin: 0;
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--phos-dim);
}

/* Once the bar wraps, the second row starts at the left edge rather than
   hanging under the wordmark. Must come after the margin-left:auto above. */
@media (max-width: 46rem) {
  .station { margin-left: 0; }
}

.statusbar nav { font-size: 0.8125rem; display: flex; gap: 1rem; }
.statusbar nav a {
  color: var(--phos);
  text-decoration: none;
  transition: color var(--decay) var(--ease);
}
.statusbar nav a:hover,
.statusbar nav a:focus-visible {
  color: var(--phos-hot);
  text-decoration: underline;
  transition-duration: var(--strike);
}

/* ---------- stamps (rail content) ---------- */

.stamp {
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--phos-dim);
  font-variant-numeric: tabular-nums;
  padding-top: 1.1rem;   /* sits the stamp on the title's first baseline */
}
.stamp b {
  display: block;
  font-weight: 400;
  color: var(--amber);
}

@media (max-width: 46rem) {
  .stamp { padding-top: 0; margin-bottom: 0.5rem; }
  .stamp b { display: inline; margin-right: 0.5rem; }
}

/* ---------- the live entry ---------- */

.entry { margin-bottom: 5rem; }

.entry-title {
  margin: 0 0 1.25rem;
  font-size: 1.75rem;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--phos-bright);
}
.entry-title a { color: inherit; text-decoration: none; }
.entry-title a:hover { color: var(--phos-bright); }

.entry-lede {
  margin: 0 0 1.5rem;
  font-size: 1.0625rem;
  color: var(--phos);
}

.readon { font-size: 0.8125rem; }

@media (min-width: 46rem) {
  .entry-title { font-size: 2.125rem; }
}

/* ---------- the log ---------- */

.log-head {
  margin: 0 0 0.25rem;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--phos-dim);
}

/* The log spans both columns so each entry keeps its stamp in the rail; its
   heading labels the titles, so it sits over the record column. */
.grid > .log { grid-column: 1 / -1; }
.grid > .log-head { grid-column: 2; }

.log { list-style: none; margin: 0; padding: 0; }

.log > li {
  transition: background-color var(--decay) var(--ease);
  display: grid;
  grid-template-columns: var(--rail) minmax(0, var(--measure));
  column-gap: var(--gutter);
  border-top: 1px solid var(--rule);
  padding-block: 1.1rem;
}

.log > li:hover { background-color: var(--ground-lit); transition-duration: var(--strike); }
.log > li:hover .log-title { color: var(--phos-hot); transition-duration: var(--strike); }
.log > li:hover .log-date { color: var(--phos); transition-duration: var(--strike); }

.log-date {
  transition: color var(--decay) var(--ease);
  grid-column: 1;
  font-size: 0.75rem;
  color: var(--phos-dim);
  font-variant-numeric: tabular-nums;
  padding-top: 0.15rem;  /* baseline-matched to .log-title */
}

.log-title {
  grid-column: 2;
  font-size: 1rem;
  font-weight: 700;
  color: var(--phos-bright);
  text-decoration: none;
  transition: color var(--decay) var(--ease);
}
.log-title:hover { color: var(--phos-hot); transition-duration: var(--strike); }

.log-sum {
  grid-column: 2;
  font-size: 0.875rem;
  color: var(--phos-dim);
  margin-top: 0.15rem;
}

@media (max-width: 46rem) {
  .log > li { grid-template-columns: minmax(0, 1fr); }
  .log-date, .log-title, .log-sum { grid-column: 1; padding-top: 0; }
  .log-date { margin-bottom: 0.3rem; }
}

/* Measurement material: the log is a record, so it states its own size. */
.record-status {
  grid-column: 1 / -1;
  margin: 1.75rem 0 0;
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
  font-size: 0.75rem;
  color: var(--phos-dim);
  font-variant-numeric: tabular-nums;
}

/* ---------- record (post + page body) ---------- */

.record-title {
  margin: 0 0 2.5rem;
  font-size: 1.75rem;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--phos-bright);
}

@media (min-width: 46rem) {
  .record-title { font-size: 2.125rem; }
}

.body > p:first-of-type {
  font-size: 1.0625rem;
  color: var(--phos-bright);
  margin-top: 0;
  margin-bottom: 2.25rem;
}

.body h2 {
  margin: 3.5rem 0 1.25rem;
  font-size: 1.25rem;
  line-height: 1.35;
  font-weight: 700;
  color: var(--phos-bright);
  letter-spacing: -0.01em;
}

.body h3 {
  margin: 2.5rem 0 0.75rem;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--phos-bright);
}

.body p { margin: 0 0 1.5rem; }

/* "**What happened.**" / "**Why it matters.**" become record field labels
   without touching a character of the markdown. */
.body p > strong:first-child {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--phos-dim);
  margin-bottom: 0.35rem;
}

/* "_Source: [domain](url)_" — the attribution line, second phosphor. */
.body p > em:only-child {
  display: block;
  font-style: normal;
  font-size: 0.8125rem;
  color: var(--phos-dim);
  margin-top: -0.75rem;
}

.body ul, .body ol { margin: 0 0 1.5rem; padding-left: 1.4rem; }
.body ul { list-style: square; }
.body li { margin-bottom: 0.85rem; }
.body li::marker { color: var(--phos-dim); }
.body li strong { color: var(--phos-bright); }

.body blockquote {
  margin: 2rem 0;
  padding-left: 1.25rem;
  border-left: 1px solid var(--rule);
  color: var(--phos-dim);
}

.body code {
  font-size: 0.9em;
  color: var(--amber);
}

.body pre {
  overflow-x: auto;
  padding: 1rem 1.1rem;
  border: 1px solid var(--rule);
  font-size: 0.875rem;
  line-height: 1.6;
}
.body pre code { color: var(--phos); }

.body img { max-width: 100%; height: auto; }
.body hr { border: 0; border-top: 1px solid var(--rule); margin: 3rem 0; }

.record-foot {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.8125rem;
}
.record-foot p { margin: 0; }

/* ---------- empty ---------- */

.empty { margin-bottom: 5rem; }

/* ---------- footer ---------- */

.site-foot {
  margin-top: 7rem;
  border-top: 1px solid var(--rule);
  font-size: 0.75rem;
  color: var(--phos-dim);
}

.site-foot .grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  padding-block: 1.75rem;
}
.site-foot p { margin: 0; }
.site-foot .right { margin-left: auto; display: flex; gap: 1.25rem; }
.site-foot a { color: var(--phos-dim); text-decoration: none; }
.site-foot a[href^="http"] { color: var(--amber); }
.site-foot a:hover { color: var(--phos-hot); }
.site-foot a[href^="http"]:hover { color: var(--amber-bright); }

/* ---------- narrow viewports ----------
   Declared last on purpose: these override base rules of equal specificity,
   and an earlier media block loses that cascade silently. */

@media (max-width: 46rem) {
  :root { --pad: 0.9rem; }
  body { font-size: 0.9375rem; }
  .entry-lede,
  .body > p:first-of-type { font-size: 0.9375rem; }
}

/* ---------- motion / print ---------- */

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

@media print {
  .statusbar, .site-foot, .record-foot, .skip { display: none; }
  body { background: #fff; color: #000; font-size: 10.5pt; }
  .grid { display: block; max-width: none; }
  .record-title, .body h2, .body h3, .body > p:first-of-type { color: #000; }
  a { color: #000; }
  .body a::after { content: " (" attr(href) ")"; font-size: 8.5pt; color: #444; }
}
