/* =====================================================================
   journey.css - the guided first-run journey (js/journey.js)
   One step on screen at a time, full bleed, no nav. Everything is a
   theme.css token: soft card surfaces, hairline borders, ONE shadow, and
   the Cormorant / Quicksand voice the whole site speaks now.

   NOTE (Aug 2026): .jy-x -- the corner escape hatch -- is no longer
   rendered on a FIRST run. Journey._showSkip decides; the owner does not
   want the intro skippable before it has been seen. The styles stay
   because a REPLAY still gets it.
   ===================================================================== */

/* the journey owns the whole viewport: no nav, no header (header is
   hidden from portal.js the same way the picker does it) */
body[data-page="start"] #app-nav { display: none; }
body[data-page="start"] #app-content { padding: 0; }
body[data-page="start"] { --page-accent: var(--accent); --page-accent-deep: var(--accent-deep); }

.jy {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: max(18px, env(safe-area-inset-top)) var(--page-pad)
             max(18px, env(safe-area-inset-bottom));
    box-sizing: border-box;
    overflow: hidden;
}

/* art-deco-ish corner accents. Hairlines now, not 2px blush brackets --
   and .jy--vn hides them outright (css/vn.css), so in practice only the
   register-recovery interstitial ever shows them. */
.jy-corner {
    position: absolute;
    width: 24px; height: 24px;
    border: 1px solid var(--line);
    pointer-events: none;
    opacity: 1;
}
.jy-corner--tl { top: 10px;    left: 10px;  border-right: 0; border-bottom: 0; }
.jy-corner--tr { top: 10px;    right: 10px; border-left: 0;  border-bottom: 0; }
.jy-corner--bl { bottom: 10px; left: 10px;  border-right: 0; border-top: 0; }
.jy-corner--br { bottom: 10px; right: 10px; border-left: 0;  border-top: 0; }

.jy-scroll {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 8px 2px;
}
.jy-body { width: 100%; animation: rise .45s var(--ease) both; }

.jy-foot { flex: 0 0 auto; padding-top: var(--space-sm); }
.jy-foot .btn + .btn { margin-top: var(--space-sm); }

/* ---- heads and text ---- */
.jy-head { text-align: center; margin-bottom: var(--space-md); }
.jy-title {
    font-family: var(--serif);
    font-size: var(--text-2xl);
    line-height: 1.08;
    color: var(--ink);
    margin-top: 6px;
}
.jy-intro {
    font-family: var(--sans);
    font-size: var(--text-sm);
    line-height: 1.5;
    color: var(--ink-soft);
    margin-top: 8px;
}
.jy-fine {
    font-family: var(--sans);
    font-size: var(--text-xs);
    line-height: 1.5;
    color: var(--ink-mute);
    margin-top: 8px;
}
.jy-big {
    font-family: var(--serif);
    font-size: var(--text-3xl);
    line-height: 1.05;
    color: var(--accent-deep);
    margin: 6px 0 4px;
}

/* ---- cards ---- */
.jy-card {
    background: var(--card);
    border: var(--bw) solid var(--frame-ink);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    padding: var(--space-md);
    margin-top: var(--space-md);
    position: relative;
}
.jy-card--quiet { background: var(--card-2); text-align: center; }
.jy-card--moment { text-align: center; padding: var(--space-lg) var(--space-md); }
.jy-card--tour { text-align: center; }
.jy-card--moment .jy-deco { margin-bottom: 4px; }

.jy-kv {
    font-family: var(--serif);
    font-size: var(--px-xl);
    color: var(--ink);
    line-height: 1.3;
}
.jy-kv--sm { font-size: var(--px-md); color: var(--ink-soft); }

/* ---- mascot hero ---- */
.jy-hero {
    display: flex;
    gap: var(--space-sm);
    align-items: flex-end;
    justify-content: center;
    margin-bottom: 4px;
}
.jy-hero--float .mbox { animation: jy-bob var(--bob-dur) ease-in-out infinite; }
.jy-hero--float .mbox:last-child { animation-delay: .8s; }
@keyframes jy-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* ---- tour ---- */
.jy-tico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px; height: 54px;
    border: var(--bw) solid var(--frame-ink);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    margin-bottom: var(--space-md);
}
.jy-tico svg { width: 28px; height: 28px; }
.jy-peek { text-decoration: none; display: block; }
.jy-card--tour .stage-card { margin-top: var(--space-sm); }

