/* =====================================================
   amamiya.xyz — Dashboard Contemplation Space
   Colors: #141e3a #0d1733 #8a9bb8 #080e1e #1a2744 #c4943a #e8eaf0 #e8c97a
   Font: Commissioner (300/400/700)
   ===================================================== */

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #080e1e;
    color: #e8eaf0;
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    -webkit-font-smoothing: antialiased;
}

/* --- CSS Custom Properties --- */
:root {
    --deep-midnight: #141e3a;
    --abyss: #0d1733;
    --slate-blue: #8a9bb8;
    --space-black: #080e1e;
    --shadow-blue: #1a2744;
    --flare-amber: #c4943a;
    --horizon-white: #e8eaf0;
    --gold-light: #e8c97a;

    --zone-a-h: 56px;
    --zone-d-h: 32px;
    --zone-c-w: 220px;
    --border-color: rgba(138, 155, 184, 0.15);
    --border-active: rgba(138, 155, 184, 0.35);
}

/* --- Zone E: Fixed Lens Flare Overlay --- */
.zone-e {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

/* Flare stars — 8-point starburst via clip-path */
.flare-star {
    position: absolute;
    background-color: var(--flare-amber);
    opacity: 0.7;
    will-change: transform;
    transition: opacity 1.2s ease;
}

.flare-star::before,
.flare-star::after {
    content: '';
    position: absolute;
    inset: 0;
    background: inherit;
    border-radius: 2px;
}

.flare-1 {
    width: 48px;
    height: 48px;
    top: 22%;
    left: 78%;
    clip-path: polygon(50% 0%, 58% 38%, 100% 50%, 58% 62%, 50% 100%, 42% 62%, 0% 50%, 42% 38%);
    opacity: 0.65;
}

.flare-2 {
    width: 24px;
    height: 24px;
    top: 55%;
    left: 15%;
    clip-path: polygon(50% 0%, 58% 38%, 100% 50%, 58% 62%, 50% 100%, 42% 62%, 0% 50%, 42% 38%);
    opacity: 0.45;
}

.flare-3 {
    width: 64px;
    height: 64px;
    top: 70%;
    left: 62%;
    clip-path: polygon(50% 0%, 58% 38%, 100% 50%, 58% 62%, 50% 100%, 42% 62%, 0% 50%, 42% 38%);
    opacity: 0.4;
}

.flare-4 {
    width: 16px;
    height: 16px;
    top: 38%;
    left: 44%;
    clip-path: polygon(50% 0%, 58% 38%, 100% 50%, 58% 62%, 50% 100%, 42% 62%, 0% 50%, 42% 38%);
    opacity: 0.55;
}

/* Lens flare streaks */
.flare-streak {
    position: absolute;
    background: linear-gradient(90deg, transparent, var(--flare-amber), transparent);
    opacity: 0.12;
    height: 1px;
    will-change: transform;
}

.flare-streak-1 {
    width: 320px;
    top: 22.5%;
    left: 50%;
    transform: translateX(-50%) rotate(-8deg);
}

.flare-streak-2 {
    width: 220px;
    top: 55.5%;
    left: 10%;
    transform: rotate(4deg);
}

/* Leaf motifs — SVG-like organic silhouettes */
.leaf {
    position: absolute;
    opacity: 0.07;
    background-color: var(--slate-blue);
}

.leaf-1 {
    width: 80px;
    height: 120px;
    top: 10%;
    left: 5%;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    transform: rotate(-25deg);
}

.leaf-2 {
    width: 60px;
    height: 90px;
    top: 65%;
    left: 88%;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    transform: rotate(15deg);
    opacity: 0.09;
}

.leaf-3 {
    width: 100px;
    height: 150px;
    top: 30%;
    left: 50%;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    transform: rotate(40deg);
    opacity: 0.06;
}

.leaf-4 {
    width: 50px;
    height: 75px;
    top: 80%;
    left: 30%;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    transform: rotate(-60deg);
    opacity: 0.08;
}

/* --- Dashboard Grid --- */
.dashboard {
    position: relative;
    z-index: 1;
    width: 100vw;
    height: 100vh;
    display: grid;
    grid-template-areas:
        "zone-a  zone-a       zone-a"
        "zone-cl zone-b       zone-cr"
        "zone-d  zone-d       zone-d";
    grid-template-rows: var(--zone-a-h) 1fr var(--zone-d-h);
    grid-template-columns: var(--zone-c-w) 1fr var(--zone-c-w);
    background-color: transparent;
}

/* --- Zone A: Horizon Bar --- */
.zone-a {
    grid-area: zone-a;
    background-color: var(--space-black);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 24px;
    position: relative;
    z-index: 5;
}

.zone-a::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--flare-amber), transparent);
    opacity: 0.3;
}

