/* martial.quest -- Sepia Nostalgic, Scandinavian Memorial Design */

/* ============================================================
   CSS Custom Properties
   ============================================================ */
:root {
    --aged-parchment: #F0E4D0;
    --sepia-ink: #5A4430;
    --warm-sepia: #8B7355;
    --marble-white: #F0ECE6;
    --pressed-green: #6A8060;
    --deep-brown: #3A2A18;
    --faded-rose: #C0908A;
    --marble-gradient-a: #F0ECE8;
    --marble-gradient-b: #E8E0D8;
}

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

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

body {
    font-family: 'Source Serif 4', 'Georgia', serif;
    font-weight: 400;
    font-size: clamp(15px, 1.1vw, 18px);
    line-height: 1.85;
    color: var(--sepia-ink);
    background-color: var(--aged-parchment);
    overflow-x: hidden;
}

/* ============================================================
   Hero Section
   ============================================================ */
#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--aged-parchment);
    overflow: hidden;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
}

#hero-title {
    width: clamp(320px, 60vw, 800px);
    height: auto;
    overflow: visible;
}

#martial-text {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    animation: drawText 2.5s ease-out forwards;
    fill: none;
    stroke: var(--deep-brown);
    stroke-width: 2;
}

@keyframes drawText {
    0% {
        stroke-dashoffset: 2000;
        fill: transparent;
    }
    60% {
        stroke-dashoffset: 0;
        fill: transparent;
    }
    100% {
        stroke-dashoffset: 0;
        fill: var(--deep-brown);
    }
}

#hero-subtitle {
    font-family: 'Inconsolata', monospace;
    font-size: clamp(14px, 1.2vw, 20px);
    font-weight: 400;
    color: var(--warm-sepia);
    letter-spacing: 0.3em;
    margin-top: 8px;
    opacity: 0;
    animation: fadeInSubtitle 1s ease-out 2.5s forwards;
}

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

.hero-divider {
    position: absolute;
    bottom: 0;
    left: -5%;
    width: 110%;
    height: 2px;
    background-color: var(--warm-sepia);
    transform: rotate(-2deg);
    opacity: 0.4;
}

/* Botanical illustrations */
.botanical {
    position: absolute;
    pointer-events: none;
    z-index: 1;
}

.botanical-hero {
    right: 5%;
    bottom: 10%;
    width: 100px;
    height: auto;
    opacity: 0.3;
}

.botanical-margin-right {
    position: absolute;
    right: -10px;
    top: 10%;
    width: 70px;
    height: auto;
}

.botanical-margin-left {
    position: absolute;
    left: -10px;
    top: 10%;
    width: 70px;
    height: auto;
}

/* ============================================================
   Diagonal Sections
   ============================================================ */
.diagonal-section {
    position: relative;
    transform: skewY(-2deg);
    margin: 0 -5%;
    padding: 80px 5%;
    overflow: hidden;
}

.diagonal-section:nth-child(even) {
    transform: skewY(-1.5deg);
}

.diagonal-section:nth-child(3n) {
    transform: skewY(-2.5deg);
}

.section-inner {
    transform: skewY(2deg);
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 60px;
}

.diagonal-section:nth-child(even) .section-inner {
    transform: skewY(1.5deg);
}

.diagonal-section:nth-child(3n) .section-inner {
    transform: skewY(2.5deg);
}

.section-content {
    position: relative;
}

/* ============================================================
   Marble Memorial Panels
   ============================================================ */
.marble-panel {
    background: linear-gradient(135deg, var(--marble-gradient-a), var(--marble-gradient-b), var(--marble-gradient-a));
}

.engraved {
    text-shadow:
        1px 1px 0 rgba(255, 255, 255, 0.8),
        -1px -1px 0 rgba(0, 0, 0, 0.05);
}

/* ============================================================
   Typography
   ============================================================ */
