/* ===========================================================================
   khizarali.ai
   Editorial blog styling — Inter for headings/UI, Lora for body copy,
   hairline rules, pastel category pills.
   Light palette on :root; dark overrides in one place.
   =========================================================================== */

:root {
  --bg:        #ffffff;
  --surface:   #fafafa;
  --surface-2: #f2f2f2;
  --line:      #d2d2d2;
  --line-soft: #ebebeb;
  --text:      #323232;
  --text-2:    #464646;
  --muted:     #8a8a8a;
  --faint:     #aaaaaa;
  --link:      #146ef5;

  /* Category pills — same swatches in both themes, always dark text on top. */
  --mint:     #b4dcb4;
  --pink:     #ffb9b9;
  --peach:    #ffd9b3;
  --lavender: #d8d2f0;
  --sky:      #b9d5ff;
  --sand:     #eee2c8;
  --pill-ink: #323232;
  /* Solid under dark text in light mode; translucent in dark mode, where a
     solid pastel behind near-white text is unreadable. */
  --highlight: var(--mint);

  --wrap: 1120px;
  --measure: 720px;

  --sans: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: Lora, Georgia, "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --ease: cubic-bezier(.22, .61, .36, 1);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:        #17181a;
    --surface:   #1e1f22;
    --surface-2: #26282c;
    --line:      #35373b;
    --line-soft: #2a2c30;
    --text:      #ededed;
    --text-2:    #c8c8c8;
    --muted:     #8f9195;
    --faint:     #6f7176;
    --link:      #6ba8ff;
    --highlight: color-mix(in srgb, var(--mint) 42%, transparent);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg:        #17181a;
  --surface:   #1e1f22;
  --surface-2: #26282c;
  --line:      #35373b;
  --line-soft: #2a2c30;
  --text:      #ededed;
  --text-2:    #c8c8c8;
  --muted:     #8f9195;
  --faint:     #6f7176;
  --link:      #6ba8ff;
  --highlight: color-mix(in srgb, var(--mint) 42%, transparent);
  color-scheme: dark;
}

/* --- reset ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .js .reveal { opacity: 1 !important; transform: none !important; }
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }

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

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--text); color: var(--bg);
  padding: .7rem 1.1rem; text-decoration: none; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

.wrap { width: min(100% - 3rem, var(--wrap)); margin-inline: auto; }
.wrap-narrow { width: min(100% - 3rem, var(--measure)); margin-inline: auto; }

.line { height: 1px; background: var(--line); border: 0; }

/* --- scroll reveal --------------------------------------------------------
   Scoped to .js so the hidden start state only ever applies when scripting is
   live. Without the guard, a blocked or failed main.js would leave the whole
   page sitting at opacity 0. */
.js .reveal {
  opacity: 0; transform: translateY(14px);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.js .reveal.is-in { opacity: 1; transform: none; }

/* --- masthead ------------------------------------------------------------- */
.masthead {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease);
}
.masthead.is-stuck { border-bottom-color: var(--line); }

.masthead-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 1.1rem 0;
}

.brand {
  font-size: 1.05rem; font-weight: 500; letter-spacing: -.01em;
  text-decoration: none; color: var(--text); white-space: nowrap;
}

/* Below this the brand and the full nav no longer fit on one line, so the nav
   drops to its own row rather than overflowing the container. */
@media (max-width: 560px) {
  .masthead-inner { flex-wrap: wrap; gap: .2rem; padding: .7rem 0 .55rem; }
  .nav { flex: 1 0 100%; margin-left: -.65rem; }
  .nav a { padding: .35rem .65rem; font-size: .92rem; }
  .theme-toggle { margin-left: auto; }
  .nav-social:not(:empty) { margin-left: .35rem; padding-left: .45rem; }
}

@media (max-width: 430px) {
  .wrap, .wrap-narrow { width: min(100% - 2rem, var(--wrap)); }
  .brand { font-size: .98rem; }
}

