/* Abhi — site styles. Shared by every page.
   Layout: a white (or black, in dark mode) page with a slab-serif voice, mustard as the one accent,
   hand-drawn doodles for warmth, and plain cards for anything you can click. */
:root {
  --paper: #ffffff;
  --paper-2: #f6f5f1;
  --ink: #121212;
  --muted: #5f5e59;
  --line: #e5e3dc;
  --accent: #a87412;          /* mustard, dark enough for text on white */
  --accent-fill: #e1a83a;     /* mustard for fills and the toggle */
  --mark: #ffd84d;            /* highlighter */
  --blue: #23408f;
  --blue-soft: #e8edfa;
  --ok: #17734c; --ok-soft: #e3f3ea;
  --warn: #9a5800; --warn-soft: #fbefdc;
  --card: #ffffff;
  --shadow: 0 1px 2px rgba(18,18,18,.05), 0 10px 30px rgba(18,18,18,.07);

  --slab: "Zilla Slab", "Rockwell", "Roboto Slab", Georgia, serif;
  --body: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;

  --wide: 1140px;
  --measure: 66ch;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121316; --paper-2: #181a1e; --ink: #eeede9; --muted: #a6a6a1; --line: #2c2e33;
    --accent: #e8b24f; --accent-fill: #dca23a; --mark: #6e5612; --blue: #a8bcf5; --blue-soft: #1c2335;
    --ok: #71d3a4; --ok-soft: #13271e; --warn: #f0b45e; --warn-soft: #2b2216; --card: #1b1d21;
    --shadow: 0 1px 2px rgba(0,0,0,.5), 0 10px 30px rgba(0,0,0,.4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #121316; --paper-2: #181a1e; --ink: #eeede9; --muted: #a6a6a1; --line: #2c2e33;
  --accent: #e8b24f; --accent-fill: #dca23a; --mark: #6e5612; --blue: #a8bcf5; --blue-soft: #1c2335;
  --ok: #71d3a4; --ok-soft: #13271e; --warn: #f0b45e; --warn-soft: #2b2216; --card: #1b1d21;
  --shadow: 0 1px 2px rgba(0,0,0,.5), 0 10px 30px rgba(0,0,0,.4);
  color-scheme: dark;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 1.0625rem/1.65 var(--body);
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s ease, color .3s ease;
}
.page { padding-inline: 20px; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-family: var(--slab); font-weight: 600; line-height: 1.08; margin: 0; text-wrap: balance; }
p { margin: 0; }
.wrap { max-width: var(--wide); margin-inline: auto; }
.label { font: 500 .74rem/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.mark { background: linear-gradient(transparent 58%, var(--mark) 58%, var(--mark) 92%, transparent 92%); padding-inline: .06em; }
.hand { font-family: var(--hand); font-weight: 700; color: var(--accent); }
.muted { color: var(--muted); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: var(--ink); color: var(--paper); padding: 8px 12px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* ---------- header ---------- */
.site-head {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 12px 20px;
}
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.logo { display: flex; align-items: center; gap: 10px; font: 700 1.35rem var(--slab); color: var(--ink); text-decoration: none; }
.logo .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent-fill); }
.nav { display: flex; align-items: center; gap: 2px; }
.nav a { color: var(--muted); text-decoration: none; font-size: .95rem; padding: 7px 11px; border-radius: 7px; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); background: var(--paper-2); }
.theme-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--ink); display: grid; place-items: center; cursor: pointer; margin-left: 6px; }
.theme-btn svg { width: 18px; height: 18px; }
.theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: block; }
:root[data-theme="dark"] .theme-btn .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .sun { display: block; }
  :root:not([data-theme="light"]) .theme-btn .moon { display: none; }
}
@media (max-width: 640px) { .nav a.opt { display: none; } .nav a { padding: 7px 8px; } }

