/* ---------- Tokens ---------- */
:root {
  --espresso: #1c1713;
  --espresso-2: #26201b;
  --espresso-3: #332a23;
  --ink: #f4efe8;
  --ink-dim: #a89c8f;
  --ink-faint: #6e6359;
  --paper: #f3f0eb;
  --paper-ink: #16120f;
  --paper-dim: #6f675f;
  --line: rgba(244, 239, 232, .12);
  --sand: #d8b98e;

  /* card accents by type */
  --research: 32 70% 62%;   /* amber */
  --teaching: 150 28% 58%;  /* sage */
  --industry: 214 45% 66%;  /* slate blue */
  --service: 350 45% 68%;   /* rose */

  --radius: 22px;
  --max: 1240px;
  --sans: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--espresso);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
::selection { background: var(--sand); color: var(--espresso); }

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 20px;
}
h2 {
  font-weight: 400;
  font-size: clamp(36px, 5.2vw, 68px);
  line-height: 1.04;
  letter-spacing: -.03em;
}
.dim { color: var(--ink-faint); }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(20px, 4vw, 48px);
  transition: background .3s, backdrop-filter .3s;
}
.nav.scrolled { background: rgba(28, 23, 19, .72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.nav.on-light { background: rgba(243, 240, 235, .8); color: var(--paper-ink); }
.nav-mark { font-weight: 600; letter-spacing: -.02em; font-size: 18px; }
.nav nav { display: flex; gap: 28px; align-items: center; font-size: 14px; }
.nav nav a { opacity: .78; transition: opacity .2s; }
.nav nav a:hover { opacity: 1; }
.nav-cta { border: 1px solid currentColor; padding: 8px 16px; border-radius: 999px; opacity: 1 !important; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 24px; border-radius: 999px;
  font-size: 14px; font-weight: 500; letter-spacing: .01em;
  transition: transform .2s, background .2s, color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-light { background: var(--ink); color: var(--espresso); }
.btn-ghost { border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink-dim); }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100svh;
  display: grid; place-items: center;
  padding: 120px clamp(20px, 5vw, 64px) 80px;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 80% 10%, #4a3a2e 0%, transparent 55%),
    radial-gradient(90% 70% at 10% 100%, #3a2d24 0%, transparent 60%),
    var(--espresso);
}
.hero-glow {
  position: absolute; width: 60vmax; height: 60vmax; right: -18vmax; top: -12vmax;
  background: conic-gradient(from 200deg, #d8b98e33, #8a6a4c22, #d8b98e10, #d8b98e33);
  filter: blur(60px); border-radius: 50%;
  animation: drift 18s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translate(-6vmax, 6vmax) rotate(40deg); } }
.hero-inner { position: relative; max-width: var(--max); width: 100%; }
.hero-name {
  font-weight: 400;
  font-size: clamp(54px, 10.5vw, 168px);
  line-height: .92; letter-spacing: -.045em;
}
.hero-name .light { color: var(--ink-faint); }
.hero-pitch {
  margin-top: 32px; max-width: 640px;
  font-size: clamp(18px, 1.7vw, 22px); color: var(--ink-dim); line-height: 1.45;
}
.hero-pitch strong { color: var(--ink); font-weight: 500; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.fact {
  font-family: var(--mono); font-size: 12px; color: var(--ink);
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px;
  background: rgba(255,255,255,.03);
}
.fact b { color: var(--sand); font-weight: 500; }
.hero-actions { display: flex; gap: 12px; margin-top: 40px; flex-wrap: wrap; }
.scroll-hint {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  font-family: var(--mono); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-faint);
}
.scroll-hint::after {
  content: ""; display: block; width: 1px; height: 36px; margin: 10px auto 0;
  background: linear-gradient(var(--ink-faint), transparent);
  animation: hint 2s ease-in-out infinite;
}
@keyframes hint { 0%,100% { transform: scaleY(.4); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } }

/* ---------- Sections ---------- */
section { padding: clamp(96px, 12vw, 160px) clamp(20px, 5vw, 64px); }
.section-head { max-width: var(--max); margin: 0 auto 56px; }

/* ---------- Research / Teaching: name cards ---------- */
.teaching { padding-top: 0; }
.teaching h2 { font-size: clamp(32px, 4vw, 52px); }

.cards {
  max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px;
  perspective: 1400px;
}
.card {
  --h: var(--research);
  position: relative; isolation: isolate;
  aspect-ratio: 1.75 / 1;                /* business-card proportions (cards without a thumbnail) */
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  background:
    radial-gradient(120% 120% at 100% 0%, hsl(var(--h) / .22) 0%, transparent 50%),
    linear-gradient(160deg, var(--espresso-3), var(--espresso-2) 60%);
  border: 1px solid var(--line);
  cursor: pointer; overflow: hidden;
  transform-style: preserve-3d;
  transition: transform .5s cubic-bezier(.2,.7,.2,1), box-shadow .5s, border-color .3s, opacity .5s;
  box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 20px 40px -24px rgba(0,0,0,.6);
  opacity: 0; transform: translateY(40px);
}
.card.in { opacity: 1; transform: none; }
.card:hover { border-color: hsl(var(--h) / .45); box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 40px 80px -30px hsl(var(--h) / .35); }
.card.featured { grid-column: 1 / -1; aspect-ratio: 3.2 / 1; }

/* info block (the "name card" text) */
.card-info {
  position: relative; isolation: isolate; overflow: hidden; flex: 1;
  display: flex; flex-direction: column; justify-content: space-between; gap: 18px;
  padding: clamp(22px, 2.4vw, 32px);
}

/* thumbnail */
.card-thumb {
  position: relative; overflow: hidden; flex: none;
  margin: 10px 10px 0; border-radius: 14px;
  aspect-ratio: 2 / 1; background: #120e0b;
  box-shadow: 0 0 0 1px rgba(255,255,255,.06) inset;
}
.card-thumb canvas, .card-thumb img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  transition: transform .9s cubic-bezier(.2,.7,.2,1), filter .6s;
  filter: saturate(.92) brightness(.94);
}
.card:hover .card-thumb canvas, .card:hover .card-thumb img { transform: scale(1.045); filter: saturate(1.08) brightness(1.04); }
.card-thumb::after { /* soft inner shade so the image sits in the card */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent 60%, rgba(20,16,13,.35));
}
.card.has-thumb { aspect-ratio: auto; }

