/* ============================================================
   rriddl.com — frutiger aero tide-pool styles
   coastal-blend palette · organic blobs · scroll-triggered
   ============================================================ */

:root {
    /* sea gradient stops */
    --sea-top: #A8E6F0;
    --sea-mid: #5FB8D6;
    --sea-deep: #1F6F8B;
    --abyss: #0A2540;

    /* sand + accents */
    --sand: #F4E1B5;
    --foam: #FFE8A3;
    --kelp: #7FD4C1;
    --coral: #FF7B6B;

    /* ink */
    --paper: #F8FAFB;
    --ink: #0A2540;
    --ink-aside: #2E5A8C;
    --glass: rgba(255, 255, 255, 0.18);
    --glass-strong: rgba(255, 255, 255, 0.32);

    /* type */
    --f-display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
    --f-display-2: "Big Shoulders Display", "Inter", system-ui, sans-serif;
    --f-body: "DM Sans", "Inter", system-ui, sans-serif;
    --f-hand: "Caveat", "Comic Sans MS", cursive;
    --f-mono: "JetBrains Mono", monospace;

    /* easings */
    --ease-out-quart: cubic-bezier(0.22, 0.61, 0.36, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

    /* scroll var (set by JS) */
    --scroll: 0px;
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--f-body);
    font-size: 18px;
    line-height: 1.65;
    color: var(--ink);
    background: linear-gradient(180deg,
        var(--sea-top) 0%,
        var(--sea-mid) 28%,
        var(--sea-deep) 62%,
        var(--abyss) 92%,
        var(--abyss) 100%);
    overflow-x: hidden;
    min-height: 100vh;
    cursor: none;
}

/* hide default svg defs */
.svg-defs {
    position: absolute;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* ============================================================
   noise overlay — fixed across viewport
   ============================================================ */
.noise-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1000;
    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='1.4' numOctaves='3' seed='7'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.55 0'/></filter><rect width='200' height='200' filter='url(%23n)'/></svg>");
    background-size: 200px 200px;
    opacity: 0.06;
    mix-blend-mode: soft-light;
}

/* ============================================================
   nav pill — frosted glass capsule
   ============================================================ */
.nav-pill {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 18px;
    height: 36px;
    padding: 0 18px;
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 999px;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.7) inset,
        0 8px 32px rgba(10, 37, 64, 0.18),
        0 0 0 1px rgba(168, 230, 240, 0.0);
    transition: padding 0.6s var(--ease-out-quart),
        gap 0.6s var(--ease-out-quart),
        box-shadow 0.6s var(--ease-out-quart);
}

.nav-pill.is-condensed {
    padding: 0 10px;
    gap: 8px;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.7) inset,
        0 8px 32px rgba(10, 37, 64, 0.22),
        0 0 0 1px var(--sea-top);
}

.nav-pill.is-condensed .nav-wordmark-text,
.nav-pill.is-condensed .nav-link {
    opacity: 0;
    transform: scale(0.7);
    width: 0;
    overflow: hidden;
    pointer-events: none;
    margin: 0;
}

.nav-wordmark {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--ink);
    font-family: var(--f-display);
    font-weight: 800;
    font-size: 16px;
    letter-spacing: -0.02em;
}

.nav-wordmark-blob {
    width: 18px;
    height: 18px;
    fill: var(--coral);
    flex-shrink: 0;
    animation: blob-spin 60s linear infinite;
}

.nav-wordmark-text {
    transition: opacity 0.4s var(--ease-out-quart),
        transform 0.4s var(--ease-out-quart);
}

.nav-link {
    text-decoration: none;
    color: var(--ink);
    font-family: var(--f-body);
    font-size: 14px;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.35);
    transition: background 0.3s var(--ease-out-quart),
        opacity 0.4s var(--ease-out-quart),
        transform 0.4s var(--ease-out-quart);
}

.nav-link:hover {
    background: rgba(255, 232, 163, 0.65);
}

/* ============================================================
   riddle counter badge — lower-right
   ============================================================ */
