/* ==========================================================================
   Ahmet Tahir Mat — personal site
   Tokens → base → layout → components → home → essay
   ========================================================================== */

/* Tokens ------------------------------------------------------------------ */
:root {
  color-scheme: light dark;

  /* SF Pro on Apple devices, Inter everywhere else. */
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-logo: "Instrument Serif", "Newsreader", Georgia, serif;

  --bg: #fbfbfd;
  --band: #f5f5f7;
  --surface: #ffffff;
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-muted-strong: #424245;
  --line: rgba(0, 0, 0, 0.09);
  --line-strong: rgba(0, 0, 0, 0.2);
  --link: #0066cc;
  --link-on-tint: #0058b5; /* links over the hero glow */
  --focus: #0066cc;
  --button-bg: #1d1d1f;
  --button-text: #ffffff;
  --button-bg-hover: #424245;
  --nav-bg: rgba(251, 251, 253, 0.8);
  --menu-bg: rgba(251, 251, 253, 0.97);
  --card-shadow: 0 1px 1px rgba(0, 0, 0, 0.03), 0 18px 40px -18px rgba(0, 0, 0, 0.18);
  --aura-opacity: 0.9;
  --cover-filter: none;

  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-pill: 999px;

  --gutter: clamp(1rem, 4vw, 2.5rem);
  --max: 1120px;
  --measure: 40rem;
  --nav-h: 52px;
  --section-space: clamp(5rem, 3.5rem + 6vw, 9rem);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --band: #0d0d0e;
    --surface: #161617;
    --text: #f5f5f7;
    --text-secondary: #a1a1a6;
    --text-muted-strong: #d2d2d7;
    --line: rgba(255, 255, 255, 0.12);
    --line-strong: rgba(255, 255, 255, 0.28);
    --link: #2997ff;
    --link-on-tint: #2997ff;
    --focus: #2997ff;
    --button-bg: #f5f5f7;
    --button-text: #1d1d1f;
    --button-bg-hover: #d2d2d7;
    --nav-bg: rgba(22, 22, 23, 0.72);
    --menu-bg: rgba(10, 10, 11, 0.97);
    --card-shadow: none;
    --aura-opacity: 0.42;
    --cover-filter: saturate(0.92) brightness(0.84);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--nav-h) + 1rem);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.5;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3, p, figure, blockquote, dl, dd { margin: 0; }

a { color: inherit; text-decoration: none; }

button { font: inherit; color: inherit; }

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

::selection { background: rgba(0, 102, 204, 0.18); }

/* Language: every bilingual pair is two siblings with lang="tr" / lang="en". */
html[data-lang="tr"] [lang="en"],
html[data-lang="en"] [lang="tr"] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.625rem 1rem;
  border-radius: var(--radius-pill);
  background: var(--button-bg);
  color: var(--button-text);
  font-size: 0.875rem;
  font-weight: 600;
  transform: translateY(-200%);
}
.skip-link:focus-visible { transform: none; }

/* Layout ------------------------------------------------------------------ */
.container {
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
}

.section { padding-block: var(--section-space); }
.section--flush-top { padding-top: 0; }

.band { background: var(--band); }

/* Type -------------------------------------------------------------------- */
.display {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 1.35rem + 4.9vw, 5rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.038em;
  text-wrap: balance;
}

.heading {
  font-family: var(--font-display);
  font-size: clamp(2rem, 1.45rem + 2.4vw, 3.5rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.lead {
  font-size: clamp(1.1875rem, 1.05rem + 0.55vw, 1.5rem);
  line-height: 1.45;
  letter-spacing: -0.014em;
  color: var(--text-muted-strong);
  text-wrap: pretty;
}

.eyebrow {
  display: block;
  margin-bottom: 0.875rem;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-secondary);
}

/* Buttons & links --------------------------------------------------------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0 1.375rem;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--button-bg);
  color: var(--button-text);
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: -0.012em;
  cursor: pointer;
  transition: background-color 0.2s var(--ease-out), transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}
.button svg { width: 18px; height: 18px; flex: none; }
.button:active { transform: scale(0.98); }

.button--secondary {
  background: transparent;
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

@media (hover: hover) {
  .button:hover { background: var(--button-bg-hover); }
  .button--secondary:hover { background: var(--band); box-shadow: inset 0 0 0 1px var(--text-secondary); }
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 44px;
  color: var(--link);
  font-size: 1.0625rem;
  letter-spacing: -0.012em;
}
.text-link svg {
  width: 14px;
  height: 14px;
  transition: transform 0.25s var(--ease-out);
}
@media (hover: hover) {
  .text-link:hover { text-decoration: underline; text-underline-offset: 0.2em; }
  .text-link:hover svg { transform: translateX(3px); }
}

/* Header ------------------------------------------------------------------ */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--nav-h);
  transition: background-color 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}

