:root {
    --bg: #06101e;
    --bg-2: #09182a;
    --panel: rgba(9, 20, 36, 0.76);
    --panel-strong: rgba(13, 28, 50, 0.92);
    --text: #edf6ff;
    --muted: #9eb1c8;
    --line: rgba(145, 197, 255, 0.18);
    --blue: #5cc8ff;
    --blue-2: #7ce6ff;
    --cyan: #59f4d6;
    --purple: #a78bfa;
    --green: #8cffb7;
    --danger: #ff6b9a;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
    --radius: 28px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 12% 8%, rgba(92, 200, 255, 0.18), transparent 32%),
        radial-gradient(circle at 82% 10%, rgba(89, 244, 214, 0.12), transparent 28%),
        radial-gradient(circle at 50% 80%, rgba(167, 139, 250, 0.12), transparent 32%),
        var(--bg);
    color: var(--text);
    overflow-x: hidden;
}

body.modal-open {
    overflow: hidden;
}

::selection {
    background: rgba(92, 200, 255, 0.35);
}

.noise {
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.035;
    z-index: 1;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 250 250' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

#grid-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.6;
}

a {
    color: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.site-header {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    width: min(1180px, calc(100% - 32px));
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(3, 10, 20, 0.62);
    backdrop-filter: blur(22px);
    box-shadow: 0 14px 55px rgba(0, 0, 0, 0.25);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand-mark {
    width: 42px;
    height: 42px;
    filter: drop-shadow(0 0 16px rgba(92, 200, 255, 0.35));
}

.brand span {
    display: grid;
    gap: 1px;
}

.brand strong {
    letter-spacing: 0.02em;
}

.brand small {
    color: var(--muted);
    font-size: 12px;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.main-nav a {
    padding: 10px 14px;
    color: var(--muted);
    text-decoration: none;
    border-radius: 999px;
    font-size: 14px;
    transition: color 180ms ease, background 180ms ease;
}

.main-nav a:hover,
.main-nav a:focus-visible {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
}

.main-nav .nav-cta {
    color: #03111d;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    font-weight: 800;
}

.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
}

.nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 4px auto;
    background: var(--text);
    border-radius: 999px;
}

main,
.site-footer {
    position: relative;
    z-index: 2;
}

.section-shell {
    width: min(1180px, calc(100% - 32px));
    margin-inline: auto;
}

.hero {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
    gap: 36px;
    align-items: center;
    padding: 132px 0 72px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border: 1px solid rgba(92, 200, 255, 0.28);
    border-radius: 999px;
    color: #cfefff;
    background: rgba(92, 200, 255, 0.08);
    font-size: 14px;
    font-weight: 700;
}

.eyebrow.compact {
    margin-bottom: 14px;
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 18px var(--green);
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin: 28px 0 22px;
    font-size: clamp(46px, 8vw, 98px);
    line-height: 0.92;
    letter-spacing: -0.075em;
}

h1 span {
    color: transparent;
    background: linear-gradient(135deg, #ffffff, var(--blue-2), var(--cyan));
    -webkit-background-clip: text;
    background-clip: text;
}

.hero-text {
    max-width: 720px;
    color: var(--muted);
    font-size: clamp(18px, 2vw, 21px);
    line-height: 1.7;
}

.hero-text strong {
    color: var(--text);
}

.hero-actions,
.contact-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 850;
    letter-spacing: -0.01em;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.button:hover {
    transform: translateY(-2px);
}

.button-primary {
    color: #02101c;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    box-shadow: 0 18px 55px rgba(92, 200, 255, 0.22);
}

.button-ghost {
    color: var(--text);
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.045);
}

.button-ghost:hover {
    border-color: rgba(92, 200, 255, 0.55);
    background: rgba(92, 200, 255, 0.08);
}

.quick-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 34px;
}

.quick-stats article {
    min-height: 112px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.045);
}

.quick-stats strong,
.quick-stats span {
    display: block;
}

.quick-stats strong {
    margin-bottom: 8px;
    font-size: 19px;
}

.quick-stats span {
    color: var(--muted);
    line-height: 1.4;
}

.hero-panel {
    position: relative;
    display: grid;
    gap: 16px;
}

.terminal-window,
.signal-card,
.glass-card,
.project-card,
.skill-card,
.contact-card {
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(12, 27, 48, 0.82), rgba(6, 16, 30, 0.72));
    box-shadow: var(--shadow);
    backdrop-filter: blur(24px);
}

.terminal-window {
    overflow: hidden;
    border-radius: var(--radius);
}

.terminal-top {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
}

.terminal-top span {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #ff6b6b;
}

.terminal-top span:nth-child(2) {
    background: #ffd166;
}

.terminal-top span:nth-child(3) {
    background: #59f4d6;
}

.terminal-top p {
    margin: 0 0 0 8px;
    color: var(--muted);
    font-size: 13px;
}

