/* ---------- Tokens ---------- */
:root {
  --bg: #f3f1ec;
  --card: #ffffff;
  --ink: #0e0e0e;
  --muted: #64615b;
  --line: rgba(14, 14, 14, 0.1);
  --accent: #2b3bff;
  --accent-ink: #ffffff;
  --sans: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  --gutter: clamp(16px, 3.4vw, 48px);
  --radius: 18px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
html:not(.lenis) { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: 0.02em; text-transform: uppercase; color: var(--muted); font-weight: 400; }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 200;
  background: var(--accent); color: var(--accent-ink); padding: 10px 16px; border-radius: 999px; text-decoration: none;
}
.skip:focus { top: 16px; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 14px var(--gutter);
  transition: background 0.4s, backdrop-filter 0.4s, box-shadow 0.4s;
}
.nav.is-scrolled {
  background: rgba(243, 241, 236, 0.78);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--line);
}
.nav__logo { justify-self: start; text-decoration: none; }
.nav__logo span {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 800; font-size: 15px; letter-spacing: -0.02em;
  transition: transform 0.5s var(--ease);
}
.nav__logo:hover span { transform: rotate(-8deg) scale(1.06); }
.nav nav { display: flex; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.nav nav a { text-decoration: none; font-size: 14px; font-weight: 500; padding: 7px 14px; border-radius: 999px; transition: background 0.3s, color 0.3s; }
.nav nav a:hover { background: var(--ink); color: var(--bg); }
.nav__cta {
  justify-self: end; text-decoration: none; font-size: 14px; font-weight: 500;
  background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px;
  transition: background 0.3s;
}
.nav__cta:hover { background: var(--accent); }
@media (max-width: 640px) {
  .nav { grid-template-columns: auto 1fr; }
  .nav nav { display: none; }
}

/* ---------- Hero ---------- */
.hero { padding: clamp(96px, 13vh, 140px) var(--gutter) clamp(40px, 7vh, 80px); overflow-x: clip; }
.hero__top { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: clamp(12px, 2vh, 24px); }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12px; text-transform: uppercase;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px 6px 10px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: #18b85a; box-shadow: 0 0 0 0 rgba(24, 184, 90, 0.5); }
.motion .dot { animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(24, 184, 90, 0); } 100% { box-shadow: 0 0 0 0 rgba(24, 184, 90, 0); } }

.hero__name {
  font-weight: 760;
  font-variation-settings: "wght" 760, "wdth" 80, "opsz" 96;
  font-size: min(23vw, 36vh);
  line-height: 0.92;
  letter-spacing: -0.045em;
  white-space: nowrap;
  padding-bottom: 0.08em; /* room for the tail of the y */
  margin-left: -0.04em;
}
.name { display: inline-block; }
.name .ch { display: inline-block; font-variation-settings: inherit; }
.name .sp { display: inline-block; width: 0.22em; }
@media (max-width: 640px) {
  .hero__name { white-space: normal; font-size: 40vw; line-height: 0.86; }
  .name .sp { display: block; width: 0; height: 0; }
}

.hero__grid {
  display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(24px, 4vw, 64px); align-items: end;
  margin-top: clamp(20px, 3vh, 36px); padding-top: 22px; border-top: 1px solid var(--line);
}
.hero__lede { margin: 0; max-width: 30ch; font-size: clamp(22px, 2.3vw, 32px); line-height: 1.2; font-weight: 500; letter-spacing: -0.015em; }
.hl { background: linear-gradient(transparent 62%, rgba(43, 59, 255, 0.2) 62%); }
.hero__facts { margin: 0; display: grid; gap: 10px; }
.hero__facts div { display: grid; grid-template-columns: 96px 1fr; gap: 12px; font-size: 15px; }
.hero__facts dt { font-family: var(--mono); font-size: 12px; text-transform: uppercase; color: var(--muted); padding-top: 2px; }
.hero__facts dd { margin: 0; }
.clock { font-variant-numeric: tabular-nums; }
@media (max-width: 820px) { .hero__grid { grid-template-columns: 1fr; } }

/* ---------- Sections ---------- */
.section { padding: clamp(40px, 7vw, 96px) var(--gutter); }
.head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-bottom: 16px; margin-bottom: 24px; border-bottom: 1px solid var(--line);
}
.head__title {
  font-size: clamp(36px, 5vw, 72px); line-height: 1; letter-spacing: -0.035em;
  font-weight: 720; font-variation-settings: "wght" 720, "wdth" 82, "opsz" 96;
}

