/* ============================================
   MACIEJ DROBNIUCH - V3 // EXPANSION
   2Advanced-inspired HUD interface
   ============================================ */

:root {
    --bg-0: #0d1424;
    --bg-1: #141c2e;
    --bg-2: #1a2438;
    --bg-panel: #1f2a40;
    --bg-panel-2: #2a3753;

    --text: #e5e7eb;
    --text-2: #a9b6cf;
    --text-3: #7183a5;

    --blue: #9ec5f0;
    --blue-2: #5f8fc9;
    --cyan: #d8ecff;
    --orange: #ff9a3c;
    --white: #ffffff;

    --line: rgba(158, 197, 240, 0.16);
    --line-2: rgba(158, 197, 240, 0.34);
    --line-3: rgba(158, 197, 240, 0.65);

    --glow-blue: 0 0 18px rgba(158, 197, 240, 0.35);
    --glow-orange: 0 0 18px rgba(255, 154, 60, 0.35);

    --font-display: 'Michroma', 'Eurostile', 'Bank Gothic', sans-serif;
    --font-ui: 'Roboto', 'Segoe UI', sans-serif;
    --font-mono: 'Share Tech Mono', 'JetBrains Mono', monospace;

    --nav-h: 64px;
    --rail-w: 52px;
    --cut: 12px;
    --cut-sm: 7px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    font-size: 16px;
    scrollbar-width: thin;
    scrollbar-color: var(--blue-2) var(--bg-0);
}

body {
    font-family: var(--font-ui);
    font-weight: 400;
    background: var(--bg-0);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

body.is-booting { overflow: hidden; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb { background: var(--blue-2); }

::selection { background: var(--blue); color: var(--bg-0); }

a { color: var(--blue); }

/* ---------- Ambient layers ---------- */
.bg-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.dots {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: radial-gradient(rgba(158, 197, 240, 0.22) 1px, transparent 1.2px);
    background-size: 14px 14px;
    opacity: 0.5;
    mask-image: linear-gradient(180deg, rgba(0,0,0,0.9), rgba(0,0,0,0.25) 40%, rgba(0,0,0,0.6));
    -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,0.9), rgba(0,0,0,0.25) 40%, rgba(0,0,0,0.6));
}

.grain {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0.035;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
    mix-blend-mode: screen;
}

.scanline {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9998;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.12) 0px,
        rgba(0, 0, 0, 0.12) 1px,
        transparent 1px,
        transparent 3px
    );
    opacity: 0.5;
}

.scanline::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 120px;
    top: -120px;
    background: linear-gradient(180deg, transparent, rgba(158, 197, 240, 0.05), transparent);
    animation: sweep 9s linear infinite;
}

@keyframes sweep {
    to { transform: translateY(calc(100vh + 240px)); }
}

/* ---------- HUD frame ---------- */
.hud-corner {
    position: fixed;
    width: 26px;
    height: 26px;
    z-index: 1200;
    pointer-events: none;
    border-color: var(--line-3);
    border-style: solid;
    border-width: 0;
    opacity: 0.8;
}
.hud-corner--tl { top: 10px; left: 10px; border-top-width: 1px; border-left-width: 1px; }
.hud-corner--tr { top: 10px; right: 10px; border-top-width: 1px; border-right-width: 1px; }
.hud-corner--bl { bottom: 10px; left: 10px; border-bottom-width: 1px; border-left-width: 1px; }
.hud-corner--br { bottom: 10px; right: 10px; border-bottom-width: 1px; border-right-width: 1px; }

.hud-rail {
    position: fixed;
    right: 0;
    top: var(--nav-h);
    bottom: 0;
    width: var(--rail-w);
    z-index: 1100;
    border-left: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(13, 20, 36, 0.8), rgba(13, 20, 36, 0.4));
    backdrop-filter: blur(6px);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 2rem;
    gap: 2.2rem;
    pointer-events: none;
}

.hud-rail-item {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.22em;
    color: var(--text-3);
    display: flex;
    gap: 0.6rem;
    white-space: nowrap;
}

.hud-k { color: var(--blue-2); }
.hud-v { color: var(--text-2); }

.hud-rail-ticks {
    margin-top: auto;
    margin-bottom: 1.5rem;
    width: 12px;
    height: 160px;
    background: repeating-linear-gradient(180deg, var(--line-2) 0 1px, transparent 1px 8px);
    opacity: 0.6;
}

