/* ==========================================================================
   JULIEN BERNATH // PORTFOLIO STYLESHEET
   Swiss Modernist Graphic Design + Futuristic Red Signal Command Center
   ========================================================================== */

/* --- 1. DESIGN SYSTEM & ROOT VARIABLES --- */
:root {
    /* Color Palette — Light Mode (default) */
    --color-bg: #FFFFFF;
    --color-text: #000000;
    --color-signal: #E30613; /* Swiss Red */
    --color-accent: #C87533; /* Copper Akzentfarbe */
    
    /* RGB versions for transparency */
    --color-signal-rgb: 227, 6, 19;
    --color-text-rgb: 0, 0, 0;
    --color-bg-rgb: 255, 255, 255;
    --color-accent-rgb: 200, 117, 51;

    /* Fonts */
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'Space Mono', monospace;

    /* Layout metrics */
    --border-width: 1px;
    --header-height: 60px;
    
    /* Animation Speeds */
    --transition-speed-fast: 0.15s;
    --transition-speed-normal: 0.3s;
    --transition-speed-slow: 0.6s;
    
    --cursor-size: 24px;
}

/* Dark Mode Overrides */
.mode-dark {
    --color-bg: #0D0D0D;
    --color-text: #EFEFEF;
    --color-signal: #FF2235;
    --color-accent: #E09A5F; /* Brighter copper for dark bg */
    --color-signal-rgb: 255, 34, 53;
    --color-text-rgb: 239, 239, 239;
    --color-bg-rgb: 13, 13, 13;
    --color-accent-rgb: 224, 154, 95;
}

/* --- 2. BASE RESET & GLOBAL STYLES --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Custom Brutalist Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--color-bg);
    border-left: var(--border-width) solid var(--color-text);
}
::-webkit-scrollbar-thumb {
    background: var(--color-text);
    border: 1px solid var(--color-bg);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-signal);
}

html {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
    height: 100%;
}

body {
    height: 100%;
    overflow: hidden;
    position: relative;
    cursor: none; /* Custom cursor default */
    background-color: var(--color-bg);
    color: var(--color-text);
    transition: background-color var(--transition-speed-normal), color var(--transition-speed-normal);
    /* Blueprint grid background */
    background-image:
        linear-gradient(rgba(var(--color-text-rgb), 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(var(--color-text-rgb), 0.045) 1px, transparent 1px);
    background-size: 40px 40px;
    background-attachment: fixed;
}

/* Fallback for native cursors on mobile */
@media (hover: none) {
    body {
        cursor: default;
    }
}

a, button, input, textarea, [tabindex="0"] {
    outline: none;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Fonts styles shortcuts */
.monospace {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    letter-spacing: -0.02em;
}

.text-signal {
    color: var(--color-signal) !important;
}

.text-accent {
    color: var(--color-accent);
    font-weight: bold;
}

.text-pulse {
    animation: text-pulse-anim 1.5s infinite ease-in-out;
}

.select-none {
    user-select: none;
}

/* --- 3. DYNAMIC INTERACTIVE LAYERS --- */
.system-frame {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 9997;
    border: 1px solid rgba(var(--color-text-rgb), 0.25);
    margin: 12px;
    box-sizing: border-box;
}

.frame-edge {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--color-text);
    opacity: 0.6;
    background-color: var(--color-bg);
    padding: 0 8px;
    transition: background-color var(--transition-speed-normal), color var(--transition-speed-normal);
}

.frame-top {
    top: -6px;
    left: 50px;
    right: 50px;
    height: 12px;
}

.frame-bottom {
    bottom: -6px;
    left: 50px;
    right: 50px;
    height: 12px;
}

.frame-left {
    left: -6px;
    top: 120px;
    bottom: 120px;
    width: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.frame-right {
    right: -6px;
    top: 120px;
    bottom: 120px;
    width: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.frame-vertical-label {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    white-space: nowrap;
    letter-spacing: 0.1em;
}

.frame-center-line {
    flex-grow: 1;
    height: 1px;
    background-image: linear-gradient(to right, transparent, rgba(var(--color-text-rgb), 0.15) 20%, rgba(var(--color-text-rgb), 0.15) 80%, transparent);
    margin: 0 20px;
}

#grid-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
    display: block;
}

.scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0) 97%,
        rgba(var(--color-signal-rgb), 0.04) 97%,
        rgba(var(--color-signal-rgb), 0.04) 100%
    );
    background-size: 100% 4px;
    z-index: 9998;
    pointer-events: none;
}

body.mode-calm .scanline {
    display: none;
}

/* Custom Cursor — technical X-icon + coordinates */
body:has(dialog[open]),
body.mode-dark:has(dialog[open]) {
    cursor: auto !important;
}

body:has(dialog[open]) #custom-cursor {
    display: none !important;
}

#custom-cursor {
    position: fixed;
    width: var(--cursor-size);
    height: var(--cursor-size);
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 10010; /* above dialogs (10001) */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-speed-normal);
}

.cursor-cross {
    position: relative;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotate(45deg);
    transition: transform var(--transition-speed-normal) cubic-bezier(0.19, 1, 0.22, 1);
}

.cursor-cross::before,
.cursor-cross::after {
    content: '';
    position: absolute;
    background-color: var(--color-signal);
    transition: background-color var(--transition-speed-fast);
}

.cursor-cross::before {
    width: 14px;
    height: 1.5px;
}

.cursor-cross::after {
    width: 1.5px;
    height: 14px;
}