/* ---------- Work cards ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(12px, 1.6vw, 20px); }
.card {
  position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px; transition: transform 0.6s var(--ease), box-shadow 0.6s var(--ease);
}
.card:hover { transform: translateY(-6px); box-shadow: 0 24px 48px -24px rgba(14, 14, 14, 0.25); }
.card:has(.card__hit:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.card__hit { position: absolute; inset: 0; z-index: 3; background: none; border: 0; padding: 0; cursor: pointer; border-radius: inherit; }
.card__hit:focus-visible { outline: none; }
.card__media { border-radius: 12px; overflow: hidden; aspect-ratio: 4 / 3; background: #e6e3dc; }
.card__media img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform 1s var(--ease); }
.card:hover .card__media img { transform: scale(1.05); }
.card__body { padding: 16px 8px 8px; }
.card__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.card__tags span {
  font-family: var(--mono); font-size: 11px; text-transform: uppercase;
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; color: var(--muted);
}
.card__tags .tag--accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.card h3 {
  font-size: clamp(28px, 2.6vw, 38px); line-height: 1; letter-spacing: -0.03em;
  font-weight: 720; font-variation-settings: "wght" 720, "wdth" 82, "opsz" 96; margin-bottom: 8px;
}
.card p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.45; }
.card__go {
  position: absolute; top: 20px; right: 20px; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--card); font-size: 16px; transition: transform 0.6s var(--ease), background 0.3s, color 0.3s;
}
.card:hover .card__go { transform: rotate(45deg); background: var(--accent); color: var(--accent-ink); }
@media (max-width: 960px) { .cards { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .cards { grid-template-columns: 1fr; } }

/* ---------- Awards ---------- */
.awards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(12px, 1.6vw, 20px); }
.awards li {
  display: flex; flex-direction: column; gap: 6px; min-height: 200px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
  transition: background 0.4s var(--ease), color 0.4s var(--ease), transform 0.6s var(--ease);
}
.awards strong {
  margin-top: auto; font-size: clamp(22px, 2vw, 28px); line-height: 1.1; letter-spacing: -0.02em;
  font-weight: 650; font-variation-settings: "wght" 650, "wdth" 85;
}
.awards__org { color: var(--muted); font-size: 14px; transition: color 0.4s; }
.badge {
  align-self: flex-start; margin-top: 10px;
  font-family: var(--mono); font-size: 11px; text-transform: uppercase;
  background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 4px 10px;
}
.awards li:hover { background: var(--accent); color: var(--accent-ink); transform: translateY(-4px); }
.awards li:hover .mono, .awards li:hover .awards__org { color: rgba(255, 255, 255, 0.75); }
.awards li:hover .badge { background: var(--accent-ink); color: var(--accent); }
@media (max-width: 820px) { .awards { grid-template-columns: 1fr; } .awards li { min-height: 0; } }

/* ---------- About ---------- */
.about__grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(24px, 5vw, 72px); }
.about__text { margin: 0; font-size: clamp(20px, 2vw, 28px); line-height: 1.3; letter-spacing: -0.01em; font-weight: 450; max-width: 34ch; }
.about__skills { display: grid; gap: 22px; align-content: start; }
.about__skills h3 { margin-bottom: 10px; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 14px; }
@media (max-width: 820px) { .about__grid { grid-template-columns: 1fr; } }

