/* miko.cam — a devotional photography console.
   evolved-minimal · dashboard · retro-display · terracotta-warm · zoom-focus · lens-flare */

:root {
    --cream:      #f5e6d3; /* rice paper cream — page background */
    --ink:        #3a2418; /* sumi ink brown — primary text */
    --terracotta: #c2856a; /* terracotta — primary accent */
    --cedar:      #7a4a36; /* burnt cedar — secondary accent / stage border */
    --aged:       #d9b89e; /* aged paper — dividers */
    --ember:      #e8a87c; /* dusk ember — rare highlight */
    --tea:        #9a7558; /* tea stain — muted text / de-focused */
    --paper-fill: rgba(255,253,248,0.4);

    --serif-display: "DM Serif Display", Georgia, serif;
    --serif-label:   "Cormorant Garamond", Georgia, serif;
    --serif-body:    "EB Garamond", Georgia, serif;
}

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

html { scroll-behavior: smooth; }

body {
    background: var(--cream);
    color: var(--ink);
    font-family: var(--serif-body);
    font-size: 16px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

/* ---------- paper grain overlay ---------- */
.grain-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    mix-blend-mode: multiply;
    opacity: 0.6;
    z-index: 9999;
}
.grain-overlay svg { width: 100%; height: 100%; }

/* ---------- console grid skeleton ---------- */
.console {
    display: grid;
    grid-template-columns: 220px 1fr 260px;
    grid-template-rows: 64px 1fr 80px;
    min-height: 100vh;
    gap: 0;
}

/* ---------- header strip ---------- */
.strip {
    grid-column: 1 / -1;
    grid-row: 1;
    display: flex;
    align-items: center;
    gap: 2.2rem;
    padding: 0 1.6rem;
    border-bottom: 1px solid var(--terracotta);
}
.wordmark {
    font-family: var(--serif-display);
    font-size: 1.4rem;
    letter-spacing: 0.02em;
    color: var(--ink);
}
.wordmark .dot-dom { color: var(--terracotta); }
.strip-line {
    font-family: var(--serif-body);
    font-style: italic;
    font-size: 0.98rem;
    color: var(--tea);
}
.strip-clock {
    margin-left: auto;
    font-family: var(--serif-display);
    font-size: 1.05rem;
    letter-spacing: 0.12em;
    color: var(--cedar);
}

/* ---------- left rail: frame ledger ---------- */
.rail {
    grid-column: 1;
    grid-row: 2;
    border-right: 1px solid var(--terracotta);
    padding: 1.4rem 1.1rem 1.2rem;
    display: flex;
    flex-direction: column;
}
.rail-head, .rail-foot {
    font-family: var(--serif-label);
    font-size: 0.72rem;
    text-transform: lowercase;
    letter-spacing: 0.18em;
    color: var(--tea);
}
.rail-head { margin-bottom: 1.2rem; }
.rail-foot { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--aged); }
.ledger { list-style: none; display: flex; flex-direction: column; gap: 0.15rem; }
.entry {
    display: grid;
    grid-template-columns: 10px 1.6rem 1fr;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.55rem 0.4rem;
    cursor: pointer;
    border-left: 1px solid transparent;
    transition: background 220ms ease, border-color 220ms ease;
}
.entry:hover { background: rgba(194,133,106,0.08); }
.entry.active {
    background: rgba(232,168,124,0.14);
    border-left: 1px solid var(--ember);
}
.entry .dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--terracotta);
    align-self: center;
}
.entry.active .dot { background: var(--ember); }
.entry .e-num {
    font-family: var(--serif-display);
    font-size: 0.95rem;
    color: var(--cedar);
}
.entry.active .e-num { color: var(--ink); }
.entry .e-sub {
    font-family: var(--serif-body);
    font-size: 0.86rem;
    color: var(--ink);
    letter-spacing: 0.01em;
}

