/* Layout: one dark "night lab" world. Floating pill nav, a big type-led hero over a
   slow aurora, and project cards that each glow in their own color. */
:root {
  --bg: #07080f;
  --surface: #10121d;
  --surface-2: #161928;
  --line: rgba(160, 170, 255, 0.12);
  --text: #eef0ff;
  --muted: #9198b8;
  --accent: #8b7bff;
  --accent-2: #22d3ee;
  --accent-3: #ff5fa2;
  --soft: #cdd1ea;
  --text-2: #d6daf5;
  --name-mid: #c9c2ff;
  /* one color per project card, in the order they're listed */
  --p1: #c6f432;
  --p2: #a78bfa;
  --p3: #22d3ee;
  --p4: #ff6b5a;
  --display: "Bricolage Grotesque", "Arial Black", system-ui, sans-serif;
  --body: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 20px;
  color-scheme: dark;
}

/* Color themes. Pick one with `palette` in content.js. */
/* Aurora with the purple swapped out: same navy, cyan and pink blend. */
:root[data-palette="aurora-mint"] { --accent: #34d399; --name-mid: #b5f5dc; --p2: #34d399; }
:root[data-palette="aurora-coral"] { --accent: #ff8a5c; --name-mid: #ffd0bd; --p2: #ff8a5c; }
:root[data-palette="aurora-lime"] { --accent: #a3e635; --name-mid: #e2f7b8; --p2: #facc15; }
:root[data-palette="ember"] {
  --bg: #0d0908; --surface: #17110f; --surface-2: #201814; --line: rgba(255, 190, 160, 0.12);
  --text: #fff3ec; --muted: #b39d93; --soft: #e3d3cb; --text-2: #f0e2da; --name-mid: #ffc7a8;
  --accent: #ff7a45; --accent-2: #ffb547; --accent-3: #ff3d6e;
  --p1: #ffd166; --p2: #ff8a4c; --p3: #ff5d73; --p4: #f4a259;
}
:root[data-palette="jade"] {
  --bg: #060b09; --surface: #0e1714; --surface-2: #13201c; --line: rgba(150, 255, 210, 0.11);
  --text: #ecfff6; --muted: #8fb3a4; --soft: #cfe6dc; --text-2: #dcefe6; --name-mid: #b7f5d6;
  --accent: #10b981; --accent-2: #a3e635; --accent-3: #2dd4bf;
  --p1: #c6f432; --p2: #34d399; --p3: #2dd4bf; --p4: #facc15;
}
:root[data-palette="sunset"] {
  --bg: #0c0809; --surface: #171012; --surface-2: #20161a; --line: rgba(255, 180, 210, 0.12);
  --text: #fff0f5; --muted: #b597a3; --soft: #e6d0d8; --text-2: #f2dfe6; --name-mid: #ffc2dc;
  --accent: #f472b6; --accent-2: #fb923c; --accent-3: #facc15;
  --p1: #facc15; --p2: #f472b6; --p3: #fb923c; --p4: #f43f5e;
}
:root[data-palette="crimson"] {
  --bg: #0b0708; --surface: #160e10; --surface-2: #1f1416; --line: rgba(255, 170, 180, 0.11);
  --text: #fff1f2; --muted: #b3979b; --soft: #e5d0d3; --text-2: #f1dfe1; --name-mid: #ffd28a;
  --accent: #e11d48; --accent-2: #f59e0b; --accent-3: #fb7185;
  --p1: #f59e0b; --p2: #fb7185; --p3: #e11d48; --p4: #fcd34d;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 var(--body);
  overflow-x: hidden;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; border-radius: 6px; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
h1, h2, h3 { font-family: var(--display); text-wrap: balance; letter-spacing: -0.02em; margin: 0; }
h2 { font-size: 1.6rem; font-weight: 700; margin: 4rem 0 1.2rem; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1rem; }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

/* Background atmosphere */
.aurora { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.45; }
.b1 { width: 46vmax; height: 46vmax; background: var(--accent); top: -18vmax; left: -10vmax; animation: drift1 22s ease-in-out infinite alternate; }
.b2 { width: 38vmax; height: 38vmax; background: var(--accent-2); top: -12vmax; right: -14vmax; opacity: 0.28; animation: drift2 26s ease-in-out infinite alternate; }
.b3 { width: 30vmax; height: 30vmax; background: var(--accent-3); top: 30vh; left: 35vw; opacity: 0.16; animation: drift1 30s ease-in-out infinite alternate-reverse; }
@keyframes drift1 { to { transform: translate(8vmax, 6vmax) scale(1.1); } }
@keyframes drift2 { to { transform: translate(-6vmax, 10vmax) scale(0.9); } }
.grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.5;
  background-image: radial-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 3px 3px;
  mask-image: linear-gradient(to bottom, #000, transparent 90%);
}

/* Header + floating tab bar */
.site-header {
  position: sticky; top: 0; z-index: 10; padding-block: 14px;
  background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brand { font-family: var(--display); font-weight: 800; font-size: 1.1rem; text-decoration: none; letter-spacing: -0.02em; }
.tabs {
  display: flex; gap: 2px; padding: 5px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 72%, transparent); border: 1px solid var(--line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  overflow-x: auto; max-width: 100%;
}
.tabs a {
  padding: 8px 16px; border-radius: 999px; text-decoration: none; white-space: nowrap;
  color: var(--muted); font-weight: 600; font-size: 0.92rem; transition: color 0.2s, background 0.2s;
}
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { background: var(--text); color: var(--bg); }
.tabs a.nav-resume { color: var(--accent-2); }
.tabs a.nav-resume:hover { color: var(--text); }

main.wrap { padding-top: 40px; padding-bottom: 40px; }
.panel { animation: rise 0.45s cubic-bezier(0.2, 0.7, 0.2, 1); }
@keyframes rise { from { opacity: 0.001; transform: translateY(10px); } }

/* Hero */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 48px; align-items: center; padding-block: 32px 8px; }
.status {
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 22px;
  padding: 6px 14px 6px 10px; border-radius: 999px; font-size: 0.85rem; font-weight: 600;
  background: color-mix(in srgb, var(--accent-2) 8%, transparent); border: 1px solid color-mix(in srgb, var(--accent-2) 25%, transparent); color: var(--accent-2);
}
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent-2) 60%, transparent); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.hero-name {
  font-size: clamp(3.2rem, 11vw, 7.5rem); font-weight: 800; line-height: 0.92; letter-spacing: -0.045em;
  background: linear-gradient(100deg, var(--text) 30%, var(--name-mid) 55%, var(--accent-2) 85%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 22px;
}
.hero-role { color: var(--muted); font-size: clamp(0.92rem, 2.2vw, 1.05rem); margin-bottom: 4px; }
.prompt { color: var(--accent); }
.caret { display: inline-block; width: 0.55em; height: 1.1em; vertical-align: -0.18em; margin-left: 4px; background: var(--accent); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.photo-frame {
  position: relative; width: clamp(160px, 22vw, 240px); aspect-ratio: 1; max-width: 100%;
  border-radius: 32px; padding: 3px;
  background: conic-gradient(from 200deg, var(--accent), var(--accent-2), var(--accent-3), var(--accent));
  transform: rotate(3deg); box-shadow: 0 30px 80px -20px color-mix(in srgb, var(--accent) 50%, transparent);
}
.photo { width: 100%; height: 100%; object-fit: cover; border-radius: 29px; display: block; background: var(--surface); }

/* Buttons */
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 14px;
  font-weight: 700; font-size: 0.95rem; text-decoration: none;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); color: var(--text);
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
}
.btn:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, 0.3); }
.btn-primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn-primary:hover { background: #fff; }

/* Featured tiles */
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.section-head h2 { margin-bottom: 1.2rem; }
.see-all { font-size: 0.85rem; color: var(--muted); text-decoration: none; white-space: nowrap; }
.see-all:hover { color: var(--text); }
.featured { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tile {
  position: relative; display: flex; flex-direction: column; gap: 6px; min-height: 150px; padding: 18px;
  border-radius: var(--radius); text-decoration: none; overflow: hidden;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 16%, var(--surface)) 0%, var(--surface) 70%);
  border: 1px solid color-mix(in srgb, var(--c) 25%, transparent);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.tile:hover { transform: translateY(-4px); border-color: var(--c); box-shadow: 0 18px 50px -18px var(--c); }
.tile-kind { padding-right: 22px; font-size: 0.72rem; color: var(--c); text-transform: uppercase; letter-spacing: 0.08em; }
.tile-name { font-family: var(--display); font-weight: 800; font-size: 1.7rem; letter-spacing: -0.03em; margin-top: auto; }
.tile-arrow { position: absolute; top: 14px; right: 16px; color: var(--muted); transition: transform 0.2s, color 0.2s; }
.tile:hover .tile-arrow { transform: translateX(4px); color: var(--c); }

/* About */
.about-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 40px; align-items: end; }
.prose { max-width: 62ch; color: var(--soft); font-size: 1.05rem; }
.facts { display: grid; gap: 0; margin: 0 0 1rem; border-top: 1px solid var(--line); }
.facts div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; padding-top: 2px; }
.facts dd { margin: 0; font-weight: 600; text-align: right; }

