/* =============================================================
   SengGack.com — Archival Studio
   Palette: Terracotta Warm
   #6B3A2A Deep Sienna  · #B85C38 Fired Terracotta
   #F5EFE0 Warm Parchment · #EDE4D0 Aged Ivory
   #A07858 Dusty Clay  · #C4A882 Stone Bisque
   #3D2314 Charred Umber · #C9A96E Faded Gilt
   Fonts: Fraunces (variable), Cormorant Garamond, Lora, DM Mono
   ============================================================= */

/* ---------- CSS Custom Properties ---------- */
:root {
    --deep-sienna:    #6B3A2A;
    --fired-terra:    #B85C38;
    --warm-parchment: #F5EFE0;
    --aged-ivory:     #EDE4D0;
    --dusty-clay:     #A07858;
    --stone-bisque:   #C4A882;
    --charred-umber:  #3D2314;
    --faded-gilt:     #C9A96E;

    --col-12: 100%;
    --gutter: clamp(16px, 2.5vw, 32px);
    --page-side: clamp(24px, 5vw, 80px);

    --scroll-progress: 0;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    background-color: var(--warm-parchment);
    color: var(--charred-umber);
    font-family: 'Lora', Georgia, serif;
    font-weight: 400;
    line-height: 1.75;
    overflow-x: hidden;
}

/* ---------- SVG Defs (hidden) ---------- */
.svg-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
    pointer-events: none;
}

/* ---------- Wave Progress Bar (fixed top) ---------- */
.wave-progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 40px;
    z-index: 1000;
    pointer-events: none;
}

.wave-progress-svg {
    width: 100%;
    height: 40px;
}

.wave-progress-track {
    fill: none;
    stroke: var(--aged-ivory);
    stroke-width: 1;
    opacity: 0.4;
}

.wave-progress {
    fill: none;
    stroke: var(--fired-terra);
    stroke-width: 2;
    stroke-dasharray: 2200;
    stroke-dashoffset: calc(2200px - (2200px * var(--scroll-progress)));
    transition: stroke-dashoffset 0.05s linear;
}

/* ---------- Typography ---------- */
.fraunces-wonk {
    font-family: 'Fraunces', Georgia, serif;
    font-variation-settings: "SOFT" 50, "WONK" 1, "opsz" 144;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--deep-sienna);
    transition: font-variation-settings 0.4s ease;
}

.fraunces-wonk:hover {
    font-variation-settings: "SOFT" 50, "WONK" 0, "opsz" 144;
    transition: font-variation-settings 0.4s ease;
}

.cormorant-garamond {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 300;
}

.lora {
    font-family: 'Lora', Georgia, serif;
    font-weight: 400;
}

.dm-mono {
    font-family: 'DM Mono', 'Courier New', monospace;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 0.75rem;
}

/* ---------- Wave Dividers ---------- */
.wave-divider {
    width: 100%;
    height: 80px;
    overflow: hidden;
    position: relative;
    z-index: 2;
}

.wave-divider-inner {
    margin-top: auto;
}

.wave-svg {
    width: 100%;
    height: 80px;
    fill: none;
    stroke: var(--stone-bisque);
    stroke-width: 1;
    overflow: visible;
}

.wave-anim path {
    animation: wave-drift 18s ease-in-out infinite;
}

.wave-anim-slow path {
    animation: wave-drift 26s ease-in-out infinite;
}

.wave-anim-rev path {
    animation: wave-drift-rev 20s ease-in-out infinite;
}

@keyframes wave-drift {
    0%   { transform: translateX(0); }
    50%  { transform: translateX(-40px); }
    100% { transform: translateX(0); }
}

@keyframes wave-drift-rev {
    0%   { transform: translateX(0); }
    50%  { transform: translateX(40px); }
    100% { transform: translateX(0); }
}

/* ---------- Background wave ---------- */
.chamber-bg-wave {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.bg-wave-svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: var(--stone-bisque);
    stroke-width: 0.5;
    opacity: 0.35;
}

.bg-wave-path {
    animation: wave-drift 24s ease-in-out infinite;
}

/* ---------- Daguerreotype Photo Treatment ---------- */
.photo-daguerreotype {
    filter: sepia(0.45) contrast(1.1) brightness(0.92) saturate(0.6);
    position: relative;
}