/* ---------- buttons, chips ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 999px; font: 600 .95rem var(--body); text-decoration: none; border: 1.5px solid var(--ink); cursor: pointer; transition: transform .15s ease, background-color .2s ease, color .2s ease; }
.btn:hover { transform: translateY(-2px); }
.btn-solid { background: var(--ink); color: var(--paper); }
.btn-solid:hover { background: var(--accent-fill); border-color: var(--accent-fill); color: #121212; }
.btn-line { background: transparent; color: var(--ink); }
.btn-line:hover { background: var(--ink); color: var(--paper); }
.btn svg { width: 16px; height: 16px; }
.chip { font: 500 .72rem var(--mono); padding: 3px 8px; border-radius: 5px; border: 1px solid var(--line); color: var(--muted); }
.state { font: 500 .72rem var(--mono); padding: 3px 9px; border-radius: 999px; justify-self: start; }
.state.live { color: var(--ok); background: var(--ok-soft); }
.state.next { color: var(--warn); background: var(--warn-soft); }
.state.done { color: var(--blue); background: var(--blue-soft); }

/* ---------- sections ---------- */
.section { padding-block: 96px; }
.section.alt { background: var(--paper-2); margin-inline: -20px; padding-inline: 20px; }
@media (max-width: 720px) { .section { padding-block: 60px; } }
.section-title { font-size: clamp(2.2rem, 5vw, 3.6rem); }
.section-lede { color: var(--muted); max-width: 60ch; margin-top: 14px; font-size: 1.08rem; }
.head-row { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 40px; }

/* ---------- loader (home page only) ---------- */
.loader {
  position: fixed; inset: 0; z-index: 90; background: var(--paper);
  display: grid; place-items: center; gap: 0;
  animation: loader-out .55s ease 1.9s forwards;
}
.loader-inner { display: grid; justify-items: center; gap: 18px; }
.loader svg { width: 220px; height: 120px; overflow: visible; }
.loader .doc { animation: doc-in 1.2s cubic-bezier(.5,0,.3,1) both; }
.loader .doc.d2 { animation-delay: .15s; }
.loader .doc.d3 { animation-delay: .3s; }
.loader .lens { animation: lens-pulse 1.2s ease-in-out .4s both; transform-box: fill-box; transform-origin: center; }
.loader .tick { stroke-dasharray: 40; stroke-dashoffset: 40; animation: tick .4s ease 1.35s forwards; }
.loader-steps { font: 500 .8rem var(--mono); letter-spacing: .06em; color: var(--muted); height: 1.3em; overflow: hidden; text-align: center; }
.loader-steps span { display: block; animation: steps 1.6s steps(1) both; }
.loader-steps span:nth-child(1) { animation-name: s1; }
.loader-steps span:nth-child(2) { animation-name: s2; }
.loader-steps span:nth-child(3) { animation-name: s3; }
.loader-steps { position: relative; width: 260px; }
.loader-steps span { position: absolute; inset: 0; opacity: 0; }
@keyframes s1 { 0%, 40% { opacity: 1; } 41%, 100% { opacity: 0; } }
@keyframes s2 { 0%, 40% { opacity: 0; } 41%, 80% { opacity: 1; } 81%, 100% { opacity: 0; } }
@keyframes s3 { 0%, 80% { opacity: 0; } 81%, 100% { opacity: 1; } }
@keyframes doc-in { from { transform: translateX(-90px); opacity: 0; } 60% { opacity: 1; } to { transform: translateX(0); opacity: 1; } }
@keyframes lens-pulse { 0% { transform: scale(.6); opacity: 0; } 50% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
@keyframes tick { to { stroke-dashoffset: 0; } }
@keyframes loader-out { to { opacity: 0; visibility: hidden; transform: translateY(-12px); } }
.loader.gone { display: none; }

/* ---------- custom cursor (mouse only) ---------- */
@media (pointer: fine) {
  body.has-cursor, body.has-cursor a, body.has-cursor button, body.has-cursor [role="switch"] { cursor: none; }
  body.has-cursor input, body.has-cursor textarea { cursor: text; }
}
.cursor-dot, .cursor-ring { position: fixed; left: 0; top: 0; pointer-events: none; z-index: 100; border-radius: 50%; }
.cursor-dot { width: 8px; height: 8px; margin: -4px 0 0 -4px; background: var(--accent-fill); }
.cursor-ring { width: 38px; height: 38px; margin: -19px 0 0 -19px; border: 1.5px dashed var(--ink); transition: width .2s ease, height .2s ease, margin .2s ease, background-color .2s ease, border-color .2s ease; }
.cursor-ring.hover { width: 64px; height: 64px; margin: -32px 0 0 -32px; border-style: solid; border-color: var(--accent-fill); background: color-mix(in srgb, var(--accent-fill) 18%, transparent); }
.cursor-ring.down { width: 28px; height: 28px; margin: -14px 0 0 -14px; }

/* ---------- hero ---------- */
.hero { text-align: center; padding-top: 72px; overflow: hidden; }
.hero .tagline { font: 500 clamp(1.05rem, 2.2vw, 1.35rem) var(--slab); color: var(--muted); }
.hero h1 { font-size: clamp(3.2rem, 11vw, 8.6rem); font-weight: 600; letter-spacing: -0.02em; margin-top: 10px; line-height: 1; }
.hero .name { font: 500 clamp(1.1rem, 2.4vw, 1.5rem) var(--body); letter-spacing: .32em; color: var(--accent); margin-top: 18px; text-transform: uppercase; }
.hero .name span { color: var(--muted); letter-spacing: .08em; font-size: .7em; text-transform: none; display: block; margin-top: 6px; }
.toon-stage { position: relative; width: min(440px, 92vw); margin: 34px auto 0; }
.toon-stage .disc { position: absolute; left: 50%; bottom: 0; width: 86%; aspect-ratio: 1; transform: translate(-50%, 18%); border-radius: 50%; background: var(--accent-fill); opacity: .9; }
.toon { position: relative; width: 100%; height: auto; display: block; }
.toon .eyes { transform-box: fill-box; transform-origin: center; animation: blink 4.6s infinite; }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 95%, 97% { transform: scaleY(.08); } }
.toon .head { transform-box: fill-box; transform-origin: 50% 90%; animation: bob 6s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(-1.6deg); } }
.hero-note { position: absolute; font-family: var(--hand); font-weight: 700; color: var(--accent); font-size: 1.5rem; line-height: 1.05; text-align: left; }
.hero-note.n1 { left: -170px; top: 30%; transform: rotate(-8deg); }
.hero-note.n2 { right: -170px; top: 52%; transform: rotate(6deg); }
.hero-note svg { width: 70px; height: 34px; display: block; }
@media (max-width: 900px) { .hero-note { display: none; } }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 28px; }