.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  padding: 7px 14px; border-radius: 999px; font-size: 0.9rem; font-weight: 600;
  background: var(--surface); border: 1px solid var(--line); color: var(--text-2);
}
.chips.small li { font-family: var(--mono); font-size: 0.75rem; font-weight: 500; padding: 4px 11px; }
.plain-list { padding-left: 1.2rem; }

/* Page headers */
.eyebrow { color: var(--accent); font-size: 0.85rem; margin-bottom: 10px; }
.page-title { font-size: clamp(2.6rem, 7vw, 4.5rem); font-weight: 800; line-height: 1; letter-spacing: -0.04em; margin-bottom: 18px; }
.page-title.big { font-size: clamp(3rem, 10vw, 6.5rem); }
.lead { color: var(--muted); font-size: 1.1rem; max-width: 60ch; }

/* Projects */
.project-list { display: grid; gap: 22px; margin-top: 40px; }
.project {
  position: relative; display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 8px;
  padding: 32px 32px 28px 20px; border-radius: 26px; overflow: hidden;
  background: linear-gradient(135deg, color-mix(in srgb, var(--c) 10%, var(--surface)) 0%, var(--surface) 45%);
  border: 1px solid color-mix(in srgb, var(--c) 22%, transparent);
  scroll-margin-top: 90px;
}
.project::after {
  content: ""; position: absolute; width: 340px; height: 340px; right: -120px; top: -160px; border-radius: 50%;
  background: var(--c); filter: blur(110px); opacity: 0.22; pointer-events: none;
}
.project-index { font-size: 0.85rem; color: var(--c); padding-top: 10px; text-align: center; }
.project-main { position: relative; z-index: 1; min-width: 0; }
.project-kind { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--c); margin-bottom: 6px; }
.project-name { font-size: clamp(2.2rem, 6vw, 3.4rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1; margin: 0 0 16px; }
.project-summary { color: var(--soft); font-size: 1.05rem; max-width: 68ch; margin-bottom: 18px; }
.project .btn-primary { background: var(--c); border-color: var(--c); color: #0a0a12; }

/* Click-to-open boxes */
.toggles { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; padding-top: 22px; border-top: 1px dashed var(--line); }
.toggle {
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
  padding: 10px 16px; border-radius: 12px; font: 600 0.9rem var(--body); color: var(--text);
  background: var(--surface-2); border: 1px solid var(--line); transition: border-color 0.15s, background 0.15s;
}
.toggle:hover { border-color: var(--c); }
.toggle[aria-expanded="true"] { background: color-mix(in srgb, var(--c) 18%, var(--surface-2)); border-color: var(--c); }
.toggle-icon { position: relative; width: 12px; height: 12px; flex-shrink: 0; }
.toggle-icon::before, .toggle-icon::after { content: ""; position: absolute; left: 0; top: 5px; width: 12px; height: 2px; border-radius: 2px; background: var(--c); transition: transform 0.25s; }
.toggle-icon::after { transform: rotate(90deg); }
.toggle[aria-expanded="true"] .toggle-icon::after { transform: rotate(0deg); }
.drawer { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.35s ease; }
.drawer.open { grid-template-rows: 1fr; }
.drawer-inner { overflow: hidden; min-height: 0; }
.drawer-box {
  margin-top: 12px; padding: 20px 22px; border-radius: 16px;
  background: color-mix(in srgb, var(--bg) 60%, transparent); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent);
  border-left: 3px solid var(--c);
}
.drawer:not(.open) .drawer-box { visibility: hidden; transition: visibility 0s 0.35s; }
.drawer-box h4 { margin: 0 0 12px; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--c); }
.drawer-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.drawer-list li { position: relative; padding-left: 22px; color: var(--text-2); max-width: 80ch; }
.drawer-list li::before { content: "▸"; position: absolute; left: 0; color: var(--c); }

