/* TUI Hardcore Theme */
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@300;400;500;600&family=VT323&display=swap');

:root {
    --font-mono: 'Fira Code', monospace;
    --font-pixel: 'VT323', monospace;

    /* Colors */
    --color-bg: #050505;
    --color-terminal-green: #4af626;
    /* Phosphor Green */
    --color-terminal-dim: #1a4d10;
    --color-terminal-amber: #ffca28;
    --color-text-main: #e6e6e6;
    --color-text-muted: #b0b0b0;

    /* Layout */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;

    --border-sharp: 1px solid var(--color-terminal-green);
    --border-dim: 1px solid var(--color-terminal-dim);
}

/* Reset & Base */
* {
    box-sizing: border-box;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text-main);
    font-family: var(--font-mono);
    margin: 0;
    line-height: 1.6;
    overflow-x: hidden;
    user-select: none;
    /* Disable text selection */
    -webkit-user-select: none;
}

input,
textarea {
    user-select: text;
    -webkit-user-select: text;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-mono);
    text-transform: uppercase;
    margin: 0 0 1rem 0;
    line-height: 1.2;
}

h1 {
    font-size: 2.5rem;
    color: var(--color-terminal-amber);
    text-shadow: 2px 2px 0px var(--color-terminal-dim);
}

h2 {
    font-size: 1.8rem;
    color: var(--color-terminal-green);
    border-bottom: 2px solid var(--color-terminal-dim);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    position: relative;
    letter-spacing: 2px;
}

/* HUD Header Decoration: Status Light */
h2::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    background: var(--color-terminal-green);
    box-shadow: 0 0 10px var(--color-terminal-green);
    animation: blink-status 2s infinite;
}

/* HUD Header Decoration: System ID */
h2::after {
    content: '[ SYS.RDY ]';
    position: absolute;
    right: 0;
    font-family: var(--font-pixel);
    font-size: 1rem;
    color: var(--color-terminal-dim);
    letter-spacing: 1px;
}

/* Animated Tech Icons */
.tech-icon {
    margin-right: 0.5rem;
    color: var(--color-terminal-amber);
    display: inline-block;
}

.spin-slow {
    animation: spin-cw 10s linear infinite;
}

.pulse-tech {
    animation: pulse-tech 3s ease-in-out infinite;
}

