:root {
  --bg: #ede9e1;
  --bg2: #e3dfd6;
  --ink: #111009;
  --rust: #b83d1c;
  --muted: #8a8278;
  --moss: #5f6b4f;          /* accent that harmonises with rust + cream */
  --border: rgba(17, 16, 9, .10);
  --sans: 'Unbounded', sans-serif;
  --mono: 'DM Mono', monospace;
  /* organic motion tokens */
  --ease-organic: cubic-bezier(.65, .05, .35, 1);
  --slow: 18s;
  --slower: 28s;
  --slowest: 42s;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

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

html {
  scroll-behavior: smooth;
}

html {
  /* prevent iOS Safari from auto-zooming text */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  overflow-x: hidden;
  cursor: none;
  /* allow only vertical pan, prevent horizontal rubber-band on iOS */
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
}

/* TOUCH DEVICES — disable custom cursor entirely, restore native pointers */
@media (hover: none), (pointer: coarse) {
  body { cursor: auto; }
  a, button, .btn, .wk-proj, .pb-item, .nav-ham, .ct-links a {
    cursor: pointer !important;
  }
  #cursor, #cursor-trail { display: none !important; }
  /* disable expensive hover-only effects on touch */
  .pb-item:hover, .wk-proj:hover { background: transparent; padding-left: 0; }
  .pb-item:hover { padding: 32px 52px; }
}

/* keep page content above ambient layers */
nav,
section,
footer,
#mobile-menu {
  position: relative;
  z-index: 20;
}

/* ── BLOB CURSOR ─────────────────────── */
#cursor {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  width: 14px;
  height: 14px;
  background: var(--rust);
  transform: translate(-50%, -50%);
  mix-blend-mode: multiply;
  animation: bmorph 4s ease-in-out infinite;
  transition: width .35s var(--ease-organic), height .35s var(--ease-organic), background .35s;
}

#cursor-trail {
  position: fixed;
  pointer-events: none;
  z-index: 9998;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(184,61,28,.10), transparent 65%);
  transform: translate(-50%, -50%);
  mix-blend-mode: multiply;
  filter: blur(2px);
  transition: width .6s var(--ease-organic), height .6s var(--ease-organic), opacity .4s;
}

body:has(a:hover) #cursor {
  width: 30px;
  height: 30px;
  background: var(--ink);
}

body:has(a:hover) #cursor-trail {
  width: 90px;
  height: 90px;
  opacity: .8;
}

@keyframes bmorph {
  0%,
  100% {
    border-radius: 60% 40% 30% 70%/60% 30% 70% 40%;
  }
  25% {
    border-radius: 30% 60% 70% 40%/50% 60% 30% 60%;
  }
  50% {
    border-radius: 50% 30% 60% 40%/70% 50% 40% 60%;
  }
  75% {
    border-radius: 40% 70% 30% 60%/30% 40% 70% 60%;
  }
}

/* ── AMBIENT LAYER ───────────────────── */
.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.blob {
  position: absolute;
  pointer-events: none;
  animation: bmorph var(--slow) ease-in-out infinite,
             drift-a var(--slower) ease-in-out infinite;
  mix-blend-mode: multiply;
  will-change: transform, border-radius;
}

#bg-blob.blob-a {
  right: 5%;
  top: 50%;
  width: 520px;
  height: 520px;
  background: radial-gradient(ellipse at 44% 44%,
      rgba(10, 9, 6, .34) 0%, rgba(10, 9, 6, .20) 36%,
      rgba(10, 9, 6, .05) 60%, transparent);
  filter: blur(6px);
  z-index: 10;
  transform: translateY(-50%);
  animation: bmorph var(--slow) ease-in-out infinite,
             float-a 22s ease-in-out infinite;
}

.blob-b {
  left: -8%;
  top: 18%;
  width: 380px;
  height: 380px;
  background: radial-gradient(ellipse at 50% 50%,
      rgba(184, 61, 28, .14) 0%, rgba(184, 61, 28, .06) 45%, transparent 70%);
  filter: blur(40px);
  animation: bmorph var(--slower) ease-in-out infinite,
             float-b 32s ease-in-out infinite;
}

.blob-c {
  left: 40%;
  top: 130%;
  width: 460px;
  height: 460px;
  background: radial-gradient(ellipse at 50% 50%,
      rgba(17, 16, 9, .08) 0%, rgba(17, 16, 9, .03) 50%, transparent 70%);
  filter: blur(50px);
  animation: bmorph var(--slowest) ease-in-out infinite,
             float-c 38s ease-in-out infinite;
}