.terminal-body {
    min-height: 420px;
    padding: 24px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 15px;
    line-height: 1.75;
}

.terminal-body p {
    margin: 0 0 12px;
}

.prompt {
    color: var(--cyan);
}

.output {
    color: #d4e8ff;
    padding-left: 18px;
}

.typing-line::after {
    content: "";
    display: inline-block;
    width: 8px;
    height: 18px;
    margin-left: 4px;
    vertical-align: middle;
    background: var(--blue);
    animation: blink 850ms infinite;
}

@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.signal-card {
    display: grid;
    gap: 10px;
    padding: 22px;
    border-radius: var(--radius);
}

.signal-label,
.card-kicker,
.project-card-top span,
.modal-kicker {
    color: var(--blue-2);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-weight: 900;
}

.signal-card strong {
    font-size: 26px;
    letter-spacing: -0.04em;
}

.signal-bars {
    display: flex;
    align-items: end;
    gap: 5px;
    height: 44px;
}

.signal-bars i {
    display: block;
    width: 12px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--cyan), var(--blue));
    box-shadow: 0 0 18px rgba(89, 244, 214, 0.28);
}

.signal-bars i:nth-child(1) { height: 16px; }
.signal-bars i:nth-child(2) { height: 24px; }
.signal-bars i:nth-child(3) { height: 31px; }
.signal-bars i:nth-child(4) { height: 39px; }
.signal-bars i:nth-child(5) { height: 44px; }

.section-heading {
    max-width: 830px;
    margin-bottom: 26px;
}

.section-heading > span {
    display: inline-block;
    margin-bottom: 12px;
    color: var(--cyan);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 12px;
}

.section-heading h2,
.contact-card h2 {
    margin-bottom: 0;
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1;
    letter-spacing: -0.06em;
}

.about-section,
.projects-section,
.infra-section,
.skills-section,
.timeline-section,
.contact-section {
    padding: 80px 0;
}

.about-grid {
    display: grid;
    grid-template-columns: 1.5fr 0.75fr 0.75fr;
    gap: 16px;
}

.glass-card {
    padding: 26px;
    border-radius: var(--radius);
}

.glass-card h3,
.project-card h3,
.skill-card h3,
.timeline-item h3 {
    margin-bottom: 12px;
    font-size: 24px;
    letter-spacing: -0.035em;
}

.glass-card p,
.project-card p,
.skill-card p,
.timeline-item p,
.contact-card p {
    color: var(--muted);
    line-height: 1.65;
}

.big-card p:last-child,
.mini-card p:last-child,
.skill-card p:last-child,
.timeline-item p:last-child {
    margin-bottom: 0;
}

.mini-card strong {
    display: block;
    margin: 10px 0;
    font-size: 26px;
    letter-spacing: -0.04em;
}

.project-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 22px;
}

.filter {
    min-height: 42px;
    padding: 0 15px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.045);
    cursor: pointer;
    font-weight: 800;
    transition: color 180ms ease, background 180ms ease, border-color 180ms ease;
}

.filter.active,
.filter:hover {
    color: #03111d;
    border-color: transparent;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.project-card {
    position: relative;
    min-height: 430px;
    display: flex;
    flex-direction: column;
    padding: 24px;
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 180ms ease, opacity 180ms ease, border-color 180ms ease;
}

.project-card::before {
    content: "";
    position: absolute;
    inset: -1px;
    background:
        radial-gradient(circle at top right, rgba(92, 200, 255, 0.15), transparent 36%),
        radial-gradient(circle at bottom left, rgba(89, 244, 214, 0.1), transparent 34%);
    pointer-events: none;
}

.project-card > * {
    position: relative;
}

.project-card:hover {
    transform: translateY(-6px);
    border-color: rgba(92, 200, 255, 0.42);
}

.project-card.hidden {
    display: none;
}

.project-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.project-card-top strong {
    color: rgba(255, 255, 255, 0.16);
    font-size: 42px;
    letter-spacing: -0.08em;
}

.project-card ul {
    margin: 8px 0 22px;
    padding-left: 18px;
    color: #c9daf0;
    line-height: 1.75;
}

.project-open {
    margin-top: auto;
    align-self: flex-start;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid rgba(92, 200, 255, 0.3);
    border-radius: 999px;
    color: var(--blue-2);
    background: rgba(92, 200, 255, 0.08);
    cursor: pointer;
    font-weight: 900;
}

.infra-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 18px;
    align-items: start;
}

.infra-diagram {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: calc(var(--radius) + 6px);
    background: rgba(255, 255, 255, 0.035);
    box-shadow: var(--shadow);
}

.node {
    position: relative;
    display: grid;
    gap: 7px;
    padding: 22px;
    border: 1px solid rgba(92, 200, 255, 0.22);
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(9, 22, 39, 0.92), rgba(14, 35, 61, 0.78));
}

.node span {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #03111d;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    font-size: 12px;
    font-weight: 950;
}

