/* ==========================================================================
   Shelly's blog
   Dark, spacey, restrained. One accent colour, generous vertical rhythm.
   ========================================================================== */

:root {
  --bg:          #090c13;
  --bg-soft:     #0f141f;
  --bg-card:     #141a28;
  --bg-inset:    #0b0f18;
  --line:        #212a3c;
  --line-soft:   #1a2231;
  --text:        #dbe2ef;
  --text-bright: #f2f5fa;
  --text-dim:    #8792a9;
  --text-faint:  #5d6880;
  --accent:      #7ee0c8;
  --accent-dim:  #3f9c86;
  --accent-glow: rgba(126, 224, 200, .14);
  --amber:       #e6c07b;
  --measure:     40rem;
  --radius:      10px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.72 var(--sans);
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent-glow); color: var(--text-bright); }

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 24px;
}

/* ==========================================================================
   Masthead
   ========================================================================== */

.masthead {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 62px 0 38px;
  margin-bottom: 52px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
}

/* soft glow from above */
.masthead::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(1200px 420px at 50% -180px, rgba(126,224,200,.10), transparent 70%),
    radial-gradient(900px 380px at 84% -120px, rgba(230,192,123,.05), transparent 70%);
}

/* faint starfield, three layers at different sizes */
.masthead::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .5;
  background-image:
    radial-gradient(1px 1px at 18% 32%, rgba(255,255,255,.55) 50%, transparent 51%),
    radial-gradient(1px 1px at 63% 18%, rgba(255,255,255,.40) 50%, transparent 51%),
    radial-gradient(1px 1px at 84% 58%, rgba(255,255,255,.30) 50%, transparent 51%),
    radial-gradient(1px 1px at 33% 71%, rgba(255,255,255,.28) 50%, transparent 51%),
    radial-gradient(1px 1px at 71% 82%, rgba(255,255,255,.35) 50%, transparent 51%),
    radial-gradient(1px 1px at 8%  55%, rgba(255,255,255,.22) 50%, transparent 51%);
  background-size:
    340px 260px, 470px 380px, 260px 300px,
    400px 440px, 300px 220px, 520px 400px;
}

.masthead h1 {
  margin: 0 0 10px;
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: -.02em;
  font-weight: 700;
}

.masthead h1 a {
  color: var(--text-bright);
  text-decoration: none;
  transition: color .15s ease;
}

.masthead h1 a:hover { color: var(--accent); }

.tagline {
  margin: 0;
  max-width: 34rem;
  color: var(--text-dim);
  font-size: 16.5px;
  line-height: 1.65;
}

.snail {
  display: inline-block;
  margin-right: 9px;
  filter: saturate(1.2);
}

/* Compact variant used on article pages: keeps the link back, drops the bulk. */
.masthead.compact {
  padding: 22px 0 18px;
  margin-bottom: 44px;
}

.masthead.compact h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .01em;
}

.masthead.compact h1 a { color: var(--text-dim); }
.masthead.compact h1 a:hover { color: var(--accent); }
.masthead.compact .snail { margin-right: 7px; }

/* ==========================================================================
   Article
   ========================================================================== */

article { padding-bottom: 20px; }

article h1 {
  margin: 0 0 16px;
  font-size: clamp(30px, 5.4vw, 41px);
  line-height: 1.14;
  letter-spacing: -.028em;
  font-weight: 700;
  color: var(--text-bright);
}

.kicker {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 12.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 600;
}

.standfirst {
  margin: 0 0 36px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 19px;
  line-height: 1.58;
}

/* Short accent rule above each section heading */
article h2 {
  margin: 58px 0 16px;
  font-size: 23px;
  line-height: 1.3;
  letter-spacing: -.016em;
  font-weight: 650;
  color: var(--text-bright);
}

article h2::before {
  content: "";
  display: block;
  width: 30px;
  height: 2px;
  margin-bottom: 18px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-dim));
}

article h2:first-of-type { margin-top: 46px; }

article h3 {
  margin: 34px 0 10px;
  font-size: 18px;
  font-weight: 650;
  color: var(--text-bright);
}

