:root {
    --background: 220 20% 7%;
    --foreground: 210 20% 90%;
    --card: 220 18% 10%;
    --card-foreground: 210 20% 90%;
    --primary: 160 100% 45%;
    --primary-foreground: 220 20% 7%;
    --secondary: 220 15% 16%;
    --secondary-foreground: 210 20% 90%;
    --muted: 220 15% 16%;
    --muted-foreground: 215 15% 55%;
    --accent: 200 100% 55%;
    --accent-foreground: 220 20% 7%;
    --border: 220 15% 18%;
    --input: 220 15% 18%;
    --ring: 160 100% 45%;
    --radius: 0.5rem;
    --terminal: 160 100% 45%;
    --glow: 160 100% 45%;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
}

.text-outline {
    color: transparent;
    -webkit-text-stroke: 2px hsl(var(--foreground));
}

.bg-scanlines {
    background-image: repeating-linear-gradient(0deg, transparent, transparent 3px, hsl(var(--border) / 0.1) 3px, hsl(var(--border) / 0.1) 4px);
}

.bg-circuit {
    background-image: linear-gradient(90deg, hsl(var(--border) / 0.3) 1px, transparent 1px), linear-gradient(hsl(var(--border) / 0.3) 1px, transparent 1px), radial-gradient(hsl(var(--primary) / 0.08) 2px, transparent 2px);
    background-size: 80px 80px, 80px 80px, 40px 40px;
    background-position: 0 0, 0 0, 20px 20px;
}

.bg-diagonal {
    background-image: repeating-linear-gradient(-45deg, transparent, transparent 30px, hsl(var(--border) / 0.25) 30px, hsl(var(--border) / 0.25) 31px);
}

.bg-dots {
    background-image: radial-gradient(hsl(var(--border) / 0.7) 1px, transparent 1px);
    background-size: 24px 24px;
}

.bg-isometric {
    background-image:
        repeating-linear-gradient(21deg, transparent, transparent 24px, hsl(var(--border) / 0.2) 24px, hsl(var(--border) / 0.2) 25px),
        repeating-linear-gradient(-21deg, transparent, transparent 24px, hsl(var(--border) / 0.2) 24px, hsl(var(--border) / 0.2) 25px);
}

.bg-crosshatch {
    background-image:
        repeating-linear-gradient(45deg, transparent, transparent 24px, hsl(var(--border) / 0.2) 24px, hsl(var(--border) / 0.2) 25px),
        repeating-linear-gradient(-45deg, transparent, transparent 24px, hsl(var(--border) / 0.2) 24px, hsl(var(--border) / 0.2) 25px);
}

.bg-radial-glow {
    background-image:
        radial-gradient(ellipse at 20% 50%, hsl(var(--primary) / 0.06) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 80%, hsl(var(--accent) / 0.04) 0%, transparent 50%);
}

.text-glow {
    text-shadow: 0 0 20px hsl(var(--terminal) / 0.5), 0 0 40px hsl(var(--terminal) / 0.2);
}

.border-glow {
    box-shadow: 0 0 15px hsl(var(--terminal) / 0.15), inset 0 0 15px hsl(var(--terminal) / 0.05);
}

.bg-grid {
    background-image:
        linear-gradient(hsl(var(--border) / 0.5) 1px, transparent 1px),
        linear-gradient(90deg, hsl(var(--border) / 0.5) 1px, transparent 1px);
    background-size: 60px 60px;
}

/* Mobile menu toggle animation */
#menu-icon-open,
#menu-icon-close {
    position: absolute;
    inset: 0;
    transition: opacity 0.2s ease, transform 0.25s ease;
}

#menu-icon-open {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

#menu-icon-close {
    opacity: 0;
    transform: rotate(-45deg) scale(0.75);
}

#menu-toggle.menu-open #menu-icon-open {
    opacity: 0;
    transform: rotate(45deg) scale(0.75);
}

#menu-toggle.menu-open #menu-icon-close {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* Mobile menu animation */
#mobile-menu {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-0.5rem);
    transition:
        max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.3s ease,
        transform 0.3s ease;
}

#mobile-menu.open {
    max-height: 500px;
    opacity: 1;
    transform: translateY(0);
}

#mobile-menu li {
    opacity: 0;
    transform: translateX(-0.75rem);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

#mobile-menu.open li:nth-child(1) {
    opacity: 1;
    transform: none;
    transition-delay: 0.07s;
}