.hud-progress {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    height: 2px;
    z-index: 1150;
    background: rgba(158, 197, 240, 0.08);
}

.hud-progress-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--blue-2), var(--cyan));
    box-shadow: var(--glow-blue);
}

/* ---------- Boot overlay ---------- */
.boot {
    position: fixed;
    inset: 0;
    z-index: 20000;
    background: var(--bg-0);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.7s ease, visibility 0.7s;
}

.boot.done { opacity: 0; visibility: hidden; }

.boot-frame {
    width: min(520px, 86vw);
    border: 1px solid var(--line-2);
    padding: 2rem 2.2rem;
    position: relative;
    clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
    background: linear-gradient(160deg, rgba(42, 55, 83, 0.9), rgba(20, 28, 46, 0.97));
}

.boot-logo {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 1.6rem;
}

.boot-logo-mark {
    font-family: var(--font-display);
    font-size: 1.9rem;
    color: var(--white);
    letter-spacing: 0.1em;
    text-shadow: var(--glow-blue);
}

.boot-logo-ver {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    color: var(--blue);
}

.boot-bar {
    height: 3px;
    background: rgba(158, 197, 240, 0.12);
    margin-bottom: 0.7rem;
    overflow: hidden;
}

.boot-bar-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--blue-2), var(--cyan));
    box-shadow: var(--glow-blue);
    transition: width 0.25s ease;
}

.boot-readout {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.2em;
    color: var(--text-2);
    margin-bottom: 1.2rem;
}

.boot-readout span:first-child { color: var(--orange); }

.boot-log {
    list-style: none;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    color: var(--text-3);
    min-height: 6.4em;
    line-height: 1.6;
}

.boot-log li::before { content: '> '; color: var(--blue-2); }
.boot-log li.ok::after { content: '  [OK]'; color: var(--blue); }

/* ---------- Container ---------- */
.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 2.5rem;
}

main { position: relative; z-index: 2; padding-right: var(--rail-w); }
.footer { position: relative; z-index: 2; padding-right: var(--rail-w); }

/* ---------- Panels (chamfered HUD boxes) ---------- */
.panel {
    position: relative;
    background: linear-gradient(160deg, rgba(42, 55, 83, 0.55), rgba(31, 42, 64, 0.85));
    border: 1px solid var(--line);
    clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
    transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.panel::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, var(--line-3), transparent 30%) top left / 100% 1px no-repeat,
        linear-gradient(90deg, transparent 70%, var(--line-3)) bottom right / 100% 1px no-repeat;
    opacity: 0.6;
}

.panel::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40%;
    left: -60%;
    background: linear-gradient(100deg, transparent, rgba(216, 236, 255, 0.07), transparent);
    transform: skewX(-12deg);
    pointer-events: none;
    transition: left 0s;
}

.panel:hover::after { left: 130%; transition: left 0.9s ease; }

.panel:hover {
    border-color: var(--line-2);
    box-shadow: 0 0 0 1px rgba(158, 197, 240, 0.05), 0 18px 50px rgba(0, 0, 0, 0.45);
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 1.1rem;
    border-bottom: 1px solid var(--line);
    background: rgba(158, 197, 240, 0.04);
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.26em;
    color: var(--blue);
}

.panel-id { color: var(--text-3); }

.panel-body { padding: 1.4rem 1.5rem 1.6rem; }

.panel-foot {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.1rem;
    border-top: 1px solid var(--line);
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.2em;
    color: var(--text-3);
}

.panel-foot-right { margin-left: auto; }

.blink-dot {
    width: 6px;
    height: 6px;
    background: var(--blue);
    box-shadow: var(--glow-blue);
    animation: blink 1.4s step-end infinite;
}

@keyframes blink { 50% { opacity: 0.15; } }

