/* ============================================================
   Aniruddha Sarkar — portfolio
   A hand-written, dependency-free stylesheet.
   ============================================================ */

/* ---------- Fonts ---------- */
@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono-var.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --paper: #f5f2ea;
  --paper-2: #ece7db;
  --paper-3: #e3ddcf;
  --card: #fbf9f3;
  --ink: #171612;
  --ink-2: #2b2822;
  --ink-soft: #514d44;
  --muted: #6b655a;
  --line: rgba(23, 22, 18, 0.14);
  --line-strong: rgba(23, 22, 18, 0.28);
  --green: #1d5c4b;
  --green-dark: #123c31;
  --green-pale: #dfe9e2;
  --terra: #ad4f2c;
  --terra-light: #e29a78;
  --terra-pale: #f0d9cb;
  --dark: #0f1713;
  --dark-2: #16221c;
  --dark-3: #1c2b24;
  --cream: #f5f2ea;
  --cream-muted: #a9b5ac;
  --cream-line: rgba(245, 242, 234, 0.14);
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --container: 1180px;
  --radius: 16px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow: 0 24px 70px -34px rgba(23, 22, 18, 0.45);
  --header-h: 78px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #12140f;
  --paper-2: #181b15;
  --paper-3: #22261d;
  --card: #1a1d16;
  --ink: #f1eee3;
  --ink-2: #ddd8ca;
  --ink-soft: #b9b3a4;
  --muted: #979183;
  --line: rgba(241, 238, 227, 0.14);
  --line-strong: rgba(241, 238, 227, 0.3);
  --green: #7cc0a4;
  --green-dark: #0e2b23;
  --green-pale: rgba(124, 192, 164, 0.14);
  --terra: #e08a63;
  --terra-light: #e29a78;
  --terra-pale: rgba(224, 138, 99, 0.16);
  --dark: #0c110e;
  --shadow: 0 24px 70px -34px rgba(0, 0, 0, 0.8);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.032;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 220 220' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

body.nav-open {
  overflow: hidden;
}

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

img {
  height: auto;
}

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

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

button {
  cursor: pointer;
}

ul,
ol,
dl,
dd {
  margin: 0;
  padding: 0;
}

li {
  list-style: none;
}

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

::selection {
  background: var(--green);
  color: var(--cream);
}

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

.skip-link:focus {
  left: 0 !important;
  outline-offset: -2px;
}

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

/* ---------- Shared layout ---------- */
.container {
  width: min(100% - 48px, var(--container));
  margin-inline: auto;
}

.section {
  padding: clamp(72px, 9vw, 124px) 0;
  position: relative;
}

.section--tight {
  padding-top: clamp(56px, 6vw, 84px);
}

.section--dark {
  background: var(--dark);
  color: var(--cream);
}

.section--tint {
  background: var(--paper-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-head {
  max-width: 760px;
}

.section-head--split {
  max-width: none;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.65fr);
  gap: 32px 64px;
  align-items: end;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--green);
}

.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border: 1px solid currentColor;
  transform: rotate(45deg);
  flex: none;
}

.section--dark .eyebrow {
  color: #a9cdb9;
}

h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(42px, 5.2vw, 68px);
  line-height: 0.98;
  letter-spacing: -0.015em;
  margin-top: 18px;
}

h2 em,
h1 em {
  font-style: italic;
  color: var(--terra);
}

.section--dark h2 em {
  color: var(--terra-light);
}

.section-head > p {
  margin-top: 22px;
  max-width: 60ch;
  color: var(--ink-soft);
  font-size: 16px;
}

.section--dark .section-head > p {
  color: var(--cream-muted);
}

.section-head--split > p {
  margin-top: 0;
  font-size: 14px;
  line-height: 1.7;
}

.lead {
  font-family: var(--serif);
  font-size: clamp(24px, 2.5vw, 31px);
  line-height: 1.3;
  color: var(--ink);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--green);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: border-color 0.25s, color 0.25s;
}

.text-link:hover {
  color: var(--terra);
  border-color: currentColor;
}

/* ---------- Icons ---------- */
.icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  flex: none;
  background-color: currentColor;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.icon--arrow-up-right { -webkit-mask-image: url("../img/icons/arrow-up-right.svg"); mask-image: url("../img/icons/arrow-up-right.svg"); }
