/* ============================================
   0xv1n — Portfolio
   Aesthetic: Nier: Automata + Evangelion + FFT
   Single-screen two-column composition
   ============================================ */

/* --- Custom Properties --- */
:root {
    --bg-primary: #E8E0D0;
    --bg-secondary: #DED6C4;
    --text-primary: #2A2A2A;
    --text-secondary: #5C5749;
    --text-tertiary: #8A8378;
    --accent-gold: #B4975A;
    --accent-red: #8B2252;
    --border-light: #C8C0B0;
    --border-medium: #A89F8F;

    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'M PLUS Rounded 1c', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Mono', monospace;

    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: 200ms var(--ease-out-expo);
    --transition-base: 400ms var(--ease-out-expo);
    --transition-slow: 800ms var(--ease-out-expo);
}

/* --- Reset --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    color: var(--text-primary);
    background: radial-gradient(ellipse at 30% 50%, #EDE5D5 0%, #E8E0D0 50%, #E3DBCB 100%);
    background-attachment: fixed;
    line-height: 1.6;
    cursor: none;
    overflow-x: hidden;
    min-height: 100vh;
    transition: background-color 0.8s ease, color 0.8s ease;
}

a {
    color: inherit;
    text-decoration: none;
    cursor: none;
}

img {
    display: block;
    max-width: 100%;
}

/* --- Noise Overlay --- */
.noise-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='256' height='256' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* --- Particles Canvas --- */
#particles {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

/* --- Corner Bracket Frame (Nier/Eva) --- */
.frame-corner {
    position: fixed;
    width: 24px;
    height: 24px;
    z-index: 3;
    pointer-events: none;
    opacity: 0;
}
.frame-corner.is-revealed {
    animation: cornerReveal 1s var(--ease-out-expo) forwards;
}

@keyframes cornerReveal {
    to { opacity: 1; }
}

.frame-corner--tl {
    top: 1.25rem;
    left: 1.25rem;
    border-left: 1px solid var(--border-medium);
    border-top: 1px solid var(--border-medium);
}

.frame-corner--tr {
    top: 1.25rem;
    right: 1.25rem;
    border-right: 1px solid var(--border-medium);
    border-top: 1px solid var(--border-medium);
}

.frame-corner--bl {
    bottom: 1.25rem;
    left: 1.25rem;
    border-left: 1px solid var(--border-medium);
    border-bottom: 1px solid var(--border-medium);
}

.frame-corner--br {
    bottom: 1.25rem;
    right: 1.25rem;
    border-right: 1px solid var(--border-medium);
    border-bottom: 1px solid var(--border-medium);
}

/* --- Decorative System Text --- */
.sys-text {
    position: fixed;
    font-family: var(--font-mono);
    font-size: 0.55rem;
    color: var(--text-tertiary);
    letter-spacing: 0.15em;
    opacity: 0;
    z-index: 3;
    pointer-events: none;
    transition: color 0.8s ease;
}
.sys-text.is-revealed {
    animation: cornerReveal 1s var(--ease-out-expo) forwards;
}

.sys-text--tl {
    top: 1.65rem;
    left: 3.25rem;
}

.sys-text--br {
    bottom: 1.65rem;
    right: 3.25rem;
}

/* --- Custom Cursor --- */
.cursor-dot {
    position: fixed;
    left: 0;
    top: 0;
    width: 6px;
    height: 6px;
    background: var(--text-primary);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
    transition:
        width var(--transition-fast),
        height var(--transition-fast),
        background-color var(--transition-fast);
    will-change: transform;
}

.cursor-dot.is-hovering {
    width: 10px;
    height: 10px;
    background: var(--accent-gold);
}

.cursor-ring {
    position: fixed;
    left: 0;
    top: 0;
    width: 36px;
    height: 36px;
    border: 1px solid var(--text-primary);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
    opacity: 0.4;
    transition:
        width var(--transition-fast),
        height var(--transition-fast),
        border-color var(--transition-fast),
        opacity var(--transition-fast);
    will-change: transform;
}

.cursor-ring.is-hovering {
    width: 50px;
    height: 50px;
    border-color: var(--accent-gold);
    opacity: 0.5;
}

@media (hover: none) and (pointer: coarse) {
    .cursor-dot,
    .cursor-ring {
        display: none;
    }

    body {
        cursor: auto;
    }

    a {
        cursor: pointer;
    }
}