.riddle-counter {
    position: fixed;
    right: 28px;
    bottom: 28px;
    z-index: 150;
    display: flex;
    align-items: baseline;
    gap: 4px;
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 999px;
    color: var(--ink);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.7) inset,
        0 8px 24px rgba(10, 37, 64, 0.18);
    transition: transform 0.4s var(--ease-spring);
}

.riddle-counter.pulse {
    transform: scale(1.08);
}

.riddle-counter-num {
    font-family: var(--f-display);
    font-weight: 800;
    font-size: 22px;
    line-height: 1;
    color: var(--coral);
    letter-spacing: -0.02em;
}

.riddle-counter-sep,
.riddle-counter-tot {
    font-family: var(--f-mono);
    font-size: 12px;
    color: var(--ink);
    opacity: 0.7;
}

/* ============================================================
   tide-clock widget — lower-left
   ============================================================ */
.tide-clock {
    position: fixed;
    left: 28px;
    bottom: 28px;
    z-index: 150;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 12px;
    color: var(--ink);
    font-family: var(--f-mono);
    font-size: 11px;
    line-height: 1.4;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.6) inset,
        0 6px 16px rgba(10, 37, 64, 0.16);
}

.tide-clock-label {
    opacity: 0.6;
    font-size: 10px;
    text-transform: lowercase;
}

.tide-clock-value {
    font-size: 13px;
    color: var(--coral);
    letter-spacing: 0.04em;
}

.tide-clock-coords {
    opacity: 0.55;
    font-size: 10px;
}

/* ============================================================
   sections — shared
   ============================================================ */
.section {
    position: relative;
    width: 100%;
    padding: 64px clamp(24px, 6vw, 96px);
    overflow: hidden;
}

.section-label {
    display: inline-block;
    font-family: var(--f-mono);
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--coral);
    margin-bottom: 18px;
    padding: 4px 14px;
    background: rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.display-headline {
    font-family: var(--f-display);
    font-weight: 800;
    font-size: clamp(56px, 9vw, 156px);
    line-height: 0.92;
    letter-spacing: -0.024em;
    color: var(--paper);
    max-width: 16ch;
    text-wrap: balance;
    text-shadow: 0 2px 24px rgba(10, 37, 64, 0.18);
}

.display-headline--md {
    font-size: clamp(40px, 6.4vw, 96px);
    color: var(--paper);
}

.display-headline--sm {
    font-size: clamp(32px, 5vw, 72px);
    color: var(--paper);
}

.display-headline em {
    font-style: italic;
    color: var(--foam);
    font-weight: 800;
}

.body-copy {
    font-family: var(--f-body);
    font-size: clamp(16px, 1.4vw, 20px);
    line-height: 1.65;
    color: var(--paper);
    max-width: 56ch;
    margin-top: 24px;
}

.body-copy em {
    font-style: italic;
    color: var(--foam);
}

.body-copy--small {
    font-size: clamp(14px, 1.1vw, 17px);
    opacity: 0.78;
}

.kicker {
    font-family: var(--f-hand);
    font-size: clamp(20px, 1.8vw, 28px);
    color: var(--ink-aside);
    margin-bottom: 16px;
    transform: rotate(-1.5deg);
    transform-origin: left center;
}

.hero-sub {
    font-family: var(--f-body);
    font-size: clamp(18px, 1.5vw, 22px);
    color: var(--paper);
    margin-top: 28px;
    max-width: 44ch;
    line-height: 1.5;
    font-weight: 400;
}

.hero-sub em {
    font-style: italic;
    color: var(--foam);
}

/* caveat asides — gutters */
.caveat-aside {
    position: absolute;
    font-family: var(--f-hand);
    font-size: clamp(18px, 1.7vw, 26px);
    color: var(--ink-aside);
    line-height: 1.2;
    transform: rotate(-3deg);
    pointer-events: none;
    z-index: 5;
    max-width: 22ch;
}

.caveat-aside::before {
    content: "";
    position: absolute;
    left: -28px;
    top: 14px;
    width: 22px;
    height: 2px;
    background: var(--ink-aside);
    border-radius: 2px;
    transform: rotate(-12deg);
    opacity: 0.7;
}

.caveat-aside--hero {
    right: clamp(24px, 6vw, 96px);
    bottom: 18%;
    color: var(--foam);
    transform: rotate(2deg);
}