.drawer-list.numbered { counter-reset: step; }
.drawer-list.numbered li { counter-increment: step; padding-left: 34px; }
.drawer-list.numbered li::before {
  content: counter(step); top: 1px; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font: 600 0.72rem var(--mono);
  background: color-mix(in srgb, var(--c) 20%, transparent); color: var(--c);
}
.drawer-list code, .link-note code {
  font-family: var(--mono); font-size: 0.86em; padding: 1px 6px; border-radius: 6px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text); overflow-wrap: anywhere;
}
.wip {
  display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; white-space: nowrap;
  margin-left: 14px; padding: 4px 10px; border-radius: 999px; letter-spacing: 0.04em;
  font-size: 0.72rem; font-weight: 500; line-height: 1.4; text-transform: uppercase;
  color: #ffc857; background: rgba(255, 200, 87, 0.1); border: 1px solid rgba(255, 200, 87, 0.35);
}
.wip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tile .wip { align-self: flex-start; margin: 0; font-size: 0.62rem; padding: 3px 8px; }
.link-note { margin: 12px 0 0; font-size: 0.88rem; color: var(--muted); max-width: 68ch; }

/* Labs */
.lab-grid { display: grid; gap: 18px; margin-top: 40px; }
.lab {
  position: relative; display: flex; flex-direction: column; gap: 10px; padding: 28px; border-radius: 24px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--c) 8%, var(--surface)) 0%, var(--surface) 50%);
  border: 1px solid color-mix(in srgb, var(--c) 20%, transparent); --c: var(--accent-2);
}
.lab-top { display: flex; justify-content: space-between; gap: 12px; font-size: 0.8rem; }
.lab-number { color: var(--c); font-weight: 500; }
.lab-date { color: var(--muted); }
.lab h3 { font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; }
.lab .project-kind { margin: 0; }
.lab-summary { color: var(--soft); max-width: 70ch; margin: 4px 0 6px; }
.lab-report {
  display: flex; align-items: flex-start; gap: 10px; margin: 8px 0 0; font-size: 0.78rem; color: var(--muted);
  padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--bg) 50%, transparent); border: 1px dashed var(--line);
}
.lock { position: relative; flex-shrink: 0; width: 10px; height: 8px; margin-top: 6px; border-radius: 2px; background: var(--c); }
.lock::before { content: ""; position: absolute; left: 2px; top: -5px; width: 6px; height: 6px; border: 1.5px solid var(--c); border-bottom: 0; border-radius: 4px 4px 0 0; box-sizing: border-box; }
.lab .toggles { margin-top: 8px; }

