:root {
  --bg: #06080a;
  --bg2: #0b0f13;
  --ink: #e6ecef;
  --mute: #7d8992;
  --line: rgba(214, 232, 244, .12);
  --acc: #c6f432;
  --acc-dim: rgba(198, 244, 50, .14);
  --plate: #d9dee1;
  --display: "Archivo", "Arial Narrow", sans-serif;
  --mono: "Martian Mono", ui-monospace, monospace;
  --pad: clamp(16px, 4vw, 56px);
  --ease: cubic-bezier(.2, .7, .1, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 var(--display);
  font-stretch: 100%;
  cursor: crosshair;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a, button, summary, .card { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
::selection { background: var(--acc); color: var(--bg); }
:focus-visible { outline: 1px solid var(--acc); outline-offset: 4px; }

.mono { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.dim { color: var(--mute); }
.label { color: var(--acc); margin-bottom: 28px; }

/* ---------- atmosphere ---------- */
.grain {
  position: fixed; inset: -50%; z-index: 90; pointer-events: none; opacity: .06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1s steps(4) infinite;
}
@keyframes grain { 25% { transform: translate(3%, -2%) } 50% { transform: translate(-2%, 3%) } 75% { transform: translate(2%, 1%) } }

.reticle {
  position: fixed; left: 0; top: 0; z-index: 95; pointer-events: none;
  width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border: 1px solid rgba(198, 244, 50, .55); border-radius: 50%;
  transition: translate .12s linear, width .25s var(--ease), height .25s var(--ease), margin .25s var(--ease), background .25s;
  opacity: 0;
}
.reticle span {
  position: absolute; left: 100%; top: 100%; margin: 4px 0 0 4px;
  font: 9px/1 var(--mono); letter-spacing: .1em; color: var(--acc); white-space: nowrap;
}
.reticle.is-on { opacity: 1; }
.reticle.is-big { width: 64px; height: 64px; margin: -32px 0 0 -32px; background: var(--acc-dim); }
@media (pointer: coarse) { .reticle { display: none; } }

/* ---------- boot ---------- */
.boot {
  position: fixed; inset: 0; z-index: 100; background: var(--bg);
  display: grid; place-items: center; transition: opacity .5s, visibility .5s;
}
.boot.is-done { opacity: 0; visibility: hidden; }
.boot__log { position: absolute; left: var(--pad); bottom: 64px; font: 10px/1.9 var(--mono); color: var(--mute); text-transform: uppercase; }
.boot__log b { color: var(--acc); font-weight: 400; }
.boot__pct { font: 800 clamp(64px, 14vw, 180px)/1 var(--display); font-stretch: 125%; font-variant-numeric: tabular-nums; }
.boot__pct span { color: var(--ink); }
.boot__bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--line); }
.boot__bar i { display: block; height: 100%; width: 0; background: var(--acc); }

/* ---------- HUD header ---------- */
.hud {
  position: fixed; inset: 0 0 auto; z-index: 80;
  display: flex; align-items: center; gap: 24px;
  padding: 14px var(--pad);
  background: linear-gradient(var(--bg), rgba(6, 8, 10, .6) 70%, transparent);
  backdrop-filter: blur(6px);
}
.hud__id { display: flex; align-items: center; gap: 10px; font-size: 14px; white-space: nowrap; }
.hud__id svg { color: var(--acc); transition: transform .5s var(--ease); }
.hud__id:hover svg { transform: rotate(90deg); }
.hud__id .dim { font-size: 13px; }
.hud__mid { display: flex; gap: 28px; margin: 0 auto; color: var(--mute); font-variant-numeric: tabular-nums; }
.hud__mid span span { color: var(--ink); }
.hud__nav { display: flex; gap: 6px; }
.hud__nav a {
  font: 500 13px/1 var(--display); padding: 9px 12px; border-radius: 3px;
  transition: background .2s, color .2s;
}
.hud__nav a:hover { background: rgba(230, 236, 239, .08); }
.hud__nav .hud__cta { background: var(--ink); color: var(--bg); }
.hud__nav .hud__cta:hover { background: var(--acc); }
.hud__menu { display: none; margin-left: auto; background: rgba(230, 236, 239, .1); color: var(--ink); border: 0; padding: 9px 14px; border-radius: 3px; }
.hud__progress { position: absolute; left: 0; bottom: 0; height: 1px; width: 100%; background: var(--acc); transform-origin: 0; transform: scaleX(0); }

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: 100svh; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 120px var(--pad) 32px;
}
#cloud { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero::after { /* vignette */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(6,8,10,.85) 100%), linear-gradient(transparent 75%, var(--bg));
}
.hero > *:not(canvas) { position: relative; z-index: 2; }
.hero__corners { position: absolute !important; inset: 84px var(--pad) 24px; pointer-events: none; }
.hero__corners i { position: absolute; width: 18px; height: 18px; border: 1px solid var(--mute); }
.hero__corners i:nth-child(1) { left: 0; top: 0; border-width: 1px 0 0 1px; }
.hero__corners i:nth-child(2) { right: 0; top: 0; border-width: 1px 1px 0 0; }
.hero__corners i:nth-child(3) { left: 0; bottom: 0; border-width: 0 0 1px 1px; }
.hero__corners i:nth-child(4) { right: 0; bottom: 0; border-width: 0 1px 1px 0; }
.hero__tag { position: absolute !important; top: 104px; left: calc(var(--pad) + 28px); color: var(--mute); }
.blink { color: var(--acc); animation: blink 1.2s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0 } }

