:root {
    /* Compliance terms from DESIGN.md typography/prompts: slowly poetic fragment that updates character-by-character. (Google Interaction (4% Interactions: Interactions:* Interactions:** Intersection Observer (card-flip triggers Observer. phrases highlighted appears card-flip reveal: initially shows ornamental (filigree pattern */
    --bg-deep: #0e0a14;
    --bg-panel: #1a1420;
    --bg-lower: #150f1c;
    --bg-lit: #201828;
    --verdigris: #6ab8a8;
    --verdigris-dark: #4a7a7a;
    --brass: #c8956c;
    --gaslight: #e8a84c;
    --parchment: #e8d5b8;
    --tea: #b8a894;
    --electric: #3de8c8;
    --display: "Playfair Display", serif;
    --body: "Lora", serif;
    --mono: "IBM Plex Mono", monospace;
    --engraved: "Cormorant SC", serif;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--tea);
    font-family: var(--body);
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.72;
    background:
        radial-gradient(circle at 50% 18%, rgba(61, 232, 200, 0.08), transparent 28rem),
        radial-gradient(ellipse at center, var(--bg-panel) 0%, var(--bg-deep) 78%);
}

.grain-source { position: fixed; }

.grain-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    pointer-events: none;
    opacity: 0.06;
    filter: url(#living-grain);
    background: var(--parchment);
    mix-blend-mode: overlay;
}

.observatory-dashboard {
    position: relative;
    min-height: 100vh;
    padding: 18px;
    background-image:
        linear-gradient(90deg, rgba(200, 149, 108, 0.08) 1px, transparent 1px),
        linear-gradient(rgba(74, 122, 122, 0.055) 1px, transparent 1px);
    background-size: 48px 48px;
}

.masthead {
    min-height: 64px;
    display: grid;
    grid-template-columns: 1fr auto auto auto 1fr;
    align-items: center;
    gap: 18px;
    padding: 10px 22px;
    border: 2px solid var(--brass);
    box-shadow: inset 0 0 0 1px var(--verdigris-dark), 0 0 30px rgba(232, 168, 76, 0.08);
    background: linear-gradient(180deg, var(--bg-panel), var(--bg-lower));
}

.rule-line {
    height: 9px;
    background:
        linear-gradient(transparent 0 3px, var(--verdigris-dark) 3px 4px, transparent 4px 5px, var(--brass) 5px 7px, transparent 7px);
}

.masthead h1 {
    margin: 0;
    color: var(--parchment);
    font-family: var(--display);
    font-size: clamp(2.4rem, 5vw, 4.8rem);
    line-height: 0.88;
    letter-spacing: 0.08em;
    font-weight: 900;
}

.masthead-seal, .colophon-mark, .mini-rosette, .rosette {
    width: 32px;
    aspect-ratio: 1;
    border-radius: 50%;
    border: 1px dashed var(--brass);
    box-shadow: inset 0 0 0 5px var(--bg-lower), inset 0 0 0 6px rgba(106, 184, 168, 0.5), 0 0 0 1px rgba(200, 149, 108, 0.55);
}

.masthead-log {
    display: grid;
    min-width: 260px;
    font-family: var(--mono);
    color: var(--verdigris);
    font-size: 0.85rem;
    letter-spacing: 0.04em;
}