.nav { display: flex; align-items: center; gap: .1rem; }
.nav a {
  position: relative; font-size: .95rem; color: var(--text-2); text-decoration: none;
  padding: .4rem .8rem; white-space: nowrap;
}
.nav a::after {
  content: ""; position: absolute; left: .8rem; right: .8rem; bottom: .15rem;
  height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: left;
  transition: transform .3s var(--ease);
}
.nav a:hover::after { transform: scaleX(1); }
.nav a.is-current { color: var(--text); }
.nav a.is-current::after { transform: scaleX(1); }

/* Profile icons in the header — populated from section 1 of content.js.
   flex:none throughout: without it these shrink when the nav gets tight, and
   the svg reset's max-width:100% then squashes the icons to slivers. */
.nav-social { display: flex; align-items: center; gap: .1rem; flex: none; }
.nav-social:not(:empty) {
  margin-left: .5rem; padding-left: .6rem; border-left: 1px solid var(--line);
}
.icon-link {
  flex: none;
  display: grid; place-items: center; width: 30px; height: 30px;
  border-radius: 999px; color: var(--muted);
  transition: color .2s ease, background .2s ease, transform .25s var(--ease);
}
.icon-link:hover { color: var(--text); background: var(--surface-2); transform: translateY(-2px); }
.icon-link svg { flex: none; width: 16px; height: 16px; max-width: none; fill: currentColor; }

.theme-toggle {
  flex: none;
  display: grid; place-items: center; margin-left: .6rem;
  width: 34px; height: 34px; padding: 0; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--text-2);
  transition: transform .3s var(--ease), border-color .2s ease;
}
.theme-toggle:hover { border-color: var(--text-2); transform: rotate(20deg); }
.theme-toggle svg {
  width: 16px; height: 16px; fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: none; }
:root[data-theme="dark"] .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun  { display: none; }
  :root:not([data-theme="light"]) .icon-moon { display: block; }
  :root[data-theme="dark"] .icon-sun { display: none; }
}

/* --- hero ----------------------------------------------------------------- */
.hero { padding: clamp(3rem, 9vw, 6.5rem) 0 clamp(2.5rem, 6vw, 4rem); }

.hero h1 {
  font-size: clamp(2.1rem, 5.2vw, 3rem);
  font-weight: 400; line-height: 1.2; letter-spacing: -.015em;
  color: var(--text); max-width: 16ch; text-wrap: balance;
}
/* Highlighter stroke under the last words. Kept low enough to read as an
   underline rather than a band through the letters. */
.hero h1 .accent {
  background: linear-gradient(to top, var(--highlight) 30%, transparent 30%);
  padding: 0 .1em;
}

.hero-sub {
  font-family: var(--serif); font-size: 1.12rem; line-height: 1.7;
  color: var(--text-2); margin-top: 1.6rem; max-width: 56ch;
}

.hero-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
  margin-top: 1.9rem;
}

/* --- portrait ------------------------------------------------------------- */
/* Injected by main.js from SITE.profile.photo. If the file is missing the whole
   figure is removed rather than leaving a broken-image icon. */
.avatar { margin: 0; flex: none; }
.avatar img {
  width: 100%; height: 100%; object-fit: cover;
  border-radius: 50%; background: var(--surface-2);
}

.avatar-hero { width: clamp(150px, 22vw, 210px); aspect-ratio: 1; position: relative; }
/* A soft mint disc offset behind the photo — the one properly playful thing on
   the page, and it keeps the hero from being a wall of text. */
.avatar-hero::before {
  content: ""; position: absolute; inset: 0;
  border-radius: 50%; background: var(--mint);
  transform: translate(11px, 11px); z-index: -1;
}
.avatar-hero img { position: relative; }

.avatar-page { width: clamp(96px, 15vw, 128px); aspect-ratio: 1; }
.avatar-sm { width: 52px; aspect-ratio: 1; }

.hero-grid {
  display: grid; gap: clamp(1.75rem, 5vw, 3.5rem);
  grid-template-columns: minmax(0, 1fr) auto; align-items: center;
}
@media (max-width: 700px) {
  .hero-grid { grid-template-columns: 1fr; justify-items: start; }
  .avatar-hero { width: 130px; order: -1; }
}

