/* munj.uk - Maritime Hydrographic Design */
/* Palette: Admiralty Ink #1B2838, Vellum Cream #F4EDE3, Compass Brass #A8896C, 
   Strait Blue #4A7C8E, Chart Wash #D4C5A9, Kelp Shadow #2C3E50,
   Signal Red #B85C4A, Fog Grey #E2DCD4 */

/* === RESET & BASE === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Libre Baskerville', Georgia, serif;
    color: #2C3E50;
    background-color: #F4EDE3;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Paper grain texture - applied to body */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
}

/* === MAIN SCROLL CONTAINER === */
#main-scroll {
    scroll-snap-type: y proximity;
    overflow-y: auto;
    height: 100vh;
}

/* === FIXED FOLIO INDICATOR === */
.folio-indicator {
    position: fixed;
    top: 24px;
    right: 32px;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-style: italic;
    font-size: 16px;
    color: #A8896C;
    z-index: 100;
    transition: color 0.6s ease;
    pointer-events: none;
}

.folio-indicator.indicator-light {
    color: #D4C5A9;
}

/* === KOREAN SEAL === */
.korean-seal {
    position: fixed;
    bottom: 32px;
    left: 32px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid #B85C4A;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: seal-pulse 4s ease-in-out infinite;
}

.seal-char {
    font-family: 'Noto Serif KR', serif;
    font-size: 20px;
    color: #B85C4A;
    line-height: 1;
}

@keyframes seal-pulse {
    0%, 100% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(3deg) scale(1.03); }
}

/* === COMPASS ROSE WATERMARK === */
.compass-watermark {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 70vmin;
    height: 70vmin;
    transform: translate(-50%, -50%);
    z-index: 0;
    pointer-events: none;
    opacity: 0.5;
    transition: opacity 0.8s ease;
}

/* === DEPTH CONTOUR LINES === */
.depth-contours {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 1;
}

.contour-line {
    stroke-dasharray: 8 12;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 0.1s linear;
}

/* === RHUMB LINES (cursor follow) === */
.rhumb-lines {
    position: fixed;
    width: 300px;
    height: 300px;
    z-index: 90;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
    transform: translate(-50%, -50%);
}

.rhumb-lines.active {
    opacity: 1;
}

/* === FOLIO SECTIONS === */
.folio {
    min-height: 100vh;
    scroll-snap-align: start;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 64px;
    z-index: 1;
}

.folio-light {
    background-color: #F4EDE3;
    color: #1B2838;
}

.folio-dark {
    background-color: #1B2838;
    color: #E8DFD0;
}

.folio-fog {
    background-color: #E2DCD4;
    color: #1B2838;
}

/* === FOLIO LABEL (per-section) === */
.folio-label {
    position: absolute;
    top: 24px;
    right: 32px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #A8896C;
}

.folio-label-light {
    color: #D4C5A9;
}

/* === COMPASS-ROSE GRID === */
.compass-grid {
    display: grid;
    grid-template-areas:
        ". north ."
        "west center east"
        ". south .";
    grid-template-columns: minmax(60px, 15%) minmax(40%, 1fr) minmax(60px, 15%);
    grid-template-rows: auto 1fr auto;
    width: 100%;
    max-width: 1200px;
    min-height: calc(100vh - 128px);
    gap: 24px;
    align-items: center;
}

.grid-north {
    grid-area: north;
    text-align: center;
    padding-top: 16px;
}

.grid-south {
    grid-area: south;
    text-align: center;
    padding-bottom: 16px;
}

.grid-west {
    grid-area: west;
    display: flex;
    align-items: center;
    justify-content: center;
}

.grid-east {
    grid-area: east;
    display: flex;
    align-items: center;
    justify-content: center;
}

.grid-center {
    grid-area: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* === ANNOTATIONS === */
.annotation {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #A8896C;
}

.annotation-light {
    color: #D4C5A9;
}

.vertical-text {
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

/* === CARTOUCHE FRAME === */
.cartouche {
    position: relative;
    padding: 48px;
}

.cartouche::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid #A8896C;
    pointer-events: none;
}

.cartouche::after {
    content: '';
    position: absolute;
    top: 7px;
    left: 7px;
    right: 7px;
    bottom: 7px;
    border: 1px solid #D4C5A9;
    pointer-events: none;
}

.cartouche-dark::before {
    border-color: rgba(168, 137, 108, 0.6);
}

.cartouche-dark::after {
    border-color: rgba(212, 197, 169, 0.3);
}

/* Corner flourishes */
.cartouche .center-content::before,
.cartouche .center-content::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border-color: #A8896C;
    border-style: solid;
}

.cartouche .center-content::before {
    top: -6px;
    left: -6px;
    border-width: 0 0 1px 0;
    border-radius: 0 0 0 12px;
    border-left-width: 1px;
}

.cartouche .center-content::after {
    bottom: -6px;
    right: -6px;
    border-width: 1px 0 0 0;
    border-radius: 0 12px 0 0;
    border-right-width: 1px;
}

.center-content {
    position: relative;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
}