#mobile-menu.open li:nth-child(2) {
    opacity: 1;
    transform: none;
    transition-delay: 0.12s;
}

#mobile-menu.open li:nth-child(3) {
    opacity: 1;
    transform: none;
    transition-delay: 0.17s;
}

#mobile-menu.open li:nth-child(4) {
    opacity: 1;
    transform: none;
    transition-delay: 0.22s;
}

#mobile-menu.open li:nth-child(5) {
    opacity: 1;
    transform: none;
    transition-delay: 0.27s;
}

#mobile-menu.open li:nth-child(6) {
    opacity: 1;
    transform: none;
    transition-delay: 0.32s;
}

#mobile-menu.open li:nth-child(7) {
    opacity: 1;
    transform: none;
    transition-delay: 0.37s;
}

/* Scroll animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(2rem);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Section content reveal after typewriter titles */
.section-content {
    opacity: 0;
    transform: translateY(1rem);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.titles-done .section-content {
    opacity: 1;
    transform: translateY(0);
}

/* Album card staggered reveal */
.album-item {
    opacity: 0;
    transform: translateX(3rem);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.titles-done .album-item {
    opacity: 1;
    transform: translateX(0);
}

/* Project card staggered reveal */
.project-card {
    opacity: 0;
    transform: translateX(3rem);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.titles-done .project-card {
    opacity: 1;
    transform: translateX(0);
}

/* Timeline line draw animation */
.timeline-line {
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 1.2s ease-out;
}

.titles-done .timeline-line {
    transform: scaleX(1);
}

/* Timeline dot animation */
.timeline-item {
    opacity: 0;
    transform: translateX(-1.25rem);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

#experience .timeline-item {
    opacity: 0;
    transform: translateX(-1.25rem);
}

.experience-arrows {
    opacity: 0;
    transition: opacity 0.4s ease 0.2s;
}

#experience.titles-done .experience-arrows {
    opacity: 1;
}

#experience.titles-done .timeline-item {
    opacity: 1;
    transform: translateX(0);
}

/* Blink cursor */
@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.animate-blink {
    animation: blink 1s step-end infinite;
}

/* Section titles */
.section-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 3.25rem;
    line-height: 1;
    min-height: 3.25rem;
}

/* Typewriter section titles */
.typewriter-title {
    min-height: 1.2em;
}

.typewriter-cursor {
    display: inline-block;
    width: 0.4em;
    height: 0.75em;
    background: hsl(var(--primary));
    vertical-align: middle;
    margin-left: 1px;
    animation: blink 1s step-end infinite;
}

/* About window maximize */
#about-paragraphs {
    transition: opacity 0.3s ease;
}

#about-win-col.win-maximized {
    position: fixed !important;
    z-index: 60;
    margin: 0 !important;
    transition:
        left 0.45s cubic-bezier(0.4, 0, 0.2, 1),
        width 0.45s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

#about-backdrop {
    position: fixed;
    inset: 0;
    z-index: 59;
    background: rgba(0, 0, 0, 0);
    pointer-events: none;
    transition: background 0.4s ease;
}

#about-backdrop.active {
    background: rgba(0, 0, 0, 0.55);
    pointer-events: auto;
}

/* Section navigation dots */
.section-dot {
    display: block;
    width: 0.6em;
    height: 0.6em;
    border-radius: 9999px;
    background: hsl(var(--muted-foreground) / 0.3);
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.section-dot:hover {
    background: white;
}

.section-dot.active {
    background: hsl(var(--primary));
    transform: scale(1.5);
    box-shadow: 0 0 8px hsl(var(--primary) / 0.5);
}

/* === Contact form submit indicator === */

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

#contact-spinner svg {
    animation: spin 0.8s linear infinite;
}

/* === Portfolio card effects === */

/* Animated gradient border sweep */
@property --card-border-angle {
    syntax: '<angle>';
    inherits: false;
    initial-value: 0turn;
}

@keyframes card-border-rotate {
    to {
        --card-border-angle: 1turn;
    }
}

.project-card {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.project-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: conic-gradient(from var(--card-border-angle), transparent 0%, hsl(var(--primary) / 0.9) 10%, hsl(var(--accent) / 0.7) 22%, transparent 38%);
    animation: card-border-rotate 2.5s linear infinite;
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
    z-index: 0;
}