.blob-d {
  right: -10%;
  top: 220%;
  width: 360px;
  height: 360px;
  background: radial-gradient(ellipse at 50% 50%,
      rgba(184, 61, 28, .10) 0%, rgba(184, 61, 28, .04) 50%, transparent 70%);
  filter: blur(45px);
  animation: bmorph var(--slow) ease-in-out infinite reverse,
             float-d 30s ease-in-out infinite;
}

@keyframes float-a {
  0%, 100% { transform: translateY(-50%) translateX(0); }
  50%      { transform: translateY(-48%) translateX(-22px); }
}
@keyframes float-b {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(40px, -30px) scale(1.05); }
  66%      { transform: translate(-20px, 40px) scale(.96); }
}
@keyframes float-c {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(-50px, 30px) scale(1.08); }
}
@keyframes float-d {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(30px, -40px) scale(.94); }
}

/* ── BREATHING DOT FIELD ─────────────── */
.dot-field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  color: var(--ink);
  opacity: .14;
  animation: breathe 14s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { opacity: .12; transform: scale(1); }
  50%      { opacity: .18; transform: scale(1.04); }
}

/* ── GRAIN OVERLAY ───────────────────── */
.grain {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  pointer-events: none;
  z-index: 3;
  opacity: .045;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.92' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.9'/></svg>");
  animation: grain-shift 8s steps(8) infinite;
}

@keyframes grain-shift {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-2%, 1%); }
  40%  { transform: translate(1%, -2%); }
  60%  { transform: translate(-1%, 2%); }
  80%  { transform: translate(2%, -1%); }
  100% { transform: translate(0, 0); }
}

/* ── NAV — organic floating pill, liquid glass, morphing border-radius ── */
nav {
  position: fixed;
  top: max(18px, env(safe-area-inset-top));
  left: 50%;
  z-index: 100;
  padding: 12px 26px 12px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 36px;
  /* organic morphing pill — same animation family as the blobs */
  border-radius: 60% 40% 50% 50% / 50% 50% 60% 40%;
  transform: translate(-50%, calc(-100% - 24px)) scale(.92);
  opacity: 0;
  pointer-events: none;
  background: transparent;
  border: 1px solid transparent;
  transition:
    transform .9s var(--ease-organic),
    opacity .55s var(--ease-organic),
    border-radius 1.2s var(--ease-organic),
    padding .45s var(--ease-organic),
    background .55s,
    border-color .55s,
    box-shadow .55s;
  white-space: nowrap;
}

/* Reveals on scroll — floats in, settles into pill with liquid glass */
nav.scrolled {
  transform: translate(-50%, 0) scale(1);
  opacity: 1;
  pointer-events: auto;
  background: rgba(237, 233, 225, .42);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border-color: rgba(255, 255, 255, .5);
  border-radius: 999px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .65),
    inset 0 -1px 0 rgba(17, 16, 9, .04),
    0 14px 38px -14px rgba(17, 16, 9, .18),
    0 4px 10px -4px rgba(184, 61, 28, .08);
  animation: nav-breathe 12s ease-in-out infinite 1.2s;
}

@keyframes nav-breathe {
  0%, 100% {
    border-radius: 999px;
    transform: translate(-50%, 0) scale(1);
  }
  50% {
    border-radius: 60% 60% 58% 58% / 50% 50% 50% 50%;
    transform: translate(-50%, -2px) scale(1.005);
  }
}

/* organic rust pulse-dot before the logo — matches hero hm-dot */
nav::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--rust);
  flex-shrink: 0;
  animation: pulse-dot 3.4s ease-in-out infinite;
  margin-right: -8px;
  opacity: 0;
  transition: opacity .5s var(--ease-organic) .15s;
}
nav.scrolled::before { opacity: 1; }

/* Fallback for browsers without backdrop-filter */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  nav.scrolled { background: rgba(237, 233, 225, .94); }
}

