:root {
  --ink: #05060f;
  --ink-2: #0d1024;
  --paper: #f1ede6;
  --dust: #a3a7bd;
  --hair: rgba(241, 237, 230, 0.14);
  --hair-2: rgba(241, 237, 230, 0.3);
  --sun: #fff1d6;
  --panel-w: min(460px, 38vw);
  --sans: "Manrope", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.2, .7, .1, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  background: radial-gradient(120% 90% at 50% 45%, #0c0d24 0%, var(--ink) 62%, #020208 100%);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  touch-action: none;
  overscroll-behavior: none;
}
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--sun); outline-offset: 3px; border-radius: 3px; }

#sky { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#world { position: fixed; inset: 0; overflow: hidden; cursor: grab; }
#world.dragging { cursor: grabbing; }

.grain {
  position: fixed; inset: -50%; z-index: 8; pointer-events: none;
  opacity: .07; mix-blend-mode: overlay;
  background-size: 160px 160px;
}

/* ---------- atoms ---------- */
.nucleus {
  position: absolute; left: 0; top: 0; z-index: 3;
  display: block; border-radius: 50%;
  will-change: transform;
  -webkit-tap-highlight-color: transparent;
}
.nucleus canvas { width: 100%; height: 100%; display: block; pointer-events: none; }
.nucleus:hover canvas { filter: brightness(1.12) saturate(1.1); }
.nucleus { transition: opacity .6s; }
.nucleus.dim { opacity: .25; pointer-events: none; }

.node {
  position: absolute; left: 0; top: 0;
  overflow: hidden;
  background: var(--c, #888);
  will-change: transform;
  transition: opacity .5s var(--ease), box-shadow .3s;
  box-shadow: 0 0 6px -1px var(--c, transparent);
}
.node img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  opacity: 0; transition: opacity .5s;
  pointer-events: none; user-select: none; -webkit-user-drag: none;
}
.node img.ready { opacity: 1; }
.node.dim { opacity: .08; pointer-events: none; }
.node.big { box-shadow: 0 8px 30px rgba(0,0,0,.5); }
.node.big:hover, .node.big:focus-visible { box-shadow: 0 0 0 2px var(--sun), 0 12px 40px rgba(0,0,0,.6); z-index: 7 !important; }

/* ---------- labels in the world ---------- */
.label {
  position: absolute; left: 0; top: 0; z-index: 5;
  white-space: nowrap;
  text-decoration: none;
  transition: opacity .4s;
  will-change: transform;
}
.label.hide { opacity: 0; pointer-events: none; }
.planet-label {
  text-align: center;
  padding: 4px 10px;
  text-shadow: 0 1px 14px var(--ink), 0 0 2px var(--ink);
}
.planet-label span { display: block; font-size: 21px; font-weight: 600; letter-spacing: -0.01em; }
.planet-label small { display: block; font-size: 13px; color: var(--dust); margin-top: 1px; }
.planet-label:hover span { color: #fff; }
.project-label {
  font-size: 15px;
  font-weight: 600;
  padding: 3px 8px;
  text-shadow: 0 1px 10px var(--ink), 0 0 2px var(--ink);
}
.project-label::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--g); margin-right: 8px; vertical-align: 2px; box-shadow: 0 0 8px var(--g);
}
.sun-hit { border-radius: 50%; }

.sun-text {
  position: absolute; left: 0; top: 0; z-index: 5;
  width: min(520px, calc(100vw - 48px));
  text-align: center;
  transition: opacity .5s;
  will-change: transform;
  text-shadow: 0 1px 16px var(--ink);
}
.sun-text.hide { opacity: 0; pointer-events: none; }
.sun-text p { margin: 0; }
.sun-intro { font-size: 14px; color: var(--dust); }
.sun-lede { font-size: 20px; line-height: 1.45; font-weight: 500; letter-spacing: -0.01em; margin: 10px 0 14px !important; }
.sun-more {
  display: inline-block; font-size: 14.5px; font-weight: 600; text-decoration: none;
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--hair-2);
  background: rgba(5, 6, 15, .35);
}
.sun-more:hover { background: var(--paper); color: var(--ink); text-shadow: none; }

/* ---------- chrome ---------- */
.top {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 24px 30px;
  pointer-events: none;
  z-index: 10;
}
.top > * { pointer-events: auto; }
.mark { text-decoration: none; display: block; }
.mark-name { display: block; font-size: 24px; line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; }
.mark-sub { display: block; font-size: 14px; color: var(--dust); margin-top: 4px; }
.topnav { display: flex; gap: 24px; font-size: 15px; font-weight: 500; padding-top: 4px; }
.topnav a { text-decoration: none; color: var(--paper); opacity: .85; border-bottom: 1.5px solid transparent; padding-bottom: 2px; }
.topnav a:hover, .topnav a[aria-current="page"] { opacity: 1; border-bottom-color: var(--paper); }