@keyframes spin-cw {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse-tech {

    0%,
    100% {
        opacity: 0.6;
        text-shadow: 0 0 0 transparent;
    }

    50% {
        opacity: 1;
        text-shadow: 0 0 8px var(--color-terminal-amber);
    }
}

@keyframes blink-status {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

h3 {
    font-size: 1.2rem;
    color: var(--color-terminal-amber);
    margin-bottom: 0.5rem;
}

a {
    color: var(--color-terminal-green);
    text-decoration: none;
    transition: all 0.2s;
}

a:hover {
    background-color: var(--color-terminal-green);
    color: var(--color-bg);
}

p {
    margin-bottom: 1rem;
}

/* Layout Containers (Replacing Tailwind) */
.container {
    max-width: 1024px;
    margin: 0 auto;
    padding: var(--spacing-sm);
    padding-top: var(--spacing-lg);
}

.flex-col {
    display: flex;
    flex-direction: column;
}

.flex-row {
    display: flex;
    flex-direction: row;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

.gap-8 {
    gap: 2rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-8 {
    margin-bottom: 2rem;
}

.mb-12 {
    margin-bottom: 3rem;
}

/* Responsive adjustments */
@media (min-width: 768px) {
    .md-flex-row {
        flex-direction: row;
    }

    .md-text-left {
        text-align: left;
    }

    .grid-2 {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-sm);
    }
}

/* Component: Sections (Cyberpunk Window) */
.tui-section {
    background-color: rgba(5, 5, 5, 0.7);
    border: 1px solid var(--color-terminal-dim);
    border-top: 1px solid var(--color-terminal-green);
    /* Top highlight */
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    position: relative;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    background-image:
        linear-gradient(rgba(26, 77, 16, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(26, 77, 16, 0.05) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Corner Brackets */
.tui-section::before {
    content: '';
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 15px;
    height: 15px;
    border-bottom: 2px solid var(--color-terminal-green);
    border-right: 2px solid var(--color-terminal-green);
}

.tui-section::after {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    width: 10px;
    height: 10px;
    border-top: 2px solid var(--color-terminal-green);
    border-left: 2px solid var(--color-terminal-green);
}


/* Component: Header Profile */
.profile-wrapper {
    position: relative;
    display: block;
    /* Flex item behavior */
    width: 164px;
    /* Force fit image + border */
    height: 164px;
    flex: none;
    /* Prevent growing/shrinking */
    margin-right: 2rem;
    /* Spacing from text */
    overflow: visible;
}

.profile-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* FaceID Scanner */
    background: linear-gradient(180deg,
            rgba(74, 246, 38, 0) 0%,
            rgba(74, 246, 38, 0.5) 50%,
            rgba(74, 246, 38, 0.8) 55%,
            rgba(74, 246, 38, 0) 60%);
    background-size: 100% 200%;
    background-position: 0% 0%;
    opacity: 0.7;
    animation: face-id-scan 3s ease-in-out infinite alternate;
    pointer-events: none;
    border-radius: 50%;
    z-index: 2;
    box-shadow: inset 0 0 10px rgba(74, 246, 38, 0.1);
}

.profile-wrapper:has(.profile-img.square)::after {
    border-radius: 0;
}

@keyframes face-id-scan {
    0% {
        background-position: 0% -150%;
    }

    100% {
        background-position: 0% 250%;
    }
}

.profile-img {
    width: 160px;
    height: 160px;
    object-fit: cover;
    border: 2px solid var(--color-terminal-green);
    border-radius: 50%;
    background: transparent;
    filter: grayscale(100%) contrast(120%);
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.profile-img:hover {
    filter: none;
    border-color: var(--color-terminal-amber);
}

/* Interactive Elements (Buttons) */
.btn {
    display: inline-block;
    background: transparent;
    border: var(--border-sharp);
    color: var(--color-terminal-green);
    padding: 0.8rem 1.5rem;
    font-family: var(--font-mono);
    text-transform: uppercase;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    transition: all 0.1s steps(2);
    box-shadow: 2px 2px 0px var(--color-terminal-dim);
}

.btn:hover {
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0px var(--color-terminal-green);
    background-color: var(--color-terminal-dim);
}

.btn:active {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0px var(--color-terminal-green);
}

/* Visitor Intel Widget */
.visitor-intel {
    margin-top: 1rem;
    font-family: var(--font-pixel);
    font-size: 0.9rem;
    color: var(--color-terminal-dim);
    border-top: 1px dotted var(--color-terminal-dim);
    padding-top: 0.5rem;
    text-align: center;
    width: 100%;
}

.intel-label {
    display: block;
    font-size: 0.7rem;
    margin-bottom: 0.2rem;
    color: var(--color-terminal-green);
    opacity: 0.7;
}

.intel-data {
    color: var(--color-terminal-amber);
    animation: pulse-tech 2s infinite;
}

/* Skills: Wireframe Box Style */
/* Skills: Terminal Chip Style */
.skill-tag {
    display: inline-block;
    background: rgba(26, 77, 16, 0.1);
    /* Subtle solid fill */
    border: 1px solid var(--color-terminal-green);
    color: var(--color-terminal-green);
    padding: 0.4rem 0.8rem;
    /* Slightly tighter padding */
    margin: 0.4rem;
    /* More distinct separation */
    font-family: var(--font-mono);
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    cursor: crosshair;
    transition: all 0.2s ease;
    text-shadow: none;
    box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.5);
    /* Physical depth */
}

.skill-tag:hover {
    background-color: var(--color-terminal-green);
    color: var(--color-bg);
    box-shadow: 0 0 15px var(--color-terminal-green);
    transform: translateY(-2px);
    font-weight: bold;
}


/* Timeline: Circuit Node Style */
.timeline-item {
    border-left: 2px dotted var(--color-terminal-dim);
    /* Circuit trace */
    padding-left: 2rem;
    margin-left: 0.5rem;
    margin-bottom: 2.5rem;
    position: relative;
}

/* Last item trace fade */
.timeline-item:last-child {
    border-image: linear-gradient(to bottom, var(--color-terminal-dim) 50%, transparent 100%) 1 100%;
    border-left-style: solid;
}

.timeline-icon {
    position: absolute;
    left: -1rem;
    /* Center on line */
    top: 0;
    width: 2.2rem;
    height: 2.2rem;
    background: var(--color-bg);
    border: 1px solid var(--color-terminal-green);
    color: var(--color-terminal-green);
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateX(-50%);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    /* Hexagon */
    z-index: 2;
    box-shadow: 0 0 10px rgba(74, 246, 38, 0.1);
    transition: all 0.3s ease;
}

.timeline-item:hover .timeline-icon {
    background: var(--color-terminal-green);
    color: var(--color-bg);
    box-shadow: 0 0 15px var(--color-terminal-green);
    transform: translateX(-50%) scale(1.1);
}

/* Security / Encrypted Data */
.encrypted-container {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    border: 1px dashed var(--color-terminal-dim);
    padding: 0.3rem 0.8rem;
    margin-right: 1rem;
}

.encrypted-container:hover {
    background-color: var(--color-terminal-dim);
}

.encrypted-text {
    color: #ff3333;
    font-family: var(--font-mono);
}

.encrypted-container.decrypted .encrypted-text {
    color: var(--color-terminal-green);
    animation: none;
}

/* Modal: Hardcore Popup */
#quiz-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    display: none;
    /* Default hidden */
}

#quiz-modal.modal-visible {
    display: flex;
}

#quiz-modal.modal-hidden {
    display: none;
}

.modal-content {
    background: var(--color-bg);
    border: 2px solid var(--color-terminal-green);
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    box-shadow: 8px 8px 0px var(--color-terminal-dim);
}

#system-alert {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10002;
    /* Above everything */
    justify-content: center;
    align-items: center;
    display: none;
}

#system-alert.modal-visible {
    display: flex;
}

