/* ==========================================================================
   anaschahid.com — redesign
   Two-colour editorial system: warm ink + bone, one signal accent.
   ========================================================================== */

:root {
  color-scheme: dark;
  --bg: #12110f;
  --bg-2: #1a1916;
  --ink: #ece6da;
  --bg-rgb: 18, 17, 15;
  --ink-rgb: 236, 230, 218;
  --muted: #8f887c;
  --line: rgba(var(--ink-rgb), 0.14);
  --accent: #ff5b1f;

  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", ui-serif, Georgia, serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --gutter: clamp(16px, 3.2vw, 48px);
  --ease: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3eee4;
  --bg-2: #eae4d8;
  --ink: #16140f;
  --bg-rgb: 243, 238, 228;
  --ink-rgb: 22, 20, 15;
  --muted: #6b6559;
  --accent: #e8470a;
}
:root[data-theme="light"] .grain {
  opacity: 0.05;
  mix-blend-mode: multiply;
}
body,
.menu,
.finding {
  transition: background-color 0.4s, color 0.4s;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

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

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

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

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

h1,
h2,
h3,
p,
ol,
ul,
dl,
dd,
figure {
  margin: 0;
  padding: 0;
}

ol,
ul {
  list-style: none;
}

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

.serif {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.mono {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.skip {
  position: fixed;
  left: var(--gutter);
  top: -100px;
  z-index: 200;
  background: var(--ink);
  color: var(--bg);
  padding: 10px 14px;
}
.skip:focus {
  top: 12px;
}

/* ---------- Grain overlay ---------- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Preloader ---------- */
.loader {
  display: none;
}
.js .loader {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 16px;
  padding: var(--gutter);
  background: var(--ink);
  color: var(--bg);
  transition: transform 1s var(--ease);
}
.loader__row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(40px, 9vw, 140px);
  line-height: 0.9;
}
.loader__count {
  font-family: var(--sans);
  font-style: normal;
  font-weight: 300;
  font-variant-numeric: tabular-nums;
}
.loader__bar {
  height: 2px;
  background: rgba(var(--bg-rgb), 0.15);
}
.loader__bar span {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--bg);
  transform-origin: left;
  transform: scaleX(0);
}
.is-loaded .loader {
  transform: translateY(-100%);
}

/* ---------- Cursor ---------- */
.cursor {
  display: none;
}
@media (hover: hover) and (pointer: fine) {
  .js .cursor {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 120;
    display: grid;
    place-items: center;
    width: 10px;
    height: 10px;
    margin: -5px 0 0 -5px;
    border-radius: 50%;
    background: #ece6da;
    mix-blend-mode: difference;
    pointer-events: none;
    transition:
      width 0.4s var(--ease-out),
      height 0.4s var(--ease-out),
      margin 0.4s var(--ease-out),
      opacity 0.3s;
  }
  .cursor__label {
    font-family: var(--mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #12110f;
    opacity: 0;
    transition: opacity 0.2s;
  }
  .cursor.is-hover {
    width: 44px;
    height: 44px;
    margin: -22px 0 0 -22px;
  }
  .cursor.is-view {
    width: 84px;
    height: 84px;
    margin: -42px 0 0 -42px;
    mix-blend-mode: normal;
    background: var(--accent);
  }
  .cursor.is-view .cursor__label {
    opacity: 1;
  }
  .cursor.is-hidden {
    opacity: 0;
  }
}

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px var(--gutter);
  mix-blend-mode: difference;
  color: #fff;
}
.nav__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
}
.nav__mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 11px;
}
.nav__links {
  display: flex;
  gap: 32px;
  font-size: 14px;
}
.nav__right {
  display: flex;
  align-items: center;
  gap: 18px;
}
.theme-toggle {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
}
.theme-toggle__icon {
  width: 16px;
  height: 16px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  background: linear-gradient(90deg, currentColor 50%, transparent 50%);
  transition: transform 0.6s var(--ease-out);
}
.theme-toggle:hover .theme-toggle__icon {
  transform: rotate(180deg);
}
.nav__toggle {
  display: none;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  padding: 8px 0;
}