/* ---------- Navigation ---------- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-h);
    z-index: 1300;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0 1.6rem 0 1.4rem;
    background: linear-gradient(180deg, rgba(13, 20, 36, 0.94), rgba(13, 20, 36, 0.8));
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.nav.scrolled { box-shadow: 0 8px 40px rgba(0, 0, 0, 0.55); }

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;
    margin-right: auto;
}

.brand-mark {
    font-family: var(--font-display);
    font-size: 0.95rem;
    color: var(--white);
    width: 40px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line-2);
    clip-path: polygon(var(--cut-sm) 0, 100% 0, 100% calc(100% - var(--cut-sm)), calc(100% - var(--cut-sm)) 100%, 0 100%, 0 var(--cut-sm));
    background: rgba(158, 197, 240, 0.06);
    text-shadow: var(--glow-blue);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.1; }

.brand-name {
    font-family: var(--font-display);
    font-size: 0.78rem;
    letter-spacing: 0.24em;
    color: var(--white);
}

.brand-sub {
    font-family: var(--font-mono);
    font-size: 0.58rem;
    letter-spacing: 0.24em;
    color: var(--blue-2);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 0.1rem;
}

.nav-link {
    display: inline-flex;
    align-items: baseline;
    gap: 0.45rem;
    font-family: var(--font-ui);
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--text-2);
    text-decoration: none;
    padding: 0.55rem 0.8rem;
    position: relative;
    transition: color 0.2s ease;
}

.nav-link i {
    font-style: normal;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-3);
    letter-spacing: 0.1em;
    transition: color 0.2s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    left: 0.8rem;
    right: 0.8rem;
    bottom: 0.25rem;
    height: 1px;
    background: var(--blue);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
    box-shadow: var(--glow-blue);
}

.nav-link:hover, .nav-link.active { color: var(--white); }
.nav-link:hover i, .nav-link.active i { color: var(--orange); }
.nav-link:hover::after, .nav-link.active::after { transform: scaleX(1); }

.nav-link--highlight { color: var(--blue); }
.nav-link--highlight i { color: var(--blue-2); }

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}

.nav-toggle span {
    width: 24px;
    height: 1px;
    background: var(--blue);
    transition: all 0.3s ease;
}

.audio-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: transparent;
    border: 1px solid var(--line);
    color: var(--text-3);
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.24em;
    padding: 0.45rem 0.75rem;
    cursor: pointer;
    clip-path: polygon(var(--cut-sm) 0, 100% 0, 100% calc(100% - var(--cut-sm)), calc(100% - var(--cut-sm)) 100%, 0 100%, 0 var(--cut-sm));
    transition: all 0.25s ease;
}

.audio-toggle:hover { color: var(--blue); border-color: var(--line-2); }
.audio-toggle[aria-pressed="true"] { color: var(--orange); border-color: rgba(255, 154, 60, 0.5); }

.audio-bars { display: inline-flex; gap: 2px; align-items: flex-end; height: 10px; }
.audio-bars span { width: 2px; height: 3px; background: currentColor; }
.audio-toggle[aria-pressed="true"] .audio-bars span { animation: eq 0.9s ease-in-out infinite; }
.audio-bars span:nth-child(2) { animation-delay: 0.15s; }
.audio-bars span:nth-child(3) { animation-delay: 0.3s; }
.audio-bars span:nth-child(4) { animation-delay: 0.45s; }

@keyframes eq { 0%, 100% { height: 3px; } 50% { height: 10px; } }

/* ---------- Hero ---------- */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: calc(var(--nav-h) + 3rem) 2.5rem 4rem;
    position: relative;
    overflow: hidden;
}

.hero-rings {
    position: absolute;
    right: -8%;
    top: 50%;
    width: min(70vh, 640px);
    height: min(70vh, 640px);
    transform: translateY(-50%);
    opacity: 0.55;
    pointer-events: none;
}

.rings { width: 100%; height: 100%; }
.ring { fill: none; stroke: var(--blue-2); stroke-width: 0.6; opacity: 0.5; }
.ring--dash { stroke-dasharray: 3 9; animation: spin 90s linear infinite; transform-origin: 300px 300px; }
.ring--dash2 { stroke-dasharray: 20 6 2 6; animation: spin 60s linear infinite reverse; transform-origin: 300px 300px; }
.ring--thin { stroke-width: 0.4; opacity: 0.35; }
.ring-arc { fill: none; stroke: var(--cyan); stroke-width: 2; stroke-linecap: square; transform-origin: 300px 300px; opacity: 0.8; filter: drop-shadow(0 0 4px rgba(216, 236, 255, 0.6)); }
.ring-arc--a { animation: spin 14s linear infinite; }
.ring-arc--b { stroke: var(--orange); stroke-width: 1.2; animation: spin 22s linear infinite reverse; filter: drop-shadow(0 0 4px rgba(255, 154, 60, 0.5)); }
.ring-cross { stroke: var(--line-2); stroke-width: 0.5; }
.ring-ticks line { stroke: var(--blue); stroke-width: 1; opacity: 0.5; }

@keyframes spin { to { transform: rotate(360deg); } }