.crumbs {
  position: fixed; left: 30px; bottom: 26px; z-index: 10;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  font-size: 14.5px; color: var(--dust);
  max-width: calc(100vw - 220px);
  transition: opacity .3s;
}
.crumbs a { color: var(--dust); text-decoration: none; }
.crumbs a:hover { color: var(--paper); }
.crumbs span[aria-current] { color: var(--paper); font-weight: 600; }
.crumbs .sep { width: 18px; height: 1px; background: var(--hair-2); display: inline-block; }

.hint {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  margin: 0; font-size: 14.5px; color: var(--dust); z-index: 9;
  transition: opacity .8s; pointer-events: none; text-align: center;
}
.hint.gone { opacity: 0; }

.zoom {
  position: fixed; right: 30px; bottom: 22px; z-index: 10;
  display: flex; align-items: center; gap: 2px;
  border: 1px solid var(--hair); border-radius: 999px;
  background: rgba(5, 6, 15, .55);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: right .5s var(--ease), opacity .3s;
}
.zoom button { width: 38px; height: 38px; font-size: 20px; line-height: 1; border-radius: 50%; color: var(--paper); }
.zoom button:hover { background: rgba(241,237,230,.08); }
.scale { font-size: 12.5px; color: var(--dust); min-width: 62px; text-align: center; font-variant-numeric: tabular-nums; }
body.has-panel .zoom { right: calc(var(--panel-w) + 30px); }

/* ---------- side panel ---------- */
.panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: var(--panel-w);
  z-index: 20;
  background: linear-gradient(180deg, rgba(12, 13, 34, .88), rgba(5, 6, 15, .94));
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-left: 1px solid var(--hair);
  transform: translateX(100%);
  transition: transform .6s var(--ease);
  display: flex; flex-direction: column;
}
.panel.open { transform: none; }
.panel-grab { display: none; }
.panel-close {
  position: absolute; top: 20px; right: 20px; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; color: var(--dust); z-index: 2;
}
.panel-close:hover { color: var(--paper); background: rgba(241,237,230,.08); }
.panel-body {
  overflow-y: auto; padding: 76px 40px 44px; flex: 1;
  overscroll-behavior: contain; touch-action: pan-y;
  scrollbar-width: thin; scrollbar-color: var(--hair-2) transparent;
}
.kicker { display: flex; align-items: center; gap: 10px; font-size: 14.5px; font-weight: 500; color: var(--dust); margin: 0 0 12px; }
.kicker i { width: 10px; height: 10px; border-radius: 50%; background: var(--g); box-shadow: 0 0 12px var(--g); }
.kicker a { color: var(--dust); text-decoration: none; }
.kicker a:hover { color: var(--paper); }
.panel h1 {
  font-weight: 700;
  font-size: clamp(32px, 2.9vw, 42px); line-height: 1.08; letter-spacing: -0.025em;
  margin: 0 0 22px;
}
.panel h2 { font-weight: 700; font-size: 17px; letter-spacing: -0.01em; margin: 34px 0 12px; }
.panel p { margin: 0 0 1em; max-width: 62ch; color: rgba(241,237,230,.86); }
.panel p.lede { font-size: 19.5px; line-height: 1.5; font-weight: 500; letter-spacing: -0.01em; color: var(--paper); }
dl.meta { display: grid; grid-template-columns: auto 1fr; gap: 6px 20px; margin: 0 0 26px; font-size: 15px; padding: 14px 0; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
dl.meta dt { color: var(--dust); }
dl.meta dd { margin: 0; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { border-top: 1px solid var(--hair); }
.list li:last-child { border-bottom: 1px solid var(--hair); }
.list a { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 13px 0; text-decoration: none; font-size: 16.5px; font-weight: 500; }
.list a:hover .t { color: #fff; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--hair-2); }
.list .n { color: var(--dust); font-size: 14px; font-weight: 400; font-variant-numeric: tabular-nums; white-space: nowrap; }
.thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 8px 0 26px; }
.thumbs button { aspect-ratio: 1; overflow: hidden; background: var(--ink-2); border-radius: 3px; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s var(--ease), opacity .3s; opacity: .92; }
.thumbs button:hover img { transform: scale(1.06); opacity: 1; }
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 30px; padding-top: 16px; border-top: 1px solid var(--hair); font-size: 14px; }
.pager a { text-decoration: none; color: var(--dust); max-width: 48%; }
.pager a:hover { color: var(--paper); }
.pager a span { display: block; font-size: 17px; font-weight: 600; color: var(--paper); margin-top: 2px; }
.pager a.next { text-align: right; margin-left: auto; }
.links { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 15.5px; font-weight: 500; }
.links a { text-decoration: none; border-bottom: 1px solid var(--hair-2); }
.links a:hover { border-bottom-color: var(--paper); }
.btn-mail {
  display: inline-block; margin: 6px 0 4px; padding: 11px 20px; border-radius: 999px;
  border: 1px solid var(--hair-2); text-decoration: none; font-size: 15.5px; font-weight: 600;
}
.btn-mail:hover { background: var(--paper); color: var(--ink); }
.cv-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 14px; padding: 10px 0; border-top: 1px solid var(--hair); font-size: 15px; }
.cv-row > span:first-child { font-weight: 600; }
.cv-row .sub { color: var(--dust); grid-column: 1; }
.cv-row .yr { color: var(--dust); grid-row: 1; grid-column: 2; font-variant-numeric: tabular-nums; font-size: 14px; }
.small { font-size: 14.5px; color: var(--dust); }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(3, 3, 10, .95);
  display: grid; place-items: center;
  opacity: 0; transition: opacity .35s;
  touch-action: pan-y;
}
.lightbox.open { opacity: 1; }
.lightbox[hidden] { display: none; }
.lb-figure { margin: 0; display: flex; flex-direction: column; align-items: center; max-width: calc(100vw - 160px); }
.lb-figure img { max-width: calc(100vw - 160px); max-height: calc(100vh - 150px); object-fit: contain; display: block; box-shadow: 0 30px 80px rgba(0,0,0,.6); background: var(--ink-2); }
.lb-figure figcaption { margin-top: 16px; font-size: 15px; color: var(--dust); text-align: center; max-width: 70ch; }
.lb-figure figcaption b { font-weight: 700; color: var(--paper); margin-right: 10px; }
.lb-btn { position: absolute; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; color: var(--paper); opacity: .8; }
.lb-btn:hover { opacity: 1; background: rgba(241,237,230,.08); }
.lb-prev { left: 24px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 24px; top: 50%; transform: translateY(-50%); }
.lb-close { top: 18px; right: 18px; }

