/* ===========================================================
   miris.xyz  —  retro-futuristic / ma-negative-space
   palette: creamy-pastel · typography: geometric-sans
   =========================================================== */

:root {
    /* Color palette (exact hex from DESIGN.md) */
    --bg:           #F5F0E8;  /* Warm Cream */
    --text:         #4A3F35;  /* Roasted Walnut */
    --text-2:       #8B9A82;  /* Dusty Sage */
    --accent-1:     #D4937A;  /* Faded Terracotta */
    --accent-2:     #9BB5C9;  /* Muted Sky */
    --accent-3:     #C4B5D4;  /* Pale Lavender */
    --line:         #D4C5B0;  /* Parchment Tan */
    --deep:         #3D3D32;  /* Charcoal Olive */

    --font-head: 'Josefin Sans', 'Inter', system-ui, sans-serif;
    --font-body: 'Nunito', 'Lora', Georgia, serif;
    --font-hand: 'Caveat', 'Inter', cursive;

    --pad-x: 80px;
    --pad-x-wide: 140px;
    --max-content: 960px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    background: var(--bg);
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.75;
    font-weight: 400;
    overflow-x: hidden;
    cursor: default;
}

/* Cursor canvas — covers viewport, sits above everything but ignores pointer */
#cursor-canvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 100;
}

/* ===========================================================
   Typography
   =========================================================== */

h1, h2, h3 {
    font-family: var(--font-head);
    font-weight: 300;
    color: var(--text);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    line-height: 1.15;
}

.heading {
    font-size: clamp(36px, 5vw, 60px);
    margin-bottom: 28px;
    color: var(--text);
}

p {
    max-width: 520px;
    font-size: 18px;
    line-height: 1.75;
    margin-bottom: 18px;
    color: var(--text);
}

a {
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid var(--accent-2);
    transition: color 320ms ease, transform 320ms ease, border-color 320ms ease;
    display: inline-block;
}

a:hover {
    color: var(--accent-1);
    border-bottom-color: var(--accent-1);
    transform: translateY(2px);
}

/* Caveat-on-hover effect: secondary span layered under links/nav */
.nav-link, .horizon-below a {
    position: relative;
}

.kicker {
    display: inline-block;
    font-family: var(--font-hand);
    font-size: 17px;
    color: var(--text-2);
    margin-bottom: 14px;
    letter-spacing: 0.02em;
}

.overline {
    display: inline-block;
    font-family: var(--font-head);
    font-weight: 300;
    font-size: 12px;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--text-2);
    margin-bottom: 36px;
}

.caption {
    display: block;
    font-family: var(--font-hand);
    font-size: 16px;
    color: var(--text-2);
    margin-top: 12px;
    letter-spacing: 0.01em;
}

.caveat { font-family: var(--font-hand); font-size: 18px; color: var(--text); }

/* ===========================================================
   Navigation
   =========================================================== */

.site-nav {
    position: fixed;
    top: 56px;
    left: var(--pad-x);
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-link {
    font-family: var(--font-hand);
    font-size: 18px;
    color: var(--text);
    border-bottom: none;
    padding: 2px 0;
    letter-spacing: 0.02em;
    transition: color 280ms ease, transform 280ms ease, letter-spacing 280ms ease;
}

.nav-link:hover {
    color: var(--accent-1);
    transform: translateY(2px);
    letter-spacing: 0.04em;
}

/* ===========================================================
   Sections — ma-negative-space
   =========================================================== */

.section {
    position: relative;
    padding: 0 var(--pad-x);
    min-height: 100vh;
    display: block;
}

@media (min-width: 1600px) {
    .section { padding: 0 var(--pad-x-wide); }
}

/* ----- Decorative section numerals (mix-blend-mode: multiply) ----- */
.numeral {
    position: absolute;
    font-family: var(--font-head);
    font-weight: 100;
    font-size: clamp(120px, 14vw, 160px);
    color: var(--accent-3);
    letter-spacing: 0.04em;
    line-height: 1;
    mix-blend-mode: multiply;
    pointer-events: none;
    user-select: none;
    opacity: 0.85;
}

/* ----- Reveal animation (IntersectionObserver) ----- */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 600ms ease-out, transform 600ms ease-out;
}

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