#cursor-coords {
    position: absolute;
    left: 18px;
    top: 10px;
    font-size: 0.55rem;
    color: var(--color-accent);
    white-space: nowrap;
    opacity: 0.7;
    pointer-events: none;
    letter-spacing: -0.02em;
}

/* Hover: X-icon spins and highlights to copper */
body.cursor-hover .cursor-cross {
    transform: rotate(135deg);
}

body.cursor-hover .cursor-cross::before,
body.cursor-hover .cursor-cross::after {
    background-color: var(--color-accent);
}

/* --- CLICK COORDINATE MARKER --- */
#click-ripple-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10009;
    overflow: hidden;
}

.click-coords-marker {
    position: absolute;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 10009;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: marker-fade-out 0.8s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

.marker-brackets {
    width: 36px;
    height: 36px;
    border: 1px solid var(--color-signal);
    position: relative;
    box-sizing: border-box;
    animation: marker-expand 0.8s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

/* Masking elements to create custom target lock corner brackets */
.marker-brackets::before,
.marker-brackets::after {
    content: '';
    position: absolute;
    background-color: var(--color-bg);
    transition: background-color var(--transition-speed-normal);
}

.marker-brackets::before {
    top: -1px;
    bottom: -1px;
    left: 8px;
    right: 8px;
}

.marker-brackets::after {
    left: -1px;
    right: -1px;
    top: 8px;
    bottom: 8px;
}

.marker-label {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    color: var(--color-accent);
    margin-top: 6px;
    background-color: rgba(var(--color-bg-rgb), 0.9);
    border: 1px solid rgba(var(--color-text-rgb), 0.15);
    padding: 2px 6px;
    white-space: nowrap;
    letter-spacing: -0.01em;
    animation: label-slide-up 0.8s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

@keyframes marker-expand {
    0% { transform: scale(0.6); opacity: 1; border-color: var(--color-signal); }
    50% { border-color: var(--color-accent); }
    100% { transform: scale(1.3); opacity: 0; border-color: transparent; }
}

@keyframes marker-fade-out {
    0% { opacity: 1; }
    80% { opacity: 0.9; }
    100% { opacity: 0; }
}

@keyframes label-slide-up {
    0% { transform: translateY(4px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

/* --- 4. TOP DASHBOARD HEADER --- */
#main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background-color: var(--color-bg);
    border-bottom: var(--border-width) solid var(--color-text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 1000;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.03em;
    background: none;
    border: none;
    color: var(--color-text);
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: color var(--transition-speed-fast);
}

.header-logo:hover {
    color: var(--color-signal);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--color-signal);
    border-radius: 50%;
    display: inline-block;
    animation: signal-pulse-anim 1.2s infinite ease-in-out;
}

.header-info {
    display: flex;
    gap: 1.5rem;
    font-size: 0.75rem;
}

.header-info .info-item {
    border-right: 1px solid rgba(var(--color-text-rgb), 0.2);
    padding-right: 1.5rem;
}

.header-info .info-item:last-child {
    border-right: none;
    padding-right: 0;
}

.header-info .label {
    opacity: 0.6;
}

#main-nav {
    display: flex;
    height: 100%;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0 1rem;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9rem;
    border-left: var(--border-width) solid rgba(var(--color-text-rgb), 0.1);
    height: 100%;
    transition: background-color var(--transition-speed-fast), color var(--transition-speed-fast);
    position: relative;
}

.nav-link:last-child {
    border-right: var(--border-width) solid rgba(var(--color-text-rgb), 0.1);
}

.nav-num {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--color-signal);
    margin-right: 4px;
    font-weight: normal;
}

.nav-link:hover {
    background-color: var(--color-text);
    color: var(--color-bg);
}

.nav-link:hover .nav-num {
    color: var(--color-bg);
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.mode-switcher-container {
    display: flex;
    border: var(--border-width) solid var(--color-text);
}

.mode-btn {
    background: none;
    border: none;
    border-right: var(--border-width) solid var(--color-text);
    padding: 4px 8px;
    font-size: 0.7rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color var(--transition-speed-fast), color var(--transition-speed-fast);
}

.mode-btn:last-child {
    border-right: none;
}

.mode-btn.active {
    background-color: var(--color-signal);
    color: #fff;
}

.mode-btn:hover:not(.active) {
    background-color: var(--color-text);
    color: var(--color-bg);
}

/* Search Bar in Header */
.search-bar-container {
    display: flex;
    align-items: center;
    border: var(--border-width) solid rgba(var(--color-text-rgb), 0.35);
    background-color: rgba(var(--color-text-rgb), 0.04);
    padding: 0 10px;
    gap: 8px;
    height: 32px;
    transition: border-color var(--transition-speed-fast), background-color var(--transition-speed-fast);
}

.search-bar-container:focus-within {
    border-color: var(--color-accent);
    background-color: rgba(var(--color-accent-rgb), 0.06);
}

.search-icon {
    width: 14px;
    height: 14px;
    color: var(--color-accent);
    flex-shrink: 0;
    opacity: 0.8;
}

#site-search {
    background: none;
    border: none;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--color-text);
    width: 180px;
    padding: 0;
    transition: color var(--transition-speed-fast);
}

#site-search::placeholder {
    color: rgba(var(--color-text-rgb), 0.4);
}

#site-search::-webkit-search-cancel-button {
    display: none;
}

/* Dark Mode Toggle Button */
.dark-mode-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: var(--border-width) solid var(--color-text);
    padding: 4px 10px;
    height: 32px;
    cursor: pointer;
    color: var(--color-text);
    transition: background-color var(--transition-speed-fast), color var(--transition-speed-fast), border-color var(--transition-speed-fast);
}

