/* =========================================================
   PPZZ.lu — Systems Operations Manual
   sci-fi, f-pattern, bebas-neue, warm-earthy, layered-depth
   ========================================================= */

/* IBM Plex family triple-use as unified technical voice:** Most designs using IBM Plex Mono use it for code only. ppzz.lu uses IBM Plex Sans (body),
   IBM Plex Mono (labels/data), IBM Plex Mono data tables, IBM Plex Mono in Signal Green (#7EC8A4),
   IBM Plex Mono' IBM Plex Mono" (Google Fonts), IBM Plex Sans Italic (annotations), IBM Plex Sans" (Google Fonts) */
:root {
    --amber:        #E8A040;  /* Instrument Amber — headlines, active dots */
    --terracotta:   #C05A2A;  /* Terracotta Signal — borders, hover states */
    --copper:       #8B5E3C;  /* Oxidized Copper — secondary accent, spine rule */
    --pale-console: #D4C9B8;  /* Pale Console — primary body text */
    --smoked:       #1E1810;  /* Smoked Parchment — deepest background */
    --panel:        #2A2218;  /* Instrument Panel — elevated surfaces */
    --obsidian:     #131009;  /* Matte Obsidian — spine, deepest shadow */
    --signal-green: #7EC8A4;  /* Signal Green — active data, success */
    --dust:         #6A6055;  /* Dust — inactive labels, rules */
    --terracotta-mist: #C08060; /* annotation text (annotations) */
    --dust-mid:        #8A8070;  /* mid-dust tone */
}

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

/* ---- Noise Texture Overlay ---- */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 1000;
    pointer-events: none;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

/* ---- Base Typography ---- */
html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    background-color: var(--smoked);
    color: var(--pale-console);
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 16px;
    line-height: 1.7;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ---- Utility Classes ---- */
.mono {
    font-family: 'IBM Plex Mono', monospace;
}

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

.signal-green {
    color: var(--signal-green);
}

.dust-label {
    color: var(--dust);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.body-text {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--pale-console);
}

.italic-text {
    font-style: italic;
    color: var(--terracotta-mist);
    font-size: 13px;
}

.annotation-text {
    font-family: 'IBM Plex Sans', sans-serif;
    font-style: italic;
    font-size: 13px;
    color: var(--terracotta-mist);
    line-height: 1.6;
}

/* ---- SVG Noise Defs (hidden) ---- */
.noise-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* ============================================================
   PAGE LAYOUT — F-Pattern Grid
   ============================================================ */

.page-layout {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 0;
    min-height: 100vh;
}

/* ============================================================
   LEFT SPINE — Layer 3 (topmost)
   ============================================================ */

.spine {
    background: var(--obsidian);
    border-right: 1px solid var(--copper);
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 2rem;
    gap: 0;
    z-index: 100;
    overflow: hidden;
}

.spine-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    flex: 1;
    width: 100%;
}

.spine-section-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 1.2rem 0;
    width: 100%;
    cursor: pointer;
    position: relative;
}

.spine-section-indicator:hover .spine-label {
    color: var(--amber);
}

/* Channel indicator dots */
.spine-dot {
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--dust);
    transition: background 0.3s ease;
    position: relative;
    flex-shrink: 0;
}

.spine-dot--active {
    background: var(--amber);
}

/* Sonar-ping animation */
@keyframes sonar-ping {
    0% {
        box-shadow: 0 0 0 0 rgba(232, 160, 64, 0.6);
    }
    100% {
        box-shadow: 0 0 0 24px rgba(232, 160, 64, 0);
    }
}

.spine-dot--active {
    background: var(--amber);
    animation: sonar-ping 1.8s ease-out 1;
}

.spine-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--dust);
    writing-mode: vertical-rl;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.spine-vertical-rule {
    width: 1px;
    height: 100%;
    background: linear-gradient(to bottom, transparent, var(--copper) 20%, var(--copper) 80%, transparent);
    position: absolute;
    right: 0;
    top: 0;
    opacity: 0.4;
}

/* ============================================================
   CONTENT WELL — Main Editorial Area
   ============================================================ */

.content-well {
    background: var(--smoked);
    position: relative;
}

/* ============================================================
   SECTIONS
   ============================================================ */

.section {
    position: relative;
    overflow: hidden;
}

.section-body {
    padding: 4rem 4rem 4rem 3rem;
    position: relative;
    z-index: 2;
}

/* ---- Section Glow Panels — Layer 1 ---- */
.section-glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.section-glow--hero {
    background: radial-gradient(ellipse 600px 600px at bottom left, rgba(232, 160, 64, 0.06) 0%, transparent 70%);
}

.section-glow--left {
    background: radial-gradient(ellipse 500px 400px at 10% 80%, rgba(232, 160, 64, 0.05) 0%, transparent 70%);
}