.icon--arrow-left { -webkit-mask-image: url("../img/icons/arrow-left.svg"); mask-image: url("../img/icons/arrow-left.svg"); }
.icon--arrow-right { -webkit-mask-image: url("../img/icons/arrow-right.svg"); mask-image: url("../img/icons/arrow-right.svg"); }
.icon--download { -webkit-mask-image: url("../img/icons/download.svg"); mask-image: url("../img/icons/download.svg"); }
.icon--mail { -webkit-mask-image: url("../img/icons/mail.svg"); mask-image: url("../img/icons/mail.svg"); }
.icon--copy { -webkit-mask-image: url("../img/icons/copy.svg"); mask-image: url("../img/icons/copy.svg"); }
.icon--pin { -webkit-mask-image: url("../img/icons/pin.svg"); mask-image: url("../img/icons/pin.svg"); }
.icon--phone { -webkit-mask-image: url("../img/icons/phone.svg"); mask-image: url("../img/icons/phone.svg"); }
.icon--check { -webkit-mask-image: url("../img/icons/check.svg"); mask-image: url("../img/icons/check.svg"); }
.icon--github { -webkit-mask-image: url("../img/icons/github.svg"); mask-image: url("../img/icons/github.svg"); }
.icon--linkedin { -webkit-mask-image: url("../img/icons/linkedin.svg"); mask-image: url("../img/icons/linkedin.svg"); }
.icon--x { -webkit-mask-image: url("../img/icons/x.svg"); mask-image: url("../img/icons/x.svg"); }
.icon--youtube { -webkit-mask-image: url("../img/icons/youtube.svg"); mask-image: url("../img/icons/youtube.svg"); }
.icon--scholar { -webkit-mask-image: url("../img/icons/scholar.svg"); mask-image: url("../img/icons/scholar.svg"); }
.icon--sun { -webkit-mask-image: url("../img/icons/sun.svg"); mask-image: url("../img/icons/sun.svg"); }
.icon--moon { -webkit-mask-image: url("../img/icons/moon.svg"); mask-image: url("../img/icons/moon.svg"); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 0 21px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.005em;
  white-space: nowrap;
  transition: background-color 0.25s, color 0.25s, border-color 0.25s, transform 0.25s var(--ease);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn .icon {
  width: 16px;
  height: 16px;
}

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

.btn--primary:hover {
  background: var(--green);
  color: #fff;
}

.btn--ghost {
  border-color: var(--line-strong);
  color: var(--ink);
  background: transparent;
}

.btn--ghost:hover {
  border-color: var(--ink);
  background: rgba(23, 22, 18, 0.04);
}

.btn--light {
  background: var(--cream);
  color: var(--ink);
}

.btn--light:hover {
  background: var(--terra);
  color: var(--cream);
}

.btn--outline-light {
  border-color: var(--cream-line);
  color: var(--cream);
  background: transparent;
}

.btn--outline-light:hover {
  border-color: var(--cream);
  background: rgba(245, 242, 234, 0.06);
}

.btn--sm {
  min-height: 40px;
  padding: 0 15px;
  font-size: 12px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  transition: background-color 0.25s, color 0.25s, border-color 0.25s, transform 0.25s var(--ease);
}

.icon-btn .icon {
  width: 17px;
  height: 17px;
}

.icon-btn:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--cream);
  transform: translateY(-2px);
}

.section--dark .icon-btn,
.contact .icon-btn {
  border-color: var(--cream-line);
  color: var(--cream-muted);
}

.section--dark .icon-btn:hover,
.contact .icon-btn:hover {
  background: var(--cream);
  border-color: var(--cream);
  color: var(--ink);
}

/* ---------- Scroll progress ---------- */
.scroll-progress {
  position: fixed;
  inset: 0 0 auto;
  height: 2px;
  z-index: 300;
  pointer-events: none;
}

.scroll-progress span {
  display: block;
  height: 100%;
  background: var(--terra);
  transform: scaleX(0);
  transform-origin: left;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s, border-color 0.3s, backdrop-filter 0.3s;
}

[data-theme="dark"] .site-header.is-scrolled {
  background: rgba(18, 20, 15, 0.86);
}

.site-header.is-scrolled {
  background: rgba(245, 242, 234, 0.86);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
  border-bottom-color: var(--line);
}

.nav-wrap {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex: none;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  transition: background-color 0.25s, border-color 0.25s, transform 0.4s var(--ease);
}

.brand-mark svg {
  width: 18px;
  height: 18px;
  display: block;
}

.brand:hover .brand-mark {
  background: var(--green);
  border-color: var(--green);
  transform: rotate(12deg);
}

.brand:hover .brand-mark path,
.brand:hover .brand-mark circle {
  stroke: var(--cream);
}

.brand-name {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.01em;
}

.brand-name em {
  font-style: italic;
  color: var(--green);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.2vw, 30px);
  margin-left: auto;
}

.nav-links a {
  position: relative;
  padding: 7px 0;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-soft);
  transition: color 0.25s;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--terra);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease);
}

.nav-links a:hover,
.nav-links a.is-active {
  color: var(--ink);
}

.nav-links a:hover::after,
.nav-links a.is-active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
  position: relative;
  color: var(--ink);
}

.menu-toggle span {
  position: absolute;
  left: 13px;
  width: 16px;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.35s var(--ease), top 0.35s var(--ease);
}

.menu-toggle span:first-child { top: 17px; }
.menu-toggle span:last-child { top: 23px; }

