/* Case File — dossier theme for the blog.
   Ported from "Blog Concepts.dc.html" direction 1a. Tokens match the portfolio. */

:root {
  /* Must match the portfolio's active theme (its `accent` prop default, currently
     "Red" -> data-theme="red"). The design concept file shipped Amber as its :root,
     which is how these drifted apart. Swap all three together to change theme.

       Red    0.62 0.21 25   / 0.71 0.20 25   / ink #1f0707   <- active
       Amber  0.82 0.13 75   / 0.86 0.10 75   / ink #1a1400
       Cyan   0.74 0.12 220  / 0.83 0.11 210  / ink #04161c
       Green  0.80 0.17 150  / 0.86 0.16 150  / ink #03160b                        */
  --accentC: 0.62 0.21 25;
  --accentBrightC: 0.71 0.20 25;
  --accentInk: #1f0707;

  --ground: #0A0A0B;
  --ink: #E8E6E1;
  --ink-bright: #FAF8F3;
  --ink-mid: #C9C6C0;
  --ink-dim: #9C9990;
  --ink-body: #A09D96;
  --ink-faint: #7A7873;
  --ink-ghost: #56544f;

  --rule: rgba(255, 255, 255, .1);
  --rule-soft: rgba(255, 255, 255, .07);

  --sans: 'Space Grotesk', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;

  --gutter: clamp(24px, 4vw, 44px);
}

* { box-sizing: border-box; }

/* Author-declared `display` beats the UA sheet's [hidden] rule, so an element
   with `display: grid` (.entry) stays visible when JS sets hidden. The filter
   chips depend on this working. */
[hidden] { display: none !important; }

/* A single unbroken token (long URL, hash, package name) is the usual cause of
   horizontal page scroll. Break it rather than let it push the layout wide. */
.entry__title,
.post-head__title,
.index-head__title,
.rail__list a,
.pager__title,
.article p,
.article li,
.article h2,
.article h3 { overflow-wrap: break-word; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; }

/* ---------- chrome ---------- */

.statusbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 10px var(--gutter);
  border-bottom: 1px solid var(--rule);
  font: 500 11px/1 var(--mono);
  letter-spacing: .06em;
  color: var(--ink-faint);
  background: rgba(10, 10, 11, .86);
  backdrop-filter: blur(10px);
}

.statusbar__live { display: flex; align-items: center; gap: 9px; min-width: 0; }
.statusbar__path { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.statusbar__dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: oklch(var(--accentC));
  box-shadow: 0 0 10px oklch(var(--accentC));
}

.masthead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px var(--gutter);
  border-bottom: 1px solid var(--rule-soft);
}

.masthead__logo { height: 26px; width: auto; display: block; }

.masthead__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px clamp(12px, 2.2vw, 26px);
  font: 500 11px/1 var(--mono);
  letter-spacing: .03em;
  color: #8a8884;
}

.masthead__nav a:hover { color: var(--ink-mid); }
.masthead__nav .is-current { color: oklch(var(--accentBrightC)); }

/* ---------- index ---------- */

.shell { max-width: 1180px; margin: 0 auto; }

.index-head { padding: clamp(32px, 4vw, 56px) var(--gutter) 40px; }

.kicker {
  font: 500 11px/1 var(--mono);
  letter-spacing: .14em;
  color: oklch(var(--accentBrightC));
  margin-bottom: 22px;
}

.index-head__title {
  margin: 0 0 18px;
  font: 700 clamp(38px, 5.5vw, 62px)/0.98 var(--sans);
  letter-spacing: -.03em;
  color: var(--ink-bright);
}

.index-head__blurb {
  margin: 0 0 30px;
  font: 400 16px/1.65 var(--sans);
  color: var(--ink-dim);
  max-width: 560px;
}

.chips { display: flex; gap: 8px; flex-wrap: wrap; }

.chip {
  font: 500 11px/1 var(--mono);
  letter-spacing: .04em;
  padding: 8px 15px;
  border-radius: 3px;
  background: transparent;
  color: #9b988f;
  border: 1px solid rgba(255, 255, 255, .16);
  cursor: pointer;
  transition: color .15s, border-color .15s;
}

