/* =========================================================
   omidveisi.com design system
   Visual language: the original centered layout with its teal
   "thread" line, extended into a system of rules, nodes and
   corner ticks. Type: Geist. One accent: brand teal.
   Radius rule: buttons are pills, images 12px, panels 16px.
   ========================================================= */

@font-face {
  font-family: "Geist";
  src: url("/static/fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("/static/fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --bg: #fcfdfd;
  --surface: #ffffff;
  --surface-2: #eef1f2;
  --tint: #f1f7f9;
  --ink: #0d1b22;
  --ink-2: #3a4950;
  --muted: #5f6f77;
  --line: rgba(13, 27, 34, 0.1);
  --line-strong: rgba(13, 27, 34, 0.2);

  /* the thread */
  --teal: #0b5b76;
  --teal-ink: #0a4457;
  --rule: rgba(11, 91, 118, 0.16);
  --rule-strong: rgba(11, 91, 118, 0.34);

  --accent: var(--teal);
  --accent-hover: #084a60;
  --accent-soft: #e2eff3;

  --radius-media: 12px;
  --radius: 16px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(11, 45, 58, 0.06), 0 4px 12px rgba(11, 45, 58, 0.05);
  --shadow: 0 2px 6px rgba(11, 45, 58, 0.06), 0 24px 48px -16px rgba(11, 45, 58, 0.22);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --container: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 68px;
}

/* ---------- Base (new pages) ---------- */

body.ds {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

:where(body.ds) *,
:where(body.ds) *::before,
:where(body.ds) *::after {
  box-sizing: border-box;
}

:where(body.ds) img {
  display: block;
  max-width: 100%;
  height: auto;
}

:where(body.ds) :where(h1, h2, h3, p, ul, ol, figure, blockquote, dl, dd) {
  margin: 0;
}

:where(body.ds) :where(ul, ol) {
  padding: 0;
  list-style: none;
}

:where(body.ds) a {
  color: inherit;
}

html {
  scroll-padding-top: calc(var(--header-h) + 16px);
}

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: #fff !important;
  font: 500 14px/1 var(--font-sans);
  text-decoration: none;
  transition: top 0.2s var(--ease);
}

.skip-link:focus {
  top: 12px;
}

:where(.site-header, .site-footer, .ds-scope, body.ds) :focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  border-radius: 6px;
}

.icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  fill: currentColor;
}

.mono {
  font-family: var(--font-mono);
}

/* ---------- Line system ----------
   rails: two vertical lines at the content edges, full page height
   rule / hline: horizontal lines that run off both edges of the page,
   with a "+" where they cross the rails
   thread: the vertical teal line through the centre, with nodes */

:root {
  --railw: min(var(--container), 100vw - 2 * var(--gutter));
}

html:has(body.ds) {
  overflow-x: clip;
}

body.ds main {
  position: relative;
}

body.ds main::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 0;
  bottom: 0;
  left: 50%;
  width: var(--railw);
  transform: translateX(-50%);
  border-left: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
  pointer-events: none;
}

.thread {
  position: relative;
  display: block;
  width: 1px;
  height: var(--h, 72px);
  margin-inline: auto;
  background: var(--teal);
}

.thread::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid var(--teal);
  background: var(--bg);
  transform: translateX(-50%);
}

.thread--plain::after {
  display: none;
}

@media (prefers-reduced-motion: no-preference) {
  html.js .thread.reveal {
    opacity: 1;
    transform: scaleY(0);
    transform-origin: 50% 0;
    transition: transform 1s var(--ease);
  }

  html.js .thread.reveal.is-in {
    transform: none;
  }
}

/* full-bleed line: works on any horizontally centred element */
.hline,
.rule {
  position: relative;
}

.hline {
  display: block;
  height: 0;
}

.hline::before,
.rule::before {
  content: "";
  position: absolute;
  top: -0.5px;
  left: 50%;
  width: 100vw;
  height: 1px;
  background: var(--rule-strong);
  transform: translateX(-50%);
  pointer-events: none;
}