.dark-mode-btn svg {
    width: 14px;
    height: 14px;
    stroke: var(--color-accent);
    flex-shrink: 0;
}

.dark-mode-btn:hover {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
    color: #fff;
}

.dark-mode-btn:hover svg {
    stroke: #fff;
}

.toggle-label {
    font-size: 0.7rem;
    font-weight: bold;
    letter-spacing: 0.05em;
}

/* LinkedIn Header Button */
.linkedin-header-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 10px;
    border: var(--border-width) solid var(--color-accent);
    color: var(--color-accent);
    text-decoration: none;
    transition: background-color var(--transition-speed-fast), color var(--transition-speed-fast), border-color var(--transition-speed-fast);
    flex-shrink: 0;
}

.linkedin-header-btn svg {
    width: 14px;
    height: 14px;
    fill: var(--color-accent);
    flex-shrink: 0;
    transition: fill var(--transition-speed-fast);
}

.linkedin-label {
    font-size: 0.7rem;
    font-weight: bold;
    letter-spacing: 0.05em;
}

.linkedin-header-btn:hover {
    background-color: #0A66C2;
    border-color: #0A66C2;
    color: #fff;
}

.linkedin-header-btn:hover svg {
    fill: #fff;
}

/* Logo text: slightly smaller to accommodate longer domain name */
.logo-text {
    font-size: 1.05rem;
    letter-spacing: -0.03em;
}

/* Mode-dark body gets correct cursor */
body.mode-dark {
    cursor: none;
}

/* --- HAMBURGER BUTTON (visible only on mobile) --- */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: var(--border-width) solid var(--color-text);
    padding: 8px 10px;
    cursor: pointer;
    width: 40px;
    height: 36px;
    justify-content: center;
    transition: border-color var(--transition-speed-fast);
}

.mobile-menu-btn:hover {
    border-color: var(--color-signal);
}

.hamburger-bar {
    display: block;
    width: 100%;
    height: 1.5px;
    background-color: var(--color-text);
    transition: background-color var(--transition-speed-fast);
}

.mobile-menu-btn:hover .hamburger-bar {
    background-color: var(--color-signal);
}

/* --- MOBILE NAV OVERLAY --- */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-bg);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}

.mobile-nav-overlay.is-open {
    transform: translateX(0);
}

.mobile-nav-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0;
    border-left: 4px solid var(--color-signal);
}

.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 1.5rem;
    border-bottom: var(--border-width) solid var(--color-text);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.03em;
}

.mobile-nav-close {
    background: none;
    border: var(--border-width) solid var(--color-text);
    color: var(--color-text);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: bold;
    padding: 6px 12px;
    cursor: pointer;
    transition: background-color var(--transition-speed-fast), color var(--transition-speed-fast);
}

.mobile-nav-close:hover {
    background-color: var(--color-signal);
    border-color: var(--color-signal);
    color: #fff;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 1.4rem 1.5rem;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.5rem;
    border-bottom: var(--border-width) solid rgba(var(--color-text-rgb), 0.1);
    color: var(--color-text);
    text-decoration: none;
    transition: background-color var(--transition-speed-fast), color var(--transition-speed-fast);
    letter-spacing: -0.02em;
}

.mobile-nav-link:hover, .mobile-nav-link:active {
    background-color: var(--color-signal);
    color: #fff;
}

.mobile-nav-link:hover .nav-num,
.mobile-nav-link:active .nav-num {
    color: rgba(255,255,255,0.7);
}

/* Scroll Progress indicator */
#scroll-telemetry {
    position: fixed;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%) rotate(90deg);
    transform-origin: right center;
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 200px;
}

.telemetry-bar-outer {
    width: 80px;
    height: 2px;
    background-color: rgba(var(--color-text-rgb), 0.2);
    position: relative;
}

#telemetry-bar-inner {
    width: 0%;
    height: 100%;
    background-color: var(--color-signal);
    position: absolute;
    top: 0;
    left: 0;
    transition: width 0.1s ease-out;
}

#telemetry-text {
    font-size: 0.75rem;
    font-weight: bold;
    white-space: nowrap;
}

/* --- 5. CONTENT SCROLL CONTAINER --- */
/* This fixed, centered div confines the scrollbar to the grid column boundary */
#content-scroll {
    position: fixed;
    top: var(--header-height);
    left: 50%;
    transform: translateX(-50%);
    width: min(100%, 1440px);
    bottom: 0;
    overflow-y: scroll;
    overflow-x: hidden;
    scroll-behavior: smooth;
    z-index: 10;
}

/* --- 5b. GRID CONTAINER & BRUTALIST STRUCTURE --- */
.grid-container {
    max-width: 1440px;
    margin: 0 auto;
    border-left: var(--border-width) solid var(--color-text);
    border-right: var(--border-width) solid var(--color-text);
    background-color: var(--color-bg);
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    position: relative;
}

.grid-section {
    grid-column: span 12;
    border-bottom: var(--border-width) solid var(--color-text);
    padding: 6rem 4rem;
    position: relative;
}

.section-decor {
    position: absolute;
    top: 1rem;
    left: 2rem;
    right: 2rem;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

.coord-label {
    opacity: 0.65;
    font-size: 0.7rem;
    color: var(--color-accent);
}

.bracket-label {
    opacity: 0.85;
    font-size: 0.7rem;
    color: var(--color-signal);
    font-weight: bold;
}

.section-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
    text-transform: uppercase;
    margin-bottom: 2rem;
    position: relative;
}

.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.section-header-row .section-title {
    margin-bottom: 0;
}

