/* =========================================================================
   chetanpatil.co.in — core stylesheet
   Structure and components only. Every colour, font and radius comes from a
   custom property that the active theme defines in themes/<name>/theme.css.
   ========================================================================= */

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

:root {
  --wrap: 1440px;
  --wrap-prose: 760px;
  /* Scales with the screen instead of jumping at two breakpoints, so a wide
     display gets real margins and a 1280 laptop does not waste 100px a side. */
  --gutter: clamp(20px, 3.5vw, 64px);
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px; --s5: 24px;
  --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px; --s10: 128px;
  --section-y: 96px;
  --tap: 44px;
  --header-h: 74px;
  --ease: cubic-bezier(.2,.7,.3,1);
  --dur: 180ms;
}

@media (max-width: 767px) { :root { --section-y: 64px; --gutter: 20px; } }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body, 16.5px);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: var(--accent); color: var(--bg); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--accent); color: var(--bg); padding: 12px 20px; font-weight: 700;
}
.skip-link:focus { left: 0; }

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--prose { max-width: calc(var(--wrap-prose) + var(--gutter) * 2); }
.main { display: block; min-height: 50vh; }
.section { padding-block: var(--section-y); }
.section--tight { padding-block: calc(var(--section-y) * .62); }
.section--alt { background: var(--surface-alt); border-block: 1px solid var(--border); }