/* ---------- who am I ---------- */
.who-head { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.switch { position: relative; width: 112px; height: 60px; border-radius: 999px; border: 0; padding: 0; background: #9c9c98; cursor: pointer; transition: background-color .3s ease; box-shadow: inset 0 2px 6px rgba(0,0,0,.25); }
.switch .knob { position: absolute; top: 6px; left: 6px; width: 48px; height: 48px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3); transition: transform .3s cubic-bezier(.4,1.4,.6,1); }
.switch .ring { position: absolute; top: 18px; left: 20px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid rgba(0,0,0,.45); opacity: 0; transition: opacity .3s ease; }
.switch[aria-checked="true"] { background: var(--accent-fill); }
.switch[aria-checked="true"] .knob { transform: translateX(52px); }
.switch[aria-checked="true"] .ring { opacity: 1; }
.switch-label { font-family: var(--hand); font-weight: 700; font-size: 1.5rem; color: var(--accent); transform: rotate(-4deg); }
.who-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; margin-top: 48px; font-size: 1.15rem; line-height: 1.75; }
.who-cols p:nth-child(2) { margin-top: 120px; }
.who-cols p:nth-child(3) { margin-top: 240px; }
@media (max-width: 900px) { .who-cols { grid-template-columns: minmax(0, 1fr); gap: 22px; } .who-cols p:nth-child(n) { margin-top: 0; } }
.who-cols .x { transition: color .35s ease, text-decoration-color .35s ease; text-decoration: line-through transparent; text-decoration-thickness: 1.5px; }
.tldr .who-cols .x { color: color-mix(in srgb, var(--muted) 55%, transparent); text-decoration-color: currentColor; }
.who-photo { display: flex; align-items: center; gap: 18px; margin-top: 56px; }
.who-photo img { width: 96px; height: 96px; }
.who-photo p { font-family: var(--hand); font-size: 1.5rem; font-weight: 700; color: var(--accent); line-height: 1.1; transform: rotate(-2deg); }

/* ---------- logos & experience ---------- */
.logo-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .logo-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px) { .logo-strip { grid-template-columns: minmax(0, 1fr); } }
.xp { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px; display: grid; gap: 10px; align-content: start; transition: transform .2s ease, box-shadow .2s ease; }
.xp:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.xp .logo-slot { height: 56px; display: flex; align-items: center; }
.xp .logo-slot img { max-height: 48px; width: auto; max-width: 160px; object-fit: contain; }
.xp .logo-slot img.invert-dark { }
:root[data-theme="dark"] .xp .logo-slot img.invert-dark { filter: invert(1) hue-rotate(180deg); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .xp .logo-slot img.invert-dark { filter: invert(1) hue-rotate(180deg); } }
.wordmark { font: 700 1.35rem/1 var(--slab); letter-spacing: -.01em; }
.xp .role { font-weight: 600; }
.xp .when { font: 500 .78rem var(--mono); color: var(--muted); }
.xp p { font-size: .93rem; color: var(--muted); }
.xp .badge { font-family: var(--hand); font-weight: 700; font-size: 1.15rem; color: var(--accent); }

