/* ════════════════════════════════════════════════════════════
   aimee.systems — a tech blog with personality
   ════════════════════════════════════════════════════════════ */

:root {
  --bg: #f3eadc;
  --paper: #faf3e6;
  --ink: #1a1612;
  --ink-soft: #5b4f43;
  --ink-faint: #978878;
  --rule: #d8c7b0;
  --rule-soft: #e6d8c0;
  --accent: #8b5cf6;
  --accent-soft: #e0d4fc;
  --highlight: #fff066;

  --max: 1240px;
  --pad: clamp(20px, 4vw, 56px);
  --gut: clamp(14px, 1.8vw, 24px);

  --font-sans: "General Sans", "Söhne", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", "IBM Plex Mono", ui-monospace, monospace;
  --font-serif: "Instrument Serif", "Times New Roman", serif;

  --text: 17px;
  --lh: 1.62;
  --shadow-pop: 4px 4px 0 var(--ink);
}

[data-mode="dark"] {
  --bg: #14100c;
  --paper: #1d1812;
  --ink: #f3eadc;
  --ink-soft: #ad9f8d;
  --ink-faint: #6b5e4f;
  --rule: #38301f;
  --rule-soft: #2a2418;
  --accent: #a78bfa;
  --accent-soft: #2e1a4a;
  --highlight: #b9a83a;
}

/* ─── reset ─── */
*,*::before,*::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--text);
  line-height: var(--lh);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

/* ─── shared layout ─── */
.shell { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }

/* paper-grain background */
body::before {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    radial-gradient(circle at 25% 30%, rgba(0,0,0,.018) 0, transparent 40%),
    radial-gradient(circle at 75% 70%, rgba(0,0,0,.014) 0, transparent 40%);
  opacity: .9;
}
[data-mode="dark"] body::before { opacity: .4; }

/* ─── hero with image overlay ─── */
.hero { position: relative; min-height: 0; }
[data-hero="banner"] .hero,
[data-hero="backdrop"] .hero {
  min-height: clamp(560px, 78vh, 760px);
  padding: 0;
  display: flex;
  align-items: center;
}
.hero-bg {
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  width: 100vw;
  z-index: 0;
  overflow: hidden;
  border-bottom: 1px solid var(--rule);
}
.hero-bg-img {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 78% 30%;
}
[data-hero="backdrop"] .hero-bg-img { object-position: 50% 40%; }
.hero-bg-veil {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg,
      color-mix(in oklab, var(--bg) 94%, transparent) 0%,
      color-mix(in oklab, var(--bg) 88%, transparent) 32%,
      color-mix(in oklab, var(--bg) 40%, transparent) 60%,
      transparent 100%),
    linear-gradient(180deg,
      transparent 0%,
      transparent 70%,
      color-mix(in oklab, var(--bg) 85%, transparent) 100%);
}
[data-mode="dark"] .hero-bg-veil {
  background:
    linear-gradient(90deg,
      color-mix(in oklab, var(--bg) 94%, transparent) 0%,
      color-mix(in oklab, var(--bg) 86%, transparent) 32%,
      color-mix(in oklab, var(--bg) 50%, transparent) 60%,
      color-mix(in oklab, var(--bg) 20%, transparent) 100%),
    linear-gradient(180deg,
      transparent 0%,
      transparent 70%,
      color-mix(in oklab, var(--bg) 85%, transparent) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 64ch;
  width: 100%;
  padding: clamp(32px, 6vh, 80px) 0;
}

/* ─── top bar ─── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--rule);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px var(--pad);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .04em;
  max-width: var(--max);
  margin: 0 auto;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600;
}
.brand-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--ink);
  flex: none;
  background: var(--paper);
}
.brand-avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 35%;
  display: block;
}
.brand .blip {
  width: 10px; height: 10px; background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--accent-soft);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(.85); opacity: .7; }
}
.brand-name { color: var(--ink); }
.brand-slash { color: var(--ink-faint); }
.brand-suffix { color: var(--accent); }

.nav { display: flex; gap: 18px; align-items: center; }
.nav a {
  color: var(--ink-soft);
  text-transform: uppercase;
  position: relative;
  padding: 4px 0;
  cursor: pointer;
}
.nav a:hover { color: var(--ink); }
.nav a.active { color: var(--accent); }
.nav a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; background: var(--accent);
}

.nav-meta {
  display: flex; align-items: center; gap: 14px;
  color: var(--ink-faint);
}
.nav-meta .dot { width: 4px; height: 4px; background: var(--ink-faint); border-radius: 50%; }
.status-on { color: #2da461; }
[data-mode="dark"] .status-on { color: #6ad991; }

/* ─── footer ─── */
.foot {
  margin-top: 96px; padding: 40px var(--pad) 60px;
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-faint);
  letter-spacing: .03em;
}
.foot-inner {
  max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px;
}
.foot h4 {
  margin: 0 0 14px; font-size: 10px; font-weight: 600;
  text-transform: uppercase; color: var(--ink-soft);
  letter-spacing: .08em;
}
.foot ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.foot a:hover { color: var(--accent); }
.foot-meta { display: flex; flex-direction: column; gap: 4px; }
.foot-meta b { color: var(--ink-soft); font-weight: 500; }