.grid { display: grid; gap: var(--s5); }
.grid--two     { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid--posts   { grid-template-columns: repeat(auto-fill, minmax(288px, 1fr)); gap: var(--s7) var(--s5); }
.grid--projects{ grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid--albums  { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--s6); }
.grid--three   { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.split { display: grid; gap: var(--s7); }
@media (min-width: 900px) {
  .split--about   { grid-template-columns: 1fr 1.05fr; gap: var(--s8); }
  .split--career  { grid-template-columns: 1.15fr .85fr; gap: var(--s8); align-items: start; }
  .split--beyond  { grid-template-columns: 1fr 1.05fr; gap: var(--s8); align-items: center; }
  .split--contact { grid-template-columns: 1.15fr .85fr; gap: var(--s7); align-items: start; }
}

/* ---------- type ---------- */
.display, .h1, .h2, .h3, .h4 { font-family: var(--font-display); font-weight: var(--display-weight, 600); margin: 0; text-wrap: balance; letter-spacing: var(--display-tracking, -.02em); }
.display { font-size: clamp(2.6rem, 7vw, var(--fs-display, 4.6rem)); line-height: var(--lh-display, 1.02); }
.h1      { font-size: clamp(2.1rem, 5vw, var(--fs-h1, 3.2rem)); line-height: 1.08; }
.h2      { font-size: clamp(1.6rem, 3.6vw, var(--fs-h2, 2.4rem)); line-height: 1.14; }
.h3      { font-size: clamp(1.14rem, 2vw, var(--fs-h3, 1.42rem)); line-height: 1.28; }
.h4      { font-family: var(--font-body); font-size: 1.02rem; font-weight: 700; line-height: 1.4; letter-spacing: 0; }

p { margin: 0 0 var(--s4); }
p:last-child { margin-bottom: 0; }

.lead  { font-size: clamp(1.02rem, 1.6vw, 1.2rem); line-height: 1.62; color: var(--text-muted); margin: 0; text-wrap: pretty; }
.small { font-size: .875rem; line-height: 1.6; color: var(--text-muted); margin: 0; }
.muted { color: var(--text-muted); }
.mono  { font-family: var(--font-mono); }
.sep   { color: var(--text-faint); padding-inline: .35em; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: .69rem;
  letter-spacing: var(--eyebrow-tracking, .17em);
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0;
  display: flex; align-items: center; gap: .55em; flex-wrap: wrap;
}
.eyebrow a { color: inherit; }
.eyebrow a:hover { color: var(--accent); }
.eyebrow__num { color: var(--accent); }
.eyebrow__sep { color: var(--text-faint); }

.pull-quote {
  margin: var(--s5) 0;
  padding-left: var(--s5);
  border-left: 3px solid var(--accent);
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  line-height: 1.45;
  color: var(--text);
  font-style: var(--quote-style, normal);
}

/* ---------- buttons, chips, badges ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: var(--tap);
  padding: 13px 22px;
  border: 1px solid transparent;
  border-radius: var(--radius-btn, 999px);
  font-family: var(--font-body);
  font-size: .94rem; font-weight: 700; line-height: 1;
  letter-spacing: var(--btn-tracking, 0);
  text-transform: var(--btn-transform, none);
  cursor: pointer;
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
  white-space: nowrap;
}
.btn--accent { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn--accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--sm { min-height: 38px; padding: 9px 16px; font-size: .84rem; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border: 1px solid var(--border); border-radius: var(--radius-btn, 999px);
  background: transparent; color: var(--text-muted); cursor: pointer;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }

.chips { display: flex; flex-wrap: wrap; gap: var(--s2); list-style: none; margin: 0; padding: 0; }
.chips--loose { gap: var(--s3); }
.chip {
  display: inline-flex; align-items: center; gap: .4em;
  font-family: var(--font-mono); font-size: .69rem; letter-spacing: .05em;
  padding: 6px 11px; border-radius: var(--radius-chip, 999px);
  background: var(--chip-bg); border: 1px solid var(--chip-border); color: var(--text-muted);
  line-height: 1.2; text-transform: var(--chip-transform, none);
}
a.chip:hover, .chip--filter:hover { color: var(--accent); border-color: var(--accent); }
.chip--filter { min-height: 38px; padding: 8px 15px; font-size: .78rem; cursor: pointer; font-family: var(--font-body); font-weight: 600; letter-spacing: 0; }
.chip--filter.is-active, .chip.is-active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chip__count { opacity: .6; font-variant-numeric: tabular-nums; }

.badge {
  display: inline-flex; align-items: center; gap: .55em;
  font-family: var(--font-mono); font-size: .69rem; letter-spacing: .12em; text-transform: uppercase;
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text-muted); background: var(--surface);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); flex: none; }

.link-arrow { display: inline-flex; align-items: center; gap: .45em; font-weight: 700; font-size: .92rem; color: var(--accent); }
.link-arrow svg { transition: transform var(--dur) var(--ease); }
.link-arrow:hover svg { transform: translateX(3px); }
.link-out { display: inline-flex; align-items: center; gap: .35em; font-size: .84rem; font-weight: 600; color: var(--text-muted); }
.link-out:hover { color: var(--accent); }

/* ---------- header ---------- */
/* Sticky header. The background strip is always there — scrolling only makes
   it translucent and frosted, so content passes behind it without ever showing
   through the nav text. With JavaScript off it simply stays solid. */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: var(--header-bg-solid);
  border-bottom: 1px solid var(--border);
  transition: background 260ms var(--ease), box-shadow 260ms var(--ease);
}
.site-header.is-scrolled {
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  box-shadow: 0 10px 30px -20px rgba(0,0,0,.8);
}
/* Without backdrop-filter a translucent header would just look muddy, so keep
   it solid there. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header.is-scrolled { background: var(--header-bg-solid); }
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--s5); min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text); }
.brand__mark {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent);
  border-radius: var(--radius-mark, 10px);
  font-family: var(--font-display); font-weight: 700; font-size: .92rem; letter-spacing: 0;
}
.brand__name { font-family: var(--font-display); font-size: 1.06rem; font-weight: 700; letter-spacing: -.01em; }
/* Menu sits on the right, next to the actions — the brand holds the left. */
.site-nav { display: none; gap: var(--s6); margin-left: auto; }
.site-nav__link { color: var(--text); font-size: .93rem; font-weight: 600; position: relative; padding-block: 6px; }
.site-nav__link:hover, .site-nav__link.is-active { color: var(--accent); }
.site-nav__link.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--accent); }
.site-header__actions { display: flex; align-items: center; gap: var(--s3); margin-left: var(--s5); }
.nav-toggle { display: inline-flex; }
@media (min-width: 1020px) {
  .site-nav { display: flex; }
  .nav-toggle { display: none; }
}
@media (max-width: 640px) {
  .site-header__actions .btn--accent { display: none; }
}

.theme-switch { display: none; border: 1px solid var(--border); border-radius: 999px; padding: 3px; gap: 2px; }
.theme-switch__btn { font-family: var(--font-mono); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; padding: 7px 12px; border-radius: 999px; color: var(--text-muted); }
.theme-switch__btn.is-active { background: var(--accent); color: var(--on-accent); }
@media (min-width: 1100px) { .theme-switch { display: inline-flex; } }

/* ---------- mobile nav ---------- */
.mobile-nav { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: flex; flex-direction: column; }
.mobile-nav[hidden] { display: none; }
.mobile-nav__head { display: flex; align-items: center; justify-content: space-between; min-height: 74px; }
.mobile-nav__links { display: flex; flex-direction: column; flex: 1; padding-top: var(--s5); }
.mobile-nav__link {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 0; border-bottom: 1px solid var(--border);
  font-family: var(--font-display); font-size: 1.85rem; color: var(--text);
}
.mobile-nav__link.is-active { color: var(--accent); }
.mobile-nav__cta { margin-top: var(--s5); }
.mobile-nav__foot { display: flex; flex-direction: column; gap: var(--s4); padding-block: var(--s5); border-top: 1px solid var(--border); }
.social-row { display: flex; gap: var(--s2); flex-wrap: wrap; }

