/* Modern Technical Minimalism Design System */

:root {
    /* M3-inspired color spectrum matching DESIGN.md */
    --background: #101418;                 /* Deep space base background */
    --surface: #161B22;                    /* Dark Slate elevated surface */
    --surface-container-low: #181c20;      /* Slightly lighter slate */
    --surface-container-lowest: #0b0f13;   /* Lowest tonal layer */
    --surface-container-highest: #31353a;  /* Hover/Active element background */
    --primary: #a2c9ff;                    /* Digital Blue Accent (Digital beacon) */
    --primary-container: #58a6ff;          /* Digital Blue Secondary */
    --border-subtle: #30363D;              /* Medium Gray structural divider */
    --text-primary: #F0F6FC;               /* Off-white header text */
    --text-secondary: #c0c7d4;             /* Muted steel gray labels/prose */
    --accent-warning: #F59E0B;             /* Warning alert amber dot */
    --secondary-container: #414a53;        /* Active chip backdrop */
    --on-secondary-container: #b0b9c4;    /* Active chip text */
    --on-primary: #00315c;
    --on-primary-fixed: #001c38;
    --error: #ffb4ab;
    --error-bg: #93000a;

    /* Fonts */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'JetBrains Mono', SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
}

/* Base Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--background);
    color: var(--text-secondary);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Strict Sharp Corners Reset */
.btn, .form-input, .form-textarea, .tech-card, .status-chip, .bento-card-square, .timeline-tag {
    border-radius: 0px !important;
}

/* Circular elements exception */
.status-dot {
    border-radius: 50% !important;
}

/* Shadow omission / Outline definition */
.btn, .form-input, .form-textarea, .tech-card, .bento-card-square {
    box-shadow: none !important;
}

/* Webkit Scrollbars */
::-webkit-scrollbar {
    width: 4px;
}
::-webkit-scrollbar-track {
    background: var(--surface-container-lowest);
}
::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: 0px;
}