.horizon-bar-inner {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 0;
}

.site-identifier {
    font-family: 'Commissioner', sans-serif;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.15em;
    color: var(--horizon-white);
    text-transform: uppercase;
    margin-right: auto;
}

.horizon-readouts {
    display: flex;
    align-items: center;
    gap: 12px;
}

.readout {
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: 11px;
    letter-spacing: 0.15em;
    color: var(--slate-blue);
    text-transform: uppercase;
}

.readout-value {
    color: var(--horizon-white);
}

.readout-divider {
    color: var(--border-color);
    font-size: 11px;
}

.horizon-timestamp {
    margin-left: 24px;
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: 11px;
    letter-spacing: 0.12em;
    color: var(--flare-amber);
}

/* --- Zone C: Side Panels --- */
.zone-c {
    background-color: var(--space-black);
    border-color: var(--border-color);
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    z-index: 4;
    overflow: hidden;
}

.zone-c-left {
    grid-area: zone-cl;
    border-right: 1px solid var(--border-color);
}

.zone-c-right {
    grid-area: zone-cr;
    border-left: 1px solid var(--border-color);
}

.panel-label {
    font-family: 'Commissioner', sans-serif;
    font-weight: 700;
    font-size: 9px;
    letter-spacing: 0.2em;
    color: var(--slate-blue);
    text-transform: uppercase;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 4px;
}

/* Exposure Navigation */
.exposure-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.nav-item:hover {
    background-color: rgba(138, 155, 184, 0.06);
    border-color: var(--border-color);
}

.nav-item.active {
    background-color: rgba(196, 148, 58, 0.08);
    border-color: rgba(196, 148, 58, 0.3);
}

.nav-num {
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: 10px;
    letter-spacing: 0.1em;
    color: var(--flare-amber);
    min-width: 24px;
}

.nav-title {
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: 11px;
    letter-spacing: 0.15em;
    color: var(--slate-blue);
    text-transform: uppercase;
}

.nav-item.active .nav-title {
    color: var(--horizon-white);
}

/* Depth Metric */
.panel-metric {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.metric-label {
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: 9px;
    letter-spacing: 0.2em;
    color: var(--slate-blue);
    text-transform: uppercase;
    margin-bottom: 6px;
}

.metric-bar {
    width: 100%;
    height: 2px;
    background-color: var(--shadow-blue);
    margin-bottom: 4px;
    position: relative;
    overflow: hidden;
}

.metric-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--slate-blue), var(--flare-amber));
    transition: width 0.4s ease;
}

.metric-value {
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: 10px;
    letter-spacing: 0.1em;
    color: var(--flare-amber);
    text-align: right;
}