.caveat-aside--hero::before {
    background: var(--foam);
}

.caveat-aside--ripple {
    right: 8%;
    top: 28%;
}

.caveat-aside--kelp {
    left: 6%;
    bottom: 12%;
    color: var(--kelp);
    transform: rotate(-6deg);
}

.caveat-aside--kelp::before {
    background: var(--kelp);
}

.caveat-aside--riddles {
    right: 8%;
    bottom: 8%;
    color: var(--foam);
}

.caveat-aside--riddles::before {
    background: var(--foam);
}

.caveat-aside--coda {
    left: 8%;
    bottom: 14%;
    color: var(--coral);
    transform: rotate(-2deg);
}

.caveat-aside--coda::before {
    background: var(--coral);
}

/* ============================================================
   hero pool
   ============================================================ */
.hero-pool {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 14vh;
    background:
        radial-gradient(ellipse 80% 60% at 65% 30%, rgba(168, 230, 240, 0.55) 0%, transparent 60%),
        linear-gradient(170deg, var(--sea-top) 0%, var(--sea-mid) 60%, var(--sea-deep) 100%);
}

.mega-blob {
    position: absolute;
    top: -10%;
    right: -10%;
    width: 90%;
    height: 110%;
    z-index: 0;
    filter: blur(28px) saturate(140%);
    opacity: 0.85;
    pointer-events: none;
}

.mid-blob {
    position: absolute;
    pointer-events: none;
    will-change: transform;
}

.mid-blob--a {
    top: 12%;
    left: 6%;
    width: clamp(180px, 22vw, 360px);
    animation: blob-spin 70s linear infinite;
    filter: blur(2px);
}

.mid-blob--b {
    bottom: 14%;
    right: 8%;
    width: clamp(220px, 28vw, 480px);
    animation: blob-spin-rev 90s linear infinite;
    filter: blur(1px);
}

.mid-blob--c {
    top: 60%;
    left: 30%;
    width: clamp(140px, 18vw, 260px);
    animation: blob-spin 110s linear infinite;
    filter: blur(3px);
}

.parallax-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    will-change: transform;
}

/* lens flares */
.lens-flare {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--foam);
    filter: blur(3px);
    pointer-events: none;
    mix-blend-mode: screen;
    z-index: 6;
}

.lens-flare--1 { top: 18%; left: 32%; animation: flare-pulse 4s ease-in-out infinite; }
.lens-flare--2 { top: 26%; left: 38%; width: 8px; height: 8px; animation: flare-pulse 5.2s ease-in-out 1s infinite; }
.lens-flare--3 { top: 14%; left: 44%; width: 20px; height: 20px; opacity: 0.7; animation: flare-pulse 6.1s ease-in-out 2s infinite; }

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.hero-content .display-headline {
    transform: rotate(-2.4deg);
    transition: transform 1.2s var(--ease-spring);
    transform-origin: left center;
}

.hero-content .display-headline.is-leveled {
    transform: rotate(0deg);
}

.scroll-cue {
    position: absolute;
    left: 0;
    bottom: -32px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--f-mono);
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--paper);
    opacity: 0.75;
    animation: scroll-cue-bob 2.6s ease-in-out infinite;
}

.scroll-cue-arrow {
    font-size: 18px;
    color: var(--foam);
}

@keyframes scroll-cue-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

@keyframes flare-pulse {
    0%, 100% { opacity: 0.65; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.4); }
}

@keyframes blob-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes blob-spin-rev {
    from { transform: rotate(0deg); }
    to { transform: rotate(-360deg); }
}

/* ============================================================
   ripple section
   ============================================================ */
.ripple-section {
    min-height: 140vh;
    background:
        linear-gradient(180deg, var(--sea-mid) 0%, var(--sea-deep) 100%);
    padding-top: 18vh;
}

.wave-path {
    position: absolute;
    top: 6vh;
    left: 0;
    width: 100%;
    height: 220px;
    pointer-events: none;
    opacity: 0.85;
}

.wave-text {
    font-family: var(--f-body);
    font-size: 18px;
    font-style: italic;
    fill: var(--foam);
    letter-spacing: 0.04em;
}