/* ---------- project & post cards ---------- */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
@media (max-width: 960px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .cards { grid-template-columns: minmax(0, 1fr); } }
.card { display: grid; grid-template-rows: auto 1fr; background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; color: var(--ink); text-decoration: none; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: var(--ink); }
.card .thumb { aspect-ratio: 16 / 10; background: var(--paper-2); border-bottom: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.card .thumb svg { width: 62%; height: auto; max-height: 82%; }
.card .body { padding: 20px 20px 22px; display: grid; gap: 10px; align-content: start; }
.card h3 { font-size: 1.45rem; }
.card p { color: var(--muted); font-size: .95rem; }
.card .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: space-between; }
.card .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.card .go { font: 600 .9rem var(--body); color: var(--accent); }
.empty { padding: 28px; border: 1.5px dashed var(--line); border-radius: 18px; color: var(--muted); text-align: center; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.filter { font: 500 .85rem var(--body); padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; }
.filter[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- comic ---------- */
.comic { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 900px) { .comic { grid-template-columns: minmax(0, 1fr); max-width: 460px; margin-inline: auto; } }
.panel { margin: 0; background: #fff; border: 2.5px solid #121212; border-radius: 6px; box-shadow: 6px 6px 0 var(--accent-fill); overflow: hidden; color: #121212; }
.panel svg { display: block; width: 100%; height: auto; }
.panel figcaption { border-top: 2.5px solid #121212; padding: 10px 14px; font-family: var(--hand); font-weight: 700; font-size: 1.3rem; line-height: 1.2; background: #fbf7ea; }
.panel figcaption b { color: #a87412; margin-right: 4px; }
.panel:nth-child(2) { transform: rotate(.7deg); }
.panel:nth-child(3) { transform: rotate(-.6deg); }

/* doodle strokes (comic panels are always on white, so they use fixed ink) */
.s-ink { fill: none; stroke: #121212; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.s-thin { fill: none; stroke: #121212; stroke-width: 1.5; stroke-linecap: round; }
.s-acc { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.f-white { fill: #ffffff; } .f-cream { fill: #fbf7ea; } .f-mark { fill: #ffd84d; } .f-ink { fill: #121212; }
.f-soft { fill: #e8edfa; } .f-mustard { fill: #e1a83a; }
.doodle { filter: url(#rough); overflow: visible; }
.t-hand { font-family: var(--hand); font-weight: 700; fill: #121212; }
.t-hand-acc { font-family: var(--hand); font-weight: 700; fill: #a87412; }

/* ---------- contact ---------- */
.contact { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 48px; align-items: center; }
@media (max-width: 900px) { .contact { grid-template-columns: minmax(0, 1fr); } }
.contact h2 { font-size: clamp(2.3rem, 5.4vw, 4rem); }
.contact p { color: var(--muted); margin-top: 16px; max-width: 50ch; font-size: 1.08rem; }
.email-box { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 10px 10px 16px; }
.email-box code { font: 500 .95rem var(--mono); user-select: all; overflow-wrap: anywhere; min-width: 0; flex: 1 1 240px; }
.copy { font: 600 .85rem var(--body); padding: 9px 16px; border-radius: 999px; border: 1.5px solid var(--ink); background: var(--ink); color: var(--paper); cursor: pointer; }
.links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--line); padding: 28px 20px 40px; color: var(--muted); font-size: .88rem; }
.site-foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.site-foot a { color: var(--muted); }

/* ---------- inner pages ---------- */
.page-hero { padding-block: 72px 40px; }
.page-hero h1 { font-size: clamp(2.6rem, 7vw, 5rem); }
.page-hero p { color: var(--muted); font-size: 1.15rem; max-width: 60ch; margin-top: 16px; }
.crumb { font: 500 .82rem var(--mono); color: var(--muted); text-decoration: none; display: inline-flex; gap: 8px; margin-bottom: 22px; }
.crumb:hover { color: var(--ink); }

/* article / project body */
.prose { max-width: 720px; margin-inline: auto; display: grid; gap: 20px; font-size: 1.08rem; }
.prose h2 { font-size: 1.8rem; margin-top: 18px; }
.prose ul { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; }
.prose blockquote { margin: 0; padding: 16px 20px; border-left: 4px solid var(--accent-fill); background: var(--paper-2); border-radius: 0 10px 10px 0; font: 500 1.2rem/1.45 var(--slab); }
.post-meta { font: 500 .82rem var(--mono); color: var(--muted); margin-top: 18px; }
.formula { font: 500 .95rem var(--mono); background: var(--paper-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; overflow-x: auto; white-space: nowrap; }
.tbl { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.tbl table { width: 100%; border-collapse: collapse; font-size: .94rem; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { text-align: left; padding: 11px 15px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th { font: 500 .72rem var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.pick td { background: color-mix(in srgb, var(--accent-fill) 18%, transparent); }
.post-art { border-radius: 18px; background: #fbf7ea; border: 2px solid #121212; display: grid; place-items: center; padding: 18px; margin-top: 28px; box-shadow: 6px 6px 0 var(--accent-fill); }
.post-art svg { height: 150px; width: auto; }
.post-end { max-width: 720px; margin: 48px auto 0; padding-top: 24px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; }

/* diagrams */
.diagram { margin: 4px 0 0; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px 16px 12px; }
.diagram .scroll { overflow-x: auto; }
.diagram svg { display: block; min-width: 720px; width: 100%; height: auto; }
.diagram figcaption { font-size: .86rem; color: var(--muted); margin-top: 10px; padding-inline: 4px; }
.d-box { fill: var(--paper-2); stroke: var(--line); stroke-width: 1.3; }
.d-box.accent { fill: color-mix(in srgb, var(--accent-fill) 22%, var(--card)); stroke: var(--accent-fill); }
.d-box.ok { fill: var(--ok-soft); stroke: var(--ok); }
.d-box.no { fill: var(--warn-soft); stroke: var(--warn); }
.d-text { fill: var(--ink); font: 500 13px var(--body); }
.d-small { fill: var(--muted); font: 500 10.5px var(--mono); letter-spacing: .04em; }
.d-line { stroke: var(--muted); stroke-width: 1.4; fill: none; }
.d-head { fill: var(--muted); }

/* project detail */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: minmax(0, 1fr); } }
.shot { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; box-shadow: var(--shadow); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.stat { padding: 20px 18px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; }
.stat .num { font: 600 2.3rem/1 var(--slab); font-variant-numeric: tabular-nums; }
.stat .what { font-size: .88rem; color: var(--muted); margin-top: 8px; line-height: 1.4; }
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stat:nth-child(3) { border-left: 0; } .stat:nth-child(n+3) { border-top: 1px solid var(--line); } }
.cases { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 760px) { .cases { grid-template-columns: minmax(0, 1fr); } }
.case { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px; display: grid; gap: 10px; align-content: start; }
.case .who { font: 500 .72rem var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.case h3 { font-size: 1.3rem; }
.case p { color: var(--muted); font-size: .95rem; }
.case .ex { border-left: 3px solid var(--accent-fill); padding-left: 12px; }
.case .ex b { color: var(--ink); }

/* ---------- minimal finish ---------- */
.toon-stage .disc { background: var(--accent-fill); opacity: 1; }
.section.alt { background: var(--paper-2); }
.btn-solid:hover { color: #141414; }
.toon-stage .disc { width: 96%; transform: translate(-50%, 6%); }

/* ---------- small-screen fixes ---------- */
/* grid columns must be allowed to shrink, so wide diagrams scroll inside their box instead of widening the page */
.prose { grid-template-columns: minmax(0, 1fr); }
.prose > * { min-width: 0; }
/* very small phones: the logo already links home, so drop "Home" and tighten the header */
@media (max-width: 400px) {
  .site-head { padding-inline: 14px; }
  .nav a[href$="index.html"]:not(.opt) { display: none; }
  .nav a { padding: 7px 7px; font-size: .9rem; }
  .theme-btn { width: 36px; height: 36px; margin-left: 2px; }
  .hero h1 { font-size: clamp(2.6rem, 14vw, 3.2rem); }
  .switch-label { font-size: 1.25rem; }
}
@media (max-width: 420px) { .email-box code { font-size: .8rem; } }