.project-card:hover::before,
.project-card.active::before {
    opacity: 1;
}

.project-card.active .easter-egg {
    opacity: 1;
}

/* === Threat Registry Marquee === */

@keyframes threat-blink {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 5px hsl(0 100% 50%);
    }

    50% {
        opacity: 0.25;
        box-shadow: none;
    }
}

@keyframes secure-blink {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 5px hsl(160 100% 45%);
    }

    50% {
        opacity: 0.25;
        box-shadow: none;
    }
}

@keyframes marquee-scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

@keyframes registry-scanline {
    0% {
        top: 0;
        opacity: 0.06;
    }

    50% {
        opacity: 0.12;
    }

    100% {
        top: 100%;
        opacity: 0.06;
    }
}

@keyframes terminal-flicker {

    0%,
    95%,
    100% {
        opacity: 1;
    }

    96% {
        opacity: 0.85;
    }

    97% {
        opacity: 1;
    }

    98% {
        opacity: 0.9;
    }
}

@keyframes contact-glitch {

    0%,
    88%,
    100% {
        clip-path: none;
        transform: none;
        color: inherit;
    }

    89% {
        clip-path: inset(15% 0 70% 0);
        transform: translate(-4px, 0);
        color: hsl(0 100% 60%);
    }

    90% {
        clip-path: inset(65% 0 15% 0);
        transform: translate(4px, 0);
        color: hsl(200 100% 60%);
    }

    91% {
        clip-path: inset(35% 0 45% 0);
        transform: translate(-2px, 0);
    }

    92% {
        clip-path: none;
        transform: none;
    }
}

@keyframes threat-blink-game {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 5px hsl(38 100% 50%);
    }

    50% {
        opacity: 0.25;
        box-shadow: none;
    }
}

/* Threat chip — movie (default: red) */
.threat-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 14px 7px 10px;
    background: hsl(220 20% 7%);
    border: 1px solid hsl(0 85% 50% / 0.22);
    border-radius: 2px;
    flex-shrink: 0;
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.25s, background 0.25s;
    white-space: nowrap;
}

.threat-chip:hover {
    border-color: hsl(0 85% 50% / 0.6);
    background: hsl(0 85% 50% / 0.06);
}

.threat-chip:hover .threat-status-dot {
    animation-play-state: paused;
    opacity: 1;
    box-shadow: 0 0 10px hsl(0 100% 55%), 0 0 20px hsl(0 100% 55% / 0.4);
}

/* Threat chip — game (amber) */
.threat-chip.game {
    border-color: hsl(38 95% 50% / 0.22);
}

.threat-chip.game:hover {
    border-color: hsl(38 95% 50% / 0.6);
    background: hsl(38 95% 50% / 0.06);
}

.threat-chip.game:hover .threat-status-dot {
    box-shadow: 0 0 10px hsl(38 100% 55%), 0 0 20px hsl(38 100% 55% / 0.4);
}

.threat-chip.game .threat-status-dot {
    background: hsl(38 100% 50%);
    animation-name: threat-blink-game;
}

.threat-chip.game .threat-unit {
    color: hsl(38 85% 40%);
}

.threat-chip.game .threat-active {
    color: hsl(38 100% 55%);
}

.threat-chip.game .threat-type-badge {
    background: hsl(38 95% 50% / 0.12);
    border-color: hsl(38 95% 50% / 0.3);
    color: hsl(38 100% 55%);
}

.threat-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: hsl(0 100% 50%);
    flex-shrink: 0;
    animation: threat-blink 1.4s ease-in-out infinite;
}

.threat-unit {
    font-size: 9px;
    color: hsl(0 85% 45%);
    letter-spacing: 0.12em;
    line-height: 1;
    margin-bottom: 2px;
}

.threat-name {
    font-size: 11px;
    font-weight: 700;
    color: hsl(210 20% 88%);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.2;
}

.threat-source {
    font-size: 9px;
    color: hsl(215 15% 42%);
    letter-spacing: 0.04em;
    line-height: 1;
    margin-top: 2px;
}

.threat-active {
    font-size: 9px;
    font-weight: 700;
    color: hsl(0 100% 55%);
    letter-spacing: 0.18em;
    margin-left: 4px;
}