/* ---------- hero ---------- */
.hero { position: relative; }
.hero__inner { display: grid; gap: var(--s7); align-items: center; padding-block: clamp(48px, 7vw, 92px); }
@media (min-width: 900px) { .hero__inner { grid-template-columns: 1.15fr .85fr; gap: var(--s8); } }
.hero__text { display: flex; flex-direction: column; gap: var(--s5); }
.hero__role { font-size: clamp(1rem, 1.8vw, 1.2rem); color: var(--accent); margin: 0; font-weight: 500; }
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); margin-top: var(--s2); }
.hero__text > .badge { align-self: flex-start; }
.hero__portrait { aspect-ratio: 4 / 5; border-radius: var(--radius-lg); overflow: hidden; }
.hero__portrait img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- shared blocks ---------- */
.frame { position: relative; display: block; overflow: hidden; border-radius: var(--radius-md); background: var(--surface-alt); }
.frame img { width: 100%; height: 100%; object-fit: cover; transition: transform 420ms var(--ease); }
.frame__fallback { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-faint); }

/* About: portrait beside the introduction. Without these the heading, the lead
   and the portrait collapse into raw block flow. */
.about-hero { display: grid; gap: var(--s6); align-items: center; margin-top: var(--s5); }
.about-hero__text { display: flex; flex-direction: column; gap: var(--s4); }
.about-hero__portrait { aspect-ratio: 4 / 5; border-radius: var(--radius-lg); overflow: hidden; margin: 0; }
.about-hero__portrait img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 860px) {
  .about-hero { grid-template-columns: 1.25fr .75fr; gap: var(--s8); }
  .about-hero__portrait { max-width: 360px; margin-left: auto; }
}

.page-head { padding-block: clamp(32px, 5vw, 64px) var(--s6); border-bottom: 1px solid var(--border); }
.page-head__grid { display: grid; gap: var(--s5); margin-top: var(--s4); }
@media (min-width: 900px) { .page-head__grid { grid-template-columns: 1.05fr .95fr; gap: var(--s8); align-items: start; } }
.page-head__aside { display: flex; flex-direction: column; gap: var(--s4); }

.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: .5em; list-style: none; margin: 0; padding: 0; font-family: var(--font-mono); font-size: .69rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); }
.breadcrumbs li + li::before { content: "/"; padding-right: .5em; color: var(--text-faint); }
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--accent); }

.section-head { display: grid; gap: var(--s4); margin-bottom: var(--s7); }
.section-head__text { display: flex; flex-direction: column; gap: var(--s3); max-width: 60ch; }
@media (min-width: 800px) { .section-head { grid-template-columns: 1fr auto; align-items: end; gap: var(--s6); } }

.glance__grid { display: grid; gap: var(--s5) var(--s6); margin: 0; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
@media (min-width: 760px)  { .glance__grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1180px) { .glance__grid { grid-template-columns: repeat(6, 1fr); } }
.glance__item { display: flex; flex-direction: column; gap: 5px; }
.glance__item dd { margin: 0; font-weight: 600; font-size: .98rem; }

.skill-grid { display: grid; gap: var(--s6); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.skill-grid--wide { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.skill-group { display: flex; flex-direction: column; gap: var(--s3); }

.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s7); }
.tl-item { position: relative; padding-left: var(--s5); border-left: 2px solid var(--border); display: flex; flex-direction: column; gap: var(--s2); }
.tl-item::before { content: ""; position: absolute; left: -6px; top: 7px; width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }
.tl-item.is-current::before { background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.tl-item__org { font-weight: 600; margin: 0; }
.tl-item__bullets { margin: var(--s2) 0 0; padding-left: 1.1rem; color: var(--text-muted); display: flex; flex-direction: column; gap: 6px; }

.edu-stack { display: flex; flex-direction: column; gap: var(--s4); }
.edu-card { border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--s5); background: var(--surface); display: flex; flex-direction: column; gap: 6px; }
.edu-card--lg { padding: var(--s6); }

.stat { display: flex; flex-direction: column; gap: 4px; }
.stat__value { font-family: var(--font-display); font-size: clamp(1.7rem, 4vw, 2.4rem); line-height: 1; color: var(--accent); font-weight: 700; }
.stat__label { font-family: var(--font-mono); font-size: .66rem; letter-spacing: .15em; text-transform: uppercase; color: var(--text-muted); }

.photo-mosaic { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s3); }
.photo-mosaic__item { aspect-ratio: 1; }
.photo-mosaic__item:first-child { grid-row: span 2; aspect-ratio: 3 / 4; }
.photo-mosaic__item:hover img { transform: scale(1.05); }
.photo-mosaic__label { position: absolute; left: 10px; bottom: 10px; font-family: var(--font-mono); font-size: .6rem; letter-spacing: .12em; text-transform: uppercase; color: #fff; background: rgba(0,0,0,.55); padding: 4px 8px; border-radius: 4px; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.card--muted { background: var(--surface-alt); }

.post-card { display: flex; flex-direction: column; gap: var(--s3); }
.post-card__media { aspect-ratio: 16 / 9; }
.post-card:hover .post-card__media img { transform: scale(1.04); }
.post-card__body { display: flex; flex-direction: column; gap: var(--s3); }
.post-card h3 a { color: var(--text); }
.post-card h3 a:hover { color: var(--accent); }
.post-card__excerpt { color: var(--text-muted); font-size: .92rem; margin: 0; }
.post-card__meta { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); margin: 0; }
.featured-post { margin-bottom: var(--s8); }
.post-card--featured { gap: var(--s5); }
@media (min-width: 860px) {
  .post-card--featured { display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: var(--s7); }
  .post-card--featured .post-card__media { aspect-ratio: 4 / 3; height: 100%; }
}