.hline::after,
.rule::after {
  content: "";
  position: absolute;
  top: -6px;
  left: calc(50% - var(--railw) / 2 - 6px);
  width: calc(var(--railw) + 12px);
  height: 12px;
  pointer-events: none;
  background:
    linear-gradient(var(--teal), var(--teal)) left 0 top 5.25px / 12px 1.5px no-repeat,
    linear-gradient(var(--teal), var(--teal)) left 5.25px top 0 / 1.5px 12px no-repeat,
    linear-gradient(var(--teal), var(--teal)) right 0 top 5.25px / 12px 1.5px no-repeat,
    linear-gradient(var(--teal), var(--teal)) right 5.25px top 0 / 1.5px 12px no-repeat;
}

.hline__node,
.rule__node {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: -5px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--teal);
  transform: translateX(-50%);
}

.rule {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
}

.rule__label,
.rule__meta,
.rule__link {
  position: relative;
  font: 500 13px/1.3 var(--font-mono);
  letter-spacing: 0.01em;
  text-transform: lowercase;
}

.rule__label {
  color: var(--teal);
}

.rule__meta {
  color: var(--muted);
}

.rule__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--teal);
  text-decoration: none;
}

.rule__link .icon {
  transition: transform 0.3s var(--ease);
}

.rule__link:hover .icon {
  transform: translateX(4px);
}

/* corner ticks around an element */
.ticks {
  position: relative;
}

.ticks::before {
  content: "";
  position: absolute;
  inset: -12px;
  z-index: 2;
  pointer-events: none;
  --t: var(--teal);
  background:
    linear-gradient(var(--t), var(--t)) left top / 16px 1.5px no-repeat,
    linear-gradient(var(--t), var(--t)) left top / 1.5px 16px no-repeat,
    linear-gradient(var(--t), var(--t)) right top / 16px 1.5px no-repeat,
    linear-gradient(var(--t), var(--t)) right top / 1.5px 16px no-repeat,
    linear-gradient(var(--t), var(--t)) left bottom / 16px 1.5px no-repeat,
    linear-gradient(var(--t), var(--t)) left bottom / 1.5px 16px no-repeat,
    linear-gradient(var(--t), var(--t)) right bottom / 16px 1.5px no-repeat,
    linear-gradient(var(--t), var(--t)) right bottom / 1.5px 16px no-repeat;
}

/* ---------- Type ---------- */

/* the big page titles from the original design (Projects, About, ...) */
.title-xl {
  margin: 0;
  font: 700 clamp(4rem, 1.8rem + 9vw, 9rem) / 0.92 var(--font-sans);
  letter-spacing: -0.065em;
  color: var(--teal-ink);
  text-align: center;
}

.h2 {
  font: 600 clamp(1.75rem, 1.35rem + 1.4vw, 2.5rem) / 1.1 var(--font-sans);
  letter-spacing: -0.03em;
  color: var(--ink);
  text-wrap: balance;
}

.lead {
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  line-height: 1.6;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 22px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font: 500 15px/1 var(--font-sans);
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease),
    transform 0.25s var(--ease);
}

.btn:active {
  transform: translateY(1px) scale(0.98);
}

.btn--primary {
  background: var(--teal-ink);
  color: #fff;
}

.btn--primary:hover {
  background: var(--teal);
}

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

.btn--secondary:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.btn.is-copied {
  border-color: var(--teal);
  color: var(--teal);
}

/* ---------- Header: a ruled bar on the rails ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(252, 253, 253, 0.88);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--rule-strong);
  font-family: var(--font-sans);
  transition: box-shadow 0.3s var(--ease);
}

.site-header.is-scrolled {
  box-shadow: 0 10px 30px -24px rgba(11, 45, 58, 0.55);
}

/* crosses where the header line meets the rails */
.site-header::after {
  content: "";
  position: absolute;
  bottom: -6.5px;
  left: calc(50% - var(--railw) / 2 - 6px);
  width: calc(var(--railw) + 12px);
  height: 12px;
  pointer-events: none;
  background:
    linear-gradient(var(--teal), var(--teal)) left 0 top 5.25px / 12px 1.5px no-repeat,
    linear-gradient(var(--teal), var(--teal)) left 5.25px top 0 / 1.5px 12px no-repeat,
    linear-gradient(var(--teal), var(--teal)) right 0 top 5.25px / 12px 1.5px no-repeat,
    linear-gradient(var(--teal), var(--teal)) right 5.25px top 0 / 1.5px 12px no-repeat;
}

