/* ─────────────────────────────────────────────────────────────
   Remnants — twilight + ember palette (matches the iOS app).
   ───────────────────────────────────────────────────────────── */

:root {
    --r-bg-base: #0d0a0c;
    --r-bg-surface: #1c1611;
    --r-bg-elevated: #2a201a;
    --r-accent: #d4a960;
    --r-accent-rgb: 212, 169, 96;
    --r-plum: #5a3a4a;
    --r-text-primary: #f1ead8;
    --r-text-secondary: #a89b85;
    --r-text-muted: #6f6555;
    --r-danger: #c25b4a;
    --r-success: #6c9460;
    --max-width: 1100px;
}

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

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

body {
    background: var(--r-bg-base);
    color: var(--r-text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Atmospheric backdrop — radial plum/accent washes that give the page depth. */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(var(--r-accent-rgb), 0.08), transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(90, 58, 74, 0.10), transparent 55%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 28px;
    position: relative;
    z-index: 1;
}

/* ─── Typography ────────────────────────────────────────────── */

.serif {
    font-family: 'Iowan Old Style', 'Times New Roman', Georgia, serif;
    font-style: italic;
    font-weight: 300;
    letter-spacing: -0.005em;
}

.mono {
    font-family: 'SF Mono', 'JetBrains Mono', Menlo, monospace;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 500;
    color: var(--r-text-secondary);
}

h1, h2, h3 {
    font-family: 'Iowan Old Style', 'Times New Roman', Georgia, serif;
    font-weight: 300;
    font-style: italic;
    color: var(--r-text-primary);
    line-height: 1.15;
}

h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }

p {
    color: var(--r-text-secondary);
    margin: 0 0 1em;
}

a {
    color: var(--r-accent);
    text-decoration: none;
    transition: opacity 180ms ease;
}

a:hover {
    opacity: 0.75;
}

/* ─── Nav ────────────────────────────────────────────────── */

.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(13, 10, 12, 0.78);
    backdrop-filter: saturate(180%) blur(18px);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    border-bottom: 1px solid rgba(var(--r-accent-rgb), 0.08);
}

.nav__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 28px;
    max-width: var(--max-width);
    margin: 0 auto;
}

.brandmark {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brandmark__name {
    font-family: 'Iowan Old Style', Georgia, serif;
    font-style: italic;
    font-weight: 300;
    font-size: 22px;
    color: var(--r-text-primary);
}

.brandmark__sub {
    font-family: 'SF Mono', Menlo, monospace;
    letter-spacing: 0.32em;
    font-size: 8px;
    font-weight: 500;
    color: rgba(var(--r-accent-rgb), 0.7);
    margin-top: 2px;
}

.nav__links {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav__links a {
    color: var(--r-text-secondary);
    font-size: 13px;
    font-weight: 500;
}

.nav__links a:hover {
    color: var(--r-accent);
    opacity: 1;
}

/* ─── Brushed brass CTA ────────────────────────────────────── */

.cta {
    display: inline-block;
    padding: 14px 28px;
    border-radius: 999px;
    color: var(--r-bg-base);
    font-size: 15px;
    font-weight: 600;
    background: linear-gradient(180deg, #e3b76a 0%, #c4944a 60%, #a07432 100%);
    border: 1px solid rgba(255, 255, 255, 0.24);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.32),
        inset 0 -1px 0 rgba(0, 0, 0, 0.32),
        0 12px 28px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(var(--r-accent-rgb), 0.18);
    transition: transform 180ms ease, opacity 180ms ease;
    cursor: pointer;
}

.cta:hover {
    transform: translateY(-1px);
    opacity: 1;
}

.cta:active {
    transform: translateY(1px);
}

.cta--ghost {
    background: transparent;
    color: var(--r-text-secondary);
    border: 1px solid rgba(var(--r-accent-rgb), 0.24);
    box-shadow: none;
}

.cta--ghost:hover {
    color: var(--r-accent);
}

/* ─── Hero ─────────────────────────────────────────────────── */

.hero {
    padding: clamp(80px, 12vw, 140px) 0 clamp(60px, 10vw, 100px);
    text-align: center;
    position: relative;
}

.hero__act {
    margin-bottom: 28px;
}

.hero__title {
    margin: 0 auto;
    max-width: 18ch;
}

.hero__sub {
    color: var(--r-text-secondary);
    font-size: clamp(15px, 1.6vw, 17px);
    margin: 28px auto 38px;
    max-width: 52ch;
    line-height: 1.6;
}

.hero__cta {
    display: inline-flex;
    gap: 14px;
    align-items: center;
}

/* Smoke orb — pure CSS, no JS. Mirrors the iOS Act I visual. */
.orb {
    width: 180px;
    height: 180px;
    margin: 0 auto 40px;
    position: relative;
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 50%,
            rgba(var(--r-accent-rgb), 0.85) 0%,
            #1a0e08 65%,
            #000 100%);
    box-shadow:
        0 0 80px rgba(var(--r-accent-rgb), 0.28),
        inset 0 0 24px rgba(0, 0, 0, 0.7);
    animation: orb-pulse 5s ease-in-out infinite;
}

.orb::before,
.orb::after {
    content: '';
    position: absolute;
    inset: -22%;
    border-radius: 50%;
    background: radial-gradient(circle, transparent 50%, rgba(var(--r-accent-rgb), 0.12) 60%, transparent 75%);
    animation: orb-halo 7s ease-in-out infinite;
}

.orb::after {
    animation-delay: -3s;
}

@keyframes orb-pulse {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.04); filter: brightness(1.12); }
}

