/* ==========================================================================
   Devank Arolkar — personal portfolio
   A warm-paper editorial system with a technical, lab-notebook edge.
   No frameworks. No build step. Hand-written CSS.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Fonts
   All fonts are self-hosted (SIL Open Font License) for speed and privacy.
   -------------------------------------------------------------------------- */
@font-face {
  font-family: "Instrument Sans";
  src: url("../assets/fonts/instrument-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Serif";
  src: url("../assets/fonts/instrument-serif.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Serif";
  src: url("../assets/fonts/instrument-serif-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("../assets/fonts/ibm-plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("../assets/fonts/ibm-plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* --------------------------------------------------------------------------
   2. Design tokens
   -------------------------------------------------------------------------- */
:root {
  --font-sans: "Instrument Sans", ui-sans-serif, system-ui, -apple-system,
    "Segoe UI", sans-serif;
  --font-serif: "Instrument Serif", "Iowan Old Style", "Palatino Linotype",
    Georgia, serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas,
    monospace;

  --paper: #f3f0e8;
  --paper-2: #ebe7dc;
  --paper-3: #e2ddd0;
  --ink: #151410;
  --ink-2: #3c3a33;
  --muted: #68655c;
  --line: #d3cdc0;
  --line-strong: #b9b2a3;
  --control: #8a8579;
  --accent: #e8451f;
  --accent-ink: #b8320f;
  --accent-soft: #f6ddd2;
  --on-accent: #1a0c07;
  --focus: #b8320f;

  --inverse-bg: #151410;
  --inverse-ink: #f3f0e8;
  --inverse-muted: #a7a194;
  --inverse-line: #34312a;

  --gutter: clamp(20px, 4vw, 56px);
  --max-width: 1360px;
  --grid-gap: clamp(16px, 2vw, 28px);
  --header-height: 72px;
  --radius: 2px;
  --shadow-soft: 0 18px 50px rgba(21, 20, 16, 0.06);
}

[data-theme="dark"] {
  --paper: #131210;
  --paper-2: #1b1a17;
  --paper-3: #24221d;
  --ink: #f2efe6;
  --ink-2: #cbc7bc;
  --muted: #9a9588;
  --line: #302e28;
  --line-strong: #4a463d;
  --control: #6f6a5f;
  --accent: #ff5a2b;
  --accent-ink: #ff7a52;
  --accent-soft: #33170e;
  --on-accent: #160a06;
  --focus: #ff7a52;

  --inverse-bg: #1b1a17;
  --inverse-ink: #f2efe6;
  --inverse-muted: #a8a294;
  --inverse-line: #38352d;

  --shadow-soft: 0 18px 50px rgba(0, 0, 0, 0.24);
}

/* --------------------------------------------------------------------------
   3. Reset & base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 24px);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.62;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.nav-open {
  overflow: hidden;
}

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

svg {
  overflow: visible;
}

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

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

ul,
ol {
  margin-top: 0;
}

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

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

/* The skip link targets <main>; suppress the container outline but keep every
   interactive element's focus style. */
main:focus {
  outline: none;
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.02em;
}

p {
  margin-top: 0;
}

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

.sr-only {
  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: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  padding: 12px 18px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transform: translateY(-160%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.mono,
.eyebrow,
.section-index,
.label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: var(--muted);
}

.eyebrow__dot {
  width: 5px;
  height: 5px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
}

.section-index {
  margin: 0;
  color: var(--muted);
}

.section-index span {
  color: var(--accent-ink);
}

.section {
  padding-block: clamp(72px, 9vw, 132px);
}

.section--ruled {
  border-top: 1px solid var(--line);
}

.section-head {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--grid-gap);
  align-items: end;
  padding-bottom: clamp(20px, 2.5vw, 32px);
  margin-bottom: clamp(36px, 5vw, 64px);
  border-bottom: 1px solid var(--line);
}

.section-head__index {
  grid-column: 1 / span 2;
  align-self: start;
  padding-top: 8px;
}

.section-head h2 {
  grid-column: 3 / span 7;
  max-width: 17ch;
  font-size: clamp(2.3rem, 4.5vw, 4.35rem);
  line-height: 0.98;
  letter-spacing: -0.025em;
}

.section-head h2 em {
  font-style: italic;
  color: var(--accent-ink);
}

.section-head__note {
  grid-column: 10 / span 3;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   5. Buttons & links
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  min-height: 48px;
  padding: 0.85rem 1.25rem;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  transition: background-color 0.25s ease, border-color 0.25s ease,
    color 0.25s ease;
}

.btn svg {
  flex: none;
  transition: transform 0.3s ease;
}

.btn:hover svg {
  transform: translateX(3px);
}

.btn--primary {
  background: var(--ink);
  color: var(--paper);
}

.btn--primary:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

.btn--ghost:hover {
  background: var(--ink);
  color: var(--paper);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 3px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.text-link:hover {
  color: var(--accent-ink);
  border-color: var(--accent-ink);
}

.text-link svg {
  transition: transform 0.3s ease;
}

.text-link:hover svg {
  transform: translateX(3px);
}

/* --------------------------------------------------------------------------
   6. Topline & header
   -------------------------------------------------------------------------- */
.topline {
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.topline__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 8px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.topline__group {
  display: flex;
  align-items: center;
  gap: 9px;
}

.topline__status {
  color: var(--ink-2);
}

.topline__status::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: 1px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  transition: box-shadow 0.25s ease;
}

.site-header.is-scrolled {
  box-shadow: 0 1px 0 var(--line), 0 10px 30px rgba(21, 20, 16, 0.045);
}

[data-theme="dark"] .site-header.is-scrolled {
  box-shadow: 0 1px 0 var(--line), 0 10px 30px rgba(0, 0, 0, 0.24);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--header-height);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
  line-height: 1;
}

.brand__mark {
  width: 25px;
  height: 25px;
  flex: none;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.brand:hover .brand__mark {
  transform: rotate(60deg);
}

.brand__name {
  font-family: var(--font-serif);
  font-size: 1.32rem;
  letter-spacing: -0.015em;
}

.brand__dot {
  color: var(--accent);
}

.site-header__nav {
  margin-left: auto;
}

.nav__list {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 30px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav__link {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding-block: 8px;
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.nav__link::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 2px;
  left: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.3s ease;
}

.nav__link:hover,
.nav__link.is-active {
  color: var(--ink);
}

.nav__link:hover::after,
.nav__link.is-active::after {
  transform: scaleX(1);
}

.nav__num {
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.04em;
  transition: color 0.2s ease;
}

.nav__link.is-active .nav__num {
  color: var(--accent-ink);
}

.nav__mobile-meta {
  display: none;
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--control);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  transition: border-color 0.2s ease, background-color 0.2s ease,
    color 0.2s ease;
}

.icon-btn:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.theme-toggle {
  display: none;
}

/* The toggle only works with JavaScript; do not present a dead control. */
.js .theme-toggle {
  display: grid;
}

.theme-toggle .icon-sun {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.menu-toggle span {
  display: block;
  width: 15px;
  height: 1px;
  background: currentColor;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.site-header.is-open .menu-toggle span:first-child {
  transform: translateY(2.5px) rotate(45deg);
}

.site-header.is-open .menu-toggle span:last-child {
  transform: translateY(-2.5px) rotate(-45deg);
}

.nav-scrim {
  position: fixed;
  inset: var(--header-height) 0 0;
  z-index: 90;
  background: rgba(21, 20, 16, 0.42);
  backdrop-filter: blur(1px);
}

/* --------------------------------------------------------------------------
   7. Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(
      to right,
      transparent calc(50% - 0.5px),
      var(--line) 50%,
      transparent calc(50% + 0.5px)
    );
  opacity: 0.25;
}

.hero__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  padding-block: clamp(48px, 7vw, 96px) clamp(48px, 6vw, 80px);
}

.hero__content {
  max-width: 760px;
}

.hero__eyebrow {
  margin-bottom: clamp(22px, 3vw, 34px);
}

.hero h1 {
  max-width: 11ch;
  font-size: clamp(3.5rem, 7.3vw, 7.15rem);
  line-height: 0.9;
  letter-spacing: -0.038em;
}

.hero h1 em {
  position: relative;
  color: var(--accent-ink);
  font-style: italic;
}

.hero h1 em::after {
  content: "";
  position: absolute;
  right: 0.04em;
  bottom: 0.01em;
  left: 0.02em;
  height: 0.035em;
  background: var(--accent);
  transform: rotate(-1.2deg);
  transform-origin: left center;
}

.hero__lede {
  max-width: 47ch;
  margin: clamp(26px, 3.5vw, 36px) 0 0;
  color: var(--ink-2);
  font-size: clamp(1.02rem, 1.35vw, 1.18rem);
  line-height: 1.58;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: clamp(26px, 3.5vw, 38px);
}

.hero__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  margin-top: clamp(34px, 5vw, 52px);
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.hero__foot-label {
  color: var(--accent-ink);
}

.hero__foot-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hero__foot-list li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hero__foot-list li + li::before {
  content: "·";
  color: var(--line-strong);
}

.hero__visual {
  display: flex;
  justify-content: flex-end;
  min-width: 0;
}

.instrument {
  width: min(100%, 570px);
  margin: 0;
}

.instrument svg {
  width: 100%;
  height: auto;
}

.instrument__text {
  fill: var(--muted);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.instrument__text-strong {
  fill: var(--ink);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.instrument__text-accent {
  fill: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.instrument__line {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 0.8;
}

.instrument__line-faint {
  fill: none;
  stroke: var(--line);
  stroke-width: 0.7;
}

.instrument__accent {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.2;
}

.instrument__dot {
  fill: var(--ink);
}

.instrument__dot-accent {
  fill: var(--accent);
}

.instrument__square {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 0.9;
}

.instrument__center {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 1;
}

.instrument__rotate {
  transform-origin: 300px 300px;
  animation: instrument-spin 180s linear infinite;
}

.instrument__rotate-reverse {
  transform-origin: 300px 300px;
  animation: instrument-spin 240s linear infinite reverse;
}

.instrument__pulse {
  animation: instrument-pulse 4s ease-in-out infinite;
}

@keyframes instrument-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes instrument-pulse {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.18);
  }
}

.hero-strip {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.hero-strip__list {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.hero-strip__item {
  padding: 17px 16px 18px;
  border-left: 1px solid var(--line);
}

.hero-strip__item:first-child {
  padding-left: 0;
  border-left: 0;
}

.hero-strip__num {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.hero-strip__name {
  display: block;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.25;
}

.hero-strip__desc {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.35;
}

/* --------------------------------------------------------------------------
   8. About
   -------------------------------------------------------------------------- */
.about__grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: clamp(40px, 7vw, 110px);
  align-items: start;
}

.about__copy {
  max-width: 66ch;
}

.about__copy .lead {
  margin-bottom: 1.1em;
  font-family: var(--font-serif);
  font-size: clamp(1.55rem, 2.55vw, 2.2rem);
  line-height: 1.18;
  letter-spacing: -0.018em;
}

.about__copy .lead::first-letter {
  float: left;
  padding-right: 0.09em;
  color: var(--accent-ink);
  font-family: var(--font-serif);
  font-size: 4.15em;
  line-height: 0.74;
}

.about__copy p {
  margin-bottom: 1.15em;
  color: var(--ink-2);
  font-size: 1.01rem;
  line-height: 1.68;
}

.about__copy p:last-child {
  margin-bottom: 0;
}

.about__signoff {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.about__signoff::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--accent);
}

.about__aside {
  border-top: 1px solid var(--ink);
  padding-top: 16px;
}

.facts {
  margin: 0;
}

.facts__row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.facts dt {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.facts dd {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.86rem;
  line-height: 1.45;
}

.principles {
  margin-top: 34px;
}

.principles__title {
  margin-bottom: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.principles__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.principles__item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.principles__num {
  padding-top: 2px;
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: 8px;
}

.principles__item strong {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.3;
}

.principles__item span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

/* --------------------------------------------------------------------------
   9. Projects
   -------------------------------------------------------------------------- */
.projects__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--grid-gap);
}

.project-card {
  position: relative;
  display: flex;
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--paper);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
}

.project-card__anchor {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
}

.project-card__visual {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--paper-2);
}

.project-card__visual svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.project-card:hover .project-card__visual svg {
  transform: scale(1.018);
}

.project-card__content {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: clamp(20px, 2.3vw, 30px);
}

.project-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.project-card__num {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.project-card__category {
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.07em;
  text-align: right;
  text-transform: uppercase;
}

.project-card__title {
  font-size: clamp(1.7rem, 2.25vw, 2.35rem);
  line-height: 0.98;
}

.project-card__title span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.35;
}

.project-card__desc {
  margin: 14px 0 0;
  color: var(--ink-2);
  font-size: 0.9rem;
  line-height: 1.55;
}

.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.project-card__tags li {
  padding: 3px 6px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.04em;
  line-height: 1.3;
  text-transform: uppercase;
}

.project-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.project-card__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.project-card__status::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}

.project-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.project-card__cta svg {
  transition: transform 0.3s ease;
}

.project-card:hover .project-card__cta svg {
  transform: translateX(4px);
}

/* Shared styling for the hand-built SVG project illustrations. */
.visual--paper {
  background: var(--paper-2);
}

.visual--ink {
  background: var(--inverse-bg);
}

.visual--accent {
  background: var(--accent-soft);
}

.v-line {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 1;
}

.v-line-faint {
  fill: none;
  stroke: var(--line);
  stroke-width: 0.8;
}

.v-ink-line {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.2;
}

.v-ink-fill {
  fill: var(--ink);
}

.v-paper-fill {
  fill: var(--paper);
}

.v-muted-fill {
  fill: var(--muted);
}

.v-accent-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
}

.v-accent-fill {
  fill: var(--accent);
}

.v-node {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 1;
}

.v-node-accent {
  fill: var(--accent);
}

.v-text {
  fill: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.v-text-ink {
  fill: var(--ink);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.v-text-accent {
  fill: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.v-text-inverse {
  fill: var(--inverse-muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.v-text-inverse-strong {
  fill: var(--inverse-ink);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.v-text-inverse-accent {
  fill: var(--accent);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.v-text--xs {
  font-size: 7px;
  letter-spacing: 0.1em;
}

.v-text--sm {
  font-size: 8px;
}

.v-text--lg {
  font-size: 12px;
}

.v-big-number {
  fill: none;
  stroke: var(--line);
  stroke-width: 1;
  font-family: var(--font-serif);
  font-size: 210px;
  line-height: 1;
  opacity: 0.75;
}

.visual--ink .v-big-number {
  stroke: var(--inverse-line);
}

.v-dash {
  stroke-dasharray: 5 6;
}

.v-faint-ink {
  fill: none;
  stroke: var(--inverse-line);
  stroke-width: 1;
}

.v-inverse-fill {
  fill: var(--inverse-line);
}

.v-inverse-ink-fill {
  fill: var(--inverse-ink);
}

.v-inverse-line {
  fill: none;
  stroke: var(--inverse-ink);
  stroke-width: 1.2;
}

/* The featured project spans the full grid. */
.project-card--feature {
  grid-column: 1 / -1;
}

.project-card--feature .project-card__anchor {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
}

.project-card--feature .project-card__visual {
  min-height: 455px;
  border-right: 1px solid var(--line);
  border-bottom: 0;
}

.project-card--feature .project-card__content {
  padding: clamp(26px, 3.5vw, 46px);
}

.project-card--feature .project-card__title {
  font-size: clamp(2.5rem, 3.7vw, 3.7rem);
}

.project-card--feature .project-card__desc {
  font-size: 1rem;
}

.project-card--feature .project-card__meta {
  margin-bottom: 22px;
}

/* Three standard cards sit beneath the feature. */
.project-card--standard {
  grid-column: span 4;
}

.project-card--standard .project-card__visual {
  aspect-ratio: 4 / 3;
}

.projects__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: clamp(24px, 3vw, 36px);
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   10. Fields / interests (inverted section)
   -------------------------------------------------------------------------- */
.section--fields {
  position: relative;
  overflow: hidden;
  background: var(--inverse-bg);
  color: var(--inverse-ink);
}

.section--fields::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(var(--inverse-line) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: 0.36;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 78%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 78%);
}

.section--fields > .container {
  position: relative;
  z-index: 1;
}

.section--fields .section-head {
  border-color: var(--inverse-line);
}

.section--fields .section-head__index,
.section--fields .section-head__note {
  color: var(--inverse-muted);
}

.section--fields .section-index span {
  color: var(--accent);
}

.section--fields .section-head h2 {
  color: var(--inverse-ink);
}

.section--fields .section-head h2 em {
  color: var(--accent);
}

.fields__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(36px, 6vw, 90px);
}

.fields__group-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 4px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--inverse-line);
  color: var(--inverse-muted);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.fields__group-title span:last-child {
  color: var(--accent);
}

.fields__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.fields__item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--inverse-line);
  transition: padding-left 0.25s ease, border-color 0.25s ease;
}

.fields__item:hover {
  padding-left: 7px;
  border-color: var(--accent);
}

.fields__num {
  padding-top: 4px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.06em;
}

.fields__name {
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 2vw, 1.85rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.015em;
}

.fields__desc {
  max-width: 46ch;
  margin: 5px 0 0;
  color: var(--inverse-muted);
  font-size: 0.83rem;
  line-height: 1.5;
}

.fields__overlap {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: clamp(24px, 5vw, 70px);
  align-items: start;
  margin-top: clamp(42px, 6vw, 76px);
  padding-top: 24px;
  border-top: 1px solid var(--inverse-line);
}

.fields__overlap p {
  margin: 0;
}

.fields__overlap p:first-child {
  max-width: 30ch;
  color: var(--inverse-ink);
  font-family: var(--font-serif);
  font-size: clamp(1.45rem, 2.4vw, 2.15rem);
  line-height: 1.13;
  letter-spacing: -0.015em;
}

.fields__overlap p:last-child {
  color: var(--inverse-muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

/* --------------------------------------------------------------------------
   11. Writing / notebook
   -------------------------------------------------------------------------- */
.writing__grid {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: clamp(40px, 7vw, 110px);
  align-items: start;
}

.writing__statement {
  max-width: 15ch;
  font-size: clamp(2rem, 3.6vw, 3.3rem);
  line-height: 1.03;
  letter-spacing: -0.025em;
}

.writing__statement em {
  color: var(--accent-ink);
  font-style: italic;
}

.writing__intro {
  max-width: 45ch;
  margin: 22px 0 0;
  color: var(--ink-2);
  font-size: 0.98rem;
}

.writing__cta {
  margin-top: 28px;
}

.notebook {
  border-top: 1px solid var(--ink);
}

.notebook__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.notebook__head span:last-child {
  color: var(--accent-ink);
}

.notebook__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.notebook__item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.notebook__num {
  padding-top: 3px;
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: 8px;
}

.notebook__name {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
}

.notebook__desc {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.notebook__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.notebook__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.notebook__status::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}

/* --------------------------------------------------------------------------
   12. Contact
   -------------------------------------------------------------------------- */
.section--contact {
  padding-bottom: clamp(80px, 10vw, 150px);
}

.contact-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(34px, 6vw, 90px);
  overflow: hidden;
  padding: clamp(28px, 5vw, 64px);
  border: 1px solid var(--line);
  background: var(--paper-2);
}

.contact-panel::before {
  content: "";
  position: absolute;
  top: -80px;
  right: -70px;
  width: 260px;
  height: 260px;
  border: 1px solid var(--line);
  border-radius: 50%;
  pointer-events: none;
}

.contact-panel::after {
  content: "";
  position: absolute;
  top: 38px;
  right: 28px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: none;
}

.contact-panel__intro {
  position: relative;
  z-index: 1;
}

.contact-panel h2 {
  max-width: 12ch;
  margin-top: 20px;
  font-size: clamp(2.55rem, 5.4vw, 5.1rem);
  line-height: 0.94;
  letter-spacing: -0.035em;
}

.contact-panel h2 em {
  color: var(--accent-ink);
  font-style: italic;
}

.contact-panel__lede {
  max-width: 44ch;
  margin: 24px 0 0;
  color: var(--ink-2);
  font-size: 0.98rem;
}

.contact-panel__note {
  max-width: 42ch;
  margin: 22px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.contact-list {
  position: relative;
  z-index: 1;
  align-self: end;
  border-top: 1px solid var(--ink);
}

.contact-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.contact-row__label {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.contact-row__value {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.4;
}

.contact-row__tag {
  padding: 3px 6px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.06em;
  line-height: 1.3;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   13. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--inverse-bg);
  color: var(--inverse-ink);
}

.site-footer a {
  color: inherit;
}

.footer__top {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 0.7fr));
  gap: clamp(28px, 5vw, 72px);
  padding-block: clamp(52px, 7vw, 90px);
  border-bottom: 1px solid var(--inverse-line);
}

.footer__brand {
  max-width: 14ch;
  font-family: var(--font-serif);
  font-size: clamp(2.1rem, 3.7vw, 3.5rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
}

.footer__brand span {
  display: block;
  margin-top: 16px;
  color: var(--inverse-muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  line-height: 1.5;
  text-transform: uppercase;
}

.footer__col h3 {
  margin-bottom: 14px;
  color: var(--inverse-muted);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.footer__col ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer__col a,
.footer__col span {
  color: var(--inverse-ink);
  font-size: 0.84rem;
  line-height: 1.4;
}

.footer__col a {
  transition: color 0.2s ease;
}

.footer__col a:hover {
  color: var(--accent);
}

.footer__col .is-pending {
  color: var(--inverse-muted);
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  padding-block: 18px 26px;
  color: var(--inverse-muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.05em;
  line-height: 1.5;
  text-transform: uppercase;
}

.footer__closing {
  color: var(--inverse-ink);
  font-family: var(--font-serif);
  font-size: 1rem;
  font-style: italic;
  letter-spacing: 0;
  text-transform: none;
}

.footer__top-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s ease;
}

.footer__top-link:hover {
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   14. Project detail pages
   -------------------------------------------------------------------------- */
.page-hero {
  padding-block: clamp(38px, 5vw, 70px) clamp(34px, 5vw, 58px);
}

.breadcrumbs {
  margin-bottom: clamp(28px, 4vw, 44px);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumbs li + li::before {
  content: "/";
  margin-right: 7px;
  color: var(--line-strong);
}

.breadcrumbs a {
  transition: color 0.2s ease;
}

.breadcrumbs a:hover {
  color: var(--accent-ink);
}

.breadcrumbs [aria-current="page"] {
  color: var(--ink-2);
}

.page-hero h1 {
  max-width: 12ch;
  font-size: clamp(3.3rem, 8vw, 7.4rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
}

.page-hero h1 em {
  color: var(--accent-ink);
  font-style: italic;
}

.page-hero__sub {
  display: block;
  max-width: 30ch;
  margin-top: 18px;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: clamp(0.9rem, 1.4vw, 1.1rem);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.4;
}

.page-hero__lede {
  max-width: 61ch;
  margin: 28px 0 0;
  color: var(--ink-2);
  font-size: clamp(1.05rem, 1.55vw, 1.3rem);
  line-height: 1.55;
}

.project-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 38px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.project-facts dt {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-facts dd {
  margin: 6px 0 0;
  color: var(--ink-2);
  font-size: 0.84rem;
  line-height: 1.45;
}

.project-hero-visual {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--paper-2);
}

.project-hero-visual svg {
  width: 100%;
  height: auto;
}

.project-body {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 7fr);
  gap: clamp(36px, 7vw, 110px);
  padding-block: clamp(52px, 7vw, 100px);
}

.project-aside {
  position: sticky;
  top: calc(var(--header-height) + 26px);
  align-self: start;
}

.project-aside__title {
  margin: 0 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--ink);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.project-aside__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.project-aside__list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 0.8rem;
  line-height: 1.4;
}

.project-aside__list span:first-child {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.project-aside__note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.5;
}

.prose {
  max-width: 68ch;
}

.prose > p:first-child {
  font-size: 1.09rem;
  line-height: 1.65;
}

.prose p {
  margin: 0 0 1.15em;
  color: var(--ink-2);
}

.prose h2 {
  margin: 2.1em 0 0.55em;
  font-size: clamp(1.8rem, 2.8vw, 2.55rem);
  line-height: 1;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose h3 {
  margin: 1.7em 0 0.4em;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.4;
}

.prose ul,
.prose ol {
  margin: 0 0 1.2em;
  padding-left: 1.2em;
}

.prose li {
  margin-bottom: 0.45em;
  color: var(--ink-2);
}

.prose blockquote {
  margin: 2em 0;
  padding-left: 22px;
  border-left: 2px solid var(--accent);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 2.2vw, 1.8rem);
  line-height: 1.2;
}

.prose blockquote p {
  margin: 0;
  color: inherit;
}

.prose code {
  padding: 0.12em 0.35em;
  border: 1px solid var(--line);
  background: var(--paper-2);
  font-family: var(--font-mono);
  font-size: 0.82em;
}

.prose pre {
  overflow-x: auto;
  margin: 1.5em 0;
  padding: 20px;
  background: var(--inverse-bg);
  color: var(--inverse-ink);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.6;
}

.prose pre code {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
}

.prose hr {
  margin: 2.5em 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.project-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--grid-gap);
  padding-bottom: clamp(60px, 8vw, 110px);
}

.project-nav a {
  display: block;
  padding: 20px;
  border: 1px solid var(--line);
  transition: border-color 0.25s ease, background-color 0.25s ease;
}

.project-nav a:hover {
  border-color: var(--ink);
  background: var(--paper-2);
}

.project-nav span {
  display: block;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-nav strong {
  display: block;
  margin-top: 6px;
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 2.2vw, 1.9rem);
  font-weight: 400;
  line-height: 1;
}

.project-nav--next {
  text-align: right;
}

/* --------------------------------------------------------------------------
   15. Writing index & article template
   -------------------------------------------------------------------------- */
.writing-page__hero {
  padding-block: clamp(44px, 6vw, 82px) clamp(38px, 5vw, 64px);
}

.writing-page__hero h1 {
  max-width: 11ch;
  font-size: clamp(3.1rem, 7.5vw, 6.9rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
}

.writing-page__hero h1 em {
  color: var(--accent-ink);
  font-style: italic;
}

.writing-page__lede {
  max-width: 56ch;
  margin: 26px 0 0;
  color: var(--ink-2);
  font-size: clamp(1.02rem, 1.5vw, 1.2rem);
}

.writing-index {
  margin-top: clamp(36px, 5vw, 58px);
  border-top: 1px solid var(--ink);
}

.writing-index__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.writing-entry {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 20px;
  align-items: baseline;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
  transition: padding-left 0.25s ease, border-color 0.25s ease;
}

.writing-entry:hover {
  padding-left: 7px;
  border-color: var(--line-strong);
}

.writing-entry__num {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
}

.writing-entry__title {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 2.7vw, 2.35rem);
  line-height: 1;
}

.writing-entry__desc {
  max-width: 58ch;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.writing-entry__tag {
  padding: 3px 6px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.06em;
  line-height: 1.3;
  text-transform: uppercase;
  white-space: nowrap;
}

.writing-topics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--grid-gap);
  margin-top: clamp(48px, 6vw, 76px);
}

.writing-topic {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.writing-topic__num {
  display: block;
  margin-bottom: 10px;
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.06em;
}

.writing-topic h2 {
  font-size: 1.45rem;
  line-height: 1;
}

.writing-topic p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.article-header {
  max-width: 840px;
  margin-inline: auto;
  padding-block: clamp(38px, 5vw, 68px) clamp(30px, 4vw, 48px);
}

.article-header h1 {
  max-width: 18ch;
  font-size: clamp(2.7rem, 5.6vw, 4.7rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
}

.article-header__dek {
  max-width: 56ch;
  margin: 22px 0 0;
  color: var(--ink-2);
  font-size: clamp(1.02rem, 1.5vw, 1.2rem);
  line-height: 1.55;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.article-body {
  max-width: 68ch;
  margin-inline: auto;
  padding-bottom: clamp(60px, 8vw, 110px);
}

.article-body > p:first-of-type::first-letter {
  float: left;
  padding-right: 0.09em;
  color: var(--accent-ink);
  font-family: var(--font-serif);
  font-size: 4.2em;
  line-height: 0.74;
}

.article-body p {
  margin: 0 0 1.15em;
  color: var(--ink-2);
}

.article-body h2 {
  margin: 2.1em 0 0.55em;
  font-size: clamp(1.8rem, 2.8vw, 2.5rem);
}

.article-body h3 {
  margin: 1.7em 0 0.4em;
  font-family: var(--font-sans);
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: 0;
}

.article-body blockquote {
  margin: 2em 0;
  padding-left: 22px;
  border-left: 2px solid var(--accent);
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 2.2vw, 1.8rem);
  line-height: 1.2;
}

.article-body blockquote p {
  margin: 0;
  color: var(--ink);
}

.article-body ul,
.article-body ol {
  margin: 0 0 1.2em;
  padding-left: 1.2em;
}

.article-body li {
  margin-bottom: 0.45em;
  color: var(--ink-2);
}

.article-body code {
  padding: 0.12em 0.35em;
  border: 1px solid var(--line);
  background: var(--paper-2);
  font-family: var(--font-mono);
  font-size: 0.82em;
}

.article-body pre {
  overflow-x: auto;
  margin: 1.5em 0;
  padding: 20px;
  background: var(--inverse-bg);
  color: var(--inverse-ink);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.6;
}

.article-body pre code {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
}

.template-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  margin-bottom: 32px;
  padding: 12px 16px;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.06em;
  line-height: 1.5;
  text-transform: uppercase;
}

.template-banner strong {
  color: var(--accent-ink);
  font-weight: 500;
}

.article-footer {
  max-width: 68ch;
  margin-inline: auto;
  padding-block: 24px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.article-footer a {
  color: var(--ink);
  border-bottom: 1px solid var(--line-strong);
}

.article-footer a:hover {
  color: var(--accent-ink);
  border-color: var(--accent-ink);
}

/* --------------------------------------------------------------------------
   16. 404
   -------------------------------------------------------------------------- */
.error-page {
  display: grid;
  min-height: min(68vh, 660px);
  place-items: center;
  padding-block: clamp(64px, 10vw, 130px);
  text-align: center;
}

.error-page__inner {
  max-width: 620px;
}

.error-page__code {
  margin: 0 0 18px;
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.error-page h1 {
  font-size: clamp(3.4rem, 9vw, 7.5rem);
  line-height: 0.9;
  letter-spacing: -0.045em;
}

.error-page p {
  max-width: 42ch;
  margin: 24px auto 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.error-page__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 30px;
}

/* --------------------------------------------------------------------------
   17. Scroll reveal
   Content is visible by default. The .js class is added by main.js, and the
   observer reveals items only when JavaScript is available.
   -------------------------------------------------------------------------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* --------------------------------------------------------------------------
   18. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1120px) {
  .hero__grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  }

  .section-head h2 {
    grid-column: 3 / span 6;
  }

  .section-head__note {
    grid-column: 9 / span 4;
  }

  .about__grid {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
    gap: clamp(36px, 5vw, 70px);
  }

  .project-card--feature .project-card__visual {
    min-height: 400px;
  }
}

@media (max-width: 980px) {
  .project-card--standard {
    grid-column: span 6;
  }

  .project-card--standard:last-child {
    grid-column: span 12;
  }

  .project-card--standard:last-child .project-card__anchor {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .project-card--standard:last-child .project-card__visual {
    aspect-ratio: auto;
    min-height: 330px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }
}

@media (max-width: 900px) {
  :root {
    --header-height: 64px;
  }

  .topline__inner {
    font-size: 8px;
  }

  /* No-JS fallback: the navigation remains visible as a compact row. */
  .site-header__inner {
    flex-wrap: wrap;
    height: auto;
    padding-block: 10px;
  }

  .site-header__nav {
    order: 3;
    width: 100%;
    margin-left: 0;
  }

  .nav__list {
    gap: 18px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .nav__list::-webkit-scrollbar {
    display: none;
  }

  .nav__link {
    padding-block: 4px;
    font-size: 9px;
  }

  .theme-toggle,
  .menu-toggle {
    display: none;
  }

  /* With JS, the navigation becomes a proper mobile panel. */
  .js .site-header__inner {
    flex-wrap: nowrap;
    height: var(--header-height);
    padding-block: 0;
  }

  .js .site-header__nav {
    /* Absolute to the sticky header so the panel always opens directly below
       it, whether or not the top line is still in view. */
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    z-index: 95;
    order: initial;
    width: auto;
    max-height: calc(100dvh - var(--header-height) - 36px);
    margin-left: 0;
    padding: 18px var(--gutter) 32px;
    overflow-y: auto;
    border-bottom: 1px solid var(--line);
    background: var(--paper);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease,
      visibility 0s linear 0.25s;
  }

  .js .site-header.is-open .site-header__nav {
    opacity: 1;
    visibility: visible;
    transform: none;
    /* Make the panel focusable immediately when opening; delay hiding until
       the closing fade has finished. */
    transition: opacity 0.25s ease, transform 0.25s ease,
      visibility 0s linear 0s;
  }

  .js .nav__list {
    flex-direction: column;
    gap: 0;
    overflow: visible;
    padding-bottom: 0;
  }

  .js .nav__link {
    justify-content: flex-start;
    width: 100%;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
    font-family: var(--font-serif);
    font-size: clamp(1.8rem, 7vw, 2.4rem);
    letter-spacing: -0.015em;
    text-transform: none;
  }

  .js .nav__num {
    min-width: 24px;
    font-family: var(--font-mono);
    font-size: 9px;
  }

  .js .nav__link::after {
    display: none;
  }

  .js .theme-toggle {
    display: grid;
  }

  .js .menu-toggle {
    /* Keep the two bars in a tight column so the open state crosses into an X. */
    display: flex;
  }

  .js .nav-scrim {
    /* Start the scrim below the header rather than at the viewport top. */
    position: absolute;
    inset: 100% 0 auto 0;
    height: 100vh;
    display: block;
  }

  .nav__mobile-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 22px;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 8px;
    letter-spacing: 0.07em;
    text-transform: uppercase;
  }

  .hero__grid {
    grid-template-columns: 1fr;
    gap: clamp(34px, 6vw, 54px);
    padding-block: clamp(44px, 8vw, 72px) clamp(38px, 7vw, 58px);
  }

  .hero h1 {
    max-width: 10ch;
  }

  .hero__visual {
    justify-content: flex-start;
  }

  .instrument {
    width: min(100%, 500px);
  }

  .hero-strip__list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero-strip__item:nth-child(4) {
    padding-left: 0;
    border-left: 0;
  }

  .hero-strip__item:nth-child(n + 4) {
    border-top: 1px solid var(--line);
  }

  .section-head {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .section-head__index,
  .section-head h2,
  .section-head__note {
    grid-column: 1 / -1;
  }

  .section-head__index {
    padding-top: 0;
  }

  .section-head h2 {
    max-width: 18ch;
  }

  .section-head__note {
    max-width: 52ch;
  }

  .about__grid {
    grid-template-columns: 1fr;
  }

  .about__aside {
    max-width: 560px;
  }

  .project-card--feature .project-card__anchor {
    grid-template-columns: 1fr;
  }

  .project-card--feature .project-card__visual {
    min-height: 0;
    aspect-ratio: 16 / 10;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .project-card--feature .project-card__content {
    padding: clamp(24px, 5vw, 36px);
  }

  .project-card--standard:last-child .project-card__anchor {
    grid-template-columns: 1fr;
  }

  .project-card--standard:last-child .project-card__visual {
    min-height: 0;
    aspect-ratio: 16 / 10;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .fields__grid {
    grid-template-columns: 1fr;
    gap: 46px;
  }

  .fields__overlap {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .writing__grid {
    grid-template-columns: 1fr;
    gap: 42px;
  }

  .contact-panel {
    grid-template-columns: 1fr;
  }

  .contact-panel__lede,
  .contact-panel__note {
    max-width: 52ch;
  }

  .contact-list {
    align-self: auto;
    margin-top: 8px;
  }

  .footer__top {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer__brand {
    grid-column: 1 / -1;
    max-width: 18ch;
  }

  .project-body {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .project-aside {
    position: static;
    max-width: 520px;
  }

  .project-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 24px;
  }

  .writing-topics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 26px 20px;
  }
}

@media (max-width: 680px) {
  .topline__inner {
    gap: 10px;
  }

  .topline__coords {
    display: none;
  }

  .hero h1 {
    font-size: clamp(3.15rem, 14.5vw, 4.9rem);
  }

  .hero__lede {
    font-size: 1rem;
  }

  .hero__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero__actions .btn {
    width: 100%;
  }

  .hero-strip__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-strip__item:nth-child(3),
  .hero-strip__item:nth-child(5) {
    padding-left: 0;
    border-left: 0;
  }

  .hero-strip__item:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .hero-strip__item:nth-child(4) {
    padding-left: 16px;
    border-left: 1px solid var(--line);
  }

  .about__copy .lead {
    font-size: clamp(1.4rem, 5.5vw, 1.75rem);
  }

  .project-card--standard {
    grid-column: 1 / -1;
  }

  .project-card--standard .project-card__visual {
    aspect-ratio: 16 / 10;
  }

  .project-card--standard:last-child {
    grid-column: 1 / -1;
  }

  .project-card__foot {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .contact-row {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 8px 12px;
  }

  .contact-row__tag {
    grid-column: 2;
    justify-self: start;
  }

  .footer__top {
    grid-template-columns: 1fr 1fr;
    gap: 30px 22px;
  }

  .footer__bottom {
    align-items: flex-start;
    flex-direction: column;
  }

  .project-facts {
    grid-template-columns: 1fr 1fr;
  }

  .project-nav {
    grid-template-columns: 1fr;
  }

  .project-nav--next {
    text-align: left;
  }

  .writing-topics {
    grid-template-columns: 1fr;
  }

  .writing-entry {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 14px;
  }

  .writing-entry__tag {
    grid-column: 2;
    justify-self: start;
  }

  .article-meta {
    gap: 8px 14px;
  }
}

@media (max-width: 440px) {
  .brand__name {
    font-size: 1.15rem;
  }

  .hero h1 {
    font-size: clamp(2.95rem, 14.5vw, 4rem);
  }

  .section-head h2 {
    font-size: clamp(2.05rem, 9vw, 2.7rem);
  }

  .contact-panel {
    padding: 22px 18px;
  }

  .contact-panel h2 {
    font-size: clamp(2.25rem, 11vw, 3.1rem);
  }

  .project-card--feature .project-card__content {
    padding: 22px 18px;
  }

  .project-card__content {
    padding: 20px 18px;
  }

  .footer__top {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   19. Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }

  .instrument__rotate,
  .instrument__rotate-reverse,
  .instrument__pulse {
    animation: none;
  }
}

/* --------------------------------------------------------------------------
   20. Print
   -------------------------------------------------------------------------- */
@media print {
  .topline,
  .site-header,
  .site-footer,
  .hero__visual,
  .hero-strip,
  .project-card__visual,
  .nav-scrim,
  .skip-link {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  a {
    text-decoration: underline;
  }

  .section,
  .page-hero,
  .project-body {
    padding-block: 24px;
  }
}