.site-header.is-scrolled,
.site-header.is-open {
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 1px 0 var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 100%;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--font-logo);
  font-size: 1.75rem;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.02em;
  white-space: nowrap;
  padding-right: 0.06em; /* keeps the tracked-in dot inside the focus ring */
}
.wordmark-dot {
  display: inline-block;
  color: var(--link);
  transition: transform 0.35s var(--ease-out);
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .wordmark:hover .wordmark-dot { transform: translateY(-3px); }
}

.nav-links {
  display: flex;
  gap: 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: color 0.2s;
}
.nav-links a:hover,
.nav-links a[aria-current] { color: var(--text); }

.nav-end {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.lang-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: var(--radius-pill);
  box-shadow: inset 0 0 0 1px var(--line);
}
.lang-switch button {
  min-width: 2.375rem;
  min-height: 28px;
  padding: 0 0.625rem;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background-color 0.2s var(--ease-out), color 0.2s var(--ease-out);
}
.lang-switch button:hover { color: var(--text); }
.lang-switch button[aria-pressed="true"] {
  background: var(--text);
  color: var(--bg);
}

.menu-toggle {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.menu-toggle span {
  position: absolute;
  left: 13px;
  width: 18px;
  height: 1.5px;
  border-radius: 2px;
  background: var(--text);
  transition: transform 0.3s var(--ease-out);
}
.menu-toggle span:nth-child(1) { top: 18px; }
.menu-toggle span:nth-child(2) { top: 25px; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(3.5px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { transform: translateY(-3.5px) rotate(-45deg); }

.menu-panel {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  z-index: 49;
  padding: 0.5rem var(--gutter) 2rem;
  background: var(--menu-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 1px 0 var(--line);
}
.menu-panel[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .menu-panel:not([hidden]) { animation: menu-in 0.32s var(--ease-out); }
}
@keyframes menu-in {
  from { opacity: 0; transform: translateY(-6px); }
}
.menu-panel ul { margin: 0; padding: 0; list-style: none; }
.menu-panel a {
  display: block;
  padding: 0.625rem 0;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.025em;
}

@media (max-width: 759px) {
  .nav-links { display: none; }
  .menu-toggle { display: block; }
  .nav-end { gap: 0.75rem; }
}
@media (min-width: 760px) {
  .menu-panel { display: none !important; }
}

/* Covers: generated gradient art, one palette per essay ------------------- */
.cover {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-md);
  background-color: var(--c0);
  filter: var(--cover-filter);
}
.cover::before {
  content: "";
  position: absolute;
  inset: -25%;
  z-index: -1;
  background:
    radial-gradient(38% 46% at 24% 30%, var(--c1), transparent 72%),
    radial-gradient(42% 50% at 80% 22%, var(--c2), transparent 72%),
    radial-gradient(52% 58% at 58% 92%, var(--c3), transparent 72%);
  transition: transform 1.4s var(--ease-out);
}
.cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.16;
  mix-blend-mode: overlay;
  pointer-events: none;
}
.cover-mark {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.92);
}
.cover-mark svg {
  width: 26%;
  height: auto;
  overflow: visible;
}
.cover-mark svg * { vector-effect: non-scaling-stroke; }

.cover--slow       { --c0: #c4d1e3; --c1: #8ea5ca; --c2: #f1dccb; --c3: #6a82b0; }
.cover--curious    { --c0: #f6d8b6; --c1: #f2a67c; --c2: #fce9c8; --c3: #e5866b; }
.cover--unfinished { --c0: #cfd9c7; --c1: #9ab799; --c2: #eff0dd; --c3: #6c9277; }
.cover--goodday    { --c0: #e7d8eb; --c1: #f2bbca; --c2: #fcefe4; --c3: #b6a0d6; }

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .post-card:hover .cover::before,
  .feature:hover .cover::before,
  .next-card:hover .cover::before { transform: scale(1.08) rotate(3deg); }
}

/* Card link: the title link stretches over the whole card ----------------- */
.stretched::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}
@supports selector(:has(*)) {
  .stretched:focus-visible { outline: none; }
  :is(.post-card, .feature, .next-card):has(.stretched:focus-visible) {
    outline: 2px solid var(--focus);
    outline-offset: 4px;
  }
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}
.post-meta strong {
  font-weight: 600;
  color: var(--text);
}

/* Home: hero -------------------------------------------------------------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: clip;
  padding-top: calc(var(--nav-h) + clamp(4rem, 2rem + 9vw, 9.5rem));
  padding-bottom: clamp(4rem, 3rem + 5vw, 7.5rem);
  text-align: center;
}

.hero-aura {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  z-index: -1;
  width: min(1200px, 150vw);
  translate: -50% 0;
  opacity: var(--aura-opacity);
  pointer-events: none;
  /* Elliptical mask reaches full transparency at every edge of the hero. */
  -webkit-mask-image: radial-gradient(closest-side, #000 50%, transparent);
  mask-image: radial-gradient(closest-side, #000 50%, transparent);
}
.hero-aura::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  aspect-ratio: 1;
  translate: -50% -50%;
  background:
    radial-gradient(30% 30% at 32% 38%, rgba(142, 165, 202, 0.55), transparent 70%),
    radial-gradient(28% 28% at 68% 34%, rgba(241, 210, 186, 0.7), transparent 70%),
    radial-gradient(30% 30% at 56% 64%, rgba(196, 176, 226, 0.5), transparent 70%),
    radial-gradient(22% 22% at 40% 66%, rgba(156, 198, 190, 0.38), transparent 70%);
}
@media (prefers-reduced-motion: no-preference) {
  .hero-aura::before { animation: aura-drift 48s linear infinite; }
}
@keyframes aura-drift {
  to { transform: rotate(360deg); }
}

.byline-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: clamp(1.5rem, 1rem + 1.5vw, 2.25rem);
  padding: 4px 1rem 4px 4px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line), 0 6px 20px -10px rgba(0, 0, 0, 0.2);
  font-size: 0.9375rem;
  font-weight: 500;
}
.byline-chip img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
}
.byline-chip .chip-label { color: var(--text-secondary); }
.byline-chip .chip-label::after {
  content: "";
  display: inline-block;
  width: 1px;
  height: 0.875em;
  margin: 0 0.5rem 0 0.625rem;
  background: var(--line-strong);
  vertical-align: -0.1em;
}
.byline-chip svg {
  width: 12px;
  height: 12px;
  margin-left: -0.25rem;
  color: var(--text-secondary);
  transition: transform 0.25s var(--ease-out);
}
@media (hover: hover) {
  .byline-chip { transition: box-shadow 0.25s var(--ease-out); }
  .byline-chip:hover { box-shadow: 0 0 0 1px var(--line-strong), 0 10px 28px -12px rgba(0, 0, 0, 0.28); }
  .byline-chip:hover svg { transform: translateX(2px); }
}