/* --- Staggered Reveal Animation --- */
@keyframes reveal {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero,
.identity__image,
.identity__tagline,
.about,
.experience,
.output,
.transmissions,
.meta,
.footer {
    animation: reveal 0.8s var(--ease-out-expo) var(--reveal-delay, 0ms) backwards;
}

/* --- Site Layout: Two-Column Grid --- */
.site {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    max-width: 1100px;
    margin: 0 auto;
    padding: 3rem;
    display: grid;
    grid-template-columns: 5fr 7fr;
    grid-template-rows: 1fr auto;
    gap: 0;
}

/* Divider now uses HTML element — see inline <style> */

/* --- Left Column: Identity --- */
.col-identity {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2.25rem;
    padding-right: 3rem;
}

/* Hero + portrait + tagline grouped so they can reflow independently of
   the ABOUT/META blocks that now share the left column. */
.identity-block {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ABOUT + META live in the left column — give them the same divider rhythm
   the right column's sections use. */
.col-identity > .about,
.col-identity > .meta {
    border-top: 1px solid var(--border-light);
    padding-top: 1.75rem;
}

/* --- Right Column: Content --- */
.col-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0;
    padding-left: 3rem;
}

/* Section dividers in the right column */
.col-content > section {
    padding: 1.5rem 0;
}

.col-content > section.experience {
    padding: 2.25rem 0;
}

.col-content > section:first-child {
    padding-top: 0;
}

.col-content > section:last-child {
    padding-bottom: 0;
}

.col-content > section + section {
    border-top: 1px solid var(--border-light);
}

/* --- Section Labels (Eva-style numbering) --- */
.section__label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.section__number {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent-red);
    letter-spacing: 0.05em;
    font-weight: 400;
    transition: color 0.8s ease;
}

.section__line {
    display: block;
    width: 40px;
    height: 1px;
    background: var(--border-medium);
    transition: background-color 0.8s ease;
}

.section__title {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    transition: color 0.8s ease;
    /* h2 reset so the heading sits inline with the section number/line */
    margin: 0;
    line-height: 1;
    display: inline-block;
}

/* --- Hero --- */
.hero__name {
    font-family: 'Benguiat', var(--font-display);
    font-weight: 300;
    font-size: clamp(3rem, 5vw + 1rem, 5rem);
    letter-spacing: -0.06em;
    line-height: 1;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    transition: color 0.8s ease;
}

/* Hex prefix in monospace so 0 != O */
.hero__prefix {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 0.6em;
    color: var(--accent-gold);
    letter-spacing: 0;
    vertical-align: baseline;
}

/* Thin accent line between name and roles */
.hero__name::after {
    content: '';
    display: block;
    width: 40px;
    height: 1px;
    background: var(--accent-gold);
    margin-top: 0.75rem;
    opacity: 0.5;
}

/* Roles stacked vertically — intentional, not overflow */
.hero__roles {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.hero__role {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-secondary);
    letter-spacing: 0.03em;
    transition: color 0.8s ease;
}

/* --- Identity Image --- */
.identity__image {
    margin-top: 0.5rem;
    position: relative;
    align-self: flex-start;
    width: 160px;
    height: 160px;
}

.about__image {
    width: 160px;
    height: 160px;
    object-fit: cover;
    border-radius: 2px;
    opacity: 1;
    border: 1px solid var(--accent-gold);
    box-shadow: 0 0 0 1px rgba(180, 151, 90, 0.15);
    transition: box-shadow var(--transition-base);
}

.about__image:hover {
    box-shadow:
        0 0 0 1px rgba(180, 151, 90, 0.4),
        0 0 18px rgba(180, 151, 90, 0.25),
        0 0 36px rgba(180, 151, 90, 0.08);
}

/* Diamond corner decorators framing the portrait (matches .menu-box motif) */
.identity__image-corner {
    position: absolute;
    width: 6px;
    height: 6px;
    border: 1px solid var(--accent-gold);
    background: var(--bg-primary);
    transform: rotate(45deg);
    pointer-events: none;
    transition: background-color 0.8s ease, border-color 0.8s ease;
}
.identity__image-corner--tl { top: -4px; left: -4px; }
.identity__image-corner--tr { top: -4px; right: -4px; }
.identity__image-corner--bl { bottom: -4px; left: -4px; }
.identity__image-corner--br { bottom: -4px; right: -4px; }

/* --- Identity Tagline --- */
.identity__tagline {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-tertiary);
    letter-spacing: 0.08em;
    font-style: italic;
    opacity: 0.6;
    transition: color 0.8s ease;
}