/* ===========================================================
   Section 01 — Opening Void
   =========================================================== */

.opening {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    align-items: stretch;
    padding-top: 200px;
    padding-bottom: 80px;
}

.opening-illustration {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    align-self: start;
    margin-top: 40px;
    margin-right: 40px;
    width: 240px;
}

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

.opening-title {
    grid-column: 1;
    grid-row: 2;
    align-self: end;
    justify-self: start;
    max-width: 480px;
    margin-bottom: 60px;
}

.site-title {
    font-family: var(--font-head);
    font-weight: 100;
    font-size: clamp(56px, 8vw, 96px);
    letter-spacing: 0.08em;
    text-transform: lowercase;
    color: var(--text);
    margin-bottom: 24px;
    line-height: 1;
}

.site-title .dot {
    color: var(--accent-1);
}

.site-tagline {
    font-family: var(--font-body);
    font-size: 19px;
    line-height: 1.75;
    color: var(--text);
    margin-bottom: 36px;
    max-width: 360px;
}

.scroll-hint {
    display: inline-block;
    font-family: var(--font-hand);
    font-size: 16px;
    color: var(--text-2);
    animation: pulse-down 3.6s ease-in-out infinite;
}

@keyframes pulse-down {
    0%, 100% { transform: translateY(0); opacity: 0.6; }
    50%      { transform: translateY(6px); opacity: 1; }
}

/* ===========================================================
   Section 02 — The Drift Zone (archipelago)
   =========================================================== */

.drift {
    padding-top: 160px;
    padding-bottom: 200px;
    position: relative;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: minmax(60px, auto);
    row-gap: 120px;
    column-gap: 24px;
}

.drift .numeral {
    top: 80px;
    right: var(--pad-x);
}

.drift-text-a {
    grid-column: 1 / span 6;
    grid-row: 1;
    max-width: 520px;
}

.drift-illus-a {
    grid-column: 8 / span 4;
    grid-row: 2;
    justify-self: start;
    width: 220px;
    margin-top: -40px;
}

.drift-illus-a svg { width: 100%; height: auto; display: block; }

.drift-text-b {
    grid-column: 2 / span 6;
    grid-row: 3;
    max-width: 520px;
    margin-top: 80px;
}

.drift-illus-b {
    grid-column: 6 / span 6;
    grid-row: 4;
    justify-self: end;
    width: 280px;
    margin-top: -20px;
}

.drift-illus-b svg { width: 100%; height: auto; display: block; }

/* The wandering connector line behind the drift islands */
.drift-connector {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.7;
}

.drift > .island { position: relative; z-index: 1; }

/* ===========================================================
   Section 03 — Constellation
   =========================================================== */

.constellation {
    padding-top: 180px;
    padding-bottom: 220px;
    position: relative;
    min-height: 120vh;
}

.constellation .numeral {
    top: 80px;
    left: var(--pad-x);
}

.constellation-intro {
    max-width: 520px;
    margin-left: auto;
    margin-right: 8%;
    margin-bottom: 100px;
    text-align: right;
}

.constellation-intro p {
    margin-left: auto;
}

.constellation-lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.85;
}

.constellation-lines .cline {
    transition: stroke 320ms ease, stroke-width 320ms ease, opacity 320ms ease;
}

.constellation-lines .cline.is-glowing {
    stroke: var(--accent-1);
    stroke-width: 2;
    opacity: 1;
}

.constellation-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(7, 80px);
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
}

.waypoint {
    grid-column: var(--gx) / span 2;
    grid-row: var(--gy) / span 2;
    max-width: 200px;
    padding: 18px 16px;
    background: var(--bg);
    border-radius: 4px;
    transition: transform 320ms ease, color 320ms ease;
    position: relative;
}

.waypoint:hover {
    transform: translateY(2px);
}

.waypoint .hanko {
    display: block;
    width: 60px;
    height: 60px;
    margin-bottom: 12px;
    transition: transform 320ms ease;
}

.waypoint .hanko svg { width: 100%; height: 100%; display: block; }

.waypoint:hover .hanko { transform: rotate(-4deg); }