.threat-type-badge {
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.14em;
    padding: 1px 5px;
    border-radius: 2px;
    border: 1px solid hsl(0 85% 50% / 0.3);
    background: hsl(0 85% 50% / 0.1);
    color: hsl(0 100% 60%);
    text-transform: uppercase;
    flex-shrink: 0;
}

/* Marquee container */
.threat-track {
    display: flex;
    align-items: center;
    gap: 10px;
    width: max-content;
    animation: marquee-scroll 90s linear infinite;
}

.threat-track:hover {
    animation-play-state: paused;
}

.threat-marquee-wrap {
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent 0px, #000 64px, #000 calc(100% - 64px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0px, #000 64px, #000 calc(100% - 64px), transparent 100%);
}

/* Registry panel */
.registry-panel {
    border: 1px solid hsl(0 85% 50% / 0.2);
    border-radius: 3px;
    background: hsl(0 50% 6% / 0.4);
    overflow: hidden;
    position: relative;
}

.registry-panel::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(180deg, hsl(0 100% 45% / 0.07), transparent);
    pointer-events: none;
    animation: registry-scanline 5s linear infinite;
}

.registry-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    border-bottom: 1px solid hsl(0 85% 50% / 0.18);
    background: hsl(0 50% 5% / 0.6);
}

/* Contact form inputs */
.contact-input {
    background: hsl(160 30% 8%);
    border: 1px solid hsl(160 100% 45% / 0.18);
    transition: border-color 0.2s;
}

.contact-input:focus {
    border-color: hsl(160 80% 35%);
    outline: none;
}

.contact-input::placeholder {
    color: hsl(160 40% 30%);
}

.contact-label {
    color: hsl(160 100% 40%);
}

.contact-intro {
    color: hsl(160 50% 40%);
}

@media (max-width: 639px) {
    textarea.contact-input {
        background-image: url("../images/vault-tec-watermark.faed90397dd9.svg");
        background-repeat: no-repeat;
        background-position: center center;
        background-size: 60%;
    }
}

/* Vault-Tec stamp in secure frame header */
.vault-tec-stamp {
    position: relative;
    cursor: pointer;
}

.vault-tec-stamp::after {
    content: 'This transmission is routed through Vault-Tec Secure Communications.';
    position: absolute;
    top: 50%;
    right: calc(100% + 10px);
    transform: translateY(-50%);
    width: 250px;
    padding: 6px 10px;
    background: hsl(160 60% 3%);
    border: 1px solid hsl(160 100% 45% / 0.25);
    color: hsl(160 50% 40%);
    font-family: monospace;
    font-size: 0.65rem;
    line-height: 1.5;
    letter-spacing: 0.02em;
    border-radius: 2px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.vault-tec-stamp:hover::after {
    opacity: 1;
}

.vault-tec-stamp-logo {
    height: 32px;
    width: auto;
    opacity: 0.18;
    transition: opacity 0.3s;
}

.vault-tec-stamp-logo:hover {
    opacity: 0.7;
}

/* Secure transmission frame */
.secure-frame {
    border: 1px solid hsl(160 100% 45% / 0.18);
    border-radius: 3px;
    background: hsl(160 60% 3% / 0.3);
    animation: terminal-flicker 12s ease-in-out infinite;
}

.secure-frame-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    border-bottom: 1px solid hsl(160 100% 45% / 0.15);
    background: hsl(160 60% 3% / 0.5);
}

.secure-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: hsl(160 100% 45%);
    flex-shrink: 0;
    animation: secure-blink 2.5s ease-in-out infinite;
    animation-delay: 0.5s;
}

/* Glitchy section label */
.contact-label-glitch {
    position: relative;
    display: inline-block;
}

.contact-label-glitch::before,
.contact-label-glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
    color: hsl(160 100% 45%);
}

.contact-label-glitch::before {
    animation: contact-glitch 9s ease-in-out infinite;
    animation-delay: 0.5s;
    color: hsl(0 100% 60% / 0.7);
    clip-path: inset(0);
}

.contact-label-glitch::after {
    animation: contact-glitch 9s ease-in-out infinite;
    animation-delay: 1s;
    color: hsl(200 100% 60% / 0.7);
    clip-path: inset(0);
    transform: translate(2px, 0);
}

/* Staggered blink delays for organic rhythm */
.threat-chip:nth-child(2) .threat-status-dot {
    animation-delay: 0.2s;
}

.threat-chip:nth-child(3) .threat-status-dot {
    animation-delay: 0.7s;
}

