:root {
  --bg: #05051a;
  --text: #ecebf5;
  --text-2: #d6d4ea;
  --text-3: #c9c7de;
  --muted: #bdbad6;
  --faint: #9a98b8;
  --label: #8e8cae;
  --label-2: #7d7b9c;
  --link: #b9adff;
  --violet: #8b7cf6;
  --orange: #ffa24a;
  --glass: rgba(13, 12, 40, .62);
  --glass-strong: rgba(13, 12, 40, .92);
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --gutter: clamp(20px, 6vw, 88px);
  --sans: 'Figtree', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}

html { scroll-behavior: smooth; background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--link); text-decoration: none; }
a:hover { color: #fff; }
button { font: inherit; color: inherit; }
::selection { background: var(--violet); color: #fff; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 8px; }
[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Shared pieces */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
}
.label { font-family: var(--mono); font-size: 12px; color: var(--label); }
.meta {
  display: flex; flex-wrap: wrap; gap: 8px 10px;
  font-family: var(--mono); font-size: 11px; color: var(--faint);
}
.meta span { display: flex; align-items: center; gap: 5px; }
.swatch { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--c, #9a9a9e); }
.reveal {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows .45s var(--ease);
}
.reveal.open { grid-template-rows: 1fr; }
.reveal > div { overflow: hidden; min-height: 0; }

#brain { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; z-index: 0; }

/* Nav */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 18px clamp(20px, 4vw, 48px);
  background: rgba(5, 5, 26, .55);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 20px; letter-spacing: -.01em; white-space: nowrap; }
.logo:hover { color: var(--text); }
.logo-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--orange);
  box-shadow: 0 0 10px var(--orange), 0 0 20px rgba(255, 162, 74, .6);
  margin-left: -6px; align-self: flex-end; margin-bottom: 5px;
}
.nav-links { display: flex; gap: clamp(12px, 2.4vw, 32px); font-family: var(--mono); font-size: 13px; }
.nav-links a { color: var(--muted); }
.nav-links a:hover { color: #fff; }

/* Content passes the mouse through to the brain except on real boxes */
main { position: relative; z-index: 1; pointer-events: none; }

/* Hero */
.hero {
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 120px var(--gutter) clamp(48px, 9vh, 96px);
  box-sizing: border-box;
}
.hero-inner {
  max-width: min(100%, 760px);
  display: flex; flex-direction: column; gap: 16px;
  pointer-events: auto;
  opacity: 0; transform: translateY(16px);
  transition: opacity 1.1s ease, transform 1.1s var(--ease);
}
.hero-inner.in { opacity: 1; transform: none; }
.hero h1 {
  margin: 0; font-size: clamp(44px, 6.6vw, 96px); line-height: .95; font-weight: 700;
  letter-spacing: -.035em; white-space: nowrap;
}
.hero .hi { font-weight: 400; color: var(--muted); }
.dot { color: var(--orange); text-shadow: 0 0 18px var(--orange), 0 0 40px rgba(255, 162, 74, .6); }
.hero-line { margin: 0; font-size: clamp(17px, 1.6vw, 20px); line-height: 1.4; color: var(--text-2); max-width: 400px; text-wrap: pretty; }
.hint { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 12px; color: var(--label); margin-top: 8px; }
.hint-dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: #ae85fe; box-shadow: 0 0 10px #ae85fe; }

/* Sections */
.section { padding: 96px var(--gutter); display: flex; flex-direction: column; gap: 36px; }
.section-head { display: flex; align-items: baseline; gap: 16px; }
.num { font-family: var(--mono); font-size: 13px; color: var(--label); }
.section h2 { margin: 0; font-size: clamp(36px, 5vw, 56px); font-weight: 700; letter-spacing: -.03em; }

/* Project cards */
.cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
  gap: 16px; align-items: start; pointer-events: auto;
}
.card {
  cursor: pointer; display: flex; flex-direction: column; gap: 18px;
  padding: 26px; border-radius: 20px; box-sizing: border-box;
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  transition: border-color .25s;
}
.card:hover { border-color: color-mix(in srgb, var(--c) 60%, transparent); }
.card-featured { grid-column: 1 / -1; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mark { display: block; width: 36px; height: 36px; filter: drop-shadow(0 0 10px rgba(136, 117, 255, .55)); }
.card-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 12px var(--c); }
.sign { font-family: var(--mono); font-size: 18px; color: var(--faint); width: 20px; text-align: center; }
.card-text { display: flex; flex-direction: column; gap: 8px; }
.eyebrow { font-family: var(--mono); font-size: 12px; color: #8fb6ff; }
.card h3 { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.card-featured h3 { font-size: clamp(40px, 5vw, 60px); letter-spacing: -.035em; line-height: 1; }
.card-line { margin: 0; font-size: 17px; line-height: 1.45; color: var(--text-3); }
.card-featured .card-line { font-size: 20px; }
.card .reveal { margin-top: -18px; opacity: 0; transition: grid-template-rows .5s var(--ease), opacity .4s ease; }
.card .reveal.open { opacity: 1; }
.card-detail {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 24px; padding-top: 24px;
}
.shot {
  aspect-ratio: 16 / 10; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .1);
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .035) 0 10px, transparent 10px 20px);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 12px; color: var(--label);
}
img.shot { display: block; width: 100%; object-fit: cover; }

