/* =====================================================
   taisho.day — Imperial Operations Dashboard
   Hand-drawn Taisho-era command-center stylesheet
   ===================================================== */

:root {
    --c-void: #070E1A;
    --c-panel: #0A1628;
    --c-surface: #101E32;
    --c-border: #2A3A4E;
    --c-grid: #3A4A5E;
    --c-rule: #4A5568;
    --c-text-primary: #C0C8D4;
    --c-text-body: #8899AA;
    --c-text-muted: #5A6A7A;
    --c-text-bright: #D8E0E8;
    --c-brass: #D4A574;
    --c-brass-dark: #8A6A40;
    --c-signal: #4A7AFF;
    --c-amber: #FFAA33;
    --c-silver: #A8B4C4;
    --c-deep-contour: #1A2A3E;

    --font-display: "Share Tech Mono", "IBM Plex Mono", monospace;
    --font-body: "IBM Plex Mono", "Share Tech Mono", monospace;
    --font-hand: "Caveat", "Inter", cursive;
}

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

html, body {
    width: 100%;
    min-height: 100vh;
    background: var(--c-void);
    color: var(--c-text-body);
    font-family: var(--font-body);
    font-weight: 400;
    overflow-x: hidden;
}

body {
    position: relative;
    background:
        radial-gradient(ellipse at 50% 30%, rgba(74,122,255,0.05) 0%, rgba(7,14,26,1) 65%),
        var(--c-void);
    min-height: 100vh;
    padding: 88px 24px 72px 88px;
}

/* SVG defs container */
.svg-defs { position: absolute; width: 0; height: 0; }

/* =====================================================
   BACKGROUND LAYERS
   ===================================================== */

.contour-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.55;
    animation: contourBreathe 60s ease-in-out infinite;
}

.contour-svg {
    width: 100%;
    height: 100%;
    display: block;
}

@keyframes contourBreathe {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(8px, -6px) scale(1.02); }
}

.particle-field {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: var(--c-text-primary);
    box-shadow: 0 0 4px rgba(192,200,212,0.4);
    pointer-events: none;
    will-change: transform, opacity;
}

/* =====================================================
   COMMAND HEADER
   ===================================================== */

.command-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 72px;
    z-index: 50;
    padding: 8px 16px;
    background: linear-gradient(180deg, #050A14 0%, #0A1628 100%);
    border-bottom: 1px solid var(--c-border);
}