.hero-grid {
    position: relative;
    z-index: 1;
    max-width: 1180px;
    width: 100%;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 3rem;
    align-items: center;
}

.hero-kicker {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 1.6rem;
    opacity: 0;
    animation: fadeIn 0.6s 0.2s forwards;
}

.kicker-line { width: 48px; height: 1px; background: var(--orange); box-shadow: var(--glow-orange); }

.kicker-text {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.32em;
    color: var(--orange);
}

.hero-name {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5.2vw, 4.2rem);
    line-height: 1.02;
    letter-spacing: 0.06em;
    color: var(--white);
    display: flex;
    flex-direction: column;
    text-shadow: 0 0 40px rgba(158, 197, 240, 0.25);
    margin-bottom: 1.4rem;
}

.hero-name-line { display: block; opacity: 0; animation: fadeIn 0.5s forwards; }
.hero-name-line:nth-child(1) { animation-delay: 0.5s; }
.hero-name-line:nth-child(2) { animation-delay: 0.75s; color: var(--blue); }

.hero-role {
    font-family: var(--font-ui);
    font-weight: 600;
    font-size: clamp(1rem, 1.8vw, 1.35rem);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--text);
    opacity: 0;
    animation: fadeIn 0.6s 1s forwards;
}

.hero-role .sep { color: var(--orange); margin: 0 0.4rem; }

.hero-sub {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.18em;
    color: var(--blue);
    margin-top: 0.4rem;
    opacity: 0;
    animation: fadeIn 0.6s 1.2s forwards;
}

.hero-sub .dim { color: var(--text-3); }

.hero-tags {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1.6rem 0 2rem;
}

.hero-tags li {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-2);
    border: 1px solid var(--line);
    padding: 0.4rem 0.7rem;
    background: rgba(158, 197, 240, 0.03);
    clip-path: polygon(var(--cut-sm) 0, 100% 0, 100% calc(100% - var(--cut-sm)), calc(100% - var(--cut-sm)) 100%, 0 100%, 0 var(--cut-sm));
    opacity: 0;
    animation: fadeIn 0.5s forwards;
}

.hero-tags li:nth-child(1) { animation-delay: 1.4s; }
.hero-tags li:nth-child(2) { animation-delay: 1.5s; }
.hero-tags li:nth-child(3) { animation-delay: 1.6s; }
.hero-tags li:nth-child(4) { animation-delay: 1.7s; }

.hero-cta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    opacity: 0;
    animation: fadeIn 0.6s 1.9s forwards;
}

.hero-side { opacity: 0; animation: slideIn 0.8s 1.1s forwards; }

@keyframes fadeIn { to { opacity: 1; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }

/* Readout panel */
.readout { padding: 1rem 1.2rem 0.6rem; }

.readout-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 0.55rem 0;
    border-bottom: 1px dashed var(--line);
}

.readout-row:last-child { border-bottom: none; }

.readout-k {
    font-family: var(--font-mono);
    font-size: 0.64rem;
    letter-spacing: 0.26em;
    color: var(--text-3);
}

.readout-v {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--white);
    text-shadow: var(--glow-blue);
}

.readout-v em {
    font-style: normal;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.2em;
    color: var(--blue-2);
    margin-left: 0.2rem;
}

.stat-number { color: var(--white); }

.panel-meter { padding: 0.5rem 1.2rem 1rem; }

.meter-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.26em;
    color: var(--text-3);
    margin-bottom: 0.4rem;
}

.meter {
    height: 8px;
    background: repeating-linear-gradient(90deg, rgba(158, 197, 240, 0.12) 0 6px, transparent 6px 8px);
    position: relative;
    overflow: hidden;
}

.meter-fill {
    height: 100%;
    width: 40%;
    background: repeating-linear-gradient(90deg, var(--blue) 0 6px, transparent 6px 8px);
    box-shadow: var(--glow-blue);
    transition: width 0.8s ease;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.6rem;
    font-family: var(--font-ui);
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    position: relative;
    clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
    transition: all 0.25s ease;
}

.btn-primary {
    background: linear-gradient(180deg, var(--blue), var(--blue-2));
    color: var(--bg-0);
    border-color: var(--blue);
}

.btn-primary:hover {
    background: var(--white);
    box-shadow: var(--glow-blue), 0 0 40px rgba(158, 197, 240, 0.35);
}

.btn-bracket { color: rgba(13, 20, 36, 0.6); }