.quiz-input {
    width: 100%;
    background: #111;
    border: var(--border-sharp);
    color: var(--color-terminal-green);
    padding: 0.8rem;
    margin: 1rem 0;
    font-family: var(--font-mono);
}

/* Terminal Overlay */
#terminal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 300px;
    /* Dropdown height */
    background: rgba(5, 5, 5, 0.98);
    border-bottom: 2px solid var(--color-terminal-green);
    z-index: 10001;
    padding: 2rem;
    transform: translateY(-100%);
    transition: transform 0.3s ease-out;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.8);
    overflow-y: auto;
}

#terminal-overlay.open {
    transform: translateY(0);
}

.terminal-output {
    white-space: pre-wrap;
    margin-bottom: 1rem;
    color: var(--color-text-main);
}

.terminal-input-line {
    display: flex;
    gap: 0.5rem;
    color: var(--color-terminal-green);
}

#terminal-input {
    background: transparent;
    border: none;
    color: var(--color-terminal-green);
    font-family: var(--font-mono);
    font-size: 1rem;
    flex-grow: 1;
    outline: none;
}

/* Utilities */
.text-green {
    color: var(--color-terminal-green);
}

.text-red {
    color: #ff3333;
}

.text-amber {
    color: var(--color-terminal-amber);
}

.text-muted {
    color: var(--color-text-muted);
}

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

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

.hidden {
    display: none !important;
}

/* --- AI Agent Dock --- */
#agent-dock {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 9998;
    pointer-events: none;
    /* Let clicks pass through */
    font-family: var(--font-pixel);
}

.agent-module {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: rgba(5, 5, 5, 0.85);
    border: 1px solid var(--color-terminal-dim);
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    border-right: 3px solid var(--color-terminal-dim);
}

.agent-module.active {
    border-right-color: var(--color-terminal-green);
    border-color: var(--color-terminal-green);
    transform: translateX(-5px);
    background: rgba(10, 20, 10, 0.95);
}

.agent-module.alert {
    border-right-color: #ff3333;
    border-color: #ff3333;
}

.agent-icon {
    font-size: 1.5rem;
    color: var(--color-terminal-dim);
    width: 2rem;
    text-align: center;
}

.agent-module.active .agent-icon {
    color: var(--color-terminal-green);
    animation: pulse-green 1s infinite alternate;
}

.agent-module.alert .agent-icon {
    color: #ff3333;
    animation: pulse-red 0.5s infinite alternate;
}

.agent-details {
    display: flex;
    flex-direction: column;
}

.agent-name {
    font-size: 1rem;
    color: var(--color-text-muted);
    letter-spacing: 1px;
}