/* ---------- central viewport: the focus stage ---------- */
.stage-wrap {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.2rem 1.6rem;
    gap: 1.1rem;
}
.stage {
    position: relative;
    aspect-ratio: 4 / 3;
    width: 100%;
    max-width: 720px;
    border: 1px solid var(--cedar);
    padding: 8%;
    background: var(--paper-fill);
    overflow: hidden;
    cursor:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cg stroke='%23c2856a' stroke-width='1.4' fill='none'%3E%3Cline x1='12' y1='2' x2='12' y2='9'/%3E%3Cline x1='12' y1='15' x2='12' y2='22'/%3E%3Cline x1='2' y1='12' x2='9' y2='12'/%3E%3Cline x1='15' y1='12' x2='22' y2='12'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/g%3E%3C/svg%3E") 12 12, crosshair;
}
/* crop-mark corners — L-shaped registration strokes 12px outside each corner */
.stage::before, .stage::after {
    content: "";
    position: absolute;
    width: 8px; height: 8px;
    pointer-events: none;
}
.stage::before {
    top: -12px; left: -12px;
    border-top: 1px solid var(--terracotta);
    border-left: 1px solid var(--terracotta);
    box-shadow:
        calc(100% + 12px) 0 0 -0px transparent; /* placeholder; real corners below */
}
/* Use the .stage-inner pseudo for the other two corners and explicit corner spans */
.stage::after {
    bottom: -12px; right: -12px;
    border-bottom: 1px solid var(--terracotta);
    border-right: 1px solid var(--terracotta);
}
/* extra corners drawn via the reticle wrapper's siblings — using box-shadow trick:
   simpler to add two more pseudo-bearing wrappers. We attach to .stage-inner. */
.stage-inner::before, .stage-inner::after {
    content: "";
    position: absolute;
    width: 8px; height: 8px;
    pointer-events: none;
    z-index: 4;
}
.stage-inner::before {
    top: -12px; right: -12px;
    border-top: 1px solid var(--terracotta);
    border-right: 1px solid var(--terracotta);
}
.stage-inner::after {
    bottom: -12px; left: -12px;
    border-bottom: 1px solid var(--terracotta);
    border-left: 1px solid var(--terracotta);
}
/* push those pseudo-corners relative to the stage, not stage-inner padding */
.stage-inner { position: static; }

/* ---------- viewfinder reticle ---------- */
.reticle {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    opacity: 0.06;
    transition: opacity 280ms ease-out;
}
.stage.focusing .reticle { opacity: 0.18; }
.reticle span { position: absolute; background: var(--cedar); }
.reticle .r-v { top: 0; bottom: 0; width: 1px; }
.reticle .r-v1 { left: 33.333%; }
.reticle .r-v2 { left: 66.666%; }
.reticle .r-h { left: 0; right: 0; height: 1px; }
.reticle .r-h1 { top: 33.333%; }
.reticle .r-h2 { top: 66.666%; }
.reticle .r-cross { background: var(--terracotta); }
.reticle .r-cx { left: 50%; top: calc(50% - 9px); width: 1px; height: 18px; }
.reticle .r-cy { top: 50%; left: calc(50% - 9px); height: 1px; width: 18px; }

/* ---------- lens flare ---------- */
.flare {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}
.flare-main {
    top: 8%; right: 12%;
    width: 320px; height: 320px;
    background: radial-gradient(circle,
        rgba(232,168,124,0.35) 0%,
        rgba(232,168,124,0.08) 40%,
        transparent 70%);
    z-index: 2;
    animation: drift 24s ease-in-out infinite;
}
.flare-rays {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    opacity: 0.1;
    filter: blur(8px);
}
.flare-second {
    bottom: 12%; left: 14%;
    width: 80px; height: 80px;
    background: radial-gradient(circle,
        rgba(232,168,124,0.5) 0%,
        rgba(232,168,124,0.12) 45%,
        transparent 70%);
    z-index: 2;
    opacity: 0;
}
.flare-second.pulse { animation: flarePulse 600ms ease-out; }
@keyframes drift {
    0%   { transform: translate(0, 0); }
    50%  { transform: translate(-12px, 8px); }
    100% { transform: translate(0, 0); }
}
@keyframes flarePulse {
    0%   { opacity: 0; transform: scale(0.7); }
    35%  { opacity: 0.6; transform: scale(1.05); }
    100% { opacity: 0; transform: scale(1); }
}