.btn-secondary {
    background: rgba(158, 197, 240, 0.04);
    color: var(--text);
    border-color: var(--line-2);
}

.btn-secondary:hover {
    color: var(--white);
    border-color: var(--orange);
    box-shadow: var(--glow-orange);
}

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: 1.6rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    animation: fadeIn 1s 2.8s forwards;
    opacity: 0;
}

.scroll-indicator span {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.4em;
    color: var(--text-3);
}

.scroll-arrow {
    width: 1px;
    height: 36px;
    background: linear-gradient(180deg, var(--blue), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse { 0%, 100% { opacity: 0.3; transform: scaleY(0.6); transform-origin: top; } 50% { opacity: 1; transform: scaleY(1); } }

/* ---------- Sections ---------- */
.section { padding: 6rem 0; position: relative; }

.section-dark {
    background: linear-gradient(180deg, rgba(20, 28, 46, 0.55), rgba(13, 20, 36, 0.75));
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.section-head {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 3rem;
}

.section-num {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.2em;
    color: var(--orange);
    border: 1px solid rgba(255, 154, 60, 0.45);
    padding: 0.3rem 0.55rem;
    clip-path: polygon(var(--cut-sm) 0, 100% 0, 100% calc(100% - var(--cut-sm)), calc(100% - var(--cut-sm)) 100%, 0 100%, 0 var(--cut-sm));
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.15rem, 2.4vw, 1.7rem);
    letter-spacing: 0.22em;
    color: var(--white);
    white-space: nowrap;
}

.section-rule {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--line-3), var(--line) 60%, transparent);
    position: relative;
}

.section-rule::before {
    content: '';
    position: absolute;
    left: 0;
    top: -2px;
    width: 5px;
    height: 5px;
    background: var(--blue);
    box-shadow: var(--glow-blue);
}

.section-tag {
    font-family: var(--font-mono);
    font-size: 0.64rem;
    letter-spacing: 0.26em;
    color: var(--text-3);
    white-space: nowrap;
}

.section-subtitle {
    font-size: 1.05rem;
    color: var(--text-2);
    max-width: 760px;
    margin: -1.6rem 0 2.2rem;
}

.section-subtitle strong { color: var(--blue); }

/* ---------- About ---------- */
.about-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 2rem;
    align-items: start;
}

.terminal-block .panel-body p { font-size: 1.02rem; line-height: 1.75; color: var(--text-2); }
.terminal-block .panel-body p + p { margin-top: 1rem; }

.highlight { color: var(--blue); font-weight: 600; }

.about-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.9rem;
}

.stat-card {
    background: linear-gradient(160deg, rgba(42, 55, 83, 0.55), rgba(31, 42, 64, 0.85));
    border: 1px solid var(--line);
    padding: 1.3rem 1.1rem 1.1rem;
    clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
    position: relative;
    transition: border-color 0.3s ease, transform 0.3s ease;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 8px;
    right: 10px;
    width: 18px;
    height: 1px;
    background: var(--orange);
}

.stat-card:hover { border-color: var(--line-2); transform: translateY(-3px); }

.stat-value {
    font-family: var(--font-display);
    font-size: 1.7rem;
    color: var(--white);
    text-shadow: var(--glow-blue);
    line-height: 1.1;
}

.stat-label {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--text-3);
    margin-top: 0.5rem;
}

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 2.4rem; }

.timeline::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: repeating-linear-gradient(180deg, var(--line-2) 0 6px, transparent 6px 12px);
}

.timeline-item { position: relative; margin-bottom: 1.6rem; }

.timeline-marker {
    position: absolute;
    left: -2.4rem;
    top: 1.4rem;
    width: 13px;
    height: 13px;
    border: 1px solid var(--blue);
    background: var(--bg-0);
    transform: rotate(45deg);
    transition: all 0.3s ease;
}

.timeline-item:hover .timeline-marker { background: var(--orange); border-color: var(--orange); box-shadow: var(--glow-orange); }

.timeline-content { padding: 1.5rem 1.7rem 1.4rem; }

.timeline-header { margin-bottom: 0.9rem; display: flex; flex-direction: column; gap: 0.2rem; }

.timeline-date {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.28em;
    color: var(--orange);
}

.timeline-header h3 {
    font-family: var(--font-ui);
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: 0.04em;
    color: var(--white);
}

.timeline-company {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--blue);
}

.timeline-details { list-style: none; }