.page-head-row {
  display: flex; align-items: center; gap: clamp(1.25rem, 3vw, 2rem); flex-wrap: wrap;
}

/* --- topics --------------------------------------------------------------- */
.topics {
  display: grid; gap: 1.25rem; margin-top: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.topic {
  position: relative; overflow: hidden;
  padding: 1.5rem 1.4rem 1.6rem;
  border: 1px solid var(--line-soft); border-radius: 16px;
  background: var(--bg);
  transition: transform .25s var(--ease), border-color .2s ease;
}
.topic:hover { transform: translateY(-3px); border-color: var(--line); }
/* A wash of the topic's own colour, bled in from the top-left corner. */
.topic::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(115% 130% at 0% 0%,
    color-mix(in srgb, var(--topic-accent, var(--sand)) 46%, transparent), transparent 58%);
}
.topic > * { position: relative; }
.topic h3 {
  font-size: 1.08rem; font-weight: 500; letter-spacing: -.012em; color: var(--text);
  margin-bottom: .5rem;
}
.topic p { font-family: var(--serif); font-size: .96rem; line-height: 1.7; color: var(--text-2); }

/* --- currently ------------------------------------------------------------ */
.currently {
  list-style: none; padding: 0; margin-top: 1.75rem;
  display: grid; gap: .1rem;
}
.currently li {
  display: flex; gap: .85rem; align-items: baseline; flex-wrap: wrap;
  padding: .7rem 0; border-bottom: 1px solid var(--line-soft);
}
.currently li:last-child { border-bottom: 0; }
/* min-width keeps the pills a uniform size so the values line up in a column
   rather than stepping in and out with each label's length. */
.currently .when {
  flex: none; min-width: 7rem; text-align: center;
  font-size: .72rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-2); background: var(--surface-2);
  padding: .25rem .7rem; border-radius: 320px;
}
@media (max-width: 480px) { .currently .when { min-width: 0; } }
.currently .what { font-family: var(--serif); color: var(--text-2); font-size: 1rem; }

/* --- byline (foot of an article) ------------------------------------------ */
.byline { display: flex; align-items: center; gap: 1rem; }
.byline-text strong { display: block; font-family: var(--sans); font-weight: 500; color: var(--text); }
.byline-text span { font-family: var(--sans); font-size: .9rem; color: var(--muted); }

/* --- page header (blog / videos / about) ---------------------------------- */
.page-head { padding: clamp(2.5rem, 7vw, 4.5rem) 0 clamp(1.75rem, 4vw, 2.5rem); }
.page-kicker {
  font-size: .78rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--faint); margin-bottom: .9rem;
}
.page-head h1 {
  font-size: clamp(2rem, 5vw, 2.9rem); font-weight: 400;
  line-height: 1.15; letter-spacing: -.02em; color: var(--text);
  max-width: 20ch; text-wrap: balance;
}
.page-sub {
  font-family: var(--serif); font-size: 1.08rem; line-height: 1.75;
  color: var(--text-2); margin-top: 1.1rem; max-width: 58ch;
}
.page-head .hero-meta { margin-top: 1.6rem; }

