* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --amber: #e8a849;
    --amber-light: #f4d48a;
    --dark: #1a1612;
    --dark-mid: #2a2420;
    --dark-warm: #352e28;
    --cream: #f0ece4;
    --coral: #d4736a;
    --muted: #9a8e7d;
    --copper: #c17838;
    --gap: 2px;
}

html, body {
    background: var(--dark);
    color: var(--cream);
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    line-height: 1.6;
    overflow-x: hidden;
    scroll-behavior: smooth;
    scroll-snap-type: y mandatory;
}

.deck {
    height: 100vh;
    width: 100vw;
    scroll-snap-align: start;
    padding: var(--gap);
    display: flex;
    align-items: stretch;
}

.command-wall {
    flex: 1;
    display: grid;
    gap: var(--gap);
    padding: var(--gap);
}

#deck-bridge .command-wall {
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 2fr 1fr 1fr;
}

#deck-bridge .module-hero {
    grid-column: 1 / 2;
    grid-row: 1 / 3;
}

#deck-bridge .module-status {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
}

#deck-bridge .module-coord {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
}

#deck-bridge .module-manifest {
    grid-column: 1 / -1;
    grid-row: 3 / 4;
}

#deck-observatory .command-wall {
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 3fr 1fr;
}

#deck-observatory .module-canvas {
    grid-column: 1 / 2;
    grid-row: 1 / -1;
}

#deck-observatory .module-metrics {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
}

#deck-observatory .module-scan {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
}

#deck-archive .command-wall {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
}

#deck-archive .module-thesis {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
}

#deck-archive .module-principles {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
}

#deck-archive .module-join {
    grid-column: 1 / -1;
    grid-row: 2 / 3;
}

#deck-archive .module-footer {
    grid-column: 1 / -1;
    grid-row: 3 / 4;
}

.module {
    position: relative;
    overflow: hidden;
    background: var(--dark-mid);
    border: 1px solid rgba(228, 168, 73, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.4s ease;
}

.module:hover {
    border-color: rgba(228, 168, 73, 0.4);
}

.marble-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(42, 36, 32, 0.8) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(53, 46, 40, 0.6) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 80%, rgba(26, 22, 18, 0.9) 0%, transparent 60%),
        linear-gradient(135deg, rgba(232, 168, 73, 0.03) 0%, transparent 50%),
        linear-gradient(45deg, var(--dark) 0%, var(--dark-mid) 50%, var(--dark-warm) 100%);
    filter: contrast(1.1);
    animation: marble-drift 20s ease-in-out infinite alternate;
}

@keyframes marble-drift {
    0% { background-position: 0% 0%, 100% 0%, 50% 100%, 0% 0%, 0% 0%; }
    100% { background-position: 100% 100%, 0% 100%, 50% 0%, 100% 100%, 0% 0%; }
}

.module-content {
    position: relative;
    z-index: 1;
    padding: clamp(1rem, 3vw, 2.5rem);
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.overlay-content {
    position: absolute;
    bottom: 0;
    left: 0;
    background: linear-gradient(transparent, rgba(26, 22, 18, 0.9));
    justify-content: flex-end;
    padding-bottom: 2rem;
}

h1, h2, h3 {
    font-family: 'Exo 2', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

h1.display-title {
    font-size: clamp(2rem, 5vw, 4.5rem);
    line-height: 1.1;
    color: var(--cream);
}

h1 .amber {
    color: var(--amber);
}

h2 {
    font-size: clamp(1.2rem, 3vw, 2.2rem);
    color: var(--cream);
    margin-bottom: 0.5em;
}

h3 {
    font-size: clamp(1rem, 2vw, 1.4rem);
    color: var(--amber-light);
    margin-bottom: 0.75em;
}

p {
    color: var(--muted);
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    max-width: 50ch;
}

.subtitle {
    color: var(--muted);
    font-size: clamp(1rem, 2vw, 1.3rem);
    margin-top: 0.5em;
}

.mono-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    color: var(--amber);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.mono-value {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.2rem;
    color: var(--cream);
}

.module-status .module-content {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    justify-content: center;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--amber);
    box-shadow: 0 0 10px var(--amber), 0 0 20px rgba(228, 168, 73, 0.3);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 1; box-shadow: 0 0 10px var(--amber), 0 0 20px rgba(228, 168, 73, 0.3); }
    50% { opacity: 0.6; box-shadow: 0 0 5px var(--amber), 0 0 10px rgba(228, 168, 73, 0.1); }
}

.module-coord .module-content {
    align-items: center;
    gap: 0.5rem;
}

/* Orbital Ring */
.orbital-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300px;
    height: 300px;
    border: 1px solid rgba(228, 168, 73, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%) rotateX(60deg);
    animation: orbit-spin 30s linear infinite;
    pointer-events: none;
}

@keyframes orbit-spin {
    from { transform: translate(-50%, -50%) rotateX(60deg) rotateZ(0deg); }
    to { transform: translate(-50%, -50%) rotateX(60deg) rotateZ(360deg); }
}

/* Canvas */
#topology-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* Metrics */
.metric-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.metric-row .mono-label {
    min-width: 80px;
    font-size: 0.65rem;
}

.metric-bar {
    flex: 1;
    height: 4px;
    background: var(--dark);
    border-radius: 2px;
    overflow: hidden;
}

.metric-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--amber), var(--amber-light));
    border-radius: 2px;
    transition: width 1s ease;
}

/* Principles */
.principle-list {
    list-style: none;
}

.principle-list li {
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(228, 168, 73, 0.1);
    color: var(--cream);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.principle-num {
    font-family: 'Share Tech Mono', monospace;
    color: var(--amber);
    font-size: 0.8rem;
}

/* Join */
.input-group {
    display: flex;
    gap: 0;
    margin-top: 1.5rem;
    max-width: 400px;
}

.freq-input {
    flex: 1;
    background: var(--dark);
    border: 1px solid rgba(228, 168, 73, 0.3);
    border-right: none;
    padding: 0.75rem 1rem;
    color: var(--cream);
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    outline: none;
}

.freq-input::placeholder {
    color: var(--muted);
}

.btn-amber {
    background: var(--amber);
    color: var(--dark);
    border: none;
    padding: 0.75rem 1.5rem;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-amber:hover {
    background: var(--amber-light);
}

/* Footer module */
.module-footer .module-content {
    align-items: center;
    justify-content: center;
}

/* Scanline overlay on all modules */
.module::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(26, 22, 18, 0.03) 2px,
        rgba(26, 22, 18, 0.03) 4px
    );
    pointer-events: none;
}

/* Ambient amber glow between modules */
.command-wall {
    background: rgba(228, 168, 73, 0.08);
}

@media (max-width: 768px) {
    .command-wall {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto !important;
    }
    .module {
        grid-column: auto !important;
        grid-row: auto !important;
        min-height: 200px;
    }
    .deck {
        height: auto;
        min-height: 100vh;
        scroll-snap-align: none;
    }
}