.site-header__inner {
  position: relative;
  height: 100%;
  display: flex;
  align-items: stretch;
}

/* the rails run up through the header */
.site-header__inner::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--gutter);
  right: var(--gutter);
  border-left: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
  pointer-events: none;
}

/* the centre thread starts here */
.site-header__inner::after {
  content: "";
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: -5px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--teal);
  transform: translateX(-50%);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
  padding: 0 22px 0 16px;
  color: var(--ink);
  text-decoration: none;
  transition: background-color 0.25s var(--ease);
}

.brand:hover,
.brand[aria-current="page"] {
  background: var(--tint);
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--rule-strong);
  background: var(--surface);
  color: var(--teal-ink);
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}

.brand__mark svg {
  width: 17px;
  height: 17px;
}

.brand:hover .brand__mark,
.brand[aria-current="page"] .brand__mark {
  background: var(--teal-ink);
  border-color: var(--teal-ink);
  color: #fff;
}

.brand__text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.brand__name {
  font: 600 15px/1 var(--font-sans);
  letter-spacing: -0.01em;
}

.brand__role {
  font: 500 11px/1 var(--font-mono);
  color: var(--muted);
  text-transform: lowercase;
}

.site-nav {
  display: flex;
}

.site-nav ul {
  display: flex;
  align-items: stretch;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav li {
  display: flex;
  border-left: 1px solid var(--rule);
}

.site-nav li:last-child {
  border-right: 1px solid var(--rule);
}

.site-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0 18px;
  color: var(--ink-2);
  font: 450 15px/1 var(--font-sans);
  text-transform: lowercase;
  text-decoration: none;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}

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

.site-nav a:hover {
  color: var(--teal);
  background: var(--tint);
}

.site-nav a:hover::after {
  transform: scaleX(0.4);
}

.site-nav a[aria-current="page"] {
  color: var(--teal-ink);
  font-weight: 550;
}

.site-nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

.site-header__resume {
  display: flex;
  align-items: center;
  margin-left: auto;
  padding: 0 16px 0 18px;
  border-left: 1px solid var(--rule);
  text-decoration: none;
}

.site-header__resume span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-pill);
  font: 500 12.5px/1 var(--font-mono);
  color: var(--teal-ink);
  text-transform: lowercase;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}

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

.site-header__resume:hover span {
  background: var(--teal-ink);
  border-color: var(--teal-ink);
  color: #fff;
}

.site-header__resume:hover .icon {
  transform: translateY(2px);
}

.nav-toggle {
  display: none;
  width: 60px;
  margin-left: auto;
  border: 0;
  border-left: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  place-items: center;
}

.nav-toggle .icon {
  width: 24px;
  height: 24px;
}

.nav-toggle .icon--close {
  display: none;
}

.site-header.is-open .nav-toggle .icon--open {
  display: none;
}

.site-header.is-open .nav-toggle .icon--close {
  display: block;
}

@media (max-width: 1080px) {
  .brand__role {
    display: none;
  }

  .site-nav a {
    padding: 0 13px;
  }
}