@keyframes orb-halo {
    0%, 100% { opacity: 0.55; transform: scale(1); }
    50% { opacity: 0.9; transform: scale(1.08); }
}

/* ─── Section base ─────────────────────────────────────────── */

section {
    padding: clamp(60px, 10vw, 110px) 0;
    position: relative;
}

.section__head {
    text-align: center;
    margin-bottom: clamp(40px, 6vw, 70px);
}

.section__title {
    margin: 14px auto 0;
    max-width: 22ch;
}

/* ─── Feature cards ─────────────────────────────────────────── */

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.feature {
    background: var(--r-bg-surface);
    border: 1px solid rgba(var(--r-accent-rgb), 0.10);
    border-radius: 22px;
    padding: 28px 24px;
    transition: transform 240ms ease, border-color 240ms ease;
}

.feature:hover {
    transform: translateY(-2px);
    border-color: rgba(var(--r-accent-rgb), 0.28);
}

.feature__icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-bottom: 18px;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, #e3b76a 0%, #c4944a 60%, #a07432 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.32),
        0 6px 14px rgba(0, 0, 0, 0.42);
}

.feature__icon svg {
    width: 22px;
    height: 22px;
    fill: var(--r-bg-base);
}

.feature__title {
    margin-bottom: 8px;
}

.feature__body {
    font-size: 14px;
    color: var(--r-text-secondary);
    line-height: 1.6;
}

/* ─── Lore quote ────────────────────────────────────────────── */

.lore {
    text-align: center;
    padding: clamp(60px, 8vw, 100px) 0;
}

.lore__text {
    font-family: 'Iowan Old Style', Georgia, serif;
    font-style: italic;
    font-size: clamp(1.4rem, 3vw, 2.1rem);
    color: var(--r-text-primary);
    max-width: 28ch;
    margin: 0 auto;
    line-height: 1.35;
}

/* ─── Download / final CTA ─────────────────────────────────── */

.download {
    text-align: center;
    padding: clamp(60px, 10vw, 110px) 0 clamp(80px, 12vw, 140px);
}

.appstore-badge {
    display: inline-block;
    margin-top: 8px;
}

.appstore-badge img {
    height: 52px;
    width: auto;
}

/* ─── Footer ───────────────────────────────────────────────── */

.footer {
    border-top: 1px solid rgba(var(--r-accent-rgb), 0.10);
    padding: 32px 0 48px;
    color: var(--r-text-muted);
    font-size: 13px;
}

.footer__inner {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: space-between;
    align-items: center;
}

.footer a {
    color: var(--r-text-secondary);
    margin-right: 18px;
}

.footer a:hover {
    color: var(--r-accent);
}

/* ─── Legal pages (privacy, terms) ─────────────────────────── */

.legal {
    padding: 60px 0 100px;
    max-width: 760px;
    margin: 0 auto;
}

.legal h1 {
    margin-bottom: 8px;
}

.legal .updated {
    color: var(--r-text-muted);
    font-size: 13px;
    margin-bottom: 40px;
    letter-spacing: 0.04em;
}

.legal h2 {
    margin: 40px 0 14px;
    font-size: 1.5rem;
    color: var(--r-text-primary);
    font-style: italic;
}

.legal h3 {
    margin: 24px 0 10px;
    font-size: 1.05rem;
    color: var(--r-text-primary);
    font-style: italic;
    font-weight: 400;
}

.legal p,
.legal li {
    color: var(--r-text-secondary);
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 14px;
}

.legal ul {
    padding-left: 22px;
    margin-bottom: 18px;
}

.legal strong {
    color: var(--r-text-primary);
    font-weight: 600;
}