article p { margin: 0 0 20px; }

article a {
  color: var(--accent);
  text-decoration-color: var(--accent-dim);
  text-underline-offset: 3px;
  transition: color .15s ease;
}

article a:hover { color: #a8f0dd; }

article strong { color: var(--text-bright); font-weight: 650; }
article em { color: #c7d1e2; }

article ol, article ul { margin: 0 0 22px; padding-left: 24px; }
article li { margin-bottom: 10px; }
article li::marker { color: var(--accent-dim); }

article code {
  font-family: var(--mono);
  font-size: .875em;
  padding: 1.5px 6px;
  color: var(--amber);
  background: var(--bg-inset);
  border: 1px solid var(--line);
  border-radius: 5px;
}

/* Pull quote */
blockquote {
  margin: 30px 0;
  padding: 18px 22px;
  color: #c2cddf;
  font-style: italic;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent-dim);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: linear-gradient(90deg, rgba(126,224,200,.05), transparent 70%);
}

blockquote p:last-child { margin-bottom: 0; }

/* ==========================================================================
   Code blocks
   ========================================================================== */

pre {
  margin: 26px 0;
  padding: 18px 20px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.6;
  background: var(--bg-inset);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.02);
}

pre code {
  padding: 0;
  font-size: inherit;
  color: #c6d1e4;
  background: none;
  border: 0;
}

pre .c { color: var(--text-faint); }

/* ==========================================================================
   Figures
   ========================================================================== */

figure { margin: 32px 0; }

figure img {
  display: block;
  width: 100%;
  height: auto;
  background: #05070c;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.03),
    0 18px 40px -24px rgba(0,0,0,.9);
}

figcaption {
  margin-top: 12px;
  color: var(--text-faint);
  font-size: 13.5px;
  line-height: 1.5;
  text-align: center;
}

/* ==========================================================================
   Tables
   ========================================================================== */

.table-scroll {
  margin: 30px 0;
  overflow-x: auto;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 40px -28px rgba(0,0,0,.9);
}

table {
  width: 100%;
  min-width: 440px;
  font-size: 14.5px;
  border-collapse: collapse;
}

th, td {
  padding: 11px 15px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--line-soft);
}

th {
  color: var(--text-dim);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  background: #182033;
  border-bottom: 1px solid var(--line);
}

tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s ease; }
tbody tr:hover { background: rgba(126,224,200,.045); }

td.num, th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Next-episode callout
   ========================================================================== */

.next-up {
  margin-top: 56px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(126,224,200,.055), rgba(126,224,200,.015));
}

.next-up h3 {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.next-up p {
  margin: 0;
  color: var(--text-dim);
  font-size: 15.5px;
}

/* ==========================================================================
   Footer + Expanse epilogue
   ========================================================================== */

footer {
  margin-top: 60px;
  padding: 34px 0 64px;
  border-top: 1px solid var(--line);
}

.epilogue {
  position: relative;
  margin-bottom: 30px;
  padding: 20px 22px 18px;
  text-align: center;
  background: var(--bg-inset);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}

/* small teal tick on the top edge */
.epilogue::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 50%;
  width: 44px;
  height: 2px;
  transform: translateX(-50%);
  border-radius: 0 0 2px 2px;
  background: linear-gradient(90deg, transparent, var(--accent-dim), transparent);
}

.quote-line {
  margin: 0;
  color: #cbd5e6;
  font-size: 16.5px;
  line-height: 1.55;
  font-style: italic;
}

/* reserve space so the card does not jump while JS fills it in */
.quote-line span, .quote-attr span { min-height: 1em; }

.quote-attr {
  margin: 10px 0 0;
  color: var(--text-faint);
  font-size: 12px;
  font-style: normal;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.foot-nav {
  margin: 0;
  color: var(--text-faint);
  font-size: 14px;
}

.foot-nav a {
  color: var(--text-dim);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: color .15s ease, border-color .15s ease;
}

.foot-nav a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent-dim);
}

/* ==========================================================================
   Post index
   ========================================================================== */

