:root {
  color-scheme: light;
  --sky: #237cde;
  --sky-deep: #145da9;
  --paper: #fbfcfd;
  --paper-mark: var(--sky);
  --ink: #293c53;
  --ink-strong: #1f3146;
  --ink-soft: #526983;
  --ink-faint: #7890aa;
  --blue: #2f78c9;
  --line: rgba(41, 60, 83, 0.18);
  --shadow: rgba(7, 27, 51, 0.22);
  --cloud-1: rgba(255, 255, 255, .30);
  --cloud-2: rgba(255, 255, 255, .20);
  --cloud-3: rgba(255, 255, 255, .16);
  --chrome: rgba(255, 255, 255, .92);
  --chrome-bg: rgba(255, 255, 255, .09);
  --chrome-line: rgba(255, 255, 255, .28);
  --tag-line: rgba(47, 120, 201, .28);
  --quote-line: rgba(47, 120, 201, .50);
  --soft-blue: rgba(35, 124, 222, .10);
  --conversation: rgba(35, 124, 222, .055);
  --callout-bg: rgba(35, 124, 222, .07);
  --callout-line: rgba(47, 120, 201, .24);
  --code-bg: #14283f;
  --code-ink: #eef7ff;
  --landing-image-opacity: .72;
  --landing-image-filter: blur(34px) saturate(.72) contrast(.92);
  --landing-wash: linear-gradient(180deg, rgba(35, 124, 222, .24), rgba(35, 124, 222, .58));
  --sans: system-ui, -apple-system, "Segoe UI", "Helvetica Neue", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --sky: #061526;
  --sky-deep: #020914;
  --paper: #283b4d;
  --paper-mark: #67adf5;
  --ink: #e6eef7;
  --ink-strong: #f4f8fc;
  --ink-soft: #bdcad9;
  --ink-faint: #829bb5;
  --blue: #78b9ff;
  --line: rgba(181, 207, 235, .17);
  --shadow: rgba(0, 0, 0, .52);
  --cloud-1: rgba(42, 116, 194, .19);
  --cloud-2: rgba(35, 96, 164, .14);
  --cloud-3: rgba(58, 132, 207, .10);
  --chrome: rgba(222, 237, 252, .88);
  --chrome-bg: rgba(92, 160, 231, .08);
  --chrome-line: rgba(132, 187, 245, .22);
  --tag-line: rgba(120, 185, 255, .32);
  --quote-line: rgba(120, 185, 255, .52);
  --soft-blue: rgba(99, 169, 241, .13);
  --conversation: rgba(77, 143, 211, .09);
  --callout-bg: rgba(77, 143, 211, .10);
  --callout-line: rgba(120, 185, 255, .22);
  --code-bg: #050d17;
  --code-ink: #e7f2ff;
  --landing-image-opacity: .78;
  --landing-image-filter: blur(36px) brightness(.42) saturate(.78) contrast(.96);
  --landing-wash: linear-gradient(180deg, rgba(2, 9, 20, .32), rgba(2, 9, 20, .68));
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: var(--sky);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.48) transparent;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.65;
  background:
    radial-gradient(ellipse 31rem 12rem at 13% 10rem, var(--cloud-1), transparent 72%),
    radial-gradient(ellipse 37rem 14rem at 89% 34rem, var(--cloud-2), transparent 72%),
    radial-gradient(ellipse 29rem 11rem at 22% 72rem, var(--cloud-3), transparent 72%),
    var(--sky);
  transition: color .2s ease, background-color .2s ease;
}

/* The index uses the original Parannoul cover as atmosphere rather than as
   another hero. Oversizing the fixed layer gives the Gaussian blur pixels to
   spill into, so no soft transparent rim appears around the viewport. */
.blog-index {
  position: relative;
  isolation: isolate;
  overflow-x: hidden;
  background: var(--sky);
}
.blog-index::before,
.blog-index::after {
  content: "";
  position: fixed;
  pointer-events: none;
}
.blog-index::before {
  inset: -3rem;
  z-index: -2;
  background: url("/art/tstnpotd-cover.png") center / cover no-repeat;
  filter: var(--landing-image-filter);
  opacity: var(--landing-image-opacity);
}
.blog-index::after {
  inset: 0;
  z-index: -1;
  background: var(--landing-wash);
}

a { color: inherit; }
img { max-width: 100%; }