.telemetry-pill {
    border: var(--border-width) solid var(--color-text);
    padding: 4px 10px;
    font-size: 0.75rem;
}

/* --- 6. HERO SECTION --- */
#hero {
    min-height: calc(80vh - var(--header-height));
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 6rem 4rem 2rem 4rem;
}

.hero-content {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    z-index: 5;
}

.hero-header-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 3rem;
    width: 100%;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(3.5rem, 11vw, 8.5rem);
    font-weight: 700;
    line-height: 0.85;
    letter-spacing: -0.05em;
    text-transform: uppercase;
}

.hero-title .title-row {
    display: block;
}

.hero-role-marquee {
    border-top: var(--border-width) solid var(--color-text);
    border-bottom: var(--border-width) solid var(--color-text);
    padding: 0.8rem 0;
    overflow: hidden;
    /* Stretch to full viewport width, break out of any padding */
    position: relative;
    left: 50%;
    right: 50%;
    width: 100vw;
    margin-left: -50vw;
    margin-right: -50vw;
    background-color: var(--color-text);
    color: var(--color-bg);
}

.marquee-track {
    display: inline-block;
    white-space: nowrap;
    /* Each span copy is ~25% of total, so -50% = seamless loop at 2 copies */
    animation: marquee-anim 30s linear infinite;
    font-size: 1.25rem;
    font-weight: bold;
    letter-spacing: 0.05em;
}

@keyframes marquee-anim {
    0%   { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-50%, 0, 0); }
}

.hero-telemetry-box {
    border: var(--border-width) solid var(--color-text);
    background-color: var(--color-bg);
    width: 100%;
    max-width: 460px;
    align-self: flex-start;
}

.telemetry-header {
    border-bottom: var(--border-width) solid var(--color-text);
    padding: 6px 12px;
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    font-size: 0.75rem;
}

.telemetry-status {
    color: var(--color-signal);
}

.telemetry-body {
    padding: 12px;
    font-size: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.telemetry-footer {
    border-top: var(--border-width) solid var(--color-text);
    padding: 6px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
}

.cta-link-arrow {
    font-weight: bold;
    color: var(--color-signal);
    transition: transform var(--transition-speed-fast);
}

.cta-link-arrow:hover {
    transform: translateX(4px);
}

/* Grid Crosshairs */
.crosshairs .ch {
    position: absolute;
    width: 20px;
    height: 20px;
    pointer-events: none;
    opacity: 0.6;
}

.ch::before, .ch::after {
    content: '';
    position: absolute;
    background-color: var(--color-text);
}

.ch::before {
    width: 100%;
    height: 1px;
    top: 50%;
    left: 0;
}

.ch::after {
    width: 1px;
    height: 100%;
    left: 50%;
    top: 0;
}

.ch-top-left { top: 2rem; left: 2rem; }
.ch-top-right { top: 2rem; right: 2rem; }
.ch-bottom-left { bottom: 2rem; left: 2rem; }
.ch-bottom-right { bottom: 2rem; right: 2rem; }

/* --- 7. SPLIT LAYOUT (ABOUT & CONTACT) --- */
.split-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 0;
    gap: 0;
}

.split-col-left {
    border-right: var(--border-width) solid var(--color-text);
    padding: 6rem 4rem;
}

.split-col-right {
    padding: 6rem 4rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.about-text {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.lead {
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--color-text);
}

.about-text p:not(.lead) {
    line-height: 1.6;
    opacity: 0.8;
}

.button-row {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

/* Custom Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: background-color var(--transition-speed-fast), color var(--transition-speed-fast), border-color var(--transition-speed-fast);
    border: var(--border-width) solid var(--color-text);
    background: none;
    font-family: var(--font-heading);
}

.btn-signal {
    background-color: var(--color-signal);
    color: #fff;
    border-color: var(--color-signal);
}

.btn-signal:hover {
    background-color: var(--color-text);
    color: var(--color-bg);
    border-color: var(--color-text);
}

.btn-outline {
    color: var(--color-text);
}

.btn-outline:hover {
    background-color: var(--color-text);
    color: var(--color-bg);
}

/* Specs Window */
.specs-window {
    border: var(--border-width) solid var(--color-text);
    width: 100%;
    max-width: 440px;
    background-color: var(--color-bg);
    box-shadow: 8px 8px 0px var(--color-text);
}

/* Hover interaction variant */
.specs-window-interactive {
    transition:
        transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.25s ease;
    cursor: default;
}

.specs-window-interactive:hover {
    transform: scale(1.025) translateY(-2px);
    box-shadow: 10px 10px 0px var(--color-signal), 0 0 28px rgba(227, 6, 19, 0.18);
}

.specs-title-bar {
    border-bottom: var(--border-width) solid var(--color-text);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
}

.specs-title-bar .dot {
    width: 8px;
    height: 8px;
    background-color: var(--color-signal);
    border-radius: 50%;
}

/* Webcam / REC indicator blink */
.dot-webcam {
    animation: webcam-blink 2.4s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(227, 6, 19, 0);
}

@keyframes webcam-blink {
    0%    { opacity: 1;    box-shadow: 0 0 6px 2px rgba(227, 6, 19, 0.7); }
    40%   { opacity: 1;    box-shadow: 0 0 6px 2px rgba(227, 6, 19, 0.7); }
    55%   { opacity: 0.08; box-shadow: 0 0 0px 0px rgba(227, 6, 19, 0);   }
    70%   { opacity: 1;    box-shadow: 0 0 6px 2px rgba(227, 6, 19, 0.7); }
    85%   { opacity: 0.08; box-shadow: 0 0 0px 0px rgba(227, 6, 19, 0);   }
    100%  { opacity: 1;    box-shadow: 0 0 6px 2px rgba(227, 6, 19, 0.7); }
}

.specs-title {
    flex-grow: 1;
    font-size: 0.75rem;
}

.window-control {
    font-size: 0.8rem;
    opacity: 0.6;
}

.specs-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.spec-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    border-bottom: 1px dashed rgba(var(--color-text-rgb), 0.1);
    padding-bottom: 6px;
}

.spec-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.spec-label {
    opacity: 0.6;
}

.spec-val {
    font-weight: bold;
}

.specs-footer {
    border-top: var(--border-width) solid var(--color-text);
    padding: 6px 12px;
    font-size: 0.65rem;
    opacity: 0.5;
    text-align: right;
}

/* --- 8. SELECTED PROJECTS (PROJEKTE) --- */
.project-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    background: none;
    border: var(--border-width) solid transparent;
    padding: 6px 12px;
    font-size: 0.8rem;
    cursor: pointer;
    font-weight: bold;
    transition: border-color var(--transition-speed-fast), color var(--transition-speed-fast), background-color var(--transition-speed-fast);
}

