:root {
    --bg: #0A0014;
    --green: #00FF41;
    --amber: #FFB000;
    --magenta: #FF006E;
    --cyan: #00FFFF;
    --text: rgba(217, 255, 226, 0.92);
    --muted: rgba(217, 255, 226, 0.62);
    --panel: rgba(0, 255, 65, 0.06);
    --panel-strong: rgba(255, 176, 0, 0.08);
    --border: rgba(0, 255, 65, 0.34);
    --border-amber: rgba(255, 176, 0, 0.34);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at 18% 12%, rgba(255, 0, 110, 0.26), transparent 26rem),
        radial-gradient(circle at 84% 20%, rgba(0, 255, 255, 0.18), transparent 28rem),
        linear-gradient(180deg, #0A0014 0%, #12001f 48%, #0A0014 100%);
    color: var(--text);
    font-family: "Space Mono", "Courier New", monospace;
    font-variant-numeric: tabular-nums;
    line-height: 1.65;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 20;
    pointer-events: none;
    background: repeating-linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.045) 0,
        rgba(255, 255, 255, 0.045) 1px,
        transparent 1px,
        transparent 4px
    );
    mix-blend-mode: screen;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 21;
    pointer-events: none;
    background: radial-gradient(circle at center, transparent 34%, rgba(10, 0, 20, 0.58) 100%);
}

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

a {
    color: var(--green);
    text-decoration-color: rgba(0, 255, 65, 0.45);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.28em;
    overflow-wrap: anywhere;
    transition: color 260ms ease, text-shadow 260ms ease;
}

a:hover {
    color: var(--amber);
    text-shadow: 0 0 14px var(--amber);
}

.terminal-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem clamp(1rem, 4vw, 3rem);
    background: rgba(10, 0, 20, 0.82);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 0 28px rgba(0, 255, 65, 0.12);
    backdrop-filter: blur(14px);
    max-width: 100%;
}

.brand {
    display: grid;
    gap: 0.1rem;
    color: var(--green);
    text-decoration: none;
}

.brand span,
.command,
h1,
h2 {
    text-shadow: 2px 0 rgba(255, 0, 110, 0.46), -2px 0 rgba(0, 255, 255, 0.32), 0 0 20px rgba(0, 255, 65, 0.22);
}

.brand span {
    font-weight: 700;
}

.brand small {
    color: var(--amber);
    font-family: "VT323", "Courier New", monospace;
    font-size: 1.25rem;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: clamp(0.75rem, 2vw, 1.35rem);
    font-size: 0.92rem;
}

.nav a {
    color: var(--muted);
    text-decoration: none;
}

main {
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto;
    max-width: 100%;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(20rem, 0.92fr);
    gap: 1rem;
    align-items: start;
    min-height: auto;
    padding: clamp(2.5rem, 6vw, 4.5rem) 0;
}

.terminal-card {
    position: relative;
    min-width: 0;
    max-width: 100%;
    border: 1px solid var(--border);
    background: linear-gradient(135deg, var(--panel), rgba(10, 0, 20, 0.72));
    box-shadow: inset 0 0 28px rgba(0, 255, 65, 0.06), 0 0 30px rgba(0, 255, 65, 0.08);
}

.terminal-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-top: 1px solid rgba(255, 176, 0, 0.32);
    pointer-events: none;
}

.hero-terminal,
.status-panel,
.content-card,
.timeline-item,
.stack-card,
.project-card,
.contact {
    padding: clamp(1rem, 3vw, 2rem);
}

.hero-terminal {
    display: flex;
    min-height: 24rem;
    flex-direction: column;
    justify-content: center;
}

.command {
    margin: 0 0 1.1rem;
    color: var(--amber);
    font-family: "VT323", "Courier New", monospace;
    font-size: clamp(1.3rem, 3vw, 2rem);
    letter-spacing: 0;
}

.command::before {
    content: "$ ";
    color: var(--green);
}

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

h1 {
    max-width: 10ch;
    margin-bottom: 1rem;
    color: var(--green);
    font-family: "VT323", "Courier New", monospace;
    font-size: clamp(3.8rem, 8.4vw, 8.2rem);
    font-weight: 400;
    line-height: 0.82;
    overflow-wrap: anywhere;
}

.hero-terminal h1 {
    max-width: 100%;
    font-size: clamp(3.2rem, 6.6vw, 6.25rem);
    overflow-wrap: normal;
    word-break: normal;
}

.hero-title-word {
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
}

.hero-title-break {
    display: none;
}