.site-header {
  width: min(72rem, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: clamp(1.3rem, 4vw, 2.5rem) 0 1rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
}

.home-link {
  color: var(--paper-mark);
  text-decoration: none;
  text-transform: lowercase;
  letter-spacing: .14em;
  font-size: .78rem;
  text-shadow: none;
}

.home-link:hover { color: var(--blue); }

.header-actions {
  display: flex;
  align-items: center;
  gap: clamp(.25rem, 1vw, .6rem);
}

.theme-toggle {
  min-height: 2rem;
  padding: .3rem .6rem;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--paper-mark);
  font: 500 .69rem/1 var(--mono);
  letter-spacing: .06em;
  text-transform: lowercase;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.theme-toggle:hover { color: var(--blue); }
.theme-toggle:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
/* Small pieces from the same paper set as the landing-page navigation. Each
   control gets its own scrap, while the text remains a real link or button. */
.paper-chip {
  position: relative;
  isolation: isolate;
  min-height: 2.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .55rem .9rem;
}
.paper-chip::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--chip-image) center / 100% 100% no-repeat;
  filter: drop-shadow(0 3px 7px var(--shadow));
  transition: filter .2s ease;
}
.paper-chip:hover::before { filter: drop-shadow(0 5px 9px var(--shadow)); }
.paper-chip:focus-visible { outline: 2px solid var(--chrome); outline-offset: 3px; }
.paper-chip-theme { --chip-image: url("/art/nav-3.png"); width: clamp(5.5rem, 9vw, 6.7rem); transform: rotate(.45deg); }
.paper-chip-home { --chip-image: url("/art/nav-6.png"); width: clamp(6.2rem, 11vw, 8rem); transform: rotate(-.35deg); }
.paper-chip-text {
  display: inline-block;
  transform: rotate(var(--text-rot, 0deg));
}
:root[data-theme="dark"] .paper-chip::before,
:root[data-theme="dark"] .lede::before {
  background: var(--paper);
  -webkit-mask: var(--chip-image) center / 100% 100% no-repeat;
  mask: var(--chip-image) center / 100% 100% no-repeat;
}

.title-wrap {
  width: min(72rem, calc(100% - 2.5rem));
  margin: clamp(2.5rem, 8vw, 6rem) auto clamp(3.5rem, 8vw, 6.5rem);
}

.title-strip {
  position: relative;
  width: min(26rem, 90%);
  min-height: 5.4rem;
  display: grid;
  place-items: center;
  isolation: isolate;
  transform: rotate(-1deg);
}

.title-strip::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("/art/nav-6.png") center / 100% 100% no-repeat;
  filter: drop-shadow(0 5px 12px var(--shadow));
}

.title-strip h1 {
  margin: 0;
  color: var(--paper-mark);
  font-size: clamp(1.35rem, 5vw, 2.2rem);
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: lowercase;
}

.lede {
  --chip-image: url("/art/nav-3.png");
  position: relative;
  isolation: isolate;
  width: fit-content;
  max-width: min(39rem, 94%);
  margin: 1.25rem 0 0 clamp(.4rem, 4vw, 2.5rem);
  padding: 1.1rem clamp(1.7rem, 5vw, 3rem);
  color: var(--paper-mark);
  font-size: clamp(.94rem, 2vw, 1.08rem);
  text-shadow: none;
  transform: rotate(.35deg);
}
.lede::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--chip-image) center / 100% 100% no-repeat;
  filter: drop-shadow(0 4px 9px var(--shadow));
}

.post-list {
  width: min(64rem, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 0 0 8rem;
  display: grid;
  gap: clamp(1.6rem, 4vw, 3rem);
}

.post-card {
  position: relative;
  isolation: isolate;
  width: min(48rem, 94%);
  padding: clamp(2.4rem, 6vw, 4.2rem) clamp(2rem, 7vw, 5rem);
  text-decoration: none;
  transform: rotate(var(--turn, -.35deg));
  transition: transform .22s ease, filter .22s ease;
}

.post-card:nth-child(even) {
  justify-self: end;
  --turn: .45deg;
}

.post-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("/art/text_box_1.png") center / 100% 100% no-repeat;
  filter: drop-shadow(0 9px 18px var(--shadow));
}

/* In night mode the paper drawings become masks. Their ragged silhouettes
   stay intact while the sheet itself can take on the dusk-blue palette. */
:root[data-theme="dark"] .title-strip::before,
:root[data-theme="dark"] .post-card::before {
  background: var(--paper);
  -webkit-mask: url("/art/text_box_1.png") center / 100% 100% no-repeat;
  mask: url("/art/text_box_1.png") center / 100% 100% no-repeat;
  filter: drop-shadow(0 9px 18px var(--shadow));
}
:root[data-theme="dark"] .title-strip::before {
  -webkit-mask-image: url("/art/nav-6.png");
  mask-image: url("/art/nav-6.png");
}

/* Long posts used to stretch the small torn-paper PNG to the article's full
   height. That made its raster edge soft, especially on phones. Posts now use
   a clean, cropped sheet; the original paper artwork stays on the short cards
   where it can remain close to its intended proportions. */
.paper::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--paper);
}

.post-card:hover,
.post-card:focus-visible {
  transform: rotate(0) translateY(-3px);
  filter: brightness(1.015);
}

.post-card:focus-visible { outline: 2px solid var(--chrome); outline-offset: 5px; }

.post-meta,
.article-meta {
  margin: 0 0 .65rem;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: .76rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.post-card h2 {
  margin: 0;
  font-size: clamp(1.45rem, 4vw, 2.25rem);
  line-height: 1.15;
  letter-spacing: -.025em;
  font-weight: 650;
}

.post-card p:not(.post-meta) {
  margin: .85rem 0 1.1rem;
  color: var(--ink-soft);
}

.tags { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .5rem; }
.tag {
  display: inline-block;
  color: var(--blue);
  font-family: var(--mono);
  font-size: .69rem;
}

.empty-note {
  color: rgba(255,255,255,.76);
  text-align: center;
  font-family: var(--mono);
  font-size: .78rem;
}

.article-shell {
  width: min(72rem, calc(100% - 2rem));
  margin: clamp(2rem, 6vw, 5rem) auto 8rem;
}

.paper {
  position: relative;
  isolation: isolate;
  width: min(55rem, 100%);
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 6rem) clamp(1.7rem, 8vw, 6.5rem);
}