.project-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.project-card:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.project-card__media { aspect-ratio: 16 / 10; border-radius: 0; border-bottom: 1px solid var(--border); }
.project-card__body { display: flex; flex-direction: column; gap: var(--s3); padding: var(--s5); flex: 1; }
.project-card__body .eyebrow { justify-content: space-between; }
.project-card h3 a { color: var(--text); }
.project-card h3 a:hover { color: var(--accent); }
.project-card__links { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-top: auto; padding-top: var(--s3); }

/* The projects index leads with one project and lists the rest flat underneath.
   The featured block is a card that has swallowed a page section: text on the
   left, cover filling the right. Below 900px it stacks, cover first, like every
   other card on the site. */
.project-feature { display: grid; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.project-feature__body { display: flex; flex-direction: column; gap: var(--s5); padding: clamp(24px, 3.4vw, 48px); }
.project-feature__body .h2 a { color: var(--text); }
.project-feature__body .h2 a:hover { color: var(--accent); }
.project-feature__flag { color: var(--accent); }
.project-feature__summary { color: var(--text-soft); max-width: 46ch; }
.project-feature__meta { display: grid; gap: var(--s4) var(--s6); margin: 0; }
.project-feature__meta > div { display: flex; flex-direction: column; gap: 5px; }
.project-feature__meta dt { font-family: var(--font-mono); font-size: .69rem; letter-spacing: .18em; text-transform: uppercase; color: var(--text-faint); }
.project-feature__meta dd { margin: 0; font-size: .875rem; line-height: 1.5; color: var(--text-soft); }
.project-feature__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s5); margin-top: auto; padding-top: var(--s2); }
/* The cover sits inset inside the card rather than bleeding to its edge — it is
   supporting evidence, not the headline. */
.project-feature__media { padding: var(--s5); }
.project-feature__media .frame { aspect-ratio: 16 / 10; }
@media (min-width: 560px) {
  .project-feature__meta { grid-template-columns: 1fr 1fr; }
  .project-feature__meta > .project-feature__meta--wide { grid-column: 1 / -1; }
}
/* Stacked, a 16:10 cover on a tablet is 450px of picture before a word of
   copy — crop it instead. */
@media (max-width: 899px) {
  .project-feature__media { order: -1; padding-bottom: 0; }
  .project-feature__media .frame { aspect-ratio: auto; height: clamp(200px, 38vw, 300px); }
}
@media (min-width: 900px) {
  .project-feature { grid-template-columns: 1.02fr .98fr; }
  .project-feature__media { display: grid; padding-left: 0; }
  .project-feature__media .frame { aspect-ratio: auto; height: 100%; min-height: 320px; }
}

/* "Also shipped": a quieter head than a full section, and a rule to sit it under
   the featured block rather than beside it. */
.projects-more__head { margin-top: var(--s8); padding-bottom: var(--s5); margin-bottom: var(--s6); border-bottom: 1px solid var(--border); }