.hero__name {
  margin: 0; font-weight: 800; font-stretch: 125%;
  font-size: clamp(52px, 13vw, 230px); line-height: .84; letter-spacing: -.035em;
  text-transform: uppercase;
}
.hero__sub { margin: 28px 0 6px; font-size: clamp(18px, 2vw, 26px); font-weight: 300; max-width: 30ch; }
.hero__sub em { font-style: normal; color: var(--acc); }
.hero__type { color: var(--mute); margin: 0 0 48px; font-size: 12px; }
.hero__type span:first-child { color: var(--ink); }
.caret { color: var(--acc); animation: blink .9s steps(2) infinite; }
.hero__readouts { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.hero__readouts > * { padding: 16px 0; display: flex; flex-direction: column; gap: 6px; }
.hero__readouts > * + * { padding-left: 20px; border-left: 1px solid var(--line); }
.hero__scroll { justify-content: flex-end; text-align: right; color: var(--acc); animation: bob 2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(4px) } }

/* ---------- shared section ---------- */
section:not(.hero) { padding: clamp(96px, 14vw, 180px) var(--pad); position: relative; }
.head { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; margin-bottom: clamp(48px, 7vw, 96px); border-bottom: 1px solid var(--line); padding-bottom: 20px; }
.head .label { margin: 0; }
h2 { margin: 0; font-weight: 800; font-stretch: 125%; font-size: clamp(40px, 7vw, 104px); line-height: .9; letter-spacing: -.03em; text-transform: uppercase; }
h3 { margin: 0 0 18px; font-weight: 600; font-stretch: 110%; font-size: clamp(24px, 2.8vw, 40px); line-height: 1.05; letter-spacing: -.02em; }
p { margin: 0 0 16px; color: #b7c1c7; }

.rv { opacity: 0; transform: translateY(40px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.rv.is-in { opacity: 1; transform: none; }

/* ---------- manifesto ---------- */
.manifesto__text {
  font-size: clamp(28px, 4.4vw, 68px); line-height: 1.08; letter-spacing: -.025em; font-weight: 500;
  color: var(--ink); max-width: 22ch; margin: 0 0 clamp(64px, 10vw, 140px);
}
.manifesto__text .w { opacity: .14; transition: opacity .4s; }
.manifesto__text .w.on { opacity: 1; }
.specs { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.spec { padding: 40px 24px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.spec + .spec { border-left: 1px solid var(--line); }
.spec:nth-child(2) { transition-delay: .1s } .spec:nth-child(3) { transition-delay: .2s } .spec:nth-child(4) { transition-delay: .3s }
.spec b { font-size: clamp(40px, 5vw, 72px); font-weight: 300; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.spec span { color: var(--acc); font-size: 10px; }
.spec small { color: var(--mute); font-size: 13px; }

/* ---------- marquee ---------- */
.marquee { overflow: hidden; border-block: 1px solid var(--line); padding: 18px 0; color: var(--mute); }
.marquee__track { display: flex; width: max-content; animation: marquee 50s linear infinite; }
.marquee span { padding: 0 28px; position: relative; }
.marquee span::after { content: "◆"; position: absolute; right: -6px; color: var(--acc); font-size: 7px; top: 2px; }
@keyframes marquee { to { transform: translateX(-50%) } }

/* ---------- research ---------- */
.mission {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: center;
  padding: clamp(48px, 7vw, 96px) 0; border-bottom: 1px solid var(--line);
}
.mission:nth-of-type(even) .frame { order: -1; }
.mission__id { color: var(--acc); margin-bottom: 20px; }
.mission__body p { max-width: 58ch; }
.mission__body b { color: var(--ink); font-weight: 600; }
.frame.frame--wide { grid-column: 1 / -1; aspect-ratio: 1600 / 905; }
.tags { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { border: 1px solid var(--line); padding: 6px 10px; border-radius: 2px; font-size: 10px; color: var(--mute); }
.btn {
  display: inline-flex; gap: 12px; align-items: center; margin-top: 28px;
  font: 500 14px/1 var(--display); padding: 14px 20px; border: 1px solid var(--ink); border-radius: 2px;
  transition: background .25s, color .25s, border-color .25s;
}
.btn span { transition: transform .25s var(--ease); }
.btn:hover { background: var(--acc); color: var(--bg); border-color: var(--acc); }
.btn:hover span { transform: translate(3px, -3px); }

.more { margin-top: 20px; border-top: 1px solid var(--line); }
.more summary { list-style: none; padding: 14px 0; color: var(--acc); }
.more summary::-webkit-details-marker { display: none; }
.more summary::before { content: "+ "; }
.more[open] summary::before { content: "− "; }
.more p { font-size: 15px; }
.more b { color: var(--ink); font-weight: 600; }

/* framed figure with HUD brackets + scan line */
.frame {
  position: relative; margin: 0; background: var(--plate); aspect-ratio: 4 / 3.4;
  display: grid; place-items: center; padding: 8%; overflow: hidden;
  background-image: linear-gradient(rgba(0,0,0,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(0,0,0,.06) 1px, transparent 1px);
  background-size: 28px 28px;
}
.frame--dark { background-color: #12171c; background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); }
.frame img { max-height: 100%; width: auto; object-fit: contain; transition: transform 1.2s var(--ease); }
.frame:hover img { transform: scale(1.04); }
.frame--cover { padding: 0; aspect-ratio: 4 / 3; }
.frame--cover img { width: 100%; height: 100%; max-height: none; object-fit: cover; }
.frame::before, .frame::after { content: ""; position: absolute; width: 22px; height: 22px; border: 2px solid var(--acc); z-index: 2; }
.frame::before { left: 10px; top: 10px; border-width: 2px 0 0 2px; }
.frame::after { right: 10px; bottom: 10px; border-width: 0 2px 2px 0; }
.frame figcaption {
  position: absolute; left: 12px; bottom: 12px; z-index: 2; font-size: 9px;
  background: var(--bg); color: var(--acc); padding: 5px 8px;
}
.frame .scan, .card__media .scan {
  position: absolute; left: 0; right: 0; height: 30%; top: -30%; pointer-events: none; z-index: 1;
  background: linear-gradient(transparent, rgba(198, 244, 50, .22) 90%, var(--acc));
  mix-blend-mode: multiply; animation: scan 4.5s var(--ease) infinite;
}
.frame--dark .scan, .card__media .scan { mix-blend-mode: screen; background: linear-gradient(transparent, rgba(198, 244, 50, .12) 90%, var(--acc)); }
@keyframes scan { 0% { top: -30% } 60%, 100% { top: 100% } }

/* ---------- projects ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 32px; }
.filters button {
  font: inherit; color: var(--mute); background: transparent; border: 1px solid var(--line);
  padding: 10px 14px; border-radius: 2px; transition: color .2s, border-color .2s, background .2s;
}
.filters button sup { color: var(--acc); margin-left: 4px; font-size: 8px; }
.filters button:hover { color: var(--ink); border-color: var(--mute); }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.card {
  position: relative; background: var(--bg); padding: 14px; display: flex; flex-direction: column; gap: 16px;
  text-align: left; color: inherit; font: inherit; border: 0;
  animation: cardIn .6s var(--ease) both;
}
.card[hidden] { display: none; }
@keyframes cardIn { from { opacity: 0; transform: translateY(16px) } }
.card__media { position: relative; aspect-ratio: 4 / 3; background: var(--bg2); overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease), filter .5s; filter: grayscale(.85) brightness(.85); }
.card__media .scan { animation-play-state: paused; opacity: 0; }
.card:hover .card__media img, .card:focus-visible .card__media img { transform: scale(1.06); filter: none; }
.card:hover .scan, .card:focus-visible .scan { opacity: 1; animation-play-state: running; }
.card__meta { display: flex; justify-content: space-between; color: var(--mute); }
.card__meta b { color: var(--acc); font-weight: 400; }
.card h3 { font-size: 24px; margin: 0; display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.card h3 i { font-style: normal; font-size: 20px; color: var(--mute); transition: transform .3s var(--ease), color .3s; }
.card:hover h3 i { transform: translate(4px, -4px); color: var(--acc); }
.card::after { /* corner light */
  content: ""; position: absolute; inset: 0; pointer-events: none; border: 1px solid transparent; transition: border-color .3s;
}
.card:hover::after { border-color: rgba(198, 244, 50, .5); }

/* ---------- dossier dialog ---------- */
.dossier {
  width: min(1100px, 100% - 24px); max-height: calc(100% - 24px); padding: 0; margin: auto;
  background: var(--bg2); color: var(--ink); border: 1px solid var(--line); border-radius: 0; overflow: auto; overscroll-behavior: contain;
}
body:has(.dossier[open]) { overflow: hidden; }
.dossier[open] { animation: dIn .5s var(--ease); }
.dossier::backdrop { background: rgba(3, 4, 5, .78); backdrop-filter: blur(8px); }
@keyframes dIn { from { opacity: 0; transform: translateY(30px) scale(.98) } }
.dossier__bar {
  position: sticky; top: 0; z-index: 3; display: flex; justify-content: space-between; align-items: center;
  padding: 14px clamp(18px, 4vw, 48px); background: var(--bg2); border-bottom: 1px solid var(--line); color: var(--acc);
}
.dossier__close { font: inherit; letter-spacing: inherit; background: none; border: 1px solid var(--line); color: var(--ink); padding: 8px 12px; }
.dossier__close:hover { border-color: var(--acc); color: var(--acc); }
.dossier__actions { display: flex; gap: 8px; }
.dossier__close[hidden] { display: none; }
.dossier__sub a { color: var(--acc); border-bottom: 1px solid; }
.pages { display: flex; flex-direction: column; gap: 14px; }
.page { width: 100%; background: #fff; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.page canvas { display: block; width: 100%; height: auto; }
.dossier__inner { padding: clamp(28px, 5vw, 64px) clamp(18px, 4vw, 48px) clamp(40px, 6vw, 80px); }
.dossier h2 { font-size: clamp(34px, 5.5vw, 72px); margin: 14px 0 12px; }
.dossier__sub { font-size: clamp(17px, 1.6vw, 21px); color: var(--mute); margin-bottom: clamp(32px, 5vw, 56px); }
.dossier h4 { font: 500 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--acc); margin: clamp(40px, 6vw, 72px) 0 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.dossier__hero { aspect-ratio: 1100 / 829; margin-bottom: 8px; }
.block { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(20px, 4vw, 48px); align-items: center; padding: 24px 0; border-top: 1px solid var(--line); }
.block:nth-child(even) .frame { order: 2; }
.block .frame { aspect-ratio: auto; min-height: 260px; padding: 28px; }
.block p { font-size: 16px; }
.block b { color: var(--ink); font-weight: 600; }
.block--text { grid-template-columns: 1fr; }
.block .idx { color: var(--mute); margin-bottom: 10px; display: block; }

/* ---------- education ---------- */
.edu { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.edu__item { background: var(--bg); padding: clamp(24px, 4vw, 48px); }
.edu__item .dim { margin-bottom: 18px; }
.edu__item:nth-child(2) { transition-delay: .15s; }
.edu__badge { color: var(--acc); margin-bottom: 28px; }
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { font-size: 10px; padding: 7px 10px; background: rgba(230, 236, 239, .05); border-radius: 2px; color: #b7c1c7; transition: background .2s, color .2s; }
.chips li:hover { background: var(--acc); color: var(--bg); }
.langs { display: flex; flex-wrap: wrap; gap: 8px 28px; align-items: baseline; margin-top: 48px; font-size: clamp(20px, 2.4vw, 32px); font-weight: 300; }

/* ---------- contact ---------- */
.contact { min-height: 75svh; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.contact::before { /* faint radar */
  content: ""; position: absolute; right: -20vw; top: 50%; width: 80vw; aspect-ratio: 1; translate: 0 -50%; border-radius: 50%; pointer-events: none;
  background: repeating-radial-gradient(circle, transparent 0 59px, var(--line) 60px), conic-gradient(from 0deg, var(--acc-dim), transparent 25%);
  mask: radial-gradient(circle, #000 30%, transparent 70%); animation: spin 8s linear infinite;
}
@keyframes spin { to { rotate: 360deg } }
.contact__big {
  position: relative; display: flex; flex-direction: column; width: fit-content;
  font-weight: 800; font-stretch: 125%; text-transform: uppercase;
  font-size: clamp(56px, 13vw, 220px); line-height: .86; letter-spacing: -.04em;
}
.contact__big span { display: block; background: linear-gradient(90deg, var(--acc) 50%, var(--ink) 50%) 100% 0 / 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; transition: background-position .7s var(--ease); }
.contact__big span:nth-child(2) { transition-delay: .08s; }
.contact__big:hover span { background-position: 0 0; }
.contact__big i { font-style: normal; font-size: .45em; vertical-align: top; margin-left: .1em; }
.contact__links { position: relative; display: flex; flex-wrap: wrap; gap: 12px 40px; margin-top: 48px; font-size: 12px; }
.contact__links a { border-bottom: 1px solid var(--line); padding-bottom: 6px; transition: color .2s, border-color .2s; text-transform: none; }
.contact__links a:hover { color: var(--acc); border-color: var(--acc); }

.foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 24px var(--pad); border-top: 1px solid var(--line); color: var(--ink); }
.foot a:hover { color: var(--acc); }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .hud__mid { display: none; }
  .hud__menu { display: block; }
  .hud__nav {
    position: absolute; top: 100%; right: var(--pad); flex-direction: column; min-width: 200px;
    background: var(--bg2); border: 1px solid var(--line); padding: 6px;
    opacity: 0; visibility: hidden; transform: translateY(-6px); transition: .25s var(--ease);
  }
  .hud__nav.is-open { opacity: 1; visibility: visible; transform: none; }
  .hud__nav a { padding: 14px 12px; }
  .mission, .block, .edu { grid-template-columns: 1fr; }
  .mission:nth-of-type(even) .frame, .block:nth-child(even) .frame { order: 0; }
  .specs { grid-template-columns: 1fr 1fr; }
  .spec:nth-child(3) { border-left: 0; }
  .spec:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .hud__id .dim { display: none; }
  .hero__tag { left: calc(var(--pad) + 12px); font-size: 9px; }
  .hero__readouts { grid-template-columns: 1fr 1fr; }
  .hero__readouts > *:nth-child(3) { padding-left: 0; border-left: 0; }
  .hero__readouts > *:nth-child(n+3) { border-top: 1px solid var(--line); }
  .spec { padding: 28px 8px; }
  .frame:not(.frame--cover) { aspect-ratio: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .rv { opacity: 1; transform: none; }
  .manifesto__text .w { opacity: 1; }
}