/* Mobile floating ham — organic blob shape matching the nav */
.nav-ham-float {
  display: none;
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: max(18px, env(safe-area-inset-right));
  z-index: 101;
  width: 46px;
  height: 46px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  background: rgba(237, 233, 225, .42);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 60% 40% 50% 50% / 50% 50% 60% 40%;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .65),
    0 10px 26px -10px rgba(17, 16, 9, .18);
  cursor: pointer;
  animation: ham-breathe 10s ease-in-out infinite;
  transition: opacity .4s var(--ease-organic), transform .5s var(--ease-organic);
}
.nav-ham-float span {
  display: block;
  width: 18px;
  height: 1px;
  background: var(--ink);
}
@keyframes ham-breathe {
  0%, 100% { border-radius: 60% 40% 50% 50% / 50% 50% 60% 40%; }
  33%      { border-radius: 40% 60% 55% 45% / 55% 45% 55% 45%; }
  66%      { border-radius: 55% 45% 40% 60% / 45% 60% 40% 55%; }
}
@media (max-width: 900px) {
  .nav-ham-float { display: flex; }
  /* hide the main pill nav on mobile — use the floating ham instead */
  nav { display: none; }
}
body.nav-visible .nav-ham-float {
  opacity: 0;
  transform: scale(.85);
  pointer-events: none;
}

.nav-logo {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--ink);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 36px;
  list-style: none;
}

.nav-links a {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color .3s var(--ease-organic);
  position: relative;
  padding-bottom: 4px;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--rust);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .55s var(--ease-organic);
}

.nav-links a:hover {
  color: var(--ink);
}
.nav-links a:hover::after { transform: scaleX(1); }

.nav-cv {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--rust);
  text-decoration: none;
  border: 1px solid rgba(184, 61, 28, .35);
  padding: 7px 14px;
  transition: background .2s;
}

.nav-cv:hover {
  background: rgba(184, 61, 28, .07);
}

/* hamburger */
.nav-ham {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: none;
  background: none;
  border: none;
  /* iOS-friendly hit target ≥ 44px */
  padding: 12px;
  margin: -12px;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}

.nav-ham span {
  display: block;
  width: 22px;
  height: 1px;
  background: var(--ink);
  transition: all .3s;
}

/* mobile menu */
#mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99;
  background: var(--bg);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding-top: 80px;
}

#mobile-menu.open {
  display: flex;
}

#mobile-menu a {
  font-family: var(--sans);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--ink);
  text-decoration: none;
}

#mobile-menu a:hover {
  color: var(--rust);
}

/* ── LAYOUT ──────────────────────────── */
.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 52px;
}

section {
  position: relative;
}

.s-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--rust);
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 56px;
}

.s-label::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rust);
  animation: pulse-dot 3.4s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulse-dot {
  0%, 100% { opacity: .35; transform: scale(.85); }
  50%      { opacity: 1;   transform: scale(1.15); }
}

.s-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--rust), transparent);
  max-width: 80px;
  transform-origin: left;
  animation: line-grow 4s ease-in-out infinite alternate;
}

@keyframes line-grow {
  0%   { transform: scaleX(.6); opacity: .5; }
  100% { transform: scaleX(1);  opacity: 1; }
}

/* reveal */
.rv {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 1.1s var(--ease-organic), transform 1.1s var(--ease-organic);
}

.rv.on {
  opacity: 1;
  transform: none;
}

.rv2 {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 1.1s var(--ease-organic) .18s, transform 1.1s var(--ease-organic) .18s;
}

.rv2.on {
  opacity: 1;
  transform: none;
}

.rv3 {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 1.1s var(--ease-organic) .34s, transform 1.1s var(--ease-organic) .34s;
}

.rv3.on {
  opacity: 1;
  transform: none;
}

/* ── HERO ─ editorial, asymmetric, organic ─────────── */
#hero {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 130px 52px 48px;
  /* honour safe areas on iPhone landscape (notch) */
  padding-left: max(52px, env(safe-area-inset-left));
  padding-right: max(52px, env(safe-area-inset-right));
  gap: 40px;
  position: relative;
}

/* TOP META STRIP */
.hero-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}

.hm-l, .hm-r {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hm-r { text-align: right; }

.hm-status {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--rust);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.hm-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--rust);
  animation: pulse-dot 3.4s ease-in-out infinite;
}

.hm-line {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}
.hm-line:first-child { color: var(--ink); }

/* NAME BLOCK */
.hero-name {
  font-family: var(--sans);
  font-weight: 900;
  font-size: clamp(72px, 13vw, 220px);
  line-height: .86;
  letter-spacing: -.035em;
  align-self: center;
  margin: 0;
  padding: 0;
}