.menu-toggle[aria-expanded="true"] span:first-child {
  top: 20px;
  transform: rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:last-child {
  top: 20px;
  transform: rotate(-45deg);
}

/* ---------- Theme toggle ---------- */
.theme-toggle {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  transition: background-color 0.25s, color 0.25s, border-color 0.25s, transform 0.25s var(--ease);
}

.theme-toggle:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--cream);
  transform: translateY(-2px);
}

.theme-toggle .icon {
  width: 17px;
  height: 17px;
}

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

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

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

[data-theme="dark"] .theme-toggle:hover {
  background: var(--green);
  border-color: var(--green);
  color: #0d1712;
}

/* ---------- Mobile nav ---------- */
.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--paper);
  opacity: 0;
  visibility: hidden;
  overflow-y: auto;
  transition: opacity 0.35s var(--ease), visibility 0.35s;
}

.mobile-nav.is-open {
  opacity: 1;
  visibility: visible;
}

.mobile-nav__inner {
  width: min(100% - 40px, 620px);
  margin-inline: auto;
  padding: calc(var(--header-h) + 34px) 0 48px;
  display: flex;
  flex-direction: column;
  gap: 34px;
  min-height: 100%;
}

.mobile-nav nav {
  border-top: 1px solid var(--line);
}

.mobile-nav nav a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--serif);
  font-size: clamp(36px, 9.5vw, 54px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  transition: color 0.25s, padding-left 0.35s var(--ease);
}

.mobile-nav nav a:hover {
  color: var(--green);
  padding-left: 8px;
}

.mobile-nav nav a span {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.mobile-nav__foot {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 10px;
}

.mobile-nav__foot .socials {
  display: flex;
  gap: 8px;
}

.mobile-nav__mail {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(36px, 5vw, 66px) 0 0;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 70% 60% at 82% 34%, rgba(29, 92, 75, 0.09), transparent 65%),
    radial-gradient(ellipse 50% 50% at 12% 78%, rgba(184, 85, 49, 0.07), transparent 70%),
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: auto, auto, 90px 90px, 90px 90px;
  opacity: 0.55;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent 88%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent 88%);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(300px, 0.84fr);
  align-items: center;
  gap: clamp(40px, 6vw, 86px);
  min-height: 610px;
}

.hero-copy {
  position: relative;
  z-index: 2;
  padding: 20px 0;
}

.hero-eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.available {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--green);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2f8b64;
  box-shadow: 0 0 0 4px rgba(47, 139, 100, 0.13);
  flex: none;
}

.hero h1 {
  margin-top: 22px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(64px, 8.7vw, 122px);
  line-height: 0.84;
  letter-spacing: -0.035em;
}

.hero h1 span,
.hero h1 em {
  display: block;
}

.hero h1 em {
  padding-left: 0.07em;
}

.hero-role {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 30px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.hero-role .slash {
  color: var(--terra);
}

.hero-lede {
  max-width: 56ch;
  margin-top: 22px;
  font-size: clamp(16px, 1.4vw, 18px);
  line-height: 1.7;
  color: var(--ink-soft);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
  margin-top: 32px;
}

.hero-socials {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 36px;
}

.social-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 4px;
}

.socials {
  display: flex;
  align-items: center;
  gap: 8px;
}

.socials .icon-btn {
  width: 37px;
  height: 37px;
}

/* Portrait */
.hero-visual {
  position: relative;
  width: min(100%, 408px);
  justify-self: end;
  animation: rise 1s var(--ease) 0.25s both;
}

.hero-visual::before {
  content: "";
  position: absolute;
  top: -25px;
  right: -28px;
  width: 144px;
  height: 144px;
  border-radius: 50%;
  background: var(--terra-pale);
  z-index: -1;
}

.hero-visual::after {
  content: "";
  position: absolute;
  bottom: 64px;
  left: -34px;
  width: 74px;
  height: 74px;
  border: 1px solid var(--green);
  transform: rotate(45deg);
  z-index: -1;
  opacity: 0.65;
}

.portrait-shell {
  position: relative;
  padding: 11px;
  border: 1px solid var(--line-strong);
  border-radius: 220px 220px 18px 18px;
  background: rgba(255, 255, 255, 0.16);
}

.portrait {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border-radius: 210px 210px 10px 10px;
  background: var(--paper-3);
}

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 20%;
  filter: saturate(0.84) contrast(1.02);
  display: block;
}

.portrait::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  background: linear-gradient(to top, rgba(15, 23, 19, 0.72), transparent);
  pointer-events: none;
}

.portrait-caption {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 19px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--cream);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.portrait-caption span:last-child {
  color: rgba(245, 242, 234, 0.62);
}

.portrait-note {
  position: absolute;
  right: -22px;
  bottom: -22px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 11px;
  max-width: 255px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  animation: rise 1s var(--ease) 0.55s both;
}

.portrait-note strong {
  display: block;
  font-size: 11.5px;
  line-height: 1.35;
  font-weight: 600;
}