/* Contact */
.contact-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 14px; margin-top: 36px; }
.contact-item {
  position: relative; display: flex; flex-direction: column; gap: 4px; padding: 22px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); transition: border-color 0.2s;
}
.contact-item:hover { border-color: var(--accent); }
.contact-label { font-size: 0.75rem; color: var(--accent); text-transform: uppercase; letter-spacing: 0.08em; }
.contact-value { font-weight: 700; font-size: 1.05rem; text-decoration: none; word-break: break-word; }
.contact-value:hover { text-decoration: underline; }
.copy {
  position: absolute; top: 16px; right: 16px; cursor: pointer; font-size: 0.72rem;
  padding: 4px 10px; border-radius: 8px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line);
}
.copy:hover { color: var(--text); }

.footer { padding-block: 40px 56px; color: var(--muted); font-size: 0.8rem; }

@media (max-width: 860px) {
  .featured { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .about-grid { grid-template-columns: 1fr; gap: 8px; }
}
@media (max-width: 640px) {
  main.wrap { padding-top: 16px; }
  .hero { grid-template-columns: 1fr; gap: 28px; padding-top: 12px; }
  .photo-frame { order: -1; width: 128px; border-radius: 26px; }
  .photo { border-radius: 23px; }
  .project { grid-template-columns: 1fr; padding: 24px 20px; }
  .project-index { text-align: left; padding: 0; }
  .header-inner { justify-content: center; }
  .brand { display: none; }
  .tabs a.nav-resume { display: none; }
  h2 { margin-top: 3rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