h2 {
    max-width: 12ch;
    margin-bottom: 1.25rem;
    color: var(--green);
    font-family: "VT323", "Courier New", monospace;
    font-size: clamp(3rem, 8vw, 6.2rem);
    font-weight: 400;
    line-height: 0.85;
}

h3 {
    margin-bottom: 0.75rem;
    color: var(--amber);
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.3;
}

.hero-line {
    max-width: 45rem;
    color: var(--amber);
    font-size: clamp(1.1rem, 2vw, 1.45rem);
    font-weight: 700;
}

.summary,
.content-card p,
.timeline-item p,
.stack-card p,
.project-card p,
.contact p,
.status-panel dd {
    color: var(--muted);
}

.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.contact-links a {
    display: inline-flex;
    min-height: 2.75rem;
    align-items: center;
    gap: 0.55rem;
    border: 1px solid var(--border);
    padding: 0.55rem 0.85rem;
    background: rgba(0, 255, 65, 0.08);
    text-decoration: none;
}

.contact-links svg {
    width: 1.15rem;
    height: 1.15rem;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.contact-links svg path,
.contact-links svg rect,
.contact-links svg circle {
    vector-effect: non-scaling-stroke;
}

.contact-links a[href*="github.com"] svg path,
.contact-links a[href*="linkedin.com"] svg path {
    fill: currentColor;
    stroke: none;
}

.contact-links a:hover {
    border-color: var(--border-amber);
    background: rgba(255, 176, 0, 0.1);
}

.status-panel {
    display: flex;
    align-self: start;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0;
}

.identity-grid {
    display: grid;
    align-content: start;
}

dl {
    display: grid;
    gap: 1rem;
    margin: 0;
}

dt {
    color: var(--green);
    font-size: 0.8rem;
}

dd {
    margin: 0;
}

.section-grid,
.section-block,
.contact {
    margin: clamp(3rem, 7vw, 6rem) 0;
}

.section-wide > h2,
.section-wide > div > h2 {
    max-width: 100%;
}

.section-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: 1rem;
    align-items: start;
}

.content-card {
    display: grid;
    gap: 1rem;
}

.content-card p:last-child,
.company-card p:last-child,
.stack-card p:last-child,
.project-card p:last-child,
.contact p:last-child {
    margin-bottom: 0;
}

.career-list,
.stack-grid {
    display: grid;
    gap: 1rem;
}

.career-list {
    margin-top: 2rem;
}

.company-card {
    border-color: var(--border-amber);
    background: linear-gradient(135deg, var(--panel-strong), rgba(10, 0, 20, 0.74));
    animation: pulse-border 4200ms ease-in-out infinite alternate;
}

.company-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 176, 0, 0.24);
}

.company-header > div {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.company-header h3 {
    margin-bottom: 0;
    border: 1px solid var(--border-amber);
    padding: 0.28rem 0.55rem;
    background: rgba(255, 176, 0, 0.06);
}

.company-location {
    display: inline-flex;
    max-width: none;
    border: 1px solid rgba(217, 255, 226, 0.2);
    padding: 0.28rem 0.55rem;
    color: var(--muted);
    white-space: nowrap;
}

.period {
    border: 1px solid var(--border);
    padding: 0.28rem 0.55rem;
    background: rgba(0, 255, 65, 0.06);
}

.company-header .period {
    margin-bottom: 0;
}

.role-line {
    position: relative;
    padding: 0 0 1.25rem 1.35rem;
    border-left: 1px solid var(--border);
}

.role-line::before {
    content: "";
    position: absolute;
    top: 0.4rem;
    left: -0.35rem;
    width: 0.65rem;
    height: 0.65rem;
    background: var(--green);
    box-shadow: 0 0 16px rgba(0, 255, 65, 0.7);
}

.role-line:last-child {
    padding-bottom: 1rem;
}

.role-line.single {
    padding-bottom: 1rem;
}

.role-line span {
    display: inline-block;
    margin-bottom: 0.35rem;
    color: var(--green);
    font-size: 0.82rem;
    font-weight: 700;
}

.role-line strong {
    display: block;
    margin-bottom: 0.55rem;
    color: var(--amber);
}

.period,
.project-card span {
    display: inline-block;
    margin-bottom: 0.9rem;
    color: var(--green);
    font-weight: 700;
}

ul {
    margin: 1rem 0 0;
    padding-left: 1.25rem;
    color: var(--muted);
}

li + li {
    margin-top: 0.5rem;
}

.stack-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 2rem;
}