.ripple-content {
    position: relative;
    z-index: 10;
    max-width: 1200px;
    margin: 22vh auto 0;
    padding-left: 4vw;
    transform: rotate(-1.2deg);
}

.ripple-content .display-headline {
    transform: rotate(0.4deg);
    transform-origin: left center;
}

.mid-blob--divider {
    position: absolute;
    right: -4vw;
    bottom: -6vw;
    width: clamp(180px, 24vw, 320px);
    animation: blob-spin 90s linear infinite;
    pointer-events: none;
    opacity: 0.7;
}

/* tide-line dividers between sections */
.tide-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    pointer-events: none;
}

/* ============================================================
   kelp forest
   ============================================================ */
.kelp-forest {
    min-height: 180vh;
    background:
        linear-gradient(180deg, var(--sea-deep) 0%, #14516a 50%, var(--sea-deep) 100%);
    padding-top: 16vh;
}

.kelp-strands {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.kelp-strand {
    position: absolute;
    bottom: 0;
    width: 70px;
    height: 100%;
    background: linear-gradient(180deg,
        transparent 0%,
        rgba(127, 212, 193, 0.0) 5%,
        rgba(127, 212, 193, 0.35) 25%,
        rgba(46, 90, 140, 0.55) 100%);
    clip-path: polygon(45% 0%, 55% 0%, 70% 28%, 50% 55%, 70% 82%, 55% 100%, 45% 100%, 30% 82%, 50% 55%, 30% 28%);
    transform-origin: 50% 100%;
    mix-blend-mode: multiply;
    filter: blur(0.5px);
}

.kelp-strand--1 { left: 4%; animation: kelp-sway 6s ease-in-out infinite; opacity: 0.85; }
.kelp-strand--2 { left: 14%; height: 88%; animation: kelp-sway 6.8s ease-in-out -1s infinite; opacity: 0.7; }
.kelp-strand--3 { left: 24%; height: 96%; animation: kelp-sway-rev 7.2s ease-in-out -2s infinite; opacity: 0.78; }
.kelp-strand--4 { left: 34%; height: 84%; animation: kelp-sway 6.4s ease-in-out -0.5s infinite; opacity: 0.65; }
.kelp-strand--5 { right: 30%; height: 92%; animation: kelp-sway-rev 7s ease-in-out -1.5s infinite; opacity: 0.75; }
.kelp-strand--6 { right: 20%; height: 100%; animation: kelp-sway 6.6s ease-in-out -3s infinite; opacity: 0.85; }
.kelp-strand--7 { right: 10%; height: 86%; animation: kelp-sway-rev 6.9s ease-in-out -0.8s infinite; opacity: 0.7; }
.kelp-strand--8 { right: 2%; height: 94%; animation: kelp-sway 7.3s ease-in-out -2.5s infinite; opacity: 0.78; }

@keyframes kelp-sway {
    0%, 100% { transform: translateX(0) skewX(0deg); }
    50% { transform: translateX(3px) skewX(1.2deg); }
}

@keyframes kelp-sway-rev {
    0%, 100% { transform: translateX(0) skewX(0deg); }
    50% { transform: translateX(-3px) skewX(-1.2deg); }
}

.caustics {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    mix-blend-mode: screen;
}

.caustics svg {
    width: 100%;
    height: 100%;
}

.kelp-content {
    position: relative;
    z-index: 10;
    max-width: 1200px;
    margin: 12vh auto 0;
}

.kelp-content .display-headline {
    transform: rotate(-1.8deg);
    transform-origin: left center;
    margin-bottom: 8vh;
}

.kelp-fish {
    position: relative;
    max-width: 48ch;
    padding: 22px 28px;
    margin: 8vh 0;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px) saturate(150%);
    -webkit-backdrop-filter: blur(10px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 22px;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.4) inset,
        0 12px 32px rgba(10, 37, 64, 0.28);
}

.kelp-fish--1 {
    margin-left: 8vw;
    transform: rotate(-1.2deg);
}

.kelp-fish--2 {
    margin-left: auto;
    margin-right: 6vw;
    transform: rotate(1.4deg);
}

.kelp-fish .body-copy {
    margin-top: 0;
}

/* ============================================================
   bubble drift
   ============================================================ */
.bubble-drift {
    min-height: 120vh;
    background:
        radial-gradient(ellipse 80% 60% at 50% 80%, rgba(95, 184, 214, 0.3) 0%, transparent 70%),
        linear-gradient(180deg, var(--sea-deep) 0%, #16526b 60%, var(--sea-deep) 100%);
    padding-top: 14vh;
    padding-bottom: 14vh;
}

.bubble-drift-content {
    position: relative;
    z-index: 10;
    max-width: 1200px;
    margin: 0 auto 6vh;
    text-align: center;
}

.bubble-drift-content .section-label {
    margin-left: auto;
    margin-right: auto;
}

.bubble-drift-content .display-headline {
    margin-left: auto;
    margin-right: auto;
    max-width: 20ch;
}

.bubble-drift-content .body-copy {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.bubble-field {
    position: relative;
    z-index: 5;
    height: 70vh;
    max-width: 1200px;
    margin: 0 auto;
}

.bubble {
    position: absolute;
    width: clamp(80px, 12vw, 160px);
    height: clamp(80px, 12vw, 160px);
    display: flex;
    align-items: center;
    justify-content: center;
    will-change: transform, opacity;
    transition: transform 0.3s var(--ease-spring),
        opacity 0.3s ease;
    filter: drop-shadow(0 8px 24px rgba(10, 37, 64, 0.3));
}

.bubble svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.bubble svg circle {
    filter: drop-shadow(0 0 12px rgba(255, 232, 163, 0.45));
}

.bubble::before {
    /* chromatic aberration rim — offset highlight */
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.85) 0%, transparent 16%),
        radial-gradient(circle at 70% 80%, rgba(255, 232, 163, 0.5) 0%, transparent 22%);
    mix-blend-mode: screen;
    pointer-events: none;
}

.bubble::after {
    /* offset rim */
    content: "";
    position: absolute;
    inset: 1px -1px -1px 1px;
    border-radius: 50%;
    border: 1px solid rgba(255, 232, 163, 0.4);
    mix-blend-mode: screen;
    pointer-events: none;
}

.bubble-text {
    position: relative;
    z-index: 2;
    font-family: var(--f-display);
    font-weight: 700;
    font-size: clamp(16px, 1.8vw, 24px);
    color: var(--ink);
    letter-spacing: -0.02em;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

.bubble--right .bubble-text {
    color: var(--paper);
    text-shadow: 0 1px 8px rgba(10, 37, 64, 0.5);
}

.bubble.is-popping {
    animation: bubble-pop 0.32s var(--ease-spring) forwards;
}

@keyframes bubble-pop {
    0% { transform: translate(var(--bx, 0), var(--by, 0)) scale(1); opacity: 1; }
    40% { transform: translate(var(--bx, 0), var(--by, 0)) scale(1.18); opacity: 1; }
    100% { transform: translate(var(--bx, 0), var(--by, 0)) scale(0); opacity: 0; }
}

.bubble.is-winner {
    animation: bubble-winner 1.2s var(--ease-spring) infinite alternate;
}

@keyframes bubble-winner {
    0% { transform: translate(var(--bx, 0), var(--by, 0)) scale(1); }
    100% { transform: translate(var(--bx, 0), var(--by, 0)) scale(1.08); }
}

/* ============================================================
   riddles list (details/summary)
   ============================================================ */
.riddles-list {
    min-height: 100vh;
    background:
        linear-gradient(180deg, var(--sea-deep) 0%, #082238 100%);
    padding-top: 14vh;
    padding-bottom: 14vh;
}

.riddles-list-content {
    position: relative;
    z-index: 10;
    max-width: 1100px;
    margin: 0 auto;
}

.riddles-list-content .display-headline {
    margin-bottom: 6vh;
    transform: rotate(-1deg);
    transform-origin: left center;
}

.riddle {
    position: relative;
    margin: 22px 0;
    padding: 26px 32px;
    background: rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 28px;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.35) inset,
        0 12px 32px rgba(10, 37, 64, 0.28);
    transition: transform 0.5s var(--ease-spring),
        background 0.4s ease,
        border-color 0.4s ease;
    overflow: hidden;
}

.riddle[open] {
    background: rgba(255, 232, 163, 0.12);
    border-color: rgba(255, 232, 163, 0.45);
    transform: scale(1.012);
}

.riddle summary {
    cursor: pointer;
    list-style: none;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: baseline;
    gap: 18px;
}

.riddle summary::-webkit-details-marker { display: none; }
.riddle summary::marker { content: ""; }

.riddle-q-no {
    font-family: var(--f-mono);
    font-size: 14px;
    color: var(--coral);
    letter-spacing: 0.08em;
}

.riddle-q-text {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: clamp(20px, 2.2vw, 30px);
    color: var(--paper);
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.riddle-q-cue {
    font-family: var(--f-hand);
    font-size: 20px;
    color: var(--foam);
    transition: transform 0.4s var(--ease-spring);
}

.riddle[open] .riddle-q-cue {
    transform: rotate(90deg);
    color: var(--coral);
}

.riddle-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.7s var(--ease-out-quart);
}

.riddle[open] .riddle-answer {
    max-height: 360px;
}

.answer-display {
    font-family: var(--f-display-2);
    font-weight: 700;
    font-size: clamp(40px, 5vw, 80px);
    line-height: 1;
    color: var(--foam);
    margin-top: 22px;
    letter-spacing: 0.01em;
}

.answer-body {
    font-family: var(--f-body);
    font-size: 17px;
    color: var(--paper);
    opacity: 0.82;
    margin-top: 14px;
    max-width: 50ch;
}

/* ============================================================
   reveal section — big answer
   ============================================================ */
.reveal-section {
    min-height: 90vh;
    display: flex;
    align-items: center;
    background:
        radial-gradient(ellipse 60% 50% at 50% 50%, rgba(255, 123, 107, 0.18) 0%, transparent 60%),
        linear-gradient(180deg, #082238 0%, var(--abyss) 100%);
    padding: 16vh clamp(24px, 6vw, 96px);
}

.reveal-content {
    position: relative;
    z-index: 10;
    max-width: 1100px;
    margin: 0 auto;
    text-align: center;
}

.answer-display--xl {
    font-size: clamp(96px, 18vw, 280px);
    color: var(--foam);
    line-height: 0.9;
    margin: 32px auto;
    text-shadow:
        0 0 60px rgba(255, 232, 163, 0.4),
        0 8px 40px rgba(255, 123, 107, 0.4);
    letter-spacing: -0.02em;
}

.reveal-content .body-copy {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

/* ============================================================
   coda — final pool
   ============================================================ */
.coda {
    min-height: 90vh;
    background:
        linear-gradient(180deg, var(--abyss) 0%, #061829 60%, #04101d 100%);
    padding-top: 12vh;
    padding-bottom: 8vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.shoreline {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 28vh;
    pointer-events: none;
    z-index: 1;
}

.coda-content {
    position: relative;
    z-index: 10;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    padding-bottom: 16vh;
}

.coda-content .display-headline {
    margin-bottom: 24px;
}

.coda-content .body-copy {
    margin-left: auto;
    margin-right: auto;
}

.contact-pill {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    margin-top: 40px;
    padding: 18px 32px;
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    border: 1px solid rgba(255, 232, 163, 0.4);
    border-radius: 999px;
    color: var(--paper);
    text-decoration: none;
    font-family: var(--f-body);
    font-weight: 500;
    font-size: 18px;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.5) inset,
        0 12px 32px rgba(10, 37, 64, 0.4),
        0 0 0 1px rgba(255, 232, 163, 0.0);
    transition: transform 0.4s var(--ease-spring),
        box-shadow 0.4s ease,
        background 0.4s ease;
}

.contact-pill:hover {
    transform: translateY(-3px) scale(1.03);
    background: rgba(255, 232, 163, 0.25);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.6) inset,
        0 18px 48px rgba(10, 37, 64, 0.5),
        0 0 0 2px rgba(255, 232, 163, 0.6);
}

.contact-pill-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--coral);
    box-shadow: 0 0 12px var(--coral);
    animation: dot-pulse 2s ease-in-out infinite;
}

@keyframes dot-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.7; }
}