/* ---------- the focused content ---------- */
.stage-inner {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    height: 100%;
    gap: 1.1rem;
}
/* zoom-focus: when hovering the stage, soften the siblings of the hovered child */
.stage:hover .focusable {
    filter: blur(2px) saturate(0.55) opacity(0.5);
    transition: filter 280ms ease-out, transform 280ms ease-out, opacity 280ms ease-out;
}
.stage .focusable {
    transition: filter 280ms ease-out, transform 280ms ease-out, opacity 280ms ease-out;
    transform-origin: left center;
}
.stage:hover .focusable:hover {
    filter: none;
    transform: scale(1.04);
}
.stage-tag {
    font-family: var(--serif-label);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: lowercase;
    color: var(--tea);
}
.frame-numeral {
    font-family: var(--serif-display);
    font-weight: 400;
    font-size: clamp(3rem, 8vw, 6rem);
    line-height: 1;
    color: var(--ink);
    border-bottom: 1px solid var(--aged);
    padding-bottom: 0.4rem;
}
.frame-numeral .numero { color: var(--terracotta); }
.narrator-body {
    font-family: var(--serif-body);
    font-size: 1.05rem;
    line-height: 1.7;
    letter-spacing: 0.012em;
    color: var(--ink);
    max-width: 32ch;
}
.witness-quote {
    font-family: var(--serif-body);
    font-style: italic;
    font-size: 0.95rem;
    color: var(--cedar);
    letter-spacing: 0.01em;
}
.witness-quote .q-dash { color: var(--terracotta); font-style: normal; }

.stage-caption {
    font-family: var(--serif-body);
    font-style: italic;
    font-size: 0.86rem;
    color: var(--tea);
    text-align: center;
    max-width: 44ch;
}

/* ---------- right instrument column ---------- */
.instruments {
    grid-column: 3;
    grid-row: 2;
    border-left: 1px solid var(--terracotta);
    display: flex;
    flex-direction: column;
}
.panel {
    position: relative;
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid var(--aged);
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.35rem;
}
.panel:last-child { border-bottom: none; }
/* small crop-mark corners inside each panel */
.panel::before, .panel::after {
    content: "";
    position: absolute;
    width: 6px; height: 6px;
    pointer-events: none;
}
.panel::before {
    top: 6px; left: 6px;
    border-top: 1px solid var(--terracotta);
    border-left: 1px solid var(--terracotta);
}
.panel::after {
    bottom: 6px; right: 6px;
    border-bottom: 1px solid var(--terracotta);
    border-right: 1px solid var(--terracotta);
}
.panel dl { display: flex; flex-direction: column; gap: 0.15rem; }
.panel dt {
    font-family: var(--serif-label);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: lowercase;
    color: var(--tea);
}
.panel dd {
    font-family: var(--serif-display);
    font-size: 1.6rem;
    color: var(--ink);
    line-height: 1;
}
.panel-note {
    font-family: var(--serif-body);
    font-style: italic;
    font-size: 0.78rem;
    color: var(--tea);
}

/* aperture diagram */
.aperture { width: 64px; height: 64px; display: block; margin-top: 0.2rem; }
.aperture .blade {
    fill: var(--cedar);
    transform-origin: 40px 40px;
    animation: irisOpen 1.2s ease forwards;
}
.aperture .iris-hex { fill: var(--terracotta); }
.aperture .b1 { animation-delay: 0s; }
.aperture .b2 { animation-delay: 0.04s; }
.aperture .b3 { animation-delay: 0.08s; }
.aperture .b4 { animation-delay: 0.12s; }
.aperture .b5 { animation-delay: 0.16s; }
.aperture .b6 { animation-delay: 0.2s; }
@keyframes irisOpen {
    0%   { transform: rotate(40deg) scale(1.4); opacity: 1; }
    100% { transform: rotate(0deg) scale(1); opacity: 0.85; }
}

