/* hidden must win over component display rules */
[hidden]{display:none!important}

/* ============================================================
   ian — stylesheet
   Light = warm paper. Dark = deep ink with a dawn-lit hero.
   ============================================================ */

/* ---------------------------------------------------- tokens */
:root {
  /* surface */
  --bg:        #f6f3ec;
  --bg-tint-a: rgba(168, 67, 26, .055);
  --bg-tint-b: rgba(31, 101, 132, .05);
  --card:      #fffdf8;
  --card-2:    #fbf8f1;
  --ink:       #16140e;
  --muted:     #6d675b;
  --faint:     #978f80;
  --hairline:  rgba(22, 20, 14, .11);
  --hairline-2:rgba(22, 20, 14, .06);
  --accent:    #a8431a;
  --accent-soft: rgba(168, 67, 26, .12);

  /* categories */
  --c-current:  #1f6584;
  --c-code:   #6244ad;
  --c-markets: #1d7554;
  --c-misc: #9b4f67;

  /* elevation */
  --shadow-1: 0 1px 1px rgba(32, 26, 16, .04),
              0 2px 6px -2px rgba(32, 26, 16, .06);
  --shadow-2: 0 1px 1px rgba(32, 26, 16, .05),
              0 10px 22px -12px rgba(32, 26, 16, .18),
              0 32px 60px -40px rgba(32, 26, 16, .35);

  /* hero */
  --sky-0: #a3c2db;
  --sky-1: #ccd4d8;
  --sky-2: #f0dcbc;
  --sky-3: #fbe8c6;
  --glow-in:  rgba(255, 241, 203, .95);
  --glow-mid: rgba(255, 205, 140, .45);
  --glow-out: rgba(255, 216, 158, 0);
  --wafer-face: #9cb4c6;
  --wafer-die:  #7c97ac;
  --wafer-grid: rgba(26, 38, 46, .19);
  --wafer-edge: rgba(32, 46, 56, .55);
  --wafer-rim:  rgba(255, 246, 225, .75);
  --ridge-1: #bcc8ca;
  --ridge-2: #94a4a6;
  --ridge-3: #5f7275;
  --ridge-4: #2c3a3d;
  --haze:    rgba(248, 234, 210, .3);
  --trace:   rgba(255, 214, 150, .62);
  --via:     rgba(255, 224, 168, .95);
  --star:    rgba(226, 232, 240, 0);
  --scrim-1: rgba(10, 14, 14, 0);
  --scrim-2: rgba(10, 14, 14, .30);
  --scrim-3: rgba(10, 14, 14, .66);

  --ray:     rgba(255, 245, 219, .4);
  --wash-in: rgba(255, 246, 219, .42);
  --wash-out:rgba(255, 212, 148, .1);
  --rim-in:  rgba(255, 250, 232, .95);
  --rim-mid: rgba(255, 240, 210, .4);

  --grain: .045;

  --ease:   cubic-bezier(.22, .78, .28, 1);

  --measure: 42rem;
  --gutter: clamp(1.15rem, 5vw, 2.25rem);
}

/* ---------------------------------------------------- dark palette */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg:        #0b0b0c;
    --bg-tint-a: rgba(233, 163, 107, .07);
    --bg-tint-b: rgba(108, 178, 212, .055);
    --card:      #131316;
    --card-2:    #17171b;
    --ink:       #ece7db;
    --muted:     #918b7e;
    --faint:     #6c675d;
    --hairline:  rgba(236, 231, 219, .12);
    --hairline-2:rgba(236, 231, 219, .06);
    --accent:    #e9a36b;
    --accent-soft: rgba(233, 163, 107, .14);

    --c-current:  #74bada;
    --c-code:   #ab92e8;
    --c-markets: #68cb9c;
    --c-misc: #e0a0b5;

    --shadow-1: 0 1px 1px rgba(0, 0, 0, .5),
                0 2px 8px -2px rgba(0, 0, 0, .6);
    --shadow-2: 0 1px 1px rgba(0, 0, 0, .55),
                0 12px 26px -14px rgba(0, 0, 0, .8),
                0 40px 70px -44px rgba(0, 0, 0, 1);

    --sky-0: #05080f;
    --sky-1: #0f1520;
    --sky-2: #241f26;
    --sky-3: #46301e;
    --glow-in:  rgba(255, 184, 108, .62);
    --glow-mid: rgba(236, 130, 70, .26);
    --glow-out: rgba(233, 140, 80, 0);
    --wafer-face: #2d3d47;
    --wafer-die:  #48616f;
    --wafer-grid: rgba(178, 208, 226, .2);
    --wafer-edge: rgba(150, 186, 204, .45);
    --wafer-rim:  rgba(255, 206, 150, .7);
    --ridge-1: #26333b;
    --ridge-2: #19242b;
    --ridge-3: #0e161b;
    --ridge-4: #05090c;
    --haze:    rgba(233, 140, 80, .1);
    --trace:   rgba(233, 163, 107, .45);
    --via:     rgba(255, 196, 132, .9);
    --star:    rgba(226, 232, 240, .85);
    --scrim-1: rgba(6, 7, 9, 0);
    --scrim-2: rgba(6, 7, 9, .35);
    --scrim-3: rgba(6, 7, 9, .78);

    --ray:     rgba(255, 190, 120, .22);
  --wash-in: rgba(255, 198, 130, .46);
  --wash-out:rgba(236, 130, 70, .08);
    --wash-in: rgba(255, 198, 130, .46);
    --wash-out:rgba(236, 130, 70, .08);
    --rim-in:  rgba(255, 206, 150, .85);
    --rim-mid: rgba(255, 190, 130, .3);

    --ray:     rgba(255, 190, 120, .22);
  --rim-in:  rgba(255, 206, 150, .85);
  --rim-mid: rgba(255, 190, 130, .3);

  --grain: .06;
  }
}

