/* ============================================================
   dvstronics.in — profile site
   Hand-written CSS. No framework, no build step.
   Edit the custom properties below to restyle the whole site.
   ============================================================ */

/* ── Design tokens ─────────────────────────────────────── */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
               "Liberation Mono", monospace;

  --wrap: 1120px;
  --radius: 14px;
  --radius-sm: 8px;

  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.075rem);
  --step-1: clamp(1.15rem, 1.08rem + 0.35vw, 1.35rem);
  --step-2: clamp(1.5rem, 1.32rem + 0.9vw, 2.1rem);
  --step-3: clamp(2.1rem, 1.6rem + 2.5vw, 3.6rem);

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark (default)
   Blue is the primary accent; the warm red (--accent-2) is deliberately
   rationed — brand mark, section rules, inline code, blockquotes. Every
   pairing below is checked for WCAG AA (worst case 4.79:1). */
[data-theme="dark"] {
  --bg:          #080b12;
  --bg-alt:      #0c1119;
  --surface:     #131a25;
  --surface-2:   #1a2331;
  --border:      #232e3f;
  --border-str:  #35435a;
  --text:        #e9edf4;
  --text-mid:    #a6b2c4;
  --text-dim:    #7b8798;
  --accent:      #5b9dff;
  --accent-str:  #82b4ff;
  --accent-dim:  rgba(91, 157, 255, 0.12);
  --accent-ink:  #04101f;
  --accent-2:    #ff7a70;
  --accent-2-dim: rgba(255, 122, 112, 0.12);
  --shadow:      0 1px 2px rgba(0,0,0,.45), 0 8px 24px rgba(0,0,0,.4);
  --shadow-lg:   0 2px 4px rgba(0,0,0,.45), 0 20px 48px rgba(0,0,0,.55);
  --grid-line:   rgba(110, 160, 255, 0.06);
}

/* Light */
[data-theme="light"] {
  --bg:          #ffffff;
  --bg-alt:      #f4f7fb;
  --surface:     #ffffff;
  --surface-2:   #eef2f8;
  --border:      #dde4ee;
  --border-str:  #bfcada;
  --text:        #0d1520;
  --text-mid:    #44515f;
  --text-dim:    #626e7e;
  --accent:      #1454bd;
  --accent-str:  #0f4fb0;
  --accent-dim:  rgba(20, 84, 189, 0.09);
  --accent-ink:  #ffffff;
  --accent-2:    #b32d3e;
  --accent-2-dim: rgba(179, 45, 62, 0.09);
  --shadow:      0 1px 2px rgba(16,24,40,.05), 0 6px 18px rgba(16,24,40,.07);
  --shadow-lg:   0 2px 6px rgba(16,24,40,.07), 0 18px 44px rgba(16,24,40,.12);
  --grid-line:   rgba(20, 84, 189, 0.07);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -0.02em; margin: 0; font-weight: 650; }
p { margin: 0 0 1em; }
img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-str); }

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

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 24px; }

/* Anchor targets must clear the sticky header. */
section[id], .prose h2[id], .prose h3[id] { scroll-margin-top: 88px; }
@media (max-width: 720px) { section[id], .prose h2[id], .prose h3[id] { scroll-margin-top: 118px; } }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--accent); color: var(--accent-ink);
  padding: 10px 18px; border-radius: 0 0 var(--radius-sm) 0; font-weight: 600;
}
.skip-link:focus { left: 0; }