.filter-btn.active {
    border-color: var(--color-signal);
    color: var(--color-signal);
}

.filter-btn:hover:not(.active) {
    border-color: var(--color-text);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.project-card {
    border: var(--border-width) solid var(--color-text);
    background-color: var(--color-bg);
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-speed-normal) cubic-bezier(0.1, 0.8, 0.3, 1), box-shadow var(--transition-speed-normal), opacity var(--transition-speed-normal) ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 6px 6px 0px var(--color-signal);
    border-color: var(--color-signal);
}

.card-border-details {
    display: flex;
    justify-content: space-between;
    border-bottom: var(--border-width) solid var(--color-text);
    padding: 4px 8px;
    font-size: 0.65rem;
    opacity: 0.6;
}

.project-card:hover .card-border-details {
    border-bottom-color: var(--color-signal);
}

.project-visual {
    height: 220px;
    border-bottom: var(--border-width) solid var(--color-text);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background-color: #fff;
    transition: background-color var(--transition-speed-normal);
}

.project-card:hover .project-visual {
    border-bottom-color: var(--color-signal);
    background-color: rgba(var(--color-signal-rgb), 0.03);
}

.tech-graphic {
    width: 80%;
    height: 80%;
    transition: transform var(--transition-speed-slow) cubic-bezier(0.1, 0.8, 0.3, 1);
}

.project-card:hover .tech-graphic {
    transform: scale(1.05);
}

.project-tag {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background-color: var(--color-text);
    color: var(--color-bg);
    padding: 2px 6px;
    font-size: 0.65rem;
    font-weight: bold;
}

.project-card:hover .project-tag {
    background-color: var(--color-signal);
}

.project-info {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 8px;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.project-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.arrow-icon {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    opacity: 0.5;
    transition: transform var(--transition-speed-fast), opacity var(--transition-speed-fast);
}

.project-card:hover .arrow-icon {
    transform: translate(2px, -2px);
    color: var(--color-signal);
    opacity: 1;
}

.project-desc {
    font-size: 0.85rem;
    line-height: 1.5;
    opacity: 0.7;
    margin-bottom: 8px;
}

.project-meta {
    display: flex;
    gap: 8px;
    font-size: 0.65rem;
    opacity: 0.5;
    flex-wrap: wrap;
}

/* Animations for filter switching */
.project-card.fade-out {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
    border: none;
    margin: 0;
    padding: 0;
}

/* --- 9. SKILLS SECTION CONSOLE --- */
.skills-console-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.console-widget {
    border: var(--border-width) solid var(--color-text);
    background-color: var(--color-bg);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
    cursor: pointer;
    transition: border-color var(--transition-speed-fast), box-shadow var(--transition-speed-fast);
}

.console-widget:hover {
    border-color: var(--color-signal);
    box-shadow: 4px 4px 0px var(--color-text);
}

.widget-header {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    font-size: 0.7rem;
}

.widget-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 75%;
}

.widget-stat {
    color: var(--color-signal);
}

.widget-visual {
    height: 16px;
    border: var(--border-width) solid var(--color-text);
    position: relative;
    background-color: rgba(var(--color-text-rgb), 0.05);
    overflow: hidden;
}

.bar-fill-indicator {
    height: 100%;
    width: var(--percent, 0%);
    background-color: var(--color-text);
    position: absolute;
    top: 0;
    left: 0;
    transition: width var(--transition-speed-slow) cubic-bezier(0.1, 0.8, 0.3, 1);
}

.console-widget:hover .bar-fill-indicator {
    background-color: var(--color-signal);
}

.widget-signal-lines {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.line-pulse {
    position: absolute;
    top: 0;
    height: 100%;
    width: 66px; /* 6 cells of 11px (8px fill + 3px gap) */
    left: -66px;
    pointer-events: none;
    background-image: 
        /* Segments the trail to match the progress bar style */
        repeating-linear-gradient(90deg, transparent 0px, transparent 8px, var(--color-bg) 8px, var(--color-bg) 11px),
        /* Scanline gradient: grey -> red -> white -> transparent */
        linear-gradient(
            to right,
            transparent 0px,
            rgba(120, 120, 120, 0.85) 11px, /* grey trail */
            rgba(227, 6, 19, 0.9) 33px,     /* red trail */
            rgba(255, 255, 255, 0.95) 55px, /* white scanner head */
            transparent 66px
        );
    animation: bar-sweep 3s infinite linear;
}

@keyframes bar-sweep {
    0% { left: -66px; }
    100% { left: 100%; }
}

.widget-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.65rem;
    opacity: 0.6;
}