.album-card { display: flex; flex-direction: column; gap: var(--s3); color: var(--text); }
.album-card__media { aspect-ratio: 4 / 3; }
.album-card:hover .album-card__media img { transform: scale(1.05); }
.album-card:hover .h3 { color: var(--accent); }
.album-card__count { position: absolute; right: 10px; top: 10px; font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; background: rgba(0,0,0,.6); color: #fff; padding: 5px 9px; border-radius: 4px; }
.album-card__body { display: flex; flex-direction: column; gap: 5px; }
.album-card__body .small { display: inline-flex; align-items: center; gap: .4em; }

/* ---------- blog ---------- */
.filter-bar { border-bottom: 1px solid var(--border); background: var(--surface-alt); }
.filter-bar__inner { display: flex; gap: var(--s2); padding-block: var(--s4); overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
.filter-bar__inner::-webkit-scrollbar { width: 0; height: 0; display: none; }
.filter-bar__inner > * { flex: none; }
@media (min-width: 768px) {
  /* Thirteen categories do not fit one row on a laptop; wrapping shows them
     all rather than hiding half behind a horizontal scroll. */
  .filter-bar__inner { flex-wrap: wrap; overflow-x: visible; row-gap: var(--s2); }
}

.search { position: relative; display: flex; align-items: center; gap: var(--s2); }
.search__icon { position: absolute; left: 14px; color: var(--text-muted); display: grid; place-items: center; pointer-events: none; }
.search .input { padding-left: 44px; flex: 1; }

.pagination { display: flex; align-items: center; justify-content: center; gap: var(--s2); margin-top: var(--s8); flex-wrap: wrap; }
.pagination__page, .pagination__step {
  min-width: var(--tap); min-height: var(--tap);
  display: inline-grid; place-items: center;
  border: 1px solid var(--border); border-radius: var(--radius-btn, 999px);
  font-family: var(--font-mono); font-size: .85rem; color: var(--text-muted);
}
.pagination__page:hover, .pagination__step:hover { border-color: var(--accent); color: var(--accent); }
.pagination__page.is-active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.pagination__step.is-disabled { opacity: .3; pointer-events: none; }
.pagination__gap { color: var(--text-faint); padding-inline: 4px; }

.empty { text-align: center; display: flex; flex-direction: column; align-items: center; gap: var(--s4); padding-block: var(--s8); }

/* ---------- article ---------- */
.reading-progress { position: fixed; inset: 0 0 auto 0; height: 3px; background: transparent; z-index: 70; }
.reading-progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 80ms linear; }

/* The article's artwork now sits behind the header rather than as a slab of
   flat colour below the title — a low-contrast generated card reads as a blank
   panel at full strength, but works as texture. */
.post__head { position: relative; padding-block: clamp(28px, 5vw, 56px) var(--s5); }
.post__head--media { padding-bottom: var(--s7); }
.post__head .wrap { position: relative; z-index: 2; }
.post__head-media { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.post__head-media img { width: 100%; height: 100%; object-fit: cover; opacity: .3; filter: saturate(.85); }
.post__head-media::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(100deg, var(--bg) 12%, color-mix(in srgb, var(--bg) 62%, transparent) 58%, transparent 92%),
    linear-gradient(180deg, color-mix(in srgb, var(--bg) 55%, transparent) 0%, transparent 30%, var(--bg) 97%);
}
.post__kicker { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); margin: var(--s5) 0 var(--s4); font-size: .8rem; color: var(--text-muted); }
.post__kicker-meta { display: inline-flex; align-items: center; gap: .45em; white-space: nowrap; }
.post__title { margin: 0; }
.post__standfirst { margin: var(--s4) 0 0; font-size: clamp(1.05rem, 2vw, 1.24rem); line-height: 1.58; color: var(--text-soft); max-width: 62ch; }
.post__byline { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s4); margin-top: var(--s6); padding-top: var(--s5); border-top: 1px solid var(--border); }
.author { display: inline-flex; align-items: center; gap: var(--s3); }
.author__avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex: none; }
.author__name { display: block; font-weight: 700; font-size: .94rem; }
.author__line { display: block; font-size: .82rem; color: var(--text-muted); }
.share { display: inline-flex; gap: var(--s2); }

/* One column by default. The sidebar only appears when there is a contents
   list to put in it — otherwise the article would end up in a 230px gutter. */
.post__body { display: block; padding-block: var(--s7) var(--s8); }
.post__body .prose { margin-inline: auto; }
/* Everything in the article starts on the same left edge as the site header,
   so the page has one axis rather than three. The body keeps a reading
   measure; the header does not — a title capped at 760px left most of the
   band empty. Only the standfirst stays narrow, because that one is prose. */
.post__body .prose { max-width: var(--wrap-prose); margin-inline: 0; }
.post__head .wrap > * { max-width: none; }
.post__head .post__title { font-size: clamp(2.1rem, 5.4vw, 4.1rem); line-height: 1.06; }
/* The deck runs the full band like the title above it. It is set larger than
   body copy so the longer line still tracks — a 20px line across 1336px would
   be ~180 characters and unreadable; at 28px it is ~95, which a two-line deck
   carries fine. */
.post__head .post__standfirst { max-width: none; font-size: clamp(1.08rem, 2.05vw, 1.72rem); line-height: 1.45; }
@media (min-width: 1080px) {
  .post__body--with-toc {
    display: grid;
    grid-template-columns: minmax(0, var(--wrap-prose)) 1fr;
    gap: 0 var(--s7);
    align-items: start;
  }
  /* The contents list comes first in the DOM (so it reads first on a phone and
     for a screen reader) but sits in the right column. Both need an explicit
     row, or auto-placement drops the prose into row 2. */
  .post__body--with-toc > .prose { grid-column: 1; grid-row: 1; }
  .post__body--with-toc > .toc   { grid-column: 2; grid-row: 1; }
}