/* Technical Grid and Scanline Overlays */
.technical-grid {
    position: fixed;
    inset: 0;
    background-image: linear-gradient(to right, rgba(48, 54, 61, 0.2) 1px, transparent 1px),
                      linear-gradient(to bottom, rgba(48, 54, 61, 0.2) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    z-index: 1;
}

.scanline {
    width: 100%;
    height: 2px;
    background: rgba(162, 201, 255, 0.08);
    position: fixed;
    left: 0;
    pointer-events: none;
    z-index: 2;
    animation: scan 6s linear infinite;
}

@keyframes scan {
    0% { top: 0%; }
    100% { top: 100%; }
}

/* App Layout Shell */
.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    z-index: 10;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 32px;
    height: 80px;
    border-bottom: 1px solid var(--border-subtle);
    background-color: var(--background);
    position: sticky;
    top: 0;
    z-index: 50;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.logo-shimmer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(135deg, transparent 0%, transparent 40%, rgba(255, 255, 255, 0.15) 50%, transparent 60%, transparent 100%);
    background-size: 200% 200%;
    animation: shimmer 3s infinite linear;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.logo-text {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 500;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.app-nav {
    display: flex;
    gap: 24px;
}

.nav-link {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    letter-spacing: 0.05em;
    padding: 4px 8px;
    border: 1px solid transparent;
    transition: all 0.2s ease-in-out;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary);
    border: 1px solid var(--primary);
}

/* Dynamic Content Injector */
.app-main {
    flex: 1;
    padding: 48px 32px;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    position: relative;
}

/* Footer */
.app-footer {
    padding: 32px;
    border-top: 1px solid var(--border-subtle);
    background-color: var(--surface-container-lowest);
}

.footer-content {
    max-w: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

.footer-link {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-link:hover {
    color: var(--primary);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-subtle);
    padding-top: 16px;
    margin-top: 8px;
}

.footer-icons {
    display: flex;
    gap: 16px;
    color: var(--text-secondary);
}

.footer-icons .material-symbols-outlined {
    cursor: pointer;
    font-size: 20px;
}

.footer-icons .material-symbols-outlined:hover {
    color: var(--primary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 8px 16px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    outline: none;
}

.btn-header-inquire {
    border-color: var(--primary);
    color: var(--primary);
    background-color: transparent;
}

.btn-header-inquire:hover {
    background-color: var(--surface-container);
}

.btn-primary {
    background-color: var(--primary);
    color: var(--on-primary-fixed);
    font-weight: 600;
}

.btn-primary:hover {
    background-color: var(--primary-container);
}

.btn-ghost {
    background-color: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-ghost:hover {
    background-color: var(--surface-container-high);
}

/* Forms & UI Inputs */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    transition: color 0.15s ease;
}

.form-input, .form-textarea {
    width: 100%;
    background-color: var(--surface-container-low);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 12px 16px;
    font-family: var(--font-mono);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.form-input:focus, .form-textarea:focus {
    border-color: var(--primary);
}

.form-textarea {
    min-height: 120px;
    resize: none;
}

/* Typography styles */
h1, h2, h3, h4 {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.display-lg {
    font-size: 40px;
    line-height: 1.2;
    letter-spacing: -0.02em;
    font-weight: 700;
}

.headline-lg {
    font-size: 32px;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.headline-md {
    font-size: 24px;
    line-height: 1.4;
}

.headline-sm {
    font-size: 20px;
    line-height: 1.4;
}

.body-lg {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.body-md {
    font-size: 14px;
    color: var(--text-secondary);
}

.mono-label {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

/* Cards & Layout Grid */
.grid-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin-top: 24px;
}

.tech-card {
    background-color: var(--surface);
    border: 1px solid var(--border-subtle);
    padding: 24px;
    position: relative;
    transition: border-color 0.2s ease;
}

.tech-card:hover {
    border-color: var(--primary);
}

.tech-card-header {
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 12px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Node cluster visualization */
.node-viz {
    width: 100%;
    height: 192px;
    background-color: var(--surface);
    border: 1px solid var(--border-subtle);
    position: relative;
    overflow: hidden;
    margin-bottom: 24px;
}

.node-viz-dots {
    position: absolute;
    inset: 0;
    opacity: 0.2;
    background-image: radial-gradient(circle at 2px 2px, var(--primary) 1px, transparent 0);
    background-size: 16px 16px;
}

.node-viz-content {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.node-viz-label {
    position: absolute;
    bottom: 8px;
    right: 8px;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-secondary);
    opacity: 0.6;
    text-transform: uppercase;
}

/* Status badging */
.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 2px 8px;
    border: 1px solid var(--border-subtle);
    background-color: var(--surface-container-low);
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.status-chip-active {
    border-color: var(--primary);
    color: var(--primary);
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-warning);
}

.status-dot.pulse {
    animation: pulse-dot 2s infinite ease-in-out;
}

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

/* Bento grid */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 24px;
}

.bento-card-wide {
    grid-column: span 2;
    background-color: var(--surface);
    border: 1px solid var(--border-subtle);
    padding: 24px;
}

.bento-card-square {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--surface-container-lowest);
    border: 1px solid var(--border-subtle);
    text-align: center;
    padding: 16px;
    aspect-ratio: 1 / 1;
}

/* Timeline */
.timeline {
    display: flex;
    flex-direction: column;
    margin-top: 24px;
}

.timeline-item {
    display: flex;
    flex-direction: column;
    position: relative;
}

.timeline-header {
    display: flex;
    align-items: baseline;
    gap: 16px;
    border-top: 1px solid var(--border-subtle);
    padding-top: 24px;
    padding-bottom: 8px;
}

.timeline-body {
    padding-left: 48px;
    padding-bottom: 32px;
    border-left: 1px solid var(--border-subtle);
    margin-left: 18px;
}

.timeline-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.timeline-tag {
    padding: 2px 8px;
    border: 1px solid var(--border-subtle);
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.timeline-end {
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: flex-end;
    padding-top: 8px;
}

/* Contact row items */
.contact-row {
    border-left: 2px solid var(--border-subtle);
    padding-left: 24px;
    padding-top: 4px;
    padding-bottom: 4px;
    margin-bottom: 24px;
}

.contact-row-title {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 4px;
}

.contact-row-val {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-primary);
}

.map-container {
    height: 192px;
    border: 1px solid var(--border-subtle);
    position: relative;
    overflow: hidden;
    cursor: crosshair;
    margin-top: 24px;
}

.map-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%) brightness(40%);
    transition: transform 0.7s ease;
}

.map-container:hover .map-img {
    transform: scale(1.05);
}

.map-overlay {
    position: absolute;
    top: 16px;
    left: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10;
}

/* Form group focus styling wrapper */
.form-group.focused .form-label {
    color: var(--primary);
}

/* Mobile persistent bottom navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--surface);
    border-top: 1px solid var(--border-subtle);
    z-index: 50;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    height: 64px;
}

.bottom-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    transition: all 0.15s ease-in-out;
}

.bottom-nav-link.active {
    background-color: var(--secondary-container);
    color: var(--on-secondary-container);
}

.bottom-nav-link .material-symbols-outlined {
    margin-bottom: 4px;
    font-size: 20px;
}

/* Drawer navigation container */
.drawer {
    height: 100%;
    width: 320px;
    position: fixed;
    left: 0;
    top: 0;
    background-color: var(--surface);
    border-right: 1px solid var(--border-subtle);
    z-index: 100;
    display: flex;
    flex-direction: column;
    padding: 24px;
    transition: transform 0.3s ease-in-out;
}

.drawer.hidden {
    transform: translateX(-100%);
    display: flex !important; /* overrides display:none from generic hidden framework to animate */
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 48px;
}

.btn-close {
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
}

.drawer-nav {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.drawer-link {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 14px;
    transition: all 0.15s ease-in-out;
    border: 1px solid transparent;
}

.drawer-link:hover {
    background-color: var(--surface-container-highest);
}

.drawer-link.active {
    background-color: var(--secondary-container);
    color: var(--on-secondary-container);
}

/* Desktop drawer toggler - initially hidden */
.drawer-toggle {
    display: none;
    cursor: pointer;
    color: var(--text-primary);
}

/* Responsive Overrides */
@media (max-width: 767px) {
    .app-main {
        padding-bottom: 112px; /* space for fixed bottom nav */
    }
    .app-header .app-nav {
        display: none;
    }
    .app-header .btn-header-inquire {
        display: none;
    }
    /* Show drawer toggle on mobile header if needed */
    .drawer-toggle {
        display: block;
    }
}

@media (min-width: 768px) {
    .bottom-nav {
        display: none;
    }
}

/* Alert modifications */
.alert {
    padding: 16px;
    border: 1px solid var(--border-subtle);
    font-family: var(--font-sans);
    margin-bottom: 24px;
    font-size: 14px;
}

.alert-success {
    border-color: var(--primary);
    background-color: rgba(162, 201, 255, 0.05);
    color: var(--primary);
}

.alert-error {
    border-color: var(--error);
    background-color: rgba(255, 180, 171, 0.05);
    color: var(--error);
}

/* Divider rules spacing */
.hero-section {
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 32px;
    margin-bottom: 32px;
}