/* --- 10. EXPERIENCE TIMELINE (WERDEGANG) --- */
.timeline-container {
    position: relative;
    padding-left: 3rem;
    margin: 2rem 0;
}

.timeline-line {
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--color-text);
}

.timeline-pulse-node {
    position: absolute;
    left: -4px;
    top: 0;
    width: 10px;
    height: 10px;
    background-color: var(--color-signal);
    border-radius: 50%;
    transform: translateY(-50%);
    z-index: 5;
}

body.mode-light #timeline-pulse {
    animation: timeline-node-anim 3s infinite linear;
}

@keyframes timeline-node-anim {
    0% { top: 0%; }
    100% { top: 100%; }
}

.timeline-item {
    position: relative;
    margin-bottom: 4rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: calc(-3rem + 5px);
    top: 6px;
    width: 12px;
    height: 12px;
    background-color: var(--color-bg);
    border: 2px solid var(--color-text);
    border-radius: 50%;
    z-index: 4;
    transition: background-color var(--transition-speed-fast), border-color var(--transition-speed-fast);
}

.timeline-item:hover .timeline-marker {
    border-color: var(--color-signal);
    background-color: var(--color-signal);
}

.timeline-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    font-weight: bold;
    color: var(--color-signal);
}

.timeline-loc {
    color: var(--color-text);
    opacity: 0.5;
}

.timeline-content {
    background-color: var(--color-bg);
    border: var(--border-width) solid var(--color-text);
    padding: 1.5rem;
    max-width: 800px;
    transition: border-color var(--transition-speed-fast);
}

.timeline-item:hover .timeline-content {
    border-color: var(--color-signal);
}

.timeline-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.timeline-company {
    font-weight: bold;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.timeline-desc {
    font-size: 0.9rem;
    line-height: 1.5;
    opacity: 0.8;
}

/* --- 11. SERVICES BLUEPRINTS (LEISTUNGEN) --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.service-blueprint {
    border: var(--border-width) solid var(--color-text);
    background-color: var(--color-bg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: border-color var(--transition-speed-fast);
}

.service-blueprint:hover {
    border-color: var(--color-signal);
}

.blueprint-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    border-bottom: var(--border-width) dashed rgba(var(--color-text-rgb), 0.2);
    padding-bottom: 8px;
    margin-bottom: 1rem;
    font-weight: bold;
}

.bp-class {
    color: var(--color-signal);
}

.blueprint-graphic {
    height: 100px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: var(--border-width) solid rgba(var(--color-text-rgb), 0.1);
    background-color: rgba(var(--color-text-rgb), 0.01);
}

.service-svg {
    width: 60px;
    height: 60px;
}

.service-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.service-desc {
    font-size: 0.85rem;
    line-height: 1.5;
    opacity: 0.8;
    margin-bottom: 1.25rem;
    flex-grow: 1;
}

.service-details-list {
    list-style: none;
    font-size: 0.65rem;
    font-weight: bold;
    display: flex;
    flex-direction: column;
    gap: 4px;
    opacity: 0.7;
}

/* --- 12. CONTACT TERMINAL FORM (KONTAKT) --- */
.direct-channels {
    margin: 2rem 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.channel-row {
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(var(--color-text-rgb), 0.1);
    padding-bottom: 6px;
}

.channel-label {
    opacity: 0.5;
    font-weight: bold;
    display: inline-block;
    width: 100px;
}

.channel-val {
    font-weight: bold;
}

.social-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.social-link {
    font-size: 0.75rem;
    font-weight: bold;
    transition: color var(--transition-speed-fast);
}

.social-link:hover {
    color: var(--color-signal);
}

/* LinkedIn social link — accent colored */
.social-link-linkedin {
    color: var(--color-accent) !important;
    border: 1px solid var(--color-accent);
    padding: 4px 12px;
    transition: background-color var(--transition-speed-fast), color var(--transition-speed-fast);
}

.social-link-linkedin:hover {
    background-color: var(--color-accent);
    color: #fff !important;
}

/* Terminal Uplink Container */
.terminal-container {
    border: var(--border-width) solid var(--color-text);
    width: 100%;
    max-width: 480px;
    background-color: var(--color-bg);
    margin-top: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 6px 6px 0px var(--color-text);
    transition: box-shadow var(--transition-speed-fast), border-color var(--transition-speed-fast);
}

.terminal-container:hover {
    box-shadow: 6px 6px 0px var(--color-signal);
    border-color: var(--color-signal);
}

.terminal-header {
    border-bottom: var(--border-width) solid var(--color-text);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: bold;
    background-color: var(--color-text);
    color: var(--color-bg);
    transition: background-color var(--transition-speed-normal), color var(--transition-speed-normal);
}

.terminal-container:hover .terminal-header {
    background-color: var(--color-signal);
}

.terminal-title {
    flex-grow: 1;
    margin-left: 8px;
}

.terminal-status {
    font-size: 0.65rem;
    letter-spacing: 0.05em;
    font-weight: bold;
    color: var(--color-signal) !important;
}

.terminal-container:hover .terminal-status {
    color: var(--color-bg) !important;
}

.terminal-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.terminal-line {
    font-size: 0.8rem;
    opacity: 0.8;
}

.terminal-action-row {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
}

.terminal-action-row .btn {
    width: 100%;
}

.form-status-msg {
    font-size: 0.75rem;
    font-weight: bold;
    min-height: 1.2rem;
}

/* Spacer for final section boundary */
.last-section {
    border-bottom: none;
}

/* --- 13. FOOTER --- */
#main-footer {
    max-width: 1440px;
    margin: 0 auto;
    border-top: var(--border-width) solid var(--color-text);
    border-left: var(--border-width) solid var(--color-text);
    border-right: var(--border-width) solid var(--color-text);
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    opacity: 0.6;
    flex-wrap: wrap;
    gap: 10px;
    z-index: 10;
    position: relative;
    background-color: var(--color-bg);
}

.separator {
    color: var(--color-signal);
    margin: 0 8px;
}

.footer-link:hover {
    color: var(--color-signal);
    text-decoration: underline;
}

/* --- 14. INTERACTIVE DIALOG MODALS --- */
dialog {
    border: none;
    background: none;
    padding: 0;
    margin: auto;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    max-width: 90%;
    max-height: 90%;
    z-index: 10001;
}

dialog::backdrop {
    background-color: rgba(var(--color-bg-rgb), 0.85);
    backdrop-filter: blur(4px);
}

body.mode-dark dialog::backdrop {
    backdrop-filter: blur(2px);
    background-color: rgba(0, 0, 0, 0.7);
}

/* Floating prev/next navigation buttons for project modal */
.modal-nav-floating-btn {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--color-bg);
    border: var(--border-width) solid var(--color-text);
    color: var(--color-text);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10005;
    box-shadow: 4px 4px 0 var(--color-text);
    transition: all var(--transition-speed-fast) cubic-bezier(0.1, 0.8, 0.3, 1);
}