.portrait-note small {
  display: block;
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-copy > * {
  animation: rise 0.9s var(--ease) both;
}

.hero-copy > :nth-child(2) { animation-delay: 0.08s; }
.hero-copy > :nth-child(3) { animation-delay: 0.16s; }
.hero-copy > :nth-child(4) { animation-delay: 0.22s; }
.hero-copy > :nth-child(5) { animation-delay: 0.28s; }
.hero-copy > :nth-child(6) { animation-delay: 0.34s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Stats */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: clamp(48px, 6vw, 76px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.hero-stat {
  padding: 22px 24px 24px;
  border-left: 1px solid var(--line);
}

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

.hero-stat strong {
  display: block;
  font-family: var(--serif);
  font-size: clamp(30px, 3vw, 40px);
  font-weight: 400;
  line-height: 1;
}

.hero-stat span {
  display: block;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  gap: clamp(44px, 6vw, 88px);
  align-items: start;
  margin-top: 54px;
}

.about-copy .lead {
  max-width: 22ch;
}

.about-copy p + p {
  margin-top: 20px;
}

.about-copy p:not(.lead) {
  max-width: 60ch;
  color: var(--ink-soft);
  font-size: 15.5px;
}

.about-copy p strong {
  color: var(--ink);
  font-weight: 600;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 30px;
}

.pill {
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  transition: border-color 0.25s, color 0.25s, background-color 0.25s;
}

.pill:hover {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-pale);
}

.about-card {
  position: relative;
  overflow: hidden;
  align-self: start;
  padding: 30px;
  background: var(--dark);
  color: var(--cream);
  border-radius: 20px;
}

.about-card::before {
  content: "";
  position: absolute;
  top: -70px;
  right: -70px;
  width: 210px;
  height: 210px;
  border: 1px solid var(--cream-line);
  border-radius: 50%;
}

.about-card::after {
  content: "";
  position: absolute;
  top: 20px;
  right: 24px;
  width: 8px;
  height: 8px;
  background: var(--terra-light);
  transform: rotate(45deg);
}

.about-card .eyebrow {
  color: #a9cdb9;
}

.facts {
  display: grid;
  gap: 17px;
  margin-top: 25px;
}

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

.facts dd {
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.45;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 26px;
  padding: 8px 12px;
  border: 1px solid rgba(169, 205, 185, 0.28);
  border-radius: 999px;
  background: rgba(169, 205, 185, 0.07);
  color: #b8dcc6;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-pill .dot {
  width: 6px;
  height: 6px;
  background: #7fc79e;
  box-shadow: 0 0 0 3px rgba(127, 199, 158, 0.14);
}

.about-card .text-link {
  color: #b8dcc6;
  margin-top: 22px;
}

.about-card .text-link:hover {
  color: var(--terra-light);
}

/* ---------- Skills ---------- */
.skills .section-head--split {
  align-items: end;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1px;
  margin-top: 52px;
  border: 1px solid var(--cream-line);
  border-radius: 18px;
  overflow: hidden;
  background: var(--cream-line);
}

.skill-group {
  grid-column: span 2;
  padding: 26px;
  background: var(--dark-2);
}

.skill-group__head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--cream-line);
}

.skill-group__num {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--terra-light);
  letter-spacing: 0.08em;
}

.skill-group h3 {
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 400;
  line-height: 1;
}

.skill-list {
  display: grid;
  gap: 15px;
  margin-top: 20px;
}

.skill-row__label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  color: var(--cream);
}

.skill-row__label span:last-child {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cream-muted);
  white-space: nowrap;
}

.skill-bar {
  height: 3px;
  margin-top: 7px;
  border-radius: 2px;
  background: rgba(245, 242, 234, 0.1);
  overflow: hidden;
}

.skill-bar i {
  display: block;
  height: 100%;
  width: calc(var(--level) * 1%);
  border-radius: inherit;
  background: linear-gradient(90deg, #4f8c72, #b9ddc7);
}

.js .reveal .skill-bar i {
  transform: scaleX(0);
  transform-origin: left;
}

.js .reveal.is-visible .skill-bar i {
  transform: scaleX(1);
  transition: transform 1s var(--ease) calc(var(--i, 0) * 80ms);
}

.skill-group--explore {
  background: var(--green-dark);
}

.skill-group--explore .skill-group__head {
  border-bottom-color: rgba(245, 242, 234, 0.22);
}

.explore-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 20px;
}

.explore-list li {
  padding: 6px 10px;
  border: 1px solid rgba(245, 242, 234, 0.24);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.05em;
  color: #d7e7dc;
}

.skill-note {
  margin-top: 22px;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--cream-muted);
}

.skills-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  margin-top: 26px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cream-muted);
}

.skills-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend-bar {
  width: 34px;
  height: 3px;
  background: rgba(245, 242, 234, 0.14);
  border-radius: 2px;
  overflow: hidden;
}

.legend-bar i {
  display: block;
  height: 100%;
  background: #b9ddc7;
}

/* ---------- Timelines ---------- */
.background-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 84px);
  margin-top: 52px;
}

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