.section-link {
  font-size: .92rem; color: var(--text-2); text-decoration: none;
  display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap;
}
.section-link:hover { color: var(--text); }
.section-link .arrow { transition: transform .3s var(--ease); }
.section-link:hover .arrow { transform: translateX(4px); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* --- pills ---------------------------------------------------------------- */
.pill {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .3rem 1.05rem; border-radius: 320px;
  font-size: .88rem; line-height: 1.45; white-space: nowrap;
  border: 1px solid transparent; background: var(--surface-2); color: var(--text-2);
  text-decoration: none;
  transition: transform .25s var(--ease), border-color .2s ease, background .2s ease;
}
.pill:hover { transform: translateY(-2px); }
.pill svg { width: 15px; height: 15px; fill: currentColor; }

.pill-outline { background: transparent; border-color: var(--text-2); color: var(--text-2); }

.cat { color: var(--pill-ink); border-color: transparent; }
.cat-mint     { background: var(--mint); }
.cat-pink     { background: var(--pink); }
.cat-peach    { background: var(--peach); }
.cat-lavender { background: var(--lavender); }
.cat-sky      { background: var(--sky); }
.cat-sand     { background: var(--sand); }

/* --- filter bar ----------------------------------------------------------- */
.toolbar {
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: center;
  justify-content: space-between; padding: 1.25rem 0;
}
.filters { display: flex; flex-wrap: wrap; gap: .45rem; }

.filter {
  cursor: pointer; font-family: inherit;
  padding: .3rem 1.05rem; border-radius: 320px; font-size: .88rem;
  border: 1px solid var(--line); background: transparent; color: var(--text-2);
  transition: background .2s ease, border-color .2s ease, color .2s ease, transform .25s var(--ease);
}
.filter:hover { transform: translateY(-2px); border-color: var(--text-2); }
.filter[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.filter .dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: .45rem; vertical-align: 1px;
}

.toolbar-simple { justify-content: space-between; }
.toolbar .count { font-size: .86rem; color: var(--faint); margin-left: auto; }

.search {
  position: relative; flex: 0 1 260px;
}
.search input {
  width: 100%; font: inherit; font-size: .92rem;
  padding: .5rem .9rem .5rem 2.1rem; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
  transition: border-color .2s ease;
}
.search input::placeholder { color: var(--faint); }
.search input:focus { border-color: var(--text-2); outline: none; }
.search svg {
  position: absolute; left: .7rem; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; stroke: var(--faint); fill: none; stroke-width: 2;
}

/* --- featured post -------------------------------------------------------- */
.featured { display: block; text-decoration: none; padding: clamp(2rem, 5vw, 3rem) 0; }
.featured-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: .75rem;
  font-size: .88rem; color: var(--muted);
}
.featured h2 {
  font-size: clamp(1.9rem, 5vw, 3.2rem);
  font-weight: 400; line-height: 1.15; letter-spacing: -.02em;
  color: var(--text-2); margin: 1.1rem 0 0; text-wrap: balance;
  transition: color .25s ease;
}
.featured:hover h2 { color: var(--text); }
.featured p {
  font-family: var(--serif); font-size: 1.08rem; line-height: 1.75;
  color: var(--text-2); margin-top: 1.1rem; max-width: 68ch;
}
.featured .more {
  display: inline-flex; align-items: center; gap: .45rem;
  margin-top: 1.3rem; font-size: .95rem; color: var(--text);
}
.featured .more .arrow { transition: transform .3s var(--ease); }
.featured:hover .more .arrow { transform: translateX(5px); }

/* --- post rows ------------------------------------------------------------ */
.post-list { display: flex; flex-direction: column; }

.post-row {
  position: relative;
  display: grid; gap: .35rem 1.5rem; align-items: baseline;
  grid-template-columns: 8.5rem minmax(0, 1fr) auto;
  padding: 1.5rem .9rem; margin-inline: -.9rem;
  border-radius: 12px; text-decoration: none;
  transition: background .25s var(--ease);
}
/* A rail in the post's own category colour, wiped in on hover. --row-accent is
   set per row by main.js. */
.post-row::before {
  content: ""; position: absolute; left: 0; top: 1.2rem; bottom: 1.2rem;
  width: 3px; border-radius: 3px; background: var(--row-accent, var(--line));
  transform: scaleY(0); transform-origin: top;
  transition: transform .3s var(--ease);
}
.post-row:hover::before { transform: scaleY(1); }
.post-row + .post-row { box-shadow: 0 -1px 0 var(--line); }
.post-row:hover { background: var(--surface); }