.section-heading {
    font-family: 'Source Serif 4', serif;
    font-weight: 600;
    font-size: clamp(24px, 3vw, 42px);
    color: var(--deep-brown);
    margin-bottom: 24px;
    line-height: 1.3;
}

.date-label {
    font-family: 'Inconsolata', monospace;
    font-weight: 400;
    font-size: 13px;
    color: var(--warm-sepia);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    display: block;
    margin-bottom: 12px;
}

.body-text {
    color: var(--sepia-ink);
    margin-bottom: 20px;
    max-width: 680px;
}

.testimony {
    font-family: 'Caveat', cursive;
    font-size: clamp(22px, 3vw, 36px);
    font-weight: 500;
    color: var(--deep-brown);
    line-height: 1.5;
    margin: 32px 0;
    padding: 20px 28px;
    border-left: 3px solid var(--faded-rose);
    position: relative;
    transition: transform 0.15s ease-out;
}

.annotation {
    font-family: 'Caveat', cursive;
    font-size: clamp(14px, 1.3vw, 18px);
    font-weight: 400;
    color: var(--faded-rose);
    font-style: italic;
    margin-top: 16px;
    opacity: 0.85;
}

/* ============================================================
   Timeline Entries
   ============================================================ */
.timeline-entries {
    display: flex;
    flex-direction: column;
    gap: 40px;
    margin-top: 16px;
}

.timeline-entry {
    padding: 24px 28px;
    border-left: 2px solid var(--warm-sepia);
    position: relative;
    transition: transform 0.15s ease-out;
}

.timeline-entry::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 28px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--faded-rose);
}

.timeline-entry .date-label {
    margin-bottom: 8px;
    font-size: 14px;
    letter-spacing: 0.15em;
}

.timeline-entry .body-text {
    margin-bottom: 0;
}

/* ============================================================
   Magnetic Text Interaction
   ============================================================ */
.magnetic-text {
    --mag-x: 0px;
    --mag-y: 0px;
    transform: translate(var(--mag-x), var(--mag-y));
    transition: transform 0.15s ease-out;
    will-change: transform;
}

/* ============================================================
   Fade-in Animation for Sections
   ============================================================ */
.diagonal-section {
    opacity: 0;
    transform-origin: center top;
}

.diagonal-section.visible {
    opacity: 1;
    transition: opacity 0.6s ease-out;
}

/* Preserve skew while visible */
.diagonal-section.visible {
    transform: skewY(-2deg);
}

.diagonal-section.visible:nth-child(even) {
    transform: skewY(-1.5deg);
}

.diagonal-section.visible:nth-child(3n) {
    transform: skewY(-2.5deg);
}

/* ============================================================
   Footer
   ============================================================ */
#site-footer {
    padding: 60px 20px 40px;
    text-align: center;
    background-color: var(--aged-parchment);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.footer-domain {
    font-family: 'Caveat', cursive;
    font-size: 24px;
    font-weight: 600;
    color: var(--deep-brown);
}

.footer-note {
    font-family: 'Inconsolata', monospace;
    font-size: 12px;
    color: var(--warm-sepia);
    letter-spacing: 0.15em;
    text-transform: lowercase;
}

/* ============================================================
   Responsive Adjustments
   ============================================================ */
@media (max-width: 768px) {
    .diagonal-section {
        padding: 60px 5%;
    }

    .section-inner {
        padding: 24px 20px;
    }

    .botanical-margin-right,
    .botanical-margin-left {
        display: none;
    }

    .botanical-hero {
        right: 2%;
        width: 70px;
    }

    .testimony {
        font-size: clamp(18px, 4vw, 28px);
        padding: 16px 20px;
    }

    .timeline-entry {
        padding: 16px 20px;
    }
}

@media (max-width: 480px) {
    #hero-title {
        width: 85vw;
    }

    .section-heading {
        font-size: clamp(20px, 5vw, 32px);
    }
}