/* ── Header ────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s var(--ease), background .25s var(--ease);
}
.site-header.is-stuck { border-bottom-color: var(--border); }

.header-inner {
  display: flex; align-items: center; gap: 20px;
  height: 66px;
}

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 650; letter-spacing: -0.02em; }
.brand:hover { color: var(--text); }
.brand-mark {
  width: 26px; height: 26px; flex: none; border-radius: 7px;
  background: linear-gradient(135deg, var(--accent) 15%, var(--accent-2) 115%);
  position: relative;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 7px;
  border: 2px solid var(--accent-ink); border-radius: 2px; opacity: .85;
}

.site-nav { margin-left: auto; display: flex; gap: 4px; }
.site-nav a {
  color: var(--text-mid); font-size: .93rem; font-weight: 500;
  padding: 8px 13px; border-radius: var(--radius-sm);
  transition: color .18s var(--ease), background .18s var(--ease);
}
.site-nav a:hover { color: var(--text); background: var(--surface-2); }

.theme-toggle {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text-mid);
  cursor: pointer;
  /* Named properties, not `all` — `all` animates the focus outline too,
     which delays the focus ring by the transition duration. */
  transition: color .18s var(--ease), border-color .18s var(--ease), background .18s var(--ease);
}
.theme-toggle:hover { color: var(--accent); border-color: var(--border-str); }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; }
[data-theme="dark"] .icon-sun  { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun  { display: none; }
[data-theme="light"] .icon-moon { display: block; }

/* On narrow screens the nav drops to its own scrollable row rather than
   disappearing — every section stays one tap away without a menu button. */
@media (max-width: 720px) {
  .header-inner {
    height: auto; padding-block: 10px 0;
    flex-wrap: wrap; row-gap: 2px;
  }
  .theme-toggle { margin-left: auto; }
  .site-nav {
    order: 3; width: 100%; margin-left: 0;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 8px; margin-inline: -4px;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { padding: 6px 12px; font-size: .88rem; white-space: nowrap; }
}

/* ── Hero ──────────────────────────────────────────────── */
.hero { position: relative; overflow: hidden; padding: clamp(48px, 7vw, 84px) 0 clamp(36px, 4.5vw, 56px); }

.hero-grid {
  position: absolute; inset: -1px 0 auto 0; height: 620px; pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 90% 68% at 50% 0%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 90% 68% at 50% 0%, #000 20%, transparent 78%);
}
.hero::before {
  content: ""; position: absolute; top: -220px; left: 50%; transform: translateX(-50%);
  width: 1100px; height: 520px; pointer-events: none;
  background:
    radial-gradient(ellipse 46% 100% at 34% 50%, var(--accent-dim), transparent 70%),
    radial-gradient(ellipse 38% 90% at 72% 55%, var(--accent-2-dim), transparent 72%);
  /* The ellipses do not reach full transparency before the element ends, which
     left a visible horizontal seam — especially on narrow screens. This fades
     the whole layer out well before its own bottom edge. */
  -webkit-mask-image: linear-gradient(#000 35%, transparent 92%);
  mask-image: linear-gradient(#000 35%, transparent 92%);
}

.hero-inner {
  position: relative;
  display: grid; grid-template-columns: minmax(0,1fr) auto; gap: clamp(32px, 6vw, 72px);
  align-items: center;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-mono); font-size: .78rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent);
  background: var(--accent-dim); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  padding: 5px 13px; border-radius: 100px; margin-bottom: 22px;
}
.eyebrow::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); }
  70%  { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.hero-name { font-size: var(--step-3); font-weight: 700; letter-spacing: -0.035em; margin-bottom: 6px; }
.hero-role {
  font-size: var(--step-1); font-weight: 550; color: var(--accent);
  margin-bottom: 18px; letter-spacing: -0.015em;
}
.hero-tagline { font-size: var(--step-1); color: var(--text-mid); max-width: 34ch; margin-bottom: 20px; line-height: 1.55; }

.hero-meta { display: flex; flex-wrap: wrap; gap: 18px; color: var(--text-dim); font-size: .9rem; margin-bottom: 30px; }
.meta-item { display: inline-flex; align-items: center; gap: 7px; }
.meta-item svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 34px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px; border-radius: 10px;
  font-weight: 600; font-size: .95rem; letter-spacing: -0.01em;
  border: 1px solid transparent; cursor: pointer;
  transition: color .18s var(--ease), background .18s var(--ease),
              border-color .18s var(--ease), transform .18s var(--ease),
              box-shadow .18s var(--ease);
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-str); color: var(--accent-ink); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-sm { padding: 8px 15px; font-size: .85rem; min-height: 34px; margin-left: 6px; }
.btn-ghost { border-color: var(--border-str); color: var(--text); background: transparent; }
.btn-ghost:hover { color: var(--text); border-color: var(--accent); background: var(--accent-dim); }

/* Socials */
.socials { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 0; }
.socials a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 11px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-mid);
  transition: color .18s var(--ease), background .18s var(--ease),
              border-color .18s var(--ease), transform .18s var(--ease);
}
.socials a:hover {
  color: var(--accent); border-color: var(--accent);
  background: var(--accent-dim); transform: translateY(-2px);
}
.socials svg { width: 19px; height: 19px; fill: currentColor; }
.socials-lg a { width: 48px; height: 48px; }
.socials-lg svg { width: 21px; height: 21px; }