/* ---- progress dots + skip ---- */
.jy-dots {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin: var(--space-md) 0 6px;
}
.jy-dot {
    width: 5px; height: 5px;
    border: 0;
    background: var(--line);
    border-radius: 50%;
}
.jy-dot.on { background: var(--rose); }

/* The escape hatch (round 3). It used to be a full-width "Skip to site" link
   along the bottom of every scene; the owner wanted that space back, so it is
   a small always-tappable × in the top corner instead. Still on EVERY scene --
   a first-visit guest has no nav to fall back on -- just out of the way.
   44px hit area on a 26px glyph, above the deco corner. */
.jy-x {
    position: absolute;
    top: max(6px, env(safe-area-inset-top));
    right: 6px;
    z-index: 8;
    width: 44px; height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--card) 78%, transparent);
    border: 1px solid var(--line);
    border-radius: 50%;
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1;
    color: var(--dim);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.jy-x:active { color: var(--accent-deep); }
.jy-x:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.jy-spin { display: flex; justify-content: center; padding: var(--space-lg) 0; }
.jy-hidden { display: none; }

/* the hosted join door drops its own top padding inside the step frame */
.jy [style*="padding-top:46px"] { padding-top: 0 !important; }

/* ---- confetti (light, CSS only, reduced-motion aware) ---- */
.jy-confetti {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}
.jy-confetti i {
    position: absolute;
    top: -14px;
    width: 8px; height: 12px;
    border-radius: 2px;
    animation-name: jy-fall;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}
@keyframes jy-fall {
    0%   { transform: translateY(-20px) rotate(0deg);    opacity: 0; }
    12%  { opacity: 1; }
    100% { transform: translateY(105vh) rotate(540deg);  opacity: .9; }
}

/* ---- resume banner (home only) ---- */
.jy-banner {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(var(--nav-height) + 10px);
    z-index: 60;
    width: min(calc(100vw - 24px), var(--content-max));
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 10px 12px;
    background: var(--card);
    border: var(--bw) solid var(--frame-ink);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    /* NOT the shared .rise animation: it ends on `transform: none`, which would
       wipe the translateX(-50%) that centres this and shove it off screen. */
    animation: jy-slide-up .45s var(--ease) both;
}
@keyframes jy-slide-up {
    from { transform: translateX(-50%) translateY(10px); opacity: 0; }
    to   { transform: translateX(-50%) translateY(0);    opacity: 1; }
}
body.dock-open .jy-banner { bottom: calc(var(--nav-height) + var(--dock-h) + 10px); }
.jy-bt {
    flex: 1 1 auto;
    font-family: var(--sans);
    font-weight: 600;
    font-size: var(--text-sm);
    line-height: 1.3;
    color: var(--ink);
}
.jy-bt em {
    display: block;
    font-style: normal;
    font-weight: 400;
    font-size: var(--text-xs);
    font-family: var(--sans);
    color: var(--dim);
}
.jy-bgo {
    flex: 0 0 auto;
    background: var(--rose);
    color: #fff;
    border: 0;
    border-radius: var(--radius-pill);
    box-shadow: none;
    padding: 11px 16px;
    min-height: 44px;
    font-family: var(--sans);
    font-weight: 600;
    font-size: var(--px-sm);
    cursor: pointer;
}
.jy-bgo:active { background: var(--accent-deep); }
.jy-bx {
    flex: 0 0 auto;
    background: none;
    border: 0;
    color: var(--dim);
    font-size: 15px;
    line-height: 1;
    padding: 12px;
    min-width: 44px; min-height: 44px;
    cursor: pointer;
}
.jy-bgo:focus-visible, .jy-bx:focus-visible { outline: 2px solid var(--rose); outline-offset: 2px; }

/* the auth retry banner shares the shell, warns in the accent tint */
.jy-banner--retry { border-color: color-mix(in srgb, var(--rose) 40%, var(--line)); }

@media (prefers-reduced-motion: reduce) {
    .jy-body { animation: none; }
    /* keep the centring transform even with the animation off */
    .jy-banner { animation-duration: .01s; }
    .jy-confetti { display: none; }
    .jy-hero--float .mbox { animation: none; }
}
