/* ================================= */
/* martial.quest - Victorian Cabinet  */
/* ================================= */

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: #0b1228;
    color: #e8dcc8;
    font-family: "Cormorant Garamond", Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.65;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    cursor: none;
}

/* ======================== */
/* Background Pattern       */
/* ======================== */
.bg-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cpath d='M25 15 L30 10 L35 15 M25 15 L30 20 L35 15' fill='none' stroke='%23c9a84c' stroke-width='0.5'/%3E%3Cpath d='M20 40 L30 35 L40 40 L30 45 Z' fill='none' stroke='%23c9a84c' stroke-width='0.5'/%3E%3C/svg%3E");
    background-size: 60px 60px;
}

/* ======================== */
/* Corner Ornaments          */
/* ======================== */
.corner-ornament {
    position: fixed;
    width: 80px;
    height: 80px;
    z-index: 100;
    pointer-events: none;
    transition: transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}
.corner-tl { top: 10px; left: 10px; }
.corner-tr { top: 10px; right: 10px; }
.corner-bl { bottom: 10px; left: 10px; }
.corner-br { bottom: 10px; right: 10px; }

.corner-ornament svg {
    width: 100%;
    height: 100%;
}

/* ======================== */
/* Cursor Follow             */
/* ======================== */
#cursor-follow {
    position: fixed;
    width: 48px;
    height: 48px;
    pointer-events: none;
    z-index: 200;
    transform: translate(-50%, -50%);
    will-change: transform, left, top;
}

.compass-rose {
    width: 48px;
    height: 48px;
    filter: drop-shadow(0 0 6px rgba(201, 168, 76, 0.3));
}

.cursor-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(201, 168, 76, 0.1) 0%, transparent 70%);
    pointer-events: none;
}
/* ======================== */
/* Opening Section           */
/* ======================== */
.opening-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.opening-frame {
    text-align: center;
    padding: 3rem 2rem;
    position: relative;
    animation: frameAppear 2s ease-out forwards;
    opacity: 0;
}

@keyframes frameAppear {
    0% { opacity: 0; transform: scale(0.95); }
    100% { opacity: 1; transform: scale(1); }
}

.frame-ornament {
    width: clamp(300px, 60vw, 600px);
    height: 30px;
    margin: 0 auto;
}

.frame-ornament svg {
    width: 100%;
    height: 100%;
}

.opening-title {
    font-family: "Playfair Display", Georgia, serif;
    font-weight: 800;
    font-size: clamp(2.8rem, 8vw, 6rem);
    letter-spacing: -0.02em;
    line-height: 1.05;
    color: #e8dcc8;
    margin: 1.5rem 0 0.5rem;
    text-shadow: 0 0 60px rgba(201, 168, 76, 0.15);
}

.opening-subtitle {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1rem, 2.5vw, 1.6rem);
    color: #8a9ab5;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    opacity: 0;
    animation: fadeIn 1s ease-out 2.5s forwards;
}

.scroll-indicator svg {
    width: 24px;
    height: 40px;
}

.scroll-dot {
    animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% { cy: 12; opacity: 1; }
    50% { cy: 28; opacity: 0.3; }
}