.node strong {
    font-size: 24px;
    letter-spacing: -0.04em;
}

.node p,
.vhost p {
    margin: 0;
    color: var(--muted);
}

.node-core {
    border-color: rgba(89, 244, 214, 0.45);
    box-shadow: 0 0 40px rgba(89, 244, 214, 0.1);
}

.link {
    width: 2px;
    height: 38px;
    margin: 0 auto;
    background: linear-gradient(180deg, transparent, var(--blue), transparent);
}

.vhost-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 14px;
}

.vhost {
    padding: 18px;
    border: 1px dashed rgba(92, 200, 255, 0.32);
    border-radius: 20px;
    background: rgba(92, 200, 255, 0.06);
}

.vhost.muted {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.035);
}

.infra-notes {
    display: grid;
    gap: 16px;
}

.checklist-card label {
    display: block;
    margin-top: 14px;
    color: #d8e9ff;
    line-height: 1.4;
}

.checklist-card input {
    margin-right: 8px;
    accent-color: var(--cyan);
}

.skill-columns {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.skill-card {
    padding: 24px;
    border-radius: var(--radius);
}

.skill-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    margin-bottom: 20px;
    border: 1px solid rgba(92, 200, 255, 0.34);
    border-radius: 18px;
    color: var(--blue-2);
    background: rgba(92, 200, 255, 0.08);
    font-size: 14px;
    font-weight: 950;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.skill-tags span,
.modal-stack span {
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: #dceeff;
    background: rgba(255, 255, 255, 0.045);
    font-size: 13px;
    font-weight: 750;
}

.timeline {
    display: grid;
    gap: 14px;
    position: relative;
}

.timeline-item {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 22px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.04);
}

.timeline-date {
    color: var(--cyan);
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 12px;
}

.contact-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px;
    align-items: center;
    padding: 34px;
    border-radius: calc(var(--radius) + 8px);
    background:
        radial-gradient(circle at top left, rgba(92, 200, 255, 0.16), transparent 34%),
        linear-gradient(180deg, rgba(13, 31, 55, 0.94), rgba(6, 16, 30, 0.88));
}

.contact-card p {
    max-width: 660px;
    margin-top: 14px;
    margin-bottom: 0;
}

.site-footer {
    width: min(1180px, calc(100% - 32px));
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin: 0 auto;
    padding: 44px 0 60px;
    color: var(--muted);
}

.site-footer a {
    color: var(--blue-2);
    text-decoration: none;
    font-weight: 850;
}

.project-modal {
    width: min(720px, calc(100% - 28px));
    padding: 34px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--text);
    background:
        radial-gradient(circle at top right, rgba(92, 200, 255, 0.15), transparent 35%),
        #071322;
    box-shadow: 0 40px 140px rgba(0, 0, 0, 0.62);
}

.project-modal::backdrop {
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(8px);
}

.modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--text);
    background: rgba(255, 255, 255, 0.045);
    cursor: pointer;
    font-size: 26px;
}

.project-modal h2 {
    margin: 12px 46px 14px 0;
    font-size: clamp(32px, 5vw, 46px);
    letter-spacing: -0.06em;
}

.project-modal p {
    color: var(--muted);
    line-height: 1.7;
}

.modal-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 22px;
}

.reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 650ms ease, transform 650ms ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 1080px) {
    .hero,
    .infra-layout,
    .contact-card {
        grid-template-columns: 1fr;
    }

    .project-grid,
    .skill-columns {
        grid-template-columns: repeat(2, 1fr);
    }

    .about-grid {
        grid-template-columns: 1fr 1fr;
    }

    .big-card {
        grid-column: 1 / -1;
    }

    .contact-actions {
        margin-top: 0;
    }
}

@media (max-width: 760px) {
    .site-header {
        top: 10px;
        width: min(100% - 20px, 1180px);
        border-radius: 26px;
    }

    .brand small {
        display: none;
    }

    .nav-toggle {
        display: block;
    }

    .main-nav {
        position: absolute;
        top: calc(100% + 10px);
        left: 0;
        right: 0;
        display: none;
        padding: 12px;
        border: 1px solid var(--line);
        border-radius: 24px;
        background: rgba(3, 10, 20, 0.92);
        backdrop-filter: blur(20px);
    }

    .main-nav.open {
        display: grid;
    }

    .main-nav a {
        padding: 13px 14px;
    }

    .hero {
        padding-top: 122px;
        grid-template-columns: 1fr;
    }

    .quick-stats,
    .project-grid,
    .skill-columns,
    .about-grid,
    .vhost-grid {
        grid-template-columns: 1fr;
    }

    .terminal-body {
        min-height: 320px;
        font-size: 13px;
    }

    .project-card {
        min-height: auto;
    }

    .timeline-item {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .site-footer {
        display: grid;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 1ms !important;
        transition-duration: 1ms !important;
    }
}