.post-date {
  font-size: .84rem; color: var(--muted); grid-row: 1;
}
.post-main { grid-column: 2; grid-row: 1 / span 2; min-width: 0; }
.post-row h3 {
  font-size: 1.32rem; font-weight: 400; line-height: 1.35; letter-spacing: -.012em;
  color: var(--text-2); text-wrap: pretty;
  transition: color .25s ease, transform .3s var(--ease);
}
.post-row:hover h3 { color: var(--text); transform: translateX(4px); }
.post-row .excerpt {
  font-family: var(--serif); font-size: .98rem; line-height: 1.7;
  color: var(--muted); margin-top: .45rem;
}
.post-side { grid-column: 3; grid-row: 1 / span 2; display: flex; align-items: center; gap: .6rem; }
.post-side .read { font-size: .84rem; color: var(--faint); white-space: nowrap; }

@media (max-width: 720px) {
  .post-row { grid-template-columns: 1fr; gap: .5rem; }
  .post-main, .post-side { grid-column: 1; grid-row: auto; }
  .post-side { justify-content: flex-start; }
  .post-row:hover h3 { transform: none; }
}

.no-results {
  padding: 2.5rem 0; color: var(--muted); font-family: var(--serif); font-size: 1.02rem;
}
.no-results button {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--link); text-decoration: underline; font-family: var(--sans);
}

.empty-note {
  border: 1px dashed var(--line); border-radius: 12px;
  padding: 1.6rem; color: var(--text-2); font-size: .96rem; background: var(--surface);
}
.empty-note strong { display: block; margin-bottom: .3rem; color: var(--text); }
.empty-note code {
  font-family: var(--mono); font-size: .86em;
  background: var(--surface-2); padding: .1em .4em; border-radius: 4px;
}

/* --- sections ------------------------------------------------------------- */
.section { padding: clamp(3rem, 7vw, 5rem) 0 0; }
.section-head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 1rem; padding-bottom: 1.1rem; border-bottom: 1px solid var(--line);
}
.section-head h2 {
  font-size: 1.7rem; font-weight: 400; letter-spacing: -.015em; color: var(--text);
}
.section-head .count { font-size: .86rem; color: var(--faint); }

/* --- videos --------------------------------------------------------------- */
.video-grid {
  display: grid; gap: 1.75rem 1.5rem; margin-top: 2rem;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.video-card { display: flex; flex-direction: column; }

.video-thumb {
  position: relative; width: 100%; padding: 0; cursor: pointer;
  border: 1px solid var(--line); border-radius: 14px;
  aspect-ratio: 16 / 9; background: var(--surface-2); overflow: hidden;
  transition: transform .3s var(--ease), border-color .2s ease;
}
.video-thumb:hover { transform: translateY(-4px); border-color: var(--text-2); }
.video-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s var(--ease);
}
.video-thumb:hover img { transform: scale(1.04); }

.play {
  position: absolute; inset: 0; margin: auto;
  width: 56px; height: 40px; border-radius: 10px;
  background: rgba(24, 24, 24, .72); backdrop-filter: blur(3px);
  display: grid; place-items: center;
  transition: background .25s var(--ease), transform .25s var(--ease);
}
.video-thumb:hover .play { background: #e11d2e; transform: scale(1.08); }
.play svg { width: 18px; height: 18px; fill: #fff; }

.video-body { padding-top: .9rem; }
.video-body h3 {
  font-size: 1.05rem; font-weight: 400; line-height: 1.4;
  letter-spacing: -.01em; color: var(--text-2); text-wrap: pretty;
}
.video-card:hover .video-body h3 { color: var(--text); }
.video-body p {
  font-family: var(--serif); font-size: .92rem; line-height: 1.65;
  color: var(--muted); margin-top: .35rem;
}

/* --- lightbox ------------------------------------------------------------- */
/* Presence is controlled by the [hidden] attribute, not visibility. Transitioning
   visibility would leave the dialog computed-hidden at the moment it opens, and
   a hidden element silently refuses focus — which breaks keyboard users. */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; padding: 1.5rem;
  background: rgba(12, 12, 14, .82); backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .3s var(--ease);
}
.lightbox[hidden] { display: none; }
.lightbox.is-open { opacity: 1; }

.lightbox-inner {
  width: min(100%, 960px); transform: scale(.97);
  transition: transform .3s var(--ease);
}
.lightbox.is-open .lightbox-inner { transform: scale(1); }

.lightbox-frame {
  position: relative; aspect-ratio: 16 / 9;
  background: #000; border-radius: 14px; overflow: hidden;
}
.lightbox-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.lightbox-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-top: .9rem; color: #f0f0f0;
}
.lightbox-bar h3 { font-size: 1rem; font-weight: 400; }
.lightbox-close {
  flex: none; width: 36px; height: 36px; cursor: pointer;
  border: 1px solid rgba(255,255,255,.3); border-radius: 999px;
  background: transparent; color: #fff; display: grid; place-items: center;
  transition: background .2s ease, transform .25s var(--ease);
}
.lightbox-close:hover { background: rgba(255,255,255,.14); transform: rotate(90deg); }
.lightbox-close svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 2; fill: none; }