/* ═══════════ home page ═══════════ */
.hero { padding: 36px 0 60px; }
.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-faint);
  display: flex; gap: 10px; align-items: center; margin-bottom: 24px;
}
.hero-eyebrow .bracket { color: var(--accent); }
.hero h1 {
  font-size: clamp(44px, 7vw, 88px);
  line-height: 1.02; letter-spacing: -0.025em; font-weight: 500;
  margin: 0 0 20px;
  max-width: 16ch;
}
.hero h1 .ital {
  font-family: var(--font-serif);
  font-style: italic; font-weight: 400;
  letter-spacing: -.01em;
}
.hero h1 .marker {
  background: linear-gradient(180deg, transparent 60%, var(--accent-soft) 60%, var(--accent-soft) 92%, transparent 92%);
  padding: 0 .1em;
}
.hero-sub {
  max-width: 56ch;
  font-size: clamp(17px, 1.4vw, 19px);
  color: var(--ink-soft);
  line-height: 1.55;
  margin: 0 0 36px;
}
.hero-sub em {
  font-family: var(--font-serif);
  font-size: 1.12em;
  color: var(--ink);
}

/* status widget on hero */
.status-card {
  display: inline-grid;
  grid-template-columns: auto 1fr;
  gap: 4px 18px;
  padding: 14px 20px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--paper);
  font-family: var(--font-mono);
  font-size: 11.5px;
  align-items: center;
}
.status-card .label { color: var(--ink-faint); text-transform: uppercase; letter-spacing: .06em; }
.status-card .value { color: var(--ink); }
.status-card .value.hot { color: var(--accent); }

/* ─── section header (mono dividers) ─── */
.section-h {
  display: flex; align-items: center; gap: 16px;
  font-family: var(--font-mono);
  font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-faint);
  margin: 64px 0 24px;
}
.section-h .num { color: var(--accent); }
.section-h .rule { flex: 1; height: 1px; background: var(--rule); }
.section-h .meta { color: var(--ink-faint); font-size: 10.5px; }