.agent-status {
    font-size: 0.8rem;
    color: var(--color-terminal-dim);
    text-transform: uppercase;
}

.agent-module.active .agent-status {
    color: var(--color-terminal-green);
}

.agent-module.alert .agent-status {
    color: #ff3333;
}

.agent-viz {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.2;
}

.agent-module.active .agent-viz {
    opacity: 1;
}

/* Sentinel Viz */
.sentinel-viz::after {
    content: '';
    width: 100%;
    height: 2px;
    background: var(--color-terminal-green);
    box-shadow: 0 0 5px var(--color-terminal-green);
    animation: scan-vertical 1s linear infinite;
}

@keyframes scan-vertical {
    0% {
        transform: translateY(-10px);
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    80% {
        opacity: 1;
    }

    100% {
        transform: translateY(10px);
        opacity: 0;
    }
}

@keyframes pulse-green {
    from {
        text-shadow: 0 0 2px var(--color-terminal-green);
    }

    to {
        text-shadow: 0 0 10px var(--color-terminal-green);
    }
}

@keyframes pulse-red {
    from {
        text-shadow: 0 0 2px #ff3333;
    }

    to {
        text-shadow: 0 0 10px #ff3333;
    }
}

/* Cipher Viz (Matrix bits) */
.cipher-viz::before {
    content: '1010';
    font-family: var(--font-pixel);
    font-size: 10px;
    color: var(--color-terminal-amber);
    animation: bits-flicker 0.2s steps(2) infinite;
}

@keyframes bits-flicker {
    0% {
        content: '1010';
    }

    25% {
        content: '0110';
    }

    50% {
        content: '1101';
    }

    75% {
        content: '0011';
    }
}

/* Nexus Viz (Wave) */
.nexus-viz {
    background: repeating-linear-gradient(90deg,
            transparent,
            transparent 2px,
            var(--color-terminal-green) 2px,
            var(--color-terminal-green) 4px);
    background-size: 200% 100%;
    animation: stream-data 1s linear infinite;
    mask-image: linear-gradient(to right, transparent, black, transparent);
}

@keyframes stream-data {
    0% {
        background-position: 100% 0;
    }

    100% {
        background-position: 0 0;
    }
}

/* --- Mobile Optimization --- */
@media (max-width: 768px) {

    /* Layout & Spacing */
    .container {
        padding: 1rem;
        padding-top: 2rem;
    }

    h1 {
        font-size: 1.8rem;
        margin-top: 0.5rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .section-title {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Header Alignment */
    header {
        text-align: center;
    }

    .profile-wrapper {
        margin-bottom: 1rem;
    }

    /* Contact Info Stacking */
    .contact-info {
        flex-direction: column;
        gap: 0.8rem;
        align-items: center;
        /* Center align items */
        width: 100%;
    }

    .encrypted-container {
        margin-right: 0;
        width: 100%;
        justify-content: center;
        padding: 0.8rem;
        /* Larger touch target */
    }

    /* Buttons */
    .btn {
        width: 100%;
        /* Full width buttons */
        padding: 1rem;
        font-size: 1.1rem;
    }

    /* Agent Dock - Mobile Bar Style */
    #agent-dock {
        bottom: 0;
        right: 0;
        left: 0;
        flex-direction: row;
        width: 100%;
        background: rgba(5, 5, 5, 0.95);
        border-top: 1px solid var(--color-terminal-dim);
        padding: 0.5rem;
        justify-content: space-around;
        transform: none;
        /* Reset desktop scale */
        gap: 0;
    }

    .agent-module {
        flex-direction: column;
        gap: 0.2rem;
        border: none;
        background: transparent;
        padding: 0.2rem;
        flex: 1;
        justify-content: center;
        border-right: none;
    }

    .agent-module.active {
        transform: translateY(-2px);
        /* Slight bump up */
        background: transparent;
    }

    /* Hide less critical agent details to save space */
    .agent-name {
        font-size: 0.6rem;
        display: none;
        /* Hide name, keep icon/status */
    }

    .agent-status {
        font-size: 0.6rem;
    }

    .agent-viz {
        display: none;
        /* Hide viz on mobile bar */
    }

    /* Ensure dock doesn't cover content */
    body {
        padding-bottom: 80px;
    }
}