.timeline-details li {
    position: relative;
    padding-left: 1.2rem;
    margin-bottom: 0.45rem;
    color: var(--text-2);
    font-size: 0.98rem;
    line-height: 1.6;
}

.timeline-details li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.65em;
    width: 6px;
    height: 1px;
    background: var(--blue-2);
}

.timeline-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1rem; }

.tag {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-2);
    border: 1px solid var(--line);
    padding: 0.28rem 0.55rem;
    background: rgba(158, 197, 240, 0.04);
    transition: all 0.2s ease;
}

.tag:hover { color: var(--blue); border-color: var(--line-2); }

.timeline-summary { color: var(--text-2); font-size: 0.98rem; }
.timeline-summary strong { color: var(--text); }

/* ---------- Skills ---------- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
}

.skill-category { padding: 1.5rem 1.7rem 1.6rem; }

.skill-category-header {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 1.3rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--line);
}

.skill-icon {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.2em;
    color: var(--orange);
    border: 1px solid rgba(255, 154, 60, 0.4);
    padding: 0.25rem 0.5rem;
}

.skill-category-header h3 {
    font-family: var(--font-ui);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--white);
}

.skill-item {
    display: grid;
    grid-template-columns: 1fr 140px 32px;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.7rem;
}

.skill-name { font-size: 0.95rem; color: var(--text-2); letter-spacing: 0.02em; }

.skill-bar {
    height: 6px;
    background: repeating-linear-gradient(90deg, rgba(158, 197, 240, 0.14) 0 4px, transparent 4px 6px);
    overflow: hidden;
}

.skill-fill {
    height: 100%;
    width: 0;
    background: repeating-linear-gradient(90deg, var(--blue) 0 4px, transparent 4px 6px);
    box-shadow: var(--glow-blue);
    transition: width 1.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.skill-pct {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    color: var(--blue);
    text-align: right;
}

/* ---------- Projects ---------- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
}

.project-card { padding: 1.4rem 1.5rem 1.5rem; display: flex; flex-direction: column; }

.project-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }

.project-idx {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.26em;
    color: var(--orange);
}

.project-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    color: var(--blue);
    border: 1px solid var(--line-2);
    clip-path: polygon(var(--cut-sm) 0, 100% 0, 100% calc(100% - var(--cut-sm)), calc(100% - var(--cut-sm)) 100%, 0 100%, 0 var(--cut-sm));
    background: rgba(158, 197, 240, 0.05);
    transition: all 0.3s ease;
}

.project-card:hover .project-icon { color: var(--white); box-shadow: var(--glow-blue); border-color: var(--blue); }

.project-card h3 {
    font-family: var(--font-ui);
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.06em;
    color: var(--white);
    margin-bottom: 0.5rem;
}

.project-card p { color: var(--text-2); font-size: 0.95rem; line-height: 1.6; flex: 1; }

.project-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 1rem; }

/* ---------- Chat ---------- */
.chat-container { max-width: 1100px; margin: 0 auto; }

.chat-window { overflow: hidden; }

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.4rem;
    background: rgba(158, 197, 240, 0.04);
    border-bottom: 1px solid var(--line);
}

.chat-status {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.24em;
    color: var(--text-2);
}

.status-dot {
    width: 7px;
    height: 7px;
    background: var(--blue);
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 4px var(--blue); }
    50% { opacity: 0.4; box-shadow: 0 0 10px var(--blue); }
}

.chat-secure {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.22em;
    color: var(--orange);
}

.chat-messages {
    padding: 1.5rem;
    min-height: 400px;
    max-height: 600px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scroll-behavior: smooth;
    background:
        linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 40px,
        linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 40px 100%;
    background-color: rgba(13, 20, 36, 0.45);
}

.chat-message { display: flex; gap: 0.75rem; animation: messageIn 0.3s ease; }

@keyframes messageIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-message.user { flex-direction: row-reverse; }

.message-avatar {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 0.72rem;
    flex-shrink: 0;
    clip-path: polygon(var(--cut-sm) 0, 100% 0, 100% calc(100% - var(--cut-sm)), calc(100% - var(--cut-sm)) 100%, 0 100%, 0 var(--cut-sm));
}

.chat-message.bot .message-avatar {
    background: rgba(158, 197, 240, 0.12);
    color: var(--blue);
    border: 1px solid var(--line-2);
}

