@font-face { font-family: 'Archivo'; src: url('assets/fonts/archivo.woff2') format('woff2'); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('assets/fonts/jetbrains-mono.woff2') format('woff2'); font-weight: 100 800; font-display: swap; }

:root {
  --room: #060B14;
  --panel: #0C1420;
  --steel: #93A6BA;
  --frost: #EAF2F8;
  --current: #FF8A1E;
  --arc: #38BDF8;
  --alarm: #FF3B30;
  --line: rgba(147, 166, 186, .2);
  --sans: 'Archivo', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --gutter: clamp(20px, 5vw, 80px);
  --bar: 7vh;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--room); -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--frost); font: 400 1.0625rem/1.6 var(--sans); overflow-x: hidden; }
body.is-booting { overflow: hidden; }
h1, h2, h3, p, ol, ul { margin: 0; padding: 0; }
ol, ul { list-style: none; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--arc); outline-offset: 3px; }
section:focus { outline: none; }

.skip-link { position: fixed; left: 12px; top: -60px; z-index: 100; background: var(--frost); color: var(--room); padding: 8px 14px; }
.skip-link:focus { top: 12px; }

/* Stage layers */
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; background: var(--room);
  /* Fallback if WebGL is missing: a warm-to-cold glow instead of the world */
  background-image: radial-gradient(60vmax 40vmax at 70% 40%, rgba(255,138,30,.18), transparent 70%), radial-gradient(70vmax 50vmax at 20% 80%, rgba(56,189,248,.12), transparent 70%); }
#veil { position: fixed; inset: 0; background: var(--room); opacity: 0; pointer-events: none; }
.bar { position: fixed; left: 0; right: 0; height: var(--bar); background: #000; z-index: 5; pointer-events: none; transform: scaleY(0); }
.bar--top { top: 0; transform-origin: top; }
.bar--bottom { bottom: 0; transform-origin: bottom; }

/* Boot */
#boot { position: fixed; inset: 0; z-index: 50; background: #000; display: flex; align-items: flex-end; padding: var(--gutter); }
#boot-log { margin: 0; font: 400 clamp(11px, 1.5vw, 14px)/1.7 var(--mono); color: var(--steel); white-space: pre-wrap; }
#boot-log b { color: #4ADE80; font-weight: 400; }
#boot-log em { color: var(--current); font-style: normal; }

/* Nav */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 14px var(--gutter); }
.nav { transition: background .25s; }
.nav.is-solid { background: rgba(6, 11, 20, .9); backdrop-filter: blur(10px); }
.nav__name { font-weight: 800; font-stretch: 125%; font-size: .95rem; letter-spacing: -.01em; text-decoration: none; }
.nav nav { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 32px); font-size: .9rem; }
.nav nav a { text-decoration: none; color: var(--frost); opacity: .78; transition: opacity .2s; }
.nav nav a:hover { opacity: 1; }
.nav .nav__cta { opacity: 1; border: 1px solid rgba(234,242,248,.45); border-radius: 99px; padding: 6px 16px; transition: background .2s, color .2s; }
.nav .nav__cta:hover { background: var(--frost); color: var(--room); }

/* Film */
#film { height: 1350vh; position: relative; }
#stage { position: fixed; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; perspective: 900px; }
#stage a { pointer-events: auto; }
.beat { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; padding: calc(var(--bar) + 20px) var(--gutter); visibility: hidden; will-change: transform, opacity; }
.beat--center { align-items: center; text-align: center; background: radial-gradient(ellipse 62% 46% at 50% 50%, rgba(3,6,11,.5), transparent 75%); }
.beat--left { align-items: flex-start; text-align: left; background: linear-gradient(90deg, rgba(3,6,11,.55), transparent 62%); }
.beat__title { font-weight: 800; font-stretch: 125%; font-size: clamp(2.4rem, 7.4vw, 7.5rem); line-height: .96; letter-spacing: -.035em; text-wrap: balance; max-width: 13ch; text-shadow: 0 2px 40px rgba(0,0,0,.55); }
.beat__sub { margin-top: 1.3rem; max-width: 42ch; font-size: clamp(1rem, 1.5vw, 1.3rem); line-height: 1.45; color: var(--frost); text-shadow: 0 1px 18px rgba(0,0,0,.85); }
.word { display: inline-block; white-space: nowrap; }
.ch { display: inline-block; will-change: transform, opacity; }