/* Rolling text link */
.roll {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
}
.roll span {
  position: relative;
  display: inline-block;
  transition: transform 0.5s var(--ease-out);
}
.roll span::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 100%;
}
.roll:hover span,
.roll:focus-visible span {
  transform: translateY(-100%);
}

/* Mobile menu */
.menu {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 96px var(--gutter) var(--gutter);
  background: var(--ink);
  color: var(--bg);
  clip-path: inset(0 0 100% 0);
  transition: clip-path 0.7s var(--ease);
}
.menu[hidden] {
  display: none;
}
.menu.is-open {
  clip-path: inset(0 0 0 0);
}
.menu nav {
  display: flex;
  flex-direction: column;
}
.menu nav a {
  font-size: clamp(48px, 14vw, 96px);
  line-height: 1.05;
  letter-spacing: -0.04em;
  border-bottom: 1px solid rgba(var(--bg-rgb), 0.15);
  padding: 6px 0;
}
.menu nav sup {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0;
  margin-right: 12px;
  vertical-align: super;
}
.menu__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-size: 14px;
}
body.menu-open .nav {
  mix-blend-mode: normal;
  color: var(--bg);
}

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 16px 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition:
    color 0.5s var(--ease-out),
    border-color 0.5s;
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--ink);
  border-radius: inherit;
  transform: translateY(101%);
  transition: transform 0.5s var(--ease-out);
}
.btn:hover {
  color: var(--bg);
  border-color: var(--ink);
}
.btn:hover::before {
  transform: translateY(0);
}
.btn i {
  font-style: normal;
  transition: transform 0.5s var(--ease-out);
}
.btn:hover i {
  transform: translateX(4px);
}
.btn--solid {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}
.btn--solid::before {
  background: var(--ink);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
  padding: 104px var(--gutter) 48px;
}
.hero__meta {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.hero__meta-end {
  text-align: right;
}
.hero__title {
  font-weight: 500;
  /* Scale with width, but never so tall that the intro and buttons drop
     below the fold on wide-but-short screens. */
  font-size: clamp(64px, min(19.5vw, 30svh), 340px);
  line-height: 0.84;
  letter-spacing: -0.065em;
  margin-left: -0.04em;
}
.hero__title .serif {
  font-weight: 400;
  letter-spacing: -0.03em;
}
.line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.06em;
}
.line--indent {
  padding-left: 18vw;
}
.hero__foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
  flex-wrap: wrap;
}
.hero__lede {
  max-width: 34ch;
  font-size: clamp(20px, 2.1vw, 30px);
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.hero__ctas {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Short desktop/laptop screens: tighten the hero so it fits one screen. */
@media (min-width: 901px) and (max-height: 760px) {
  .hero {
    padding-top: 84px;
    padding-bottom: 28px;
    gap: 24px;
  }
  .hero__title {
    font-size: clamp(64px, min(19.5vw, 26svh), 340px);
  }
  .hero__lede {
    max-width: 44ch;
    font-size: clamp(18px, 1.6vw, 22px);
  }
}

/* Split text (letters wrapped by JS) */
.char {
  display: inline-block;
  will-change: transform;
}
.js .split .char {
  transform: translateY(105%);
  transition: transform 1.2s var(--ease-out);
  transition-delay: calc(var(--i) * 45ms + 250ms);
}
.js .is-loaded .split .char,
.js .split.is-in .char {
  transform: translateY(0);
}
.js .contact .split .char {
  transition-delay: calc(var(--i) * 30ms);
}
.js .contact .split:not(.is-in) .char {
  transform: translateY(105%);
}

/* ---------- Reveal on scroll ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(36px);
  transition:
    opacity 1s var(--ease-out),
    transform 1.2s var(--ease-out);
  transition-delay: var(--d, 0ms);
}
.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

/* ---------- Marquee ---------- */
.marquee {
  overflow: hidden;
  border-block: 1px solid var(--line);
  padding: 22px 0;
}
.marquee__track {
  display: flex;
  width: max-content;
  animation: marquee 40s linear infinite;
}
.marquee:hover .marquee__track {
  animation-play-state: paused;
}
.marquee ul {
  display: flex;
}
.marquee li {
  display: flex;
  align-items: center;
  font-size: clamp(22px, 3vw, 40px);
  letter-spacing: -0.03em;
  white-space: nowrap;
}
.marquee li::after {
  content: "✦";
  font-size: 0.5em;
  color: var(--accent);
  margin: 0 0.9em;
}
.marquee li:nth-child(even) {
  font-family: var(--serif);
  font-style: italic;
  letter-spacing: -0.01em;
}
@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}

/* ---------- Sections ---------- */
.section {
  padding: clamp(96px, 14vw, 200px) var(--gutter) 0;
}
.section__head {
  display: grid;
  grid-template-columns: 1fr 3fr;
  align-items: end;
  gap: 24px;
  margin-bottom: clamp(40px, 6vw, 80px);
}
.section__title {
  font-weight: 400;
  font-size: clamp(48px, 8vw, 128px);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

/* ---------- Work list ---------- */
.work__list {
  border-top: 1px solid var(--line);
  counter-reset: p;
}
.project {
  border-bottom: 1px solid var(--line);
  transition: opacity 0.4s;
}
.project__link {
  display: grid;
  grid-template-columns: 56px minmax(0, 1.1fr) minmax(0, 1.2fr) 200px 40px;
  align-items: baseline;
  gap: 24px;
  padding: 34px 0;
}
.project__name {
  font-size: clamp(30px, 3.8vw, 58px);
  line-height: 1;
  letter-spacing: -0.045em;
  transition:
    transform 0.6s var(--ease-out),
    color 0.3s;
}
.project__desc {
  color: var(--muted);
  font-size: 15px;
  max-width: 48ch;
}
.project__tags {
  text-align: right;
}
.project__arrow {
  justify-self: end;
  font-size: 22px;
  transition: transform 0.6s var(--ease-out), color 0.3s;
}
.project__arrow--muted {
  color: var(--muted);
}
.project__thumb {
  display: none;
}
@media (hover: hover) and (min-width: 901px) {
  .work__list:hover .project:not(:hover) {
    opacity: 0.32;
  }
  .project:hover .project__name {
    transform: translateX(20px);
  }
  .project:hover .project__arrow {
    color: var(--accent);
    transform: rotate(45deg);
  }
}

/* Floating preview */
.preview {
  display: none;
}
@media (hover: hover) and (pointer: fine) and (min-width: 901px) {
  .js .preview {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 80;
    display: block;
    width: 440px;
    aspect-ratio: 16 / 10;
    margin: -140px 0 0 -220px;
    pointer-events: none;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
    transform: scale(0.6) rotate(-4deg);
    opacity: 0;
    transition:
      opacity 0.35s,
      transform 0.6s var(--ease-out);
  }
  .js .preview.is-active {
    opacity: 1;
    transform: scale(1) rotate(var(--rot, 0deg));
  }
}
.preview__inner {
  position: relative;
  width: 100%;
  height: 100%;
}
.preview__inner img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  clip-path: inset(100% 0 0 0);
  transition: clip-path 0.7s var(--ease-out);
}
.preview__inner img.is-current {
  clip-path: inset(0 0 0 0);
  z-index: 2;
}
.preview__inner img.is-prev {
  clip-path: inset(0 0 0 0);
  z-index: 1;
}

/* Archive */
.archive {
  margin-top: 48px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.archive summary {
  display: grid;
  grid-template-columns: 1fr 3fr auto;
  align-items: center;
  gap: 24px;
  padding: 28px 0;
  cursor: pointer;
  list-style: none;
}
.archive summary::-webkit-details-marker {
  display: none;
}
.archive__title {
  font-size: clamp(22px, 2.4vw, 32px);
  letter-spacing: -0.03em;
}
.archive__icon {
  position: relative;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  transition:
    transform 0.5s var(--ease-out),
    background 0.3s;
}
.archive__icon::before,
.archive__icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 1px;
  background: currentColor;
  transform: translate(-50%, -50%);
}
.archive__icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
}
.archive[open] .archive__icon {
  transform: rotate(45deg);
  background: var(--ink);
  color: var(--bg);
}
.archive summary:hover .archive__icon {
  border-color: var(--ink);
}
.archive__body {
  padding-bottom: 24px;
  overflow-x: auto;
}
.archive table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
.archive th {
  text-align: left;
  font-family: var(--mono);
  font-weight: 400;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 0 16px 12px 0;
}
.archive td {
  padding: 14px 16px 14px 0;
  border-top: 1px solid var(--line);
  vertical-align: top;
}
.archive td:nth-child(2) {
  color: var(--muted);
}
.archive td a {
  display: inline-block;
  margin-right: 14px;
  border-bottom: 1px solid var(--line);
  transition:
    color 0.2s,
    border-color 0.2s;
}
.archive td a:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.archive tbody tr {
  transition: background 0.2s;
}
.archive tbody tr:hover {
  background: var(--bg-2);
}