.waypoint h3 {
    font-family: var(--font-head);
    font-weight: 300;
    font-size: 18px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 8px;
    color: var(--text);
    transition: color 280ms ease;
}

.waypoint:hover h3 { color: var(--accent-1); }

.waypoint p {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    margin-bottom: 10px;
}

.waypoint .meta {
    font-family: var(--font-hand);
    font-size: 14px;
    color: var(--text-2);
    letter-spacing: 0.04em;
}

/* ===========================================================
   Section 04 — Horizon
   =========================================================== */

.horizon {
    min-height: 100vh;
    padding-top: 160px;
    padding-bottom: 80px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.horizon .numeral {
    top: 80px;
    right: var(--pad-x);
}

.horizon-above {
    margin-top: 80px;
    max-width: 520px;
    margin-left: 8%;
}

.horizon-line-text {
    font-family: var(--font-head);
    font-weight: 300;
    font-size: clamp(22px, 2.4vw, 30px);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    line-height: 1.3;
    color: var(--text);
    max-width: 520px;
    margin-bottom: 14px;
}

.horizon-sub {
    font-family: var(--font-hand);
    font-size: 20px;
    color: var(--text-2);
    max-width: 480px;
}

/* The horizon line itself — sits at ~70% of the section height */
.horizon-line-wrap {
    position: relative;
    margin-top: 14vh;
    margin-bottom: 60px;
    height: 80px;
}

.horizon-line-svg {
    position: absolute;
    left: -20px;
    right: -20px;
    width: calc(100% + 40px);
    top: 30px;
    height: 4px;
    overflow: visible;
}

.horizon-walker {
    position: absolute;
    left: 18%;
    top: -34px;
    width: 40px;
    height: 56px;
    animation: walk-along 22s linear infinite;
}

@keyframes walk-along {
    0%   { left: 8%;  transform: translateY(0); }
    50%  { left: 70%; transform: translateY(-2px); }
    100% { left: 8%;  transform: translateY(0); }
}

.horizon-below {
    max-width: 880px;
    margin-left: auto;
    margin-right: 8%;
}

.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 36px;
    margin-bottom: 40px;
}

.fcol .kicker {
    display: block;
    margin-bottom: 6px;
}

.fcol a {
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--deep);
    border-bottom: 1px solid var(--accent-2);
}

.fcol a:hover {
    color: var(--accent-1);
    border-bottom-color: var(--accent-1);
}

.horizon-coda {
    font-family: var(--font-hand);
    font-size: 15px;
    color: var(--text-2);
    text-align: right;
    max-width: none;
}

/* ===========================================================
   Responsive — collapse to single-column at narrow widths
   while preserving ma-negative-space margins
   =========================================================== */

@media (max-width: 900px) {
    :root { --pad-x: 36px; }

    .site-nav {
        top: 28px;
        left: 36px;
        flex-direction: row;
        gap: 18px;
    }

    .opening {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        padding-top: 160px;
    }

    .opening-illustration {
        grid-column: 1;
        grid-row: 1;
        justify-self: end;
        width: 180px;
    }

    .opening-title {
        grid-column: 1;
        grid-row: 2;
        margin-top: 80px;
    }

    .drift {
        grid-template-columns: 1fr;
        row-gap: 80px;
    }

    .drift-text-a, .drift-text-b {
        grid-column: 1;
    }

    .drift-illus-a, .drift-illus-b {
        grid-column: 1;
        justify-self: start;
        width: 200px;
        margin-top: 0;
    }

    .drift-text-a { grid-row: 1; }
    .drift-illus-a { grid-row: 2; }
    .drift-text-b { grid-row: 3; margin-top: 0; }
    .drift-illus-b { grid-row: 4; justify-self: end; }

    .constellation-intro {
        text-align: left;
        margin-left: 0;
        margin-right: auto;
    }
    .constellation-intro p { margin-left: 0; }

    .constellation-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
        gap: 36px;
    }

    .waypoint {
        grid-column: auto !important;
        grid-row: auto !important;
        max-width: none;
    }

    .constellation-lines { display: none; }

    .footer-cols { grid-template-columns: 1fr; gap: 24px; }
    .horizon-below { margin-right: 0; }
    .horizon-coda { text-align: left; }
}
