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

html {
    scroll-behavior: smooth;
    --bg: #f5ece0;
    --text: #2c2318;
    --terracotta: #b5654a;
    --clay: #c9917a;
    --taupe: #9c8b7a;
    --red-oxide: #8b3a2a;
    --highlight: #f0dcc4;
    --diagram: #7a3f2e;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Lora', serif;
    font-size: clamp(1rem, 1.1vw, 1.15rem);
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
}

/* === WATERMARK === */
.watermark {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-30deg);
    font-family: 'Playfair Display', serif;
    font-size: clamp(4rem, 12vw, 10rem);
    font-weight: 700;
    color: var(--terracotta);
    opacity: 0.04;
    pointer-events: none;
    z-index: 9999;
    white-space: nowrap;
    animation: watermark-drift 10s ease-in-out infinite alternate;
}

@keyframes watermark-drift {
    from { transform: translate(-50%, -50%) rotate(-30deg); }
    to { transform: translate(-50%, -50%) rotate(-32deg); }
}

/* === COLUMN CONTAINER === */
.column-container {
    max-width: 42rem;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* === SECTION HEADING === */
.section-heading {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--text);
    margin-bottom: 2rem;
    text-align: center;
}

/* === HERO === */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background-color: var(--bg);
    background-image: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent calc(2rem - 1px),
        rgba(201, 145, 122, 0.06) calc(2rem - 1px),
        rgba(201, 145, 122, 0.06) 2rem
    );
}

.hero-content {
    text-align: center;
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.02em;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.85rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--taupe);
}

/* === BACKWARD CLOCK === */
.backward-clock {
    position: absolute;
    top: 2rem;
    left: 3rem;
    width: 64px;
    height: 64px;
}

.clock-face {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 2px solid var(--taupe);
    position: relative;
    background: var(--bg);
}

.clock-tick {
    position: absolute;
    top: 2px;
    left: 50%;
    width: 1px;
    height: 8px;
    background: var(--taupe);
    transform-origin: 50% 30px;
    transform: translateX(-50%) rotate(calc(var(--i) * 30deg));
}

.clock-hand {
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform-origin: 50% 100%;
    background: var(--text);
    border-radius: 1px;
}

.clock-minute {
    width: 1.5px;
    height: 22px;
    animation: spin-reverse 60s linear infinite;
}

.clock-hour {
    width: 2px;
    height: 16px;
    animation: spin-reverse 720s linear infinite;
}