/* The peephole: a rounded window cut through the whole featured card (glass
   and blur included) so the live brain shows through. main.js sets its width
   to the line above and the card's mask while the card is open. */
.card-featured { -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-size: 100% 100%; mask-size: 100% 100%; }
.card-featured .card-line { align-self: flex-start; }
/* The outline is a border inside the window and the hole is cut just inside
   it, so rounding can never shave the outline off. */
.peephole {
  position: relative; box-sizing: border-box; width: var(--pw, 100%); max-width: 100%; aspect-ratio: 16 / 9;
  margin: 24px 0 26px; border-radius: 18px;
  border: 1.5px solid rgba(185, 173, 255, .6);
  box-shadow: 0 0 28px rgba(136, 117, 255, .4);
}
.peephole-label { position: absolute; left: 0; right: 0; bottom: -26px; text-align: center; font-family: var(--mono); font-size: 11px; color: var(--label); }
.card-detail-solo { grid-template-columns: minmax(0, 1fr); padding-top: 8px; }
.card-detail-solo .card-detail-text { max-width: 720px; }
/* Wide screens: window on the left, text on the right. */
@media (min-width: 1100px) {
  .nv-detail { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 40px; align-items: start; }
  .nv-detail .peephole { width: 100%; }
  .nv-detail .card-detail-solo { padding-top: 24px; }
}
.card-detail-text { display: flex; flex-direction: column; gap: 18px; justify-content: space-between; }
.card-detail-text p { margin: 0; font-size: 17px; line-height: 1.55; color: var(--text-2); text-wrap: pretty; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 20px; margin: 0; font-family: var(--mono); font-size: 12px; }
.facts dt { color: var(--label); }
.facts dd { margin: 0; color: var(--text-2); }
.pills { display: flex; flex-wrap: wrap; gap: 10px; }
.pill { padding: 10px 16px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .18); color: var(--text); font-size: 14px; white-space: nowrap; }
.pill-fill { background: var(--c); border-color: var(--c); color: var(--ink); font-weight: 500; }
.pill-fill:hover { color: var(--ink); filter: brightness(1.1); }

/* About */
.about { min-height: 70vh; box-sizing: border-box; }
.about-body { display: flex; flex-direction: column; gap: 36px; max-width: 560px; pointer-events: auto; }
.about-text { margin: 0; font-size: clamp(17px, 1.6vw, 20px); line-height: 1.55; color: var(--text-2); text-wrap: pretty; }
.topics-wrap { display: flex; flex-direction: column; gap: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; max-height: 86px; overflow: hidden; }
.chip {
  display: flex; align-items: center; gap: 9px; height: 38px; box-sizing: border-box;
  padding: 0 15px; max-width: 100%; white-space: nowrap; cursor: pointer;
  border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--glass);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-size: 15px; color: var(--text-2);
  transition: border-color .2s, color .2s;
}
.chip:hover { border-color: rgba(255, 255, 255, .42); color: #fff; }
.chip.open { border-color: var(--c); }
.chip-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); }
.chip-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.chip-when { font-family: var(--mono); font-size: 11px; color: var(--label); }
.list-panel { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; padding: 12px 14px; border-radius: 14px; }
.list-panel .label { font-size: 11px; color: var(--label-2); padding-bottom: 4px; }