/* ---------- Research ---------- */
.pubs {
  border-top: 1px solid var(--line);
}
.pub a {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 220px 40px;
  align-items: baseline;
  gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
  transition: padding 0.5s var(--ease-out);
}
.pub__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pub__title {
  max-width: 34em;
  font-size: clamp(19px, 1.9vw, 27px);
  line-height: 1.2;
  letter-spacing: -0.025em;
  transition: color 0.3s;
}
.pub__authors {
  font-size: 14px;
  color: var(--muted);
}
.pub__authors b {
  font-weight: 500;
  color: var(--ink);
}
.pub__venue {
  text-align: right;
}
.pub i {
  justify-self: end;
  font-style: normal;
  font-size: 20px;
  transition:
    transform 0.5s var(--ease-out),
    color 0.3s;
}
@media (hover: hover) and (min-width: 901px) {
  .pubs:hover .pub:not(:hover) {
    opacity: 0.4;
  }
  .pub {
    transition: opacity 0.4s;
  }
  .pub a:hover {
    padding-left: 16px;
  }
  .pub a:hover i {
    color: var(--accent);
    transform: rotate(45deg);
  }
}
.research__sub {
  margin: clamp(72px, 9vw, 128px) 0 28px;
}
.research__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: start;
}
.findings {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
@media (min-height: 860px) {
  .findings {
    position: sticky;
    top: 96px;
  }
}
.finding {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: clamp(24px, 3vw, 40px);
  border-radius: 6px;
  background: var(--ink);
  color: var(--bg);
  transition: transform 0.6s var(--ease-out);
}
.finding:hover {
  transform: translateY(-4px);
}
.finding .mono {
  color: rgba(var(--bg-rgb), 0.6);
}
.finding__num {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 0.25em;
  font-size: clamp(48px, 6vw, 96px);
  line-height: 0.95;
  letter-spacing: -0.06em;
}
.finding__before {
  color: rgba(var(--bg-rgb), 0.38);
  text-decoration: line-through;
  text-decoration-thickness: 0.04em;
}
.finding__arrow {
  font-size: 0.5em;
  color: var(--accent);
}
.finding__after {
  font-family: var(--serif);
  font-style: italic;
  letter-spacing: -0.02em;
}
.finding__text {
  max-width: 44ch;
  font-size: 15px;
  color: rgba(var(--bg-rgb), 0.75);
}
.finding__cta {
  margin-top: 8px;
}
.finding:hover .finding__cta {
  color: var(--accent);
}

.models {
  display: flex;
  flex-direction: column;
  gap: 48px;
}
.models .btn {
  align-self: flex-start;
}
.models__head {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 14px;
  color: var(--ink);
}
.models__head span {
  font-family: var(--sans);
  text-transform: none;
  letter-spacing: 0;
  font-size: 14px;
  color: var(--muted);
}
.models ul {
  border-top: 1px solid var(--line);
}
.models li a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 24px;
  align-items: baseline;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  transition:
    padding 0.5s var(--ease-out),
    color 0.3s;
}
.models__name {
  font-size: clamp(16px, 1.5vw, 20px);
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
.models li a i {
  font-style: normal;
  justify-self: end;
  transition:
    transform 0.5s var(--ease-out),
    color 0.3s;
}
@media (hover: hover) {
  .models li a:hover {
    padding-left: 12px;
  }
  .models li a:hover i {
    color: var(--accent);
    transform: translate(3px, -3px);
  }
}

/* ---------- About ---------- */
.about__grid {
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: 24px;
  align-items: start;
}
.about__portrait {
  position: sticky;
  top: 96px;
  max-width: 300px;
}
.about__portrait img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 4px;
  filter: grayscale(1) contrast(1.05);
  transition: filter 1.6s var(--ease);
}
/* Colour comes in when the portrait scrolls into view (JS), or on hover/tap. */
.about__portrait.is-color img,
.about__portrait:hover img {
  filter: grayscale(0) contrast(1);
}
.about__portrait figcaption {
  margin-top: 12px;
}
.about__statement {
  font-size: clamp(26px, 3.6vw, 54px);
  line-height: 1.12;
  letter-spacing: -0.035em;
  text-indent: 2.5em;
}
.about__statement .w {
  transition: opacity 0.3s;
}
.js .about__statement .w {
  opacity: 0.16;
}
.js .about__statement .w.on {
  opacity: 1;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: clamp(56px, 8vw, 112px);
  border-top: 1px solid var(--line);
}
.stats > div {
  padding: 20px 20px 0 0;
}
.stats > div + div {
  padding-left: 20px;
  border-left: 1px solid var(--line);
}
.stats dd {
  margin-top: 12px;
  font-size: clamp(36px, 5vw, 72px);
  line-height: 1;
  letter-spacing: -0.05em;
}