.modal-nav-floating-btn:hover {
    background-color: var(--color-signal);
    color: var(--color-bg);
    box-shadow: 4px 4px 0 var(--color-bg);
    transform: translateY(-50%) translate(-2px, -2px);
}

.modal-nav-floating-btn:active {
    transform: translateY(-50%) translate(0, 0);
    box-shadow: 2px 2px 0 var(--color-text);
}

.modal-nav-floating-btn.prev {
    left: calc(50% - 480px - 80px); /* 480px is half of 960px modal width, 80px sits in margin */
}

.modal-nav-floating-btn.next {
    right: calc(50% - 480px - 80px);
}

@media (max-width: 1200px) {
    .modal-nav-floating-btn.prev {
        left: 20px;
    }
    .modal-nav-floating-btn.next {
        right: 20px;
    }
}

@media (max-width: 768px) {
    .modal-nav-floating-btn {
        display: none;
    }
}

/* Command Palette Dialog UI */
.palette-container {
    width: 600px;
    max-width: 100%;
    border: var(--border-width) solid var(--color-text);
    background-color: var(--color-bg);
    box-shadow: 12px 12px 0px var(--color-text);
}

.palette-header {
    border-bottom: var(--border-width) solid var(--color-text);
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    font-weight: bold;
    opacity: 0.6;
}

.palette-input-wrapper {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: var(--border-width) solid var(--color-text);
    background-color: rgba(var(--color-text-rgb), 0.02);
}

.prompt-search-icon {
    width: 16px;
    height: 16px;
    color: var(--color-accent);
    flex-shrink: 0;
    margin-right: 12px;
    opacity: 0.8;
}

#palette-input {
    width: 100%;
    background: none;
    border: none;
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--color-text);
}

#palette-suggestions {
    list-style: none;
    max-height: 250px;
    overflow-y: auto;
}

#palette-suggestions li {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(var(--color-text-rgb), 0.05);
    cursor: pointer;
    font-size: 0.8rem;
    transition: background-color var(--transition-speed-fast), color var(--transition-speed-fast);
}

#palette-suggestions li:last-child {
    border-bottom: none;
}

#palette-suggestions li.selected, #palette-suggestions li:hover {
    background-color: var(--color-signal);
    color: #fff;
}

#palette-suggestions li.selected .highlight, #palette-suggestions li:hover .highlight {
    color: #fff;
}

#palette-suggestions li .highlight {
    font-weight: bold;
    color: var(--color-signal);
}

/* Diagnostic Box inside Command Palette */
.diag-output-box {
    border-top: var(--border-width) solid var(--color-text);
    padding: 16px;
    max-height: 250px;
    overflow-y: auto;
    font-size: 0.75rem;
    color: var(--color-text);
    background-color: var(--color-bg);
    display: none;
    white-space: pre-wrap;
    line-height: 1.4;
}

/* Project Detail Modal UI */
.modal-box {
    width: 900px;
    max-width: 100%;
    border: var(--border-width) solid var(--color-text);
    background-color: var(--color-bg);
    box-shadow: 12px 12px 0px var(--color-text);
}

.modal-header {
    border-bottom: var(--border-width) solid var(--color-text);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--color-text);
    color: var(--color-bg);
}

.modal-title-bar {
    display: flex;
    align-items: center;
    font-size: 0.75rem;
    font-weight: bold;
    gap: 8px;
}

.modal-title-bar .pulse-dot {
    animation: signal-pulse-anim 0.8s infinite;
}

.modal-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-nav-btn,
.close-btn {
    background: none;
    border: none;
    color: var(--color-bg);
    cursor: pointer;
    font-weight: bold;
    font-size: 0.75rem;
    transition: color var(--transition-speed-fast);
}

.modal-nav-btn:hover,
.close-btn:hover {
    color: var(--color-signal);
}

.modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 500px;
}

.modal-visual-panel {
    border-right: var(--border-width) solid var(--color-text);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
    padding: 2rem;
    overflow: hidden;
}

.modal-visual-panel svg {
    width: 90%;
    height: 90%;
}