@media (max-width: 900px) {
  .site-header__inner::after {
    display: none;
  }

  .nav-toggle {
    display: grid;
  }

  .site-header__resume {
    display: none;
  }

  .site-nav ul {
    position: absolute;
    left: 0;
    right: 0;
    top: var(--header-h);
    flex-direction: column;
    align-items: stretch;
    padding: 4px var(--gutter) 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--rule-strong);
    box-shadow: 0 24px 40px -24px rgba(11, 45, 58, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0s linear 0.25s;
  }

  .site-nav {
    position: static;
  }

  .site-header__inner {
    position: relative;
  }

  .site-header.is-open .site-nav ul {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
  }

  .site-nav li,
  .site-nav li:last-child {
    border-left: 0;
    border-right: 0;
  }

  .site-nav li + li {
    border-top: 1px solid var(--rule);
  }

  .site-nav a {
    width: 100%;
    height: 54px;
    padding: 0 4px;
    font-size: 18px;
  }

  .site-nav a::after {
    left: auto;
    right: 4px;
    bottom: 50%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transform: translateY(50%) scale(0);
  }

  .site-nav a[aria-current="page"]::after {
    transform: translateY(50%) scale(1);
  }

  .site-nav a:hover::after {
    transform: translateY(50%) scale(0.6);
  }
}

/* ---------- Home ---------- */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero > .thread:first-child {
  --h: clamp(40px, 6vw, 72px);
  margin-bottom: 30px;
}

.hero__portrait {
  width: min(340px, 74vw);
}

.hero__portrait img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: 50% 32%;
  border-radius: 20px;
  box-shadow: 0 24px 48px -24px rgba(11, 45, 58, 0.4);
}

.hero__portrait + .thread {
  --h: clamp(36px, 5vw, 56px);
  margin-top: 26px;
}

.hero__statement {
  width: 100%;
}

.hero__title {
  max-width: 1040px;
  margin-inline: auto;
  font: 600 clamp(1.75rem, 1.1rem + 1.9vw, 2.625rem) / 1.14 var(--font-sans);
  letter-spacing: -0.035em;
  color: var(--ink);
  text-wrap: balance;
}

.hero__sub {
  max-width: 44rem;
  margin: 18px auto 0;
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
  line-height: 1.6;
  color: var(--muted);
  text-wrap: pretty;
}

/* the thread splits to the two actions and carries on down the middle */
.fork {
  --gap: clamp(48px, 7vw, 88px);
  --drop: 22px;
  --col: 340px;
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, var(--col)));
  justify-content: center;
  column-gap: var(--gap);
  padding-top: calc(var(--drop) + 28px);
  padding-bottom: clamp(36px, 5vw, 52px);
}

/* centre line, top to bottom */
.fork::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: var(--teal);
}

/* horizontal branch between the two button centres */
.fork__branch {
  position: absolute;
  top: 28px;
  left: 50%;
  width: calc(var(--col) + var(--gap));
  height: 1px;
  background: var(--teal);
  transform: translateX(-50%);
}

.fork__branch::before,
.fork__branch::after {
  content: "";
  position: absolute;
  top: -4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid var(--teal);
  background: var(--bg);
}

.fork__branch::before {
  left: -4px;
}

.fork__branch::after {
  right: -4px;
}

.fork__node {
  position: absolute;
  z-index: 1;
  top: 24px;
  left: 50%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--teal);
  transform: translateX(-50%);
}

.fork > a {
  position: relative;
}

/* drop from the branch to each action */
.fork > a::before {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(var(--drop) * -1);
  height: var(--drop);
  width: 1px;
  background: var(--teal);
}

/* file-like action cards */
.action {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px 12px 12px;
  border: 1px solid var(--rule-strong);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  text-decoration: none;
  transition: border-color 0.3s var(--ease), box-shadow 0.4s var(--ease), transform 0.3s var(--ease);
}

.action:hover {
  border-color: var(--teal);
  box-shadow: 0 16px 32px -20px rgba(11, 45, 58, 0.45);
  transform: translateY(-2px);
}

.action:active {
  transform: translateY(0) scale(0.99);
}

.action__icon {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 56px;
  border-radius: 6px 14px 6px 6px;
  background: var(--teal-ink);
  color: #fff;
}

.action__icon::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 12px;
  height: 12px;
  border-radius: 0 6px 0 4px;
  background: linear-gradient(225deg, var(--bg) 50%, rgba(255, 255, 255, 0.35) 50%);
}

.action__icon .icon {
  width: 24px;
  height: 24px;
}