.timeline-item {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 20px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.timeline-item__year {
  padding-top: 4px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  color: var(--green);
  white-space: nowrap;
}

.timeline-item h3 {
  font-family: var(--serif);
  font-size: clamp(22px, 2.2vw, 27px);
  font-weight: 400;
  line-height: 1.08;
}

.timeline-item__org {
  margin-top: 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}

.timeline-item__meta {
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.timeline-item p {
  margin-top: 9px;
  font-size: 13px;
  line-height: 1.62;
  color: var(--ink-soft);
}

.timeline-item p strong {
  color: var(--ink);
  font-weight: 600;
}

.also-line {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}

.also-line strong {
  color: var(--ink-soft);
  font-weight: 600;
}

/* Thesis */
.thesis {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 32px;
  margin-top: 60px;
  padding: clamp(28px, 4vw, 44px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.thesis::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--terra);
}

.thesis .eyebrow {
  color: var(--terra);
}

.thesis h3 {
  max-width: 26ch;
  margin-top: 14px;
  font-family: var(--serif);
  font-size: clamp(27px, 3.2vw, 40px);
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: -0.01em;
}

.thesis p {
  max-width: 68ch;
  margin-top: 14px;
  font-size: 13.5px;
  color: var(--ink-soft);
}

.thesis-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 20px;
}

.thesis-tags span {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.thesis-year {
  font-family: var(--serif);
  font-size: clamp(60px, 8vw, 104px);
  line-height: 0.8;
  color: var(--paper-3);
  -webkit-text-stroke: 1px var(--line-strong);
  user-select: none;
}

/* ---------- Projects ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin-top: 52px;
}

.project-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease), border-color 0.45s;
}

.project-card:hover {
  transform: translateY(-6px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}

.project-shot {
  padding: 10px 10px 0;
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
}

.browser-bar {
  height: 25px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  background: var(--paper-3);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
}

.browser-bar i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(23, 22, 18, 0.22);
  flex: none;
}

.browser-bar span {
  margin-left: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.project-shot__img {
  overflow: hidden;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 7px 7px;
  background: var(--paper-3);
}

.project-shot img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform 0.7s var(--ease);
}

.project-card:hover .project-shot img {
  transform: scale(1.035);
}

.project-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 20px 21px 22px;
}

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

.project-meta .index {
  color: var(--terra);
}

.project-body h3 {
  margin-top: 10px;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.01em;
}

.project-body > p {
  margin-top: 9px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 15px;
}

.project-tags span {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
}

.project-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--green);
}

.project-link .icon {
  width: 15px;
  height: 15px;
  transition: transform 0.3s var(--ease);
}

.project-card:hover .project-link .icon {
  transform: translate(3px, -3px);
}

.more-work {
  display: grid;
  grid-template-columns: minmax(200px, 0.6fr) minmax(0, 1.4fr);
  gap: 28px;
  align-items: start;
  margin-top: 60px;
  padding-top: 34px;
  border-top: 1px solid var(--line);
}

.more-work h3 {
  font-family: var(--serif);
  font-size: clamp(26px, 2.8vw, 34px);
  font-weight: 400;
  line-height: 1.05;
}

.more-work > p {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--muted);
  max-width: 30ch;
}

.more-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.more-link {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 116px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: transparent;
  transition: background-color 0.25s, border-color 0.25s, transform 0.25s var(--ease);
}

.more-link:hover {
  background: var(--card);
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.more-link strong {
  font-size: 13.5px;
  font-weight: 600;
}

.more-link span {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted);
}

.more-link .icon {
  width: 14px;
  height: 14px;
  margin-top: auto;
  color: var(--green);
  align-self: flex-end;
}

/* ---------- Contact ---------- */
.contact {
  position: relative;
  overflow: hidden;
  background: var(--dark);
  color: var(--cream);
  padding: clamp(76px, 9vw, 120px) 0 60px;
}

.contact::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 70% at 88% 20%, rgba(29, 92, 75, 0.55), transparent 65%),
    radial-gradient(ellipse 40% 50% at 4% 100%, rgba(184, 85, 49, 0.12), transparent 70%);
  pointer-events: none;
}

.contact .container {
  position: relative;
}

.contact .eyebrow {
  color: #a9cdb9;
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(300px, 0.82fr);
  gap: clamp(44px, 6vw, 80px);
  align-items: start;
  margin-top: 48px;
}

.contact h2 {
  font-size: clamp(48px, 6.6vw, 88px);
  line-height: 0.92;
}

.contact h2 em {
  color: var(--terra-light);
}

.contact-lede {
  max-width: 48ch;
  margin-top: 22px;
  font-size: 15px;
  color: var(--cream-muted);
}

.email-block {
  margin-top: 32px;
}

.email-block .label {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--cream-muted);
}

.email-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  padding-bottom: 5px;
  font-family: var(--serif);
  font-size: clamp(24px, 3.2vw, 37px);
  line-height: 1.1;
  color: var(--cream);
  border-bottom: 1px solid var(--cream-line);
  transition: color 0.25s, border-color 0.25s;
  word-break: break-word;
}