/* ---------- Contact ---------- */
.contact {
  margin: clamp(24px, 4vw, 48px) var(--gutter) 0;
  background: var(--accent); color: var(--accent-ink); border-radius: calc(var(--radius) + 6px);
  padding: clamp(36px, 6vw, 80px) clamp(22px, 5vw, 72px);
  position: relative; overflow: hidden;
}
.contact__label { color: rgba(255, 255, 255, 0.75); margin: 0 0 10px; }
.contact__title {
  font-size: clamp(64px, 12vw, 200px); line-height: 0.9; letter-spacing: -0.03em;
  font-weight: 800; font-variation-settings: "wght" 800, "wdth" 78, "opsz" 96;
  margin-bottom: clamp(24px, 4vw, 48px);
}
.contact__row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.contact__mail {
  font-size: clamp(20px, 2.8vw, 36px); font-weight: 500; text-decoration: none;
  border-bottom: 2px solid rgba(255, 255, 255, 0.4); padding-bottom: 2px; transition: border-color 0.3s;
  overflow-wrap: anywhere;
}
.contact__mail:hover { border-color: #fff; }
.copy {
  background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.35); color: #fff;
  border-radius: 999px; padding: 8px 16px; font-family: var(--mono); font-size: 12px; text-transform: uppercase; cursor: pointer;
  transition: background 0.3s, color 0.3s;
}
.copy:hover { background: #fff; color: var(--accent); }

/* ---------- Footer ---------- */
.footer {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 22px var(--gutter) 28px; font-family: var(--mono); font-size: 12px; text-transform: uppercase; color: var(--muted);
}
.footer a { text-decoration: none; }
.footer a:hover { color: var(--ink); }

/* ---------- Project sheets ---------- */
.sheet {
  margin: 0 0 0 auto; padding: 0; border: 0;
  width: min(620px, 100vw); height: 100dvh; max-height: 100dvh; max-width: 100vw;
  background: var(--bg); color: var(--ink);
  box-shadow: -30px 0 80px rgba(14, 14, 14, 0.18);
}
.sheet::backdrop { background: rgba(14, 14, 14, 0.4); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.sheet[open] { animation: sheet-in 0.6s var(--ease); }
.sheet[open]::backdrop { animation: fade-in 0.4s ease; }
.sheet.closing { animation: sheet-out 0.35s ease-in forwards; }
.sheet.closing::backdrop { animation: fade-out 0.35s ease-in forwards; }
.calm .sheet[open], .calm .sheet[open]::backdrop, .calm .sheet.closing, .calm .sheet.closing::backdrop { animation: none; }
@keyframes sheet-in { from { transform: translateX(100%); } }
@keyframes sheet-out { to { transform: translateX(100%); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }

.sheet__inner { height: 100%; overflow-y: auto; overscroll-behavior: contain; padding: 28px clamp(20px, 4vw, 40px) 40px; }
.sheet__close {
  position: sticky; top: 0; float: right; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); cursor: pointer;
  transition: transform 0.5s var(--ease), background 0.3s, color 0.3s;
}
.sheet__close:hover { transform: rotate(90deg); background: var(--ink); color: var(--bg); }
.sheet h2 {
  font-size: clamp(48px, 7vw, 72px); line-height: 0.95; letter-spacing: -0.04em; margin: 10px 0 14px;
  font-weight: 760; font-variation-settings: "wght" 760, "wdth" 80, "opsz" 96;
}
.sheet__lede { margin: 0 0 22px; font-size: 18px; line-height: 1.45; }
.sheet__lede a { text-decoration-color: var(--accent); text-underline-offset: 3px; }
.sheet img { width: 100%; border-radius: 12px; border: 1px solid var(--line); }
.sheet__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.sheet__stats div { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.sheet__stats strong {
  display: block; font-size: clamp(30px, 4vw, 40px); line-height: 1; letter-spacing: -0.03em; color: var(--accent);
  font-weight: 760; font-variation-settings: "wght" 760, "wdth" 80; font-variant-numeric: tabular-nums;
}
.sheet__stats div > span { font-size: 13px; color: var(--muted); }
.sheet__duo { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sheet__duo img { border: 0; background: #ece8df; }
.sheet__list { list-style: none; margin: 22px 0 26px; padding: 0; }
.sheet__list li { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 15px; line-height: 1.45; }
.sheet__list b { font-family: var(--mono); font-weight: 400; font-size: 12px; text-transform: uppercase; color: var(--accent); padding-top: 2px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  background: var(--ink); color: var(--bg); padding: 14px 22px; border-radius: 999px; font-weight: 500; font-size: 15px;
  transition: background 0.3s;
}
.btn:hover { background: var(--accent); }

/* ---------- "View" cursor on cards ---------- */
.cursor {
  position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none;
  width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  display: none; place-items: center; font-family: var(--mono); font-size: 12px; text-transform: uppercase;
  transform: scale(0);
}
.has-cursor .cursor { display: grid; }

/* ---------- Motion start states (only once JS is running) ---------- */
.motion.ready [data-in] { opacity: 0; transform: translateY(28px); }
.motion.ready .name .ch { opacity: 0; transform: translateY(40%); }