/* ---------- Experience ---------- */
.xp {
  border-top: 1px solid var(--line);
}
.xp__row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 2fr) 96px;
  gap: 24px;
  align-items: baseline;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
  isolation: isolate;
}
.xp__row::before {
  content: "";
  position: absolute;
  inset: -1px 0 -1px 0;
  z-index: -1;
  background: var(--ink);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.5s var(--ease-out);
}
.xp__org {
  font-size: clamp(22px, 2.4vw, 34px);
  letter-spacing: -0.03em;
}
.xp__role {
  color: var(--muted);
}
.xp__place {
  text-align: right;
}
.xp__row--now .xp__year {
  color: var(--accent);
}
@media (hover: hover) {
  .xp__row {
    transition:
      color 0.4s,
      padding 0.5s var(--ease-out);
  }
  .xp__row:hover {
    color: var(--bg);
    padding-inline: 16px;
  }
  .xp__row:hover::before {
    transform: scaleY(1);
  }
  .xp__row:hover .xp__role,
  .xp__row:hover .mono {
    color: var(--bg);
  }
}

/* Certifications */
.certs {
  border-top: 1px solid var(--line);
}
.certs a {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) 96px 24px;
  align-items: baseline;
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  transition: padding 0.5s var(--ease-out);
}
.certs__name {
  font-size: clamp(19px, 1.8vw, 26px);
  letter-spacing: -0.025em;
}
.certs__name .serif {
  color: var(--muted);
}
.certs__issuer {
  color: var(--muted);
}
.certs__date {
  text-align: right;
}
.certs a i {
  justify-self: end;
  font-style: normal;
  transition:
    transform 0.5s var(--ease-out),
    color 0.3s;
}
@media (hover: hover) {
  .certs a:hover {
    padding-left: 12px;
  }
  .certs a:hover i {
    color: var(--accent);
    transform: translate(3px, -3px);
  }
}