/* Right Panel Instrument Readouts */
.instrument-readout {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.readout-label {
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: 9px;
    letter-spacing: 0.2em;
    color: var(--slate-blue);
    text-transform: uppercase;
}

.readout-display {
    font-family: 'Commissioner', sans-serif;
    font-weight: 700;
    font-size: 22px;
    letter-spacing: 0.08em;
    color: var(--horizon-white);
    line-height: 1;
}

.readout-display-sm {
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.12em;
    color: var(--flare-amber);
}

.readout-display-xs {
    font-size: 11px;
    font-weight: 300;
    letter-spacing: 0.1em;
    color: var(--gold-light);
}

.panel-divider {
    height: 1px;
    background: var(--border-color);
}

/* Micro bars (lens flare intensity) */
.micro-bars {
    display: flex;
    gap: 3px;
    align-items: flex-end;
    height: 14px;
}

.bar {
    width: 4px;
    background-color: var(--shadow-blue);
    border-radius: 1px;
    transition: background-color 0.3s ease, height 0.4s ease;
}

.bar:nth-child(1) { height: 6px; }
.bar:nth-child(2) { height: 9px; }
.bar:nth-child(3) { height: 12px; }
.bar:nth-child(4) { height: 8px; }
.bar:nth-child(5) { height: 5px; }

.bar.bar-active {
    background-color: var(--flare-amber);
}

/* Ambient Field Notes */
.ambient-field {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.field-label {
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: 9px;
    letter-spacing: 0.2em;
    color: var(--slate-blue);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.field-text {
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: 11px;
    line-height: 1.6;
    color: rgba(232, 234, 240, 0.5);
    letter-spacing: 0.02em;
    font-style: italic;
    transition: color 0.6s ease;
}

/* --- Zone B: Main Content --- */
.zone-b {
    grid-area: zone-b;
    position: relative;
    overflow: hidden;
    background-color: var(--abyss);
}

/* Vertical rule lines on Zone B background */
.zone-b::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(138, 155, 184, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(138, 155, 184, 0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
    z-index: 0;
}

.zone-b-inner {
    position: relative;
    z-index: 1;
    height: 100%;
    overflow-y: scroll;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.zone-b-inner::-webkit-scrollbar {
    display: none;
}

/* --- Exposure Articles --- */
.exposure {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px 72px;
    opacity: 0;
    transition: opacity 0.6s ease;
    position: relative;
}

.exposure.visible {
    opacity: 1;
}

/* Separator between exposures */
.exposure + .exposure::before {
    content: '';
    position: absolute;
    top: 0;
    left: 72px;
    right: 72px;
    height: 1px;
    background: var(--border-color);
}

.exposure-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 40px;
}

.exposure-number {
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: 11px;
    letter-spacing: 0.15em;
    color: var(--flare-amber);
    text-transform: uppercase;
}

.exposure-slash {
    font-size: 11px;
    color: var(--border-active);
    font-weight: 300;
}

.exposure-label {
    font-family: 'Commissioner', sans-serif;
    font-weight: 700;
    font-size: 48px;
    letter-spacing: 0.08em;
    color: var(--horizon-white);
    text-transform: uppercase;
    line-height: 1;
}

.exposure-body {
    max-width: 600px;
}

.exposure-lead {
    font-family: 'Commissioner', sans-serif;
    font-weight: 400;
    font-size: 20px;
    line-height: 1.5;
    letter-spacing: 0.02em;
    color: var(--horizon-white);
    margin-bottom: 28px;
}

.exposure-text {
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: 15px;
    line-height: 1.75;
    letter-spacing: 0.01em;
    color: var(--slate-blue);
    margin-bottom: 18px;
}

.exposure-text:last-of-type {
    margin-bottom: 0;
}

.exposure-rule {
    width: 48px;
    height: 1px;
    background: linear-gradient(90deg, var(--flare-amber), transparent);
    margin: 32px 0 24px;
}

.exposure-data-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.data-label {
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: 10px;
    letter-spacing: 0.2em;
    color: var(--slate-blue);
    text-transform: uppercase;
}

.data-value {
    font-family: 'Commissioner', sans-serif;
    font-weight: 400;
    font-size: 13px;
    letter-spacing: 0.1em;
    color: var(--flare-amber);
}

/* --- Zone D: Status Strip --- */
.zone-d {
    grid-area: zone-d;
    background-color: var(--space-black);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    position: relative;
    z-index: 5;
}

.status-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0 24px;
}

.status-left,
.status-center,
.status-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-item {
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: 10px;
    letter-spacing: 0.15em;
    color: var(--slate-blue);
    text-transform: uppercase;
    white-space: nowrap;
}

.status-value {
    color: var(--flare-amber);
}

.status-sep {
    color: var(--border-color);
    font-size: 10px;
}

/* --- Glint animation on flare stars --- */
@keyframes flare-pulse {
    0%, 100% { opacity: 0.65; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(1.08); }
}

@keyframes flare-pulse-sm {
    0%, 100% { opacity: 0.45; }
    50% { opacity: 0.65; }
}

.flare-1 {
    animation: flare-pulse 6s ease-in-out infinite;
}

.flare-2 {
    animation: flare-pulse-sm 8s ease-in-out infinite 1s;
}

.flare-3 {
    animation: flare-pulse-sm 10s ease-in-out infinite 2s;
}

.flare-4 {
    animation: flare-pulse 4s ease-in-out infinite 0.5s;
}

/* --- Scan-line texture overlay --- */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 3px,
        rgba(8, 14, 30, 0.08) 3px,
        rgba(8, 14, 30, 0.08) 4px
    );
    opacity: 0.4;
}

/* --- Responsive adjustments --- */
@media (max-width: 900px) {
    :root {
        --zone-c-w: 160px;
    }
    .exposure {
        padding: 40px 40px;
    }
    .exposure-label {
        font-size: 32px;
    }
}

@media (max-width: 640px) {
    .dashboard {
        grid-template-areas:
            "zone-a  zone-a"
            "zone-b  zone-b"
            "zone-d  zone-d";
        grid-template-columns: 1fr;
    }
    .zone-c { display: none; }
    .exposure { padding: 32px 24px; }
    .exposure-label { font-size: 28px; }
}