/* ─── featured post ─── */
.featured {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  padding: 36px;
  border: 1px solid var(--ink);
  background: var(--paper);
  border-radius: 4px;
  position: relative;
  box-shadow: var(--shadow-pop);
  transition: transform .2s cubic-bezier(.3,.7,.4,1);
}
.featured:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
@media (min-width: 900px) {
  .featured { grid-template-columns: 1.4fr 1fr; gap: 48px; }
}
.featured-tag {
  position: absolute; top: -14px; left: 28px;
  background: var(--accent); color: white;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 600;
  padding: 5px 10px; border-radius: 3px;
  letter-spacing: .08em; text-transform: uppercase;
}
[data-mode="dark"] .featured-tag { color: #1a1612; }
.featured h2 {
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.05; letter-spacing: -.02em; font-weight: 500;
  margin: 8px 0 16px;
}
.featured h2 .ital { font-family: var(--font-serif); font-style: italic; font-weight: 400; }
.featured-excerpt { color: var(--ink-soft); margin: 0 0 24px; max-width: 50ch; }
.featured-meta {
  display: flex; flex-wrap: wrap; gap: 14px;
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint);
  letter-spacing: .04em;
}
.featured-meta .dot { color: var(--rule); }
.featured-meta .spice { color: var(--accent); letter-spacing: 1px; }
.featured-art {
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 4px;
  aspect-ratio: 4/3;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.featured-art::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(45deg, transparent 0 12px, color-mix(in oklab, var(--ink) 4%, transparent) 12px 13px);
}
.diagram-placeholder {
  position: relative; z-index: 1;
  font-family: var(--font-mono); font-size: 10px;
  color: var(--ink-faint);
  text-align: center;
  padding: 16px 22px;
  background: var(--paper);
  border: 1px dashed var(--ink-faint);
}

/* ─── post list ─── */
.posts {
  display: flex; flex-direction: column;
  border-top: 1px solid var(--rule);
}
.post-row {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 24px;
  padding: 22px 8px;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
  cursor: pointer;
  transition: background .15s, padding .2s cubic-bezier(.3,.7,.4,1);
  position: relative;
}
.post-row::before {
  content: ""; position: absolute;
  left: 0; top: 0; bottom: 0; width: 0;
  background: var(--accent);
  transition: width .2s cubic-bezier(.3,.7,.4,1);
}
.post-row:hover { padding-left: 22px; background: var(--paper); }
.post-row:hover::before { width: 4px; }
.post-row:hover .post-arrow { transform: translateX(4px); color: var(--accent); }
.post-date {
  font-family: var(--font-mono); font-size: 11.5px;
  color: var(--ink-faint); letter-spacing: .03em;
}
.post-row h3 {
  margin: 0; font-size: 19px; font-weight: 500; letter-spacing: -.005em;
  line-height: 1.35;
}
.post-row h3 .ital { font-family: var(--font-serif); font-style: italic; font-weight: 400; font-size: 1.1em; }
.post-row h3 .note { color: var(--ink-faint); font-weight: 400; }
.post-tags { display: flex; gap: 6px; margin-top: 6px; }
.post-tag {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--ink-faint); letter-spacing: .04em;
  text-transform: lowercase;
}
.post-tag::before { content: "#"; color: var(--accent); }
.post-arrow {
  font-family: var(--font-mono); font-size: 14px;
  color: var(--ink-faint);
  transition: transform .2s, color .2s;
}