/* ---------- Contact ---------- */
.contact {
  padding: clamp(120px, 16vw, 240px) var(--gutter) clamp(64px, 8vw, 120px);
}
.contact__title {
  margin: 24px 0 40px;
  font-weight: 500;
  font-size: clamp(60px, 13vw, 220px);
  line-height: 0.88;
  letter-spacing: -0.06em;
}
.contact__title .serif {
  font-weight: 400;
  color: var(--accent);
}
.contact__mail {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  font-size: clamp(22px, 3.4vw, 48px);
  letter-spacing: -0.03em;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
  transition: border-color 0.3s;
}
.contact__mail i {
  font-style: normal;
  color: var(--accent);
  transition: transform 0.5s var(--ease-out);
}
.contact__mail:hover {
  border-color: var(--ink);
}
.contact__mail:hover i {
  transform: translate(4px, -4px);
}

.form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 32px;
  margin-top: clamp(64px, 8vw, 120px);
  max-width: 1100px;
}
.field {
  position: relative;
}
.field--wide {
  grid-column: 1 / -1;
}
.field input,
.field textarea {
  width: 100%;
  padding: 30px 0 12px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font: inherit;
  font-size: 20px;
  resize: vertical;
  border-radius: 0;
  transition: border-color 0.3s;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--ink);
}
.field label {
  position: absolute;
  left: 0;
  top: 30px;
  color: var(--muted);
  font-size: 20px;
  pointer-events: none;
  transform-origin: left top;
  transition:
    transform 0.4s var(--ease-out),
    color 0.3s;
}
.field input:focus + label,
.field input:not(:placeholder-shown) + label,
.field textarea:focus + label,
.field textarea:not(:placeholder-shown) + label {
  transform: translateY(-26px) scale(0.65);
  color: var(--ink);
}
.form .btn {
  justify-self: start;
  margin-top: 32px;
}
.form__status {
  grid-column: 1 / -1;
  min-height: 1.5em;
}