/* Avatar */
.hero-visual { display: grid; place-items: center; }
.avatar-frame {
  position: relative; width: clamp(180px, 26vw, 250px); aspect-ratio: 1;
  border-radius: 24px; overflow: hidden;
  border: 1px solid var(--border);
  background: linear-gradient(150deg, var(--surface), var(--surface-2));
  box-shadow: var(--shadow-lg);
  display: grid; place-items: center;
}
.avatar-frame::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 7%, transparent), transparent 55%);
}
.avatar-frame img { width: 100%; height: 100%; object-fit: cover; }
.avatar-frame img[hidden] { display: none; }
.avatar-fallback {
  position: absolute; font-size: clamp(3rem, 7vw, 4.6rem); font-weight: 700;
  letter-spacing: -0.04em; color: var(--accent); opacity: .9;
}

/* Stack the hero only when the viewport is genuinely narrow. At 860px this
   also caught phones in landscape (852px wide, ~390px tall), which pushed the
   name below the fold on a screen that had plenty of room beside the photo. */
@media (max-width: 760px) {
  .hero { padding-block: 32px clamp(28px, 4vw, 48px); }
  .hero-inner { grid-template-columns: 1fr; gap: 24px; }
  .hero-visual { order: -1; justify-items: start; }
  .avatar-frame { width: clamp(132px, 37vw, 190px); border-radius: 20px; }
  .hero-tagline { max-width: none; }
  .hero-meta { margin-bottom: 24px; }
  .hero-actions { margin-bottom: 26px; }
}

/* Short landscape viewports: claw back vertical space, and keep the photo
   beside the text rather than stacked on top of it wherever there is room. */
@media (orientation: landscape) and (max-height: 520px) {
  .hero { padding-block: 24px 20px; }
  .hero-actions { margin-bottom: 20px; }
}
@media (orientation: landscape) and (max-height: 520px) and (min-width: 600px) {
  .hero-inner { grid-template-columns: minmax(0, 1fr) auto; gap: 32px; }
  .hero-visual { order: 0; justify-items: center; }
  .avatar-frame { width: clamp(120px, 19vw, 180px); }
}

/* ── Sections ──────────────────────────────────────────── */
.section { padding: clamp(56px, 8vw, 96px) 0; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--border); }
.section-skills { padding-top: clamp(24px, 4vw, 40px); }

.section-title {
  display: flex; align-items: center; gap: 14px;
  font-size: .82rem; font-family: var(--font-mono); font-weight: 600;
  text-transform: uppercase; letter-spacing: .13em; color: var(--text-dim);
  margin-bottom: 14px;
}
.section-title .rule {
  width: 28px; height: 2px; flex: none; border-radius: 1px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.section-lede { color: var(--text-mid); max-width: 62ch; margin-bottom: 36px; font-size: var(--step-1); }

/* ── Skills ────────────────────────────────────────────── */
.skill-groups {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(198px, 100%), 1fr));
}
.skill-group {
  background: var(--surface); padding: 20px 22px;
  border: 1px solid var(--border); border-radius: var(--radius);
  transition: border-color .2s var(--ease);
}
.skill-group:hover { border-color: var(--border-str); }
.skill-group h3 {
  font-size: .78rem; font-family: var(--font-mono); text-transform: uppercase;
  letter-spacing: .1em; color: var(--accent); margin-bottom: 12px; font-weight: 600;
}
.skill-note {
  display: block; margin-top: 4px;
  font-family: var(--font-sans); font-size: .76rem; font-weight: 400;
  text-transform: none; letter-spacing: 0; color: var(--text-dim);
}
.skill-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  font-size: .82rem; line-height: 1.5; color: var(--text-mid);
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 3px 10px; border-radius: 100px;
  max-width: 100%; overflow-wrap: break-word;
}

/* ── Project grid ──────────────────────────────────────── */
.project-grid {
  display: grid; gap: 22px;
  /* min() keeps the track from forcing overflow on very narrow screens. */
  grid-template-columns: repeat(auto-fill, minmax(min(310px, 100%), 1fr));
}
.loading { color: var(--text-dim); font-family: var(--font-mono); font-size: .9rem; }