/* --- About --- */
.about__text {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-secondary);
    transition: color 0.8s ease;
}

/* --- Experience (Nier menu-box) --- */
.menu-box {
    position: relative;
    border: 1px solid var(--border-medium);
    padding: 1rem 1.25rem;
    transition: border-color 0.8s ease;
}

/* Diamond decorators */
.menu-box::before,
.menu-box::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    border: 1px solid var(--border-medium);
    transform: rotate(45deg);
    transition: border-color 0.8s ease;
}

.menu-box::before {
    top: -4px;
    left: -4px;
}

.menu-box::after {
    bottom: -4px;
    right: -4px;
}

.exp-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 0;
    padding-left: 0.75rem;
    position: relative;
    cursor: none;
    transition: transform var(--transition-fast);
}

.exp-item:not(:last-child) {
    border-bottom: 1px solid var(--border-light);
}

.exp-item.is-expanded {
    transform: translateX(0.5rem);
}
@media (hover: hover) {
    .exp-item:hover {
        transform: translateX(0.5rem);
    }
}

/* Gold selection marker (Nier-style) */
.exp-item__marker {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) scaleY(0);
    width: 3px;
    height: 60%;
    background: var(--accent-gold);
    transition: transform var(--transition-base);
    border-radius: 1px;
}

.exp-item.is-expanded .exp-item__marker {
    transform: translateY(-50%) scaleY(1);
}
@media (hover: hover) {
    .exp-item:hover .exp-item__marker {
        transform: translateY(-50%) scaleY(1);
    }
}

.exp-item__role {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: var(--text-primary);
    transition: color 0.8s ease;
}

.exp-item__at {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--accent-gold);
}

.exp-item__company {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
    /* Expand tap target without changing visual size */
    padding: 0.4rem 0;
}

.exp-item__company:hover {
    color: var(--accent-red);
}

/* Expand affordance — small triangle that flips when item is open */
.exp-item__chevron {
    margin-left: auto;
    font-size: 0.7rem;
    line-height: 1;
    color: var(--text-tertiary);
    display: inline-block;
    transition: transform var(--transition-base), color var(--transition-fast);
    pointer-events: none;
    flex-shrink: 0;
}

.exp-item.is-expanded .exp-item__chevron {
    color: var(--accent-gold);
    transform: rotate(180deg);
}
@media (hover: hover) {
    .exp-item:hover .exp-item__chevron {
        color: var(--accent-gold);
        transform: rotate(180deg);
    }
}

/* --- Quantified stat chips (inline in experience roles) --- */
.exp-item__stats {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.45rem;
    order: 2; /* sit below the role line, above the expandable desc */
}

.stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.04em;
    color: var(--text-tertiary);
    border: 1px solid var(--border-light);
    padding: 0.15rem 0.45rem;
    line-height: 1.4;
    white-space: nowrap;
    transition: color 0.8s ease, border-color 0.8s ease;
}

/* Tech badge icon inside a chip */
.stat-chip i {
    color: var(--accent-gold);
    font-size: 0.64rem;
}

.stat-chip .stat-num {
    color: var(--accent-gold);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.stat-chip--tag {
    color: var(--text-secondary);
}

/* Keep the desc below the stats line */
.exp-item__desc { order: 3; }

/* --- OUTPUT: GitHub repo cards (reuse .exp-item grammar) --- */
.repo-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 0;
    padding-left: 0.75rem;
    position: relative;
    cursor: none;
    text-decoration: none;
    transition: transform var(--transition-fast);
}

.repo-item:not(:last-child) {
    border-bottom: 1px solid var(--border-light);
}

@media (hover: hover) {
    .repo-item:hover {
        transform: translateX(0.5rem);
    }
    .repo-item:hover .exp-item__marker {
        transform: translateY(-50%) scaleY(1);
    }
}

.repo-item__name {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: color 0.8s ease;
}

.repo-item:hover .repo-item__name {
    color: var(--accent-gold);
}

.repo-item__meta {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    color: var(--text-tertiary);
    letter-spacing: 0.03em;
    white-space: nowrap;
    transition: color 0.8s ease;
}

.repo-item__desc {
    width: 100%;
    font-family: var(--font-body);
    font-size: 0.7rem;
    color: var(--text-tertiary);
    line-height: 1.5;
    margin-top: 0.3rem;
}