/* same palette, forced by the toggle */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg:        #0b0b0c;
  --bg-tint-a: rgba(233, 163, 107, .07);
  --bg-tint-b: rgba(108, 178, 212, .055);
  --card:      #131316;
  --card-2:    #17171b;
  --ink:       #ece7db;
  --muted:     #918b7e;
  --faint:     #6c675d;
  --hairline:  rgba(236, 231, 219, .12);
  --hairline-2:rgba(236, 231, 219, .06);
  --accent:    #e9a36b;
  --accent-soft: rgba(233, 163, 107, .14);

  --c-current:  #74bada;
  --c-code:   #ab92e8;
  --c-markets: #68cb9c;
  --c-misc: #e0a0b5;

  --shadow-1: 0 1px 1px rgba(0, 0, 0, .5),
              0 2px 8px -2px rgba(0, 0, 0, .6);
  --shadow-2: 0 1px 1px rgba(0, 0, 0, .55),
              0 12px 26px -14px rgba(0, 0, 0, .8),
              0 40px 70px -44px rgba(0, 0, 0, 1);

  --sky-0: #05080f;
  --sky-1: #0f1520;
  --sky-2: #241f26;
  --sky-3: #46301e;
  --glow-in:  rgba(255, 184, 108, .62);
  --glow-mid: rgba(236, 130, 70, .26);
  --glow-out: rgba(233, 140, 80, 0);
  --wafer-face: #2d3d47;
  --wafer-die:  #48616f;
  --wafer-grid: rgba(178, 208, 226, .2);
  --wafer-edge: rgba(150, 186, 204, .45);
  --wafer-rim:  rgba(255, 206, 150, .7);
  --ridge-1: #26333b;
  --ridge-2: #19242b;
  --ridge-3: #0e161b;
  --ridge-4: #05090c;
  --haze:    rgba(233, 140, 80, .1);
  --trace:   rgba(233, 163, 107, .45);
  --via:     rgba(255, 196, 132, .9);
  --star:    rgba(226, 232, 240, .85);
  --scrim-1: rgba(6, 7, 9, 0);
  --scrim-2: rgba(6, 7, 9, .35);
  --scrim-3: rgba(6, 7, 9, .78);

  --grain: .06;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    radial-gradient(70rem 40rem at 82% -8%, var(--bg-tint-a), transparent 70%),
    radial-gradient(56rem 36rem at 4% 28%,  var(--bg-tint-b), transparent 70%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--ink);
  font-family: "Newsreader", ui-serif, Georgia, "Iowan Old Style", serif;
  font-optical-sizing: auto;
  font-size: clamp(1.02rem, .97rem + .25vw, 1.14rem);
  font-weight: 380;
  line-height: 1.68;
  letter-spacing: .002em;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}

/* film grain — what keeps flat colour from looking flat */
body::after {
  content: "";
  position: fixed;
  inset: -50%;
  z-index: 999;
  pointer-events: none;
  opacity: var(--grain);
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
}

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--gutter) 7rem;
}

a {
  color: var(--accent);
  text-decoration-color: color-mix(in srgb, var(--accent) 38%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
  transition: text-decoration-color .18s var(--ease), color .18s var(--ease);
}
a:hover { text-decoration-color: var(--accent); }

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

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* one family for every small letterspaced label */
.cat, .chip, .entry-meta, .icon-btn, .mark,
.tagline, .section-rule, footer, figcaption, h2 {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---------------------------------------------------- top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0 calc(var(--gutter) * -1);
  padding: .85rem var(--gutter);
  border-bottom: 1px solid transparent;
  transition: background .3s var(--ease), border-color .3s var(--ease),
              box-shadow .3s var(--ease);
}
.topbar.is-stuck {
  background: color-mix(in srgb, var(--bg) 76%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom-color: var(--hairline-2);
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  color: var(--ink);
  font-size: .7rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  text-decoration: none;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.mark::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 2px;
  background: linear-gradient(135deg, var(--accent), var(--c-current));
  transform: rotate(45deg);
}
.topbar.is-stuck .mark,
.topbar.always-mark .mark { opacity: 1; transform: none; pointer-events: auto; }

.icon-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  margin-left: auto;
  padding: .42rem .8rem;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: color-mix(in srgb, var(--card) 60%, transparent);
  color: var(--muted);
  font-size: .66rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .18s var(--ease), border-color .18s var(--ease),
              background .18s var(--ease), transform .18s var(--ease);
}
.icon-btn:hover {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--muted) 55%, transparent);
  transform: translateY(-1px);
}

.theme-icon {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: inset -4px -2px 0 0 var(--bg);
  transition: box-shadow .3s var(--ease), background .3s var(--ease);
}
:root[data-theme="light"] .theme-icon { background: var(--accent); box-shadow: inset 0 0 0 0 var(--bg); }
:root[data-theme="dark"]  .theme-icon { box-shadow: inset -5px -1px 0 0 var(--bg); }

/* ---------------------------------------------------- hero */
.hero {
  position: relative;
  margin: .75rem 0 clamp(2.6rem, 6vw, 4.5rem);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-2);
  isolation: isolate;
}
.hero::after {                 /* inner hairline keeps the edge crisp */
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
  pointer-events: none;
}
.hero svg { display: block; width: 100%; height: auto; }

.sky-0 { stop-color: var(--sky-0); }
.sky-1 { stop-color: var(--sky-1); }
.sky-2 { stop-color: var(--sky-2); }
.sky-3 { stop-color: var(--sky-3); }
.glow-in  { stop-color: var(--glow-in); }
.glow-mid { stop-color: var(--glow-mid); }
.glow-out { stop-color: var(--glow-out); }
.haze-in  { stop-color: var(--haze); }
.haze-out { stop-color: transparent; }

.wafer-face { fill: var(--wafer-face); }
.wafer-die  { fill: var(--wafer-die); }
.wafer-grid { stroke: var(--wafer-grid); stroke-width: .55; }
.wafer-edge { fill: none; stroke: var(--wafer-edge); stroke-width: 1.1; }
.wafer-rim  { fill: none; stroke: var(--wafer-rim); stroke-width: 1.6; opacity: .7; }
.wafer-notch{ fill: none; stroke: var(--wafer-edge); stroke-width: 2; stroke-linecap: round; }

