/* First-person spatial world: viewport camera, semantic DOM above the rendering surface. */
.three-container {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}
.spatial-canvas {
    display: block;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
.parallax-container { position: relative; isolation: isolate; }
body.spatial-enabled .circuit-background,
body.spatial-enabled .binary-rain-container { display: none; }
body.spatial-enabled .parallax-container::before { content: none; }
.hero-section {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: end;
    box-sizing: border-box;
    padding: clamp(2.5rem, 6vh, 6rem) clamp(1.2rem, 5vw, 6rem);
    background: linear-gradient(90deg, rgba(2, 14, 25, 0.7), rgba(2, 14, 25, 0.08) 72%);
}
.hero-section > .content {
    margin: 0;
    padding: clamp(1rem, 3vw, 2rem);
    max-width: min(780px, 72vw);
    border-left: 2px solid rgba(100, 255, 218, 0.72);
    background: linear-gradient(100deg, rgba(2,14,25,0.78), rgba(2,14,25,0.08));
}
.hero-section .name {
    font-size: clamp(2.5rem, 6vw, 5.5rem);
    line-height: 1.08;
    letter-spacing: -0.035em;
    animation: none;
}
.hero-section .tagline { color: #d2e9ed; max-width: 55ch; }
.hero-section .contact-links { justify-content: flex-start; }
.hero-section .contact-links a {
    background: rgba(2, 14, 25, .5);
    border-color: rgba(100, 255, 218, .45);
}
.world-hud {
    position: absolute;
    top: clamp(1rem, 4vw, 3rem);
    right: clamp(1rem, 4vw, 3rem);
    z-index: 7;
    display: grid;
    gap: .5rem;
    text-align: right;
    max-width: min(42vw, 320px);
    color: #c9ebea;
}
.world-hud-kicker { font-size: .7rem; letter-spacing: .22em; text-transform: uppercase; color: #64ffda; }
.world-hud h2 { font-size: clamp(1rem, 2vw, 1.6rem); margin: 0; color: #e9fdff; }
.world-hud p { margin: 0; font-size: .73rem; }
.world-route { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .4rem; }
.world-route a {
    display: inline-block;
    color: #ddffff;
    text-decoration: none;
    font-size: .75rem;
    border: 1px solid rgba(100, 255, 218, .48);
    background: rgba(1, 12, 21, .72);
    padding: .3rem .6rem;
    border-radius: 2px;
    cursor: pointer;
}
.world-route a:hover, .world-route a:focus-visible,
.world-route a[aria-current="location"] {
    color: #061522;
    background: #91ffe6;
    outline: 2px solid #91ffe6;
    outline-offset: 2px;
}
.world-status { min-height: 3.5em; }
.world-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
.world-scene-notes {
    position: relative;
    z-index: 3;
    max-width: 920px;
    margin: 2rem auto;
    padding: 1rem 2rem;
    border-left: 1px solid rgba(100, 255, 218, .3);
    background: rgba(3, 17, 29, .92);
}
.world-scene-notes summary { cursor: pointer; color: #96ffe2; }
.world-scene-notes li { padding: .25rem 0; }
body.spatial-enabled .summary-section,
body.spatial-enabled .evaluation-section,
body.spatial-enabled .skills-section {
    background: rgba(3, 16, 27, .88);
    border-color: rgba(100, 255, 218, .15);
    box-shadow: none;
}
body.spatial-enabled .three-container + * { position: relative; }
@media (max-width: 768px) {
    .hero-section { align-items: end; padding: 1rem 1rem 5.5rem; }
    .hero-section > .content { max-width: 100%; padding: .9rem; }
    .hero-section .name { font-size: clamp(2.3rem, 9vw, 3.8rem); }
    .world-hud { max-width: calc(100vw - 2rem); text-align: left; left: 1rem; right: 1rem; top: 1rem; }
    .world-hud h2 { font-size: 1.1rem; }
    .world-hud p { font-size: .7rem; }
    .world-route { justify-content: flex-start; }
    .world-route a { font-size: .7rem; }
    .hero-section .contact-links { gap: .35rem; margin: .7rem 0; }
    .hero-section .contact-links a { width: auto; padding: .35rem .65rem; }
    .world-scene-notes { margin: 1rem; padding: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
    .reveal, .name, .hero-section *, .world-route a { animation: none !important; transition: none !important; }
}

/* Server-backed project explorer is a semantic page view, never a fake scene. */
body.world-motion-paused *, body.world-motion-paused *::before, body.world-motion-paused *::after {
    animation-play-state: paused !important;
    transition: none !important;
    scroll-behavior: auto !important;
}
.projects-section { position: relative; z-index: 3; padding: 2rem 0; background: rgba(3, 17, 29, .94); }
.projects-section[hidden] { display: none; }
.projects-section h2 { color: #ddfff5; }
.project-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 1.25rem; }
.project-record { padding: 1.25rem; border-left: 2px solid rgba(100,255,218,.5); background: rgba(8,31,46,.75); }
.project-record h3 { margin-top: 0; color: #a9ffe9; }
.project-record p { color: #d0dce5; }
.project-focus { font-size: .85rem; }
.project-record button, .project-return {
    background: rgba(8,31,46,.85); border: 1px solid #64ffda;
    color: #d8fff5; padding: .6rem .8rem; font: inherit; cursor: pointer;
}
.project-record button:hover, .project-return:hover { background: #114d50; }
.project-record a { display: inline-block; color: #9cffe8; margin-top: .7rem; }
.project-return { margin: 0 0 1rem; }

/* Observational instrument layer: a quiet frame for the spatial environment. */
:root {
    --world-ink: #e1edf0;
    --world-muted: #afc4cc;
    --world-accent: #8af3d4;
    --world-rule: rgba(138, 243, 212, .25);
    --world-surface: rgba(5, 20, 33, .9);
    --text-color: #afc4cc;
}
body { font-family: 'Space Grotesk', sans-serif; color: var(--world-muted); }
button, input, .world-hud-kicker, .hero-eyebrow, .section-kicker { font-family: 'IBM Plex Mono', monospace; }
* { box-sizing: border-box; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible {
    outline: 2px solid var(--world-accent) !important;
    outline-offset: 5px;
}
.skip-link { position: fixed; top: 1rem; left: 1rem; z-index: 10001; padding: .75rem 1rem; background: #8af3d4; color: #061522; transform: translateY(-200%); }
.skip-link:focus { transform: none; }
.hero-section { min-height: 900px; min-height: max(900px, 100svh); padding: 22rem 1.25rem 6rem; align-items: end; background: linear-gradient(0deg, rgba(3,15,27,.93), transparent 70%); }
.hero-section > .content { padding: 0; border: 0; max-width: 100%; background: none; }
.hero-eyebrow { margin: 0 0 1rem; font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--world-accent); }
.hero-section .name { margin: 0 0 1rem; max-width: 12ch; font-family: 'Space Grotesk', sans-serif; font-weight: 500; font-size: clamp(2.8rem, 8vw, 5.6rem); line-height: 1.02; color: var(--world-ink); text-shadow: none; letter-spacing: -.055em; }
.hero-section .tagline { font-size: 1rem; max-width: 39ch; line-height: 1.6; margin: 0 0 .5rem; }
.hero-section .location { margin: 0; font-size: .82rem; color: var(--world-muted); }
.portfolio-entry { display: inline-flex; align-items: center; gap: 1.4rem; min-height: 44px; margin-top: 1rem; color: var(--world-accent); font-size: .9rem; text-underline-offset: 5px; }
.hero-section .contact-links { gap: .2rem 1rem; margin: 1.25rem 0 0; max-width: 580px; }
.hero-section .contact-links a { display: inline-flex; align-items: center; min-height: 44px; width: auto; border: 0; border-bottom: 1px solid var(--world-rule); padding: .4rem 0; border-radius: 0; background: none; font-size: .8rem; letter-spacing: 0; color: var(--world-ink); }
.hero-section .contact-links a:hover { color: var(--world-accent); background: none; box-shadow: none; transform: none; }
.world-hud { top: 1.5rem; left: 1.25rem; right: 1.25rem; max-width: none; gap: .7rem; text-align: left; padding-top: .8rem; border-top: 1px solid var(--world-rule); }
.world-hud-kicker { font-size: .66rem; letter-spacing: .15em; }
.world-hud h2 { font-size: 1.5rem; font-weight: 500; letter-spacing: -.035em; }
.world-hud p { font-size: .78rem; line-height: 1.6; max-width: 45ch; color: var(--world-muted); }
.world-status { min-height: 3.2em; }
.world-route { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); justify-content: start; gap: .4rem; }
.world-route a { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: .5rem .35rem; font-size: .73rem; border-color: var(--world-rule); background: rgba(3,17,29,.74); color: var(--world-ink); }
.world-route a:last-child { grid-column: 1 / -1; }
.world-motion-toggle { justify-self: start; min-height: 44px; padding: .4rem .65rem; background: rgba(3,17,29,.8); border: 1px solid var(--world-rule); color: var(--world-accent); font-size: .72rem; cursor: pointer; }
.world-motion-toggle:hover { background: #123e44; }
.world-scene-notes { margin: 0; max-width: none; padding: 1.25rem; border: 0; border-top: 1px solid var(--world-rule); border-bottom: 1px solid var(--world-rule); font-size: .9rem; }
.world-scene-notes summary { min-height: 44px; line-height: 1.6; padding: .5rem 0; }
.world-scene-notes ul { max-width: 75ch; padding-left: 1.25rem; }
body.spatial-enabled .summary-section, body.spatial-enabled .evaluation-section, body.spatial-enabled .skills-section, .charts-section {
    margin: 0; padding: 3.5rem 0; border: 0; border-bottom: 1px solid var(--world-rule); border-radius: 0; background: rgba(3,16,27,.96); box-shadow: none; backdrop-filter: none;
}
.content { padding-left: 1.25rem; padding-right: 1.25rem; }
.content h2 { color: var(--world-ink); font-weight: 500; font-size: clamp(1.75rem, 3vw, 2.6rem); letter-spacing: -.035em; line-height: 1.2; }
.summary-section p, .evaluation-lead { max-width: 72ch; font-size: 1rem; line-height: 1.8; }
.skills-container .skill-card, .charts-container .chart-card { border-radius: 2px; border-color: var(--world-rule); box-shadow: none; background: rgba(7,28,43,.85); }
.terminal-container { max-width: calc(100vw - 2rem); max-height: calc(100dvh - 7rem); bottom: 5rem; right: 1rem; border-color: var(--world-rule); border-radius: 3px; box-shadow: 0 16px 60px rgba(0,0,0,.4); }
.terminal-title, .terminal-input { font-family: 'IBM Plex Mono', monospace; }
.terminal-input { min-width: 0; font-size: 16px; }
.terminal-close { min-width: 44px; min-height: 44px; }
.terminal-toggle { width: auto !important; min-height: 46px !important; height: auto !important; padding: .7rem 1rem !important; gap: .6rem !important; border-radius: 3px !important; font-size: .8rem !important; box-shadow: none !important; bottom: 1rem !important; right: 1rem !important; }
.terminal-toggle:focus-visible { outline: 2px solid #e1edf0 !important; outline-offset: 4px; }
.terminal-toggle[aria-expanded="true"] { display: none !important; }
@media (min-width: 768px) {
    .hero-section { min-height: 100svh; padding: 22rem 3rem 4rem; }
    .hero-section > .content { max-width: 650px; }
    .hero-section .tagline { font-size: 1.1rem; }
    .world-hud { left: auto; top: 2.5rem; right: 3rem; width: 320px; }
    .world-hud h2 { font-size: 1.8rem; }
    .content { padding-left: 3rem; padding-right: 3rem; }
    .world-scene-notes { padding: 1.25rem 3rem; }
}
@media (min-width: 1100px) {
    .hero-section { padding: 21rem 5vw 4rem; background: linear-gradient(0deg,rgba(3,15,27,.87),transparent 55%); }
    .hero-section > .content { max-width: min(650px,55vw); }
    .world-hud { right: 5vw; top: 3rem; }
    .summary-section .content, .evaluation-section .content { display: grid; grid-template-columns: 1fr 1.5fr; gap: 1rem 5rem; }
    .summary-section h2 { margin-top: 0; }
    .evaluation-section .section-kicker, .evaluation-section h2 { grid-column: 1; }
    .evaluation-section .evaluation-lead { grid-column: 2; grid-row: 1 / 3; margin-top: 0; }
    .evaluation-section .evaluation-principles, .evaluation-section .evaluation-proof-link { grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

.skills-container { display: grid; gap: 1.5rem; }
.skills-container .skill-card { padding: 1.5rem; border-top: 1px solid var(--world-rule); }
.skill-card h3 { margin-top: 0; color: var(--world-ink); font-weight: 500; }
.skill-card ul { padding-left: 1rem; margin-bottom: 0; }
.charts-container { display: grid; gap: 2rem; }
.charts-container .chart-card { padding: 1.25rem; min-width: 0; }
.chart-card h3 { color: var(--world-ink); font-size: 1rem; font-weight: 500; }
.chart-wrapper { position: relative; width: 100%; height: 320px; }
.chart-context { max-width: 65ch; }
@media (min-width: 768px) {
    .skills-container { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .charts-container { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (min-width: 1100px) {
    .skills-container { grid-template-columns: repeat(3,minmax(0,1fr)); }
}

/* Local optical scrims protect text as bright scene geometry crosses the HUD. */
.hero-section > .content::before, .world-hud::before {
    content: ''; position: absolute; pointer-events: none; z-index: -1;
    inset: -1.5rem -1.25rem;
    background: radial-gradient(ellipse at 30% 55%, rgba(3,16,27,.94), rgba(3,16,27,.73) 48%, transparent 76%);
}
.world-hud::before { inset: -1.5rem -1rem; background: linear-gradient(90deg, rgba(3,16,27,.84), rgba(3,16,27,.7) 75%, transparent); }
@media (min-width: 768px) {
    .hero-section > .content::before { inset: -2.5rem -4rem; }
}