/* --- TRANSMISSIONS: RSS feed log --- */
.feed {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.post-item {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    text-decoration: none;
    cursor: none;
    transition: transform var(--transition-fast);
}

@media (hover: hover) {
    .post-item:hover {
        transform: translateX(0.4rem);
    }
}

.post-item__date {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--accent-gold);
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.post-item__title {
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
    transition: color var(--transition-fast);
}

.post-item:hover .post-item__title {
    color: var(--accent-gold);
}

/* --- Meta row (Certs + Links each labeled) --- */
.meta__row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.45rem 0;
}

.meta__label {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    color: var(--accent-gold);
    text-transform: uppercase;
    /* 5rem fits "TRANSMIT" (the longest label) so all labels reserve the same
       column width and content lists start at the same x. */
    min-width: 5rem;
    flex-shrink: 0;
    transition: color 0.8s ease;
}

.meta__row .certs__list,
.meta__row .links__list {
    flex: 1 1 auto;
    /* Uniform list height so CERT badges and LINK icons sit on the same
       baseline, keeping vertical rhythm consistent in META. */
    min-height: 40px;
    align-items: center;
}

/* --- Certifications: bold mono with vertical separators + red character
   sweep (matches the hero v1n sweep, but black→red instead of black→gold) --- */
.certs__list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
}

.cert {
    position: relative;
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text-primary);
    transition: color 0.4s ease;
}

.cert + .cert {
    margin-left: 1.4rem;
}

/* Thin vertical separator centered between adjacent certs */
.cert + .cert::before {
    content: '';
    position: absolute;
    left: -0.7rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 0.9em;
    background: var(--border-medium);
    transition: background-color 0.8s ease;
}

/* --- Links: icon-only buttons (FontAwesome) --- */
.links__list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.link-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--text-primary);
    transition: color var(--transition-fast), transform var(--transition-fast);
}

.link-item i {
    font-size: 1.15rem;
    line-height: 1;
}

.link-item:hover {
    color: var(--accent-gold);
    transform: translateY(-1px);
}

.link-item:hover i {
    filter: drop-shadow(0 0 6px rgba(180, 151, 90, 0.35));
}

/* Text variant (BLOG) — plain mono wordmark, same weight as the icons */
.link-item--text {
    width: auto;
    padding: 0 0.15rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.18em;
}

/* --- Keyboard focus rings (cursor:none hides default cursor; users tabbing
   need to see where they are). Mirrors the gold hover treatment. --- */
.link-item:focus-visible,
.exp-item__company:focus-visible,
.sound-toggle:focus-visible,
.exp-item:focus-visible {
    outline: 1px solid var(--accent-gold);
    outline-offset: 4px;
    border-radius: 1px;
}

a:focus-visible {
    outline: 1px solid var(--accent-gold);
    outline-offset: 4px;
}

/* --- Footer --- */
.footer {
    grid-column: 1 / -1;
    padding-top: 1.5rem;
    align-self: end;
}

.footer__line {
    width: 30px;
    height: 1px;
    background: var(--border-medium);
    margin-bottom: 1rem;
    transition: background-color 0.8s ease;
}

.footer__text {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-tertiary);
    letter-spacing: 0.05em;
    transition: color 0.8s ease;
}

/* --- Nier: Scan Line (sweeps down on load) --- */
.scan-line {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
    z-index: 9998;
    pointer-events: none;
    opacity: 0.6;
    animation: scanSweep 1.8s var(--ease-out-expo) 0.2s forwards;
}

@keyframes scanSweep {
    0%   { transform: translateY(0); opacity: 0.6; }
    80%  { opacity: 0.3; }
    100% { transform: translateY(100vh); opacity: 0; }
}

/* --- Nier: Section Number Glitch --- */
@keyframes glitch {
    0%, 93%  { opacity: 1; transform: none; }
    94%      { opacity: 0.4; transform: translateX(2px); }
    95%      { opacity: 1; transform: translateX(-1px); }
    96%      { opacity: 0.6; transform: none; }
    97%      { opacity: 1; transform: translateX(1px); }
    98%, 100% { opacity: 1; transform: none; }
}

.section__number {
    animation: glitch 8s ease-in-out infinite;
}

.about .section__number  { animation-delay: 0s; }
.experience .section__number { animation-delay: 2s; }
.output .section__number { animation-delay: 6s; }
.transmissions .section__number { animation-delay: 8s; }
.meta .section__number  { animation-delay: 4s; }