.modal-info-panel {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
}

.modal-info-panel .project-title {
    font-size: 2rem;
    letter-spacing: -0.03em;
    text-transform: uppercase;
}

.project-long-desc {
    font-size: 0.95rem;
    line-height: 1.6;
    opacity: 0.8;
}

.project-spec-sheet {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.75rem;
}

.sheet-row {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px dashed rgba(var(--color-text-rgb), 0.1);
    padding-bottom: 6px;
}

.sheet-label {
    opacity: 0.5;
    font-weight: bold;
}

.sheet-val {
    font-weight: bold;
    text-align: right;
}

.modal-cta-row {
    margin-top: auto;
}

.modal-cta-row button, .modal-cta-row a {
    width: 100%;
}

/* --- 15. KEYFRAME ANIMATIONS --- */
@keyframes signal-pulse-anim {
    0% { opacity: 0.3; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.1); }
    100% { opacity: 0.3; transform: scale(0.9); }
}

@keyframes text-pulse-anim {
    0% { opacity: 0.4; }
    50% { opacity: 1; }
    100% { opacity: 0.4; }
}

/* Typewriter cursor blink */
@keyframes typewriter-blink {
    0%, 49%  { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.typewriter-cursor::after {
    content: '';
    display: inline-block;
    width: 3px;
    height: 0.78em;
    background-color: var(--color-signal);
    margin-left: 6px;
    vertical-align: middle;
    animation: typewriter-blink 0.75s steps(1) infinite;
}

/* --- 16. RESPONSIVE DESIGN (MEDIA QUERIES) --- */

/* Large tablet / small laptop: nav starts to overflow */
@media (max-width: 1200px) {
    .nav-link {
        padding: 0 0.65rem;
        font-size: 0.8rem;
    }

    #site-search {
        width: 130px;
    }

    .hero-header-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 2rem;
    }
}

/* Tablet layout */
@media (max-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .skills-console-grid {
        grid-template-columns: repeat(3, 1fr);
    }

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

    /* Collapse search bar to just icon on tablet to save space */
    #site-search {
        width: 90px;
    }
}

/* Narrow tablet: hide nav links, show hamburger */
@media (max-width: 860px) {
    #main-nav {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .search-bar-container {
        display: none;
    }
}

/* Mobile layouts */
@media (max-width: 768px) {
    body {
        cursor: default; /* Disable custom cursor on mobile */
    }

    #custom-cursor {
        display: none !important;
    }

    .hide-mobile {
        display: none !important;
    }

    #main-header {
        padding: 0 1rem;
        gap: 0.5rem;
    }

    #main-nav {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .search-bar-container {
        display: none;
    }

    .grid-container {
        border-left: none;
        border-right: none;
    }

    .grid-section {
        padding: 4rem 1.25rem;
    }

    .section-decor {
        left: 1.25rem;
        right: 1.25rem;
    }

    #hero {
        padding: 4rem 1.25rem;
        height: auto;
        min-height: 480px;
    }

    .hero-content {
        gap: 1.5rem;
    }

    .hero-title {
        font-size: clamp(2.8rem, 12vw, 4.5rem);
    }

    .hero-role-marquee {
        margin-left: -1.25rem;
        margin-right: -1.25rem;
        width: calc(100% + 2.5rem);
    }

    .hero-telemetry-box {
        max-width: 100%;
    }

    .split-layout {
        grid-template-columns: 1fr;
    }

    .split-col-left {
        border-right: none;
        border-bottom: var(--border-width) solid var(--color-text);
        padding: 4rem 1.25rem;
    }

    .split-col-right {
        padding: 3rem 1.25rem;
    }

    .specs-window {
        max-width: 100%;
        box-shadow: 4px 4px 0px var(--color-text);
    }

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

    .section-header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .project-filters {
        gap: 6px;
    }

    .filter-btn {
        font-size: 0.7rem;
        padding: 5px 8px;
    }

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

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

    .timeline-container {
        padding-left: 2rem;
    }

    .timeline-content {
        max-width: 100%;
    }

    .timeline-marker {
        left: calc(-2rem + 5px);
    }

    .modal-grid {
        grid-template-columns: 1fr;
        height: 80vh;
    }

    .modal-visual-panel {
        height: 200px;
        border-right: none;
        border-bottom: var(--border-width) solid var(--color-text);
    }

    .modal-info-panel {
        padding: 1.5rem;
    }

    .modal-box {
        max-height: 90vh;
        overflow-y: auto;
    }

    #main-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 1.25rem;
    }
}

@media (max-width: 480px) {
    .skills-console-grid {
        grid-template-columns: 1fr;
    }
    
    .button-row {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        text-align: center;
    }

    .hero-title {
        font-size: clamp(2.4rem, 13vw, 3.5rem);
    }

    .section-title {
        font-size: clamp(1.8rem, 8vw, 3rem);
    }

    .grid-section {
        padding: 3.5rem 1rem;
    }

    .split-col-left,
    .split-col-right {
        padding: 3rem 1rem;
    }

    .terminal-container {
        max-width: 100%;
        box-shadow: 3px 3px 0px var(--color-text);
    }
}

/* --- 17. PREFERS REDUCED MOTION --- */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-delay: 0s !important;
        animation-duration: 0s !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0s !important;
        scroll-behavior: auto !important;
    }
    
    #grid-canvas {
        display: none !important;
    }
    
    .scanline {
        display: none !important;
    }

    .marquee-track {
        animation: none !important;
        white-space: normal !important;
    }
    
    #timeline-pulse {
        animation: none !important;
        display: none;
    }
}