.action__icon--round {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface-2);
}

.action__icon--round::after {
  display: none;
}

.action__icon--round img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.action__text {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.action__title {
  font: 600 16px/1.2 var(--font-sans);
  letter-spacing: -0.01em;
}

.action__meta {
  white-space: nowrap;
  font: 500 12px/1.2 var(--font-mono);
  color: var(--muted);
  text-transform: lowercase;
}

.action__go {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  margin-left: auto;
  border-radius: 50%;
  border: 1px solid var(--rule-strong);
  color: var(--teal);
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease), transform 0.35s var(--ease);
}

.action:hover .action__go {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.action--download:hover .action__go {
  transform: translateY(2px);
}

.action--link:hover .action__go {
  transform: translateX(2px);
}

@media (max-width: 620px) {
  .fork {
    --gap: 24px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fork__branch {
    width: calc(50% + var(--gap) / 2);
  }

  .action__meta {
    white-space: normal;
  }

  .action {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
  }

  .action__go {
    display: none;
  }

  .action__title {
    font-size: 15px;
  }
}

/* ---------- Project cards: ruled rows that run off the page ---------- */

.cards {
  position: relative;
  z-index: 1;
}

.cards__row {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cards__row--wide {
  grid-template-columns: 2fr 1fr;
}

/* line under every row, full-bleed, with crosses on the rails */
.cards__row::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 100vw;
  height: 1px;
  background: var(--rule);
  transform: translateX(-50%);
  pointer-events: none;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(14px, 1.6vw, 20px);
  border-right: 1px solid var(--rule);
  color: var(--ink);
  text-decoration: none;
  transition: background-color 0.4s var(--ease);
}

.card:last-child {
  border-right: 0;
}

.card:hover {
  background: var(--tint);
}

.card:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: -2px;
  border-radius: 0;
}

.card__media {
  overflow: hidden;
  border-radius: var(--radius-media);
  background: var(--surface-2);
  aspect-ratio: 16 / 10;
}

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--ease);
}

.card:hover .card__media img {
  transform: scale(1.045);
}

.card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 18px 4px 4px;
}

.card__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font: 500 12.5px/1.3 var(--font-mono);
  color: var(--muted);
  text-transform: lowercase;
}

.card__meta span:first-child {
  color: var(--teal);
}

.card__meta span + span::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 1px;
  margin-right: 10px;
  vertical-align: middle;
  background: var(--rule-strong);
}

.card__title {
  font: 600 clamp(1.125rem, 1.05rem + 0.3vw, 1.3125rem) / 1.25 var(--font-sans);
  letter-spacing: -0.02em;
  color: var(--ink);
  transition: color 0.3s var(--ease);
}

.card:hover .card__title {
  color: var(--teal);
}

.card__desc {
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
  text-wrap: pretty;
}

.card__go {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 16px;
  font: 500 12.5px/1 var(--font-mono);
  color: var(--teal);
  text-transform: lowercase;
}

.card__go .icon {
  transition: transform 0.35s var(--ease);
}

.card:hover .card__go .icon {
  transform: translateX(5px);
}

.card--wide {
  flex-direction: row;
  gap: clamp(16px, 2vw, 28px);
}

.card--wide .card__media {
  flex: 1.5;
  aspect-ratio: auto;
  min-height: 240px;
}

.card--wide .card__body {
  flex: 1;
  padding: 4px 4px 4px 0;
}

.card--wide .card__title {
  font-size: clamp(1.375rem, 1.2rem + 0.6vw, 1.75rem);
}

@media (max-width: 980px) {
  .cards__row,
  .cards__row--wide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cards__row > .card:nth-child(3) {
    grid-column: span 2;
    border-top: 1px solid var(--rule);
    border-right: 0;
  }

  .cards__row > .card:nth-child(2) {
    border-right: 0;
  }

  .card--wide {
    grid-column: span 2;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }
}