.toc { font-size: .88rem; }
.toc__summary { list-style: none; cursor: pointer; padding-block: var(--s3); display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.toc__summary::-webkit-details-marker { display: none; }
.toc__summary::after { content: "+"; font-family: var(--font-mono); font-size: 1.1rem; line-height: 1; color: var(--text-muted); }
.toc[open] > .toc__summary::after { content: "–"; }
.toc__list { list-style: none; margin: 0; padding-left: var(--s4); border-left: 2px solid var(--border); display: flex; flex-direction: column; gap: var(--s3); }
.toc__item--h3 { padding-left: var(--s3); }
.toc__list a { color: var(--text-muted); display: block; }
.toc__list a:hover, .toc__list a.is-active { color: var(--accent); }
@media (max-width: 1079px) {
  .toc { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-alt); padding: var(--s2) var(--s5) var(--s4); margin-bottom: var(--s6); max-width: var(--wrap-prose); margin-inline: auto; }
  .toc[open] > .toc__list { margin-top: var(--s3); }
}
@media (min-width: 1080px) {
  .toc { position: sticky; top: calc(var(--header-h) + var(--s5)); }
  .toc__summary { display: none; }
}

.prose { max-width: var(--wrap-prose); font-size: 1.06rem; line-height: 1.8; }
.prose > * + * { margin-top: var(--s5); }
.prose h2 { font-family: var(--font-display); font-size: clamp(1.42rem, 3vw, 1.85rem); line-height: 1.22; margin-top: var(--s8); padding-top: var(--s5); border-top: 1px solid var(--border); }
.prose h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.prose h3 { font-family: var(--font-display); font-size: clamp(1.14rem, 2.2vw, 1.34rem); line-height: 1.3; margin-top: var(--s7); }
.prose h2 + *, .prose h3 + * { margin-top: var(--s4); }
.prose h2 .anchor, .prose h3 .anchor { opacity: 0; color: var(--accent); font-size: .68em; margin-left: .35em; transition: opacity var(--dur) var(--ease); }
.prose h2:hover .anchor, .prose h3:hover .anchor, .prose .anchor:focus-visible { opacity: 1; }
.prose p { color: var(--text-soft); }
.prose a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose ul, .prose ol { padding-left: 1.35rem; color: var(--text-soft); display: flex; flex-direction: column; gap: 10px; }
.prose li::marker { color: var(--accent); }
.prose img { border-radius: var(--radius-md); margin-block: var(--s6); }
.prose figure { margin: var(--s7) 0; }
.prose figure img { margin: 0; }
.prose figcaption { font-size: .82rem; color: var(--text-muted); margin-top: var(--s3); }
.prose blockquote { margin: var(--s7) 0; padding-left: var(--s5); border-left: 3px solid var(--accent); font-family: var(--font-display); font-size: 1.22rem; line-height: 1.5; color: var(--text); }
.prose blockquote p { color: inherit; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin-block: var(--s8); }
.prose code { font-family: var(--font-mono); font-size: .86em; background: var(--code-bg); border: 1px solid var(--border); border-radius: 5px; padding: .15em .4em; }
.prose pre { background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--s5); overflow-x: auto; font-family: var(--font-mono); font-size: .84rem; line-height: 1.75; }
.prose pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.table-scroll { overflow-x: auto; margin-block: var(--s6); }
.prose table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.prose th { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }

.post__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s4); margin-top: var(--s8); padding-top: var(--s5); border-top: 1px solid var(--border); }
.post__foot-share { display: flex; align-items: center; gap: var(--s3); }
.post__tags { display: flex; flex-wrap: wrap; gap: var(--s2); }

.author-card { display: flex; gap: var(--s5); align-items: flex-start; max-width: var(--wrap-prose); }
.author-card__avatar { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; flex: none; }
.author-card__links { display: flex; flex-wrap: wrap; gap: var(--s4); margin-top: var(--s3); }

.post-nav { display: grid; gap: var(--s4); padding-block: var(--s7); border-top: 1px solid var(--border); }
@media (min-width: 720px) { .post-nav { grid-template-columns: 1fr 1fr; } }
.post-nav__link { display: flex; align-items: center; gap: var(--s3); color: var(--text); }
.post-nav__link:hover { color: var(--accent); }
.post-nav__link--next { justify-content: flex-end; text-align: right; }
.post-nav__link span span { display: block; }

/* ---------- projects & meta ---------- */
.meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--s5); margin: 0; }
.meta-grid dd { margin: 0; font-weight: 600; }
.project__cover { margin-block: var(--s6) var(--s7); }
.project__cover img { width: 100%; border-radius: var(--radius-lg); aspect-ratio: 16 / 8; object-fit: cover; }