/* meters */
.meter {
    width: 100%; height: 6px;
    background: rgba(154,117,88,0.18);
    margin-top: 0.2rem;
    overflow: hidden;
}
.meter-fill {
    display: block;
    height: 100%;
    width: 50%;
    background: var(--terracotta);
    transition: width 600ms ease-out;
}

/* ---------- footer strip ---------- */
.footstrip {
    grid-column: 1 / -1;
    grid-row: 3;
    display: flex;
    align-items: center;
    gap: 1.6rem;
    padding: 0 1.6rem;
    border-top: 1px solid var(--terracotta);
}
.foot-mark {
    font-family: var(--serif-display);
    font-size: 1rem;
    color: var(--terracotta);
}
.foot-line {
    font-family: var(--serif-body);
    font-style: italic;
    font-size: 0.86rem;
    color: var(--tea);
}

/* ---------- the archive (only scroll content) ---------- */
.archive {
    padding: 3.4rem 2.2rem 4rem;
    border-top: 1px solid var(--terracotta);
    background: var(--cream);
}
.archive-head {
    font-family: var(--serif-display);
    font-weight: 400;
    font-size: 1.6rem;
    color: var(--ink);
    margin-bottom: 1.6rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--aged);
}
.archive-head .numero { color: var(--terracotta); }
.archive-list {
    list-style: none;
    max-width: 760px;
    display: flex;
    flex-direction: column;
}
.archive-list li {
    display: grid;
    grid-template-columns: 5.5rem 1.2rem 1fr 12px;
    align-items: baseline;
    gap: 0.7rem;
    padding: 0.5rem 0.2rem;
    border-bottom: 1px solid var(--aged);
}
.archive-list .a-num {
    font-family: var(--serif-display);
    font-size: 1rem;
    color: var(--ink);
}
.archive-list .a-dash { color: var(--terracotta); }
.archive-list .a-sub {
    font-family: var(--serif-body);
    font-size: 0.92rem;
    color: var(--ink);
    letter-spacing: 0.01em;
}
.archive-list .a-tick {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--terracotta);
    align-self: center;
    justify-self: end;
}
.archive-foot {
    margin-top: 1.6rem;
    font-family: var(--serif-body);
    font-style: italic;
    font-size: 0.9rem;
    color: var(--tea);
}

/* ---------- responsive: collapse the console gracefully ---------- */
@media (max-width: 980px) {
    .console {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto auto;
    }
    .strip { grid-column: 1; grid-row: 1; flex-wrap: wrap; gap: 0.8rem 1.6rem; padding: 0.9rem 1.2rem; }
    .strip-clock { margin-left: 0; }
    .rail { grid-column: 1; grid-row: 2; border-right: none; border-bottom: 1px solid var(--terracotta); }
    .stage-wrap { grid-column: 1; grid-row: 3; padding: 1.6rem 1.1rem; }
    .instruments { grid-column: 1; grid-row: 4; border-left: none; border-top: 1px solid var(--terracotta); }
    .panel { padding: 0.9rem 1.2rem; }
    .footstrip { grid-column: 1; grid-row: 5; flex-wrap: wrap; gap: 0.5rem 1.6rem; padding: 0.9rem 1.2rem; }
}
@media (max-width: 560px) {
    .frame-numeral { font-size: clamp(2.4rem, 12vw, 3.6rem); }
    .archive-list li { grid-template-columns: 4.4rem 1rem 1fr 10px; gap: 0.4rem; }
    .archive { padding: 2.4rem 1.2rem 3rem; }
}