/* --- about ---------------------------------------------------------------- */
.about-grid {
  display: grid; gap: clamp(2rem, 5vw, 3.5rem);
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  margin-top: 2.25rem;
}
@media (max-width: 800px) { .about-grid { grid-template-columns: 1fr; } }

.about-body {
  font-family: var(--serif); font-size: 1.06rem; line-height: 1.8; color: var(--text-2);
}
.about-body p + p { margin-top: 1.15rem; }
.about-body strong { font-weight: 600; color: var(--text); }

.side-head {
  font-size: .78rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--faint); margin-bottom: .9rem;
}
.side-block + .side-block { margin-top: 2.25rem; }

.cv { list-style: none; padding: 0; }
.cv li {
  display: flex; gap: 1rem; align-items: baseline;
  padding: .5rem 0; font-size: .94rem; color: var(--muted);
  box-shadow: 0 1px 0 var(--line-soft);
}
.cv li:last-child { box-shadow: none; }
.cv-when { flex: 0 0 4.75rem; font-size: .82rem; color: var(--faint); }
.cv-what strong { font-weight: 500; color: var(--text-2); }

.plain { list-style: none; padding: 0; }
.plain li { color: var(--muted); font-size: .95rem; padding: .4rem 0; }
.plain li + li { border-top: 1px solid var(--line-soft); }
.plain strong { color: var(--text-2); font-weight: 500; }

.chips { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; }
.chips li {
  font-size: .82rem; padding: .25rem .75rem; border-radius: 320px;
  background: var(--surface-2); color: var(--text-2);
}

/* --- contact cta ---------------------------------------------------------- */
.cta {
  margin-top: clamp(3rem, 7vw, 5rem);
  border-radius: 18px; position: relative; overflow: hidden;
  padding: clamp(2rem, 5vw, 3.25rem); text-align: center;
  background:
    radial-gradient(120% 140% at 12% 0%, color-mix(in srgb, var(--mint) 55%, transparent), transparent 62%),
    radial-gradient(120% 140% at 88% 100%, color-mix(in srgb, var(--pink) 45%, transparent), transparent 62%),
    var(--surface);
  border: 1px solid var(--line-soft);
}
.cta h2 { font-size: clamp(1.5rem, 3.4vw, 2rem); font-weight: 400; letter-spacing: -.015em; }
.cta p {
  font-family: var(--serif); font-size: 1.04rem; line-height: 1.75; color: var(--text-2);
  margin: .8rem auto 1.6rem; max-width: 50ch;
}
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .7rem 1.5rem; border-radius: 320px; text-decoration: none;
  background: var(--text); color: var(--bg); font-size: .96rem;
  transition: transform .25s var(--ease), opacity .2s ease;
}
.btn:hover { transform: translateY(-2px); opacity: .9; }

/* --- footer --------------------------------------------------------------- */
.site-footer {
  margin-top: clamp(3.5rem, 8vw, 5.5rem);
  border-top: 1px solid var(--line); padding: 2.5rem 0 2rem;
  background: linear-gradient(to bottom, var(--surface), transparent 70%);
}
.footer-cols {
  display: flex; flex-wrap: wrap; gap: 2.5rem; justify-content: space-between;
}
.footer-col h3 {
  font-size: .78rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--faint); font-weight: 400; margin-bottom: .8rem;
}
.footer-col ul { list-style: none; padding: 0; }
.footer-col li + li { margin-top: .35rem; }
.footer-col a {
  font-size: .94rem; color: var(--text-2); text-decoration: none;
  transition: color .2s ease;
}
.footer-col a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