/* featured / wide: text left, image right */
.card.featured.has-thumb {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  min-height: clamp(360px, 34vw, 460px);
}
.card.featured.has-thumb .card-thumb { order: 2; margin: 10px; aspect-ratio: auto; }
.card.featured.has-thumb .card-info { order: 1; }
.card.wide.has-thumb { min-height: clamp(300px, 26vw, 360px); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.card[data-type="teaching"] { --h: var(--teaching); }
.card[data-type="industry"] { --h: var(--industry); }
.card[data-type="service"]  { --h: var(--service); }
.card.hidden { display: none; }

/* sheen that follows the cursor */
.card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,.08), transparent 45%);
  opacity: 0; transition: opacity .3s;
}
.card:hover::before { opacity: 1; }
/* giant faded year watermark */
.card .watermark {
  position: absolute; right: -0.04em; bottom: -0.22em; z-index: -1;
  font-size: clamp(110px, 14vw, 200px); font-weight: 600; letter-spacing: -.06em; line-height: 1;
  color: hsl(var(--h) / .07); pointer-events: none; user-select: none;
}
.card.featured .watermark { font-size: clamp(140px, 18vw, 280px); }

.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.card-type {
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: hsl(var(--h)); display: inline-flex; align-items: center; gap: 8px;
}
.card-type::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: hsl(var(--h)); box-shadow: 0 0 12px hsl(var(--h)); }
.card-date { font-family: var(--mono); font-size: 12px; color: var(--ink-dim); white-space: nowrap; }
.card-body { max-width: 96%; }
.card-org { font-size: 13px; color: var(--ink-dim); margin-bottom: 8px; }
.card-title { font-size: clamp(20px, 2vw, 28px); font-weight: 500; letter-spacing: -.02em; line-height: 1.15; }
.card.featured .card-title { font-size: clamp(24px, 2.6vw, 36px); }
.card.wide .card-title { font-size: clamp(20px, 2vw, 28px); }
.card.featured .card-impact { -webkit-line-clamp: 4; font-size: 15px; }
.card-impact { margin-top: 10px; font-size: 14px; color: var(--ink-dim); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-family: var(--mono); font-size: 11px; padding: 4px 10px; border-radius: 999px;
  background: rgba(255,255,255,.05); border: 1px solid var(--line); color: var(--ink-dim);
}
.card-open {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; border: 1px solid var(--line);
  transition: background .3s, color .3s, transform .3s;
}
.card:hover .card-open { background: var(--ink); color: var(--espresso); transform: rotate(-45deg); }
.badges { display: flex; gap: 6px; }
.badge.live { background: rgba(120, 220, 150, .14); color: #8fe0a8; }
.badge.live::before { content: "● "; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.badge {
  font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  padding: 4px 8px; border-radius: 6px; background: hsl(var(--h) / .16); color: hsl(var(--h));
}

/* ---------- Drawer ---------- */
.drawer { position: fixed; inset: 0; z-index: 100; pointer-events: none; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(10,8,6,.6); backdrop-filter: blur(6px); opacity: 0; transition: opacity .35s; }
.drawer-panel {
  position: absolute; right: 0; top: 0; bottom: 0; width: min(680px, 100%);
  background: var(--espresso-2); border-left: 1px solid var(--line);
  padding: 56px clamp(24px, 4vw, 48px); overflow-y: auto;
  transform: translateX(100%); transition: transform .45s cubic-bezier(.2,.7,.2,1);
}
.drawer.open { pointer-events: auto; }
.drawer.open .drawer-backdrop { opacity: 1; }
.drawer.open .drawer-panel { transform: none; }
.drawer-close {
  position: absolute; top: 18px; right: 18px; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: transparent; color: var(--ink); font-size: 22px; cursor: pointer;
}
.d-type { margin-bottom: 14px; }
.d-title { font-size: clamp(28px, 3.4vw, 40px); font-weight: 500; letter-spacing: -.025em; line-height: 1.1; }
.d-meta { margin-top: 12px; color: var(--ink-dim); font-size: 14px; }
.d-impact { margin-top: 28px; font-size: 18px; line-height: 1.5; }
.d-media { margin-top: 28px; display: grid; gap: 12px; }
.d-media img { border-radius: 14px; border: 1px solid var(--line); }
.d-art { border-radius: 14px; overflow: hidden; aspect-ratio: 16 / 9; border: 1px solid var(--line); }
.d-art canvas { display: block; width: 100%; height: 100%; }
.d-section { margin-top: 32px; }
.d-section h4 { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-dim); font-weight: 400; margin-bottom: 12px; }
.d-section ul { list-style: none; display: grid; gap: 10px; }
.d-section li { padding-left: 20px; position: relative; color: var(--ink); line-height: 1.5; }
.d-section li::before { content: ""; position: absolute; left: 0; top: .7em; width: 8px; height: 1px; background: var(--sand); }
.d-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.pub-link { color: var(--ink); text-decoration: underline; text-decoration-color: rgba(216,185,142,.45); text-underline-offset: 3px; transition: color .2s, text-decoration-color .2s; }
.pub-link:hover { color: var(--sand); text-decoration-color: var(--sand); }
.btn img { display: inline-block; }

/* ---------- Skills: app tiles on light ---------- */
.skills { background: var(--paper); color: var(--paper-ink); }
.skills .eyebrow { color: var(--paper-dim); }
.skill-grid {
  max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px;
}
.skill-card {
  --h: 32 70% 62%;
  position: relative; overflow: hidden;
  border-radius: var(--radius); padding: 28px;
  min-height: 380px; display: flex; flex-direction: column;
  background:
    radial-gradient(90% 70% at 85% 110%, hsl(var(--h) / .35), transparent 60%),
    linear-gradient(170deg, #2b241f, #171310);
  color: var(--ink);
  transition: transform .4s cubic-bezier(.2,.7,.2,1), box-shadow .4s;
}
.skill-card:hover { transform: translateY(-6px); box-shadow: 0 30px 60px -30px rgba(0,0,0,.45); }
.skill-card h3 { font-size: 22px; font-weight: 500; letter-spacing: -.02em; }
.skill-card p { margin-top: 8px; font-size: 14px; color: var(--ink-dim); max-width: 90%; }
.app-grid {
  margin-top: auto; padding-top: 28px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 10px;
}
.app { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.app-icon {
  position: relative; overflow: hidden;
  width: 100%; max-width: 64px; aspect-ratio: 1; border-radius: 26%;
  display: grid; place-items: center;
  font-weight: 600; font-size: 17px; letter-spacing: -.02em; color: #fff;
  /* one shared white tile for every icon (logos and drawn symbols); symbols use a single ink */
  color: #3a2e25;
  background: linear-gradient(160deg, #fbf8f3, #e9e3da);
  box-shadow: 0 1px 0 rgba(255,255,255,.5) inset, 0 10px 18px -10px rgba(0,0,0,.7);
  transition: transform .3s cubic-bezier(.2,.7,.2,1), box-shadow .3s;
}
.app-icon::after { /* glossy highlight */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,0) 45%);
}
.app-icon svg { width: 56%; height: 56%; }
.app-icon.brand img { width: 58%; height: 58%; object-fit: contain; }
.app-icon.brand span { color: var(--brand); }
.app-icon.brand.wide img { width: 92%; height: auto; }
.app:hover .app-icon { transform: scale(1.1) translateY(-3px); box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 16px 24px -10px rgba(0,0,0,.75); }
.app-name { font-size: 11px; color: var(--ink-dim); text-align: center; line-height: 1.2; max-width: 72px; min-height: 2.4em; /* same row height whether a label wraps or not */ }

/* ---------- Objective ---------- */
.objective { background: #0f0c0a; padding-bottom: clamp(120px, 14vw, 200px); }
.objective .eyebrow { max-width: var(--max); margin: 0 auto 40px; }
.statements { max-width: var(--max); margin: 0 auto; display: grid; gap: clamp(36px, 5vw, 64px); }
.statement {
  font-size: clamp(34px, 5.6vw, 84px); line-height: 1.04; letter-spacing: -.035em; font-weight: 400;
}
.statement .w { color: #3a322c; transition: color .4s; }
.statement .w.lit { color: var(--ink); }
.statement .w.accent.lit { color: var(--sand); }

/* ---------- Contact ---------- */
.contact {
  background: #0f0c0a; border-top: 1px solid var(--line);
  padding: clamp(80px, 10vw, 140px) clamp(20px, 5vw, 64px) 48px;
}
.contact-big {
  max-width: var(--max); margin: 0 auto;
  font-size: clamp(48px, 9vw, 140px); line-height: .95; letter-spacing: -.045em; color: var(--ink-faint);
}
.availability {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 500; color: #bfeccb;
  padding: 7px 14px 7px 12px; border-radius: 999px;
  background: rgba(120, 220, 150, .08); border: 1px solid rgba(120, 220, 150, .22);
  margin-bottom: 26px;
}
.availability::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: #6fdc8f;
  box-shadow: 0 0 0 0 rgba(111, 220, 143, .6); animation: ping 2s ease-out infinite;
}
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(111,220,143,.55); } 80%, 100% { box-shadow: 0 0 0 9px rgba(111,220,143,0); } }
.contact .availability { display: flex; width: fit-content; max-width: var(--max); margin: 0 auto 28px max(0px, calc((100% - var(--max)) / 2)); }
.contact-email {
  display: block; width: fit-content; max-width: var(--max); margin: 40px auto 0 max(0px, calc((100% - var(--max)) / 2));
  font-size: clamp(24px, 3.4vw, 44px); letter-spacing: -.02em; color: var(--ink);
  background: linear-gradient(var(--sand), var(--sand)) 0 100% / 0 1px no-repeat;
  padding-bottom: 4px; transition: background-size .5s cubic-bezier(.2,.7,.2,1), color .3s;
}
.contact-email:hover { background-size: 100% 1px; color: var(--sand); }
.fineprint { max-width: var(--max); margin: 80px auto 0; font-family: var(--mono); font-size: 11px; color: var(--ink-faint); }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .skill-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .nav nav a:not(.nav-cta) { display: none; }
  .cards { grid-template-columns: 1fr; }
  .card, .card.featured { aspect-ratio: auto; min-height: 260px; }
  .card.featured.has-thumb, .card.wide.has-thumb { display: flex; min-height: 0; }
  .card.featured.has-thumb .card-thumb { order: 0; margin: 10px 10px 0; aspect-ratio: 2 / 1; }
  .skill-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .card { opacity: 1; transform: none; }
}
