/* =========================================================
   PPADDL.com — Watercolor Mountain Manifesto
   Palette: analogous (blue → indigo → twilight violet)
   ========================================================= */

:root {
    --c-indigo:        #1f2a44;
    --c-slate-ink:     #2c3855;
    --c-mtn-shadow:    #3a4a6c;
    --c-atmos:         #5a6e94;
    --c-mist:          #7e92b6;
    --c-glacier:       #a9bcd6;
    --c-paper-sky:     #c8d4e4;
    --c-cream:         #f4efe6;
    --c-twilight:      #5b3a7c;
    --c-mute-gray:     #6a7a99;

    --gutter: 8vw;
    --ease-confident: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html, body {
    background: var(--c-cream);
    color: var(--c-slate-ink);
    font-family: "Inter Tight", "Inter", system-ui, sans-serif;
    font-weight: 400;
    line-height: 1.62;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    cursor: none;
    background-image:
        radial-gradient(ellipse at 20% 0%, rgba(126, 146, 182, 0.10), transparent 60%),
        radial-gradient(ellipse at 80% 100%, rgba(91, 58, 124, 0.06), transparent 55%);
}

/* Page-wide paper grain texture overlay */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9000;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.62  0 0 0 0 0.55  0 0 0 0 0.45  0 0 0 0.10 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/></svg>");
    mix-blend-mode: multiply;
    opacity: 0.45;
}

.svg-defs { position: absolute; left: -9999px; top: -9999px; }

/* =========================================================
   Altitude Gutter
   ========================================================= */
.altitude-gutter {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--gutter);
    height: 100vh;
    z-index: 50;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 28px 0 28px 22px;
    pointer-events: none;
}

.altitude-gutter .alt-line {
    position: absolute;
    left: 18px;
    top: 8%;
    bottom: 18%;
    width: 1px;
    background: linear-gradient(to bottom,
        transparent,
        var(--c-mute-gray) 12%,
        var(--c-mute-gray) 88%,
        transparent);
    opacity: 0.45;
}

.alt-ticks {
    list-style: none;
    margin-top: 16vh;
    display: flex;
    flex-direction: column;
    gap: 16vh;
}

.alt-ticks li {
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 11px;
    color: var(--c-mute-gray);
    letter-spacing: 0.06em;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.6s var(--ease-confident);
}

.alt-ticks li.active { color: var(--c-indigo); }
.alt-ticks .tick { display: inline-block; width: 10px; }
.alt-ticks .m { font-feature-settings: "tnum"; }

.brand-stamp {
    font-family: "JetBrains Mono", monospace;
    font-size: 10px;
    color: var(--c-mute-gray);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    line-height: 1.7;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    align-self: flex-start;
    opacity: 0.7;
}

/* =========================================================
   Folio + Sections
   ========================================================= */
#folio {
    position: relative;
    width: 100%;
    padding-left: var(--gutter);
}

.panel {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 720px;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
        "tl tr"
        "mid mid"
        "bl br";
    gap: 18px 36px;
    padding: 6vh 7vw 6vh 4vw;
}