.chat-message.user .message-avatar {
    background: rgba(255, 154, 60, 0.12);
    color: var(--orange);
    border: 1px solid rgba(255, 154, 60, 0.4);
    font-family: var(--font-mono);
    font-size: 0.6rem;
}

.message-content {
    background: rgba(20, 28, 46, 0.92);
    border: 1px solid var(--line);
    padding: 1rem 1.1rem;
    max-width: 80%;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text);
    clip-path: polygon(var(--cut-sm) 0, 100% 0, 100% calc(100% - var(--cut-sm)), calc(100% - var(--cut-sm)) 100%, 0 100%, 0 var(--cut-sm));
}

.chat-message.user .message-content {
    background: rgba(255, 154, 60, 0.06);
    border-color: rgba(255, 154, 60, 0.3);
}

.message-content p { margin-bottom: 0.5rem; }
.message-content p:last-child { margin-bottom: 0; }
.message-content strong { color: var(--blue); }
.message-content code { font-family: var(--font-mono); color: var(--cyan); font-size: 0.88em; }
.message-content ul { margin: 0.3rem 0 0.5rem 1.2rem; }

.message-hint {
    font-family: var(--font-mono);
    font-size: 0.74rem !important;
    color: var(--text-3) !important;
    margin-top: 0.5rem !important;
}

.hint-list { margin: 0.3rem 0 0.5rem 1.2rem; line-height: 1.5; }

.chat-input-container { padding: 1rem 1.4rem; border-top: 1px solid var(--line); }

.chat-input-wrapper {
    display: flex;
    align-items: flex-end;
    background: rgba(13, 20, 36, 0.6);
    border: 1px solid var(--line);
    padding: 0.5rem 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.chat-input-wrapper:focus-within { border-color: var(--blue); box-shadow: var(--glow-blue); }

.input-prompt { font-family: var(--font-mono); color: var(--orange); margin-right: 0.75rem; }

.chat-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    padding: 0.5rem 0;
    resize: none;
    overflow-y: hidden;
    min-height: 1.4em;
    max-height: 150px;
    line-height: 1.4;
}

.chat-input::placeholder { color: var(--text-3); }

.chat-send {
    background: none;
    border: none;
    color: var(--blue);
    cursor: pointer;
    padding: 0.5rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.chat-send:hover { color: var(--white); transform: scale(1.1); filter: drop-shadow(0 0 6px var(--blue)); }

.chat-disclaimer {
    font-family: var(--font-mono);
    font-size: 0.58rem;
    letter-spacing: 0.2em;
    color: var(--text-3);
    text-align: center;
    margin-top: 0.75rem;
}

/* Typing indicator */
.typing-indicator { display: flex; gap: 4px; padding: 0.5rem 0; }

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: var(--blue);
    animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* Mermaid */
.mermaid-wrapper {
    margin-top: 0.75rem;
    background: var(--bg-0);
    border: 1px solid var(--line);
    padding: 1rem;
    overflow-x: auto;
}

.mermaid-chart { display: flex; justify-content: center; min-height: 100px; }
.mermaid-chart svg { max-width: 100%; height: auto; }

/* Playbook progress */
.playbook-progress { padding: 0.5rem 0; }

.playbook-progress-bar {
    width: 100%;
    height: 6px;
    background: repeating-linear-gradient(90deg, rgba(158, 197, 240, 0.14) 0 4px, transparent 4px 6px);
    border: 1px solid var(--line);
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.playbook-progress-fill {
    height: 100%;
    width: 5%;
    background: linear-gradient(90deg, var(--blue-2), var(--cyan));
    transition: width 0.5s ease;
    box-shadow: var(--glow-blue);
}

.playbook-progress-text {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    color: var(--blue);
    animation: progressPulse 2s ease-in-out infinite;
}

@keyframes progressPulse { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }

/* Playbook YAML block */
.playbook-block {
    margin-top: 0.5rem;
    border: 1px solid var(--line-2);
    background: var(--bg-0);
    overflow: hidden;
}

.playbook-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.9rem;
    background: rgba(158, 197, 240, 0.06);
    border-bottom: 1px solid var(--line);
}

.playbook-label {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.2em;
    color: var(--orange);
}

.playbook-actions { display: flex; gap: 0.4rem; }

.playbook-btn {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-2);
    background: transparent;
    border: 1px solid var(--line);
    padding: 0.3rem 0.65rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.playbook-btn:hover { color: var(--blue); border-color: var(--blue); box-shadow: var(--glow-blue); }

.playbook-btn--download { color: var(--blue); border-color: var(--line-2); }
.playbook-btn--download:hover { background: var(--blue); color: var(--bg-0); }

.playbook-code {
    margin: 0;
    padding: 1rem;
    max-height: 420px;
    overflow: auto;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--text);
    white-space: pre;
    background:
        linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 40px;
}

