/* ================================================================ landing (signed out)
   The world is the page: a sample world lives in a shulker box beside the two doors (an invite code,
   or the waitlist), a quiet mono caption row with its in-world day runs under it, and the block
   wordmark (wordmark.js) closes the first screen. Below: three plain steps, then the footer.
   Spacing steps: 8, 16, 24, 32, 48. */
:root {
  /* The wordmark is one big shulker box: a pale rim on top, the lid above a dark seam, the shell below,
     and a little loot inside. --wm-grass/dirt/stone keep their names for the block roles. */
  --wm-grass: #cba5dc; --wm-dirt: #a274b8; --wm-stone: #8a5ea1; --wm-seam: #3b2449; --wm-coal: #5b3a6e;
  --wm-iron: #5fd37e; --wm-gold: #f0c341; --wm-diamond: #5fe0d3; --wm-shirt: #e0674f; --wm-pants: #2f3a5a;
}
:root[data-theme="sunset"] { --wm-shirt: #3f7fc4; }
:root[data-theme="night"] { --wm-grass: #e2c6ee; --wm-dirt: #b98bcc; --wm-stone: #a57abb; --wm-seam: #2a1838; --wm-coal: #6d4a80; --wm-pants: #2a3150; }

/* First paint: theme.js sets data-view on <html> before any stylesheet loads, so the right view paints
   first; app.mjs render() keeps the final say. */
:root[data-view="landing"] .layout { display: block; max-width: none; padding: 0; }
:root[data-view="landing"] .layout > .stage, :root[data-view="landing"] .layout > .panel { display: none; }
:root[data-view="owner"] #landing { display: none; }
:root[data-view="landing"] #account-label { display: none; }
body[data-page="home"][data-view="welcome"] .topbar-right > .swatches { display: none; }
.lw { animation: none; }

.lw-first { display: flex; flex-direction: column; }
.lw-hero {
  flex: 1 0 auto; position: relative; display: grid; grid-template-columns: minmax(360px, 590px) minmax(0, 1fr);
  max-width: var(--maxw); width: 100%; margin: 0 auto; padding: 0 var(--gutter); min-height: 0;
}
.lw-copy { position: relative; z-index: 2; padding-top: clamp(8px, 3.5vh, 44px); padding-bottom: 16px; }
.lw-title {
  font: 800 clamp(2.5rem, 3.9vw, 4rem)/.96 var(--font-display); letter-spacing: -.048em;
  max-width: 12ch; text-wrap: balance;
}
.lw-lede { margin-top: 18px; font-size: 18px; line-height: 1.5; color: var(--ink-2); max-width: 31em; text-wrap: pretty; }
.lw .banner { margin-top: 22px; }

.lw-kicker, .lw-cap, .lw-sample, .lw-drag {
  font-family: var(--font-mono); font-weight: 500; letter-spacing: .06em; text-transform: uppercase;
}
/* The two doors: an invite code (primary) or the waitlist (secondary), one column of one width. */
.lw-door, .lw-copy > .lw-waitlist, #landing-account { max-width: 520px; }
.lw-door { margin-top: 32px; }
.lw-invite .label { margin-bottom: 8px; }
.lw-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: start; }
.lw-row .btn { height: 48px; padding-inline: 24px; }
.lw-msg { margin-top: 8px; font-size: 14px; color: var(--danger); }
.lw-msg:empty { display: none; }
.lw-alt { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); }
.lw-alt p { margin: 0; font-size: 15px; color: var(--ink-2); }
.lw-alt .btn { height: 44px; }
#landing[data-door="waitlist"] .lw-alt, #landing[data-door="account"] .lw-alt { display: none; }
#landing:not([data-door="waitlist"]) #waitlist { display: none; }
#landing:not([data-door="account"]) #app > .welcome { display: none; }
#landing #app > .loading-note, #landing .swatches { display: none; }

/* The world: no frame. A soft disc of whatever sky the sample world is in sits behind it. It supports the copy
   (founder, 2026-10-03: "why does the graphic take up 70% of the page"): at most a third of the screen's height. */