.hero .display { max-width: 18ch; margin-inline: auto; }
.hero .lead { max-width: 38rem; margin: clamp(1.25rem, 1rem + 1vw, 1.75rem) auto 0; }

.hero .text-link { color: var(--link-on-tint); }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1.75rem;
  margin-top: clamp(2rem, 1.5rem + 1.5vw, 2.75rem);
}

@media (prefers-reduced-motion: no-preference) {
  .rise {
    animation: rise 0.9s var(--ease-out) both;
    animation-delay: var(--d, 0s);
  }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
}

/* Home: section heads ----------------------------------------------------- */
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-bottom: clamp(2rem, 1.5rem + 2vw, 3.5rem);
}
.section-head p {
  max-width: 34rem;
  margin-top: 0.875rem;
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
  color: var(--text-secondary);
  text-wrap: pretty;
}

/* Home: featured essay ---------------------------------------------------- */
.feature {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.5rem, 1rem + 3vw, 4rem);
  padding: 10px;
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--card-shadow);
}
.feature .cover {
  aspect-ratio: 16 / 11;
  border-radius: calc(var(--radius-xl) - 10px);
}
.feature .cover-mark svg { width: 22%; }
.feature-body {
  padding: 1.5rem clamp(1rem, 0.5rem + 2vw, 2.5rem) 1.5rem 0;
}
.feature-body .eyebrow { margin-bottom: 0.5rem; }
.feature-title {
  margin-top: 0.875rem;
  font-family: var(--font-display);
  font-size: clamp(1.875rem, 1.4rem + 1.8vw, 2.75rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.feature-excerpt {
  margin-top: 1rem;
  font-size: 1.125rem;
  line-height: 1.5;
  color: var(--text-secondary);
  text-wrap: pretty;
}
.feature-more {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 1.5rem;
  color: var(--link);
}
.feature-more svg { width: 14px; height: 14px; transition: transform 0.25s var(--ease-out); }
@media (hover: hover) {
  .feature:hover .feature-more svg { transform: translateX(3px); }
}

@media (max-width: 819px) {
  .feature { grid-template-columns: 1fr; gap: 0; }
  .feature-body { padding: 1.5rem 1rem 1.25rem; }
}

/* Home: essay grid -------------------------------------------------------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(2rem, 1rem + 2vw, 2.5rem) clamp(1rem, 0.5rem + 1.5vw, 1.75rem);
  margin: clamp(2.5rem, 2rem + 2vw, 4rem) 0 0;
  padding: 0;
  list-style: none;
}
.post-card {
  position: relative;
  border-radius: var(--radius-md);
}
.post-card .post-meta { margin-top: 1.25rem; }
.post-title {
  margin-top: 0.5rem;
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.post-excerpt {
  margin-top: 0.5rem;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-secondary);
  text-wrap: pretty;
}

@media (max-width: 899px) {
  .post-grid { grid-template-columns: 1fr; }
}
@media (min-width: 600px) and (max-width: 899px) {
  .post-card {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    grid-template-rows: 1fr auto auto auto 1fr;
    column-gap: 1.75rem;
  }
  .post-card .cover { grid-column: 1; grid-row: 1 / -1; }
  .post-card > :not(.cover) { grid-column: 2; }
  .post-card .post-meta { grid-row: 2; margin-top: 0; }
  .post-card .post-title { grid-row: 3; }
  .post-card .post-excerpt { grid-row: 4; }
}

/* Home: short notes ------------------------------------------------------- */
.notes-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.note {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2.5rem;
  min-height: 15rem;
  padding: clamp(1.5rem, 1.1rem + 1.6vw, 2.5rem);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.note blockquote {
  font-family: var(--font-serif);
  font-size: clamp(1.375rem, 1.15rem + 0.8vw, 1.875rem);
  font-weight: 400;
  line-height: 1.28;
  letter-spacing: -0.012em;
  text-wrap: pretty;
}
.note-index {
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}
@media (max-width: 719px) {
  .notes-grid { grid-template-columns: 1fr; }
  .note { min-height: 0; }
}

/* Home: about ------------------------------------------------------------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  align-items: center;
  gap: clamp(2.5rem, 1rem + 6vw, 7rem);
}
.portrait {
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-xl);
  background: #a9bdd4;
}
.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 15%;
}
.about-copy .heading { max-width: 16ch; }
.about-copy p:not(.eyebrow) {
  margin-top: 1.25rem;
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
  line-height: 1.6;
  color: var(--text-secondary);
  text-wrap: pretty;
}
.about-copy p strong { font-weight: 600; color: var(--text); }
.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem 2rem;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}
.facts dt {
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}
.facts dd { font-weight: 500; }
.facts a {
  color: var(--link);
  text-underline-offset: 0.2em;
}
.facts a:hover { text-decoration: underline; }

@media (max-width: 819px) {
  .about-grid { grid-template-columns: 1fr; }
  .portrait { max-width: 22rem; aspect-ratio: 1; }
}

/* Home: contact ----------------------------------------------------------- */
.contact { text-align: center; }
.contact .heading { max-width: 14ch; margin-inline: auto; }
.contact .lead { max-width: 34rem; margin: 1.25rem auto 0; }
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 2.5rem;
}
@media (max-width: 479px) {
  .contact-actions .button { flex: 1 1 100%; }
}

/* Footer ------------------------------------------------------------------ */
.site-footer {
  padding: 1.75rem 0 2.25rem;
  border-top: 1px solid var(--line);
  font-size: 0.875rem;
  color: var(--text-secondary);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 2rem;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--text); }

/* Scroll reveal (content stays visible without JS or with reduced motion) - */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
    transition-delay: var(--d, 0s);
  }
  .js .reveal.is-visible {
    opacity: 1;
    transform: none;
  }
}