.threat-chip:nth-child(4) .threat-status-dot {
    animation-delay: 0.4s;
}

.threat-chip:nth-child(5) .threat-status-dot {
    animation-delay: 1.1s;
}

.threat-chip:nth-child(6) .threat-status-dot {
    animation-delay: 0.3s;
}

.threat-chip:nth-child(7) .threat-status-dot {
    animation-delay: 0.9s;
}

.threat-chip:nth-child(8) .threat-status-dot {
    animation-delay: 0.6s;
}

.threat-chip:nth-child(9) .threat-status-dot {
    animation-delay: 1.3s;
}

.threat-chip:nth-child(10) .threat-status-dot {
    animation-delay: 0.8s;
}

.threat-chip:nth-child(11) .threat-status-dot {
    animation-delay: 0.15s;
}

.threat-chip:nth-child(12) .threat-status-dot {
    animation-delay: 0.55s;
}

.threat-chip:nth-child(13) .threat-status-dot {
    animation-delay: 0.95s;
}

.threat-chip:nth-child(14) .threat-status-dot {
    animation-delay: 0.35s;
}

.threat-chip:nth-child(15) .threat-status-dot {
    animation-delay: 1.05s;
}

.threat-chip:nth-child(16) .threat-status-dot {
    animation-delay: 0.25s;
}

.threat-chip:nth-child(17) .threat-status-dot {
    animation-delay: 0.75s;
}

.threat-chip:nth-child(18) .threat-status-dot {
    animation-delay: 0.45s;
}

.threat-chip:nth-child(19) .threat-status-dot {
    animation-delay: 1.2s;
}

.threat-chip:nth-child(20) .threat-status-dot {
    animation-delay: 0.65s;
}

.threat-chip:nth-child(21) .threat-status-dot {
    animation-delay: 0.85s;
}

.threat-chip:nth-child(22) .threat-status-dot {
    animation-delay: 0.35s;
}

.threat-chip:nth-child(23) .threat-status-dot {
    animation-delay: 1.15s;
}

.threat-chip:nth-child(24) .threat-status-dot {
    animation-delay: 0.55s;
}

.threat-chip:nth-child(25) .threat-status-dot {
    animation-delay: 0.7s;
}

.threat-chip:nth-child(26) .threat-status-dot {
    animation-delay: 1.0s;
}

/* === Education section === */
.text-dim {
    color: hsl(215 15% 38%);
}

.text-dimmer {
    color: hsl(215 15% 32%);
}

.text-amber {
    color: hsl(38 100% 55%);
}

.pre-table {
    font-family: ui-monospace, 'Menlo', 'Monaco', 'Consolas', 'Liberation Mono', 'Courier New', monospace !important;
    font-feature-settings: 'liga' 0, 'kern' 0;
    font-kerning: none;
}

.cert-card {
    border-radius: 2px;
    overflow: hidden;
    border: 1px solid hsl(var(--primary) / 0.2);
    background: hsl(var(--background));
}

.cert-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid hsl(var(--primary) / 0.12);
    background: hsl(var(--primary) / 0.04);
}

.award-card {
    border-radius: 2px;
    overflow: hidden;
    border: 1px solid hsl(38 95% 50% / 0.2);
    background: hsl(var(--background));
}

.award-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid hsl(38 95% 50% / 0.12);
    background: hsl(38 95% 50% / 0.04);
}

/* === Contact form: override browser autofill background === */

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px hsl(var(--secondary)) inset !important;
    -webkit-text-fill-color: hsl(var(--foreground)) !important;
    transition: background-color 5000s ease-in-out 0s !important;
    caret-color: hsl(var(--foreground));
}

/* === Money page scrollbars === */
.money-sidebar::-webkit-scrollbar,
.money-main-left::-webkit-scrollbar {
    width: 6px;
}

.money-sidebar::-webkit-scrollbar-track,
.money-main-left::-webkit-scrollbar-track {
    background: hsl(var(--background));
}

.money-sidebar::-webkit-scrollbar-thumb,
.money-main-left::-webkit-scrollbar-thumb {
    background: hsl(var(--border));
    border-radius: 3px;
}

.money-sidebar::-webkit-scrollbar-thumb:hover,
.money-main-left::-webkit-scrollbar-thumb:hover {
    background: hsl(var(--primary) / 0.4);
}