.scroll-text {
    font-family: "Space Grotesk", sans-serif;
    font-weight: 400;
    font-size: clamp(0.65rem, 1vw, 0.8rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #5a6a85;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* ======================== */
/* Section Dividers          */
/* ======================== */
.section-divider {
    text-align: center;
    padding: 4rem 2rem 3rem;
    max-width: 800px;
    margin: 0 auto;
}

.divider-svg {
    width: 100%;
    height: 60px;
    margin-bottom: 1.5rem;
}

.section-title {
    font-family: "Playfair Display", Georgia, serif;
    font-weight: 800;
    font-size: clamp(2rem, 4.5vw, 3.5rem);
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: #e8dcc8;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-style: italic;
    font-size: clamp(0.9rem, 1.8vw, 1.2rem);
    color: #8a9ab5;
    max-width: 500px;
    margin: 0 auto;
}

.cabinet-section {
    position: relative;
    z-index: 1;
    padding-bottom: 4rem;
}

.section-navy {
    background-color: #142040;
}
/* ======================== */
/* Atlas Layout               */
/* ======================== */
.atlas-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: clamp(16px, 2vw, 32px);
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 clamp(16px, 3vw, 48px);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(8px, 1.5vw, 24px);
    grid-auto-flow: dense;
}

.card-2x2 { grid-column: span 2; grid-row: span 2; }
.card-2x1 { grid-column: span 2; }
.card-1x2 { grid-row: span 2; }
.card-1x1 { }

/* ======================== */
/* Specimen Cards             */
/* ======================== */
.specimen-card {
    position: relative;
    transition: transform 0.35s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.35s ease;
}

.specimen-card:hover {
    transform: translateY(-4px) rotateX(1deg) rotateY(-1deg);
}

.card-frame {
    background: #1a2a4a;
    border: 1px solid #5a6a85;
    padding: clamp(16px, 2vw, 28px);
    height: 100%;
    position: relative;
    box-shadow: 8px 12px 40px rgba(0, 0, 0, 0.4);
    transition: box-shadow 0.35s ease;
}

.specimen-card:hover .card-frame {
    box-shadow: 12px 16px 50px rgba(0, 0, 0, 0.5), 0 0 20px rgba(201, 168, 76, 0.05);
    border-color: #c9a84c;
}

.card-cartouche {
    position: absolute;
    top: -1px;
    left: 20px;
    background: #1a2a4a;
    border: 1px solid #5a6a85;
    border-top: none;
    padding: 2px 12px 4px;
    transform: translateY(-100%);
}

.specimen-card:hover .card-cartouche {
    border-color: #c9a84c;
}

.card-label {
    font-family: "Space Grotesk", sans-serif;
    font-weight: 500;
    font-size: clamp(0.6rem, 0.9vw, 0.75rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8a9ab5;
}

.card-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
}

.card-icon svg {
    width: 100%;
    height: 100%;
}

.card-title {
    font-family: "Playfair Display", Georgia, serif;
    font-weight: 700;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    letter-spacing: -0.01em;
    line-height: 1.15;
    color: #e8dcc8;
    margin-bottom: 4px;
}

.card-date {
    font-family: "Space Grotesk", sans-serif;
    font-weight: 400;
    font-size: clamp(0.7rem, 1vw, 0.85rem);
    letter-spacing: 0.06em;
    color: #c9a84c;
    margin-bottom: 8px;
}

.card-description {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-weight: 400;
    font-size: clamp(0.85rem, 1.3vw, 1rem);
    line-height: 1.55;
    color: #8a9ab5;
    margin-bottom: 12px;
}

.card-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: "Space Grotesk", sans-serif;
    font-weight: 400;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.card-status svg {
    width: 16px;
    height: 16px;
}

.status-resolved { color: #8a9ab5; }
.status-active { color: #c9a84c; }
.status-contested { color: #b87333; }
/* ======================== */
/* Annotation Margin         */
/* ======================== */
.annotation-margin {
    position: relative;
    padding-top: 2rem;
}

.timeline-spine {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    padding-left: 20px;
}

.timeline-spine::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(to bottom, transparent, #5a6a85 10%, #5a6a85 90%, transparent);
}

.timeline-node {
    position: relative;
    padding-left: 20px;
}

.timeline-node::before {
    content: "";
    position: absolute;
    left: -17px;
    top: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid #c9a84c;
    background: #0b1228;
}

.timeline-year {
    display: block;
    font-family: "Space Grotesk", sans-serif;
    font-weight: 500;
    font-size: 0.85rem;
    color: #c9a84c;
    letter-spacing: 0.04em;
}

.timeline-note {
    display: block;
    font-family: "Cormorant Garamond", Georgia, serif;
    font-style: italic;
    font-size: 0.8rem;
    color: #5a6a85;
    line-height: 1.4;
}

/* ======================== */
/* Taxonomy Grid             */
/* ======================== */
.taxonomy-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(12px, 2vw, 28px);
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(16px, 3vw, 48px);
}

.taxonomy-card .card-frame {
    background: #1a2a4a;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.taxonomy-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
}

.taxonomy-icon svg {
    width: 100%;
    height: 100%;
}

.taxonomy-card .card-title {
    font-size: clamp(1rem, 1.6vw, 1.3rem);
    margin-bottom: 8px;
}

.taxonomy-card .card-description {
    font-size: clamp(0.8rem, 1.2vw, 0.95rem);
    text-align: center;
    max-width: 300px;
}

.taxonomy-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-top: 12px;
}

.example-tag {
    font-family: "Space Grotesk", sans-serif;
    font-weight: 400;
    font-size: 0.65rem;
    letter-spacing: 0.04em;
    color: #c9a84c;
    border: 1px solid rgba(201, 168, 76, 0.3);
    padding: 2px 8px;
    border-radius: 2px;
}
/* ======================== */
/* Chronicle Layout          */
/* ======================== */
.chronicle-layout {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 clamp(16px, 3vw, 48px) 4rem;
}

.chronicle-spine {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    transform: translateX(-50%);
    background: linear-gradient(to bottom, transparent, #5a6a85 5%, #5a6a85 95%, transparent);
}

.chronicle-spine::before,
.chronicle-spine::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    border: 1px solid #c9a84c;
    border-radius: 50%;
    background: #0b1228;
}
.chronicle-spine::before { top: 0; }
.chronicle-spine::after { bottom: 0; }

.chronicle-events {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    position: relative;
}

.chronicle-event {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1.5rem;
    align-items: start;
}

.event-left .event-card { grid-column: 1; }
.event-left .event-medallion { grid-column: 2; }
.event-left::after {
    content: "";
    grid-column: 3;
}

.event-right::before {
    content: "";
    grid-column: 1;
}
.event-right .event-medallion { grid-column: 2; }
.event-right .event-card { grid-column: 3; }

.event-medallion {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}

.event-medallion svg {
    width: 100%;
    height: 100%;
}

.event-card {
    background: #1a2a4a;
    border: 1px solid #5a6a85;
    padding: clamp(14px, 2vw, 24px);
    box-shadow: 6px 10px 30px rgba(0, 0, 0, 0.35);
    transition: transform 0.35s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.35s ease, border-color 0.35s ease;
}

.event-card:hover {
    transform: translateY(-3px);
    box-shadow: 8px 14px 40px rgba(0, 0, 0, 0.45), 0 0 15px rgba(201, 168, 76, 0.05);
    border-color: #c9a84c;
}

.event-card .card-title {
    font-size: clamp(1rem, 1.6vw, 1.3rem);
    margin-bottom: 6px;
}

.event-card .card-description {
    margin-bottom: 0;
}

/* ======================== */
/* Colophon                  */
/* ======================== */
.colophon-section {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0b1228;
    padding: 4rem 2rem;
}

.colophon-frame {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.colophon-ornament-top,
.colophon-ornament-bottom {
    width: 100%;
    height: 40px;
}

.colophon-ornament-top svg,
.colophon-ornament-bottom svg {
    width: 100%;
    height: 100%;
}

.colophon-text {
    padding: 2rem 0;
}

.colophon-text p {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1.05rem, 2vw, 1.35rem);
    line-height: 1.75;
    color: #e8dcc8;
    margin-bottom: 1.5rem;
}

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

.colophon-signature {
    font-family: "Space Grotesk", sans-serif !important;
    font-style: normal !important;
    font-weight: 500 !important;
    font-size: clamp(0.75rem, 1.2vw, 0.9rem) !important;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #c9a84c !important;
    margin-top: 2rem !important;
}
/* ======================== */
/* Scroll Animations         */
/* ======================== */
.specimen-card,
.chronicle-event {
    opacity: 0;
    transform: translateY(20px);
    animation: cardReveal linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 30%;
}

@keyframes cardReveal {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Fallback for browsers without scroll-timeline */
@supports not (animation-timeline: view()) {
    .specimen-card,
    .chronicle-event {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ======================== */
/* Responsive                */
/* ======================== */
@media (max-width: 1100px) {
    .atlas-layout {
        grid-template-columns: 1fr;
    }
    .annotation-margin {
        display: none;
    }
}

@media (max-width: 900px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .card-2x2 { grid-column: span 2; grid-row: span 1; }
    .card-2x1 { grid-column: span 2; }
    .card-1x2 { grid-row: span 1; }
    .taxonomy-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .chronicle-event {
        grid-template-columns: auto 1fr;
        gap: 1rem;
    }
    .event-left .event-card { grid-column: 2; grid-row: 1; }
    .event-left .event-medallion { grid-column: 1; grid-row: 1; }
    .event-left::after { display: none; }
    .event-right::before { display: none; }
    .event-right .event-medallion { grid-column: 1; grid-row: 1; }
    .event-right .event-card { grid-column: 2; grid-row: 1; }
    .chronicle-spine { left: 30px; transform: none; }
}

@media (max-width: 600px) {
    body {
        cursor: auto;
    }
    #cursor-follow {
        display: none;
    }
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
    .card-2x2 { grid-column: span 1; }
    .card-2x1 { grid-column: span 1; }
    .taxonomy-grid {
        grid-template-columns: 1fr;
    }
    .corner-ornament {
        width: 50px;
        height: 50px;
    }
    .chronicle-event {
        grid-template-columns: 1fr;
    }
    .event-medallion {
        justify-self: center;
    }
    .event-left .event-card,
    .event-right .event-card {
        grid-column: 1;
    }
    .event-left .event-medallion,
    .event-right .event-medallion {
        grid-column: 1;
    }
    .chronicle-spine { display: none; }
}

/* ======================== */
/* Candle Animations         */
/* ======================== */
.candle-flame {
    animation: candleGlow 1.5s ease-in-out infinite;
}

@keyframes candleGlow {
    0%, 100% { opacity: 0.8; r: 1.5; }
    50% { opacity: 1; r: 2; }
}

.candle-flicker {
    animation: candleFlicker 0.8s ease-in-out infinite alternate;
}

@keyframes candleFlicker {
    0% { opacity: 0.4; }
    100% { opacity: 0.8; }
}
/* ======================== */
/* Additional Design Colors  */
/* ======================== */
/* #4a7fb5 - Celestial Blue (Highlight/Active) */
/* #8b2c2c - Wax Seal Red (Danger/Alert) */
.status-active span { color: #c9a84c; }

.highlight-blue { color: #4a7fb5; }

a, a:visited {
    color: #4a7fb5;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover { color: #c9a84c; }

.alert-text { color: #8b2c2c; }

.event-card:hover .card-title {
    color: #4a7fb5;
    transition: color 0.3s ease;
}

.specimen-card:hover .card-title {
    color: #4a7fb5;
    transition: color 0.3s ease;
}