/* === FOLIO CONTENT ANIMATION === */
.folio-content {
    opacity: 0;
    transform: scale(0.97);
    filter: blur(2px);
    transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.9s cubic-bezier(0.16, 1, 0.3, 1),
                filter 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.folio-content.visible {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
}

/* === TYPOGRAPHY === */
.hero-korean {
    font-family: 'Noto Serif KR', serif;
    font-size: 120px;
    font-weight: 400;
    color: #1B2838;
    line-height: 1.1;
    text-align: center;
    margin-bottom: 16px;
}

.hero-domain {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: #A8896C;
    text-align: center;
    margin-bottom: 12px;
}

.hero-meaning {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: 15px;
    font-style: italic;
    color: #2C3E50;
    text-align: center;
    opacity: 0.7;
}

.section-headline {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 600;
    font-size: 48px;
    letter-spacing: -0.025em;
    line-height: 1.08;
    color: #1B2838;
    margin-bottom: 32px;
}

.headline-light {
    color: #E8DFD0;
}

.body-text {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: 17px;
    line-height: 1.72;
    color: #2C3E50;
    max-width: 640px;
    text-align: justify;
    hyphens: auto;
    margin-bottom: 24px;
}

.body-light {
    color: #C8BDAE;
}

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

/* === PULL QUOTES === */
.pull-quote {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 28px;
    font-style: italic;
    font-weight: 400;
    color: #4A7C8E;
    border-left: 3px solid #A8896C;
    padding: 16px 0 16px 24px;
    margin: 32px 0;
    line-height: 1.4;
}

.pull-quote-light {
    color: #4A7C8E;
    border-left-color: rgba(168, 137, 108, 0.5);
}

/* === KOREAN ACCENT TEXT === */
.korean-accent {
    font-family: 'Noto Serif KR', serif;
    font-size: 24px;
    font-weight: 600;
    color: #B85C4A;
}

/* === PRINCIPLES GRID === */
.principles-grid {
    display: grid;
    gap: 40px;
    margin-top: 24px;
}

.principle {
    padding-bottom: 32px;
    border-bottom: 1px solid rgba(168, 137, 108, 0.25);
}

.principle:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.principle-num {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 32px;
    font-weight: 600;
    color: #A8896C;
    display: block;
    margin-bottom: 8px;
}

.principle-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 28px;
    font-weight: 600;
    color: #1B2838;
    letter-spacing: -0.015em;
    line-height: 1.2;
    margin-bottom: 12px;
}

/* === COLOPHON === */
.colophon-details {
    margin: 32px 0;
    padding: 24px 0;
    border-top: 1px solid rgba(168, 137, 108, 0.3);
    border-bottom: 1px solid rgba(168, 137, 108, 0.3);
}

.colophon-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 8px 0;
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: 14px;
    color: #2C3E50;
}

.colophon-label {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #A8896C;
    flex-shrink: 0;
    margin-right: 16px;
}

.colophon-value {
    text-align: right;
    font-size: 14px;
}

.closing-korean {
    font-family: 'Noto Serif KR', serif;
    font-size: 20px;
    color: #A8896C;
    text-align: center;
    margin-top: 32px;
    letter-spacing: 0.1em;
}

/* === INTERSTITIAL DIVIDERS === */
.interstitial-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 64px;
    height: 80px;
    background-color: #F4EDE3;
    z-index: 1;
    position: relative;
}

.folio-dark + .interstitial-divider {
    background-color: #F4EDE3;
}

.divider-line {
    flex: 1;
    height: 1px;
    background-color: #A8896C;
    opacity: 0.4;
    clip-path: inset(0 50% 0 50%);
    transition: clip-path 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.divider-line.expanded {
    clip-path: inset(0 0 0 0);
}

.divider-diamond {
    width: 10px;
    height: 10px;
    background-color: #A8896C;
    opacity: 0.4;
    transform: rotate(45deg);
    margin: 0 16px;
    flex-shrink: 0;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .folio {
        padding: 24px;
    }
    
    .compass-grid {
        grid-template-areas:
            "north"
            "center"
            "south";
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
        min-height: calc(100vh - 48px);
    }
    
    .grid-west,
    .grid-east {
        display: none;
    }
    
    .grid-north,
    .grid-south {
        text-align: center;
    }
    
    .hero-korean {
        font-size: 72px;
    }
    
    .section-headline {
        font-size: 36px;
    }
    
    .body-text {
        font-size: 15px;
    }
    
    .pull-quote {
        font-size: 22px;
    }
    
    .cartouche {
        padding: 24px;
    }
    
    .folio-label {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .folio-label-light {
        right: auto;
    }
    
    .korean-seal {
        width: 36px;
        height: 36px;
        bottom: 16px;
        left: 16px;
    }
    
    .seal-char {
        font-size: 16px;
    }
    
    .interstitial-divider {
        padding: 0 24px;
    }
    
    .folio-indicator {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
        top: 8px;
    }

    .colophon-line {
        flex-direction: column;
        gap: 4px;
    }

    .colophon-value {
        text-align: left;
    }
}