.chip:hover { color: var(--ink-mid); border-color: rgba(255, 255, 255, .3); }

.chip.is-active {
  background: oklch(var(--accentBrightC));
  color: var(--accentInk);
  border-color: oklch(var(--accentBrightC));
}

.entries { padding: 0 var(--gutter) 48px; }

.entries__year {
  font: 500 11px/1 var(--mono);
  letter-spacing: .1em;
  color: var(--ink-ghost);
  padding: 22px 0 10px;
  border-bottom: 1px solid oklch(var(--accentC) / .3);
}

.entries__year:first-child { padding-top: 10px; }

.entry {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 22px;
  align-items: center;
  padding: 18px 8px;
  border-bottom: 1px solid var(--rule-soft);
  transition: background .15s;
}

.entry:hover { background: rgba(255, 255, 255, .025); }
.entry:hover .entry__title { color: oklch(var(--accentBrightC)); }

.entry__date { font: 500 12px/1 var(--mono); color: var(--ink-faint); }
.entry__title { font: 500 18px/1.3 var(--sans); color: var(--ink); transition: color .15s; }

.entry__tag {
  font: 500 10px/1 var(--mono);
  letter-spacing: .06em;
  color: oklch(var(--accentBrightC));
  border: 1px solid oklch(var(--accentC) / .3);
  padding: 5px 9px;
  border-radius: 2px;
  white-space: nowrap;
}

.entries__empty {
  padding: 28px 8px;
  font: 500 12px/1 var(--mono);
  letter-spacing: .06em;
  color: var(--ink-ghost);
}

/* ---------- post ---------- */

.post-head {
  padding: clamp(36px, 5vw, 64px) var(--gutter) 34px;
  border-bottom: 1px solid var(--rule);
}

.breadcrumb {
  font: 500 11px/1 var(--mono);
  letter-spacing: .06em;
  color: var(--ink-faint);
  margin-bottom: 22px;
}

.breadcrumb a { color: oklch(var(--accentBrightC)); }

.post-head__title {
  margin: 0 0 24px;
  font: 700 clamp(30px, 4.5vw, 52px)/1.04 var(--sans);
  letter-spacing: -.025em;
  color: var(--ink-bright);
  max-width: 900px;
}

.post-meta {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
  font: 500 11px/1 var(--mono);
  letter-spacing: .04em;
  color: #8a8884;
}

.post-meta b { font-weight: 500; color: var(--ink-mid); }
.post-meta .filed { color: oklch(var(--accentBrightC)); }

.post-body {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: clamp(28px, 4vw, 56px);
  padding: clamp(36px, 4vw, 52px) var(--gutter) 48px;
}

.rail {
  align-self: start;
  position: sticky;
  top: 96px;
  font: 500 11px/1.9 var(--mono);
  color: var(--ink-faint);
  border-left: 1px solid oklch(var(--accentC) / .4);
  padding-left: 18px;
}

.rail__label { letter-spacing: .06em; }
.rail__list { margin: 0 0 18px; }
.rail__list a { color: var(--ink-mid); display: block; }
.rail__list a:hover { color: var(--ink-bright); }
.rail__list a.is-active { color: oklch(var(--accentBrightC)); }
.rail__share a { color: var(--ink-mid); }
.rail__share a:hover { color: oklch(var(--accentBrightC)); }

/* article typography */

.article { max-width: 680px; min-width: 0; }

.article > p {
  margin: 0 0 18px;
  font: 400 16px/1.75 var(--sans);
  color: var(--ink-body);
}

.article > p:first-child {
  font: 400 clamp(18px, 2vw, 21px)/1.65 var(--sans);
  color: #E4E1DA;
  margin-bottom: 22px;
}

.article h2 {
  margin: 34px 0 14px;
  font: 600 24px/1.25 var(--sans);
  letter-spacing: -.01em;
  color: var(--ink-bright);
  scroll-margin-top: 96px;
}

.article h3 {
  margin: 28px 0 12px;
  font: 600 19px/1.3 var(--sans);
  color: var(--ink-bright);
  scroll-margin-top: 96px;
}