.hn-row {
  display: block;
  white-space: nowrap;        /* words never break mid-line */
}
.hn-row.outline {
  color: transparent;
  -webkit-text-stroke: 2px var(--ink);
  padding-left: clamp(40px, 8vw, 140px);  /* indent for editorial offset */
}
.hn-word {
  display: inline-block;
  white-space: nowrap;        /* letters stay attached */
}
.hn-gap {
  display: inline-block;
  width: .35em;
}

/* per-letter staggered reveal — letters wrapped per word so word never breaks */
.hero-name .ltr {
  display: inline-block;
  transform: translateY(110%) rotate(3deg);
  opacity: 0;
  transition: transform 1.1s var(--ease-organic), opacity .9s ease;
}
.hero-name.on .ltr { transform: none; opacity: 1; }

/* gentle float after load */
.hero-name.on .hn-row {
  animation: gentle-rise 9s ease-in-out infinite;
}
.hero-name.on .hn-row.outline { animation-delay: -4.5s; }
@keyframes gentle-rise {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}

/* BOTTOM STRIP */
.hero-foot {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 48px;
}

.hf-tag { max-width: 460px; }

.hf-tagline {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.9;
  color: var(--muted);
  margin-bottom: 24px;
}

.hf-ctas {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.btn {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all .25s var(--ease-organic);
}
.btn-fill {
  background: var(--ink);
  color: var(--bg);
  padding: 12px 22px;
}
.btn-fill:hover { background: var(--rust); }
.btn-bare {
  color: var(--muted);
  border-bottom: 1px solid var(--muted);
  padding-bottom: 1px;
}
.btn-bare:hover { color: var(--ink); border-color: var(--ink); }

/* SCROLL HINT */
.hf-scroll {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}
.hf-scroll span {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: .26em;
  text-transform: uppercase;
}
.hf-scroll svg {
  width: 12px;
  height: 50px;
  opacity: .5;
  animation: scroll-pulse 2.6s ease-in-out infinite;
}
@keyframes scroll-pulse {
  0%, 100% { opacity: .25; transform: translateY(0); }
  50%      { opacity: .8;  transform: translateY(6px); }
}

/* organic flowing divider line */
.flow-line {
  display: block;
  width: 100%;
  height: 80px;
  position: relative;
  z-index: 20;
  margin: -20px 0 -20px;
  pointer-events: none;
}
.flow-line path {
  animation: trace-line 22s ease-in-out infinite;
}
@keyframes trace-line {
  0%   { stroke-dashoffset: 3400; }
  50%  { stroke-dashoffset: 0;    }
  100% { stroke-dashoffset: -3400; }
}

/* ── ABOUT ───────────────────────────── */
#about {
  padding: 140px 0;
}

.about-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 80px;
  align-items: start;
}

.a-left {
  position: relative;
}

.a-num {
  font-family: var(--sans);
  font-size: 160px;
  font-weight: 900;
  color: rgba(17, 16, 9, .05);
  line-height: 1;
  letter-spacing: -.04em;
  user-select: none;
  margin-bottom: -20px;
  display: inline-block;
  animation: gentle-rise 11s ease-in-out infinite;
}

.a-title {
  font-family: var(--sans);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.02em;
  margin-bottom: 28px;
}

.a-title em {
  color: var(--rust);
  font-style: normal;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 5px 12px;
  transition: color .35s var(--ease-organic),
              border-color .35s var(--ease-organic),
              transform .55s var(--ease-organic),
              background .35s;
}

.tag:hover {
  color: var(--rust);
  border-color: rgba(184, 61, 28, .3);
  transform: translateY(-3px);
  background: rgba(184, 61, 28, .04);
}

.a-right {}

.bio p {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 2;
  color: rgba(17, 16, 9, .62);
  margin-bottom: 18px;
}

.bio p strong {
  color: var(--ink);
  font-weight: 400;
}

.bio a {
  color: var(--rust);
  text-decoration: none;
}

.bio a:hover {
  text-decoration: underline;
}

