/* ========================================
   SSETTL.com — Swiss Typographic Style
   ======================================== */

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

:root {
    --settler-white: #FAF9F6;
    --charcoal-ink: #2C2C2C;
    --parchment: #E8E5DF;
    --swiss-red: #D4382C;
    --warm-stone: #B8B2A8;
    --graphite: #4A4641;

    --font-display: 'Instrument Serif', serif;
    --font-body: 'Inter', sans-serif;

    --grid-columns: 12;
    --grid-gutter: 24px;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    background-color: var(--settler-white);
    color: var(--charcoal-ink);
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
    line-height: 1.7;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

/* --- Navigation Circle --- */
#nav-circle {
    position: fixed;
    top: 2rem;
    left: 2rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--charcoal-ink);
    border: none;
    cursor: pointer;
    z-index: 1000;
    padding: 0;
    transition: transform 0.3s ease;
}

#nav-circle:hover {
    transform: scale(1.3);
}

#nav-circle.is-open {
    background: var(--settler-white);
}

/* --- Navigation Overlay --- */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(184, 178, 168, 0.97);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.nav-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.nav-overlay-content {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    text-align: center;
}

.nav-link {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 1.5rem;
    color: var(--charcoal-ink);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    position: relative;
    display: inline-block;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--warm-stone);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* --- Grid Overlay --- */
.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 2s ease;
}

.grid-overlay.is-visible {
    opacity: 0.4;
}

.grid-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        repeating-linear-gradient(
            to right,
            #E8E5DF 0px,
            #E8E5DF 1px,
            transparent 1px,
            transparent calc((100% - 11 * 24px) / 12 + 24px)
        ),
        repeating-linear-gradient(
            to bottom,
            #E8E5DF 0px,
            #E8E5DF 1px,
            transparent 1px,
            transparent 48px
        );
}

/* --- Main --- */
main {
    position: relative;
    z-index: 2;
}

/* --- Sections --- */
.section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 4rem 0;
}

.section-content {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--grid-gutter);
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    column-gap: var(--grid-gutter);
}

/* --- Column Positioning --- */
.column-left > * {
    grid-column: 1 / 7;
}

.column-center > * {
    grid-column: 4 / 10;
}

.column-center-right > * {
    grid-column: 5 / 11;
}

.column-right > * {
    grid-column: 7 / 13;
}

/* --- Column Drift via Transform --- */
.narrative-block {
    transition: transform 1.2s cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.narrative-block.drift-left {
    transform: translateX(0);
}

.narrative-block.drift-center {
    transform: translateX(0);
}

.narrative-block.drift-center-right {
    transform: translateX(0);
}

.narrative-block.drift-right {
    transform: translateX(0);
}

/* --- The Arrival --- */
.section-arrival {
    min-height: 100vh;
}

.hero-text {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(2.5rem, 8vw, 9rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--charcoal-ink);
}

/* --- Narrative Sections --- */
.text-rule {
    border: none;
    border-top: 1px solid var(--charcoal-ink);
    margin-bottom: 1.5rem;
    grid-column: inherit;
}

.body-text {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
    line-height: 1.7;
    letter-spacing: 0.01em;
    max-width: 38ch;
    hyphens: auto;
    -webkit-hyphens: auto;
    color: var(--charcoal-ink);
}

/* Text block entrance */
.narrative-block {
    opacity: 0;
    transition: opacity 0.6s ease, transform 1.2s cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.narrative-block.is-visible {
    opacity: 1;
}

/* --- Spacer --- */
.spacer {
    height: 200vh;
}

/* --- Bento Section --- */
.section-bento {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem var(--grid-gutter);
}

.bento-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 2px;
    width: min(80vw, 700px);
    aspect-ratio: 1;
}

.bento-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--settler-white);
    border: 1px solid var(--parchment);
}

.bento-glyph {
    font-family: var(--font-display);
    font-weight: 400;
    line-height: 1;
    color: var(--charcoal-ink);
}

.bento-numeral {
    font-size: clamp(8rem, 20vw, 16rem);
    letter-spacing: -0.02em;
}

.bento-cross {
    font-size: 15vw;
    color: var(--swiss-red);
    animation: pulse-red 4s ease-in-out infinite alternate;
}

.bento-word {
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: -0.02em;
}

@keyframes pulse-red {
    0% { opacity: 1; }
    100% { opacity: 0.7; }
}

/* --- The Settlement --- */
.section-settlement {
    min-height: 100vh;
}

.closing-text {
    max-width: 38ch;
}

/* --- Footer Rule --- */
.footer-rule {
    border: none;
    border-top: 1px solid var(--charcoal-ink);
    width: 100%;
    margin: 0;
}

/* --- Footer --- */
.site-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 4rem 0;
    min-height: 50vh;
}

.footer-text {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: clamp(0.75rem, 1vw, 0.9rem);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--graphite);
}

.footer-separator {
    color: var(--graphite);
    font-size: 0.9rem;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .section-content {
        display: block;
        padding: 0 2rem;
    }

    .hero-text {
        font-size: clamp(2.5rem, 12vw, 5rem);
    }

    .spacer {
        height: 100vh;
    }

    .bento-grid {
        width: 90vw;
    }

    .bento-numeral {
        font-size: clamp(4rem, 15vw, 8rem);
    }

    .bento-cross {
        font-size: 20vw;
    }

    .bento-word {
        font-size: clamp(2rem, 10vw, 4rem);
    }

    .body-text {
        max-width: 100%;
    }

    #nav-circle {
        top: 1.5rem;
        left: 1.5rem;
    }
}

/* --- Tabular figures for numerals --- */
.bento-numeral {
    font-variant-numeric: tabular-nums;
}

/* --- Selection --- */
::selection {
    background: var(--parchment);
    color: var(--charcoal-ink);
}