.contact-pill-arrow {
    color: var(--foam);
    transition: transform 0.3s ease;
}

.contact-pill:hover .contact-pill-arrow {
    transform: translateX(4px);
}

.footer {
    position: relative;
    z-index: 10;
    margin-top: auto;
    padding-top: 4vh;
    text-align: center;
}

.footer-line {
    font-family: var(--f-mono);
    font-size: 11px;
    color: var(--paper);
    opacity: 0.45;
    letter-spacing: 0.06em;
}

/* ============================================================
   cookie slip — corner caveat
   ============================================================ */
.cookie-slip {
    position: fixed;
    left: 28px;
    top: 28px;
    z-index: 180;
    max-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 18px;
    background: rgba(244, 225, 181, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(46, 90, 140, 0.3);
    border-radius: 14px;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.6) inset,
        0 8px 24px rgba(10, 37, 64, 0.22);
    transform: rotate(-2.4deg);
    transform-origin: top left;
    transition: opacity 0.5s ease,
        transform 0.5s var(--ease-spring);
}

.cookie-slip.is-hidden {
    opacity: 0;
    transform: rotate(-2.4deg) translateY(-20px) scale(0.9);
    pointer-events: none;
}

.cookie-slip-text {
    font-family: var(--f-hand);
    font-size: 16px;
    color: var(--ink);
    line-height: 1.3;
}