/* Essay ------------------------------------------------------------------- */
.essay { padding-bottom: clamp(3.5rem, 2.5rem + 3vw, 5.5rem); }

.reading-progress {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  z-index: 51;
  height: 2px;
  pointer-events: none;
}
.reading-progress span {
  display: block;
  height: 100%;
  background: var(--text);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

.essay-head {
  width: min(100% - 2 * var(--gutter), 48rem);
  margin-inline: auto;
  padding-top: calc(var(--nav-h) + clamp(2.5rem, 1.5rem + 4vw, 5.5rem));
  text-align: center;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 44px;
  margin-bottom: 1rem;
  font-size: 0.9375rem;
  color: var(--link);
}
.back-link svg { width: 14px; height: 14px; transition: transform 0.25s var(--ease-out); }
@media (hover: hover) {
  .back-link:hover { text-decoration: underline; text-underline-offset: 0.2em; }
  .back-link:hover svg { transform: translateX(-3px); }
}
.essay-head .post-meta { justify-content: center; font-size: 0.9375rem; }
.essay-title {
  margin-top: 1rem;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 1.5rem + 4.4vw, 4.75rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.038em;
  text-wrap: balance;
}
.essay-dek {
  max-width: 36rem;
  margin: 1.25rem auto 0;
}

.essay-cover {
  width: min(100% - 2 * var(--gutter), var(--max));
  margin: clamp(2.5rem, 2rem + 3vw, 4.5rem) auto;
  aspect-ratio: 21 / 9;
  border-radius: var(--radius-xl);
}
.essay-cover .cover-mark svg { width: 11%; }
@media (max-width: 599px) {
  .essay-cover { aspect-ratio: 4 / 3; border-radius: var(--radius-lg); }
  .essay-cover .cover-mark svg { width: 22%; }
}

.prose {
  width: min(100% - 2 * var(--gutter), var(--measure));
  margin-inline: auto;
  font-family: var(--font-serif);
  font-size: clamp(1.1875rem, 1.1rem + 0.35vw, 1.3125rem);
  font-weight: 400;
  line-height: 1.68;
  letter-spacing: 0;
  font-optical-sizing: auto;
  hanging-punctuation: first;
}
.prose p { text-wrap: pretty; }
.prose p + p { margin-top: 1.3em; }
.prose blockquote {
  margin: 2em 0;
  padding-left: 1.25rem;
  border-left: 2px solid var(--text);
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.022em;
  text-wrap: balance;
}
.prose blockquote + p { margin-top: 0; }

.essay-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  width: min(100% - 2 * var(--gutter), var(--measure));
  margin: clamp(3rem, 2.5rem + 2vw, 4.5rem) auto 0;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}
.author {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}
.author img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}
.author-name { font-weight: 600; }
.author-role { font-size: 0.9375rem; color: var(--text-secondary); }
.share {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.copy-status {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.next {
  padding-block: clamp(4rem, 3rem + 4vw, 7rem);
}
.next-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  align-items: center;
  gap: clamp(1.25rem, 1rem + 2vw, 3rem);
  padding: 10px;
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--card-shadow);
}
.next-card .cover {
  aspect-ratio: 16 / 10;
  border-radius: calc(var(--radius-xl) - 10px);
}
.next-card .cover-mark svg { width: 24%; }
.next-card .post-title {
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.125rem);
  letter-spacing: -0.028em;
  line-height: 1.1;
}
.next-card > div:last-child { padding-right: 1.5rem; }
@media (max-width: 679px) {
  .next-card { grid-template-columns: 1fr; gap: 0; }
  .next-card > div:last-child { padding: 1.25rem 0.75rem 1rem; }
}

/* Forced colors ----------------------------------------------------------- */
@media (forced-colors: active) {
  .feature,
  .next-card,
  .note,
  .byline-chip { border: 1px solid CanvasText; }
  .lang-switch button[aria-pressed="true"] { outline: 2px solid Highlight; }
}