.email-link .icon {
  width: 18px;
  height: 18px;
  color: var(--terra-light);
}

.email-link:hover {
  color: #cfe4d7;
  border-color: #cfe4d7;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 26px;
}

.contact-note {
  margin-top: 22px;
  font-size: 11.5px;
  color: var(--cream-muted);
}

.contact-note strong {
  color: var(--cream);
  font-weight: 500;
}

.contact-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--cream-line);
  border-radius: 14px;
  background: var(--cream-line);
}

.contact-card {
  display: flex;
  flex-direction: column;
  min-height: 128px;
  padding: 19px;
  background: rgba(15, 23, 19, 0.72);
  transition: background-color 0.25s;
}

.contact-card:hover {
  background: var(--dark-2);
}

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

.contact-card strong,
.contact-card a {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--cream);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.contact-card a:hover {
  color: #cfe4d7;
}

.contact-card small {
  margin-top: auto;
  padding-top: 12px;
  font-size: 10.5px;
  line-height: 1.45;
  color: var(--cream-muted);
}

.contact-card .icon {
  width: 15px;
  height: 15px;
  color: var(--terra-light);
  margin-bottom: 2px;
}

.contact-card--wide {
  grid-column: span 2;
}

.footer {
  position: relative;
  background: var(--dark);
  color: var(--cream-muted);
  border-top: 1px solid var(--cream-line);
  padding: 26px 0;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px 28px;
}

.footer-brand {
  font-family: var(--serif);
  font-size: 19px;
  color: var(--cream);
}

.footer-brand em {
  color: var(--terra-light);
  font-style: italic;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 11px;
}

.footer-nav a:hover {
  color: var(--cream);
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.to-top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--cream-muted);
}

.to-top:hover {
  color: var(--cream);
}

.to-top .icon {
  width: 13px;
  height: 13px;
  transform: rotate(-90deg);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 400;
  transform: translate(-50%, 18px);
  max-width: calc(100% - 32px);
  padding: 11px 17px;
  border: 1px solid var(--cream-line);
  border-radius: 999px;
  background: var(--ink);
  color: var(--cream);
  font-size: 12px;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, transform 0.3s var(--ease), visibility 0.3s;
}

.toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

/* ---------- Reveal ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  transition-delay: var(--delay, 0s);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Case study pages ---------- */
.case-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(32px, 4vw, 50px) 0 clamp(56px, 7vw, 84px);
  border-bottom: 1px solid var(--line);
}

.case-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 55% 60% at 80% 0%, rgba(29, 92, 75, 0.08), transparent 70%);
  pointer-events: none;
}

.case-hero .container {
  position: relative;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.25s;
}

.back-link .icon {
  width: 14px;
  height: 14px;
}

.back-link:hover {
  color: var(--green);
}

.case-top {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
  gap: clamp(36px, 5vw, 70px);
  align-items: end;
  margin-top: 36px;
}

.case-hero h1 {
  margin-top: 14px;
  font-family: var(--serif);
  font-size: clamp(64px, 9.4vw, 122px);
  font-weight: 400;
  line-height: 0.82;
  letter-spacing: -0.035em;
}

.case-lede {
  max-width: 58ch;
  margin-top: 20px;
  font-size: clamp(16px, 1.7vw, 19px);
  line-height: 1.65;
  color: var(--ink-soft);
}

.case-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.case-facts {
  border-top: 1px solid var(--line);
}

.case-facts > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

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

.case-facts dd {
  font-size: 12px;
  text-align: right;
  color: var(--ink-soft);
  max-width: 65%;
}

.browser-frame {
  margin-top: clamp(36px, 5vw, 56px);
  overflow: hidden;
  background: var(--paper-2);
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  box-shadow: var(--shadow);
}

.browser-frame__bar {
  height: 34px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  background: var(--paper-3);
  border-bottom: 1px solid var(--line);
}

.browser-frame__bar i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(23, 22, 18, 0.2);
}

.browser-frame__bar span {
  margin-left: 8px;
  font-family: var(--mono);
  font-size: 8.5px;
  color: var(--muted);
}

.browser-frame img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.case-content {
  padding: clamp(56px, 8vw, 96px) 0;
}

.case-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 286px;
  gap: clamp(40px, 6vw, 74px);
  align-items: start;
}

.case-body h2 {
  margin: 48px 0 16px;
  font-family: var(--serif);
  font-size: clamp(30px, 3.4vw, 40px);
  line-height: 1.05;
}

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

.case-body p,
.case-body li {
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--ink-soft);
}

.case-body p + p {
  margin-top: 16px;
}

.case-body ul {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-left: 18px;
}

.case-body li {
  list-style: disc;
  padding-left: 4px;
}

.case-body li::marker {
  color: var(--green);
}

.case-body strong {
  color: var(--ink);
  font-weight: 600;
}