.article a { color: oklch(var(--accentBrightC)); border-bottom: 1px solid oklch(var(--accentC) / .35); }
.article a:hover { border-bottom-color: oklch(var(--accentC)); }

.article ul, .article ol { margin: 0 0 18px; padding-left: 22px; color: var(--ink-body); font: 400 16px/1.75 var(--sans); }
.article ul { list-style: disc; }
.article ol { list-style: decimal; }
.article li { margin-bottom: 7px; }

.article img { border-radius: 7px; border: 1px solid var(--rule); display: block; margin: 0 0 22px; }

.article blockquote {
  border-left: 2px solid oklch(var(--accentC));
  background: oklch(var(--accentC) / .06);
  padding: 16px 20px;
  border-radius: 0 6px 6px 0;
  margin: 0 0 22px;
}

.article blockquote > :last-child { margin-bottom: 0; }
.article blockquote p { font: 400 15px/1.6 var(--sans); color: var(--ink-mid); margin: 0 0 10px; }

/* code panel — the design's labelled bash block, emitted by build.ts */
.article .codepanel {
  background: #0E0D0F;
  border: 1px solid var(--rule);
  border-radius: 7px;
  overflow: hidden;
  margin: 0 0 22px;
}

.article .codepanel__bar {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  font: 500 10px/1 var(--mono);
  letter-spacing: .06em;
  color: var(--ink-faint);
}

.article .codepanel pre { border: 0; border-radius: 0; margin: 0; }

/* legacy rouge chrome (harmless for any pre-existing markup) */

.article pre.highlight,
.article > pre,
.article div.highlighter-rouge {
  background: #0E0D0F;
  border: 1px solid var(--rule);
  border-radius: 7px;
  overflow: hidden;
  margin: 0 0 22px;
}

.article div.highlighter-rouge pre.highlight,
.article figure.highlight pre {
  border: 0;
  border-radius: 0;
  margin: 0;
}

.article pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  font: 400 13px/1.7 var(--mono);
  color: var(--ink-mid);
}

.article :not(pre) > code {
  font: 400 .88em/1.4 var(--mono);
  color: oklch(var(--accentBrightC));
  background: rgba(255, 255, 255, .05);
  border-radius: 3px;
  padding: 2px 5px;
}

/* rouge tokens, tuned to the dossier palette */
.article .highlight .c, .article .highlight .c1, .article .highlight .cm { color: var(--ink-ghost); font-style: italic; }
.article .highlight .k, .article .highlight .kd, .article .highlight .kn { color: oklch(var(--accentBrightC)); }
.article .highlight .s, .article .highlight .s1, .article .highlight .s2 { color: #b9d8a5; }
.article .highlight .nb, .article .highlight .nf { color: #cfd7ea; }
.article .highlight .m, .article .highlight .mi { color: #e0b978; }

.article table { width: 100%; border-collapse: collapse; margin: 0 0 22px; font: 400 14px/1.6 var(--sans); color: var(--ink-body); display: block; overflow-x: auto; }
.article th, .article td { border: 1px solid var(--rule); padding: 9px 12px; text-align: left; }
.article th { color: var(--ink-mid); font: 500 11px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; }

.tagrow { margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--rule-soft); display: flex; gap: 8px; flex-wrap: wrap; }
.tagrow a { font: 500 10px/1 var(--mono); letter-spacing: .06em; color: var(--ink-faint); border: 1px solid var(--rule); padding: 6px 10px; border-radius: 2px; }
.tagrow a:hover { color: oklch(var(--accentBrightC)); border-color: oklch(var(--accentC) / .4); }

/* prev / next */

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--rule);
  border-top: 1px solid var(--rule);
}

.pager__cell { background: var(--ground); padding: 24px var(--gutter); }
.pager__cell--next { text-align: right; }
.pager__label { font: 500 10px/1 var(--mono); letter-spacing: .08em; color: var(--ink-ghost); margin-bottom: 8px; }
.pager__title { font: 500 16px/1.35 var(--sans); color: var(--ink-mid); }
.pager__cell a:hover .pager__title { color: oklch(var(--accentBrightC)); }