/* ─── Mobile tweaks ─────────────────────────────────────────── */

@media (max-width: 640px) {
    .nav__links { gap: 14px; }
    .nav__links a:not(.cta) { display: none; }
    .hero { padding-top: 60px; }
    .orb { width: 140px; height: 140px; }
    .hero__cta { flex-direction: column; gap: 10px; }
    .footer__inner { flex-direction: column; text-align: center; }
}

/* ═════════════════════════════════════════════════════════════════
   Site revamp — splash warp, scrolling orb, GSAP reveal sections,
   alternating feature blocks, Instagram Reels grid.
   ═════════════════════════════════════════════════════════════════ */

/* Hide the body until the warp finishes so we don't flash unstyled
   content. `warp-finished` is added by warp.js when the splash lifts. */
html:not(.warp-finished) body > *:not(.splash) {
    opacity: 0;
    transform: translateY(8px);
}
html.warp-finished body > *:not(.splash) {
    opacity: 1;
    transform: none;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

/* ── Splash warp ──────────────────────────────────────────────── */
.splash {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: var(--r-bg-base);
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.4s ease;
    overflow: hidden;
}
.splash.is-done {
    opacity: 0;
    pointer-events: none;
}
#warp-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}
.splash__mark {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--r-text-primary);
    pointer-events: none;
}
.splash__mark-word {
    font-family: 'Iowan Old Style', 'Times New Roman', Georgia, serif;
    font-style: italic;
    font-weight: 300;
    font-size: clamp(30px, 4.4vw, 44px);
    letter-spacing: 0.5px;
    opacity: 0;
    /* The warp itself is 3.0s. The wordmark fades up across the first
       1.2s, holds at low-intensity 0.7 opacity through the bulk of the
       warp, then fades out alongside the starfield's final 0.9s. No
       scale jolt, no flash. */
    animation: splash-wordmark 3.0s ease-out forwards;
    text-shadow: 0 0 18px rgba(var(--r-accent-rgb), 0.32);
}
@keyframes splash-wordmark {
    0%   { opacity: 0; }
    40%  { opacity: 0.7; }
    70%  { opacity: 0.7; }
    100% { opacity: 0; }
}

/* ── Floating orb that travels with scroll ─────────────────────── */
.orb {
    position: fixed;
    top: 0;
    left: 50%;
    width: 64px;
    height: 64px;
    transform: translate(-50%, -50%) scale(0);
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.4s ease;
}
html.warp-finished .orb { opacity: 1; }
.orb__glow {
    position: absolute;
    inset: -40px;
    background: radial-gradient(circle, rgba(var(--r-accent-rgb), 0.35) 0%, rgba(var(--r-accent-rgb), 0) 65%);
    border-radius: 50%;
    filter: blur(8px);
}
.orb__core {
    position: absolute;
    inset: 14px;
    background: radial-gradient(circle at 35% 30%, #fff5d8 0%, #d4a960 60%, #6e4a1a 100%);
    border-radius: 50%;
    box-shadow:
        inset 0 0 8px rgba(255, 244, 220, 0.4),
        0 0 18px rgba(var(--r-accent-rgb), 0.55);
}

/* Mobile: smaller orb, less in-the-way */
@media (max-width: 720px) {
    .orb { width: 36px; height: 36px; }
    .orb__glow { inset: -22px; }
    .orb__core { inset: 8px; }
}

/* ── Side rail (the SVG path the orb tracks against) ─────────── */
.rail {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100vh;
    z-index: 4;
    pointer-events: none;
    opacity: 0.5;
}
@media (max-width: 720px) { .rail { display: none; } }

/* ── Reveal helpers (initial state — GSAP animates from here) ── */
.reveal-word {
    display: inline-block;
    overflow: hidden;
    transform: translateY(0.3em);
    opacity: 0;
}
.fade-up {
    opacity: 0;
    transform: translateY(16px);
}
/* Fallback for users with no JS — show content immediately. */
.no-gsap .reveal-word,
.no-gsap .fade-up {
    opacity: 1;
    transform: none;
}

/* ── Hero tweaks ───────────────────────────────────────────────── */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding: 80px 0 40px;
}
.hero__title {
    font-size: clamp(40px, 7vw, 76px);
    font-weight: 300;
    line-height: 1.05;
    margin: 18px 0 22px;
    letter-spacing: -0.5px;
}
.hero__title .reveal-word {
    transform: translateY(0.6em);
    margin-right: 0.2em;
}

