/* Skylar Knight portfolio — design system.
   Palette: salted cream (page), pale sky (main accent surface), crushed berry (emphasis).
   Type: Instrument Serif for headlines, Public Sans for body, subheads, and buttons. */

:root {
  color-scheme: light;
  --cream: #fefcf5;
  --sky: #c4dae9;
  --steel: #8099ac;
  --palm: #859370;
  --custard: #fdf0b6;
  --slate: #c8bfca;
  --mocha: #432f2d;
  --berry: #8c1719;

  /* Colour roles: which palette colour each part of the page uses. Change a role here to restyle
     every element that uses it; append ?palette to any URL to try roles out in the browser. */
  --bg: var(--cream);
  --ink: var(--mocha);
  --accent: var(--berry);
  --band: var(--sky);          --band-ink: var(--mocha);
  --footer: var(--sky);        --footer-ink: var(--mocha);
  --surface: var(--sky);       --surface-ink: var(--mocha);
  --form: var(--sky);          --form-ink: var(--mocha);
  --course: var(--sky);        --course-ink: var(--mocha);
  --course-text: var(--berry);
  --course-hover: var(--palm); --course-hover-ink: var(--mocha);
  --button: var(--berry);      --button-ink: var(--cream);
  --filter-on: var(--berry);   --filter-on-ink: var(--cream);
  --hover: var(--sky);
  --ink-soft: #6b5a57;
  --line: rgba(67, 47, 45, 0.18);
  --line-strong: rgba(67, 47, 45, 0.4);

  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Public Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1320px;
  --radius: 28px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-sheet: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-in: cubic-bezier(0.55, 0, 0.75, 0.2);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scrollbar-gutter: stable; }