.award {
  margin-top: 28px;
  padding: 18px 22px;
  border: 1px solid rgba(184, 61, 28, .22);
  background: rgba(184, 61, 28, .05);
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.award-ico {
  font-size: 15px;
  flex-shrink: 0;
  padding-top: 1px;
  display: inline-block;
  animation: gentle-tilt 6s ease-in-out infinite;
  transform-origin: bottom center;
}

@keyframes gentle-tilt {
  0%, 100% { transform: rotate(-4deg); }
  50%      { transform: rotate(4deg); }
}

.award-txt {
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.75;
}

.award-txt strong {
  display: block;
  color: var(--rust);
  font-weight: 400;
  letter-spacing: .04em;
  margin-bottom: 3px;
}

/* ── WORK ─ research areas with nested projects ────── */
#work {
  padding: 120px 0;
}

.wk-heading {
  font-family: var(--sans);
  font-size: clamp(32px, 4vw, 56px);
  font-weight: 900;
  letter-spacing: -.03em;
  line-height: 1;
  margin-bottom: 8px;
}
.wk-heading em { color: var(--rust); font-style: normal; }

.wk-sub {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .06em;
  margin-bottom: 56px;
}

.wk-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* AREA — the research thread */
.wk-area {
  padding: 36px 0 28px;
  position: relative;
}
.wk-area + .wk-area::before {
  /* organic gradient separator between research areas */
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(to right,
    transparent 0%,
    rgba(17, 16, 9, .12) 18%,
    rgba(184, 61, 28, .18) 50%,
    rgba(17, 16, 9, .12) 82%,
    transparent 100%);
}

.wk-area-head {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 0 24px;
  align-items: baseline;
  margin-bottom: 18px;
}

.wk-n {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}

.wk-title {
  font-family: var(--sans);
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 700;
  letter-spacing: -.015em;
  margin-bottom: 6px;
}
.wk-keys {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: .04em;
}

/* PROJECTS nested under each area */
.wk-projects {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-left: 52px;             /* aligns with text column */
  border-left: 1px solid var(--border);
}

.wk-projects.empty .wk-empty {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: .04em;
  font-style: italic;
  padding: 14px 0 14px 24px;
}

.wk-proj {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0 40px;
  align-items: start;
  padding: 22px 0 22px 24px;
  text-decoration: none;
  color: inherit;
  cursor: none;
  position: relative;
  border-top: 1px solid var(--border);
  transition: background .5s var(--ease-organic),
              padding-left .55s var(--ease-organic);
}
.wk-proj:first-child { border-top: none; }
.wk-proj::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 0;
  height: 1px;
  background: var(--rust);
  transition: width .5s var(--ease-organic);
}
.wk-proj:hover {
  background: var(--bg2);
  padding-left: 40px;
}
.wk-proj:hover::before { width: 20px; }

.wk-proj-l { min-width: 0; }
.wk-proj-name {
  font-family: var(--sans);
  font-size: clamp(20px, 2.2vw, 28px);
  font-weight: 900;
  letter-spacing: -.02em;
  line-height: 1;
  margin-bottom: 10px;
  display: block;
  transition: color .25s var(--ease-organic);
}
.wk-proj:hover .wk-proj-name { color: var(--rust); }

.wk-proj-desc {
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.8;
  color: rgba(17, 16, 9, .55);
  display: block;
  max-width: 580px;
}

.wk-proj-r {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 9px;
  flex-shrink: 0;
}

.wk-badge {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--rust);
  border: 1px solid rgba(184, 61, 28, .25);
  padding: 4px 10px;
}
.wk-badge.ongoing {
  color: var(--moss);
  border-color: rgba(95, 107, 79, .35);
}

.wk-meta {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--muted);
  letter-spacing: .05em;
  line-height: 1.6;
}
.wk-link {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--rust);
  border-bottom: 1px solid rgba(184, 61, 28, .3);
  padding-bottom: 1px;
  margin-top: 4px;
  transition: border-color .25s;
}
.wk-link:hover { border-color: var(--rust); }


/* ── PUBLICATIONS ────────────────────── */
#publications {
  padding: 120px 0;
}

.pb-heading {
  font-family: var(--sans);
  font-size: clamp(32px, 4vw, 56px);
  font-weight: 900;
  letter-spacing: -.03em;
  line-height: 1;
  margin-bottom: 8px;
}
.pb-heading em { color: var(--rust); font-style: normal; }

.pb-sub {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .06em;
  margin-bottom: 56px;
}