@media (max-width: 640px) {
  .cards__row,
  .cards__row--wide {
    grid-template-columns: minmax(0, 1fr);
  }

  .cards__row > .card,
  .cards__row > .card:nth-child(3),
  .card--wide {
    grid-column: auto;
    border-right: 0;
    border-top: 0;
    border-bottom: 1px solid var(--rule);
  }

  .cards__row > .card:last-child {
    border-bottom: 0;
  }

  .card--wide {
    flex-direction: column;
  }

  .card--wide .card__media {
    flex: none;
    aspect-ratio: 16 / 10;
    min-height: 0;
  }

  .card--wide .card__body {
    padding: 18px 4px 4px;
  }
}

/* ---------- Page heads (Projects, About) ---------- */

.page-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: clamp(40px, 6vw, 80px);
}

.page-head .lead {
  max-width: 40rem;
  margin-top: 24px;
  color: var(--muted);
}

.page-head .thread {
  --h: clamp(48px, 6vw, 72px);
  margin-top: 32px;
  margin-bottom: 4px;
}

/* ---------- About: labelled rows from the original layout ---------- */

.rows {
  position: relative;
  z-index: 1;
}

.row {
  position: relative;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px 48px;
  padding: clamp(32px, 4vw, 48px) 0;
}

.row::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 100vw;
  height: 1px;
  background: var(--rule);
  transform: translateX(-50%);
  pointer-events: none;
}

.row__label {
  position: relative;
  padding-left: 18px;
  font: 500 13px/1.6 var(--font-mono);
  color: var(--teal);
  text-transform: lowercase;
}

.row__label::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1.5px solid var(--teal);
}

.row__body {
  max-width: 46rem;
}

.row__body p {
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink-2);
}

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

.row__body .first {
  font-size: clamp(1.1875rem, 1.05rem + 0.45vw, 1.375rem);
  line-height: 1.55;
  color: var(--ink);
}

@media (max-width: 760px) {
  .row {
    grid-template-columns: minmax(0, 1fr);
  }
}

.mugshot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 32px 56px;
}

.mugshot__img {
  width: 168px;
}

.mugshot__img img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
}

.mugshot__logos p {
  margin-bottom: 12px;
  font: 500 13px/1.3 var(--font-mono);
  color: var(--muted);
  text-transform: lowercase;
}

.mugshot__logos img {
  height: 84px;
  width: auto;
}

.strength + .strength {
  margin-top: 24px;
}

.strength h3 {
  margin-bottom: 6px;
  font: 600 18px/1.35 var(--font-sans);
  letter-spacing: -0.01em;
  color: var(--ink);
}

.triple {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-left: 1px solid var(--rule);
}

.triple > li {
  padding: 4px 24px;
  border-right: 1px solid var(--rule);
  font: 500 16px/1.55 var(--font-sans);
  color: var(--ink);
}

@media (max-width: 760px) {
  .triple {
    grid-template-columns: minmax(0, 1fr);
    border-left: 0;
  }

  .triple > li {
    padding: 16px 0;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }
}

.pull-quote {
  margin: 28px 0;
  padding: 2px 0 2px 24px;
  border-left: 2px solid var(--teal);
  font: 500 clamp(1.25rem, 1.1rem + 0.6vw, 1.625rem) / 1.4 var(--font-sans);
  letter-spacing: -0.015em;
  color: var(--teal-ink);
  text-wrap: balance;
}

.contact-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

/* ---------- Social ---------- */

.social {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.social a {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--rule-strong);
  color: var(--teal-ink);
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), background-color 0.25s var(--ease);
}

.social a:hover {
  color: #fff;
  background: var(--teal);
  border-color: var(--teal);
}

.social .icon {
  width: 19px;
  height: 19px;
}

/* ---------- Next page + footer ---------- */

.page-next {
  position: relative;
  z-index: 1;
  font-family: var(--font-sans);
  margin-top: clamp(56px, 8vw, 96px);
}

.page-next a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0 28px;
  color: var(--ink);
  text-decoration: none;
}

.page-next__label {
  display: block;
  margin-bottom: 8px;
  font: 500 13px/1 var(--font-mono);
  color: var(--teal);
  text-transform: lowercase;
}

