/* miko.quest — Victorian-Ornate Zen Dashboard */

/* ============================================================
   CSS Custom Properties — Muted Vintage Palette
   ============================================================ */
:root {
    --ink: #1F1A14;
    --parchment: #E8DFC8;
    --sepia: #6B5C41;
    --sand: #9E8C6D;
    --verdigris: #4A5248;
    --linen: #C4B99A;
    --carbon: #2C2417;
    --dark-sepia: #3D3228;
    --top-bar-height: 52px;
    --scroll-offset: 0px;
}

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

html {
    scroll-behavior: auto;
}

body {
    background-color: var(--parchment);
    color: var(--dark-sepia);
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.75;
    overflow-x: hidden;
}

/* ============================================================
   Top Bar (Fixed)
   ============================================================ */
#top-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--top-bar-height);
    background-color: var(--ink);
    z-index: 100;
    border-bottom: 1px solid var(--carbon);
}

#top-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 24px;
    position: relative;
}

#wordmark {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.wordmark-text {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--parchment);
    white-space: nowrap;
}

.filigree-corner {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.85;
}

/* Tile texture on top bar */
#top-bar::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cg stroke='%239E8C6D' stroke-width='0.5' fill='none' opacity='0.04'%3E%3Ccircle cx='20' cy='20' r='8'/%3E%3Ccircle cx='0' cy='0' r='6'/%3E%3Ccircle cx='40' cy='0' r='6'/%3E%3Ccircle cx='0' cy='40' r='6'/%3E%3Ccircle cx='40' cy='40' r='6'/%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

/* ============================================================
   Panels — Full Viewport
   ============================================================ */
.panel {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    padding-top: var(--top-bar-height);
    display: flex;
    flex-direction: column;
}

.panel-light {
    background-color: var(--parchment);
}

.panel-dark {
    background-color: var(--carbon);
}

.panel-ink {
    background-color: var(--ink);
}

/* ============================================================
   Parallax Layers
   ============================================================ */