.pb-list {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.pb-item {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 0 40px;
  align-items: start;
  padding: 32px 52px;
  margin: 0 -52px;
  border-top: 1px solid var(--border);
  transition: background .5s var(--ease-organic), padding-left .55s var(--ease-organic);
}
.pb-item:last-child { border-bottom: 1px solid var(--border); }
.pb-item:hover { background: var(--bg2); padding-left: 64px; }

.pb-year {
  font-family: var(--sans);
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -.02em;
  color: var(--rust);
  line-height: 1;
}
.pb-year span {
  display: inline-block;
  transition: transform .55s var(--ease-organic);
}
.pb-item:hover .pb-year span { transform: translateX(4px); }

.pb-title {
  font-family: var(--sans);
  font-size: clamp(15px, 1.4vw, 19px);
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.35;
  margin-bottom: 8px;
  text-wrap: pretty;
}

.pb-authors {
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(17, 16, 9, .68);
  letter-spacing: .03em;
  line-height: 1.7;
  margin-bottom: 4px;
}
.pb-authors em { color: var(--rust); font-style: normal; }

.pb-venue {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.pb-actions {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.pb-link {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--rust);
  text-decoration: none;
  border-bottom: 1px solid rgba(184, 61, 28, .25);
  padding-bottom: 1px;
  transition: border-color .25s, color .25s;
}
.pb-link:hover { border-color: var(--rust); }

.pb-all {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 36px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--moss);
  text-decoration: none;
  border-bottom: 1px solid rgba(95, 107, 79, .4);
  padding-bottom: 3px;
  transition: color .25s, border-color .25s;
}
.pb-all:hover { color: var(--ink); border-color: var(--ink); }


/* ── ABOUT (now before contact) ──────── */
#about-section {
  /* placeholder — kept for selector parity */
}


/* ── CONTACT ─────────────────────────── */
#contact {
  padding: 120px 0 160px;
  text-align: center;
}

.ct-blob {
  width: 180px;
  height: 180px;
  margin: 0 auto 36px;
  background: radial-gradient(ellipse, rgba(184, 61, 28, .22), rgba(184, 61, 28, .04) 55%, transparent 70%);
  animation: bmorph 11s ease-in-out infinite, ct-pulse 7s ease-in-out infinite;
  filter: blur(6px);
}

@keyframes ct-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.1); }
}

.ct-title em {
  color: var(--rust);
  font-style: normal;
  display: inline-block;
  animation: ink-shift 9s ease-in-out infinite;
}

@keyframes ink-shift {
  0%, 100% { filter: brightness(1) saturate(1); }
  50%      { filter: brightness(1.08) saturate(1.1); }
}

.ct-title {
  font-family: var(--sans);
  font-size: clamp(44px, 7vw, 90px);
  font-weight: 900;
  line-height: .9;
  letter-spacing: -.03em;
  margin-bottom: 10px;
}

.ct-sub {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .08em;
  margin-bottom: 48px;
}

.ct-links {
  display: flex;
  gap: 28px;
  list-style: none;
  justify-content: center;
  flex-wrap: wrap;
}

.ct-links a {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: color .35s var(--ease-organic), transform .55s var(--ease-organic);
}

.ct-links a::before {
  content: '—';
  opacity: .3;
  transition: opacity .4s, transform .55s var(--ease-organic);
  display: inline-block;
}

.ct-links a:hover {
  color: var(--rust);
  transform: translateY(-3px);
}
.ct-links a:hover::before {
  opacity: 1;
  transform: translateX(-4px);
}

/* ── FOOTER ──────────────────────────── */
footer {
  padding: 40px 52px 22px;
  padding-bottom: max(22px, env(safe-area-inset-bottom));
  padding-left: max(52px, env(safe-area-inset-left));
  padding-right: max(52px, env(safe-area-inset-right));
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

footer p {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(138, 130, 120, .42);
}

/* ── RESPONSIVE ──────────────────────── */

/* TABLET ── iPad portrait, foldables unfolded, small laptops (≤1024) */
@media (max-width: 1024px) {
  nav, nav.scrolled {
    padding: 22px 36px;
    padding-top: max(22px, env(safe-area-inset-top));
  }
  .wrap { padding: 0 36px; }
  #hero {
    padding: 120px 36px 40px;
    padding-left: max(36px, env(safe-area-inset-left));
    padding-right: max(36px, env(safe-area-inset-right));
  }
  #about, #work, #publications, #contact { padding-left: 0; padding-right: 0; }
  .about-grid { grid-template-columns: 300px 1fr; gap: 56px; }
  .a-num { font-size: 120px; }
  .pb-item { padding: 28px 36px; margin: 0 -36px; }
  .pb-item:hover { padding-left: 48px; }
  footer {
    padding-left: max(36px, env(safe-area-inset-left));
    padding-right: max(36px, env(safe-area-inset-right));
  }
}