.footer-base {
  display: flex; flex-wrap: wrap; gap: .75rem; justify-content: space-between;
  margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line-soft);
  font-size: .86rem; color: var(--faint);
}

/* --- back to top ---------------------------------------------------------- */
.to-top {
  position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 55;
  width: 42px; height: 42px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg); color: var(--text-2);
  display: grid; place-items: center;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .3s var(--ease), transform .3s var(--ease), visibility .3s;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { color: var(--text); border-color: var(--text-2); }
.to-top svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; fill: none; }

/* ===========================================================================
   Article pages
   =========================================================================== */

.progress {
  position: fixed; top: 0; left: 0; z-index: 70;
  height: 3px; width: 100%; transform: scaleX(0); transform-origin: left;
  background: var(--mint);
}

.article-head { padding: clamp(2.5rem, 7vw, 4.5rem) 0 0; }
.back-link {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .9rem; color: var(--muted); text-decoration: none; margin-bottom: 1.75rem;
}
.back-link .arrow { transition: transform .3s var(--ease); }
.back-link:hover { color: var(--text); }
.back-link:hover .arrow { transform: translateX(-4px); }

.article-head h1 {
  font-size: clamp(2rem, 5vw, 3rem); font-weight: 400;
  line-height: 1.18; letter-spacing: -.02em; color: var(--text); text-wrap: balance;
}
.article-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: .75rem;
  margin-top: 1.35rem; font-size: .9rem; color: var(--muted);
}
.article-rule { margin: 2.5rem 0; }

/* --- prose ---------------------------------------------------------------- */
.prose {
  font-family: var(--serif); font-size: 1.13rem; line-height: 1.8; color: var(--text-2);
}
.prose p + p { margin-top: 1.35rem; }
.prose strong { font-weight: 600; color: var(--text); }
.prose a { color: var(--link); text-underline-offset: 3px; }

.prose h2 {
  font-family: var(--sans); font-weight: 400; color: var(--text);
  font-size: 1.65rem; letter-spacing: -.015em; line-height: 1.3;
  margin: 3rem 0 1rem;
}
.prose h3 {
  font-family: var(--sans); font-weight: 500; color: var(--text);
  font-size: 1.2rem; letter-spacing: -.01em; margin: 2.25rem 0 .75rem;
}

.prose ul, .prose ol { margin: 1.35rem 0; padding-left: 1.4rem; }
.prose li + li { margin-top: .5rem; }
.prose li::marker { color: var(--faint); }

.prose blockquote {
  margin: 2rem 0; padding: .25rem 0 .25rem 1.4rem;
  border-left: 3px solid var(--mint); color: var(--muted); font-style: italic;
}

.prose code {
  font-family: var(--mono); font-size: .85em;
  background: var(--surface-2); color: var(--text); padding: .12em .42em; border-radius: 5px;
}
.prose pre {
  margin: 1.75rem 0; padding: 1.15rem 1.25rem;
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: 12px;
  overflow-x: auto; font-size: .88rem; line-height: 1.65;
}
.prose pre code { background: none; padding: 0; font-size: inherit; }

.prose table {
  width: 100%; border-collapse: collapse; margin: 1.75rem 0;
  font-family: var(--sans); font-size: .94rem;
}
.prose th, .prose td { text-align: left; padding: .65rem .8rem; border-bottom: 1px solid var(--line-soft); }
.prose th { color: var(--text); font-weight: 500; border-bottom-color: var(--line); }
.table-scroll { overflow-x: auto; }

.prose figure { margin: 2rem 0; }
.prose figcaption { font-family: var(--sans); font-size: .86rem; color: var(--faint); margin-top: .6rem; }

.article-foot {
  margin-top: 3.5rem; padding-top: 2rem; border-top: 1px solid var(--line);
  font-family: var(--serif); font-size: 1.02rem; color: var(--text-2);
}