/* Lists of memories (chip panel, timeline, bar) */
.mem-list { display: flex; flex-direction: column; gap: 2px; }
.mem {
  display: flex; align-items: center; gap: 10px; padding: 7px 8px; margin: 0 -8px;
  border: 0; border-radius: 8px; background: transparent; color: var(--text-2);
  font-size: 15px; text-align: left; cursor: pointer; min-width: 0;
}
.mem:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.mem-title { flex: 1; min-width: 0; }
.mem-private { cursor: default; color: var(--faint); font-family: var(--mono); font-size: 12px; }
.mem-private:hover { color: var(--text-2); }
.mem-date { flex: none; font-family: var(--mono); font-size: 11px; color: var(--label-2); }

/* Timeline */
.tl { position: relative; width: 100%; max-width: 600px; pointer-events: auto; padding-top: 8px; }
.tl-track { position: absolute; left: 28px; top: 14px; bottom: 40px; width: 1px; margin-left: -.5px; background: rgba(255, 255, 255, .1); }
.tl-fill {
  position: absolute; left: 28px; top: 14px; width: 3px; margin-left: -1.5px; border-radius: 3px;
  height: 0; max-height: calc(100% - 54px);
  background: linear-gradient(180deg, #ffa24a, #3fbf5f 35%, #56b7fc 65%, #2e80fc);
  box-shadow: 0 0 12px rgba(86, 183, 252, .55);
  transition: height .2s linear;
}
.tl-rows { position: relative; display: flex; flex-direction: column; gap: 120px; }
.tl-row { --k: 0; position: relative; display: grid; grid-template-columns: 56px minmax(0, 1fr); }
.tl-branch {
  position: absolute; left: 28px; top: 12px; width: 52px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--c), transparent);
  transform-origin: left; transform: scaleX(var(--k)); transition: transform .25s ease-out;
}
.tl-dot { grid-column: 1; grid-row: 1; justify-self: center; position: relative; width: 13px; height: 13px; margin-top: 6px; }
.tl-core {
  position: absolute; inset: 0; border-radius: 50%; background: var(--c);
  box-shadow: 0 0 0 4px var(--bg), 0 0 16px var(--c);
  transform: scale(calc(.4 + .6 * var(--k))); transition: transform .3s cubic-bezier(.3, 1.6, .5, 1);
}
.tl-ring { position: absolute; inset: 0; border-radius: 50%; border: 1px solid var(--c); opacity: 0; }
.tl-row.active .tl-ring { animation: tlRing 2s ease-out infinite; }
@keyframes tlRing { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(3.2); opacity: 0; } }
.tl-body {
  grid-column: 2; grid-row: 1; display: flex; flex-direction: column; gap: 6px; padding-left: 36px;
  opacity: var(--k); transform: translateX(calc((1 - var(--k)) * -20px));
  transition: opacity .35s ease-out, transform .35s ease-out;
}
.tl-date { font-family: var(--mono); font-size: 13px; padding-top: 4px; color: var(--faint); }
.tl-date-now { color: #8fb6ff; }
.tl-title { font-size: 22px; font-weight: 500; text-wrap: balance; }
.tl-line { font-size: 16px; color: var(--muted); line-height: 1.5; text-wrap: pretty; }
.tl-more {
  align-self: flex-start; margin-top: 6px; padding: 4px 0; border: 0; background: transparent; cursor: pointer;
  color: var(--faint); font-family: var(--mono); font-size: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .18);
}
.tl-more:hover { color: #fff; border-bottom-color: #fff; }
.tl-body .mem-list { padding-top: 10px; }
.tl-body .mem { margin: 0 0 0 -8px; }
.tl-body .mem-title { flex: 0 1 auto; }
.tl-end { display: flex; flex-direction: column; align-items: center; width: 56px; gap: 9px; padding-top: 8px; opacity: 0; transition: opacity .5s; }
.tl-end.on { opacity: 1; }
.tl-end span { border-radius: 50%; background: #2e80fc; }
.tl-end span:nth-child(1) { width: 5px; height: 5px; opacity: .7; }
.tl-end span:nth-child(2) { width: 4px; height: 4px; opacity: .45; }
.tl-end span:nth-child(3) { width: 3px; height: 3px; opacity: .25; }

/* Contact */
.contact { padding-top: 120px; padding-bottom: 64px; gap: 40px; }
.email {
  pointer-events: auto; align-self: flex-start; max-width: 100%;
  font-size: clamp(22px, 6.4vw, 96px); font-weight: 700; letter-spacing: -.04em; line-height: 1;
  color: var(--text); border-bottom: 3px solid var(--violet); padding-bottom: 6px;
}
.email:hover { color: var(--link); }
.social { display: flex; flex-wrap: wrap; gap: 12px; pointer-events: auto; font-family: var(--mono); font-size: 14px; }
.social a { padding: 10px 18px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .16); background: rgba(13, 12, 40, .6); color: var(--text-2); }
.social a:hover { border-color: var(--violet); color: #fff; }
.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 56px; font-family: var(--mono); font-size: 12px; color: var(--label-2); }

/* Hover tooltip */
.tip {
  position: fixed; left: 0; top: 0; z-index: 6; pointer-events: none; will-change: transform;
  max-width: 260px; display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 12px;
  background: rgba(13, 12, 40, .88);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, .12);
}
.tip-title { font-size: 15px; font-weight: 500; line-height: 1.3; text-wrap: pretty; }