.ridge-1 { fill: var(--ridge-1); }
.ridge-2 { fill: var(--ridge-2); }
.ridge-3 { fill: var(--ridge-3); }
.ridge-4 { fill: var(--ridge-4); }
.haze    { fill: url(#haze); }
.rays    { fill: var(--ray); }
.wash-in { stop-color: var(--wash-in); }
.wash-out{ stop-color: var(--wash-out); }
.horizon-glow { opacity: .85; }
.rim-in  { stop-color: var(--rim-in); }
.rim-mid { stop-color: var(--rim-mid); }
.rim-out { stop-color: transparent; }
.crest {
  fill: none;
  stroke: url(#rim);
  stroke-width: 1.3;
}

.trace { stroke: var(--trace); stroke-width: 1.6; stroke-linecap: round; }
.via circle   { fill: var(--via); }
.stars circle { fill: var(--star); }

.halo         { animation: breathe 11s ease-in-out infinite; transform-origin: 612px 104px; }
.via circle   { animation: pulse 4.6s ease-in-out infinite var(--d, 0s); }
.stars circle { animation: twinkle 5.5s ease-in-out infinite var(--d, 0s); }
.spark        { animation: spark 7s ease-in-out infinite var(--d, 0s); }

@keyframes breathe { 0%, 100% { opacity: .8;  transform: scale(1); }
                     50%      { opacity: 1;   transform: scale(1.06); } }
@keyframes pulse   { 0%, 100% { opacity: .35; r: 2.6; }
                     50%      { opacity: 1;   r: 4; } }
@keyframes twinkle { 0%, 100% { opacity: .3; }
                     50%      { opacity: 1; } }
@keyframes spark   { 0%, 100% { opacity: 0; }
                     45%      { opacity: .9; }
                     55%      { opacity: .9; } }

.hero-scrim {
  position: absolute; inset: auto 0 0 0; height: 64%;
  background: linear-gradient(to top, var(--scrim-3) 0%, var(--scrim-2) 46%, var(--scrim-1) 100%);
  pointer-events: none;
}
.hero-vignette {
  position: absolute; inset: 0;
  background: radial-gradient(118% 100% at 50% 38%, transparent 56%, rgba(0, 0, 0, .3) 100%);
  pointer-events: none;
}

.hero-text {
  position: absolute; z-index: 2;
  left: clamp(1.25rem, 4.5%, 2.6rem);
  right: clamp(1.25rem, 4.5%, 2.6rem);
  bottom: clamp(1.1rem, 5%, 2rem);
  color: #f8f4ea;
}
.hero-text h1 {
  margin: 0 0 .5rem;
  color: inherit;
  font-family: "Fraunces", ui-serif, Georgia, serif;
  font-size: clamp(3.1rem, 13vw, 6.2rem);
  font-weight: 600;
  font-variation-settings: "SOFT" 10, "WONK" 1, "opsz" 144;
  line-height: .88;
  letter-spacing: -.034em;
  text-shadow: 0 2px 28px rgba(0, 0, 0, .45);
}
.tagline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem .75rem;
  margin: 0;
  color: rgba(248, 244, 234, .82);
  font-size: clamp(.6rem, 1.6vw, .72rem);
  letter-spacing: .24em;
  text-transform: uppercase;
  text-shadow: 0 1px 10px rgba(0, 0, 0, .5);
}
.tagline span { position: relative; white-space: nowrap; }
/* separator trails its item, so a wrapped line never opens with a stray dot */
.tagline span:not(:last-child)::after {
  content: "";
  position: absolute; right: -.5rem; top: 50%;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: currentColor;
  opacity: .5;
  transform: translateY(-50%);
}

/* ---------------------------------------------------- prose */
.intro { max-width: 34rem; }
.intro p { margin: 0 0 1.25em; }
.intro p:last-child { margin-bottom: 0; }

.intro > p:first-of-type { font-size: 1.1em; line-height: 1.6; }
.intro > p:first-of-type::first-letter {
  float: left;
  margin: .1em .14em 0 0;
  font-family: "Fraunces", ui-serif, Georgia, serif;
  font-size: 3.1em;
  font-weight: 500;
  font-variation-settings: "SOFT" 30, "WONK" 1, "opsz" 144;
  line-height: .82;
  color: var(--accent);
}

h2 {
  margin: 0 0 1.5rem;
  color: var(--faint);
  font-size: .7rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .22em;
  text-transform: uppercase;
}

/* labelled rule between major blocks */
.section-rule {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: clamp(3rem, 8vw, 4.5rem) 0 1.5rem;
  color: var(--faint);
  font-size: .64rem;
  letter-spacing: .22em;
  text-transform: uppercase;
}
.section-rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--hairline), transparent);
}

/* ---------------------------------------------------- filters */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: 2.4rem 0 1.75rem;
}
.chip {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .42rem .8rem;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: color-mix(in srgb, var(--card) 55%, transparent);
  color: var(--muted);
  font-size: .68rem;
  font-weight: 450;
  line-height: 1;
  letter-spacing: .06em;
  cursor: pointer;
  transition: background .18s var(--ease), color .18s var(--ease),
              border-color .18s var(--ease), transform .18s var(--ease),
              box-shadow .18s var(--ease);
}
.chip:hover:not(:disabled) {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--muted) 45%, transparent);
  transform: translateY(-1px);
}
.chip:disabled { opacity: .4; cursor: default; }
.chip.is-active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
  box-shadow: var(--shadow-1);
}
.chip.is-active .dot { box-shadow: 0 0 0 2px color-mix(in srgb, var(--bg) 30%, transparent); }
.chip .count {
  font-size: .9em;
  font-variant-numeric: tabular-nums;
  opacity: .45;
}

.dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex: none;
  background: currentColor;
}
.d-current  { background: var(--c-current); }
.d-code   { background: var(--c-code); }
.d-markets { background: var(--c-markets); }
.d-misc   { background: var(--c-misc); }

/* ---------------------------------------------------- feed */
.entries {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--hairline-2);
}
.entry-item {
  border-bottom: 1px solid var(--hairline-2);
}