.case-body code {
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper-2);
  font-family: var(--mono);
  font-size: 0.82em;
  color: var(--ink-2);
}

.challenge {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 14px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.challenge__num {
  padding-top: 4px;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--terra);
}

.challenge h3 {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 400;
  line-height: 1.12;
}

.challenge p {
  margin-top: 6px;
  font-size: 13.5px;
}

.case-gallery {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.5fr);
  gap: 22px;
  align-items: start;
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.case-gallery figure {
  display: grid;
  gap: 9px;
}

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

.case-gallery img {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.phone-frame {
  justify-self: center;
  width: min(100%, 235px);
  padding: 7px;
  background: var(--ink);
  border-radius: 26px;
  box-shadow: var(--shadow);
}

.phone-frame img {
  aspect-ratio: 390 / 844;
  object-fit: cover;
  border: 0;
  border-radius: 20px;
}

.case-aside {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  display: grid;
  gap: 14px;
}

.aside-card {
  padding: 19px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.aside-card h3 {
  margin-bottom: 12px;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.stack-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.stack-list li {
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 8px;
  color: var(--ink-soft);
}

.aside-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-soft);
  transition: color 0.25s;
}

.aside-links a:first-child {
  padding-top: 0;
}

.aside-links a:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.aside-links a:hover {
  color: var(--green);
}

.aside-links .icon {
  width: 13px;
  height: 13px;
}

.aside-note {
  font-size: 12px;
  line-height: 1.65;
  color: var(--ink-soft);
}

.case-next {
  border-top: 1px solid var(--line);
  padding: 38px 0;
}

.case-next a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.case-next .label {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
}

.case-next .next-title {
  display: block;
  margin-top: 5px;
  font-family: var(--serif);
  font-size: clamp(32px, 4.4vw, 56px);
  line-height: 1;
}

.case-next .icon {
  width: clamp(28px, 4vw, 40px);
  height: clamp(28px, 4vw, 40px);
  color: var(--green);
  transition: transform 0.35s var(--ease);
}

.case-next a:hover .icon {
  transform: translateX(8px);
}

/* ---------- 404 ---------- */
.error-page {
  min-height: 68vh;
  display: grid;
  place-items: center;
  padding: 80px 0;
  text-align: center;
}

.error-page .code {
  font-family: var(--serif);
  font-size: clamp(110px, 22vw, 220px);
  line-height: 0.75;
  letter-spacing: -0.04em;
}

.error-page h1 {
  margin-top: 20px;
  font-family: var(--serif);
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 400;
}

.error-page p {
  max-width: 44ch;
  margin: 12px auto 0;
  color: var(--ink-soft);
}

.error-page .btn {
  margin-top: 28px;
}

/* ---------- Research ---------- */
.research-thesis .thesis-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.research-thesis .thesis-links .btn {
  min-height: 42px;
  padding: 0 16px;
  font-size: 12px;
}

.pub-block {
  margin-top: 62px;
  padding-top: 36px;
  border-top: 1px solid var(--line);
}

.pub-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.pub-head h3 {
  margin-top: 12px;
  font-family: var(--serif);
  font-size: clamp(26px, 2.8vw, 34px);
  font-weight: 400;
  line-height: 1.05;
}

.pub-list {
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}

.pub-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.pub-item:last-child {
  border-bottom: 1px solid var(--line);
}

.pub-num {
  padding-top: 3px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.pub-item h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.42;
}

.pub-item h4 a {
  transition: color 0.25s;
}

.pub-item h4 a:hover {
  color: var(--green);
}

.pub-authors {
  margin-top: 5px;
  font-size: 12px;
  color: var(--muted);
}

.pub-venue {
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--ink-soft);
}

.pub-venue em {
  font-style: italic;
}

.pub-year {
  padding-top: 3px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--terra);
}

/* ---------- Dark theme fixes ---------- */
[data-theme="dark"] .btn--primary {
  background: var(--green);
  color: #0d1712;
}

[data-theme="dark"] .btn--primary:hover {
  background: var(--terra);
  color: #14150f;
}

[data-theme="dark"] .btn--ghost:hover {
  background: rgba(241, 238, 227, 0.07);
}

[data-theme="dark"] .btn--light {
  color: #171612;
}

[data-theme="dark"] .btn--light:hover {
  color: #14150f;
}

[data-theme="dark"] .icon-btn:hover {
  background: var(--green);
  border-color: var(--green);
  color: #0d1712;
}

[data-theme="dark"] .toast {
  background: var(--cream);
  color: #14150f;
}

[data-theme="dark"] .phone-frame {
  background: #050705;
}

[data-theme="dark"] .browser-bar i {
  background: rgba(241, 238, 227, 0.22);
}