.lw-world { position: relative; align-self: center; height: min(34vh, 320px); min-height: 220px; margin-right: calc(-1 * var(--gutter)); margin-left: -4%; }
.lw-halo {
  position: absolute; inset: 0 4% 0 6%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--sky-top, #9fd3f3) 62%, transparent) 0%,
    color-mix(in srgb, var(--sky-bottom, #eaf5fa) 45%, transparent) 58%, transparent 100%);
  opacity: .9; pointer-events: none;
}
.lw-world[data-night="true"] .lw-halo { opacity: 1; }
.lw-slot { position: absolute; inset: 0;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 9%, #000 93%, transparent 100%), linear-gradient(180deg, transparent 0, #000 12%, #000 92%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent 0, #000 9%, #000 93%, transparent 100%), linear-gradient(180deg, transparent 0, #000 12%, #000 92%, transparent 100%);
  mask-composite: intersect; }
.lw-slot canvas { display: block; width: 100%; height: 100%; outline: none; }
.lw-drag { position: absolute; right: calc(var(--gutter) + 4px); top: 6px; margin: 0; font-size: 10.5px; color: var(--ink-3); transition: opacity .6s; pointer-events: none; }
.lw-world.touched .lw-drag, .lw-world[data-replay="none"] .lw-drag, .lw-world[data-replay="fallback"] .lw-drag { opacity: 0; }

/* The caption row: one quiet mono line, the in-world day on the left. */
.lw-cap {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 28px;
  max-width: var(--maxw); width: 100%; margin: 0 auto; padding: 14px var(--gutter) 10px;
  font-size: 11px; color: var(--ink-2);
}
.lw-cap p { margin: 0; display: flex; align-items: center; gap: 0; white-space: nowrap; min-width: 0; }
.lw-cap-l #lw-day { color: var(--ink); font-weight: 600; }
.lw-dot { margin: 0 9px; color: var(--ink-3); }
.lw-cap-r { gap: 18px !important; }
.lw-cap-r button { font: inherit; letter-spacing: inherit; text-transform: inherit; color: var(--ink-2); background: none; border: 0; border-bottom: 1px solid transparent; padding: 2px 0; cursor: pointer; }
.lw-cap-r button:hover, .lw-cap-r button:focus-visible { color: var(--ink); border-color: var(--ink); }
.lw-sample { font-size: 10px; color: var(--ink-3); border: 1px dashed var(--line-3); border-radius: 999px; padding: 3px 8px; }

.lw-word-wrap { display: flex; flex-direction: column; width: min(100%, 760px); margin: 8px auto 0; }
.lw-word { width: 100%; }
.wm canvas { display: block; width: 100%; touch-action: pan-y; -webkit-user-select: none; user-select: none; }

/* Below the first screen. */
.lw-more { padding-bottom: 48px; }
.lw-band { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 72px; align-items: start; padding-top: 96px; }
.lw-band-head { position: sticky; top: 40px; }
.lw-kicker { font-size: 11px; color: var(--accent-ink); }
.lw-h2 { margin-top: 14px; font: 800 clamp(2.1rem, 3.8vw, 3.6rem)/1 var(--font-display); letter-spacing: -.045em; text-wrap: balance; }

/* How it works: three plain numbered lines. */
.lw-steps { list-style: none; margin: 0; padding: 8px 0 0; counter-reset: step; display: grid; gap: 18px; max-width: 620px; }
.lw-steps li { counter-increment: step; display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: baseline; font-size: 20px; line-height: 1.4; }
.lw-steps li::before { content: counter(step); font: 600 13px var(--font-mono); color: var(--accent-ink); }

@media (max-width: 900px), (max-height: 640px) {
  .lw-first { height: auto; min-height: 0; max-height: none; }
  .lw-hero { grid-template-columns: minmax(0, 1fr); padding: 0 16px; min-height: 0; }
  .lw-copy { padding: 8px 0 8px; }
  .lw-title { font-size: clamp(2.35rem, 10.5vw, 3.4rem); }
  .lw-lede { font-size: 16.5px; margin-top: 14px; }
  .lw-steps li { font-size: 17px; grid-template-columns: 32px minmax(0, 1fr); }
  .lw-door { margin-top: 20px; }
  .lw-copy .welcome { margin-top: 16px; }
  .lw-row .btn { padding-inline: 16px; }
  .lw-world { height: min(42vw, 180px); min-height: 0; margin: 0 -16px; }
  .lw-drag { right: 16px; top: auto; bottom: 6px; }
  .lw-cap { gap: 6px 16px; padding: 8px 16px 6px; font-size: 10.5px; }
  .lw-cap-r { gap: 12px !important; }
  .lw-band { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 64px; }
  .lw-band-head { position: static; }
}

:root { --maxw: 1440px; --gutter: clamp(20px,4vw,64px); }
#landing[hidden] { display: none; }
.lw-copy > .panel { padding: 0; width: 100%; }
.lw-copy .intro { display: none; }
.lw-copy .welcome { margin-top: 24px; }
/* Signed out, the footer closes the page under the steps. */
.lw-foot { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter) 32px; }
.lw-foot .owner-footer { margin-top: 0; padding-top: 24px; border-top: 1px solid var(--line); }
.lw-signin { border: 0; padding: 0; background: none; cursor: pointer; }
#auth-status:empty { display: none; }
/* "Sign in" (header or hero) points at the login card: a static outline for 1.2 s, with a pulse when motion is allowed. */
.signin-pulse { outline: 3px solid var(--focus); outline-offset: 4px; animation: signin-pulse 1.2s ease-out; }
@keyframes signin-pulse { from { box-shadow: 0 0 0 14px var(--focus-ring); background: var(--accent-soft); } }
.lw-sample { display: inline-block !important; }
#landing .bs-replay { width:100%;height:100%; }

/* The wordmark's pause sits under it, in the caption row's quiet mono voice. */
#wordmark-motion { align-self: flex-end; margin: 8px var(--gutter) 0; border: 0; border-bottom: 1px solid transparent; background: none; color: var(--ink-3); padding: 4px 0; font: 500 11px var(--font-mono); letter-spacing: .06em; text-transform: uppercase; cursor: pointer; }
#wordmark-motion:hover, #wordmark-motion:focus-visible { color: var(--ink); border-color: var(--ink); }

/* The SVG fallback uses external styles under the sealed script/style CSP. */
.bs-replay-fallback svg { width: 100%; height: 100%; display: block; }

/* Decorative texture must not introduce a data-image source under img-src self. */
body .stage-sky::after, body .sky::after { background-image: repeating-radial-gradient(circle at 17% 31%, var(--ink) 0 .5px, transparent .75px 1.5px); background-size: 7px 11px; opacity: .015; }

/* Sign-in card: Continue with Google spans the form like the primary button, mark before the words. */
#app .google { display: flex; align-items: center; justify-content: center; gap: 10px; }
#app .google svg { flex-shrink: 0; }
/* An account without an invite pastes its link on its own row of the Create form. */
.create-card form .invite-field { grid-column: 1 / -1; }

/* The waitlist: a card under the hero lede, signed out only. */
.card.lw-waitlist { margin-top: 24px; padding: 24px; }
.lw-wl-fields { display: grid; gap: 14px; }
.lw-wl-intro { color: var(--ink-2); font-size: 15px; line-height: 1.5; margin-top: -6px; }
.lw-waitlist .label { margin: 0; }
.lw-waitlist [hidden] { display: none; }
.lw-waitlist .label > input { margin-top: 8px; }
.lw-wl-play { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.lw-wl-play legend { padding: 0; margin-bottom: 8px; }
.lw-wl-play label { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border: 1.5px solid var(--line-2); border-radius: 999px; background: var(--surface-3); font-size: 15px; cursor: pointer; }
.lw-wl-play label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.lw-wl-play label:has(input:focus-visible) { box-shadow: 0 0 0 4px var(--focus-ring); }
.lw-wl-play input { accent-color: var(--accent); margin: 0; }
.lw-waitlist .btn { justify-self: start; }
.lw-wl-status:empty { display: none; }
.lw-wl-status { margin-top: 14px; font-size: 15px; color: var(--ink-2); }
.lw-waitlist[data-state="done"] .lw-wl-fields { display: none; }
.lw-waitlist[data-state="done"] .lw-wl-status { margin-top: 0; font-weight: 600; color: var(--ink); }
.lw-waitlist[data-state="error"] .lw-wl-status { color: var(--danger); }
.lw-waitlist .lw-wl-privacy { margin-top: 12px; font-size: 12.5px; }
@media (max-width: 560px) {
  .card.lw-waitlist { padding: 16px; }
  .lw-waitlist .btn, .lw-alt .btn { justify-self: stretch; width: 100%; }
}

/* A changed release (app.mjs) on a tab that should not reload by itself. */
.update-note { position: fixed; z-index: 50; left: 50%; bottom: 16px; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); margin: 0; padding: 10px 16px; border-radius: 999px; background: var(--toast-bg); color: var(--toast-ink); font-size: 14px; box-shadow: var(--shadow-pop); }
.update-note .text-link { color: inherit; background: none; border: 0; padding: 0; font: inherit; font-weight: 600; cursor: pointer; }