.cookie-slip-ok {
    align-self: flex-start;
    padding: 4px 14px;
    background: var(--ink);
    color: var(--paper);
    border: none;
    border-radius: 999px;
    font-family: var(--f-body);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
}

.cookie-slip-ok:hover {
    background: var(--coral);
}

/* ============================================================
   cursor blob
   ============================================================ */
.cursor-blob {
    position: fixed;
    top: 0;
    left: 0;
    width: 40px;
    height: 40px;
    pointer-events: none;
    z-index: 9999;
    transform: translate3d(-100px, -100px, 0);
    will-change: transform;
    mix-blend-mode: screen;
    transition: opacity 0.3s ease;
}

.cursor-blob svg {
    width: 100%;
    height: 100%;
    animation: cursor-morph 8s ease-in-out infinite;
    filter: drop-shadow(0 0 12px rgba(168, 230, 240, 0.7));
}

@keyframes cursor-morph {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.15) rotate(60deg); }
    50% { transform: scale(0.95) rotate(180deg); }
    75% { transform: scale(1.1) rotate(280deg); }
}

/* ============================================================
   reveal stagger animation (JS-driven via .is-visible)
   ============================================================ */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    filter: blur(6px);
    transition:
        opacity 0.72s var(--ease-out-quart),
        transform 0.72s var(--ease-out-quart),
        filter 0.72s var(--ease-out-quart);
}

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

/* word-by-word stagger spans (added by JS) */
.word {
    display: inline-block;
    opacity: 0;
    transform: translateY(24px);
    filter: blur(6px);
    transition:
        opacity 0.72s var(--ease-out-quart),
        transform 0.72s var(--ease-out-quart),
        filter 0.72s var(--ease-out-quart);
    transition-delay: calc(var(--word-i, 0) * 80ms);
    white-space: pre;
}

.word.is-visible {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

/* ============================================================
   responsive
   ============================================================ */
@media (max-width: 768px) {
    body { cursor: auto; }
    .cursor-blob { display: none; }
    .nav-pill { top: 16px; }
    .tide-clock { left: 16px; bottom: 16px; padding: 8px 10px; }
    .riddle-counter { right: 16px; bottom: 16px; padding: 8px 14px; }
    .cookie-slip { left: 16px; top: 16px; right: 16px; max-width: none; }
    .caveat-aside { position: relative; right: auto !important; left: auto !important; top: auto !important; bottom: auto !important; margin: 24px 0; }
    .caveat-aside::before { display: none; }
    .kelp-fish--1, .kelp-fish--2 { margin-left: 0; margin-right: 0; }
    .bubble-field { height: 60vh; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