/* Bottom bar for the selected memory */
.bar { position: fixed; left: 0; top: 0; z-index: 7; will-change: transform; }
.bar-glass {
  display: flex; flex-direction: column; border-radius: 16px; overflow: hidden;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-color: var(--line-2);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}
.bar-panel-inner {
  display: flex; flex-direction: column; gap: 8px; padding: 16px 20px 12px;
  border-bottom: 1px solid var(--line); opacity: 0; transition: opacity .3s;
}
.bar-panel.open .bar-panel-inner { opacity: 1; }
.bar-panel-head { font-size: 11px; color: var(--label-2); }
.bar-all {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 2px 20px; max-height: 200px; overflow-y: auto;
}
.bar-all .mem { font-size: 14px; padding: 6px 8px; }
.bar-all .mem-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row { display: flex; align-items: center; gap: 20px; padding: 12px 14px 12px 20px; }
.bar-head { flex: none; max-width: 38%; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.bar-title { font-size: 16px; font-weight: 500; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-meta { flex-wrap: nowrap; white-space: nowrap; overflow: hidden; }
.bar-links {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; overflow: hidden;
  border-left: 1px solid var(--line); padding-left: 18px;
}
.bar-links .label { flex: none; font-size: 11px; color: var(--label-2); }
.link-chip {
  flex: none; min-width: 140px; max-width: 220px; display: flex; align-items: center; gap: 7px;
  padding: 6px 11px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .12);
  background: transparent; color: var(--text-2); font-size: 13px; white-space: nowrap; cursor: pointer;
}
.link-chip:hover { border-color: rgba(255, 255, 255, .4); color: #fff; }
.link-chip span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.bar-more {
  flex: none; display: flex; align-items: center; gap: 6px; padding: 6px 2px; border: 0; background: transparent;
  color: var(--faint); font-family: var(--mono); font-size: 12px; cursor: pointer; white-space: nowrap;
}
.bar-more:hover { color: #fff; }
.bar-arrow { display: inline-block; transition: transform .35s var(--ease); }
.bar-panel.open ~ .bar-row .bar-arrow { transform: rotate(180deg); }
.close {
  flex: none; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-2);
  background: transparent; color: var(--muted); cursor: pointer; font-size: 13px;
}
.close:hover { color: #fff; border-color: var(--violet); }

/* Phones */
@media (max-width: 600px) {
  .nav { padding: 14px 16px; gap: 12px; }
  .logo { font-size: 17px; }
  .nav-links { gap: 12px; font-size: 12px; }
  .section { padding-top: 72px; padding-bottom: 72px; }
  .card { padding: 20px; }
  .tl-rows { gap: 88px; }
  .bar-row { gap: 12px; padding: 10px 10px 10px 14px; }
  .bar-head { flex: 1; max-width: none; }
  .bar-links { display: none; }
}
@media (max-width: 400px) {
  .nav-links a[href="#experience"] { display: none; }
}