.section-glow--right {
    background: radial-gradient(ellipse 500px 400px at 90% 20%, rgba(192, 90, 42, 0.04) 0%, transparent 70%);
}

/* ---- Section Header / F-pattern Top Bar ---- */
.section-header {
    margin-bottom: 40px;
}

.section-tag {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
}

.section-number {
    font-size: 11px;
    color: var(--dust);
    text-transform: uppercase;
    letter-spacing: 0.18em;
}

.section-status {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

/* ---- Display Headlines — Bebas Neue ---- */
.display-headline {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: clamp(64px, 10vw, 120px);
    letter-spacing: 0.02em;
    line-height: 0.9;
    color: var(--amber);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.display-headline--section {
    font-size: clamp(48px, 7vw, 96px);
}

.display-subheadline {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: clamp(22px, 3.5vw, 48px);
    letter-spacing: 0.04em;
    color: var(--terracotta);
    text-transform: uppercase;
    line-height: 1;
}

/* ---- Tier Separator ---- */
.section-tier-sep {
    height: 1px;
    border: none;
    border-top: 1px dashed var(--dust);
    margin: 1.5rem 0 2.5rem 0;
    opacity: 0.5;
}

/* ---- Double Tier Separator ---- */
.section-separator--double {
    display: block;
    height: 9px;
    margin: 0;
    position: relative;
}

.section-separator--double::before,
.section-separator--double::after {
    content: '';
    display: block;
    height: 1px;
    border-top: 1px dashed var(--dust);
    margin: 0 3rem 0 3rem;
    opacity: 0.45;
}

.section-separator--double::before {
    margin-bottom: 4px;
}

/* ============================================================
   HERO SECTION
   ============================================================ */

.section--hero {
    background: var(--smoked);
    min-height: 85vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.section--hero .section-body {
    padding-top: 5rem;
    padding-bottom: 5rem;
}

.hero-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 4rem;
    align-items: start;
}

.hero-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.hero-status-row {
    display: flex;
    gap: 3rem;
    margin-top: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(106, 96, 85, 0.3);
}

.status-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.status-block .mono:last-child {
    font-size: 13px;
    letter-spacing: 0.06em;
}

/* ============================================================
   ANNOTATION PANELS
   ============================================================ */

.annotation-panel {
    position: relative;
}

/* Corner-bracket annotation styling */
.annotation-bracket {
    position: relative;
    padding: 1.25rem 1.25rem 1.25rem 1.5rem;
    background: var(--panel);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
    border-top: 1px solid rgba(255, 200, 100, 0.15);
}

/* Top-left corner bracket */
.annotation-bracket::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    width: 12px;
    height: 12px;
    border-top: 1px solid var(--copper);
    border-left: 1px solid var(--copper);
}

/* Bottom-right corner bracket */
.annotation-bracket::after {
    content: '';
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 12px;
    height: 12px;
    border-bottom: 1px solid var(--copper);
    border-right: 1px solid var(--copper);
}

.annotation-label {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    color: var(--dust);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(106, 96, 85, 0.4);
}

/* ---- Annotation Table (hero) ---- */
.annotation-table {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.annot-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 12px;
    padding: 0.2rem 0;
    border-bottom: 1px solid rgba(106, 96, 85, 0.2);
}

.annot-row:last-child {
    border-bottom: none;
}

/* ============================================================
   MISSION PARAMETERS SECTION
   ============================================================ */

.parameters-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 4rem;
    align-items: start;
}

.subsection-head {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    font-weight: 500;
    color: var(--amber);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    margin-bottom: 1rem;
    margin-top: 2rem;
}

.parameters-main .subsection-head:first-child {
    margin-top: 0;
}

.procedure-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.procedure-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    font-size: 15px;
    color: var(--pale-console);
    line-height: 1.6;
}

.proc-marker {
    flex-shrink: 0;
    color: var(--terracotta);
    font-size: 13px;
    margin-top: 2px;
    min-width: 16px;
}

.proc-marker.amber {
    color: var(--amber);
}

/* ---- Spec Table ---- */
.spec-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.spec-table thead th {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--signal-green);
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--dust);
}

.spec-row td {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid rgba(106, 96, 85, 0.3);
}

.spec-row--alt {
    background: var(--smoked);
}

.spec-row {
    background: var(--panel);
}

/* ============================================================
   PROCEDURE STACK SECTION
   ============================================================ */

.procedure-content {
    max-width: 900px;
}