.noscript { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; z-index: 99; background: var(--ink); }

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  :root { --panel-w: 100vw; }
  .top { padding: 16px 16px; }
  .mark-name { font-size: 21px; }
  .mark-sub { font-size: 12.5px; }
  .topnav { gap: 16px; font-size: 14.5px; padding-top: 2px; }
  .crumbs { left: 16px; bottom: 18px; font-size: 13.5px; max-width: calc(100vw - 150px); }
  .zoom { right: 16px; bottom: 12px; }
  .zoom .scale { display: none; }
  body.has-panel .zoom, body.has-panel .crumbs { opacity: 0; pointer-events: none; }
  .hint { display: none; }
  .planet-label span { font-size: 18px; }
  .planet-label small { font-size: 12px; }
  .sun-text { width: min(320px, calc(100vw - 40px)); }
  .sun-lede { font-size: 17px; }
  .sun-intro { font-size: 13px; }
  .panel {
    top: auto; left: 0; right: 0; width: 100%;
    height: var(--sheet-h, 42vh);
    border-left: 0; border-top: 1px solid var(--hair);
    border-radius: 18px 18px 0 0;
    transform: translateY(100%);
    transition: transform .6s var(--ease), height .45s var(--ease);
  }
  .panel.expanded { --sheet-h: 86vh; }
  .panel-grab { display: block; position: absolute; top: 0; left: 0; right: 60px; height: 34px; }
  .panel-grab::after { content: ""; position: absolute; top: 9px; left: calc(50% + 30px); transform: translateX(-50%); width: 40px; height: 4px; border-radius: 4px; background: var(--hair-2); }
  .panel-close { top: 10px; right: 10px; }
  .panel-body { padding: 30px 20px 30px; }
  .panel h1 { font-size: 30px; margin-bottom: 16px; }
  .panel p.lede { font-size: 18px; }
  .lb-figure, .lb-figure img { max-width: 100vw; }
  .lb-figure img { max-height: calc(100vh - 170px); }
  .lb-figure figcaption { padding: 0 16px; }
  .lb-prev, .lb-next { top: auto; bottom: 18px; transform: none; }
  .lb-prev { left: 16px; } .lb-next { right: 16px; }
}

@media (max-width: 400px) {
  .planet-label small { display: none; }
}

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

/* ---------- click zones around photo clusters ---------- */
.zone {
  z-index: 2;
  display: block;
  -webkit-tap-highlight-color: transparent;
  transition: box-shadow .3s, background-color .3s, opacity .4s;
  will-change: transform;
}
.zone:hover {
  background: radial-gradient(closest-side, color-mix(in srgb, var(--g) 16%, transparent), transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--g) 55%, transparent), 0 0 28px -8px var(--g);
}
.zone.dim { opacity: 0; pointer-events: none; }
.zone.open, .zone.open:hover { cursor: default; background: none; box-shadow: none; }
.project-label.lit { color: #fff; }