.entry {
  --tint: var(--accent);
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 0 1rem;
  padding: 1.35rem 1.15rem 1.4rem;
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
  transition: background .22s var(--ease), transform .22s var(--ease),
              box-shadow .22s var(--ease);
}
.entry-item[data-cat="current"] .entry { --tint: var(--c-current); }
.entry-item[data-cat="code"]   .entry { --tint: var(--c-code); }
.entry-item[data-cat="markets"] .entry { --tint: var(--c-markets); }
.entry-item[data-cat="misc"] .entry { --tint: var(--c-misc); }

/* accent rail: a hint at rest, nearly full height on hover */
.entry::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  width: 2px; height: 14%;
  border-radius: 2px;
  background: var(--tint);
  opacity: .3;
  transform: translateY(-50%);
  transition: height .26s var(--ease), opacity .26s var(--ease), width .26s var(--ease);
}
/* soft colour wash from the left on hover */
.entry::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background: linear-gradient(100deg,
              color-mix(in srgb, var(--tint) 11%, transparent),
              transparent 52%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s var(--ease);
}

.entry:hover, .entry:focus-visible {
  background: var(--card);
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
  text-decoration: none;
}
.entry:hover::before, .entry:focus-visible::before { height: 66%; width: 3px; opacity: 1; }
.entry:hover::after,  .entry:focus-visible::after  { opacity: 1; }

/* every text child sits in column 1; the arrow takes column 2 */
.entry > span { position: relative; grid-column: 1; }

.cat {
  display: inline-flex; align-items: center; gap: .45rem;
  margin-bottom: .45rem;
  font-size: .62rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.c-current  { color: var(--c-current); }
.c-code   { color: var(--c-code); }
.c-markets { color: var(--c-markets); }
.c-misc   { color: var(--c-misc); }

.entry-title {
  display: block;
  margin-bottom: .32rem;
  font-family: "Fraunces", ui-serif, Georgia, serif;
  font-size: clamp(1.22rem, 1.1rem + .6vw, 1.5rem);
  font-weight: 480;
  font-variation-settings: "SOFT" 20, "WONK" 0, "opsz" 36;
  line-height: 1.2;
  letter-spacing: -.012em;
  text-wrap: balance;
}
.entry-meta {
  display: block;
  color: var(--faint);
  font-size: .66rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.entry-note {
  display: block;
  max-width: 34rem;
  margin-top: .55rem;
  color: var(--muted);
  font-size: .95em;
  line-height: 1.58;
}

.entry > .entry-arrow {   /* beats `.entry > span { grid-column: 1 }` */
  grid-column: 2;
  grid-row: 1 / -1;        /* every row, however many the summary has */
  align-self: center;
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--tint) 13%, transparent);
  color: var(--tint);
  font-size: .85rem;
  opacity: 0;
  transform: translateX(-6px) scale(.9);
  transition: opacity .2s var(--ease), transform .25s var(--ease);
}
.entry:hover .entry-arrow,
.entry:focus-visible .entry-arrow { opacity: 1; transform: none; }

/* ---------------------------------------------------- inline bodies
   Every entry opens in place — one page, nothing to navigate to. */
.entry-card { border-radius: 12px; }

summary.entry { cursor: pointer; list-style: none; }
summary.entry::-webkit-details-marker { display: none; }
summary.entry:focus-visible {
  outline: 2px solid var(--tint);
  outline-offset: -2px;
}

.entry-card[open] {
  background: var(--card);
  box-shadow: var(--shadow-1);
}
.entry-card[open] > .entry { background: none; transform: none; box-shadow: none; }
.entry-card[open] > .entry::before { height: 66%; width: 3px; opacity: 1; }
.entry-card[open] > .entry::after { opacity: 1; }
.entry-card[open] > .entry:hover { transform: none; box-shadow: none; }
.entry-card[open] .entry-arrow { opacity: 1; transform: rotate(90deg); }

.entry-body {
  max-width: 36rem;
  padding: 0 1.15rem 1.7rem;
  color: var(--muted);
  animation: bodyIn .24s var(--ease) both;
}
@keyframes bodyIn {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: none; }
}
.entry-body > :first-child { margin-top: 0; }
.entry-body > :last-child  { margin-bottom: 0; }
.entry-body p { margin: 0 0 1rem; font-size: .97rem; line-height: 1.68; }
.entry-body a { color: var(--accent); }

.entry-body pre {
  margin: 1.1rem 0;
  padding: .9rem 1rem;
  overflow-x: auto;
  background: var(--card-2);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  font-size: .82rem;
  line-height: 1.55;
}
.entry-body pre code { padding: 0; background: none; }

.repo-link { font-size: .8rem; letter-spacing: .04em; }

table.mini {
  width: 100%;
  margin: 1.1rem 0;
  border-collapse: collapse;
  font-size: .88rem;
}
table.mini th,
table.mini td {
  padding: .5rem .65rem;
  text-align: left;
  border-bottom: 1px solid var(--hairline-2);
}
table.mini th {
  color: var(--faint);
  font-size: .64rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
}
table.mini td { color: var(--ink); }
table.mini td:not(:first-child) { font-variant-numeric: tabular-nums; }

/* when the piece was written, sat just above the disclaimer */
.dateline {
  margin: 2.2rem 0 0 !important;
  padding-top: 1.1rem;
  border-top: 1px solid var(--hairline-2);
  color: var(--faint);
  font-size: .68rem !important;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.dateline + .disclaimer { margin-top: .7rem; }

.disclaimer {
  margin-top: 1.1rem;
  color: var(--faint);
  font-size: .8rem !important;
  font-style: italic;
}

.empty {
  margin: 1.6rem 0 0 1.15rem;
  color: var(--faint);
  font-style: italic;
}

/* a few details the inline-body section doesn't cover */
summary.entry::marker { content: ""; }          /* Firefox */
summary.entry { -webkit-tap-highlight-color: transparent; }

/* caret is a visible affordance here, not just a hover flourish */
.entry-card > .entry > .entry-arrow { opacity: .4; transform: none; }
.entry-card > .entry:hover > .entry-arrow { opacity: 1; }
.entry-card[open] > .entry > .entry-arrow { opacity: 1; transform: rotate(90deg); }

/* hairline between the row and its body once open */
.entry-card[open] > .entry {
  border-bottom: 1px solid var(--hairline-2);
  border-end-start-radius: 0;
  border-end-end-radius: 0;
}
.entry-card[open] .entry-body { padding-top: 1.25rem; }

/* inline code inside a body */
.entry-body :not(pre) > code {
  padding: .12em .38em;
  border: 1px solid var(--hairline-2);
  border-radius: 5px;
  background: var(--card-2);
  font-size: .86em;
}

/* ---------------------------------------------------- post pages */
.embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 2rem 0;
  background: var(--card-2);
  border: 1px solid var(--hairline-2);
  border-radius: 12px;
  overflow: hidden;
}
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