.clock-center {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    background: var(--red-oxide);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

@keyframes spin-reverse {
    from { transform: translateX(-50%) rotate(360deg); }
    to { transform: translateX(-50%) rotate(0deg); }
}

/* === INSTITUTIONAL SEAL (SMALL) === */
.seal-small {
    position: absolute;
    top: 2rem;
    right: 3rem;
    width: 80px;
    height: 80px;
    transform: rotate(2deg);
    opacity: 0.85;
}

.seal-outer {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2.5px solid var(--red-oxide);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 4px var(--bg), 0 0 0 5.5px var(--red-oxide);
}

.seal-inner {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 1px solid var(--terracotta);
    display: flex;
    align-items: center;
    justify-content: center;
}

.seal-text-svg {
    width: 56px;
    height: 56px;
}

/* === ABSTRACT === */
.abstract {
    padding: 6rem 0 4rem;
}

.body-text {
    font-family: 'Lora', serif;
    font-weight: 400;
    text-align: justify;
    hyphens: auto;
    -webkit-hyphens: auto;
    margin-bottom: 2rem;
}

.dropcap::first-letter {
    font-family: 'Playfair Display', serif;
    font-size: 4.5rem;
    font-weight: 700;
    float: left;
    color: var(--terracotta);
    line-height: 0.8;
    margin-right: 0.5rem;
    margin-top: 0.1rem;
}

.decorative-rule {
    width: 100%;
    margin: 1rem 0;
}

.rule-svg {
    width: 100%;
    height: 12px;
    display: block;
}

/* === METHODOLOGY === */
.methodology {
    padding: 4rem 0;
}

.flowchart-container {
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
    transform: scale(0.85);
    transition: transform 3s ease-in-out;
}

.flowchart-container.in-view {
    transform: scale(1.0);
}

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

.flow-box {
    fill: var(--bg);
    stroke: var(--diagram);
    stroke-width: 1.5;
}

.flow-text {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 13px;
    fill: var(--text);
    text-anchor: middle;
    dominant-baseline: middle;
}

.flow-label {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 11px;
    fill: var(--taupe);
    text-anchor: middle;
}

.flow-arrow {
    fill: none;
    stroke: var(--diagram);
    stroke-width: 1.5;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 3s ease-in-out;
}

.flow-loop {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 3s ease-in-out;
}

.flowchart-container.in-view .flow-arrow,
.flowchart-container.in-view .flow-loop {
    stroke-dashoffset: 0;
}

.flow-arrowhead {
    fill: var(--diagram);
    opacity: 0;
    transition: opacity 0.5s ease 2.5s;
}

.flowchart-container.in-view .flow-arrowhead {
    opacity: 1;
}

/* === FINDINGS === */
.findings {
    padding: 4rem 0;
}

.finding {
    margin-bottom: 4rem;
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.finding.in-view {
    opacity: 1;
    transform: scale(1.0);
}

.finding-frame {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    border: 2px solid var(--taupe);
    padding: 6px;
    position: relative;
}

.finding-frame::before,
.finding-frame::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border-color: var(--terracotta);
    border-style: solid;
}

.finding-frame::before {
    top: -3px;
    left: -3px;
    border-width: 2px 0 0 2px;
}

.finding-frame::after {
    bottom: -3px;
    right: -3px;
    border-width: 0 2px 2px 0;
}

.finding-frame-inner {
    width: 100%;
    height: 100%;
    border: 1px solid var(--clay);
    display: flex;
    align-items: center;
    justify-content: center;
}

.finding-numeral {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--red-oxide);
}

.finding-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    text-align: center;
    margin-bottom: 1rem;
}

/* === GLOSSARY === */
.glossary {
    padding: 4rem 0;
}

.glossary-columns {
    column-count: 2;
    column-gap: 2rem;
}

.glossary-entry {
    break-inside: avoid;
    margin-bottom: 0.75rem;
}

.glossary-entry dt {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--terracotta);
    font-size: 0.9rem;
    letter-spacing: 0.04em;
    margin-bottom: 0.25rem;
}

.glossary-entry dd {
    font-family: 'Lora', serif;
    font-weight: 400;
    color: var(--text);
    font-size: 0.95rem;
    line-height: 1.65;
}

@media (max-width: 640px) {
    .glossary-columns {
        column-count: 1;
    }
    .backward-clock {
        left: 1rem;
        top: 1rem;
    }
    .seal-small {
        right: 1rem;
        top: 1rem;
    }
}

/* === FOOTER SEAL === */
.footer-seal-section {
    padding: 6rem 0 4rem;
    text-align: center;
}

.seal-large {
    width: 160px;
    height: 160px;
    margin: 0 auto 2rem;
    transform: rotate(2deg);
    opacity: 0.85;
    animation: seal-pulse 4s ease-in-out infinite;
}

@keyframes seal-pulse {
    0%, 100% { transform: rotate(2deg) scale(1.0); }
    50% { transform: rotate(2deg) scale(1.02); }
}

.seal-outer-lg {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 3px solid var(--red-oxide);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 6px var(--bg), 0 0 0 8px var(--red-oxide);
}

.seal-inner-lg {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    border: 1.5px solid var(--terracotta);
    display: flex;
    align-items: center;
    justify-content: center;
}

.seal-text-svg-lg {
    width: 120px;
    height: 120px;
}

.footer-text {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.8rem;
    color: var(--taupe);
    letter-spacing: 0.04em;
}