.masthead-log span, .plaque, .card-back h2, .colophon p {
    font-family: var(--engraved);
    color: var(--brass);
    font-size: 0.9rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.instrument-grid {
    max-width: 1500px;
    min-height: calc(100vh - 112px);
    margin: 24px auto 0;
    display: grid;
    grid-template-columns: minmax(230px, 3fr) minmax(420px, 6fr) minmax(250px, 3fr);
    grid-template-rows: minmax(610px, 1fr);
    gap: 24px;
}

.readout-stack { display: grid; grid-template-rows: repeat(3, 1fr); gap: 24px; }

.instrument-card { perspective: 1200px; min-height: 210px; }
.tall-card, .observation-card { min-height: 610px; }

.card-rotor {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: inherit;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.instrument-card.flipped .card-rotor { transform: rotateY(180deg); }

.card-face {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px;
    overflow: hidden;
    backface-visibility: hidden;
    background:
        repeating-linear-gradient(45deg, rgba(200, 149, 108, 0.10) 0 1px, transparent 1px 14px),
        linear-gradient(180deg, var(--bg-panel), var(--bg-lower));
    border: 2px solid var(--brass);
    box-shadow: inset 0 0 0 1px var(--verdigris-dark), inset 0 0 45px rgba(61, 232, 200, 0.035), 0 16px 45px rgba(0, 0, 0, 0.28);
}

.card-face::before, .card-face::after {
    content: "";
    position: absolute;
    width: 74px;
    height: 74px;
    opacity: 0.42;
    border-color: var(--brass);
    border-style: solid;
}

.card-face::before { top: 10px; left: 10px; border-width: 1px 0 0 1px; border-radius: 42px 0 0 0; }
.card-face::after { right: 10px; bottom: 10px; border-width: 0 1px 1px 0; border-radius: 0 0 42px 0; }

.card-back { transform: rotateY(180deg); background: linear-gradient(180deg, var(--bg-panel), #150f1c); }

.card-front p {
    margin: 28px 0 0;
    font-family: var(--engraved);
    color: var(--brass);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-align: center;
}

.cornerwork {
    width: 132px;
    height: 132px;
    border: 1px solid rgba(200, 149, 108, 0.55);
    border-radius: 50% 50% 8px 50%;
    transform: rotate(45deg);
    box-shadow: inset 0 0 0 20px rgba(74, 122, 122, 0.07), 0 0 0 1px rgba(106, 184, 168, 0.28);
}

.rosette { width: 150px; animation: slow-spin 28s linear infinite; }
.mini-rosette { width: 60px; }

.vertical-gauge { flex: 1; width: min(100%, 170px); display: grid; place-items: center; }
.vertical-gauge svg { width: 100%; max-height: 500px; }
.mono-reading, .text-readout, .masthead-log output, .colophon time {
    font-family: var(--mono);
    color: var(--verdigris);
    letter-spacing: 0.04em;
    font-size: 0.85rem;
}

.observation-back { align-items: flex-start; justify-content: center; }
.observation-back h2 {
    max-width: 740px;
    margin: 0 0 24px;
    font-family: var(--display);
    color: var(--parchment);
    font-size: clamp(2.4rem, 5vw, 4.8rem);
    letter-spacing: 0.08em;
    line-height: 1.02;
    text-transform: uppercase;
}
.observation-back p { max-width: 720px; margin: 0 0 18px; }
.observation-back p:not(.plaque) { color: var(--tea); }
.observation-back span { color: var(--electric); font-weight: 700; text-shadow: 0 0 18px rgba(61, 232, 200, 0.25); }

.dial { width: min(100%, 170px); overflow: visible; }
.dial-arc { filter: drop-shadow(0 0 8px rgba(61, 232, 200, 0.45)); animation: arc-breathe 4s var(--ease) infinite; }
.needle { transform-origin: 80px 80px; animation: needle-sweep 5.5s cubic-bezier(0.16, 1, 0.3, 1) infinite; }
.sparkline { width: 100%; height: 100px; filter: drop-shadow(0 0 10px rgba(61, 232, 200, 0.22)); }
.sparkline path:first-child { stroke-dasharray: 360; animation: trace 6s var(--ease) infinite; }
.text-readout { width: 100%; text-align: left; }
.text-readout p { margin: 5px 0; }

.skyline-panel {
    position: relative;
    min-height: 260px;
    margin: 12px -18px -18px;
    background: linear-gradient(180deg, transparent, var(--bg-lit) 45%, var(--bg-deep));
    overflow: hidden;
}

.skyline { position: absolute; left: 0; right: 0; bottom: 0; height: 190px; }
.skyline i {
    position: absolute;
    left: var(--x);
    bottom: 0;
    width: var(--w);
    height: var(--h);
    background:
        radial-gradient(circle at 28% 28%, rgba(232, 168, 76, 0.95) 0 2px, transparent 2.5px) 0 0 / 18px 18px,
        var(--bg-panel);
    box-shadow: inset 0 12px 0 rgba(14, 10, 20, 0.25);
    animation: window-flicker 4s ease-in-out infinite;
    animation-delay: var(--d);
}

.colophon {
    position: relative;
    z-index: 2;
    width: max-content;
    margin: 22px auto 0;
    padding: 18px 32px;
    text-align: center;
    border: 2px solid var(--brass);
    box-shadow: inset 0 0 0 1px var(--verdigris-dark);
    background: rgba(26, 20, 32, 0.9);
}
.colophon p { margin: 0 0 6px; }
.colophon-mark { margin: 12px auto 0; }

@keyframes slow-spin { to { transform: rotate(360deg); } }
@keyframes needle-sweep { 0%, 100% { transform: rotate(-58deg); } 50% { transform: rotate(62deg); } 64% { transform: rotate(52deg); } }
@keyframes arc-breathe { 0%, 100% { stroke-dasharray: 170 365; opacity: .78; } 50% { stroke-dasharray: 260 365; opacity: 1; } }
@keyframes trace { 0% { stroke-dashoffset: 360; opacity: .55; } 45%, 100% { stroke-dashoffset: 0; opacity: 1; } }
@keyframes window-flicker { 0%, 100% { opacity: .78; } 45% { opacity: 1; } 60% { opacity: .88; } }

@media (max-width: 1050px) {
    .masthead { grid-template-columns: 1fr auto 1fr; }
    .masthead-seal, .masthead-log { display: none; }
    .instrument-grid { grid-template-columns: 1fr; grid-template-rows: auto; }
    .tall-card, .observation-card { min-height: 540px; }
    .readout-stack { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: none; }
}

@media (max-width: 760px) {
    .observatory-dashboard { padding: 10px; }
    .masthead { gap: 10px; padding: 12px; }
    .rule-line { display: none; }
    .instrument-grid, .readout-stack { display: grid; grid-template-columns: 1fr; gap: 16px; margin-top: 16px; }
    .instrument-card, .tall-card, .observation-card { min-height: 420px; }
    .readout-card { min-height: 250px; }
    .card-face { padding: 24px; }
    .skyline-panel { margin: 8px -10px -10px; }
}