/* per-panel paper tonal shift */
.panel[data-panel="1"] { background: linear-gradient(180deg, #f4efe6, #efe9dd); }
.panel[data-panel="2"] { background: linear-gradient(180deg, #efe9dd, #ece6d8); }
.panel[data-panel="3"] { background: linear-gradient(180deg, #ece6d8, #e7e0d1); }
.panel[data-panel="4"] { background: linear-gradient(180deg, #e7e0d1, #e3dccb); }
.panel[data-panel="5"] { background: linear-gradient(180deg, #e3dccb, #dcd2c0); }

.watercolor-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.92;
    mix-blend-mode: multiply;
    pointer-events: auto;
}

.paper-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background-image:
        radial-gradient(ellipse at 20% 30%, rgba(31, 42, 68, 0.04), transparent 60%),
        radial-gradient(ellipse at 80% 70%, rgba(91, 58, 124, 0.05), transparent 55%);
    mix-blend-mode: multiply;
}

/* Z-pattern anchors */
.z-anchor {
    position: relative;
    z-index: 3;
    transform: translateY(8px);
    opacity: 0;
    transition: opacity 1.4s var(--ease-confident), transform 1.4s var(--ease-confident);
}

.panel.is-revealed .z-anchor { opacity: 1; transform: translateY(0); }
.panel.is-revealed .anchor-tr { transition-delay: 0.18s; }
.panel.is-revealed .anchor-mid { transition-delay: 0.32s; }
.panel.is-revealed .anchor-br { transition-delay: 0.56s; }

.anchor-tl  { grid-area: tl;  align-self: start;   justify-self: start;  max-width: 64ch; }
.anchor-tr  { grid-area: tr;  align-self: start;   justify-self: end;    text-align: right; max-width: 36ch; }
.anchor-mid { grid-area: mid; align-self: center;  justify-self: center; max-width: 78ch; text-align: center; display: flex; flex-direction: column; gap: 18px; align-items: center; }
.anchor-br  { grid-area: br;  align-self: end;     justify-self: end;    text-align: right; }

/* =========================================================
   Typography
   ========================================================= */
.display.headline,
.display {
    font-family: "Fraunces", "Newsreader", "Lora", Georgia, serif;
    font-weight: 700;
    color: var(--c-indigo);
    font-size: clamp(3rem, 7vw, 6.5rem);
    letter-spacing: -0.025em;
    line-height: 1.04;
    font-variation-settings: "opsz" 144, "SOFT" 30, "wght" 700;
    transition: font-variation-settings 0.5s var(--ease-confident), color 0.5s var(--ease-confident);
}

.display.headline:hover {
    font-variation-settings: "opsz" 144, "SOFT" 80, "wght" 720;
    color: var(--c-mtn-shadow);
}

.display .line-1,
.display .line-2,
.display .line-3 {
    display: block;
    overflow: hidden;
}

.display .line-2 { padding-left: 0.6ch; opacity: 0.95; }
.display .line-3 { padding-left: 1.2ch; color: var(--c-mtn-shadow); }

.section-tag {
    font-family: "JetBrains Mono", monospace;
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--c-mute-gray);
    margin-bottom: 14px;
}

.eyebrow {
    font-family: "Fraunces", serif;
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    letter-spacing: 0.04em;
    color: var(--c-mtn-shadow);
    text-transform: lowercase;
    font-style: italic;
    font-variation-settings: "opsz" 36, "wght" 500, "SOFT" 40;
}

.eyebrow.newsreader-italic {
    font-family: "Newsreader", "Fraunces", serif;
}

.meta-line {
    margin-top: 22px;
    font-family: "JetBrains Mono", monospace;
    font-size: 12px;
    letter-spacing: 0.12em;
    color: var(--c-mute-gray);
}

.body-text {
    font-family: "Inter Tight", "Inter", sans-serif;
    font-size: clamp(1rem, 1.15vw, 1.18rem);
    line-height: 1.62;
    color: var(--c-slate-ink);
    max-width: 56ch;
    font-variation-settings: "wght" 380;
    transition: font-variation-settings 0.8s var(--ease-confident);
}

.panel.is-revealed .body-text { font-variation-settings: "wght" 420; }
.body-text .emph { font-weight: 600; color: var(--c-indigo); font-variation-settings: "wght" 600; }

.annotation {
    font-family: "JetBrains Mono", monospace;
    font-size: 12px;
    letter-spacing: 0.10em;
    color: var(--c-mute-gray);
    margin-top: 12px;
}

.margin-note.hand {
    font-family: "Caveat", cursive;
    font-size: 16px;
    color: var(--c-twilight);
    margin-top: 10px;
    line-height: 1.2;
}

.hand { font-family: "Caveat", cursive; }

/* =========================================================
   Folio nav
   ========================================================= */
.folio-nav {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-end;
}

.folio-nav a {
    font-family: "JetBrains Mono", monospace;
    font-size: 11px;
    letter-spacing: 0.10em;
    color: var(--c-atmos);
    text-decoration: none;
    text-transform: uppercase;
    transition: color 0.4s var(--ease-confident), letter-spacing 0.4s var(--ease-confident);
}

.folio-nav a:hover {
    color: var(--c-twilight);
    letter-spacing: 0.16em;
}

/* =========================================================
   Mid-anchor mountain SVGs
   ========================================================= */
.ridge-vignette {
    width: clamp(320px, 38vw, 640px);
    height: auto;
    filter: drop-shadow(0 8px 18px rgba(31, 42, 68, 0.12));
}

.ridge-vignette.mid-peak { width: clamp(280px, 32vw, 540px); }
.ridge-vignette.ridgeline-wide { width: clamp(420px, 50vw, 780px); }

.ridge-fill {
    transition: opacity 0.8s var(--ease-confident);
}

.bullet-ridge {
    width: 24px;
    height: 12px;
    margin-right: 10px;
    vertical-align: middle;
}

.ridge-list {
    list-style: none;
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: right;
    font-family: "Newsreader", serif;
    font-size: 14px;
    color: var(--c-mtn-shadow);
    font-style: italic;
}

.ridge-list li { display: inline-flex; align-items: center; justify-content: flex-end; }

/* =========================================================
   Dispatch (br anchor) link
   ========================================================= */
.dispatch-link {
    position: relative;
    display: inline-flex;
    align-items: baseline;
    gap: 10px;
    font-family: "Inter Tight", sans-serif;
    font-weight: 600;
    font-size: clamp(1rem, 1.05vw, 1.15rem);
    color: var(--c-indigo);
    text-decoration: none;
    letter-spacing: 0.02em;
    padding-bottom: 14px;
}

.dispatch-link .dl-arrow {
    transition: transform 0.5s var(--ease-confident);
    color: var(--c-twilight);
}

.dispatch-link:hover .dl-arrow { transform: translateY(4px); }
.dispatch-link:hover { color: var(--c-twilight); }

.hand-underline {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 12px;
    overflow: visible;
}

.hand-underline path {
    stroke-dasharray: 240;
    stroke-dashoffset: 240;
    transition: stroke-dashoffset 1.2s var(--ease-confident);
}

.panel.is-revealed .hand-underline path { stroke-dashoffset: 0; }
.dispatch-link:hover .hand-underline path { stroke: var(--c-twilight); }

/* =========================================================
   Form (granulation panel)
   ========================================================= */
.dispatch-form {
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    position: relative;
}

.dispatch-form label {
    font-family: "Caveat", cursive;
    font-size: 18px;
    color: var(--c-twilight);
}

.dispatch-form input {
    font-family: "Inter Tight", sans-serif;
    font-size: 14px;
    background: rgba(244, 239, 230, 0.6);
    border: none;
    border-bottom: 1.4px solid var(--c-atmos);
    padding: 8px 6px;
    color: var(--c-indigo);
    width: 220px;
    outline: none;
    transition: border-color 0.4s var(--ease-confident), background 0.4s var(--ease-confident);
}

.dispatch-form input:focus {
    border-bottom-color: var(--c-twilight);
    background: rgba(244, 239, 230, 0.9);
}

.ink-btn {
    background: transparent;
    border: 1.2px solid var(--c-indigo);
    color: var(--c-indigo);
    font-family: "Inter Tight", sans-serif;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.06em;
    padding: 8px 18px;
    cursor: none;
    transition: background 0.5s var(--ease-confident), color 0.5s var(--ease-confident), border-color 0.5s var(--ease-confident);
}

.ink-btn:hover {
    background: var(--c-indigo);
    color: var(--c-cream);
}

.ink-btn:active {
    background: var(--c-twilight);
    border-color: var(--c-twilight);
}

.form-hint {
    display: block;
    width: 100%;
    text-align: center;
    color: var(--c-twilight);
    min-height: 18px;
    margin-top: 6px;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.6s var(--ease-confident), transform 0.6s var(--ease-confident);
    font-size: 16px;
}

.form-hint.show {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================================
   Painterly shake (error)
   ========================================================= */
@keyframes painterly-shake {
    0%,100% { transform: translateX(0); }
    20%     { transform: translateX(-8px); }
    40%     { transform: translateX(6px); }
    60%     { transform: translateX(-4px); }
    80%     { transform: translateX(2px); }
}

.shake { animation: painterly-shake 0.4s var(--ease-confident); }

/* Splatter container (positioned absolutely by JS) */
.splatter {
    position: absolute;
    width: 80px;
    height: 80px;
    pointer-events: none;
    overflow: visible;
    z-index: 12;
}

/* =========================================================
   Deckle edge separators
   ========================================================= */
.deckle {
    position: absolute;
    left: 0;
    width: 100%;
    height: 26px;
    z-index: 4;
    pointer-events: none;
    filter: drop-shadow(0 4px 14px rgba(60, 40, 30, 0.08));
}

.deckle-bottom { bottom: -1px; }

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

/* =========================================================
   Brush-stroke entrance reveal
   ========================================================= */
.panel .z-anchor.anchor-tl .display {
    clip-path: inset(0 100% 0 0);
    transition: clip-path 1.4s var(--ease-confident);
}

.panel.is-revealed .anchor-tl .display { clip-path: inset(0 0 0 0); }

.panel .z-anchor.anchor-mid .ridge-vignette {
    clip-path: inset(0 100% 0 0);
    transition: clip-path 1.6s var(--ease-confident) 0.2s;
}

.panel.is-revealed .anchor-mid .ridge-vignette { clip-path: inset(0 0 0 0); }

.panel .z-anchor.anchor-mid .body-text {
    opacity: 0;
    transition: opacity 1s var(--ease-confident) 0.6s;
}

.panel.is-revealed .anchor-mid .body-text { opacity: 1; }

/* =========================================================
   Custom paintbrush cursor
   ========================================================= */
.paint-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 14px;
    height: 32px;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -10%) rotate(35deg);
    transition: transform 0.2s var(--ease-confident);
    will-change: top, left, transform;
}

.paint-cursor.is-painting { transform: translate(-50%, -10%) rotate(45deg) scale(1.1); }

/* The decaying pigment trail dots are appended by JS */
.pigment-trail {
    position: fixed;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(31, 42, 68, 0.45);
    filter: blur(2px);
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    opacity: 0.8;
    transition: opacity 0.8s var(--ease-confident), transform 0.8s var(--ease-confident);
}

.pigment-trail.fade {
    opacity: 0;
    transform: translate(-50%, -50%) scale(2.2);
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 900px) {
    :root { --gutter: 56px; }

    .panel {
        grid-template-columns: 1fr;
        grid-template-areas:
            "tl"
            "tr"
            "mid"
            "br";
        padding: 5vh 6vw 5vh 4vw;
        height: auto;
        min-height: 100vh;
    }

    .anchor-tr { justify-self: start; text-align: left; }
    .anchor-mid { align-items: flex-start; text-align: left; }
    .anchor-br { justify-self: end; }

    .display.headline { font-size: clamp(2.4rem, 9vw, 4rem); }

    .altitude-gutter { padding: 14px 0 14px 12px; }
    .alt-ticks { margin-top: 10vh; gap: 12vh; }
    .brand-stamp { display: none; }

    .ridge-vignette,
    .ridge-vignette.mid-peak,
    .ridge-vignette.ridgeline-wide { width: 92%; }

    body { cursor: auto; }
    .paint-cursor { display: none; }
    .pigment-trail { display: none; }
}

@media (max-width: 540px) {
    .folio-nav a { font-size: 10px; }
    .display.headline { font-size: clamp(2rem, 11vw, 3rem); }
    .body-text { font-size: 1rem; }
}

/* =========================================================
   Print fallback
   ========================================================= */
@media print {
    .watercolor-canvas, .paint-cursor, .pigment-trail, .deckle { display: none; }
    body { cursor: auto; background: white; }
}