/* ─── newsletter ─── */
.newsletter {
  margin-top: 64px;
  padding: 40px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 4px;
  display: grid;
  gap: 28px;
  grid-template-columns: 1fr;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.newsletter::after {
  content: "::EOF::";
  position: absolute; right: 18px; bottom: 12px;
  font-family: var(--font-mono); font-size: 9px;
  color: var(--ink-faint); letter-spacing: .08em;
}
@media (min-width: 760px) { .newsletter { grid-template-columns: 1.2fr 1fr; } }
.newsletter h3 {
  margin: 0 0 10px; font-size: 28px; font-weight: 500; letter-spacing: -.015em;
}
.newsletter h3 .ital { font-family: var(--font-serif); font-style: italic; font-weight: 400; }
.newsletter p { margin: 0; color: var(--ink-soft); max-width: 40ch; }
.newsletter p .mono { font-family: var(--font-mono); font-size: .92em; color: var(--ink-faint); }
.newsletter-form {
  display: flex; flex-direction: column; gap: 10px;
}
.newsletter-input-wrap {
  display: flex;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: var(--bg);
  overflow: hidden;
}
.newsletter-input-wrap:focus-within { box-shadow: var(--shadow-pop); transform: translate(-2px, -2px); transition: all .15s; }
.newsletter-input {
  flex: 1; border: 0; background: transparent;
  padding: 14px 16px;
  font-family: var(--font-mono); font-size: 13px;
  color: var(--ink); outline: none;
}
.newsletter-input::placeholder { color: var(--ink-faint); }
.newsletter-button {
  appearance: none; border: 0; background: var(--accent); color: white;
  padding: 0 22px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  cursor: pointer;
  transition: background .15s;
}
[data-mode="dark"] .newsletter-button { color: #1a1612; }
.newsletter-button:hover { background: color-mix(in oklab, var(--accent) 80%, var(--ink)); }
.newsletter-fineprint {
  font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-faint);
  letter-spacing: .03em;
}
.newsletter-fineprint b { color: var(--ink-soft); font-weight: 500; }
.newsletter-success {
  font-family: var(--font-mono); font-size: 13px; color: #2da461;
  padding: 14px 18px; border: 1px solid #2da461; border-radius: 4px;
  background: color-mix(in oklab, #2da461 8%, transparent);
}
[data-mode="dark"] .newsletter-success { color: #6ad991; border-color: #6ad991; }

/* ═══════════ article page ═══════════ */
.article-wrap { padding: 56px 0 40px; }
.article-wrap .shell { max-width: 880px; }

.article-back {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 12px;
  color: var(--ink-faint); letter-spacing: .04em;
  margin-bottom: 32px; cursor: pointer;
}
.article-back:hover { color: var(--accent); }

.article-header { margin-bottom: 56px; }
.article-eyebrow {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 18px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.article-eyebrow .bracket { color: var(--accent); }
.article-eyebrow .pipe { color: var(--rule); }

.article h1 {
  font-size: clamp(38px, 5.4vw, 64px);
  line-height: 1.05; letter-spacing: -.022em; font-weight: 500;
  margin: 0 0 18px;
}
.article h1 .ital { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -.005em; }

.article-deck {
  font-family: var(--font-serif); font-style: italic;
  font-size: clamp(20px, 2vw, 26px);
  color: var(--ink-soft);
  margin: 0 0 32px;
  line-height: 1.4;
  max-width: 40ch;
}

.article-meta-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 36px;
}
.article-meta-cell {
  background: var(--paper);
  padding: 14px 18px;
  font-family: var(--font-mono); font-size: 11px;
  display: flex; flex-direction: column; gap: 4px;
}
.article-meta-cell .k { color: var(--ink-faint); text-transform: uppercase; letter-spacing: .08em; font-size: 9.5px; }
.article-meta-cell .v { color: var(--ink); font-size: 13px; }
.article-meta-cell .v.hot { color: var(--accent); }
@media (max-width: 600px) {
  .article-meta-row { grid-template-columns: repeat(2, 1fr); }
}

/* article body prose */
.prose {
  font-size: 18px;
  line-height: 1.72;
  color: var(--ink);
}
.prose > * + * { margin-top: 1.4em; }
.prose h2 {
  font-size: 28px; font-weight: 500; letter-spacing: -.015em;
  margin: 2.2em 0 .6em; line-height: 1.18;
  display: flex; align-items: baseline; gap: 14px;
}
.prose h2::before {
  content: "§"; color: var(--accent);
  font-family: var(--font-mono); font-size: 16px;
}
.prose h2 .ital { font-family: var(--font-serif); font-style: italic; font-weight: 400; }
.prose h3 {
  font-size: 22px; font-weight: 500; letter-spacing: -.01em;
  margin: 1.8em 0 .5em;
}
.prose p { margin: 0 0 1.4em; }
.prose p:last-child { margin-bottom: 0; }
.prose p .ital { font-family: var(--font-serif); font-style: italic; font-size: 1.06em; }
.prose strong { font-weight: 600; color: var(--ink); }
.prose em { font-family: var(--font-serif); font-style: italic; font-size: 1.05em; }
.prose a {
  color: var(--accent);
  border-bottom: 1px solid color-mix(in oklab, var(--accent) 40%, transparent);
}
.prose a:hover { background: var(--accent-soft); border-bottom-color: var(--accent); }
.prose hr {
  border: 0; height: 1px; background: var(--rule);
  margin: 2.4em 0; position: relative;
}
.prose hr::after {
  content: "* * *"; position: absolute;
  left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: var(--bg); padding: 0 18px;
  font-family: var(--font-mono); color: var(--ink-faint); font-size: 11px; letter-spacing: .4em;
}

/* footnote popovers */
.fn {
  display: inline-flex; vertical-align: super;
  font-family: var(--font-mono); font-size: .58em;
  color: var(--accent); font-weight: 600;
  cursor: pointer;
  padding: 0 3px; margin: 0 1px;
  border-radius: 3px;
  background: var(--accent-soft);
  user-select: none;
  position: relative;
  border: none;
  line-height: 1.3;
}
.fn:hover, .fn[data-open="true"] { background: var(--accent); color: white; }
[data-mode="dark"] .fn:hover, [data-mode="dark"] .fn[data-open="true"] { color: #1a1612; }
.fn-pop {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  width: min(360px, 80vw);
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 4px;
  padding: 16px 18px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.55;
  color: var(--ink);
  text-align: left;
  z-index: 100;
  box-shadow: 4px 4px 0 var(--ink);
  letter-spacing: 0;
  text-transform: none;
  display: none;
}
.fn[data-open="true"] .fn-pop { display: block; }
.fn-pop::before {
  content: ""; position: absolute;
  top: -6px; left: 50%; transform: translateX(-50%) rotate(45deg);
  width: 10px; height: 10px;
  background: var(--paper);
  border-left: 1px solid var(--ink);
  border-top: 1px solid var(--ink);
}
.fn-pop .fn-num {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--accent); letter-spacing: .1em; text-transform: uppercase;
  display: block; margin-bottom: 6px;
}
.fn-pop em { font-family: var(--font-serif); font-style: italic; }

/* code blocks */
.codeblock {
  font-family: var(--font-mono); font-size: 13px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  margin: 1.8em 0 !important;
}
.codeblock-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px;
  border-bottom: 1px solid var(--rule);
  font-size: 10.5px;
  letter-spacing: .06em;
  color: var(--ink-faint);
  text-transform: uppercase;
}
.codeblock-head .lang { color: var(--accent); font-weight: 600; }
.codeblock pre {
  margin: 0; padding: 18px 20px;
  overflow-x: auto;
  line-height: 1.55;
  white-space: pre;
}
.codeblock .c { color: var(--ink-faint); }
.codeblock .k { color: var(--accent); }
.codeblock .s { color: #5a6b40; }
[data-mode="dark"] .codeblock .s { color: #a3c47a; }
.codeblock .n { color: var(--ink); }

/* aside / pull quote */
.aside {
  border-left: 3px solid var(--accent);
  background: var(--paper);
  padding: 20px 24px;
  margin: 1.8em 0 !important;
  border-radius: 0 4px 4px 0;
  display: flex; gap: 16px;
}
.aside-icon {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  color: var(--accent); letter-spacing: .1em; text-transform: uppercase;
  white-space: nowrap;
}
.aside-body { font-size: 16px; line-height: 1.6; color: var(--ink-soft); }
.aside-body em { font-family: var(--font-serif); font-style: italic; font-size: 1.08em; color: var(--ink); }

/* diagram */
.diagram {
  border: 1px solid var(--ink);
  background: var(--paper);
  padding: 32px 28px;
  margin: 2em 0 !important;
  border-radius: 4px;
  font-family: var(--font-mono); font-size: 12px;
  color: var(--ink);
  line-height: 1.7;
  white-space: pre;
  overflow-x: auto;
}
/* interactive diagram */
.diagram-interactive { position: relative; }
.diagram-edit-btn {
  position: absolute; top: 12px; right: 12px;
  font-family: var(--font-mono); font-size: 10px;
  color: var(--accent); background: var(--paper);
  border: 1px solid var(--accent); border-radius: 3px;
  padding: 4px 10px; cursor: pointer;
  opacity: 0; transition: opacity .2s;
  letter-spacing: .04em;
}
.diagram-interactive:hover .diagram-edit-btn { opacity: 1; }

.diagram-cap {
  display: block; margin-top: 14px; padding-top: 12px;
  border-top: 1px dashed var(--rule);
  font-family: var(--font-mono); font-size: 10.5px;
  color: var(--ink-faint); letter-spacing: .04em;
  text-transform: uppercase; white-space: normal;
}
.diagram-cap .num { color: var(--accent); }

/* article footer */
.article-end {
  margin: 64px 0 0;
  padding: 28px 0;
  border-top: 1px solid var(--rule);
  display: grid; gap: 24px;
}
.article-end-tags {
  display: flex; flex-wrap: wrap; gap: 8px;
  font-family: var(--font-mono); font-size: 11.5px;
  color: var(--ink-faint);
}
.article-end-tags .tag {
  padding: 4px 10px;
  border: 1px solid var(--rule); border-radius: 999px;
  cursor: pointer;
}
.article-end-tags .tag:hover { border-color: var(--accent); color: var(--accent); }
.article-end-tags .tag::before { content: "#"; color: var(--accent); }
.article-end-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 16px;
}
.end-nav-card {
  border: 1px solid var(--rule); border-radius: 4px;
  padding: 18px 20px;
  background: var(--paper);
  cursor: pointer;
  transition: all .15s;
}
.end-nav-card:hover { border-color: var(--ink); transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--ink); }
.end-nav-card.next { text-align: right; }
.end-nav-card .lbl {
  font-family: var(--font-mono); font-size: 10px; color: var(--ink-faint);
  letter-spacing: .1em; text-transform: uppercase;
  margin-bottom: 6px;
}
.end-nav-card .lbl .ar { color: var(--accent); }
.end-nav-card .ttl { font-size: 16px; font-weight: 500; line-height: 1.3; }
.end-nav-card .ttl .ital { font-family: var(--font-serif); font-style: italic; font-weight: 400; }
@media (max-width: 600px) { .article-end-nav { grid-template-columns: 1fr; } }

/* ═══════════ about page ═══════════ */
.about-wrap { padding: 56px 0 40px; }
.about-wrap .shell { max-width: 1080px; }
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 56px;
}
@media (min-width: 880px) {
  .about-grid { grid-template-columns: 320px 1fr; gap: 72px; }
}
.about-photo {
  aspect-ratio: 3/4;
  border: 1px solid var(--ink);
  background: var(--paper);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-pop);
}
.about-photo img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 30%;
}
.about-photo .label {
  position: absolute; left: 14px; bottom: 14px;
  font-family: var(--font-mono); font-size: 10px;
  color: var(--ink-soft);
  background: var(--paper);
  padding: 4px 8px;
  border: 1px dashed var(--ink-faint);
  letter-spacing: .04em;
  z-index: 2;
}
.about-photo .label .hot { color: var(--accent); }