.playbook-code code { font-family: inherit; }

.playbook-quota {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    color: var(--orange);
    margin-top: 0.6rem;
}

/* ---------- Contact ---------- */
.contact-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 2rem;
    align-items: stretch;
}

.contact-item {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 1rem;
    padding: 0.6rem 0;
    border-bottom: 1px dashed var(--line);
    align-items: baseline;
}

.contact-item:last-child { border-bottom: none; }

.contact-label {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.26em;
    color: var(--text-3);
}

.contact-value { color: var(--text); text-decoration: none; font-size: 1rem; transition: color 0.2s ease; }
a.contact-value:hover { color: var(--blue); text-shadow: var(--glow-blue); }

.contact-cta {
    padding: 2rem 1.8rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.2rem;
}

.cta-kicker {
    font-family: var(--font-mono);
    font-size: 0.64rem;
    letter-spacing: 0.3em;
    color: var(--orange);
}

.contact-cta p { font-size: 1.25rem; font-weight: 600; color: var(--white); line-height: 1.4; }

.cta-buttons { display: flex; flex-direction: column; gap: 0.7rem; }
.cta-buttons .btn { justify-content: center; }

/* ---------- Footer ---------- */
.footer { padding: 2.2rem 0 2.6rem; border-top: 1px solid var(--line); background: var(--bg-0); }

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-text {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.24em;
    color: var(--text-2);
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.footer-mark {
    font-family: var(--font-display);
    color: var(--blue);
    border: 1px solid var(--line-2);
    padding: 0.2rem 0.4rem;
}

.footer-copy {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    color: var(--text-3);
}

/* ---------- Reveal ---------- */
.reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal.visible { opacity: 1; transform: none; }

/* decode text effect uses inline text only - no extra styles needed */
.decode { font-variant-numeric: tabular-nums; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .projects-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-rings { opacity: 0.3; }
}

@media (max-width: 900px) {
    :root { --rail-w: 0px; }
    .hud-rail { display: none; }
    .hero-grid { grid-template-columns: 1fr; gap: 2rem; }
    .about-grid, .contact-grid { grid-template-columns: 1fr; }
    .skills-grid { grid-template-columns: 1fr; }
    .section-tag { display: none; }
    .nav-links {
        position: fixed;
        top: var(--nav-h);
        left: 0;
        right: 0;
        flex-direction: column;
        background: rgba(13, 20, 36, 0.98);
        border-bottom: 1px solid var(--line);
        padding: 0.8rem 1rem 1.2rem;
        display: none;
    }
    .nav-links.open { display: flex; }
    .nav-link { padding: 0.75rem 0.8rem; }
    .nav-toggle { display: flex; }
    .audio-label { display: none; }
    .scroll-indicator { display: none; }
    .hero { min-height: 0; padding-bottom: 3rem; }
}

@media (max-width: 600px) {
    .container { padding: 0 1.2rem; }
    .hero { padding: calc(var(--nav-h) + 2rem) 1.2rem 4rem; }
    .projects-grid { grid-template-columns: 1fr; }
    .about-stats { grid-template-columns: 1fr 1fr; }
    .skill-item { grid-template-columns: 1fr 90px 28px; gap: 0.6rem; }
    .section { padding: 4rem 0; }
    .section-head { flex-wrap: wrap; gap: 0.8rem; }
    .hero-rings { display: none; }
    .brand-text { display: none; }
    .contact-item { grid-template-columns: 1fr; gap: 0.2rem; }
    .message-content { max-width: 92%; }
    .hud-corner { display: none; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
    .hero-kicker, .hero-name-line, .hero-role, .hero-sub, .hero-tags li, .hero-cta, .hero-side, .scroll-indicator { opacity: 1; }
    .scanline::after { display: none; }
}

/* ---------- Theme switch ---------- */
.theme-switch {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.24em;
    color: var(--text-3);
    text-decoration: none;
    border: 1px solid var(--line);
    padding: 0.35rem 0.6rem;
    transition: all 0.2s ease;
}
.theme-switch:hover { color: var(--orange); border-color: var(--orange); box-shadow: var(--glow-orange); }