/* ---------- footer ---------- */

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 20px var(--gutter);
  border-top: 1px solid var(--rule);
  font: 500 11px/1.6 var(--mono);
  letter-spacing: .06em;
  color: var(--ink-ghost);
}

.footer a:hover { color: oklch(var(--accentBrightC)); }
.footer__social { display: flex; gap: 18px; }

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .post-body { grid-template-columns: 1fr; }
  .rail {
    position: static;
    border-left: 0;
    border-top: 1px solid oklch(var(--accentC) / .4);
    padding: 16px 0 0;
    order: 2;
  }
  .article { order: 1; max-width: none; }
}

@media (max-width: 620px) {
  .entry { grid-template-columns: 1fr auto; gap: 6px 14px; align-items: start; }
  .entry__date { grid-row: 2; align-self: center; }
  .entry__title { grid-column: 1 / -1; }
  .entry__tag { grid-row: 2; grid-column: 2; }
  .statusbar { font-size: 10px; }
  .masthead { flex-direction: column; align-items: flex-start; gap: 12px; }
  .pager { grid-template-columns: 1fr; }
  .pager__cell--next { text-align: left; }
}

/* ================================================================
   HOMEPAGE — apurvsinghgautam.me landing page (index.html)
   Same tokens as the blog above. Homepage keeps its own wider gutter
   (clamp(20px,5vw,72px) vs the blog's --gutter) since the two layouts
   are legitimately different rhythms — colors/fonts are what must
   never drift, spacing is allowed to differ by page.
   ================================================================ */

.site-root { background: var(--ground); color: var(--ink); font-family: var(--sans); min-height: 100vh; }

/* ---------- top status bar ---------- */
.site-statusbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px clamp(20px, 5vw, 72px);
  border-bottom: 1px solid var(--rule);
  font: 500 11px/1 var(--mono);
  letter-spacing: .06em;
  color: var(--ink-faint);
  background: rgba(10, 10, 11, .86);
  backdrop-filter: blur(10px);
}
.site-statusbar__live { display: flex; align-items: center; gap: 9px; }
.site-statusbar__dot { width: 7px; height: 7px; border-radius: 50%; background: oklch(var(--accentC)); box-shadow: 0 0 10px oklch(var(--accentC)); }
.site-statusbar__mid { display: none; }
.site-statusbar__mid b { color: oklch(var(--accentBrightC)); font-weight: 500; }
@media (min-width: 560px) { .site-statusbar__mid { display: block; } }

/* ---------- nav ---------- */
.site-nav {
  position: sticky; top: 31px; z-index: 19;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px clamp(20px, 5vw, 72px);
  background: rgba(10, 10, 11, .86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule-soft);
}
.site-nav__logo { height: 30px; width: auto; display: block; }
.site-nav__links { display: flex; gap: clamp(14px, 2vw, 30px); font: 500 12px/1 var(--mono); letter-spacing: .03em; color: #8a8884; }
.site-nav__links a:hover { color: oklch(var(--accentBrightC)); }
.site-nav__toggle {
  display: none; cursor: pointer; align-items: center; gap: 8px;
  font: 600 12px/1 var(--mono); letter-spacing: .08em; color: var(--ink-mid);
  border: 1px solid rgba(255, 255, 255, .18); border-radius: 6px; padding: 9px 13px;
  background: transparent;
}

/* ---------- hero ---------- */
.hero {
  padding: clamp(56px, 9vw, 96px) clamp(20px, 5vw, 72px) clamp(48px, 7vw, 76px);
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  position: relative; overflow: hidden;
}
.hero__glow {
  position: absolute; inset: 0;
  background: radial-gradient(900px 420px at 78% 18%, oklch(var(--accentC) / .10), transparent 70%);
  pointer-events: none;
}
.hero__kicker { position: relative; font: 500 12px/1 var(--mono); letter-spacing: .1em; color: oklch(var(--accentBrightC)); margin-bottom: 30px; }
.hero__title { position: relative; margin: 0; font: 700 clamp(48px, 9vw, 98px)/0.98 var(--sans); letter-spacing: -.03em; color: var(--ink-bright); }
.hero__grid { position: relative; display: grid; grid-template-columns: 1fr 290px; gap: 48px; margin-top: 42px; align-items: end; }
.hero__lede { margin: 0; font-size: clamp(16px, 1.7vw, 19px); line-height: 1.7; color: var(--ink-body); max-width: 640px; }
.hero__meta { font: 500 12px/1.85 var(--mono); color: var(--ink-faint); border-left: 1px solid oklch(var(--accentC) / .4); padding-left: 20px; }
.hero__meta b { color: var(--ink-mid); font-weight: 500; }
.hero__meta .is-active { color: oklch(var(--accentBrightC)); }
.hero__connect { position: relative; display: flex; gap: 12px; margin-top: 40px; align-items: center; flex-wrap: wrap; }
.hero__connect-label { font: 500 11px/1 var(--mono); letter-spacing: .12em; color: var(--ink-faint); margin-right: 4px; }
.hero__social {
  width: 46px; height: 46px; display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255, 255, 255, .16); border-radius: 7px; color: var(--ink-mid);
}
.hero__social:hover { border-color: oklch(var(--accentC) / .6); color: oklch(var(--accentBrightC)); background: oklch(var(--accentC) / .08); }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--rule); }
.stat { padding: clamp(24px, 3vw, 36px) clamp(18px, 3vw, 32px); border-right: 1px solid var(--rule); }
.stat:last-child { border-right: 0; }
.stat__num { font: 700 clamp(34px, 4.5vw, 48px)/1 var(--sans); letter-spacing: -.02em; color: var(--ink-bright); }
.stat__label { margin-top: 10px; font: 500 11px/1 var(--mono); letter-spacing: .05em; color: var(--ink-faint); }