/* --- Nier: System Text Flicker --- */
@keyframes sysFlicker {
    0%, 90%  { opacity: 0.5; }
    91%      { opacity: 0.1; }
    92%      { opacity: 0.5; }
    93%      { opacity: 0.15; }
    94%, 100% { opacity: 0.5; }
}

.sys-text.is-revealed {
    animation: cornerReveal 1s var(--ease-out-expo) forwards,
               sysFlicker 12s ease-in-out 1.5s infinite;
}

/* ============================================
   Hacking Mode (Konami Easter Egg)
   Visual aesthetic matches the Nier boot screen —
   dark CRT with vignette, scanlines, crosshatch grid,
   and chromatic aberration on key text.
   ============================================ */

/* Base layer — dark bg + 4px crosshatch, sits below site content.
   Fading this pseudo-element smooths the transition from the beige
   gradient to the dark hacking-mode palette (CSS can't interpolate
   between a gradient and a solid color directly). Matches the boot
   screen's own background exactly. */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        linear-gradient(0deg, rgba(100, 95, 85, 0.15) 1px, transparent 1px),
        linear-gradient(90deg, rgba(100, 95, 85, 0.15) 1px, transparent 1px),
        #0D0D0B;
    background-size: 4px 4px, 4px 4px, auto;
    opacity: 0;
    pointer-events: none;
    z-index: 0;
    transition: opacity 0.8s ease;
}

/* Foreground layer — CRT vignette + scanlines, sits above site content
   but below any transition overlays. Creates the curved-monitor feel
   without needing 3D transforms. Kept intentionally subtle so content
   stays comfortably readable. */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.38) 100%),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.10) 2px,
            rgba(0, 0, 0, 0.10) 4px
        );
    opacity: 0;
    pointer-events: none;
    z-index: 3000;
    transition: opacity 0.8s ease;
}

body.hacking-mode::before,
body.hacking-mode::after {
    opacity: 1;
}

/* Boot-screen palette */
body.hacking-mode {
    --bg-primary: #0D0D0B;
    --bg-secondary: #15150E;
    --text-primary: #D4CFC5;
    --text-secondary: #9A958B;
    --text-tertiary: #6A6258;
    --border-light: #3A3A3A;
    --border-medium: #4A4A4A;
}

/* Suppress the resting 6px .dot-overlay in hacking mode — the 4px grid
   on body::before provides the crosshatch here, and stacking both creates
   a moiré-dense pattern that muddies text. */
body.hacking-mode .dot-overlay {
    opacity: 0;
    transition: opacity 0.8s ease;
}

/* Chromatic aberration on the hero name — mirrors the boot-header treatment. */
body.hacking-mode .hero__name {
    text-shadow:
        -2.5px 0 0 rgba(255, 60, 60, 0.55),
        2.5px 0 0 rgba(60, 120, 255, 0.55);
    animation: hackingGlow 2s ease-in-out infinite;
}

@keyframes hackingGlow {
    0%, 100% {
        text-shadow:
            -2.5px 0 0 rgba(255, 60, 60, 0.55),
            2.5px 0 0 rgba(60, 120, 255, 0.55),
            0 0 0 rgba(212, 207, 197, 0);
    }
    50% {
        text-shadow:
            -2.5px 0 0 rgba(255, 60, 60, 0.55),
            2.5px 0 0 rgba(60, 120, 255, 0.55),
            0 0 14px rgba(212, 207, 197, 0.45);
    }
}

/* Subtle aberration on secondary text so the whole UI reads as the
   glitched boot layer, not just the hero name. */
body.hacking-mode .hero__role,
body.hacking-mode .section__label,
body.hacking-mode .section__number,
body.hacking-mode .exp-item__role,
body.hacking-mode .exp-item__company,
body.hacking-mode .repo-item__name,
body.hacking-mode .post-item__title,
body.hacking-mode .cert,
body.hacking-mode .meta__label,
body.hacking-mode .footer__text,
body.hacking-mode .identity__tagline,
body.hacking-mode .about__text {
    text-shadow:
        -1px 0 0 rgba(255, 60, 60, 0.28),
        1px 0 0 rgba(60, 120, 255, 0.28);
}

.hacking-overlay {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    pointer-events: none;
    opacity: 1;
    transition: opacity 1.2s ease;
}

.hacking-overlay.is-fading {
    opacity: 0;
}

.hacking-overlay__text {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    letter-spacing: 0.3em;
    color: #B4975A;
    text-shadow:
        -1.5px 0 0 rgba(255, 60, 60, 0.45),
        1.5px 0 0 rgba(60, 120, 255, 0.45);
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-gold);
}