/* ---------- CHAMBER 1 — Header Stone ---------- */
.chamber-1 {
    min-height: 100vh;
    background-color: var(--warm-parchment);
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 var(--page-side);
    overflow: hidden;
}

.chamber-1-grid {
    display: grid;
    grid-template-columns: 1fr 55%;
    gap: var(--gutter);
    width: 100%;
    align-items: center;
    position: relative;
    z-index: 1;
    padding: 120px 0 80px;
}

.chamber-1-headline {
    padding-right: clamp(20px, 4vw, 60px);
}

.headline-label {
    display: block;
    font-family: 'DM Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--dusty-clay);
    margin-bottom: clamp(16px, 2.5vh, 32px);
}

.headline-display {
    font-size: clamp(4rem, 9vw, 9rem);
    line-height: 0.92;
    margin-bottom: clamp(24px, 3.5vh, 48px);
    color: var(--deep-sienna);
    font-variation-settings: "SOFT" 50, "WONK" 1, "opsz" 144;
}

.headline-sub {
    font-family: 'Lora', serif;
    font-size: clamp(0.95rem, 1.5vw, 1.15rem);
    color: var(--charred-umber);
    line-height: 1.75;
    max-width: 42ch;
}

/* Oval photo frame */
.chamber-1-photo {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.photo-frame-oval {
    position: relative;
    width: 100%;
    max-width: 520px;
    aspect-ratio: 4/5;
    margin: 0 auto;
}

.photo-frame-oval .photo-inner {
    width: 100%;
    height: 100%;
    overflow: hidden;
    clip-path: url(#oval-clip-hero);
}

.photo-placeholder {
    width: 100%;
    height: 100%;
    display: block;
}

.portrait-svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Daguerreotype mat border (outside the oval) */
.photo-mat-border {
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    border: 3px solid var(--faded-gilt);
    box-shadow: inset 0 0 0 1px var(--deep-sienna);
    pointer-events: none;
}

/* Caption */
.photo-caption {
    margin-top: 14px;
    text-align: left;
    width: 100%;
    max-width: 520px;
}

.caption-subject {
    display: block;
    font-family: 'DM Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--fired-terra);
    line-height: 1.6;
}

.caption-date {
    display: block;
    font-family: 'DM Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--dusty-clay);
    line-height: 1.6;
}

/* Oval morph animation */
#oval-path-hero {
    animation: oval-morph 8s ease-in-out infinite alternate;
}

@keyframes oval-morph {
    0% {
        d: path("M 50,2 C 72,2 96,18 98,44 C 100,70 84,96 58,98 C 32,100 4,84 2,58 C 0,32 14,2 50,2 Z");
    }
    100% {
        d: path("M 52,3 C 74,1 97,20 96,47 C 95,74 78,98 54,97 C 30,96 3,79 4,55 C 5,31 18,4 52,3 Z");
    }
}

/* ---------- CHAMBER 2 — The Horizontal Band ---------- */
.chamber-2 {
    min-height: 60vh;
    background-color: var(--aged-ivory);
    padding: clamp(60px, 8vh, 120px) var(--page-side);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.chamber-2-grid {
    display: grid;
    grid-template-columns: 7fr 3fr;
    gap: clamp(32px, 4vw, 64px);
    align-items: center;
    width: 100%;
}

.chamber-2-photo {
    width: 100%;
}

.photo-strip {
    position: relative;
    width: 100%;
    aspect-ratio: 16/5;
    overflow: hidden;
}

.photo-strip-inner {
    width: 100%;
    height: 100%;
    border-radius: 2px;
}

.landscape-svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Strip mat border */
.strip-mat-border {
    position: absolute;
    inset: 0;
    border: 3px solid var(--faded-gilt);
    box-shadow: inset 0 0 0 1px var(--deep-sienna);
    pointer-events: none;
}

/* Pull quote */
.chamber-2-quote {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(24px, 4vw, 48px) 0;
}

.pull-quote {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1.5rem, 3.5vw, 3rem);
    font-weight: 300;
    font-style: italic;
    color: var(--deep-sienna);
    line-height: 1.35;
    text-align: center;
    border: none;
    padding: 0;
}

.pull-quote p {
    margin-bottom: 20px;
}

.quote-attr {
    display: block;
    font-style: normal;
    font-family: 'DM Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--dusty-clay);
    margin-top: 16px;
}

/* ---------- CHAMBER 3 — The F-Stem Content ---------- */
.chamber-3 {
    min-height: 80vh;
    background-color: var(--warm-parchment);
    padding: clamp(80px, 10vh, 160px) var(--page-side);
    position: relative;
}

/* Vertical sine wave on left */
.vertical-wave-accent {
    position: absolute;
    left: calc(var(--page-side) * 0.4);
    top: 0;
    bottom: 0;
    width: 40px;
    pointer-events: none;
    z-index: 1;
}

.vert-wave-svg {
    width: 40px;
    height: 100%;
    fill: none;
    stroke: var(--stone-bisque);
    stroke-width: 0.3;
    opacity: 0.6;
}

.vert-wave-path {
    animation: vert-wave-drift 22s ease-in-out infinite;
}

@keyframes vert-wave-drift {
    0%   { transform: translateY(0); }
    50%  { transform: translateY(-30px); }
    100% { transform: translateY(0); }
}

.chamber-3-grid {
    display: grid;
    grid-template-columns: 2fr 5fr 3fr;
    gap: clamp(24px, 4vw, 64px);
    position: relative;
    z-index: 2;
}

/* Left empty columns — intentional negative space */
.chamber-3-empty {
    /* Visual void — nothing here intentionally */
}

/* Body content */
.chamber-3-body {
    padding-right: clamp(16px, 2vw, 32px);
}

.section-heading {
    font-family: 'Fraunces', Georgia, serif;
    font-size: clamp(1.5rem, 3.5vw, 3rem);
    font-weight: 700;
    color: var(--deep-sienna);
    font-variation-settings: "SOFT" 50, "WONK" 1, "opsz" 72;
    letter-spacing: -0.02em;
    margin-bottom: clamp(20px, 3vh, 36px);
    cursor: default;
    transition: font-variation-settings 0.4s ease;
}

.section-heading:hover {
    font-variation-settings: "SOFT" 50, "WONK" 0, "opsz" 72;
    transition: font-variation-settings 0.4s ease;
}

.body-text {
    font-family: 'Lora', serif;
    font-size: clamp(0.95rem, 1.5vw, 1.15rem);
    color: var(--charred-umber);
    line-height: 1.75;
    max-width: 58ch;
}

.body-text p {
    margin-bottom: clamp(16px, 2.5vh, 28px);
}

.body-spacer {
    height: clamp(48px, 7vh, 100px);
}

/* Metadata column */
.chamber-3-meta {
    padding-top: 8px;
}

.meta-stack {
    display: flex;
    flex-direction: column;
    gap: clamp(20px, 3vh, 36px);
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.meta-label {
    font-family: 'DM Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--dusty-clay);
    display: block;
}

.meta-value {
    font-family: 'DM Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--deep-sienna);
    display: block;
}

/* ---------- CHAMBER 4 — Gallery Alcove ---------- */
.chamber-4 {
    min-height: 80vh;
    background-color: var(--aged-ivory);
    padding: clamp(60px, 8vh, 120px) var(--page-side);
    display: flex;
    align-items: center;
}

.gallery-grid {
    display: grid;
    grid-template-columns: 4fr 3fr 5fr;
    gap: clamp(16px, 2.5vw, 40px);
    width: 100%;
    align-items: end;
}

.gallery-item {
    display: flex;
    flex-direction: column;
}

.gallery-item-1 {
    align-self: end;
}

.gallery-item-2 {
    align-self: center;
}

.gallery-item-3 {
    align-self: start;
}

/* Rectangular photo frames for gallery */
.photo-frame-rect {
    width: 100%;
    aspect-ratio: auto;
    position: relative;
    border: 3px solid var(--faded-gilt);
    box-shadow: inset 0 0 0 1px var(--deep-sienna);
    overflow: hidden;
}

.gallery-svg {
    width: 100%;
    height: auto;
    display: block;
}

.gallery-item-1 .photo-frame-rect {
    aspect-ratio: 4/5;
}

.gallery-item-2 .photo-frame-rect {
    aspect-ratio: 4/5;
}

.gallery-item-3 .photo-frame-rect {
    aspect-ratio: 6/5;
}

/* ---------- CHAMBER 5 — Grand Paragraph ---------- */
.chamber-5 {
    min-height: 60vh;
    background-color: var(--warm-parchment);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(80px, 12vh, 160px) var(--page-side);
}

.grand-paragraph-wrap {
    max-width: 900px;
    width: 100%;
    /* Columns 2-8 of a 12-col grid approximately */
    margin-left: calc((100% / 12) * 1);
    margin-right: calc((100% / 12) * 2);
}

.grand-paragraph {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    font-weight: 300;
    font-style: italic;
    color: var(--deep-sienna);
    line-height: 1.55;
    margin-bottom: 32px;
}

.grand-attr {
    display: block;
    font-family: 'DM Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--dusty-clay);
}

/* ---------- CHAMBER 6 — Colophon ---------- */
.chamber-6 {
    min-height: 40vh;
    background-color: var(--deep-sienna);
    padding: clamp(60px, 8vh, 100px) var(--page-side);
    display: flex;
    align-items: center;
}

.colophon-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: clamp(32px, 5vw, 80px);
    width: 100%;
    align-items: center;
}

/* Branding column */
.col-brand {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.colophon-wordmark {
    font-family: 'Fraunces', serif;
    font-size: clamp(1rem, 2vw, 1.4rem);
    font-weight: 700;
    font-variation-settings: "SOFT" 50, "WONK" 1, "opsz" 48;
    color: var(--warm-parchment);
    letter-spacing: -0.01em;
    cursor: default;
    transition: font-variation-settings 0.4s ease;
}

.colophon-wordmark:hover {
    font-variation-settings: "SOFT" 50, "WONK" 0, "opsz" 48;
}

.colophon-tagline {
    font-family: 'DM Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--stone-bisque);
}

.colophon-copy {
    font-family: 'DM Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--dusty-clay);
    margin-top: 8px;
}

/* Navigation column */
.col-nav {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.colophon-nav {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.colophon-nav li a {
    font-family: 'DM Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--stone-bisque);
    text-decoration: none;
    transition: color 0.25s ease;
}

.colophon-nav li a:hover {
    color: var(--faded-gilt);
}

.colophon-contact {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.colophon-contact span {
    font-family: 'DM Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--dusty-clay);
}

/* Medallion column */
.col-medallion {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.medallion-frame {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--faded-gilt);
    box-shadow: 0 0 0 1px var(--fired-terra);
}

.medallion-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
}

.medallion-svg {
    width: 120px;
    height: 120px;
    display: block;
}

.medallion-caption {
    font-family: 'DM Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--dusty-clay);
    text-align: center;
}

/* ---------- Scroll reveal animations ---------- */
.chamber {
    opacity: 1;
}

.reveal-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-up.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .chamber-1-grid {
        grid-template-columns: 1fr 50%;
    }

    .chamber-2-grid {
        grid-template-columns: 3fr 2fr;
    }

    .chamber-3-grid {
        grid-template-columns: 0 1fr 2fr;
        gap: clamp(16px, 3vw, 40px);
    }

    .chamber-3-empty {
        display: none;
    }
}

@media (max-width: 860px) {
    .chamber-1-grid {
        grid-template-columns: 1fr;
        gap: clamp(40px, 6vh, 72px);
        padding: 80px 0;
    }

    .headline-display {
        font-size: clamp(3.5rem, 12vw, 7rem);
    }

    .chamber-1-photo {
        align-items: flex-start;
    }

    .photo-frame-oval {
        max-width: 280px;
    }

    .chamber-2-grid {
        grid-template-columns: 1fr;
        gap: clamp(32px, 5vh, 60px);
    }

    .chamber-3-grid {
        grid-template-columns: 1fr;
    }

    .chamber-3-meta {
        display: grid;
        grid-template-columns: 1fr;
    }

    .meta-stack {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 24px 32px;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        max-width: 420px;
    }

    .gallery-item-1,
    .gallery-item-2,
    .gallery-item-3 {
        align-self: auto;
    }

    .gallery-item-1 .photo-frame-rect,
    .gallery-item-2 .photo-frame-rect,
    .gallery-item-3 .photo-frame-rect {
        aspect-ratio: 3/2;
    }

    .colophon-grid {
        grid-template-columns: 1fr;
        gap: clamp(32px, 5vh, 56px);
    }

    .col-medallion {
        align-items: flex-start;
    }

    .grand-paragraph-wrap {
        margin-left: 0;
        margin-right: 0;
    }
}

@media (max-width: 560px) {
    :root {
        --page-side: 20px;
    }

    .headline-display {
        font-size: clamp(3rem, 14vw, 5.5rem);
    }

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