.beat--hero { justify-content: center; align-items: flex-start; }
.beat--hero h1 { font-weight: 900; font-stretch: 125%; font-size: clamp(3rem, 8.6vw, 9.4rem); line-height: .9; letter-spacing: -.045em; text-shadow: 0 2px 50px rgba(0,0,0,.6); }
.beat--hero h1 .line { display: block; }
.hero__role { margin-top: 1.8rem; font-weight: 700; font-stretch: 112%; font-size: clamp(1rem, 1.6vw, 1.4rem); color: var(--current); }
.hero__intro { margin-top: .5rem; max-width: 40ch; font-size: clamp(1rem, 1.25vw, 1.15rem); line-height: 1.5; text-shadow: 0 1px 14px rgba(0,0,0,.9); }

#reticle { position: absolute; left: 50%; top: 50%; width: min(78vh, 88vw); height: min(78vh, 88vw); margin: calc(min(78vh, 88vw) / -2) 0 0 calc(min(78vh, 88vw) / -2); fill: none; stroke: var(--arc); stroke-width: 1; opacity: 0; }

.scroll-cue { position: absolute; left: var(--gutter); bottom: calc(var(--bar) + 12px); display: flex; align-items: center; gap: 12px; font-size: .9rem; color: var(--frost); }
.scroll-cue span { width: 2px; height: 34px; background: linear-gradient(var(--current), transparent); animation: cue 1.8s ease-in-out infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }
.skip-film { position: absolute; right: var(--gutter); bottom: calc(var(--bar) + 12px); font-size: .9rem; color: var(--frost); text-underline-offset: 4px; }
.film-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; }
.film-progress i { display: block; height: 100%; width: 100%; background: var(--current); transform: scaleX(0); transform-origin: left; }

/* Content */
.content { position: relative; z-index: 4; }
.sec { position: relative; z-index: 4; padding: clamp(80px, 13vh, 170px) var(--gutter); }
.sec h2 { font-weight: 800; font-stretch: 125%; font-size: clamp(2rem, 5vw, 4.6rem); line-height: 1; letter-spacing: -.03em; margin-bottom: clamp(32px, 6vh, 72px); text-wrap: balance; }