.hero__scroll-hint {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--r-text-muted);
    font-family: 'SF Mono', 'JetBrains Mono', Menlo, monospace;
    font-size: 10px;
    letter-spacing: 3px;
    opacity: 0;
    animation: hint-in 1s ease 1.6s forwards;
}
.hero__scroll-line {
    width: 0.5px;
    height: 36px;
    background: linear-gradient(to bottom, rgba(var(--r-accent-rgb), 0.7), transparent);
    animation: hint-pulse 2.2s ease-in-out infinite;
    transform-origin: top;
}
@keyframes hint-in    { to { opacity: 0.8; } }
@keyframes hint-pulse {
    0%, 100% { transform: scaleY(1); opacity: 0.7; }
    50%      { transform: scaleY(1.3); opacity: 1; }
}

/* ── Premise section ──────────────────────────────────────────── */
.lore {
    padding: 140px 0;
    text-align: center;
}
.lore__text {
    font-family: 'Iowan Old Style', 'Times New Roman', Georgia, serif;
    font-style: italic;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.35;
    color: var(--r-text-primary);
    margin: 22px auto;
    max-width: 760px;
    font-weight: 300;
}

/* ── Features intro head ──────────────────────────────────────── */
.features-section {
    padding: 60px 0;
}
.section__head {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 60px;
}
.section__title {
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 300;
    margin-top: 10px;
}

/* ── Feature blocks (alternating left/right) ──────────────────── */
.feature-block {
    padding: 100px 0;
}
.feature-block__container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}
.feature-block--left .feature-block__container {
    grid-template-areas: "body art";
}
.feature-block--right .feature-block__container {
    grid-template-areas: "art body";
}
.feature-block--left  .feature-block__body { grid-area: body; }
.feature-block--left  .feature-block__art  { grid-area: art;  }
.feature-block--right .feature-block__body { grid-area: body; }
.feature-block--right .feature-block__art  { grid-area: art;  }

.feature-block__art {
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
}
.feature-block__art svg {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 24px 48px rgba(0,0,0,0.45));
}

.kicker {
    color: var(--r-text-secondary);
    font-size: 11px;
    letter-spacing: 3px;
    margin-bottom: 14px;
}
.feature-block__title {
    font-size: clamp(32px, 4.4vw, 52px);
    font-weight: 300;
    font-style: italic;
    margin-bottom: 20px;
    color: var(--r-text-primary);
}
.feature-block__copy {
    font-size: 17px;
    color: var(--r-text-secondary);
    line-height: 1.65;
    max-width: 460px;
}
.feature-block__points {
    list-style: none;
    margin-top: 22px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.feature-block__points li {
    position: relative;
    padding-left: 22px;
    color: var(--r-text-primary);
    font-size: 14px;
}
.feature-block__points li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 9px;
    width: 12px;
    height: 0.5px;
    background: var(--r-accent);
}

@media (max-width: 820px) {
    .feature-block__container,
    .feature-block--left .feature-block__container,
    .feature-block--right .feature-block__container {
        grid-template-columns: 1fr;
        grid-template-areas: "art" "body";
        gap: 36px;
    }
    .feature-block__art { max-width: 280px; }
}

/* SVG animation hooks — paused until ScrollTrigger plays them */
.pulse-ring {
    transform-origin: center;
    animation: pulse-ring 2.4s ease-out infinite;
}
@keyframes pulse-ring {
    0%   { transform: scale(0.85); opacity: 0.8; }
    100% { transform: scale(1.6);  opacity: 0;   }
}
.sand-fall {
    stroke-dasharray: 4 4;
    animation: sand-fall 1.2s linear infinite;
}
@keyframes sand-fall {
    0%   { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: -16; }
}

/* ── Reels gallery ────────────────────────────────────────────── */
.reels {
    padding: 100px 0 80px;
}
.reels__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 22px;
    margin-top: 36px;
}
.reels__item {
    position: relative;
    background: var(--r-bg-surface);
    border-radius: 14px;
    overflow: hidden;
    border: 0.5px solid rgba(var(--r-accent-rgb), 0.18);
    aspect-ratio: 9 / 16;
    transition: transform 0.3s ease, border-color 0.3s ease;
}
.reels__item:hover {
    transform: translateY(-4px);
    border-color: rgba(var(--r-accent-rgb), 0.45);
}
.reels__item iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
.reels__item-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--r-text-muted);
    padding: 16px;
    font-style: italic;
    font-family: 'Iowan Old Style', serif;
}
.reels__footer {
    margin-top: 38px;
    color: var(--r-text-secondary);
    font-size: 14px;
    text-align: center;
}
.reels__footer a {
    color: var(--r-accent);
    text-decoration: none;
    border-bottom: 0.5px solid rgba(var(--r-accent-rgb), 0.4);
}