.page-next__title {
  font: 700 clamp(2rem, 1.3rem + 2.8vw, 3.5rem) / 1 var(--font-sans);
  letter-spacing: -0.05em;
  color: var(--teal-ink);
  text-transform: lowercase;
}

.page-next__arrow {
  display: grid;
  place-items: center;
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--rule-strong);
  color: var(--teal);
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease), transform 0.4s var(--ease);
}

.page-next a:hover .page-next__arrow {
  background: var(--teal);
  color: #fff;
  transform: translateX(4px);
}

.site-footer {
  font-family: var(--font-sans);
  border-top: 1px solid var(--rule-strong);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  padding-block: 28px;
}

.site-footer p {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  text-transform: lowercase;
}

.site-footer__mail {
  color: var(--teal);
  text-decoration: none;
}

.site-footer__mail:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-footer__right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.site-footer .social a {
  width: 38px;
  height: 38px;
}

.site-footer .social .icon {
  width: 17px;
  height: 17px;
}

/* ---------- Carousel ---------- */

.carousel {
  --ratio: 16 / 10;
  display: block;
  width: 100%;
  max-width: 1040px;
  margin: 40px auto;
  font-family: var(--font-sans);
}

.carousel__viewport {
  position: relative;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--rule);
  overflow: hidden;
}

.carousel__track {
  display: flex;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  outline: none;
}

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

.carousel__slide {
  flex: 0 0 100%;
  aspect-ratio: var(--ratio);
  display: grid;
  place-items: center;
  padding: clamp(10px, 2.4vw, 28px);
  scroll-snap-align: center;
  scroll-snap-stop: always;
}

.carousel__slide img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
}

.carousel__btn {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-top: -23px;
  padding: 0;
  border-radius: var(--radius-pill);
  border: 1px solid var(--rule-strong);
  background: rgba(255, 255, 255, 0.94);
  color: var(--teal-ink);
  cursor: pointer;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease);
}

.carousel__btn .icon {
  width: 20px;
  height: 20px;
}

.carousel__btn:hover {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.carousel__btn:active {
  transform: scale(0.94);
}

.carousel__btn--prev {
  left: 14px;
}

.carousel__btn--next {
  right: 14px;
}

.carousel__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  margin-top: 12px;
  padding-inline: 2px;
}

.carousel__caption {
  margin: 0;
  font: 400 14px/1.5 var(--font-sans);
  color: var(--muted);
}

.carousel__dots {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.carousel__dot {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.carousel__dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--teal);
  transition: width 0.35s var(--ease), background-color 0.35s var(--ease);
}

.carousel__dot[aria-current="true"]::before {
  width: 20px;
  background: var(--teal);
}

@media (max-width: 600px) {
  .carousel__btn {
    width: 40px;
    height: 40px;
    margin-top: -20px;
  }

  .carousel__btn--prev {
    left: 8px;
  }

  .carousel__btn--next {
    right: 8px;
  }
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  html.js .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
    transition-delay: calc(var(--i, 0) * 80ms);
  }

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

  .rise {
    animation: rise 1s var(--ease) both;
    animation-delay: calc(var(--i, 0) * 110ms);
  }

  .carousel__track {
    scroll-behavior: smooth;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.rule--flat::before,
.rule--flat::after {
  display: none;
}

/* ---------- Stats strip (ruled cells) ---------- */

.stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
}

.stats::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 100vw;
  height: 1px;
  background: var(--rule);
  transform: translateX(-50%);
}

.stats > div {
  padding: 24px 24px 22px;
}

.stats > div + div {
  border-left: 1px solid var(--rule);
}

.stats dt {
  font: 700 clamp(2.25rem, 1.8rem + 1.6vw, 3.25rem) / 1 var(--font-sans);
  letter-spacing: -0.05em;
  color: var(--teal-ink);
}

.stats dd {
  margin-top: 8px;
  font: 500 12.5px/1.4 var(--font-mono);
  color: var(--muted);
  text-transform: lowercase;
}