.parallax-bg,
.parallax-mid {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.bg-engraving {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.bg-tile-pattern {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.botanical-breathe {
    animation: botanicalBreathe 8s ease-in-out infinite;
    transform-origin: center center;
}

@keyframes botanicalBreathe {
    0%   { transform: scale(1.0);   }
    50%  { transform: scale(1.008); }
    100% { transform: scale(1.0);   }
}

/* ============================================================
   Panel Frame (Ornamental Border)
   ============================================================ */
.panel-frame {
    position: absolute;
    inset: calc(var(--top-bar-height) + 20px) 20px 56px 20px;
    border: 1px solid var(--linen);
    pointer-events: none;
}

.corner-filigree {
    position: absolute;
}

.corner-tl { top: -1px;  left: -1px;  }
.corner-tr { top: -1px;  right: -1px; }
.corner-bl { bottom: -1px; left: -1px;  }
.corner-br { bottom: -1px; right: -1px; }

/* ============================================================
   Panel Content
   ============================================================ */
.panel-content {
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 60px 80px 40px 80px;
}

/* ============================================================
   Dashboard Grid (2-column)
   ============================================================ */
.dashboard-grid {
    display: grid;
    grid-template-columns: 38fr 1px 62fr;
    gap: 0;
    flex: 1;
    min-height: 0;
}

.col-left {
    padding: 40px 60px 40px 0;
    max-width: 560px;
}

.col-divider {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.col-divider-line {
    width: 1px;
    flex: 1;
    background-color: var(--linen);
}

.col-divider-lozenge {
    position: absolute;
    top: 50%;
    transform: translateY(-50%) translateX(-50%);
    left: 50%;
}

.col-right {
    padding: 40px 0 40px 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================================
   Drop Cap Block (Panel I)
   ============================================================ */
.drop-cap-block {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.drop-cap-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
    margin-bottom: 8px;
}

.drop-cap-frame {
    position: absolute;
    inset: 0;
}

.drop-cap {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'IM Fell English', serif;
    font-size: 56px;
    font-weight: 400;
    color: var(--sepia);
    line-height: 1;
    padding-top: 4px;
}

.drop-cap-text p {
    font-family: 'DM Sans', sans-serif;
    font-weight: 300;
    font-size: 16px;
    line-height: 1.75;
    color: var(--dark-sepia);
    margin-bottom: 1.6em;
    max-width: 560px;
}

.drop-cap-text p:last-child {
    margin-bottom: 0;
}

/* ============================================================
   Fern Engraving (Panel I right column)
   ============================================================ */
.fern-engraving {
    width: 100%;
    max-width: 380px;
    height: auto;
    max-height: calc(100vh - var(--top-bar-height) - 160px);
}

/* ============================================================
   Index Grid (Panel II)
   ============================================================ */
.index-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
    width: 100%;
    flex: 1;
    align-items: center;
}

.subject-card {
    border: 1px solid var(--linen);
    padding: 36px 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: border-color 200ms ease, transform 200ms ease;
    cursor: default;
}

.subject-card:hover {
    border-color: var(--sand);
    transform: translateY(-3px);
}

.card-numeral {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: 11px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--sand);
}

.card-divider-top {
    height: 1px;
    background-color: var(--linen);
    opacity: 0.5;
}

.card-heading {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--parchment);
    line-height: 1.5;
}

.ornamental-divider {
    width: 100%;
    height: 16px;
    overflow: hidden;
}

.card-body {
    font-family: 'DM Sans', sans-serif;
    font-weight: 300;
    font-size: 14px;
    line-height: 1.7;
    color: var(--sand);
}

/* ============================================================
   Typographic Statement (Panel III left)
   ============================================================ */
.col-left-statement {
    display: flex;
    align-items: center;
}

.typographic-statement {
    padding: 48px 0;
}

.fell-statement {
    font-family: 'IM Fell English', serif;
    font-style: italic;
    font-size: 30px;
    line-height: 1.5;
    color: var(--ink);
    letter-spacing: 0.01em;
    margin-bottom: 24px;
}

.statement-rule {
    width: 48px;
    height: 1px;
    background-color: var(--linen);
    margin: 20px 0;
}

.fell-statement-sub {
    font-family: 'IM Fell English', serif;
    font-style: italic;
    font-size: 22px;
    line-height: 1.6;
    color: var(--sepia);
    letter-spacing: 0.01em;
}

/* ============================================================
   Sub-panels (Panel III right)
   ============================================================ */
.col-right-subpanels {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding-left: 60px;
}

.sub-panel {
    border: 1px solid var(--linen);
    padding: 28px 32px;
    margin-bottom: -1px;
}

.sub-panel-label {
    display: block;
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: 11px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--sand);
    margin-bottom: 10px;
}

.sub-panel-value {
    font-family: 'DM Sans', sans-serif;
    font-weight: 300;
    font-size: 15px;
    line-height: 1.7;
    color: var(--dark-sepia);
}

/* ============================================================
   Archive Lockup (Panel IV)
   ============================================================ */
.panel-4-content {
    justify-content: center;
    align-items: center;
}

.archive-lockup {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.lockup-miko {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 700;
    font-size: 96px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--parchment);
    line-height: 1;
}

.lockup-divider {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lockup-quest {
    font-family: 'IM Fell English', serif;
    font-style: italic;
    font-size: 64px;
    color: var(--parchment);
    opacity: 0.85;
    line-height: 1;
}

.lockup-paragraph {
    margin-top: 36px;
    max-width: 560px;
}

.lockup-paragraph p {
    font-family: 'DM Sans', sans-serif;
    font-weight: 300;
    font-size: 16px;
    line-height: 1.75;
    color: var(--parchment);
    opacity: 0.85;
    text-align: center;
}

/* ============================================================
   Panel Footer
   ============================================================ */
.panel-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 80px;
    gap: 16px;
    position: relative;
    z-index: 2;
    height: 48px;
}

.panel-footer-rule {
    flex: 1;
    height: 1px;
    background-color: var(--linen);
}

.panel-footer-rule-dark {
    background-color: var(--sepia);
    opacity: 0.5;
}

.section-numeral {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: 11px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--sepia);
    white-space: nowrap;
}

.section-numeral-light {
    color: var(--sand);
}

/* ============================================================
   Fade-in Animation (IntersectionObserver driven)
   ============================================================ */
.fade-in {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 600ms ease-out, transform 600ms ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-stagger {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 600ms ease-out, transform 600ms ease-out;
}

.fade-in-stagger.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================
   Background engraving vignette (Panel IV)
   ============================================================ */
.bg-engraving-vignette {
    width: 100%;
    height: 60%;
    top: 0;
    bottom: auto;
}

/* ============================================================
   Responsive considerations
   ============================================================ */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .col-divider {
        display: none;
    }

    .col-right {
        padding-left: 0;
    }

    .col-left {
        padding-right: 0;
    }

    .index-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .lockup-miko {
        font-size: 64px;
    }

    .lockup-quest {
        font-size: 48px;
    }
}

@media (max-width: 640px) {
    .panel-content {
        padding: 40px 32px 32px 32px;
    }

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

    .lockup-miko {
        font-size: 48px;
    }

    .lockup-quest {
        font-size: 36px;
    }
}