.about-eyebrow {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 14px;
  display: flex; gap: 10px; align-items: center;
}
.about-eyebrow .bracket { color: var(--accent); }
.about h1 {
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.05; letter-spacing: -.022em; font-weight: 500;
  margin: 0 0 24px;
}
.about h1 .ital { font-family: var(--font-serif); font-style: italic; font-weight: 400; }
.about-bio { font-size: 18px; line-height: 1.7; color: var(--ink); max-width: 56ch; }
.about-bio p { margin: 0 0 1.4em; }
.about-bio p:last-child { margin-bottom: 0; }
.about-bio em { font-family: var(--font-serif); font-style: italic; font-size: 1.08em; }
.about-bio strong { font-weight: 600; }
.about-bio .marker {
  background: linear-gradient(180deg, transparent 60%, var(--accent-soft) 60%, var(--accent-soft) 92%, transparent 92%);
  padding: 0 .12em;
}

.about-section { margin-top: 56px; }
.about-section h2 {
  font-family: var(--font-mono); font-size: 11.5px;
  font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-faint);
  margin: 0 0 20px;
  display: flex; align-items: center; gap: 12px;
}
.about-section h2::before { content: ""; width: 6px; height: 6px; background: var(--accent); border-radius: 50%; }
.about-section h2 .num { color: var(--accent); margin-left: auto; font-size: 10px; }