.card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  color: inherit; position: relative;
  transition: transform .22s var(--ease), border-color .22s var(--ease), box-shadow .22s var(--ease);
}
.card:hover {
  transform: translateY(-3px); border-color: var(--border-str);
  box-shadow: var(--shadow-lg); color: inherit;
}
.card-media {
  aspect-ratio: 16/9; background: var(--surface-2);
  border-bottom: 1px solid var(--border); overflow: hidden;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.card:hover .card-media img { transform: scale(1.035); }

.card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.card-year {
  font-family: var(--font-mono); font-size: .74rem; color: var(--text-dim);
  letter-spacing: .06em; margin-bottom: 7px;
}
.card-title { font-size: 1.12rem; margin-bottom: 8px; letter-spacing: -0.02em; }
.card:hover .card-title { color: var(--accent); }
.card-summary { color: var(--text-mid); font-size: .93rem; line-height: 1.6; margin-bottom: 16px; flex: 1; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.card-tags .chip { font-size: .75rem; }

.card-cta {
  margin-top: 16px; font-size: .87rem; font-weight: 600; color: var(--accent);
  display: inline-flex; align-items: center; gap: 6px;
}
.card-cta svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .2s var(--ease); }
.card:hover .card-cta svg { transform: translateX(3px); }

/* ── About / timeline ──────────────────────────────────── */
.about-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 64px); }
@media (max-width: 860px) { .about-layout { grid-template-columns: 1fr; } }

.side-title {
  font-size: .82rem; font-family: var(--font-mono); font-weight: 600;
  text-transform: uppercase; letter-spacing: .13em; color: var(--text-dim);
  margin-bottom: 22px; padding-top: 2px;
}

.timeline { position: relative; padding-left: 22px; }
.timeline::before {
  content: ""; position: absolute; left: 4px; top: 6px; bottom: 6px;
  width: 1px; background: var(--border);
}
.tl-item { position: relative; padding-bottom: 26px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: -22px; top: 7px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px var(--bg-alt);
}
.tl-item h4 { font-size: 1rem; margin-bottom: 5px; }
.tl-item p { color: var(--text-mid); font-size: .9rem; margin: 0; line-height: 1.6; }

/* ── Prose (rendered markdown) ─────────────────────────── */
.prose { color: var(--text-mid); max-width: 70ch; }
.prose > *:first-child { margin-top: 0; }
.prose p { margin: 0 0 1.15em; }
.prose h1, .prose h2, .prose h3, .prose h4 { color: var(--text); margin: 2em 0 .6em; }
.prose h2 { font-size: var(--step-2); letter-spacing: -0.025em; }
.prose h3 { font-size: var(--step-1); }
.prose h4 { font-size: 1.02rem; }
.prose ul, .prose ol { margin: 0 0 1.15em; padding-left: 1.35em; }
.prose li { margin-bottom: .45em; }
.prose li::marker { color: var(--accent); }
.prose strong { color: var(--text); font-weight: 640; }
.prose a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose img { border-radius: var(--radius); border: 1px solid var(--border); margin: 1.6em 0; width: 100%; }
.prose blockquote {
  margin: 1.6em 0; padding: 4px 0 4px 20px;
  border-left: 2px solid var(--accent-2); color: var(--text-mid); font-style: italic;
}
.prose code {
  font-family: var(--font-mono); font-size: .87em;
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 1px 6px; border-radius: 5px; color: var(--accent-2);
}
.prose pre {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px 18px;
  overflow-x: auto; margin: 1.5em 0; font-size: .88rem; line-height: 1.6;
}
.prose pre code { background: none; border: none; padding: 0; font-size: inherit; color: var(--text); }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2.4em 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.6em 0; font-size: .92rem; }
.prose th, .prose td { border: 1px solid var(--border); padding: 9px 13px; text-align: left; }
.prose th { background: var(--surface-2); color: var(--text); font-weight: 600; }