[data-theme="dark"] .hero::before {
  background:
    radial-gradient(ellipse 70% 60% at 82% 34%, rgba(124, 192, 164, 0.1), transparent 65%),
    radial-gradient(ellipse 50% 50% at 12% 78%, rgba(224, 138, 99, 0.08), transparent 70%),
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: auto, auto, 90px 90px, 90px 90px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .nav-links {
    gap: 18px;
  }

  .nav-links a {
    font-size: 12px;
  }

  .hero-grid {
    min-height: 560px;
  }

  .hero h1 {
    font-size: clamp(58px, 8.4vw, 96px);
  }

  .skill-group {
    padding: 22px;
  }
}

@media (max-width: 980px) {
  .nav-links,
  .nav-actions .btn {
    display: none;
  }

  .menu-toggle {
    display: block;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.68fr);
    gap: 40px;
    min-height: 0;
  }

  .hero h1 {
    font-size: clamp(56px, 9vw, 88px);
  }

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

  .section-head--split > p {
    max-width: 58ch;
  }

  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 38px;
  }

  .about-card {
    max-width: 560px;
  }

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

  .skill-group {
    grid-column: span 1;
  }

  .skill-group--explore {
    grid-column: span 2;
  }

  .background-grid {
    grid-template-columns: 1fr;
    gap: 54px;
  }

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

  .project-card:last-child {
    grid-column: span 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .project-card:last-child .project-shot {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-bottom: 0;
    border-right: 1px solid var(--line);
  }

  .more-work {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .contact-cards {
    max-width: 560px;
  }

  .case-top {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .case-facts {
    max-width: 460px;
  }

  .case-layout {
    grid-template-columns: 1fr;
  }

  .case-aside {
    position: static;
    grid-template-columns: 1fr 1fr;
    order: -1;
  }
}

@media (max-width: 760px) {
  :root {
    --header-h: 70px;
  }

  .container {
    width: min(100% - 32px, var(--container));
  }

  .section {
    padding: 68px 0;
  }

  .hero {
    padding-top: 30px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 44px;
  }

  .hero-copy {
    padding: 0;
  }

  .hero h1 {
    font-size: clamp(58px, 16.8vw, 92px);
  }

  .hero-role {
    margin-top: 24px;
    font-size: 10px;
  }

  .hero-lede {
    font-size: 15.5px;
  }

  .hero-visual {
    justify-self: start;
    width: min(100%, 350px);
    margin-left: 4px;
  }

  .hero-visual::before {
    top: -16px;
    right: -14px;
    width: 100px;
    height: 100px;
  }

  .hero-visual::after {
    left: -18px;
    bottom: 40px;
    width: 54px;
    height: 54px;
  }

  .portrait-note {
    right: -8px;
    bottom: -18px;
  }

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

  .hero-stat {
    padding: 18px 18px 20px;
  }

  .hero-stat:nth-child(odd) {
    border-left: 0;
    padding-left: 0;
  }

  .hero-stat:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .about-grid {
    margin-top: 38px;
  }

  .about-copy .lead {
    max-width: none;
  }

  .skills-grid {
    grid-template-columns: 1fr;
    margin-top: 36px;
  }

  .skill-group,
  .skill-group--explore {
    grid-column: span 1;
  }

  .project-grid {
    grid-template-columns: 1fr;
    margin-top: 36px;
  }

  .project-card:last-child {
    grid-column: span 1;
    display: flex;
  }

  .project-card:last-child .project-shot {
    display: block;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .more-links {
    grid-template-columns: 1fr;
  }

  .more-link {
    min-height: 96px;
  }

  .thesis {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .thesis-year {
    display: none;
  }

  .pub-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .pub-item {
    grid-template-columns: 26px minmax(0, 1fr);
    gap: 12px;
  }

  .pub-year {
    grid-column: 2;
    padding-top: 0;
  }

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

  .contact-card--wide {
    grid-column: span 1;
  }

  .contact-card {
    min-height: 106px;
  }

  .footer-row {
    align-items: flex-start;
  }

  .footer-nav {
    order: 3;
    width: 100%;
    gap: 14px;
    padding-top: 4px;
    border-top: 1px solid var(--cream-line);
    padding-top: 16px;
  }

  .case-aside {
    grid-template-columns: 1fr;
  }

  .case-gallery {
    grid-template-columns: 1fr;
  }

  .phone-frame {
    width: min(100%, 210px);
  }
}

@media (max-width: 480px) {
  .brand-name {
    font-size: 19px;
  }

  .hero h1 {
    font-size: clamp(54px, 17vw, 74px);
  }

  .hero-cta {
    gap: 8px;
  }

  .hero-cta .btn {
    flex: 1 1 auto;
  }

  .hero-socials {
    gap: 9px;
  }

  .socials .icon-btn {
    width: 35px;
    height: 35px;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .timeline-item__year {
    padding-top: 0;
  }

  .project-body {
    padding: 18px;
  }

  .contact h2 {
    font-size: clamp(44px, 13vw, 66px);
  }

  .email-link {
    font-size: 22px;
  }
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

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

  .js .reveal {
    opacity: 1;
    transform: none;
  }

  .js .reveal .skill-bar i {
    transform: none;
  }
}