/* MOBILE & SMALL TABLET (≤900) — switch to single-column, show hamburger */
@media (max-width: 900px) {
  nav, nav.scrolled {
    padding: 18px 24px;
    padding-top: max(18px, env(safe-area-inset-top));
    padding-left: max(24px, env(safe-area-inset-left));
    padding-right: max(24px, env(safe-area-inset-right));
  }
  .wrap { padding: 0 24px; }
  .nav-links, .nav-cv { display: none; }
  .nav-ham { display: flex; }

  #hero {
    padding: 100px 24px 32px;
    padding-left: max(24px, env(safe-area-inset-left));
    padding-right: max(24px, env(safe-area-inset-right));
    gap: 28px;
  }
  .hero-meta { flex-direction: column; gap: 14px; }
  .hm-r { text-align: left; }
  .hero-name { font-size: clamp(56px, 18vw, 120px); }
  .hn-row.outline { padding-left: 20px; }

  .hero-foot { grid-template-columns: 1fr; gap: 24px; }
  .hf-tag { max-width: none; }
  .hf-tagline { font-size: 12px; line-height: 1.85; }
  .hf-scroll { display: none; }
  .hf-ctas .btn { padding: 14px 22px; font-size: 10px; min-height: 44px; }

  .flow-line { height: 50px; margin: 0; }
  .dot-field { opacity: .08; }

  /* sections */
  #about, #work, #publications, #contact { padding: 90px 0; }
  .s-label { margin-bottom: 40px; }

  /* ABOUT */
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .a-num { font-size: 88px; margin-bottom: -10px; }
  .a-title { font-size: clamp(26px, 6vw, 32px); }

  /* WORK */
  .wk-area-head { grid-template-columns: 36px 1fr; gap: 0 16px; }
  .wk-title { font-size: clamp(20px, 5vw, 24px) !important; }
  .wk-projects { margin-left: 0; border-left: none; padding-left: 0; }
  .wk-proj {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 22px 0;
  }
  .wk-proj:hover { padding-left: 8px; }
  .wk-proj-name { font-size: clamp(18px, 4.5vw, 22px) !important; }
  .wk-proj-desc { font-size: 12px; }
  .wk-proj-r {
    text-align: left;
    align-items: flex-start;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
  }
  .wk-meta { line-height: 1.5; }

  /* PUBLICATIONS */
  .pb-item {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 26px 24px;
    margin: 0 -24px;
  }
  .pb-item:hover { padding-left: 32px; }
  .pb-year { font-size: 22px; }
  .pb-title { font-size: 16px; }
  .pb-actions { gap: 14px; }
  .pb-link { padding: 6px 0; min-height: 32px; display: inline-flex; align-items: center; }

  /* CONTACT */
  #contact { padding: 90px 0 120px; }
  .ct-blob { width: 140px; height: 140px; }
  .ct-links { gap: 18px 22px; }
  .ct-links a { padding: 8px 0; min-height: 32px; }

  footer {
    flex-direction: column;
    gap: 6px;
    text-align: center;
    padding: 18px 24px;
    padding-bottom: max(18px, env(safe-area-inset-bottom));
  }
}