figure { margin: 2rem 0; }
figure img {
  display: block;
  width: 100%; height: auto;
  border-radius: 12px;
  box-shadow: var(--shadow-1);
}
figcaption {
  margin-top: .7rem;
  color: var(--faint);
  font-size: .72rem;
  line-height: 1.6;
  letter-spacing: .04em;
}

.post-header {
  margin: clamp(2rem, 7vw, 3.4rem) 0 clamp(1.8rem, 5vw, 2.6rem);
  padding-bottom: 1.6rem;
  border-bottom: 1px solid var(--hairline-2);
}
.post-header .cat { margin-bottom: .85rem; }
.post-header h1 {
  margin: 0 0 .6rem;
  font-family: "Fraunces", ui-serif, Georgia, serif;
  font-size: clamp(2.1rem, 1.5rem + 3vw, 3.2rem);
  font-weight: 500;
  font-variation-settings: "SOFT" 20, "WONK" 1, "opsz" 72;
  line-height: 1.06;
  letter-spacing: -.022em;
  text-wrap: balance;
}
.post-header .tagline {
  color: var(--faint);
  text-shadow: none;
  letter-spacing: .16em;
}

.progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px; width: 0;
  background: linear-gradient(to right, var(--accent), var(--c-current));
  z-index: 1000;
  transition: width .08s linear;
}

/* ---------------------------------------------------- footer */
footer {
  margin-top: clamp(3.5rem, 9vw, 5.5rem);
  padding-top: 1.6rem;
  border-top: 1px solid var(--hairline-2);
  color: var(--faint);
  font-size: .72rem;
  line-height: 1.8;
  letter-spacing: .04em;
}
footer p { margin: 0 0 .35rem; }
footer p:last-child { margin-bottom: 0; }
footer a { color: var(--muted); }
footer a:hover { color: var(--accent); }

/* ---------------------------------------------------- motion */
.reveal { opacity: 0; transform: translateY(16px); }
.reveal.in {
  opacity: 1;
  transform: none;
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}

@keyframes filterIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.filter-in { animation: filterIn .34s var(--ease) both; }

/* ---------------------------------------------------- narrow */
@media (max-width: 560px) {
  .hero { border-radius: 14px; }
  .hero-scrim { height: 78%; }
  .tagline { gap: .35rem .65rem; letter-spacing: .12em; }
  .entry { padding: 1.15rem .95rem 1.2rem; }
  .entry-body { padding: 0 .95rem 1.35rem; }
  .entry-arrow { display: none; }
  .intro > p:first-of-type::first-letter { font-size: 2.8em; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ====================================================================
   INTERACTIVE LAYER
   ==================================================================== */

/* JS drives the disclosure height, so drop the CSS entry animation */
.js .entry-body { animation: none; }

/* ---------------------------------------------------- search trigger */
.search-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  margin-left: auto;
  padding: .42rem .6rem .42rem .7rem;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: color-mix(in srgb, var(--card) 60%, transparent);
  color: var(--muted);
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  font-size: .66rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .18s var(--ease), border-color .18s var(--ease),
              transform .18s var(--ease);
}
.search-btn:hover {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--muted) 55%, transparent);
  transform: translateY(-1px);
}
/* the toggle keeps its own spacing once search sits next to it */
.search-btn + .icon-btn { margin-left: .45rem; }

.search-ico {
  width: 13px; height: 13px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round;
}
.search-kbd {
  padding: .12em .4em;
  border: 1px solid var(--hairline);
  border-radius: 4px;
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  font: inherit;
  font-size: .9em;
  opacity: .8;
}
@media (max-width: 560px) {
  .search-label, .search-kbd { display: none; }
  .search-btn { padding: .42rem .55rem; }
}