/* currently widget */
.currently {
  display: grid; grid-template-columns: 1fr; gap: 14px;
}
@media (min-width: 600px) { .currently { grid-template-columns: 1fr 1fr; } }
.currently-card {
  border: 1px solid var(--rule); border-radius: 4px;
  padding: 16px 18px;
  background: var(--paper);
  display: flex; flex-direction: column; gap: 6px;
}
.currently-card .k {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--ink-faint); letter-spacing: .08em; text-transform: uppercase;
}
.currently-card .v { font-size: 16px; line-height: 1.4; color: var(--ink); }
.currently-card .v .ital { font-family: var(--font-serif); font-style: italic; font-size: 1.1em; }
.currently-card .v .meta { display: block; font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint); margin-top: 4px; }

/* stack table */
.stack-grid {
  display: grid;
  grid-template-columns: 1fr;
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
  background: var(--paper);
}
.stack-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-mono); font-size: 12.5px;
}
.stack-row:last-child { border-bottom: 0; }
.stack-row > div { padding: 12px 16px; }
.stack-row .k {
  background: color-mix(in oklab, var(--rule) 30%, var(--paper));
  color: var(--ink-soft); text-transform: uppercase; letter-spacing: .06em; font-size: 10.5px;
}
.stack-row .v { color: var(--ink); }
.stack-row .v .accent { color: var(--accent); }
.stack-row .v .strike { text-decoration: line-through; color: var(--ink-faint); }