.procedure-steps {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ---- Step Blocks — Layer 2 ---- */
.step-block {
    display: flex;
    gap: 0;
    position: relative;
    background: var(--panel);
    border-left: 3px solid var(--terracotta);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
    border-top: 1px solid rgba(255, 200, 100, 0.15);
    margin-bottom: 2rem;
}

.step-number {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 48px;
    font-weight: 400;
    color: var(--amber);
    line-height: 1;
    flex-shrink: 0;
    width: 72px;
    padding: 1.25rem 0 1.25rem 1rem;
    opacity: 0.85;
}

.step-content {
    flex: 1;
    padding: 1.25rem 2rem 1.5rem 0;
}

.step-title {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--pale-console);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.step-separator {
    height: 0;
    margin: 0 0 2rem 0;
}

/* ---- Code Blocks ---- */
.code-block {
    background: var(--obsidian);
    border-left: 2px solid var(--dust);
    padding: 1rem 1.25rem;
    margin-top: 1.25rem;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4);
}

.code-lang {
    display: block;
    margin-bottom: 0.6rem;
    font-size: 10px;
}

.code-content {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: var(--signal-green);
    white-space: pre;
    overflow-x: auto;
}

.code-content code {
    font-family: inherit;
}

/* ---- Procedure Callout ---- */
.procedure-callout {
    margin-top: 1.25rem;
}

.procedure-callout.annotation-bracket {
    background: rgba(30, 24, 16, 0.9);
    border-left: none;
}

code.mono {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.9em;
    color: var(--signal-green);
    background: rgba(126, 200, 164, 0.08);
    padding: 0.1em 0.3em;
    border-radius: 2px;
}

/* ============================================================
   SUBSYSTEM REFERENCE GRID
   ============================================================ */

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

/* ---- Technique Cards ---- */
.technique-card {
    background: var(--panel);
    position: relative;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
    border-top: 1px solid rgba(255, 200, 100, 0.15);
    display: flex;
    flex-direction: row;
    transition: box-shadow 0.2s ease;
}

.technique-card:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.8);
}

/* Terracotta left-edge accent */
.card-accent {
    width: 3px;
    background: var(--terracotta);
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.technique-card:hover .card-accent {
    background: var(--amber);
}

.card-inner {
    padding: 1.25rem 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.card-tag {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
}

.card-title {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--pale-console);
    line-height: 1.3;
}

.card-body {
    font-size: 13px;
    line-height: 1.6;
    color: var(--pale-console);
    opacity: 0.8;
    flex: 1;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(106, 96, 85, 0.3);
    font-size: 11px;
}

/* ============================================================
   TRANSMISSION LOG / FOOTER
   ============================================================ */

.section--transmission {
    background: var(--obsidian);
}

.transmission-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 4rem;
    align-items: start;
}

.transmission-log-entries {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.log-entry {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 1.5rem;
    align-items: flex-start;
    padding-bottom: 1.5rem;
    border-bottom: 1px dashed rgba(106, 96, 85, 0.35);
}

.log-entry:last-child {
    border-bottom: none;
}

.log-ts {
    padding-top: 3px;
    line-height: 1.4;
    font-size: 11px;
    word-break: break-all;
}

.log-msg {
    font-size: 14px;
    line-height: 1.7;
    color: var(--pale-console);
    opacity: 0.85;
}

.contact-block {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.contact-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 12px;
    padding: 0.25rem 0;
    border-bottom: 1px solid rgba(106, 96, 85, 0.25);
}

.contact-row:last-child {
    border-bottom: none;
}

/* ---- Footer Colophon ---- */
.transmission-footer {
    margin-top: 4rem;
}

.footer-rule {
    height: 1px;
    background: linear-gradient(to right, var(--dust), transparent);
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.footer-colophon {
    display: flex;
    gap: 3rem;
    flex-wrap: wrap;
}

/* ============================================================
   RESPONSIVE — Mobile
   ============================================================ */

@media (max-width: 768px) {
    .page-layout {
        grid-template-columns: 0 1fr;
    }

    .spine {
        display: none;
    }

    .section-body {
        padding: 2.5rem 1.5rem;
    }

    .section--hero {
        min-height: 70vh;
    }

    .hero-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .parameters-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

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

    .transmission-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .display-headline {
        font-size: clamp(48px, 14vw, 72px);
    }

    .display-headline--section {
        font-size: clamp(36px, 11vw, 64px);
    }

    .display-subheadline {
        font-size: clamp(18px, 5vw, 28px);
    }

    .log-entry {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .step-block {
        flex-direction: column;
    }

    .step-number {
        width: auto;
        font-size: 36px;
        padding: 1rem 1rem 0.5rem;
    }

    .step-content {
        padding: 0 1rem 1.25rem;
    }

    .hero-status-row {
        flex-wrap: wrap;
        gap: 1.5rem;
    }

    .footer-colophon {
        flex-direction: column;
        gap: 0.75rem;
    }

    .section-separator--double::before,
    .section-separator--double::after {
        margin: 0 1.5rem;
    }
}

@media (max-width: 1024px) {
    .reference-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