/* SMALL PHONES (iPhone 12/13/14/15 standard ≤ 430, Android compatti) */
@media (max-width: 540px) {
  nav, nav.scrolled {
    padding: 16px 18px;
    padding-top: max(16px, env(safe-area-inset-top));
  }
  .wrap { padding: 0 18px; }

  #hero {
    padding: 96px 18px 28px;
    padding-left: max(18px, env(safe-area-inset-left));
    padding-right: max(18px, env(safe-area-inset-right));
    gap: 24px;
  }

  /* fluid name block — never overflows narrow screens */
  .hero-name { font-size: clamp(48px, 20vw, 90px); line-height: .88; }
  .hn-row.outline { padding-left: 12px; -webkit-text-stroke-width: 1.5px; }

  .ct-title  { font-size: clamp(40px, 16vw, 72px); }
  .hero-foot { grid-template-columns: 1fr; }
  .hf-ctas { flex-direction: column; align-items: stretch; }
  .hf-ctas .btn { justify-content: center; }
  .hf-ctas .btn-bare { border-bottom: none; text-align: center; padding: 12px; }

  /* mobile menu — readable on narrow phones */
  #mobile-menu { gap: 24px; padding-top: max(80px, env(safe-area-inset-top)); }
  #mobile-menu a { font-size: 24px; min-height: 44px; display: flex; align-items: center; }

  /* sections tighter */
  #about, #work, #publications, #contact { padding: 70px 0; }

  /* work area numbers smaller */
  .wk-area { padding: 28px 0 22px; }
  .wk-area-head { grid-template-columns: 28px 1fr; margin-bottom: 14px; }
  .wk-n { font-size: 8.5px; }
  .wk-keys { font-size: 10px; }

  .wk-proj { padding: 18px 0; }
  .wk-proj-r { gap: 8px; }
  .wk-badge { font-size: 7.5px; padding: 4px 9px; }
  .wk-meta { font-size: 8.5px; }

  /* publications */
  .pb-item { padding: 22px 18px; margin: 0 -18px; }
  .pb-item:hover { padding-left: 26px; }
  .pb-title { font-size: 15px; line-height: 1.4; }
  .pb-year { font-size: 20px; }
  .pb-authors, .pb-venue { font-size: 10.5px; }

  /* about */
  .a-num { font-size: 72px; }
  .a-title { font-size: clamp(24px, 7.5vw, 30px); }
  .bio p { font-size: 12.5px; line-height: 1.9; }
  .tag { font-size: 8px; padding: 5px 10px; }

  /* contact */
  .ct-links { flex-direction: column; gap: 4px; }
  .ct-links a { padding: 10px 0; justify-content: center; min-height: 44px; }

  footer { padding: 16px 18px; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  footer p { font-size: 7.5px; }
}

/* ULTRA-NARROW (iPhone SE, Galaxy Fold chiuso ~280px, small Androids ≤360) */
@media (max-width: 380px) {
  .hero-name { font-size: clamp(40px, 19vw, 64px); letter-spacing: -.03em; }
  .hn-row.outline { padding-left: 8px; -webkit-text-stroke-width: 1.25px; }
  .hm-status, .hm-line { font-size: 8.5px; letter-spacing: .14em; }
  .nav-logo { font-size: 10px; }
  .a-num { font-size: 60px; }
  .ct-title { font-size: clamp(36px, 17vw, 60px); }
  #mobile-menu a { font-size: 22px; }
  .wk-keys { font-size: 9.5px; }
  .award { padding: 14px 16px; }
  .award-txt { font-size: 11px; }
}

/* SHORT LANDSCAPE — phones rotated, ensure hero fits */
@media (max-height: 520px) and (orientation: landscape) {
  #hero {
    min-height: auto;
    padding-top: 80px;
    padding-bottom: 32px;
    gap: 20px;
  }
  .hero-name { font-size: clamp(48px, 11vw, 96px); }
  .hf-scroll { display: none; }
  #mobile-menu { gap: 18px; padding-top: 60px; overflow-y: auto; }
  #mobile-menu a { font-size: 20px; }
}

/* TALL FOLDABLES UNFOLDED (Galaxy Z Fold, Pixel Fold ~ 600-840 wide tablet-like) */
@media (min-width: 600px) and (max-width: 900px) and (min-aspect-ratio: 3/4) {
  .about-grid { grid-template-columns: 1fr 1.4fr; gap: 40px; }
  .wk-proj { grid-template-columns: 1fr auto; }
  .wk-proj-r { flex-direction: column; align-items: flex-end; text-align: right; }
}

/* LARGE SCREENS — keep content centered, don't let it stretch ugly */
@media (min-width: 1600px) {
  .wrap { max-width: 1280px; }
  #hero { max-width: 1480px; margin: 0 auto; }
}

/* TOUCH DEVICES — kill heavy ambient effects on low-power mobile GPUs */
@media (hover: none) and (max-width: 900px) {
  .blob-b, .blob-c, .blob-d { display: none; }
  #bg-blob.blob-a {
    width: 320px;
    height: 320px;
    filter: blur(8px);
    opacity: .55;
  }
  .grain { opacity: .025; }
  .ct-blob { animation: ct-pulse 7s ease-in-out infinite; }
}