/* talks list */
.talks {
  display: flex; flex-direction: column;
  border-top: 1px solid var(--rule);
}
.talk {
  display: grid;
  grid-template-columns: 84px 1fr auto;
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}
.talk .when {
  font-family: var(--font-mono); font-size: 11.5px;
  color: var(--ink-faint);
}
.talk .ttl { font-size: 16px; font-weight: 500; }
.talk .ttl .ital { font-family: var(--font-serif); font-style: italic; font-weight: 400; font-size: 1.05em; }
.talk .ttl .where { display: block; font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-faint); margin-top: 4px; }
.talk .lnk {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--accent); letter-spacing: .04em;
  cursor: pointer;
}
.talk .lnk:hover { background: var(--accent-soft); }

/* values panel */
.values {
  border: 1px solid var(--ink);
  background: var(--paper);
  padding: 28px 30px;
  border-radius: 4px;
  box-shadow: var(--shadow-pop);
}
.values ol {
  list-style: none; counter-reset: v; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 14px;
}
.values li {
  counter-increment: v;
  display: grid; grid-template-columns: 32px 1fr; gap: 12px;
  align-items: baseline;
}
.values li::before {
  content: counter(v, decimal-leading-zero);
  font-family: var(--font-mono); font-size: 11px;
  color: var(--accent); font-weight: 600;
  letter-spacing: .04em;
}
.values li b { grid-column: 2; font-weight: 600; color: var(--ink); display: block; margin-bottom: 4px; }
.values li span { grid-column: 2; color: var(--ink-soft); font-size: 15.5px; line-height: 1.5; }
.values li span em { font-family: var(--font-serif); font-style: italic; font-size: 1.06em; color: var(--ink); }