.header-bezel {
    position: relative;
    height: 100%;
    background:
        repeating-linear-gradient(45deg, rgba(7,14,26,0.4) 0 1px, transparent 1px 6px),
        linear-gradient(180deg, #101E32 0%, #0A1628 100%);
    border: 1px solid var(--c-border);
    border-radius: 4px;
    box-shadow: inset 0 0 24px rgba(74,122,255,0.04);
}

.header-inner {
    height: 100%;
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 32px;
    align-items: center;
    padding: 0 28px;
}

.nameplate {
    display: flex;
    align-items: baseline;
    gap: 16px;
    letter-spacing: 0.12em;
}

.kanji-mark {
    font-family: var(--font-display);
    font-size: 1.4rem;
    color: var(--c-brass);
    text-shadow: 0 0 12px rgba(212,165,116,0.45);
    letter-spacing: 0.1em;
}

.domain-title {
    font-family: var(--font-display);
    font-size: clamp(1.1rem, 1.6vw, 1.4rem);
    color: var(--c-text-primary);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    text-shadow: 0 0 8px rgba(192,200,212,0.35);
    font-weight: 400;
}

.nameplate-sub {
    font-family: var(--font-body);
    font-size: 0.7rem;
    color: var(--c-text-muted);
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.indicator-cluster {
    display: flex;
    gap: 14px;
    align-items: center;
}

.indicator-light {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #2A3A4E, #070E1A 70%);
    border: 1px solid var(--c-border);
    box-shadow: inset 0 0 4px rgba(0,0,0,0.6);
    transition: all 0.4s ease;
}

.indicator-light[data-state="active"] {
    background: radial-gradient(circle at 35% 35%, #D8E0E8, #4A7AFF 60%, #0A1628 100%);
    box-shadow:
        0 0 8px rgba(74,122,255,0.6),
        inset 0 0 3px rgba(216,224,232,0.5);
    animation: lightPulse 3s ease-in-out infinite;
}

.indicator-light[data-state="standby"] {
    background: radial-gradient(circle at 35% 35%, #C0C8D4, #5A6A7A 60%, #0A1628 100%);
    box-shadow: 0 0 4px rgba(192,200,212,0.35);
}

.indicator-light[data-state="alert"] {
    background: radial-gradient(circle at 35% 35%, #FFEABE, #FFAA33 60%, #1A2A3E 100%);
    box-shadow: 0 0 8px rgba(255,170,51,0.6);
    animation: lightAlert 1.6s ease-in-out infinite;
}

@keyframes lightPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

@keyframes lightAlert {
    0%, 100% { opacity: 1; box-shadow: 0 0 12px rgba(255,170,51,0.7); }
    50% { opacity: 0.5; box-shadow: 0 0 4px rgba(255,170,51,0.3); }
}

.clock-readout {
    display: grid;
    grid-template-columns: auto auto;
    gap: 4px 12px;
    align-items: baseline;
    font-family: var(--font-display);
    color: var(--c-text-primary);
    padding: 6px 14px;
    border: 1px solid var(--c-border);
    border-radius: 3px;
    background: rgba(7,14,26,0.6);
    min-width: 200px;
}

.clock-label {
    grid-column: 1 / -1;
    font-size: 0.6rem;
    color: var(--c-text-muted);
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

.clock-time {
    font-size: 1.2rem;
    color: var(--c-text-bright);
    text-shadow: 0 0 8px rgba(216,224,232,0.4);
    letter-spacing: 0.1em;
}

.clock-meridian {
    font-size: 0.7rem;
    color: var(--c-brass);
    letter-spacing: 0.2em;
}

/* =====================================================
   TAB RAIL
   ===================================================== */

.tab-rail {
    position: fixed;
    left: 0;
    top: 88px;
    bottom: 64px;
    width: 72px;
    z-index: 30;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 8px;
    background: linear-gradient(90deg, rgba(7,14,26,0.92), rgba(10,22,40,0.6));
    border-right: 1px solid var(--c-border);
}

.tab-marker {
    appearance: none;
    background: linear-gradient(180deg, #1A2A3E 0%, #101E32 100%);
    border: 1px solid var(--c-border);
    border-radius: 3px 6px 6px 3px;
    color: var(--c-text-muted);
    padding: 10px 4px 6px;
    cursor: pointer;
    font-family: var(--font-display);
    font-size: 0.55rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: all 0.3s ease;
    position: relative;
}

.tab-marker::before {
    content: "";
    position: absolute;
    top: 6px;
    left: -3px;
    width: 4px;
    height: 12px;
    background: var(--c-brass-dark);
    border-radius: 2px 0 0 2px;
}

.tab-marker:hover {
    border-color: var(--c-signal);
    color: var(--c-text-primary);
}

.tab-marker.active {
    background: linear-gradient(180deg, #213A5E 0%, #142440 100%);
    border-color: var(--c-signal);
    color: var(--c-text-bright);
    box-shadow: inset 0 0 10px rgba(74,122,255,0.2);
}

.tab-marker.active::before {
    background: var(--c-brass);
    box-shadow: 0 0 6px rgba(212,165,116,0.5);
}

.tab-marker svg { display: block; }

.tab-label {
    font-size: 0.5rem;
    line-height: 1;
}

/* =====================================================
   DASHBOARD GRID
   ===================================================== */

.dashboard {
    position: relative;
    z-index: 5;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: minmax(180px, auto);
    gap: 18px;
    max-width: 1640px;
    margin: 0 auto;
}

.widget-primary { grid-column: span 8; grid-row: span 2; }
.widget-baro    { grid-column: span 4; }
.widget-thermo  { grid-column: span 2; grid-row: span 2; }
.widget-strip   { grid-column: span 4; }
.widget-log     { grid-column: span 6; }
.widget-compass { grid-column: span 4; }

/* =====================================================
   WIDGET BASE
   ===================================================== */

.widget {
    position: relative;
    background:
        url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="6" height="6"><line x1="0" y1="6" x2="6" y2="0" stroke="%23070E1A" stroke-width="0.6" stroke-opacity="0.35"/></svg>'),
        linear-gradient(160deg, #101E32 0%, #0A1628 100%);
    border: 1px solid var(--c-border);
    border-radius: 6px;
    padding: 18px 22px 16px;
    transition:
        filter 0.35s ease,
        opacity 0.35s ease,
        border-color 0.4s ease,
        background 0.4s ease;
    overflow: hidden;
    isolation: isolate;
}

.widget::before {
    /* hand-drawn double-rule effect */
    content: "";
    position: absolute;
    inset: 5px;
    border: 1px solid rgba(58,74,94,0.55);
    border-radius: 4px;
    pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(7,14,26,0.4);
}

.widget::after {
    /* cross-hatch shadow drift */
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(45deg, rgba(74,122,255,0.0) 0%, rgba(74,122,255,0.04) 100%);
    z-index: -1;
}

.widget-border {
    position: absolute;
    inset: 2px;
    border: 1px dashed rgba(42,58,78,0.5);
    border-radius: 5px;
    pointer-events: none;
    animation: borderTrace 22s linear infinite;
}

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

.brass-fastener {
    position: absolute;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 35%, #E8C896 0%, #D4A574 45%, #8A6A40 100%);
    box-shadow:
        inset 0 0 1px rgba(0,0,0,0.6),
        0 0 3px rgba(212,165,116,0.4);
    z-index: 6;
}
.brass-fastener.tl, .brass-fastener:nth-of-type(1) { top: 6px; left: 6px; }
.brass-fastener.tr, .brass-fastener:nth-of-type(2) { top: 6px; right: 6px; }
.brass-fastener.bl, .brass-fastener:nth-of-type(3) { bottom: 6px; left: 6px; }
.brass-fastener.br, .brass-fastener:nth-of-type(4) { bottom: 6px; right: 6px; }

.widget-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px 14px;
    margin: 4px 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--c-border);
}

.widget-header.compact {
    margin-bottom: 10px;
    padding-bottom: 6px;
}

.widget-tag {
    font-family: var(--font-display);
    font-size: 0.65rem;
    color: var(--c-brass);
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.widget-title {
    font-family: var(--font-display);
    font-size: clamp(0.95rem, 1.3vw, 1.2rem);
    color: var(--c-text-primary);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-shadow: 0 0 8px rgba(192,200,212,0.3);
    font-weight: 400;
}

.widget-coord {
    font-family: var(--font-body);
    font-size: 0.7rem;
    color: var(--c-text-muted);
    letter-spacing: 0.1em;
}

.widget-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px dashed var(--c-border);
    font-family: var(--font-display);
    font-size: 0.7rem;
    color: var(--c-text-muted);
    letter-spacing: 0.18em;
}

.footer-tick {
    text-transform: uppercase;
}

/* Annotation handwriting */
.annotation {
    position: absolute;
    font-family: var(--font-hand);
    font-size: 0.95rem;
    color: var(--c-brass);
    letter-spacing: 0.02em;
    pointer-events: none;
    opacity: 0.85;
}

.annot-tl { top: 50px; left: 28px; }
.annot-br { bottom: 60px; right: 32px; transform: rotate(-3deg); }
.annot-center { position: static; display: block; text-align: center; margin-top: 8px; transform: rotate(-2deg); }
.annot-bottom { position: static; text-align: center; display: block; margin-top: 6px; }

/* =====================================================
   PRIMARY OSCILLOSCOPE WIDGET
   ===================================================== */

.oscilloscope-screen {
    position: relative;
    width: 100%;
    aspect-ratio: 5 / 2;
    min-height: 280px;
    background:
        radial-gradient(ellipse at center, rgba(74,122,255,0.06) 0%, rgba(10,22,40,0.95) 70%),
        var(--c-panel);
    border: 1px solid var(--c-border);
    border-radius: 4px;
    overflow: hidden;
}

.grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(58,74,94,0.25) 1px, transparent 1px),
        linear-gradient(90deg, rgba(58,74,94,0.25) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: -1px -1px;
    pointer-events: none;
    opacity: 0.7;
}

.grid-overlay::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(58,74,94,0.45) 1px, transparent 1px),
        linear-gradient(90deg, rgba(58,74,94,0.45) 1px, transparent 1px);
    background-size: 200px 200px;
    background-position: 50% 50%;
}

.osc-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.osc-readouts {
    position: absolute;
    top: 12px;
    right: 14px;
    display: grid;
    grid-template-columns: repeat(2, auto);
    gap: 6px 16px;
    background: rgba(7,14,26,0.7);
    border: 1px solid var(--c-border);
    border-radius: 3px;
    padding: 8px 12px;
    backdrop-filter: blur(2px);
}

.osc-readout {
    display: grid;
    grid-template-columns: auto auto auto;
    gap: 4px;
    align-items: baseline;
    font-family: var(--font-display);
}

.ro-label {
    font-size: 0.6rem;
    color: var(--c-brass);
    letter-spacing: 0.16em;
}
.ro-val {
    font-size: 0.95rem;
    color: var(--c-text-bright);
    text-shadow: 0 0 6px rgba(216,224,232,0.4);
    min-width: 40px;
}
.ro-unit {
    font-size: 0.6rem;
    color: var(--c-text-muted);
    letter-spacing: 0.1em;
}

/* =====================================================
   BAROMETER
   ===================================================== */

.baro-body {
    position: relative;
    display: grid;
    place-items: center;
    padding: 8px 0;
}

.baro-svg {
    width: 100%;
    max-width: 220px;
    height: auto;
    filter: drop-shadow(0 0 6px rgba(74,122,255,0.06));
}

.baro-digit {
    font-family: var(--font-display);
    font-size: clamp(1.1rem, 1.8vw, 1.4rem);
    color: var(--c-text-bright);
    letter-spacing: 0.2em;
    margin-top: 6px;
    text-shadow: 0 0 6px rgba(216,224,232,0.4);
}

/* =====================================================
   THERMOMETER
   ===================================================== */

.thermo-body {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    align-items: stretch;
    padding: 4px 0;
}

.thermo-svg {
    width: 76px;
    height: auto;
}

.thermo-readout {
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-family: var(--font-display);
}

.thermo-val {
    font-size: clamp(1.6rem, 2.5vw, 2.4rem);
    color: var(--c-text-bright);
    letter-spacing: 0.06em;
    text-shadow: 0 0 8px rgba(216,224,232,0.4);
}

.thermo-unit {
    font-size: 1rem;
    color: var(--c-brass);
    letter-spacing: 0.1em;
    margin-left: 4px;
}

.thermo-sub {
    font-family: var(--font-body);
    font-size: 0.65rem;
    color: var(--c-text-muted);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-top: 6px;
}

/* =====================================================
   STRIP CHART
   ===================================================== */

.strip-body {
    background: var(--c-panel);
    border: 1px solid var(--c-border);
    border-radius: 3px;
    padding: 10px 12px;
}

.strip-svg {
    width: 100%;
    height: 120px;
    display: block;
}

.strip-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-family: var(--font-display);
    font-size: 0.65rem;
    color: var(--c-text-muted);
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.strip-foot .annotation {
    position: static;
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.95rem;
}

/* =====================================================
   LOGBOOK
   ===================================================== */

.log-body {
    padding: 4px 4px 0;
}

.log-entries {
    list-style: none;
    display: grid;
    gap: 4px;
}

.log-entry {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 16px;
    padding: 6px 4px;
    border-bottom: 1px dashed rgba(42,58,78,0.5);
    font-family: var(--font-body);
    font-size: 0.78rem;
    color: var(--c-text-body);
    letter-spacing: 0.04em;
    transition: all 0.4s ease;
}

.log-entry:nth-child(1) { color: var(--c-text-bright); }
.log-entry:hover { color: var(--c-text-primary); background: rgba(74,122,255,0.04); }

.log-time {
    font-family: var(--font-display);
    color: var(--c-brass);
    letter-spacing: 0.12em;
    font-size: 0.78rem;
}

.log-text {
    color: inherit;
}

.log-margin {
    margin-top: 8px;
    text-align: right;
}

.log-margin .annotation {
    position: static;
    font-size: 0.95rem;
}

/* =====================================================
   COMPASS
   ===================================================== */

.compass-body {
    position: relative;
    display: grid;
    place-items: center;
    padding: 4px 0;
}

.compass-svg {
    width: 100%;
    max-width: 220px;
    height: auto;
}

#compassRose {
    transform-origin: 100px 100px;
    animation: compassDrift 24s ease-in-out infinite;
}

@keyframes compassDrift {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(2.5deg); }
}

.compass-readout {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 8px;
    font-family: var(--font-display);
}

.cr-label {
    font-size: 0.65rem;
    color: var(--c-brass);
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.cr-val {
    font-size: 1.2rem;
    color: var(--c-text-bright);
    letter-spacing: 0.14em;
    margin-top: 2px;
    text-shadow: 0 0 6px rgba(216,224,232,0.4);
}

/* =====================================================
   BLUR-FOCUS INTERACTION
   ===================================================== */

.dashboard.focus-mode .widget {
    filter: blur(2px);
    opacity: 0.7;
}

.dashboard.focus-mode .widget.is-focus {
    filter: blur(0);
    opacity: 1;
    border-color: var(--c-signal);
    box-shadow:
        0 0 0 1px rgba(74,122,255,0.25),
        0 0 24px rgba(74,122,255,0.18);
}

.widget.is-expanded {
    grid-column: span 12 !important;
    grid-row: span 2 !important;
}

/* =====================================================
   TELETYPE STRIP
   ===================================================== */

.teletype-strip {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 24px;
    background: linear-gradient(180deg, #050A14 0%, #0A1628 100%);
    border-top: 1px solid var(--c-border);
    overflow: hidden;
}

.tt-label {
    font-family: var(--font-display);
    font-size: 0.7rem;
    color: var(--c-brass);
    letter-spacing: 0.24em;
    text-transform: uppercase;
    flex-shrink: 0;
    padding: 4px 8px;
    border: 1px solid var(--c-brass-dark);
    border-radius: 3px;
}

.tt-tape {
    flex: 1;
    font-family: var(--font-display);
    font-size: 0.85rem;
    color: var(--c-text-primary);
    letter-spacing: 0.12em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
    text-shadow: 0 0 4px rgba(192,200,212,0.3);
}

.tt-tape span.tt-char {
    display: inline-block;
    will-change: transform;
}

.tt-cursor {
    color: var(--c-amber);
    font-family: var(--font-display);
    font-size: 1.1rem;
    animation: cursorBlink 0.8s steps(1) infinite;
    text-shadow: 0 0 6px rgba(255,170,51,0.6);
}

@keyframes cursorBlink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* =====================================================
   BOOT VEIL (opening sequence)
   ===================================================== */

.boot-veil {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: var(--c-void);
    pointer-events: none;
    animation: veilFade 4s ease-out forwards;
}

@keyframes veilFade {
    0%, 25% { opacity: 1; }
    100% { opacity: 0; visibility: hidden; }
}

/* =====================================================
   ENTRANCE STAGGER
   ===================================================== */

.command-header {
    opacity: 0;
    animation: fadeInDown 0.8s 3.2s ease-out forwards;
}

.tab-rail {
    opacity: 0;
    animation: fadeInRight 0.8s 3.0s ease-out forwards;
}

.teletype-strip {
    opacity: 0;
    animation: fadeInUp 0.8s 3.4s ease-out forwards;
}

.widget {
    opacity: 0;
    transform: translateY(8px);
    animation: widgetMaterialize 0.7s ease-out forwards;
}

.widget-primary  { animation-delay: 2.4s; }
.widget-baro     { animation-delay: 2.6s; }
.widget-thermo   { animation-delay: 2.7s; }
.widget-strip    { animation-delay: 2.8s; }
.widget-log      { animation-delay: 2.9s; }
.widget-compass  { animation-delay: 3.0s; }

@keyframes widgetMaterialize {
    0% { opacity: 0; transform: translateY(12px) scale(0.985); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fadeInDown {
    0% { opacity: 0; transform: translateY(-12px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    0% { opacity: 0; transform: translateY(12px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInRight {
    0% { opacity: 0; transform: translateX(-12px); }
    100% { opacity: 1; transform: translateX(0); }
}

/* =====================================================
   PARTICLE KEYFRAMES (programmatically applied)
   ===================================================== */

@keyframes drift1 {
    0%   { transform: translate(0, 0); opacity: 0.05; }
    25%  { transform: translate(18px, -14px); opacity: 0.15; }
    50%  { transform: translate(-12px, -28px); opacity: 0.1; }
    75%  { transform: translate(22px, -10px); opacity: 0.18; }
    100% { transform: translate(0, 0); opacity: 0.05; }
}

@keyframes drift2 {
    0%   { transform: translate(0, 0); opacity: 0.08; }
    33%  { transform: translate(-22px, -18px); opacity: 0.16; }
    66%  { transform: translate(14px, -30px); opacity: 0.05; }
    100% { transform: translate(0, 0); opacity: 0.08; }
}

@keyframes drift3 {
    0%   { transform: translate(0, 0); opacity: 0.1; }
    50%  { transform: translate(28px, -22px); opacity: 0.18; }
    100% { transform: translate(0, 0); opacity: 0.1; }
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 1100px) {
    body { padding: 88px 16px 72px 80px; }
    .widget-primary { grid-column: span 12; grid-row: span 1; }
    .widget-baro { grid-column: span 6; }
    .widget-thermo { grid-column: span 6; grid-row: span 1; }
    .widget-strip { grid-column: span 6; }
    .widget-log { grid-column: span 12; }
    .widget-compass { grid-column: span 6; }
}

@media (max-width: 720px) {
    body { padding: 76px 10px 64px 64px; }
    .header-inner { grid-template-columns: 1fr auto; gap: 12px; padding: 0 14px; }
    .indicator-cluster { display: none; }
    .clock-readout { min-width: 0; padding: 4px 10px; }
    .clock-time { font-size: 1rem; }
    .nameplate-sub { display: none; }
    .domain-title { font-size: 1rem; }
    .tab-rail { width: 56px; }
    .tab-marker { font-size: 0.5rem; }
    .tab-label { display: none; }
    .dashboard { grid-template-columns: 1fr; gap: 14px; }
    .widget-primary, .widget-baro, .widget-thermo, .widget-strip, .widget-log, .widget-compass {
        grid-column: span 1;
        grid-row: auto;
    }
    .widget { padding: 14px 16px; }
    .annot-tl, .annot-br { display: none; }
    .osc-readouts { position: static; margin-top: 10px; grid-template-columns: repeat(2, 1fr); }
    .oscilloscope-screen { aspect-ratio: 4 / 3; min-height: 220px; }
}