html.is-locked { overflow: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
::selection { background: var(--accent); color: var(--cream); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: 12px; left: 12px; z-index: 100; padding: 10px 16px;
  background: var(--button); color: var(--button-ink); border-radius: 999px;
  font: 600 0.8125rem/1 var(--sans); text-decoration: none;
  transform: translateY(-160%); transition: transform 0.2s var(--ease-out);
}
.skip-link:focus { transform: none; }

/* Type helpers */
.overline {
  font: 600 0.75rem/1.3 var(--sans);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.paren { font: 500 0.8125rem/1 var(--sans); letter-spacing: 0.02em; color: var(--ink-soft); }
.serif { font-family: var(--serif); font-weight: 400; }
em, .em { font-style: italic; }

.link {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: var(--line-strong);
  transition: text-decoration-color 0.2s, color 0.2s;
}
.link:hover { color: var(--accent); text-decoration-color: currentColor; }
.ext::after {
  content: "";
  display: inline-block;
  width: 0.62em; height: 0.62em;
  margin-left: 0.3em;
  vertical-align: 0.08em;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 8L8 2M3.2 2H8v4.8' fill='none' stroke='black' stroke-width='1.4'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 8L8 2M3.2 2H8v4.8' fill='none' stroke='black' stroke-width='1.4'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: 0.7;
  transition: transform 0.25s var(--ease-out);
}
.ext:hover::after { transform: translate(2px, -2px); }

/* Buttons: pill, uppercase, Public Sans with an underline variant from the type sample */
.button {
  display: inline-flex; align-items: center; gap: 0.6em;
  padding: 0.95em 1.6em;
  border-radius: 999px;
  border: 1px solid var(--button);
  background: var(--button); color: var(--button-ink);
  font: 600 0.8125rem/1 var(--sans);
  letter-spacing: 0.14em; text-transform: uppercase;
  text-decoration: none; cursor: pointer;
  transition: background 0.25s, color 0.25s, border-color 0.25s, transform 0.25s var(--ease-out);
}
.button:hover { background: color-mix(in srgb, var(--button) 80%, black); border-color: color-mix(in srgb, var(--button) 80%, black); }
.button:active { transform: scale(0.97); }
.button[disabled] { opacity: 0.45; cursor: not-allowed; }
.button-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.button-ghost:hover { background: var(--hover); color: var(--ink); border-color: var(--hover); }
.button .arrow { transition: transform 0.25s var(--ease-out); }
.button:hover .arrow { transform: translateX(3px); }
.text-button {
  display: inline-flex; align-items: center; gap: 0.5em;
  padding: 0 0 6px;
  border: 0; border-bottom: 1.5px solid currentColor; background: none;
  font: 600 0.8125rem/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase;
  text-decoration: none; cursor: pointer;
}
.text-button .arrow { transition: transform 0.25s var(--ease-out); }
.text-button:hover .arrow { transform: translateX(4px); }

/* Decorative line work carried over from the original site */
.decor { position: absolute; pointer-events: none; color: var(--accent); }
.decor svg { width: 100%; height: auto; overflow: visible; }
.decor path, .decor circle, .decor line { vector-effect: non-scaling-stroke; }
.sunburst path { stroke: currentColor; stroke-width: 1; fill: none; }
.ring { fill: none; stroke: currentColor; stroke-width: 1; }
.js .draw path, .js .draw circle, .js .draw line {
  stroke-dasharray: 1; stroke-dashoffset: 1;
  transition: stroke-dashoffset 1.6s var(--ease-out);
  transition-delay: var(--d, 0s);
}
.js .draw.is-in path, .js .draw.is-in circle, .js .draw.is-in line { stroke-dashoffset: 0; }
.spin { animation: spin 90s linear infinite; transform-origin: 50% 100%; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Scroll-in reveals. Content is visible without JavaScript. */
.js [data-reveal] {
  opacity: 0;
  transform: translate3d(var(--rx, 0), var(--ry, 28px), 0);
  transition: opacity 0.9s var(--ease-out), transform 1s var(--ease-out);
  transition-delay: var(--delay, 0s);
}
.js [data-reveal="left"] { --rx: -48px; --ry: 0; }
.js [data-reveal="right"] { --rx: 48px; --ry: 0; }
.js [data-reveal].is-in { opacity: 1; transform: none; }
.js [data-words] .w { opacity: 0.14; transition: opacity 0.6s var(--ease-out); transition-delay: calc(var(--i) * 45ms); }
.js [data-words].is-in .w { opacity: 1; }

/* Navigation: links left, profiles right, hairline below (as on the original) */
.nav {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow 0.3s;
}
.nav.is-stuck { box-shadow: 0 8px 24px -18px rgba(67, 47, 45, 0.45); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 68px; }
.nav-links { display: flex; align-items: center; gap: clamp(18px, 4vw, 56px); }
.nav-links a {
  position: relative;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 8px 0;
  font: 600 0.8125rem/1 var(--sans); letter-spacing: 0.12em; text-transform: uppercase;
  text-decoration: none;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1.5px;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform 0.35s var(--ease-out);
}
.nav-links a:hover::after, .nav-links a[aria-current="page"]::after { transform: scaleX(1); }
.nav-links .nav-arrow {
  width: 14px; height: 14px; color: var(--accent);
  opacity: 0; transform: translateY(-4px);
  transition: opacity 0.25s, transform 0.3s var(--ease-out);
}
.nav-links a:hover .nav-arrow { opacity: 1; transform: none; }
.nav-social { display: flex; align-items: center; gap: 6px; }
.icon-link {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 999px;
  text-decoration: none; transition: background 0.2s, color 0.2s;
}
.icon-link svg { width: 20px; height: 20px; }
.icon-link:hover { background: var(--hover); color: var(--accent); }

/* Home hero */
.hero { position: relative; overflow: hidden; padding: clamp(40px, 7vw, 96px) 0 clamp(40px, 6vw, 72px); }
.hero-stage {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: clamp(12px, 2vw, 28px);
}
.hero-word {
  font: 400 clamp(3.75rem, 11vw, 10.5rem)/0.86 var(--serif);
  letter-spacing: -0.025em;
  white-space: nowrap;
}
.hero-word:first-child { justify-self: end; }
.hero-word.is-italic { font-style: italic; justify-self: start; }
.hero-photo {
  position: relative;
  width: clamp(160px, 21vw, 300px);
  aspect-ratio: 3 / 4;
  border-radius: 999px 999px 24px 24px;
  overflow: hidden;
  background: var(--surface);
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 48% 40%; }
.js .hero-photo { clip-path: inset(100% 0 0 0 round 999px 999px 24px 24px); transition: clip-path 1.3s var(--ease-out) 0.15s; }
.js .hero-photo img { transform: scale(1.12); transition: transform 1.8s var(--ease-out) 0.15s; }
.js .hero.is-in .hero-photo { clip-path: inset(0 0 0 0 round 999px 999px 24px 24px); }
.js .hero.is-in .hero-photo img { transform: none; }
.hero-meta {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1fr auto 1fr; gap: clamp(12px, 2vw, 28px);
  margin-top: clamp(20px, 3vw, 32px);
}
.hero-role { grid-column: 3; display: flex; gap: 12px; align-items: flex-start; }
.hero-role strong { display: block; font-weight: 600; font-size: 1rem; line-height: 1.35; }
.hero-role .overline { color: var(--ink-soft); font-size: 0.6875rem; }
.dot-ring { flex: none; width: 16px; height: 16px; margin-top: 3px; border: 1px solid var(--accent); border-radius: 50%; display: grid; place-items: center; }
.dot-ring::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.hero-links {
  position: relative; z-index: 1;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 12px clamp(20px, 5vw, 64px);
  margin-top: clamp(40px, 6vw, 64px);
  font-weight: 600; font-size: 0.9375rem;
}
.hero-tagline { position: relative; z-index: 1; margin: 28px auto 0; max-width: 38ch; text-align: center; color: var(--ink-soft); }
.hero-down {
  position: relative; z-index: 1;
  display: grid; place-items: center; width: 44px; height: 44px; margin: 24px auto 0;
  border-radius: 999px; text-decoration: none; transition: background 0.2s;
}
.hero-down:hover { background: var(--hover); }
.hero-down svg { width: 18px; height: 18px; animation: nudge 2.4s var(--ease-out) infinite; }
@keyframes nudge { 0%, 100% { transform: translateY(-3px); } 50% { transform: translateY(4px); } }
.hero .decor-line { inset: 0; color: var(--ink); opacity: 0.35; }
.hero .decor-line svg { width: 100%; height: 100%; }
.hero .decor-ring { width: clamp(90px, 10vw, 140px); top: clamp(24px, 5vw, 70px); left: 58%; }
.hero .decor-burst { width: clamp(200px, 26vw, 380px); bottom: -12%; left: -4%; }
.hero .decor-burst .ring { color: var(--ink); opacity: 0.35; }

.js .hero [data-hero="left"] { opacity: 0; transform: translateX(-8vw); }
.js .hero [data-hero="right"] { opacity: 0; transform: translateX(8vw); }
.js .hero [data-hero="up"] { opacity: 0; transform: translateY(24px); }
.js .hero [data-hero] { transition: opacity 1.1s var(--ease-out), transform 1.3s var(--ease-out); transition-delay: var(--delay, 0.1s); }
.js .hero.is-in [data-hero] { opacity: 1; transform: none; }

/* About-in-brief band on pale sky */
.intro {
  position: relative; overflow: hidden;
  background: var(--band); color: var(--band-ink);
  padding: clamp(80px, 12vw, 168px) 0;
}
.intro-top {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding-bottom: 18px; margin-bottom: clamp(32px, 5vw, 56px);
  border-bottom: 1px solid var(--accent);
}
.intro-top .overline:first-child { color: var(--accent); display: inline-flex; align-items: center; gap: 12px; }
.intro-top .overline:first-child::before { content: ""; width: 28px; height: 1.5px; background: currentColor; }
.intro-statement {
  max-width: 21ch;
  font: 400 clamp(2.25rem, 5.4vw, 4.75rem)/1.04 var(--serif);
  letter-spacing: -0.012em;
  text-wrap: balance;
}
.intro-statement em { color: var(--accent); }
.intro-statement .tag {
  display: inline-block; transform: translateY(-1.1em);
  margin-inline: 0.15em 0.1em;
  font: 600 clamp(0.6875rem, 1vw, 0.8125rem)/1 var(--sans); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent);
}
.intro-statement .w { display: inline; }
/* The link sits level with the paragraph's first line so it stays clear of the corner burst. */
.intro-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: start; gap: 24px; margin-top: clamp(40px, 6vw, 72px); }
.intro-foot p { max-width: 44ch; }
.intro-points { display: grid; gap: 10px; max-width: 48ch; }
.intro-points li { position: relative; padding-left: 26px; }
.intro-points li::before { content: ""; position: absolute; left: 0; top: 0.78em; width: 14px; height: 1.5px; background: var(--accent); }
.intro .text-button { color: var(--accent); }
.intro .decor-burst { width: clamp(220px, 30vw, 440px); right: -6%; bottom: -1px; }
.intro .decor-dot { right: clamp(24px, 8vw, 120px); top: clamp(40px, 6vw, 80px); width: 18px; }

/* Section head shared by projects, About, Work */
.section { padding: clamp(72px, 10vw, 140px) 0; }
.section-head {
  display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between;
  gap: 24px 40px; margin-bottom: clamp(28px, 4vw, 48px);
}
.section-kicker { display: block; margin-bottom: 10px; }
.section-title { font: 400 clamp(2.75rem, 6.4vw, 5.5rem)/0.95 var(--serif); letter-spacing: -0.015em; }
.section-title em { color: var(--accent); }

/* Filter pills */
.filters { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.filter {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; min-height: 40px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  background: transparent;
  font: 600 0.75rem/1 var(--sans); letter-spacing: 0.12em; text-transform: uppercase;
  cursor: pointer;
  transition: background 0.25s, color 0.25s, border-color 0.25s, transform 0.2s var(--ease-out);
}
.filter:hover { background: var(--hover); border-color: var(--hover); }
.filter:active { transform: scale(0.96); }
.filter[aria-pressed="true"] { background: var(--filter-on); border-color: var(--filter-on); color: var(--filter-on-ink); }
.filter-count { font-weight: 500; letter-spacing: 0; opacity: 0.6; font-variant-numeric: tabular-nums; }

/* Footer */
.footer { position: relative; overflow: hidden; background: var(--footer); color: var(--footer-ink); padding: clamp(72px, 10vw, 128px) 0 28px; }
.footer a:not(.button) { color: inherit; }
.footer-cta { position: relative; z-index: 1; display: grid; gap: 28px; justify-items: start; max-width: 22ch; }
.footer-line { font: 400 clamp(2.25rem, 5.6vw, 4.5rem)/1.02 var(--serif); letter-spacing: -0.012em; }
.footer-line em { color: var(--accent); }
.footer-grid {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 40px;
  margin-top: clamp(56px, 8vw, 96px); padding-top: 32px; border-top: 1px solid var(--accent);
}
.footer-grid .overline { color: var(--accent); margin-bottom: 14px; display: block; }
.footer-nav { display: grid; grid-template-columns: repeat(2, max-content); gap: 10px 40px; }
.footer-nav a { font-weight: 600; text-decoration: none; text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.8125rem; }
.footer-nav a:hover { color: var(--accent); }
.footer-follow { max-width: 32ch; font-size: 1rem; line-height: 1.55; }
.footer-follow a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
.footer-follow a:hover { color: var(--accent); }
.footer .nav-social { margin-top: 16px; margin-left: -8px; }
.footer .icon-link:hover { background: var(--bg); color: var(--accent); }
.footer-bar { position: relative; z-index: 1; display: flex; justify-content: space-between; gap: 16px; margin-top: 56px; font-size: 0.8125rem; opacity: 0.85; }
.footer .decor-burst { width: clamp(220px, 28vw, 380px); right: 4%; top: clamp(56px, 8vw, 104px); color: var(--accent); opacity: 0.6; }

/* Project cards: square, rounded, flip on hover to a one-sentence description */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: clamp(16px, 2vw, 24px);
}
.cards > li { position: relative; }
.cards > li[hidden] { display: none; }
.js .cards > li { opacity: 0; transform: translateY(32px) scale(0.98); transition: opacity 0.8s var(--ease-out), transform 0.9s var(--ease-out); transition-delay: var(--delay, 0s); }
.js .cards > li.is-in { opacity: 1; transform: none; }
.pcard {
  --front: var(--sky); --back: var(--accent); --front-ink: var(--mocha); --back-ink: var(--cream);
  display: block; aspect-ratio: 1; perspective: 1400px; container-type: inline-size;
  color: var(--front-ink); text-decoration: none;
  border-radius: var(--radius);
  -webkit-tap-highlight-color: transparent;
}
.pcard:focus-visible { outline-offset: 5px; border-radius: var(--radius); }
.pcard-inner {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d;
  /* Turning back to the front is slower than the hover flip (set in the hover rule below). */
  transition: transform 1.6s var(--ease-out), scale 0.25s var(--ease-out);
}
.pcard.is-pressed .pcard-inner { scale: 0.96; }
.pcard-face {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  padding: clamp(18px, 2vw, 24px);
  border-radius: var(--radius);
  overflow: hidden;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
}
/* The front needs its own 3D transform too. Without one, Safari still paints the front's layered
   children (badge, art, title) through the back face once the card has turned. */
.pcard-front { background: var(--front); transform: rotateY(0deg); }
.pcard-back { background: var(--back); color: var(--back-ink); transform: rotateY(180deg); justify-content: space-between; }
@media (hover: hover) and (pointer: fine) {
  .pcard:hover .pcard-inner, .pcard:focus-visible .pcard-inner { transform: rotateY(180deg); transition: transform 0.85s var(--ease-out), scale 0.25s var(--ease-out); }
}
.pcard-top { position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; min-height: 30px; }
.pcard-kicker { font: 600 0.6875rem/1.3 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.78; padding-top: 7px; }
.pcard-award {
  display: inline-flex; align-items: center; gap: 6px; flex: none; max-width: 70%;
  padding: 7px 12px 7px 9px; border-radius: 999px;
  background: var(--cream); color: var(--mocha);
  font: 600 0.6875rem/1.1 var(--sans); letter-spacing: 0.04em;
  box-shadow: 0 6px 16px -10px rgba(67, 47, 45, 0.6);
}
.pcard-award svg { width: 15px; height: 15px; flex: none; color: var(--accent); }
.pcard-award.is-progress { background: transparent; color: inherit; border: 1px dashed currentColor; box-shadow: none; }
.pcard-art {
  position: relative; z-index: 1; flex: 1; min-height: 0;
  display: grid; place-items: center;
  margin: 8px calc(var(--bleed, 0) * -1) 4px;
}
.pcard-art img {
  max-width: var(--art-w, 88%); max-height: 100%; width: auto; height: auto; object-fit: contain;
  filter: drop-shadow(0 18px 18px rgba(67, 47, 45, 0.22));
  transform: translate(var(--art-x, 0), var(--art-y, 0)) rotate(var(--art-r, 0deg));
  transition: transform 0.6s var(--ease-out);
}
.pcard-art.is-screen img { border-radius: 12px; box-shadow: 0 22px 36px -18px rgba(67, 47, 45, 0.6), 0 0 0 1px rgba(67, 47, 45, 0.08); filter: none; }
.pcard-art.is-pixel img { image-rendering: pixelated; filter: drop-shadow(0 10px 10px rgba(0, 0, 0, 0.35)); }
.pcard-art.is-anchored { position: absolute; inset: 0; z-index: 1; margin: 0; display: flex; align-items: flex-end; justify-content: flex-end; }
.pcard-art.is-anchored img { max-width: none; max-height: 88%; width: var(--art-w, 100%); transform: translateX(var(--art-x, 0)); }
.pcard-art.is-anchored ~ .pcard-title-bar { margin-top: auto; flex-direction: column; align-items: flex-start; gap: 6px; max-width: 52%; }
.pcard-art .motif { width: 62%; color: var(--front-ink); opacity: 0.55; }
.pcard-title { position: relative; z-index: 2; font: 400 clamp(1.75rem, 2.6vw, 2.25rem)/1 var(--serif); letter-spacing: -0.01em; }
.pcard-title-bar { position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.pcard-year { flex: none; white-space: nowrap; font: 500 0.8125rem/1 var(--sans); opacity: 0.75; font-variant-numeric: tabular-nums; }
.pcard-back .pcard-title { font-size: clamp(1.375rem, 2vw, 1.625rem); }
/* Sans and sized to the card (cqi) so the sentence reads apart from the serif title and always fits. */
.pcard-desc {
  flex: 1; min-height: 0; display: flex; align-items: center; align-items: safe center;
  margin: 10px 0; overflow: hidden;
  font: 400 clamp(0.875rem, 6.2cqi, 1.1875rem)/1.42 var(--sans);
  letter-spacing: 0.005em; text-wrap: pretty;
}
@container (max-width: 270px) { .pcard-desc { font-size: 0.8125rem; line-height: 1.38; } }
.pcard-cta { display: inline-flex; align-items: center; gap: 8px; font: 600 0.75rem/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; }
.pcard-cta svg { width: 16px; height: 16px; transition: transform 0.3s var(--ease-out); }
.pcard:hover .pcard-cta svg { transform: translateX(4px); }
.pcard-back .burst-corner { position: absolute; right: -40px; bottom: -40px; width: 200px; opacity: 0.18; color: var(--back-ink); }
.cards-empty { padding: 48px 0; color: var(--ink-soft); }
.noscript-list { display: grid; gap: 8px; }

/* Project sheet: rises from the bottom of the screen */
.sheet {
  position: fixed; inset: 0; width: 100%; max-width: none; height: 100%; max-height: none;
  margin: 0; padding: 0; border: 0; background: transparent; overflow: hidden;
  color: var(--ink);
}
.sheet::backdrop { background: rgba(38, 52, 64, 0); -webkit-backdrop-filter: blur(0); backdrop-filter: blur(0); transition: background 0.5s, backdrop-filter 0.5s; }
.sheet.is-open::backdrop { background: rgba(38, 52, 64, 0.45); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.sheet-scrim { position: absolute; inset: 0; }
.sheet-panel {
  position: absolute; left: 50%; bottom: 0;
  width: min(1120px, 100%); height: min(94dvh, 100%);
  translate: -50% 0;
  display: flex; flex-direction: column;
  background: var(--bg);
  border-radius: 32px 32px 0 0;
  box-shadow: 0 -24px 60px -20px rgba(38, 52, 64, 0.45);
  overflow: hidden;
  will-change: transform;
}
.sheet-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.sheet-grab { position: absolute; top: 0; left: 0; right: 0; z-index: 3; height: 28px; display: grid; place-items: center; cursor: grab; touch-action: none; }
.sheet-grab { color: var(--front-ink); }
.sheet-grab::after { content: ""; width: 44px; height: 5px; border-radius: 999px; background: currentColor; opacity: 0.4; }
.sheet-controls { position: absolute; top: 16px; right: 16px; z-index: 4; display: flex; gap: 8px; }
.sheet-btn {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 999px;
  border: 0; background: var(--bg); color: var(--ink); cursor: pointer;
  box-shadow: 0 6px 18px -10px rgba(67, 47, 45, 0.7);
  transition: background 0.2s, color 0.2s, transform 0.2s var(--ease-out);
}
.sheet-btn:hover { background: var(--button); color: var(--button-ink); }
.sheet-btn:active { transform: scale(0.94); }
.sheet-btn svg { width: 18px; height: 18px; }
.sheet-head {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); align-items: end; gap: 24px;
  min-height: clamp(280px, 38vh, 420px);
  padding: clamp(56px, 7vw, 80px) clamp(20px, 4vw, 56px) clamp(28px, 4vw, 44px);
  background: var(--front); color: var(--front-ink);
}
.sheet-head .pcard-kicker { display: block; padding: 0; margin-bottom: 12px; }
.sheet-title { font: 400 clamp(2.75rem, 7vw, 5.75rem)/0.92 var(--serif); letter-spacing: -0.02em; }
.sheet-sub { margin-top: 14px; font-weight: 500; opacity: 0.8; }
.sheet-awards { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.sheet-awards .pcard-award { flex: 0 1 auto; max-width: 100%; font-size: 0.75rem; line-height: 1.3; }
.sheet-art { align-self: stretch; display: grid; place-items: center; min-height: 0; }
.sheet-art img { max-height: clamp(180px, 30vh, 320px); max-width: 100%; width: auto; object-fit: contain; filter: drop-shadow(0 22px 22px rgba(67, 47, 45, 0.25)); }
.sheet-art.is-screen img { border-radius: 14px; filter: none; box-shadow: 0 26px 44px -20px rgba(67, 47, 45, 0.6); }
.sheet-art.is-pixel img { image-rendering: pixelated; }
.sheet-art .motif { width: min(240px, 70%); opacity: 0.5; }
.sheet-body { padding: clamp(32px, 5vw, 56px) 0 clamp(48px, 6vw, 80px); }
.sheet-body .wrap { max-width: none; padding-inline: clamp(20px, 4vw, 56px); }
.sheet-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; padding: 0 clamp(20px, 4vw, 56px) clamp(40px, 5vw, 64px); }
.sheet-loading { display: grid; gap: 14px; padding-inline: clamp(20px, 4vw, 56px); }
.sheet-loading span { height: 14px; border-radius: 999px; background: linear-gradient(90deg, rgba(67, 47, 45, 0.08), rgba(67, 47, 45, 0.16), rgba(67, 47, 45, 0.08)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.sheet-loading span:nth-child(1) { width: 70%; height: 22px; }
.sheet-loading span:nth-child(3) { width: 86%; }
.sheet-loading span:nth-child(4) { width: 54%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Project write-ups: used on case-study pages and inside the sheet */
.case-head { padding-top: clamp(32px, 5vw, 64px); }
.case-back { display: inline-flex; align-items: center; gap: 8px; margin-bottom: clamp(28px, 4vw, 48px); font: 600 0.75rem/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; text-decoration: none; }
.case-back svg { width: 16px; height: 16px; transition: transform 0.25s var(--ease-out); }
.case-back:hover svg { transform: translateX(-3px); }
.case-kicker { font: 600 0.75rem/1.3 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.case-title { font: 400 clamp(3.25rem, 9vw, 8rem)/0.9 var(--serif); letter-spacing: -0.02em; padding-bottom: clamp(20px, 3vw, 32px); border-bottom: 1px solid var(--line-strong); }
.card-awards { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.card-awards li { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 10px; border-radius: 999px; background: var(--surface); color: var(--surface-ink); font: 600 0.75rem/1.2 var(--sans); }
.card-awards svg { width: 15px; height: 15px; color: var(--accent); }
.case-hero { margin-top: clamp(28px, 4vw, 48px); border-radius: var(--radius); overflow: hidden; background: var(--surface); display: grid; place-items: center; }
.case-hero img { width: 100%; max-height: 72vh; object-fit: contain; }
.case-hero.media-dark { background: #061e29; }
.case-hero.media-pixel img { image-rendering: pixelated; }
.case-summary {
  display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 88px);
  padding-top: clamp(40px, 6vw, 72px);
}
.case-label { display: flex; align-items: center; gap: 12px; margin: 40px 0 14px; font: 600 0.75rem/1.3 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; }
.case-label::after { content: ""; width: 28px; height: 1.5px; background: var(--accent); }
.case-main > .case-label:first-child { margin-top: 0; }
.case-lead { font: 400 clamp(1.5rem, 2.6vw, 2.125rem)/1.2 var(--serif); text-wrap: pretty; }
.case-main p + p, .case-prose p + p { margin-top: 1em; }
.case-aside { align-self: start; position: sticky; top: 96px; padding: 24px; border-radius: 24px; background: var(--surface); color: var(--surface-ink); }
.sheet .case-aside { position: static; }
.facts { display: grid; gap: 20px; }
.facts dt { font: 600 0.6875rem/1.3 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.facts dd { font-size: 0.9375rem; line-height: 1.5; }
.card-links { display: grid; gap: 8px; }
.card-links a { font-weight: 500; }
.card-list { display: grid; gap: 8px; padding-left: 1.1em; list-style: disc; }
.card-list li::marker { color: var(--accent); }
.case-media, .case-prose, .case-doc, .case-gallery { margin-top: clamp(40px, 6vw, 72px); }
.case-prose { max-width: 72ch; }
.case-prose h2, .case-prose h3 { margin: 2em 0 0.6em; font: 400 clamp(1.625rem, 3vw, 2.25rem)/1.1 var(--serif); }
.case-prose h4 { margin: 1.6em 0 0.4em; font: 600 1rem/1.4 var(--sans); }
.case-prose ul, .case-prose ol { margin: 1em 0; padding-left: 1.2em; list-style: disc; display: grid; gap: 6px; }
.case-prose ol { list-style: decimal; }
.case-prose li::marker { color: var(--accent); }
.case-prose figure, .case-doc { margin: 2em 0; }
.case-prose img, .case-doc img { border-radius: 16px; background: #fff; }
.case-doc { max-width: 900px; }
.case-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.case-gallery a { display: block; border-radius: 16px; overflow: hidden; background: #fff; transition: transform 0.4s var(--ease-out); }
.case-gallery a:hover { transform: translateY(-4px); }
.case-gallery img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
code { font: 0.9em/1 ui-monospace, "SF Mono", Menlo, monospace; background: rgba(67, 47, 45, 0.07); padding: 0.15em 0.4em; border-radius: 6px; }
.video { position: relative; margin-top: 28px; aspect-ratio: 16 / 9; border-radius: 20px; overflow: hidden; background: var(--steel); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-play {
  position: absolute; inset: 0; width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  border: 0; background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--surface) 70%, white), var(--surface)); color: var(--surface-ink);
  font: 600 0.8125rem/1.3 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; cursor: pointer;
}
.video-play::before {
  content: ""; width: 64px; height: 64px; border-radius: 999px; flex: none;
  background: var(--button) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 7l9 5-9 5z' fill='%23fefcf5'/%3E%3C/svg%3E") center / 26px no-repeat;
  transition: transform 0.3s var(--ease-out);
}
.video-play:hover::before { transform: scale(1.08); }
.page-end { height: clamp(56px, 8vw, 112px); }

/* Interior page heads */
.page-head { position: relative; padding-top: clamp(40px, 6vw, 88px); }
.page-title { font: 400 clamp(4rem, 13vw, 11rem)/0.86 var(--serif); letter-spacing: -0.025em; }
.page-title em { color: var(--accent); }
.page-head .rule { height: 1px; background: var(--line-strong); margin-top: clamp(20px, 3vw, 32px); }

/* Work page */
.work-intro { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 24px 48px; margin-top: 24px; }
.work-intro p { max-width: 40ch; font-size: 1.125rem; }
.more-work { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; margin-top: clamp(56px, 7vw, 88px); padding-top: 28px; border-top: 1px solid var(--line-strong); }
.more-work .serif { font-size: 1.75rem; }

/* About page — original structure */
.about-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.about-photo { grid-row: span 2; position: relative; border-radius: 999px 999px 24px 24px; overflow: hidden; aspect-ratio: 3 / 4; background: var(--surface); }
.about-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 48% 40%; }
.about-facts { display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px 40px; padding-top: 28px; }
.about-studying .overline { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.about-studying .overline::after { content: ""; width: 24px; height: 1.5px; background: var(--accent); }
.about-studying p { font: 400 clamp(1.625rem, 2.6vw, 2.125rem)/1.1 var(--serif); }
.about-studying p + p { margin-top: 10px; font: 500 1rem/1.45 var(--sans); color: var(--ink-soft); }
.about-facts dl { display: grid; gap: 18px; }
.about-facts dt { font: 600 0.6875rem/1.3 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); }
.about-facts dd { margin-top: 4px; font-weight: 500; }
.about-facts .about-connect { display: grid; grid-template-columns: repeat(2, max-content); gap: 2px 24px; }
.about-bio { padding-top: 28px; border-top: 1px solid var(--line); }
.about-bio .overline { display: block; margin-bottom: 12px; }
.about-bio p:not(.overline) { font-size: 1.125rem; line-height: 1.65; max-width: 62ch; }
.about-bio .decor { position: relative; width: 160px; margin-top: 32px; }

.block { padding-top: clamp(64px, 9vw, 120px); }
.block-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: clamp(32px, 6vw, 88px); }
.block-split .sticky { position: sticky; top: 104px; align-self: start; }
.block-split .sticky p { margin-top: 14px; color: var(--ink-soft); }
.block-split .sticky .link { display: inline-block; margin-top: 14px; font-weight: 600; }
.jobs { display: grid; gap: 4px; }
.job { display: grid; grid-template-columns: 64px 1fr; gap: 20px; align-items: start; padding: 18px 14px; margin-inline: -14px; border-radius: 20px; transition: background 0.3s; }
.job:hover { background: color-mix(in srgb, var(--hover) 55%, transparent); }
.job-logo { width: 64px; height: 64px; border-radius: 16px; background: #fff; display: grid; place-items: center; overflow: hidden; box-shadow: 0 0 0 1px var(--line); }
.job-logo img { width: 78%; height: 78%; object-fit: contain; }
.job-org { font: 600 1.0625rem/1.35 var(--sans); }
.job-role { font-style: italic; color: var(--ink-soft); }
.job-role span + span::before { content: " | "; font-style: normal; }
.job-note { margin-top: 4px; }
.jobs-group {
  display: flex; align-items: center; gap: 12px; margin: 0 0 8px;
  font: 600 0.6875rem/1.3 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent);
}
.jobs-group::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }
.jobs + .jobs-group { margin-top: clamp(28px, 4vw, 44px); }
/* Small pills that show which threads a role belongs to. */
.job-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.job-tags li {
  padding: 4px 10px; border-radius: 999px;
  background: var(--tag, var(--sky)); color: var(--mocha);
  font: 600 0.6875rem/1.2 var(--sans); letter-spacing: 0.06em;
}
.job-tags .tag-xr { --tag: var(--sky); }
.job-tags .tag-software { --tag: var(--slate); }
.job-tags .tag-research { --tag: var(--custard); }
.job-tags .tag-lead { --tag: color-mix(in srgb, var(--palm) 55%, var(--cream)); }
.job-tags .tag-teach { --tag: color-mix(in srgb, var(--steel) 55%, var(--cream)); }
.job:hover .job-tags li { box-shadow: 0 0 0 1px var(--line); }

.courses-title { text-align: right; }
.courses { display: grid; gap: 12px; margin-top: 28px; }
.course {
  display: grid; grid-template-columns: minmax(140px, 0.32fr) 1fr; gap: 16px 32px; align-items: center;
  padding: clamp(22px, 3vw, 30px) clamp(24px, 4vw, 40px);
  border-radius: 999px; background: var(--course); color: var(--course-ink);
  transition: background 0.35s, color 0.35s, transform 0.35s var(--ease-out);
}
.course:hover { background: var(--course-hover); color: var(--course-hover-ink); transform: translateX(6px); }
.course h3 { font: 600 0.9375rem/1.3 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; }
.course p { font: 500 0.8125rem/1.55 var(--sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--course-text); transition: color 0.35s; }
.course:hover p { color: var(--course-hover-ink); }

.others { display: grid; grid-template-columns: 1fr; gap: 16px; margin-top: 28px; }
@media (min-width: 720px) { .others { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .others { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.other {
  --tone: var(--sky); --tone-ink: var(--ink); --tone-sub: var(--accent);
  padding: clamp(22px, 3vw, 32px); border-radius: var(--radius);
  background: var(--tone); color: var(--tone-ink); border: 1px solid var(--line);
}
/* Sky and custard in a checkerboard. Plain alternation does it for one or three columns;
   two columns need the four-step pattern. Honors is outlined in the accent instead. */
.other:nth-child(even) { --tone: var(--custard); }
@media (min-width: 720px) and (max-width: 1099.98px) {
  .other:nth-child(4n + 3) { --tone: var(--custard); }
  .other:nth-child(4n) { --tone: var(--sky); }
}
.other.tone-outline { --tone: var(--bg); border: 1.5px solid var(--accent); }
.other h3 { font: 400 clamp(1.75rem, 2.6vw, 2.25rem)/1 var(--serif); }
.other .sub { margin: 8px 0 14px; font: 600 0.6875rem/1.4 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--tone-sub); }
.other p:not(.sub) { font-size: 0.9375rem; }
.honors { display: grid; gap: 14px; }
.honors li { display: grid; align-content: start; gap: 2px; font-size: 0.9375rem; }
.honors strong { font-weight: 600; }
.honors-card { margin-top: 28px; }
.honors-card .honors { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 20px 32px; }
.honors-card .honors li:last-child { grid-column: 1 / -1; padding-top: 16px; border-top: 1px solid rgba(67, 47, 45, 0.2); }

/* Contact page */
.contact { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 88px); margin-top: clamp(32px, 5vw, 56px); }
.contact-copy .lead { font: 400 clamp(1.75rem, 3.2vw, 2.75rem)/1.1 var(--serif); }
.contact-copy .lead em { color: var(--accent); }
.contact-links { display: grid; gap: 10px; margin-top: 28px; font-weight: 600; }
.contact-copy .decor { position: relative; width: min(240px, 60%); margin-top: 48px; }
.contact-form {
  display: grid; gap: 18px;
  padding: clamp(24px, 4vw, 44px);
  border-radius: var(--radius);
  background: var(--form); color: var(--form-ink);
}
.contact-form label { display: grid; gap: 8px; font: 600 0.75rem/1.3 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; }
.contact-form input, .contact-form textarea {
  width: 100%; padding: 14px 16px;
  border: 1px solid rgba(67, 47, 45, 0.25); border-radius: 14px;
  background: var(--cream); color: var(--mocha);
  font: 400 1rem/1.5 var(--sans); letter-spacing: 0; text-transform: none;
  transition: border-color 0.2s, background 0.2s;
}
.contact-form textarea { min-height: 160px; resize: vertical; }
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(140, 23, 25, 0.12); }
.contact-form .button { justify-self: start; }
.contact-form .note { font-size: 0.8125rem; opacity: 0.85; }
.contact-form .note a { color: inherit; }
#contact-status:empty { display: none; }
#contact-status { font-weight: 500; color: var(--accent); }
.contact-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Responsive */
@media (max-width: 860px) {
  .case-summary, .about-grid, .block-split, .contact { grid-template-columns: 1fr; }
  .case-aside, .block-split .sticky { position: static; }
  .about-photo { grid-row: auto; max-width: 420px; }
  .courses-title { text-align: left; }
  .course { grid-template-columns: 1fr; border-radius: 28px; }
  .sheet-head { grid-template-columns: 1fr; align-items: start; }
  .sheet-art { order: -1; justify-items: start; }
  .sheet-art img { max-height: 180px; }
}
@media (max-width: 640px) {
  .nav-social { display: none; }
  .nav-links { gap: 20px; }
  .nav-links a { font-size: 0.75rem; letter-spacing: 0.1em; }
  .hero-stage { grid-template-columns: 1fr; justify-items: center; gap: 0; }
  .hero-word:first-child { justify-self: start; position: relative; z-index: 2; margin-bottom: -0.18em; }
  .hero-word.is-italic { justify-self: end; position: relative; z-index: 2; margin-top: -0.12em; }
  .hero-word { font-size: 23vw; }
  .hero-photo { width: min(60vw, 250px); }
  .hero-meta { grid-template-columns: 1fr; }
  .hero-role { grid-column: 1; justify-content: center; }
  .about-facts { grid-template-columns: 1fr; }
  .filters { justify-content: flex-start; }
  .section-head { align-items: start; }
  .sheet-panel { height: 96dvh; border-radius: 24px 24px 0 0; }
  .footer-bar { flex-direction: column; }
  .js [data-reveal="left"], .js [data-reveal="right"] { --rx: 0; --ry: 28px; }
  .job { grid-template-columns: 48px 1fr; gap: 14px; }
  .job-logo { width: 48px; height: 48px; border-radius: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
  .js [data-reveal], .js .cards > li, .js .hero [data-hero] { transform: none !important; transition: opacity 0.4s linear !important; }
  .js .hero-photo { clip-path: none; transition: none; }
  .js .hero-photo img { transform: none; transition: none; }
  .pcard-inner { transition: none; }
  @media (hover: hover) and (pointer: fine) {
    .pcard:hover .pcard-inner, .pcard:focus-visible .pcard-inner { transform: none; }
    .pcard-back { transform: none; opacity: 0; transition: opacity 0.3s linear; }
    .pcard:hover .pcard-back, .pcard:focus-visible .pcard-back { opacity: 1; }
  }
}