@media (max-width: 600px) {
  .stats > div {
    padding: 18px 12px 16px;
  }
}

/* ---------- Publications ---------- */

.pubs-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
}

.seg {
  display: none;
  padding: 3px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-pill);
}

html.js .seg {
  display: inline-flex;
}

.seg__btn {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink-2);
  font: 500 12.5px/1 var(--font-mono);
  text-transform: lowercase;
  cursor: pointer;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
}

.seg__btn[aria-pressed="true"] {
  background: var(--teal-ink);
  color: #fff;
}

.pubs {
  position: relative;
  z-index: 1;
}

.pubs__group {
  position: relative;
}

.pubs__group::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 100vw;
  height: 1px;
  background: var(--rule-strong);
  transform: translateX(-50%);
}

.pubs__group:first-child::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 100vw;
  height: 1px;
  background: var(--rule-strong);
  transform: translateX(-50%);
}

.pub {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 96px;
  gap: 8px 24px;
  align-items: start;
  padding: 24px 0;
}

.pub + .pub .pub__main,
.pub + .pub .pub__cites {
  position: relative;
}

.pub + .pub {
  border-top: 1px solid var(--rule);
  margin-left: 144px;
  padding-left: 0;
  grid-template-columns: minmax(0, 1fr) 96px;
}

.pub + .pub .pub__year {
  display: none;
}

.pubs[data-pubs="cited"] .pub + .pub {
  margin-left: 0;
  grid-template-columns: 120px minmax(0, 1fr) 96px;
}

.pubs[data-pubs="cited"] .pub + .pub .pub__year {
  display: block;
}

.pub__year {
  position: relative;
  padding-left: 18px;
  font: 500 15px/1.5 var(--font-mono);
  color: var(--teal);
}

.pub__year::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--teal);
}

.pub__title {
  font: 500 clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem) / 1.4 var(--font-sans);
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  text-wrap: pretty;
  transition: color 0.2s var(--ease);
}

.pub__title .icon {
  width: 0.85em;
  height: 0.85em;
  margin-left: 6px;
  vertical-align: -0.05em;
  color: var(--teal);
  opacity: 0.55;
  transition: opacity 0.2s var(--ease), transform 0.3s var(--ease);
}

.pub__title:hover {
  color: var(--teal);
}

.pub__title:hover .icon {
  opacity: 1;
  transform: translate(2px, -2px);
}

.pub__venue {
  margin-top: 6px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-2);
}

.pub__authors {
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

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

.pub__case {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 6px 12px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-pill);
  font: 500 12px/1.2 var(--font-mono);
  color: var(--teal);
  text-decoration: none;
  text-transform: lowercase;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}

.pub__case:hover {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.pub__cites {
  justify-self: end;
  font: 500 12.5px/1.6 var(--font-mono);
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}

.pub__cites b {
  display: block;
  font: 700 24px/1 var(--font-sans);
  letter-spacing: -0.03em;
  color: var(--teal-ink);
}

@media (max-width: 720px) {
  .pub,
  .pub + .pub,
  .pubs[data-pubs="cited"] .pub + .pub {
    grid-template-columns: minmax(0, 1fr) auto;
    margin-left: 0;
  }

  .pub__year {
    grid-column: 1 / -1;
  }

  .pub__main {
    grid-column: 1;
  }
}

/* ---------- Certificates & education ---------- */

.card--static {
  cursor: default;
}

.card--static:hover .card__title {
  color: var(--ink);
}

.card__media--cert {
  aspect-ratio: 390 / 183;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.chips li {
  padding: 4px 10px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--ink-2);
  background: var(--surface);
}

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

.edu__logo {
  display: grid;
  place-items: center;
  margin: 12px;
  padding: 24px;
  border-radius: var(--radius-media);
  background: var(--surface);
  border: 1px solid var(--rule);
}

.edu__logo img {
  width: auto;
  max-width: 100%;
  max-height: 120px;
}

@media (max-width: 640px) {
  .cards__row--two {
    grid-template-columns: minmax(0, 1fr);
  }
}