.posts {
  padding: 0;
  margin: 0 0 20px;
  list-style: none;
}

.posts li {
  padding: 22px 24px;
  margin-bottom: 14px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.posts li:hover {
  border-color: var(--accent-dim);
  transform: translateY(-2px);
  box-shadow: 0 20px 40px -28px rgba(0,0,0,.95);
}

.posts h2 {
  margin: 0 0 7px;
  font-size: 20px;
  letter-spacing: -.01em;
}

.posts h2::before { display: none; }

.posts h2 a {
  color: var(--text-bright);
  text-decoration: none;
  transition: color .15s ease;
}

.posts h2 a:hover { color: var(--accent); }

.posts p {
  margin: 0;
  color: var(--text-dim);
  font-size: 15.5px;
  line-height: 1.62;
}

.meta {
  margin-bottom: 8px;
  color: var(--accent-dim);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 620px) {
  body { font-size: 16.5px; }
  .wrap { padding: 0 18px; }
  .masthead { padding: 42px 0 30px; margin-bottom: 38px; }
  .masthead.compact { padding: 18px 0 16px; margin-bottom: 34px; }
  .standfirst { margin-bottom: 30px; padding-bottom: 26px; font-size: 17.5px; }
  article h2 { margin-top: 46px; font-size: 21px; }
  figure, .table-scroll, pre { margin-left: -4px; margin-right: -4px; }
  figcaption { font-size: 13px; }
  pre { padding: 15px 16px; font-size: 13px; }
  .quote-line { font-size: 15.5px; }
}

/* ==========================================================================
   Knowledgebase
   ========================================================================== */

.kb-nav {
  border-bottom: 1px solid var(--line);
  background: var(--bg-inset);
  margin-bottom: 40px;
}

.kb-nav .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
  align-items: baseline;
  padding-top: 13px;
  padding-bottom: 13px;
}

.kb-nav a {
  color: var(--text-dim);
  font-size: 14.5px;
  text-decoration: none;
  padding-bottom: 1px;
  border-bottom: 1px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}

.kb-nav a:hover { color: var(--accent); }

.kb-nav a[aria-current="page"] {
  color: var(--accent);
  border-bottom-color: var(--accent-dim);
}

.kb-nav .kb-home { color: var(--text-bright); font-weight: 600; }
.kb-nav .kb-home:hover { color: var(--accent); }

/* confidence markers, used in the reference tables */
.conf {
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-weight: 600;
  white-space: nowrap;
}

.conf-verified { color: var(--accent-dim); }
.conf-inferred { color: var(--amber); }
.conf-unknown  { color: var(--text-faint); }

.note {
  margin: 26px 0;
  padding: 16px 20px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-dim);
  background: var(--bg-inset);
  border: 1px solid var(--line);
  border-left: 3px solid var(--amber-dim, #8a6a35);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.note p { margin: 0 0 10px; }
.note p:last-child { margin-bottom: 0; }
.note strong { color: var(--text-bright); }

ul.facts { margin: 0 0 22px; padding-left: 22px; }
ul.facts li { margin-bottom: 9px; color: var(--text); }
ul.facts li::marker { color: var(--accent-dim); }

dl.spec { margin: 0 0 24px; }
dl.spec dt {
  color: var(--text-dim);
  font-size: 12.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 600;
  margin-top: 16px;
}
dl.spec dd {
  margin: 4px 0 0;
  color: var(--text);
}

@media (max-width: 620px) {
  .kb-nav .wrap { gap: 3px 16px; padding-top: 11px; padding-bottom: 11px; }
  .kb-nav a { font-size: 13.5px; }
}

/* ==========================================================================
   Print
   ========================================================================== */

@media print {
  body { background: #fff; color: #111; font-size: 11.5pt; }
  .masthead { padding: 0 0 12pt; background: none; border-bottom: 1px solid #ccc; }
  .masthead::before, .masthead::after { display: none; }
  article a { color: #111; text-decoration: underline; }
  figure, pre, .table-scroll { break-inside: avoid; }
  footer, .next-up { display: none; }
}