.about { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 6vw, 100px); align-items: end; min-height: 90vh; }
.about__statement { font-weight: 800; font-stretch: 125%; font-size: clamp(2rem, 4.8vw, 4.8rem); line-height: 1.02; letter-spacing: -.032em; text-wrap: balance; }
.about__body p { max-width: 58ch; color: #C7D4E0; }
.about__body p + p { margin-top: 1em; }
.about__facts { margin: 2rem 0 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 22px; font-size: .95rem; }
.about__facts dt { color: var(--steel); }
.about__facts dd { margin: 0; }

/* The rack: a real rack elevation, U numbers count up from the bottom */
.rack-wrap { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 3fr); gap: clamp(28px, 5vw, 80px); align-items: start; }
.rack { background: #03060B; border: 2px solid #1F2C3B; border-radius: 4px; padding: 10px 0; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.u { position: relative; display: grid; grid-template-columns: 44px 18px minmax(150px, 3fr) minmax(0, 7fr); gap: 14px; align-items: center; margin: 0 8px; padding: 18px 14px 18px 0; background: linear-gradient(#111A26, #0B121C); border: 1px solid #1A2533; border-bottom-color: #05090F; }
.u + .u { margin-top: 3px; }
.u__num { font: 400 .75rem var(--mono); color: var(--steel); text-align: center; border-right: 1px solid #1F2C3B; }
.u__led { width: 9px; height: 9px; border-radius: 50%; background: #1A2533; transition: background .25s, box-shadow .25s; }
.u.is-on .u__led { background: var(--current); box-shadow: 0 0 10px 2px rgba(255,138,30,.75); }
.u:hover .u__led { background: var(--arc); box-shadow: 0 0 12px 3px rgba(56,189,248,.85); }
.u__name { font-weight: 700; font-stretch: 112%; font-size: 1.02rem; line-height: 1.25; }
.u__tools { font-size: .96rem; color: #B5C4D3; line-height: 1.4; }
.certs h3 { font-weight: 700; font-stretch: 112%; font-size: 1.1rem; margin-bottom: 12px; }
.certs li { padding: 10px 0; border-top: 1px solid var(--line); font-size: .96rem; color: #C7D4E0; }

/* Experience */
.log { max-width: 1100px; position: relative; }
.log::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--current), var(--arc) 60%, transparent); }
.log li.entry { position: relative; padding: 0 0 clamp(36px, 6vh, 64px) clamp(22px, 3vw, 40px); display: grid; grid-template-columns: minmax(120px, 2fr) minmax(0, 7fr); gap: 8px 28px; }
.entry::before { content: ''; position: absolute; left: -4px; top: 9px; width: 10px; height: 10px; border-radius: 50%; background: var(--current); box-shadow: 0 0 12px rgba(255,138,30,.8); }
.entry__dates { color: var(--steel); font-size: .95rem; padding-top: 4px; }
.entry h3 { font-weight: 700; font-stretch: 112%; font-size: clamp(1.25rem, 2.2vw, 1.8rem); line-height: 1.2; letter-spacing: -.012em; }
.entry__co { color: var(--current); margin-bottom: 10px; }
.entry ul li { color: #C7D4E0; max-width: 62ch; padding: 3px 0; }

/* Projects: images are renders of the 3D world */
.mosaic { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(14px, 2vw, 28px); }
.shot { position: relative; margin: 0; overflow: hidden; background: var(--panel); min-height: 460px; display: flex; flex-direction: column; justify-content: flex-end; }
.shot:nth-child(4n+1) { grid-column: span 8; }
.shot:nth-child(4n+2) { grid-column: span 4; }
.shot:nth-child(4n+3) { grid-column: span 5; }
.shot:nth-child(4n+4) { grid-column: span 7; }
.shot img { position: absolute; left: 0; top: -10%; width: 100%; height: 120%; object-fit: cover; }
.shot::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(4,8,14,.97) 0%, rgba(4,8,14,.82) 42%, rgba(4,8,14,.05) 80%); }
.shot figcaption { position: relative; z-index: 1; padding: clamp(18px, 2.4vw, 32px); }
.shot h3 { font-weight: 800; font-stretch: 118%; font-size: clamp(1.3rem, 2.2vw, 2rem); line-height: 1.1; letter-spacing: -.02em; margin-bottom: 10px; }
.shot p { font-size: .96rem; line-height: 1.45; max-width: 60ch; color: #D3DEE8; }
.shot p + p { margin-top: 6px; }
.shot .result { color: var(--current); font-weight: 600; }

/* Contact */
.contact { min-height: 100vh; display: flex; flex-direction: column; justify-content: flex-end; }
.sec.contact h2 { font-size: clamp(2.6rem, 8vw, 8.4rem); font-weight: 900; line-height: .92; letter-spacing: -.045em; max-width: 13ch; margin-bottom: 28px; text-shadow: 0 2px 50px rgba(0,0,0,.7); }
.contact__mail { align-self: flex-start; font-weight: 700; font-stretch: 112%; font-size: clamp(1.1rem, 2.4vw, 2rem); color: var(--current); text-underline-offset: 6px; overflow-wrap: anywhere; }
.contact__links { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 16px 0 44px; }
.contact__links a { text-underline-offset: 4px; }
.term { max-width: 780px; background: rgba(3,6,11,.88); border: 1px solid #1F2C3B; border-radius: 6px; padding: 16px 18px; font: 400 .9rem/1.6 var(--mono); backdrop-filter: blur(8px); }
.term__out { max-height: 220px; overflow-y: auto; white-space: pre-wrap; color: #C7D4E0; overflow-wrap: anywhere; }
.term__out .cmd { color: var(--frost); }
.term__line { display: flex; gap: 10px; margin-top: 4px; }
.term__line label { color: #4ADE80; white-space: nowrap; }
.term__line input { flex: 1; min-width: 0; background: none; border: 0; color: var(--frost); font: inherit; outline: none; caret-color: var(--current); }
.term:focus-within { border-color: var(--arc); }
.foot { margin-top: 36px; color: var(--steel); font-size: .9rem; }

.draft-tag { position: fixed; left: 50%; transform: translateX(-50%); bottom: 12px; white-space: nowrap; z-index: 30; font-size: .78rem; padding: 4px 10px; border-radius: 4px; background: var(--alarm); color: #fff; opacity: .88; pointer-events: none; }

/* Tablet and phone */
@media (max-width: 900px) {
  .about, .rack-wrap { grid-template-columns: minmax(0, 1fr); }
  .about { min-height: 0; }
  .shot:nth-child(n) { grid-column: span 12; min-height: 420px; }
  .log li.entry { grid-template-columns: minmax(0, 1fr); }
  .u { grid-template-columns: 34px 14px minmax(0, 1fr); gap: 4px 10px; padding-right: 10px; }
  .u__tools { grid-column: 3; }
  .u__num { grid-row: span 2; }
}
@media (max-width: 720px) {
  :root { --bar: 4vh; }
  #film { height: 1010vh; }
  .nav nav a:not(.nav__cta) { display: none; }
  .beat--hero { justify-content: flex-end; padding-bottom: 92px; }
  .beat__title { max-width: 12ch; }
  .beat--hero h1 { font-size: clamp(2.9rem, 15.5vw, 5.2rem); }
  .scroll-cue { font-size: .82rem; }
  .skip-film { font-size: .82rem; right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-cue span { animation: none; }
}