.article-header { margin-bottom: clamp(2.3rem, 6vw, 4rem); }
.article-header h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 7vw, 4.25rem);
  line-height: 1.02;
  letter-spacing: -.045em;
  font-weight: 680;
}
.article-deck {
  margin: 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 2.5vw, 1.22rem);
  line-height: 1.55;
}

.article-body { font-size: clamp(.98rem, 1.5vw, 1.08rem); }
.article-body h2,
.article-body h3,
.article-body h4 {
  line-height: 1.25;
  scroll-margin-top: 2rem;
}
.article-body h2 { margin: 2.5em 0 .65em; font-size: 1.65em; }
.article-body h3 { margin: 2em 0 .55em; font-size: 1.25em; }
.article-body h4 { margin: 1.7em 0 .45em; font-size: 1em; }
.article-body p { margin: 1em 0; }
.article-body a { color: var(--blue); text-underline-offset: .16em; }
.article-body ul,
.article-body ol { padding-left: 1.45em; }
.article-body li + li { margin-top: .35em; }
.article-body strong { color: var(--ink-strong); }

.article-body blockquote {
  margin: 1.8rem 0;
  padding: .25rem 0 .25rem 1.25rem;
  border-left: 3px solid var(--quote-line);
  color: var(--ink-soft);
  font-size: 1.08em;
}

code,
pre { font-family: var(--mono); }
code {
  padding: .12em .32em;
  border-radius: 4px;
  background: var(--soft-blue);
  font-size: .88em;
}
pre {
  max-width: 100%;
  overflow-x: auto;
  margin: 1.6rem 0;
  padding: 1.15rem 1.25rem;
  border-radius: 7px;
  background: var(--code-bg);
  color: var(--code-ink);
  line-height: 1.55;
  tab-size: 2;
}
pre code { padding: 0; background: none; color: inherit; font-size: .84rem; }

.table-wrap { overflow-x: auto; margin: 1.6rem 0; }
table { width: 100%; border-collapse: collapse; font-size: .92em; }
th, td { padding: .65rem .75rem; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--ink-soft); font-family: var(--mono); font-size: .78em; text-transform: uppercase; }

figure { margin: 2rem 0; }
figure img { display: block; width: 100%; height: auto; border-radius: 3px; }
figcaption { margin-top: .55rem; color: var(--ink-faint); font-size: .8rem; }
figcaption a { color: inherit; }

.video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--code-bg);
}
.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.video-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem 1rem;
  margin: 2rem 0;
}
.video-grid .video { margin: 0; min-width: 0; }

.conversation {
  padding: .9rem 1rem .9rem 1.25rem !important;
  background: var(--conversation);
}
.conversation .speaker {
  margin: 0 0 .4rem;
  color: var(--blue);
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 650;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.conversation p { margin: .7rem 0; }
.lineup { list-style: none; padding-left: 0 !important; }

.callout {
  margin: 1.7rem 0;
  padding: 1rem 1.15rem;
  border: 1px solid var(--callout-line);
  background: var(--callout-bg);
}
.callout > :first-child { margin-top: 0; }
.callout > :last-child { margin-bottom: 0; }

.article-body hr { border: 0; border-top: 1px solid var(--line); margin: 3rem 0; }
.article-footer {
  margin-top: 4rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: .76rem;
}
.article-footer a { color: var(--blue); }

@media (max-width: 36rem) {
  .site-header { width: calc(100% - 2rem); }
  .title-wrap, .post-list { width: calc(100% - 1.6rem); }
  .title-wrap { margin-top: 2rem; }
  .paper-chip { min-height: 2.35rem; padding: .45rem .65rem; }
  .paper-chip-theme { width: 5.25rem; }
  .paper-chip-home { width: 5.8rem; }
  .home-link { font-size: .68rem; }
  .theme-toggle { font-size: .63rem; }
  .lede { margin-left: 0; padding: 1.1rem 1.7rem; }
  .post-card { width: 100%; padding: 2.7rem 1.65rem; }
  .paper { padding: 4.8rem 1.35rem 4.5rem; }
  .video-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  body, .post-card { transition: none; }
}

@media print {
  :root,
  :root[data-theme="dark"] {
    color-scheme: light;
    --ink: #293c53;
    --ink-strong: #1f3146;
    --ink-soft: #526983;
    --ink-faint: #7890aa;
    --blue: #2f78c9;
    --line: rgba(41, 60, 83, .18);
  }
  body { background: #fff; }
  .site-header { display: none; }
  .article-shell { width: 100%; margin: 0; }
  .paper { width: 100%; padding: 0; }
  .paper::before { display: none; }
  pre { white-space: pre-wrap; }
}