/* ---------- Footer ---------- */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 28px var(--gutter);
  border-top: 1px solid var(--line);
}
.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  font-size: 14px;
}
.footer__top:hover {
  color: var(--ink);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav__links {
    display: none;
  }
  .nav__toggle {
    display: block;
  }
  .nav__brandtext {
    display: none;
  }

  .hero__meta {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .hero__meta-mid,
  .hero__meta-end {
    text-align: left;
  }
  .hero__title {
    font-size: 25vw;
  }
  .line--indent {
    padding-left: 10vw;
  }

  .section__head,
  .about__grid,
  .research__grid {
    grid-template-columns: 1fr;
  }
  .findings {
    position: static !important;
  }
  .pub a {
    grid-template-columns: minmax(0, 1fr) 24px;
    gap: 10px 12px;
  }
  .pub__year {
    grid-row: 1;
    grid-column: 1;
  }
  .pub i {
    grid-row: 1;
    grid-column: 2;
  }
  .pub__body {
    grid-column: 1 / -1;
  }
  .pub__venue {
    grid-column: 1 / -1;
    text-align: left;
  }
  .certs a {
    grid-template-columns: minmax(0, 1fr) auto 24px;
    gap: 6px 12px;
  }
  .certs__name {
    grid-column: 1 / -1;
  }
  .certs__date {
    text-align: left;
  }
  .models li a {
    grid-template-columns: minmax(0, 1fr) 24px;
  }
  .models__meta {
    grid-row: 2;
    grid-column: 1;
  }

  .project__link {
    grid-template-columns: 36px 1fr auto;
    grid-template-areas:
      "num name arrow"
      ". desc desc"
      ". tags tags"
      ". thumb thumb";
    gap: 10px 12px;
    padding: 28px 0;
  }
  .project__num {
    grid-area: num;
  }
  .project__name {
    grid-area: name;
  }
  .project__arrow {
    grid-area: arrow;
  }
  .project__desc {
    grid-area: desc;
  }
  .project__tags {
    grid-area: tags;
    text-align: left;
  }
  .project__thumb {
    grid-area: thumb;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    object-position: center top;
    margin-top: 8px;
    border-radius: 4px;
    background: #fff;
  }

  .archive summary {
    grid-template-columns: 1fr auto;
  }
  .archive summary .mono {
    display: none;
  }

  .about__portrait {
    position: static;
    max-width: 220px;
  }
  .about__statement {
    text-indent: 0;
  }
  .stats {
    grid-template-columns: 1fr;
  }
  .stats > div + div {
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .stats > div {
    padding: 18px 0;
  }

  .xp__row {
    grid-template-columns: 1fr auto;
    gap: 6px 16px;
  }
  .xp__year {
    grid-column: 1 / -1;
  }
  .xp__role {
    grid-column: 1 / -1;
  }
  .xp__place {
    grid-row: 2;
    grid-column: 2;
  }

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

@media (max-width: 520px) {
  .hero__ctas .btn {
    flex: 1 1 auto;
    justify-content: center;
  }
  .archive td:nth-child(2) {
    display: none;
  }
  .archive th:nth-child(2) {
    display: none;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  /* Large movement is switched off; the slow skills strip and the
     portrait's colour fade stay, since neither moves the layout. */
  *:not(.marquee__track):not(.about__portrait img),
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
  .marquee__track {
    animation-duration: 70s;
  }
  .js .reveal,
  .js .split .char {
    opacity: 1;
    transform: none;
  }
  .js .about__statement .w {
    opacity: 1;
  }
  .js .loader {
    display: none;
  }
}