/* ---------- gallery ---------- */
.masonry { columns: 2; column-gap: var(--s3); }
@media (min-width: 700px)  { .masonry { columns: 3; column-gap: var(--s4); } }
@media (min-width: 1100px) { .masonry { columns: 4; } }
.masonry__item { display: block; width: 100%; margin: 0 0 var(--s3); padding: 0; border: 0; background: none; cursor: zoom-in; break-inside: avoid; border-radius: var(--radius-md); overflow: hidden; }
.masonry__item img { width: 100%; border-radius: inherit; transition: transform 420ms var(--ease), opacity var(--dur) var(--ease); }
.masonry__item:hover img { transform: scale(1.03); opacity: .92; }

.lightbox { position: fixed; inset: 0; z-index: 120; display: grid; grid-template-rows: auto 1fr; background: rgba(4,7,6,.95); backdrop-filter: blur(6px); }
.lightbox[hidden] { display: none; }
.lightbox__bar { display: flex; align-items: center; gap: var(--s4); padding: var(--s4) var(--s5); color: #EDF2EF; }
.lightbox__caption { flex: 1; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; opacity: .8; }
.lightbox__counter { font-size: .8rem; opacity: .7; }
.lightbox__bar .icon-btn { color: #EDF2EF; border-color: rgba(255,255,255,.28); }
.lightbox__stage { margin: 0; display: grid; place-items: center; padding: 0 var(--s5) var(--s7); min-height: 0; }
.lightbox__stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--radius-md); }
.lightbox__nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; color: #EDF2EF; border-color: rgba(255,255,255,.28); background: rgba(0,0,0,.35); }
.lightbox__nav--prev { left: 12px; }
.lightbox__nav--next { right: 12px; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: var(--s5); }
.field-row { display: grid; gap: var(--s4); }
@media (min-width: 620px) { .field-row { grid-template-columns: 1fr 1fr; } }
.label { font-family: var(--font-mono); font-size: .69rem; letter-spacing: .15em; text-transform: uppercase; color: var(--text-muted); }
.input {
  width: 100%; min-height: var(--tap);
  padding: 13px 15px;
  background: var(--input-bg); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  font-family: var(--font-body); font-size: .96rem; line-height: 1.5;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.input::placeholder { color: var(--text-faint); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.input.has-error { border-color: var(--danger); }
textarea.input { resize: vertical; min-height: 150px; }
.field__error { color: var(--danger); font-size: .82rem; margin: 0; }
.field--honeypot { position: absolute; left: -9999px; }
.form-card { padding: var(--s6); }
.form-card__foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s4); }
.notice { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s4); border-radius: var(--radius-md); margin-bottom: var(--s5); border: 1px solid var(--border); }
.notice--success { border-color: var(--success); background: color-mix(in srgb, var(--success) 12%, transparent); color: var(--text); }
.notice--error { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }

.contact-side { display: flex; flex-direction: column; gap: var(--s4); }
.contact-link { display: flex; gap: var(--s4); align-items: center; padding: var(--s4); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); color: var(--text); }
.contact-link:hover { border-color: var(--accent); }
.contact-link__icon { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: var(--radius-md); background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.contact-link span span { display: block; }
.contact-where { padding: var(--s5); display: flex; flex-direction: column; gap: var(--s2); }

/* ---------- resume ---------- */
.resume__grid { display: grid; gap: var(--s7); }
@media (min-width: 980px) { .resume__grid { grid-template-columns: minmax(0,1fr) 260px; gap: var(--s8); align-items: start; } }
.resume__body { display: flex; flex-direction: column; gap: var(--s8); }
.resume__block { display: flex; flex-direction: column; gap: var(--s4); }
.resume__entry { display: flex; flex-direction: column; gap: var(--s2); padding-bottom: var(--s5); border-bottom: 1px solid var(--border); }
.resume__entry:last-child { border-bottom: 0; padding-bottom: 0; }
.resume__entry--tight { padding-bottom: var(--s4); }
.resume__entry-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s3); }
.resume__org { font-weight: 600; margin: 0; }
.resume__entry ul { margin: var(--s2) 0 0; padding-left: 1.15rem; color: var(--text-muted); display: flex; flex-direction: column; gap: 6px; }
.resume__entry ul.chips { padding-left: 0; }
.resume__skills { display: grid; gap: var(--s4); margin: 0; }
.resume__skills > div { display: grid; gap: 4px; }
@media (min-width: 640px) { .resume__skills > div { grid-template-columns: 150px 1fr; gap: var(--s5); } }
.resume__skills dt { font-weight: 700; }
.resume__skills dd { margin: 0; color: var(--text-muted); }
.resume-contact { list-style: none; margin: var(--s4) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s4); font-size: .9rem; }
.resume-contact li { display: inline-flex; align-items: center; gap: .45em; color: var(--text-muted); }
.resume-contact a { display: inline-flex; align-items: center; gap: .45em; color: var(--text-muted); }
.resume-contact a:hover { color: var(--accent); }
.resume-actions { display: flex; flex-direction: column; gap: var(--s3); align-items: flex-start; }
.fact-card { display: flex; flex-direction: column; gap: var(--s4); padding: var(--s5); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.fact-card p { margin: 0; }

.prose-intro { display: flex; flex-direction: column; gap: var(--s4); }
.prose--narrow { max-width: 62ch; }
.beyond__text { display: flex; flex-direction: column; gap: var(--s4); }
.error-page { text-align: left; padding-block: clamp(64px, 12vw, 140px); }
.error-page__recent { margin-top: var(--s7); }
.error-page__recent ul { list-style: none; margin: var(--s3) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--s2); }