/* ---------------------------------------------------- command palette */
.palette {
  width: min(34rem, calc(100vw - 2rem));
  max-height: min(30rem, calc(100vh - 8rem));
  margin: 0 auto;
  margin-top: clamp(3rem, 12vh, 8rem);
  padding: 0;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow-2);
  overflow: hidden;
}
.palette::backdrop {
  background: color-mix(in srgb, #0a0a0b 55%, transparent);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.palette[open] { display: flex; flex-direction: column; }
@media (prefers-reduced-motion: no-preference) {
  .palette[open] { animation: paletteIn .18s var(--ease) both; }
  .palette[open]::backdrop { animation: fadeIn .18s var(--ease) both; }
}
@keyframes paletteIn {
  from { opacity: 0; transform: translateY(-8px) scale(.985); }
  to   { opacity: 1; transform: none; }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.palette-head {
  display: flex; align-items: center; gap: .65rem;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--hairline-2);
}
.palette-head .search-ico { width: 15px; height: 15px; color: var(--faint); }
.palette-head input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-family: "Newsreader", ui-serif, Georgia, serif;
  font-size: 1.05rem;
}
.palette-head input::placeholder { color: var(--faint); }
.palette-head input:focus { outline: none; }
.palette-head kbd, .palette-foot kbd {
  padding: .15em .4em;
  border: 1px solid var(--hairline);
  border-radius: 4px;
  background: color-mix(in srgb, var(--ink) 5%, transparent);
  color: var(--faint);
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  font-size: .6rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.palette-results {
  flex: 1;
  margin: 0;
  padding: .4rem;
  list-style: none;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.palette-hit {
  --tint: var(--accent);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: .1rem .7rem;
  padding: .6rem .7rem;
  border-radius: 9px;
  cursor: pointer;
}
.palette-hit[data-cat="current"] { --tint: var(--c-current); }
.palette-hit[data-cat="markets"] { --tint: var(--c-markets); }
.palette-hit[data-cat="code"]    { --tint: var(--c-code); }
.palette-hit[data-cat="misc"]    { --tint: var(--c-misc); }
.palette-hit .dot { align-self: center; background: var(--tint); }
.palette-hit.is-active {
  background: color-mix(in srgb, var(--tint) 12%, transparent);
  box-shadow: inset 2px 0 0 var(--tint);
}
.hit-main { min-width: 0; }
.hit-title {
  display: block;
  font-family: "Fraunces", ui-serif, Georgia, serif;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.3;
}
.hit-note {
  display: block;
  margin-top: .1rem;
  color: var(--muted);
  font-size: .85rem;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hit-meta {
  align-self: center;
  color: var(--faint);
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  font-size: .6rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.palette mark {
  padding: 0 .1em;
  border-radius: 3px;
  background: color-mix(in srgb, var(--tint, var(--accent)) 26%, transparent);
  color: inherit;
}
.palette-empty {
  padding: 1.5rem 1rem;
  color: var(--faint);
  font-style: italic;
  text-align: center;
}

.palette-foot {
  display: flex; align-items: center; gap: 1rem;
  padding: .55rem 1rem;
  border-top: 1px solid var(--hairline-2);
  background: var(--card-2);
  color: var(--faint);
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  font-size: .6rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.palette-foot span { display: inline-flex; align-items: center; gap: .3rem; }
.palette-count { margin-left: auto; }
@media (max-width: 480px) {
  .palette-foot span:not(.palette-count) { display: none; }
  .palette-count { margin-left: 0; }
}

/* the row you jumped to, briefly lit */
.entry-item.is-target .entry { background: var(--card); }
@media (prefers-reduced-motion: no-preference) {
  .entry-item.is-target { animation: landed 1.5s var(--ease); }
}
@keyframes landed {
  0%, 18% { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent); }
  100%    { box-shadow: inset 0 0 0 2px transparent; }
}

/* ---------------------------------------------------- sortable tables */
.th-sort {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
  transition: color .16s var(--ease);
}
.th-sort:hover { color: var(--ink); }
.sort-ind {
  width: 0; height: 0;
  border-left: 3.5px solid transparent;
  border-right: 3.5px solid transparent;
  border-bottom: 5px solid currentColor;
  opacity: .25;
  transition: opacity .16s var(--ease), transform .16s var(--ease);
}
.th-sort:hover .sort-ind { opacity: .6; }
th[aria-sort="ascending"]  .sort-ind { opacity: 1; }
th[aria-sort="descending"] .sort-ind { opacity: 1; transform: rotate(180deg); }
th[aria-sort="ascending"]  .th-sort,
th[aria-sort="descending"] .th-sort { color: var(--ink); }
.mini.did-sort tbody tr { transition: background .2s var(--ease); }

/* ---------------------------------------------------- inline charts */
.chart {
  position: relative;
  --tint: var(--accent);
  margin: 1.4rem 0;
  padding: 1.9rem 0 0;          /* reserved lane for the hover readout */
  border-radius: 8px;
}
.entry-item[data-cat="current"] .chart { --tint: var(--c-current); }
.entry-item[data-cat="markets"] .chart { --tint: var(--c-markets); }
.entry-item[data-cat="code"]    .chart { --tint: var(--c-code); }
.entry-item[data-cat="misc"]    .chart { --tint: var(--c-misc); }
.chart:focus-visible { outline: 2px solid var(--tint); outline-offset: 4px; }

.chart-svg {
  display: block;
  width: 100%;
  height: 96px;
  overflow: visible;
}
.ch-area { fill: color-mix(in srgb, var(--tint) 14%, transparent); stroke: none; }
.ch-line {
  fill: none;
  stroke: var(--tint);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.ch-dot {
  fill: var(--card);
  stroke: var(--tint);
  stroke-width: 1.6;
  vector-effect: non-scaling-stroke;
  transition: r .14s var(--ease);
}
.ch-dot.is-on { fill: var(--tint); r: 4; }
.ch-bar {
  fill: color-mix(in srgb, var(--tint) 55%, transparent);
  transition: fill .14s var(--ease);
}
.ch-bar.is-on { fill: var(--tint); }
.ch-cursor {
  stroke: var(--tint);
  stroke-width: 1;
  stroke-dasharray: 2 3;
  opacity: 0;
  vector-effect: non-scaling-stroke;
  transition: opacity .14s var(--ease);
}
.chart.is-reading .ch-cursor { opacity: .45; }

.chart-readout {
  position: absolute;
  top: .1rem;
  transform: translateX(-50%);
  display: flex; align-items: baseline; gap: .4rem;
  padding: .25rem .5rem;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  background: var(--card);
  box-shadow: var(--shadow-1);
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  font-size: .66rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .14s var(--ease);
}
.chart.is-reading .chart-readout { opacity: 1; }
.chart-readout b { color: var(--ink); font-weight: 600; }
.chart-readout span { color: var(--faint); letter-spacing: .08em; text-transform: uppercase; }

.chart-cap {
  margin: .55rem 0 0 !important;
  color: var(--faint);
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  font-size: .62rem !important;
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* ---------------------------------------------------- code blocks */
.code-block {
  margin: 1.35rem 0;
  border: 1px solid var(--hairline-2);
  border-radius: 10px;
  overflow: hidden;
  background: var(--card-2);
}
.code-block pre {
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: none !important;
}
.code-bar {
  display: flex; align-items: center;
  padding: .4rem .5rem .4rem .9rem;
  border-bottom: 1px solid var(--hairline-2);
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}
.code-lang {
  color: var(--faint);
  font-size: .6rem;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.code-copy {
  margin-left: auto;
  padding: .28rem .6rem;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: .6rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .16s var(--ease), border-color .16s var(--ease),
              background .16s var(--ease);
}
.code-copy:hover { color: var(--ink); border-color: var(--muted); }
.code-copy.is-ok  { color: var(--c-markets); border-color: currentColor; }
.code-copy.is-bad { color: var(--accent); border-color: currentColor; }

/* syntax tokens */
.t-c { color: var(--faint); font-style: italic; }
.t-s { color: var(--c-markets); }
.t-n { color: var(--c-code); }
.t-k { color: var(--accent); font-weight: 500; }

/* ---------------------------------------------------- scroll-linked hero
   app.js publishes --t (0 at the top, 1 once the hero has scrolled by). */
.hero-text {
  transform: translateY(calc(var(--t, 0) * -22px));
  opacity: calc(1 - var(--t, 0) * 0.85);
  will-change: transform, opacity;
}

/* ---------------------------------------------------- view transitions */
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root),
  ::view-transition-new(root) { animation-duration: .28s; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-text { transform: none; opacity: 1; }
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) { animation: none !important; }
}

@media print {
  body::after, .topbar, .filters, .hero-scrim, .hero-vignette { display: none; }
  body { background: #fff; color: #000; }
  .hero { box-shadow: none; }
}


/* ---------------------------------------------------- empty state
   Shown only while nothing is published; app.js hides it on the
   first real entry and brings the filter chips back. */
.coming { margin-top: .5rem; }

.coming-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.5rem;
}
.coming-list li {
  display: grid;
  gap: .3rem;
  padding-left: 1rem;
  border-left: 2px solid var(--rule);
}
.coming-list p { margin: 0; color: var(--muted); }

.coming-note {
  margin: 2.2rem 0 0;
  padding-top: 1.3rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-style: italic;
}

/* ---------------------------------------------------- long-form bodies
   A piece with sections needs more room and real headings; short entries
   keep the tighter 36rem measure. */
.entry-body.is-long { max-width: 42rem; }

.entry-body h3 {
  margin: 2.1rem 0 .75rem;
  font-family: "Fraunces", ui-serif, Georgia, serif;
  font-size: 1.12rem;
  font-weight: 500;
  font-variation-settings: "SOFT" 20, "WONK" 0, "opsz" 24;
  letter-spacing: -.005em;
  color: var(--ink);
}
.entry-body h3::before {
  content: "";
  display: block;
  width: 26px;
  margin-bottom: .55rem;
  border-top: 2px solid var(--tint, var(--accent));
  opacity: .55;
}
.entry-body > h3:first-child { margin-top: 0; }
.entry-body p.lede {
  font-size: 1.04rem;
  line-height: 1.62;
  color: var(--ink);
}
.entry-body strong { color: var(--ink); font-weight: 600; }
.entry-body em { color: var(--ink); }

/* ---------------------------------------------------- co-packaged optics diagram
   Schematic of a CPO switch package. Clicking a block writes its entry from
   <dl class="cpo-key"> into the panel; the flow buttons walk a dot along the
   two invisible rails (#cpo-tx / #cpo-rx). Behaviour is in app.js. */
.cpo {
  --cpo-el:       var(--accent);
  --cpo-el-soft:  var(--accent-soft);
  --cpo-opt:      var(--c-current);
  --cpo-opt-soft: rgba(31, 101, 132, .13);
  --cpo-cw:       #ad7a1a;
  --cpo-cw-soft:  rgba(173, 122, 26, .14);
  margin: 2.2rem 0;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cpo {
    --cpo-opt-soft: rgba(116, 186, 218, .14);
    --cpo-cw:       #e0b259;
    --cpo-cw-soft:  rgba(224, 178, 89, .15);
  }
}
:root[data-theme="dark"] .cpo {
  --cpo-opt-soft: rgba(116, 186, 218, .14);
  --cpo-cw:       #e0b259;
  --cpo-cw-soft:  rgba(224, 178, 89, .15);
}

.cpo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem 1rem;
  flex-wrap: wrap;
  margin-bottom: .7rem;
}
.cpo .cpo-eyebrow {
  margin: 0;
  color: var(--faint);
  font-size: .64rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.cpo-runs { display: flex; gap: .35rem; flex-wrap: wrap; }
.cpo-btn {
  padding: .34rem .68rem;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: .68rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color .18s var(--ease), color .18s var(--ease), background .18s var(--ease);
}
.cpo-btn:hover { border-color: var(--accent); color: var(--accent); }
.cpo-btn[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.cpo-btn--ghost { color: var(--faint); }

.cpo-stage {
  padding: .4rem;
  overflow-x: auto;
  background: var(--bg);
  border: 1px solid var(--hairline-2);
  border-radius: 12px;
}
.cpo-stage svg {
  display: block;
  width: 100%;
  min-width: 560px;
  height: auto;
  font-family: inherit;
  overflow: visible;
}

/* package furniture */
.cpo-board { fill: var(--card-2); stroke: var(--hairline); stroke-width: 1.5; }
.cpo-via circle { fill: var(--faint); opacity: .45; }
.cpo-engine {
  fill: none;
  stroke: var(--hairline);
  stroke-width: 1.2;
  stroke-dasharray: 5 4;
}
.cpo-ghost {
  fill: none;
  stroke: var(--hairline-2);
  stroke-width: 1.2;
  stroke-dasharray: 3 5;
}
.cpo-box { stroke-width: 1.5; transition: stroke-width .18s var(--ease), filter .18s var(--ease); }
.cpo-asic  { fill: var(--cpo-el-soft);  stroke: var(--cpo-el); }
.cpo-eic   { fill: var(--cpo-el-soft);  stroke: var(--cpo-el); stroke-opacity: .55; }
.cpo-pic   { fill: var(--cpo-opt-soft); stroke: var(--cpo-opt); }
.cpo-fau   { fill: var(--card);         stroke: var(--cpo-opt); stroke-opacity: .7; }
.cpo-laser { fill: var(--cpo-cw-soft);  stroke: var(--cpo-cw); }

/* links */
.cpo-el path     { stroke: var(--cpo-el);  stroke-width: 2.4; stroke-linecap: round; }
.cpo-fiber path  { stroke: var(--cpo-opt); stroke-width: 2;   stroke-linecap: round; opacity: .9; }
.cpo-cw path     { stroke: var(--cpo-cw);  stroke-width: 1.8; stroke-dasharray: 7 5; opacity: .85; }
.cpo-rail        { fill: none; stroke: none; }

/* type inside the drawing */
.cpo-lbl { fill: var(--ink); font-size: 14px; font-weight: 500; }
.cpo-lbl--sm { font-size: 12px; }
.cpo-sub { fill: var(--muted); font-size: 10.5px; letter-spacing: .02em; }
.cpo-faint { fill: var(--faint); font-size: 9.5px; letter-spacing: .07em; text-transform: uppercase; }

/* hit targets */
.cpo-part { cursor: pointer; }
.cpo-part rect:not(.cpo-board) { transition: stroke-width .18s var(--ease); }
.cpo-part:hover .cpo-box,
.cpo-part.is-active .cpo-box,
.cpo-part.is-lit .cpo-box { stroke-width: 2.8; stroke-opacity: 1; }
.cpo-part:hover .cpo-board,
.cpo-part.is-active .cpo-board { stroke: var(--muted); }
.cpo-part:hover .cpo-engine,
.cpo-part.is-active .cpo-engine { stroke: var(--muted); stroke-dasharray: none; }
.cpo-part:hover .cpo-fiber path,
.cpo-part.is-active .cpo-fiber path,
.cpo-part.is-lit .cpo-fiber path { stroke-width: 3; opacity: 1; }
.cpo-part:focus { outline: none; }
.cpo-part:focus-visible .cpo-box,
.cpo-part:focus-visible .cpo-board { stroke: var(--ink); stroke-width: 2.8; }
.cpo-part.is-lit { animation: cpoLit .9s var(--ease) infinite alternate; }
@keyframes cpoLit { from { opacity: .82; } to { opacity: 1; } }

/* the travelling signal */
.cpo-dot { opacity: 0; fill: var(--cpo-el); }
.cpo-dot.is-on { opacity: 1; }
.cpo-dot.is-opt { fill: var(--cpo-opt); }
.cpo-dot.is-cw  { fill: var(--cpo-cw); }
.cpo.is-flowing .cpo-cw path { animation: cpoMarch 1.1s linear infinite; }
@keyframes cpoMarch { to { stroke-dashoffset: -24; } }

/* read-out */
.cpo-panel {
  margin-top: .85rem;
  padding: .85rem 1rem .9rem;
  background: var(--card-2);
  border: 1px solid var(--hairline-2);
  border-inline-start: 2px solid var(--accent);
  border-radius: 10px;
}
.cpo .cpo-panel-title {
  margin: 0 0 .3rem;
  color: var(--ink);
  font-size: .84rem;
  font-weight: 600;
  letter-spacing: .005em;
}
.cpo .cpo-panel-text {
  margin: 0;
  color: var(--muted);
  font-size: .87rem;
  line-height: 1.62;
}
.cpo .cpo-panel-step {
  margin: 0 0 .3rem;
  color: var(--faint);
  font-size: .62rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.cpo-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1.1rem;
  margin: .7rem 0 0;
  padding: 0;
  list-style: none;
  color: var(--faint);
  font-size: .7rem;
  letter-spacing: .05em;
}
.cpo-sw {
  display: inline-block;
  width: 15px;
  margin-inline-end: .4rem;
  border-top: 2px solid currentColor;
  vertical-align: middle;
}
.cpo-sw--el  { color: var(--cpo-el); }
.cpo-sw--opt { color: var(--cpo-opt); }
.cpo-sw--cw  { color: var(--cpo-cw); border-top-style: dashed; }

/* no-JS fallback: the same copy, as a plain key under the drawing */
.cpo-key { margin: 1rem 0 0; font-size: .87rem; line-height: 1.6; }
.cpo-key dt { margin-top: .7rem; color: var(--ink); font-weight: 600; }
.cpo-key dd { margin: .2rem 0 0; color: var(--muted); }
.js .cpo-key { display: none; }

@media (prefers-reduced-motion: reduce) {
  .cpo-part.is-lit { animation: none; }
  .cpo.is-flowing .cpo-cw path { animation: none; }
  .cpo-box, .cpo-part rect:not(.cpo-board) { transition: none; }
}

@media (max-width: 560px) {
  .cpo-head { align-items: flex-start; }
  .cpo-stage { padding: .3rem; }
}

/* wide invisible rails so the thin fiber strands are clickable */
.cpo-hit path { stroke: transparent; stroke-width: 18; }

/* ---------------------------------------------------- richer summary rows
   A long piece earns more than a one-line note: a closing hint about what's
   inside, and a row of subject tags under it. Both live in the <summary>, so
   they're what you see before opening the entry. */
.entry-hint {
  display: block;
  margin-top: .45rem;
  color: var(--faint);
  font-size: .86em;
  font-weight: 400;
  font-style: italic;
}
.entry-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .32rem .34rem;
  margin-top: .75rem;
}
.entry-tags > span {
  padding: .2rem .52rem;
  border: 1px solid var(--hairline-2);
  border-radius: 999px;
  color: var(--faint);
  font-size: .6rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: border-color .2s var(--ease), color .2s var(--ease);
}
.entry:hover .entry-tags > span { border-color: var(--hairline); }
.entry-tags > span:first-child {
  border-color: color-mix(in srgb, var(--tint) 32%, transparent);
  color: var(--tint);
}
.entry-card[open] .entry-tags,
.entry-card[open] .entry-hint { display: none; }  /* the row is a pitch; once it's open you're past it */

@media (max-width: 560px) {
  .entry-tags > span:nth-child(n+4) { display: none; }
}

/* the h3 rules in a long body should take the entry's topic colour too —
   --tint is declared on .entry, which the body isn't inside */
.entry-item[data-cat="current"] .entry-body { --tint: var(--c-current); }
.entry-item[data-cat="markets"] .entry-body { --tint: var(--c-markets); }
.entry-item[data-cat="code"]    .entry-body { --tint: var(--c-code); }
.entry-item[data-cat="misc"]    .entry-body { --tint: var(--c-misc); }