/* --- Selection --- */
::selection {
    background: var(--accent-gold);
    color: var(--bg-primary);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    /* Flatten the two column wrappers so every section becomes a direct
       flex item of .site and can be ordered freely — this keeps META after
       the right-column content instead of before EXPERIENCE on mobile. */
    .col-identity,
    .col-content {
        display: contents;
    }

    .site {
        display: flex;
        flex-direction: column;
        min-height: auto;
        padding: 2.5rem 1.25rem;
        gap: 2.5rem;
    }

    .identity-block { order: 1; }
    .about          { order: 2; }
    .experience     { order: 3; }
    .output         { order: 4; }
    .transmissions  { order: 5; }
    .meta           { order: 6; }
    .footer         { order: 7; }

    /* Left-column dividers are desktop-only; the flex gap spaces them on mobile */
    .col-identity > .about,
    .col-identity > .meta {
        border-top: none;
        padding-top: 0;
    }

    .divider,
    .tri-dots {
        display: none;
    }

    .identity-block {
        gap: 1.5rem;
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        align-items: center;
    }

    .identity-block .hero {
        grid-column: 1;
        grid-row: 1;
    }

    .identity-block .identity__image {
        grid-column: 2;
        grid-row: 1;
        margin-top: 0;
    }

    .identity-block .identity__tagline {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .hero__name {
        font-size: clamp(2.5rem, 10vw, 4rem);
        margin-bottom: 1rem;
    }

    .identity__image {
        width: 80px;
        height: 80px;
    }

    .about__image {
        width: 80px;
        height: 80px;
    }

    /* Bump diamond corners up so they're actually visible at 80px portrait size */
    .identity__image-corner {
        width: 8px;
        height: 8px;
    }
    .identity__image-corner--tl { top: -5px; left: -5px; }
    .identity__image-corner--tr { top: -5px; right: -5px; }
    .identity__image-corner--bl { bottom: -5px; left: -5px; }
    .identity__image-corner--br { bottom: -5px; right: -5px; }

    .col-content {
        padding-left: 0;
    }

    .col-content > section {
        padding: 1.25rem 0;
    }

    /* Experience items: role on its own line, "@ Company" on the second line.
       Prevents the orphaned-@ glitch when the role is too long for one row. */
    .exp-item {
        padding: 0.5rem 0;
        padding-left: 0.75rem;
    }
    .exp-item__role {
        flex: 0 0 100%;
        font-size: 0.85rem;
    }
    .exp-item__at,
    .exp-item__company {
        font-size: 0.8rem;
    }
    .exp-item__at {
        margin-left: 0.5rem;
    }
    /* Chevron pinned to top-right of the wrapped item, so it doesn't get
       trapped on the @ Company line */
    .exp-item__chevron {
        position: absolute;
        top: 0.6rem;
        right: 0.25rem;
    }

    /* META rows: stack label above content on mobile so all icons/badges
       can use the full row width. Uniform 44px list height keeps the
       vertical rhythm symmetric. */
    .meta__row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.5rem 0;
    }
    .meta__label {
        min-width: 0;
    }
    .meta__row .links__list,
    .meta__row .certs__list {
        min-height: 44px;
        gap: 0.85rem;
    }

    /* Bring back the SFX toggle — boot still plays audio on mobile so
       muting needs to be reachable. Move to bottom-left to avoid the
       portrait corner. */
    .sound-toggle {
        display: block;
        top: auto;
        right: auto;
        bottom: 1.25rem;
        left: 1.25rem;
        font-size: 0.55rem;
        padding: 0.45rem 0.7rem;
    }

    .frame-corner,
    .sys-text {
        display: none;
    }

    .cursor-dot,
    .cursor-ring {
        display: none;
    }

    body {
        cursor: auto;
    }

    a {
        cursor: pointer;
    }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    .hero,
    .identity__image,
    .identity__tagline,
    .about,
    .experience,
    .output,
    .transmissions,
    .meta,
    .certs,
    .links,
    .footer {
        animation: none;
        opacity: 1;
    }

    .frame-corner,
    .sys-text {
        animation: none;
        opacity: 1;
    }

    .cursor-dot,
    .cursor-ring {
        display: none;
    }

    body {
        cursor: auto;
    }

    a {
        cursor: pointer;
    }

    #particles {
        display: none;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
    }
}