/* ── Contact ───────────────────────────────────────────── */
.section-contact {
  background: var(--bg-alt); border-top: 1px solid var(--border);
  position: relative; overflow: hidden;
}
.section-contact::before {
  content: ""; position: absolute; bottom: -260px; left: 50%; transform: translateX(-50%);
  width: 800px; height: 460px;
  background: radial-gradient(ellipse at center, var(--accent-dim), transparent 70%);
}
.contact-inner { position: relative; text-align: center; }
.contact-title { font-size: var(--step-2); margin-bottom: 12px; letter-spacing: -0.03em; }
.contact-lede { color: var(--text-mid); max-width: 56ch; margin: 0 auto 30px; }
.contact-lede p { margin: 0 0 .9em; }
.contact-lede p:last-child { margin-bottom: 0; }
.contact-lede a { text-decoration: underline; text-underline-offset: 3px; }
.contact-inner .socials { justify-content: center; }

/* ── Footer ────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--border); padding: 26px 0; background: var(--bg); }
.footer-inner {
  display: flex; flex-wrap: wrap; gap: 10px 24px;
  align-items: center; justify-content: space-between;
  color: var(--text-dim); font-size: .85rem;
}
.footer-inner p { margin: 0; }
.footer-note { font-family: var(--font-mono); font-size: .78rem; }

/* ── Project detail page ───────────────────────────────── */
.detail-head { padding: clamp(40px, 6vw, 68px) 0 clamp(24px, 3vw, 36px); position: relative; }
.back-link {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .88rem; font-weight: 550; color: var(--text-mid);
  margin: 0 0 22px -8px; padding: 6px 8px; min-height: 28px; border-radius: var(--radius-sm);
}
.back-link:hover { background: var(--surface-2); }
.back-link:hover { color: var(--accent); }
.back-link svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }

.detail-title { font-size: var(--step-2); letter-spacing: -0.032em; margin-bottom: 12px; max-width: 22ch; }
.detail-summary { color: var(--text-mid); font-size: var(--step-1); max-width: 60ch; margin-bottom: 20px; }
.detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 4px; }
.detail-hero {
  border-radius: var(--radius); border: 1px solid var(--border);
  overflow: hidden; margin-bottom: clamp(28px, 4vw, 44px); background: var(--surface-2);
}
.detail-hero img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }

.detail-layout { display: grid; grid-template-columns: minmax(0,1fr) 220px; gap: clamp(32px, 5vw, 60px); align-items: start; }
@media (max-width: 900px) { .detail-layout { grid-template-columns: 1fr; } .toc { display: none; } }

.toc { position: sticky; top: 92px; }
.toc h4 {
  font-size: .74rem; font-family: var(--font-mono); text-transform: uppercase;
  letter-spacing: .12em; color: var(--text-dim); margin-bottom: 12px;
}
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.toc li a {
  display: block; padding: 6px 0 6px 14px; margin-left: -1px;
  border-left: 1px solid transparent;
  color: var(--text-dim); font-size: .87rem; line-height: 1.45;
}
.toc li a:hover, .toc li a.active { color: var(--accent); border-left-color: var(--accent); }

.detail-nav {
  border-top: 1px solid var(--border); margin-top: clamp(40px, 6vw, 64px); padding-top: 28px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.detail-nav a { font-weight: 600; font-size: .95rem; display: inline-flex; align-items: center; gap: 8px; }
.detail-nav span { display: block; font-size: .74rem; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--text-dim); font-weight: 500; margin-bottom: 3px; }

.notice {
  border: 1px solid var(--border); background: var(--surface);
  border-radius: var(--radius); padding: 26px; color: var(--text-mid);
}
.notice code { font-family: var(--font-mono); font-size: .87em; background: var(--surface-2); padding: 1px 6px; border-radius: 5px; }

/* ── Reveal on scroll ────────────────────────────────────
   The hidden state is only applied when JS has confirmed it can
   un-hide again (html[data-anim="on"]). Without JS, with an old
   browser, or if the observer never fires, content stays visible. */
[data-anim="on"] .reveal {
  opacity: 0; transform: translateY(14px);
  transition: opacity .55s var(--ease), transform .55s var(--ease);
}
[data-anim="on"] .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  [data-anim="on"] .reveal { opacity: 1; transform: none; }
}

/* ── Print ─────────────────────────────────────────────── */
@media print {
  .site-header, .theme-toggle, .hero-actions, .socials, .site-footer, .toc { display: none !important; }
  body { background: #fff; color: #000; }
  .section { padding: 16px 0; }
}