.cta-band__inner { display: grid; gap: var(--s5); align-items: center; }
@media (min-width: 820px) { .cta-band__inner { grid-template-columns: 1fr auto; gap: var(--s8); } }
.cta-band__actions { display: flex; flex-wrap: wrap; gap: var(--s3); }
.footer-mail { display: inline-flex; align-items: center; gap: .5em; font-weight: 600; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface-alt); padding-top: var(--s8); }
.site-footer__grid { display: grid; gap: var(--s7); }
@media (min-width: 820px) { .site-footer__grid { grid-template-columns: 1.5fr 1.2fr .9fr; gap: var(--s8); } }
.site-footer__about { display: flex; flex-direction: column; gap: var(--s4); align-items: flex-start; max-width: 42ch; }
.site-footer__nav { display: flex; flex-direction: column; gap: var(--s4); }
/* Seven links in one stack left a column of dead space beside the social
   icons, so they run in two. */
.site-footer__links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3) var(--s5); align-content: start; }
.site-footer__nav a { color: var(--text); font-size: .92rem; display: inline-flex; align-items: center; gap: .4em; }
.site-footer__nav a:hover { color: var(--accent); }
.site-footer__social { display: flex; flex-direction: column; gap: var(--s4); }
.site-footer__base { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3); margin-top: var(--s7); padding-block: var(--s5); border-top: 1px solid var(--border); }

/* ---------- print frame ----------
   base.php wraps the page content in a layout table whose empty thead/tfoot
   become repeating top and bottom margins in print (see print.css). On screen
   it must not behave like a table at all, so it is flattened back to blocks. */
.page-frame,
.page-frame > tbody,
.page-frame > tbody > tr,
.page-frame__body { display: block; width: 100%; margin: 0; padding: 0; border: 0; }
.page-frame__edge { display: none; }

/* ---------- print ----------
   Lives in assets/css/print.css, loaded with media="print" after the theme
   so it can re-point the dark tokens at an ink-friendly palette. */

/* ---------- reveal on scroll (only when JS says so) ---------- */
.has-reveal .section-head,
.has-reveal .post-card,
.has-reveal .project-card,
.has-reveal .project-feature,
.has-reveal .album-card,
.has-reveal .tl-item,
.has-reveal .edu-card { opacity: 0; transform: translateY(12px); transition: opacity 480ms var(--ease), transform 480ms var(--ease); }
.has-reveal .is-visible { opacity: 1; transform: none; }
.icon-btn.is-copied { color: var(--success); border-color: var(--success); }

/* ---------- corrections ---------- */
/* Stack chips inside a resume entry must not inherit the bullet list's column flow. */
.resume__entry ul.chips,
.tl-item ul.chips { flex-direction: row; flex-wrap: wrap; padding-left: 0; gap: var(--s2); }
.resume__entry ul.chips li,
.tl-item ul.chips li { list-style: none; }

/* Project and education grids: two equal columns that stretch to the same height. */
@media (min-width: 900px) { .grid--two { grid-template-columns: 1fr 1fr; } }
.grid--two > *, .grid--projects > * { display: flex; }
.grid--two > * > .project-card,
.grid--projects > * > .project-card,
.grid--two > .project-card,
.grid--projects > .project-card { flex: 1; }

/* The fact card's figure reads better in the mono face than the display serif. */
.fact-card .stat__value { font-family: var(--font-mono); font-size: 1.7rem; font-weight: 500; letter-spacing: -.01em; }

/* Give the filter bar's active state a hit area that matches the others. */
.filter-bar__inner .chip--filter { white-space: nowrap; }
/* Media keeps its ratio when a stretched card grows; the body absorbs the rest. */
.project-card__media, .post-card__media, .album-card__media { flex: none; }
.project-card__body { justify-content: flex-start; }
.album-card__note { color: var(--text-muted); }