.stack-card {
    min-height: 13rem;
    transition: transform 300ms ease, border-color 300ms ease, box-shadow 300ms ease;
}

.stack-card:hover,
.project-card:hover {
    transform: translateY(-0.35rem);
    border-color: var(--cyan);
    box-shadow: 0 0 34px rgba(0, 255, 255, 0.16);
}

.projects-carousel {
    margin-top: 2rem;
}

.projects {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.9rem;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-color: var(--green) rgba(0, 255, 65, 0.08);
}

.project-card {
    flex: 0 0 clamp(18rem, 32vw, 25rem);
    min-height: 12rem;
    scroll-snap-align: start;
    transition: transform 300ms ease, border-color 300ms ease, box-shadow 300ms ease;
}

.project-card p {
    font-size: 0.92rem;
}

.carousel-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.6rem;
}

.carousel-button {
    min-height: 2.6rem;
    border: 1px solid var(--border);
    padding: 0.45rem 0.9rem;
    background: rgba(0, 255, 65, 0.08);
    color: var(--green);
    font: inherit;
    cursor: pointer;
    transition: border-color 260ms ease, color 260ms ease, text-shadow 260ms ease;
}

.carousel-button:hover {
    border-color: var(--border-amber);
    color: var(--amber);
    text-shadow: 0 0 14px var(--amber);
}

.carousel-hint {
    color: var(--muted);
    font-size: 0.85rem;
}

.plain-list {
    margin-top: 0;
}

.contact {
    border-color: var(--border-amber);
}

.footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 2rem 0 3rem;
    color: var(--muted);
    border-top: 1px solid var(--border);
    max-width: 100%;
}

.footer-download {
    color: var(--amber);
}

@keyframes pulse-border {
    from {
        box-shadow: inset 0 0 24px rgba(255, 176, 0, 0.05), 0 0 24px rgba(255, 176, 0, 0.06);
    }

    to {
        box-shadow: inset 0 0 34px rgba(255, 176, 0, 0.12), 0 0 34px rgba(255, 176, 0, 0.12);
    }
}

@media (max-width: 980px) {
    .hero,
    .section-grid,
    .stack-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: auto;
    }

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

    .project-card {
        flex-basis: min(82vw, 24rem);
    }
}

@media (max-width: 680px) {
    .terminal-header {
        position: static;
        align-items: flex-start;
        flex-direction: column;
    }

    .nav {
        justify-content: flex-start;
    }

    .project-card {
        flex-basis: min(86vw, 22rem);
    }

    .company-header {
        display: grid;
    }

    .company-location {
        white-space: normal;
    }

    .carousel-controls {
        align-items: stretch;
    }

    .carousel-hint {
        align-self: center;
        text-align: center;
    }

    main,
    .footer {
        width: 100%;
        padding-right: 0.75rem;
        padding-left: 0.75rem;
    }

    .hero {
        padding-top: 2rem;
        gap: 0.75rem;
    }

    .hero-terminal,
    .status-panel,
    .content-card,
    .timeline-item,
    .stack-card,
    .project-card,
    .contact {
        padding: 1rem;
    }

    h1 {
        max-width: 8ch;
        font-size: clamp(3rem, 12.4vw, 3.75rem);
        line-height: 0.88;
    }

    .hero-terminal h1 {
        max-width: 100%;
        font-size: clamp(1.9rem, 8vw, 2.65rem);
        line-height: 0.95;
        overflow-wrap: normal;
        word-break: normal;
        hyphens: none;
    }

    .hero-terminal .hero-title-word {
        display: inline-block;
        white-space: nowrap;
        overflow-wrap: normal;
        word-break: normal;
        hyphens: none;
    }

    .hero-title-break {
        display: initial;
    }

    h2 {
        max-width: 9ch;
        font-size: clamp(2.8rem, 15vw, 4rem);
    }

    .command {
        font-size: clamp(1.15rem, 6vw, 1.55rem);
        overflow-wrap: anywhere;
    }

    .hero-line {
        font-size: clamp(1rem, 5.2vw, 1.2rem);
    }

    .contact-links {
        gap: 0.5rem;
    }

    .contact-links a {
        min-height: 2.5rem;
        padding: 0.45rem 0.65rem;
    }
}

@media (max-width: 380px) {
    h1 {
        font-size: clamp(2.65rem, 11.6vw, 3.15rem);
    }

    .hero-terminal h1 {
        font-size: clamp(1.75rem, 7.4vw, 2.35rem);
    }

    h2 {
        font-size: clamp(2.5rem, 13vw, 3.35rem);
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 1ms !important;
    }
}