/* contact strip */
.contacts {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px;
}
.contact {
  font-family: var(--font-mono); font-size: 12px;
  padding: 8px 14px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  cursor: pointer;
  transition: all .15s;
  display: inline-flex; align-items: center; gap: 8px;
}
.contact:hover { border-color: var(--ink); background: var(--paper); }
.contact .at { color: var(--accent); }

/* ─── responsive ─── */
@media (max-width: 768px) {
  :root {
    --pad: 20px;
  }

  /* topbar */
  .topbar-inner { flex-wrap: wrap; gap: 8px; padding: 12px var(--pad); }
  .nav { gap: 14px; }
  .nav-meta { display: none; }

  /* hero */
  .hero h1 { font-size: clamp(32px, 8vw, 52px); max-width: none; }
  .hero-sub { font-size: 16px; }
  .hero-content { padding: clamp(24px, 4vh, 40px) 0; }
  [data-hero="banner"] .hero,
  [data-hero="backdrop"] .hero {
    min-height: clamp(400px, 60vh, 560px);
  }

  /* status card */
  .status-card { font-size: 10.5px; gap: 4px 12px; padding: 12px 16px; }

  /* section headers */
  .section-h { margin: 40px 0 16px; font-size: 10.5px; gap: 10px; }
  .section-h .meta { display: none; }

  /* featured */
  .featured { padding: 24px; gap: 20px; }
  .featured h2 { font-size: clamp(24px, 5vw, 36px); }
  .featured-art { display: none; }
  .featured-meta { font-size: 10px; gap: 8px; }

  /* post list */
  .post-row { grid-template-columns: 1fr; gap: 4px; padding: 16px 8px; }
  .post-date { font-size: 10px; }
  .post-arrow { display: none; }

  /* newsletter */
  .newsletter { padding: 24px; grid-template-columns: 1fr; gap: 20px; }
  .newsletter h3 { font-size: 22px; }
  .newsletter-input-wrap { flex-direction: column; }
  .newsletter-button { padding: 14px; }

  /* article */
  .article-wrap { padding: 32px 0 24px; }
  .article h1 { font-size: clamp(28px, 6vw, 42px); }
  .article-deck { font-size: clamp(17px, 2vw, 22px); }
  .article-meta-row { grid-template-columns: 1fr 1fr; }
  .article-header { margin-bottom: 36px; }
  .prose { font-size: 16px; line-height: 1.65; }
  .prose h2 { font-size: 22px; }
  .codeblock { font-size: 11px; }
  .codeblock pre { padding: 14px 16px; }
  .diagram { font-size: 10px; padding: 20px 16px; }
  .aside { flex-direction: column; gap: 8px; padding: 16px 18px; }
  .article-end-nav { grid-template-columns: 1fr; }

  /* about */
  .about-wrap { padding: 32px 0 24px; }
  .about-grid { gap: 32px; }
  .about-photo { max-width: 240px; }
  .about h1 { font-size: clamp(32px, 8vw, 52px); }
  .about-bio { font-size: 16px; }
  .about-section { margin-top: 40px; }
  .stack-row { grid-template-columns: 100px 1fr; font-size: 11.5px; }
  .values { padding: 20px 22px; }
  .values li { grid-template-columns: 24px 1fr; gap: 8px; }
  .values li span { font-size: 14px; }
  .contacts { gap: 6px; }
  .contact { font-size: 11px; padding: 6px 12px; }

  /* footer */
  .foot { margin-top: 56px; padding: 28px var(--pad) 40px; }
  .foot-inner { grid-template-columns: 1fr; gap: 24px; }
}