/* ---------- section head (shared: MEDIA / PROJECTS / WRITING) ---------- */
.section-head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-top: clamp(36px, 5vw, 48px); margin-bottom: 30px; flex-wrap: wrap; gap: 12px;
}
.section-head__title-row { display: flex; gap: 9px; align-items: baseline; flex-wrap: wrap; }
.section-head__title { margin: 0; font: 500 13px/1 var(--mono); letter-spacing: .1em; color: oklch(var(--accentBrightC)); }
.section-head__sub { font: 500 13px/1 var(--mono); letter-spacing: .04em; color: #8a8884; }
.section-head__viewall { cursor: pointer; font: 500 12px/1 var(--mono); color: #8a8884; align-self: center; background: none; border: 0; }
.section-head__viewall:hover { color: oklch(var(--accentBrightC)); }

/* ---------- about ---------- */
.about { padding: clamp(48px, 6vw, 72px) clamp(20px, 5vw, 72px); }
.about__grid { display: grid; grid-template-columns: 160px 1fr 200px; gap: clamp(28px, 4vw, 48px); align-items: start; }
.about__label { margin: 0; font: 500 12px/1 var(--mono); letter-spacing: .1em; color: oklch(var(--accentBrightC)); }
.about__body p { margin: 0; font: 400 16px/1.75 var(--sans); color: var(--ink-dim); }
.about__body p + p { margin-top: 22px; }
.about__body p.about__body--long { color: var(--ink-dim); }
.about__body p.about__body--faint { color: #807d76; font-size: 15px; margin-top: 18px; }
.about__body a { color: #D4D1CA; border-bottom: 1px solid oklch(var(--accentC) / .5); }
.about__photo { border: 1px solid oklch(var(--accentC) / .25); border-radius: 4px; overflow: hidden; }
.about__photo img { width: 100%; display: block; filter: grayscale(.4) contrast(1.05); }

/* ---------- media ---------- */
.media { padding: 0 clamp(20px, 5vw, 72px) clamp(48px, 6vw, 64px); border-top: 1px solid var(--rule); }
.media__featured {
  display: grid; grid-template-columns: 380px 1fr; gap: 30px; padding: 18px;
  border: 1px solid oklch(var(--accentC) / .3); border-radius: 6px;
  background: linear-gradient(120deg, oklch(var(--accentC) / .07), transparent 60%);
  margin-bottom: 18px;
}
.media__featured:hover { border-color: oklch(var(--accentC) / .65); }
.media__featured-thumb { position: relative; border-radius: 4px; overflow: hidden; aspect-ratio: 16/9; }
.media__featured-thumb img { width: 100%; height: 100%; object-fit: cover; }
.media__featured-badge {
  position: absolute; left: 12px; top: 12px; font: 600 10px/1 var(--mono); letter-spacing: .1em;
  background: oklch(var(--accentC)); color: var(--accentInk); padding: 6px 10px; border-radius: 2px;
}
.media__featured-play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
}
.media__featured-play span {
  width: 54px; height: 54px; border-radius: 50%; background: rgba(10, 10, 11, .7);
  border: 1px solid rgba(255, 255, 255, .35); display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px;
}
.media__featured-body { align-self: center; }
.media__featured-meta { display: flex; gap: 10px; align-items: center; font: 600 11px/1 var(--mono); letter-spacing: .06em; color: oklch(var(--accentBrightC)); margin-bottom: 14px; flex-wrap: wrap; }
.media__featured-meta span.sep { color: #56544f; }
.media__featured-meta span.outlet { color: #8a8884; }
.media__featured-title { margin: 0; font: 700 clamp(20px, 2.4vw, 27px)/1.25 var(--sans); letter-spacing: -.01em; color: var(--ink-bright); }
.media__featured-desc { margin: 13px 0 0; font-size: 15px; line-height: 1.6; color: #908D86; }
.media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.media-card { border: 1px solid rgba(255, 255, 255, .1); border-radius: 6px; overflow: hidden; background: #111012; display: block; }
.media-card:hover { border-color: oklch(var(--accentC) / .5); }
.media-card__thumb { position: relative; aspect-ratio: 16/9; overflow: hidden; }
.media-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-card__badge {
  position: absolute; right: 10px; bottom: 10px; font: 600 9px/1 var(--mono); letter-spacing: .08em;
  background: rgba(10, 10, 11, .8); color: var(--ink); padding: 4px 7px; border-radius: 2px;
}
.media-card__body { padding: 16px 18px 20px; }
.media-card__meta { font: 600 10px/1 var(--mono); letter-spacing: .06em; color: oklch(var(--accentBrightC)); }
.media-card__title { margin-top: 10px; font: 600 17px/1.3 var(--sans); color: var(--ink); }

/* ---------- projects ---------- */
.projects { padding: 0 clamp(20px, 5vw, 72px) clamp(48px, 6vw, 64px); border-top: 1px solid var(--rule); }
.project-flagship {
  display: grid; grid-template-columns: 1fr 230px; gap: 36px; align-items: center;
  padding: clamp(26px, 3vw, 40px); border-radius: 8px;
  background: linear-gradient(135deg, #161416, #0e0d0f); border: 1px solid oklch(var(--accentC) / .3);
  margin-bottom: 18px;
}
.project-flagship:hover { border-color: oklch(var(--accentC) / .65); }
.project-flagship__title { margin: 0; font: 700 clamp(38px, 5vw, 54px)/1 var(--sans); letter-spacing: -.03em; color: var(--ink-bright); }
.project-flagship__desc { margin: 16px 0 0; font-size: clamp(15px, 1.6vw, 17px); line-height: 1.6; color: var(--ink-body); max-width: 560px; }
.project-flagship__side { display: flex; flex-direction: column; gap: 5px; align-items: flex-end; text-align: right; }
.project-flagship__stat { font: 700 clamp(30px, 4vw, 40px)/1 var(--sans); color: oklch(var(--accentBrightC)); }
.project-flagship__label { font: 500 11px/1.4 var(--mono); color: var(--ink-faint); letter-spacing: .04em; }
.project-flagship__link { margin-top: 14px; font: 600 11px/1 var(--mono); color: oklch(var(--accentBrightC)); }
.proj-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.proj-card { display: flex; flex-direction: column; padding: 26px 24px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 6px; background: #111012; }
.proj-card:hover { border-color: oklch(var(--accentC) / .5); }
.proj-card__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.proj-card__title { margin: 0; font: 600 20px/1.15 var(--sans); letter-spacing: -.01em; color: var(--ink); }
.proj-card__stars { font: 600 13px/1 var(--mono); color: oklch(var(--accentBrightC)); white-space: nowrap; }
.proj-card__desc { margin: 12px 0 0; font-size: 14px; line-height: 1.55; color: #807d76; }

/* ---------- experience / research / education ---------- */
.split { padding: 0 clamp(20px, 5vw, 72px) clamp(48px, 6vw, 64px); border-top: 1px solid var(--rule); display: grid; grid-template-columns: 1fr 1fr; gap: clamp(36px, 5vw, 56px); }
.split__heading { margin: 0 0 24px; font: 500 12px/1 var(--mono); letter-spacing: .1em; color: oklch(var(--accentBrightC)); padding-top: clamp(36px, 5vw, 48px); }
.split__heading--sub { margin: 36px 0 0; padding-top: 30px; border-top: 1px solid var(--rule); }
.exp-row { padding: 18px 0; border-bottom: 1px solid var(--rule-soft); }
.exp-row:last-child { border-bottom: 0; }
.exp-row__head { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.exp-company { font: 600 18px/1.2 var(--sans); color: var(--ink); }
.exp-company--current { color: var(--ink-bright); }
.exp-role { font: 400 14px/1.4 var(--sans); color: #908D86; }
.exp-date { font: 500 12px/1 var(--mono); color: var(--ink-faint); align-self: center; white-space: nowrap; }
.exp-date--current { font-size: 11px; color: oklch(var(--accentBrightC)); }
.exp-desc { margin: 11px 0 0; font: 400 13.5px/1.6 var(--sans); color: #8b8881; max-width: 97%; }
.research-item { display: block; padding: 16px 0; border-bottom: 1px solid var(--rule-soft); }
.research-item:first-child { padding-top: 0; }
.research-item:last-child { border-bottom: 0; }
.research-item:hover { opacity: .7; }
.research-item__title { font: 500 18px/1.35 var(--sans); color: var(--ink); }
.research-item__meta { margin-top: 7px; font: 500 11px/1 var(--mono); color: var(--ink-faint); }
.edu-list { margin-top: 18px; display: flex; flex-direction: column; gap: 14px; }
.edu-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.edu-school { font: 600 17px/1.2 var(--sans); color: var(--ink); }
.edu-degree { font: 400 13px/1.4 var(--sans); color: #908D86; }
.edu-country { font: 500 12px/1 var(--mono); color: var(--ink-faint); align-self: center; }

/* ---------- writing / blog teaser ---------- */
.blog-teaser { padding: 0 clamp(20px, 5vw, 72px) clamp(40px, 5vw, 56px); border-top: 1px solid var(--rule); }
.blog-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 clamp(28px, 4vw, 48px); }
.teaser-row {
  display: flex; justify-content: space-between; gap: 16px; padding: 16px 0;
  border-bottom: 1px solid var(--rule-soft);
}
.teaser-row:hover { background: rgba(255, 255, 255, .02); }
.teaser-row__title { font-size: 16px; color: #D4D1CA; }
.teaser-row__tag { font: 500 11px/1 var(--mono); color: oklch(var(--accentBrightC)); white-space: nowrap; align-self: center; }

/* ---------- modals (MEDIA "view all" / BLOG "view all") ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100; background: rgba(5, 5, 6, .84); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: clamp(14px, 4vw, 56px);
}
.modal-overlay[hidden] { display: none; }
.modal {
  width: min(920px, 100%); max-height: 88vh; display: flex; flex-direction: column;
  background: #0E0D0F; border: 1px solid rgba(255, 255, 255, .14); border-radius: 10px;
  overflow: hidden; box-shadow: 0 40px 100px rgba(0, 0, 0, .6);
}
.modal__head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 22px clamp(18px, 3vw, 28px); border-bottom: 1px solid var(--rule); }
.modal__head-row { display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap; }
.modal__head-label { font: 500 11px/1 var(--mono); letter-spacing: .1em; color: oklch(var(--accentBrightC)); }
.modal__head-title { font: 700 clamp(17px, 2.4vw, 21px)/1 var(--sans); color: var(--ink-bright); }
.modal__close {
  cursor: pointer; flex-shrink: 0; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255, 255, 255, .18); border-radius: 5px; color: var(--ink); font: 400 17px/1 var(--sans);
  background: none;
}
.modal__close:hover { border-color: oklch(var(--accentC) / .6); color: oklch(var(--accentBrightC)); }
.modal__chips { display: flex; gap: 8px; padding: 16px clamp(18px, 3vw, 28px); border-bottom: 1px solid var(--rule-soft); flex-wrap: wrap; }
.modal__list { overflow-y: auto; padding: 6px 0; }
.modal-row {
  display: grid; grid-template-columns: 84px 1fr 96px; gap: clamp(12px, 2vw, 20px); align-items: center;
  padding: 15px clamp(18px, 3vw, 28px); border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.modal-row:hover { background: rgba(255, 255, 255, .03); }
.modal-row--blog { grid-template-columns: 84px 1fr 110px; }
.modal-row__date { font: 500 12px/1 var(--mono); color: var(--ink-faint); }
.modal-row__title { display: block; font: 600 15px/1.35 var(--sans); color: var(--ink); }
.modal-row__outlet { font: 400 12px/1.4 var(--mono); color: #8a8884; }
.modal-row__cat {
  font: 500 10px/1 var(--mono); letter-spacing: .06em; color: oklch(var(--accentBrightC)); justify-self: end;
  border: 1px solid oklch(var(--accentC) / .3); padding: 5px 9px; border-radius: 2px; white-space: nowrap;
}

/* ---------- footer ---------- */
.site-footer {
  padding: clamp(32px, 4vw, 40px) clamp(20px, 5vw, 72px); border-top: 1px solid var(--rule);
  display: flex; justify-content: space-between; align-items: center; background: #08080A; flex-wrap: wrap; gap: 16px;
}
.site-footer__note { font: 500 12px/1.5 var(--mono); color: var(--ink-faint); }
.site-footer__links { display: flex; gap: 22px; font: 500 12px/1 var(--mono); color: #9b988f; }
.site-footer__links a:hover { color: oklch(var(--accentBrightC)); }

/* ---------- back to top ---------- */
.back-to-top {
  position: fixed; right: clamp(16px, 4vw, 32px); bottom: clamp(16px, 4vw, 32px); z-index: 90;
  width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; cursor: pointer;
  border: 1px solid oklch(var(--accentC) / .5); border-radius: 8px; background: rgba(10, 10, 11, .82);
  backdrop-filter: blur(8px); color: oklch(var(--accentBrightC)); font: 600 18px/1 var(--sans);
}
.back-to-top:hover { background: oklch(var(--accentC) / .14); border-color: oklch(var(--accentC) / .9); }
.back-to-top[hidden] { display: none; }

/* ---------- homepage responsive ---------- */
@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .about__grid { grid-template-columns: 1fr; }
  .media__featured { grid-template-columns: 1fr; }
  .media-grid { grid-template-columns: 1fr; }
  .project-flagship { grid-template-columns: 1fr; }
  .project-flagship__side { border-left: none; border-top: 1px solid rgba(255, 255, 255, .12); padding-left: 0; padding-top: 24px; flex-direction: row; gap: 36px; }
  .proj-grid { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .blog-grid { grid-template-columns: 1fr; }
  .modal-row { grid-template-columns: 62px 1fr; gap: 4px 14px; }
  .modal-row .modal-row__cat { grid-column: 2; justify-self: start; margin-top: 5px; }
  .site-nav__toggle { display: flex; }
  .site-nav__links {
    position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: flex-start; gap: 0;
    background: rgba(10, 10, 11, .97); backdrop-filter: blur(12px); border-bottom: 1px solid rgba(255, 255, 255, .1);
    box-shadow: 0 24px 48px rgba(0, 0, 0, .5); display: none;
  }
  .site-nav.is-open .site-nav__links { display: flex; }
  .site-nav__links a { width: 100%; padding: 15px clamp(20px, 5vw, 72px); font-size: 13px; border-top: 1px solid rgba(255, 255, 255, .06); }
}
@media (max-width: 430px) {
  .project-flagship__side { flex-direction: column; align-items: flex-start; text-align: left; gap: 5px; }
}
