/* ==========================================================================
   The asteroid homepage. Loaded only by _layouts/world.html.
   #world[data-state] = loading | walk | seat | camp | fallback; #world[data-panel] = the open panel
   ========================================================================== */

.world-page { background: #05060f; color: #eef0fa; overflow: hidden; }
.world { position: relative; width: 100%; height: 100vh; height: 100dvh; overflow: hidden;
  --neon: #ff4fa3; --teal: #3ff5e8; --glass: rgb(14 16 36 / .78); --paper: #f7ecd4; --ink-dark: #2a160a;
  /* the tiki menu: the world's PALETTE (assets/js/world/materials.js) */
  --bamboo: #c9a66b; --bamboo-hi: #e2c890; --bamboo-node: #6b4a22; --lacquer: #4a2c1a; --coral: #e8634a; --glaze: #0f5e63; --lava: #1b1412; --ink-soft: #7a5a3c;
  --font-script: "Pacifico", "Brush Script MT", cursive; }
.world__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }

/* ---------- Loading veil: looks like the first frame, no buttons (HIG: Launching) ---------- */
.veil { position: absolute; inset: 0; z-index: 6; display: grid; place-content: center; justify-items: center; gap: 14px; background: #05060f; transition: opacity .7s; pointer-events: none; }
.veil__name { font: 700 1.4rem var(--font-display); color: #fff; letter-spacing: .01em; }
.veil__bar { width: 140px; height: 3px; border-radius: 3px; background: rgb(255 255 255 / .12); overflow: hidden; }
.veil__bar span { display: block; height: 100%; width: calc(var(--p, 0) * 100%); background: linear-gradient(90deg, var(--teal), var(--neon)); transition: width .3s; }
.veil.is-gone { opacity: 0; }
.veil[hidden] { display: none; }

/* ---------- Top bar: site ID + tagline (Krug: the big bang), sections always visible (Krug: persistent nav) ---------- */
.topbar { position: absolute; z-index: 7; inset: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; background: linear-gradient(rgb(5 6 15 / .7), rgb(5 6 15 / 0)); pointer-events: none; }
.topbar > * { pointer-events: auto; }
.topbar__id { display: grid; gap: 1px; color: #fff; text-decoration: none; line-height: 1.2; text-shadow: 0 1px 12px rgb(0 0 0 / .6); }
.topbar__id strong { font: 700 1.15rem var(--font-display); }
.topbar__id span { font-size: .85rem; color: #c3c8e6; }
.topbar__nav { display: flex; gap: 2px; padding: 4px; border-radius: 999px; background: rgb(14 16 36 / .6); backdrop-filter: blur(10px); border: 1px solid rgb(255 255 255 / .1); }
.topbar__nav a { color: #dfe2f5; text-decoration: none; font: 500 .9rem var(--font-body); white-space: nowrap; padding: 9px 14px; border-radius: 999px; min-height: 36px; display: inline-flex; align-items: center; }
.topbar__nav a:hover { background: rgb(255 255 255 / .1); color: #fff; }
.topbar__nav a[aria-current="page"] { background: #fff; color: #11132a; }
.topbar__menu { display: none; font: 600 .95rem var(--font-body); color: #fff; min-width: 44px; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid rgb(255 255 255 / .2); background: rgb(14 16 36 / .6); backdrop-filter: blur(10px); cursor: pointer; }
/* seven sections: below this they'd wrap, so the Menu button takes over */
@media (max-width: 1040px) {
  .topbar__nav { display: none; }
  .topbar__menu { display: inline-flex; align-items: center; }
}

/* ---------- Hints: one at a time, just in time ---------- */
.hint { position: absolute; z-index: 3; left: 50%; bottom: max(28px, env(safe-area-inset-bottom)); transform: translateX(-50%); margin: 0; padding: 10px 18px; border-radius: 999px; background: rgb(14 16 36 / .72); backdrop-filter: blur(10px); color: #fff; font: 500 .95rem var(--font-body); white-space: nowrap; border: 1px solid rgb(255 255 255 / .12); animation: rise .5s ease-out; pointer-events: none; }
.hint[hidden] { display: none; }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 8px); } }
@media (max-width: 480px) { .hint { white-space: normal; text-align: center; width: max-content; max-width: calc(100vw - 32px); } }

/* Cursor tooltip on hover (mouse only) */
.tip { position: fixed; z-index: 4; left: 0; top: 0; display: grid; gap: 1px; padding: 8px 12px; border-radius: 10px; background: #fff; color: #11132a; box-shadow: 0 8px 24px rgb(0 0 0 / .35); pointer-events: none; font-size: .85rem; }
.tip strong { font: 700 .95rem var(--font-body); }
.tip span { color: #4a4f72; }
.tip[hidden] { display: none; }

/* The bar's floating label: visible without hover, so touch users see it too */
.beacon { position: absolute; z-index: 2; left: 0; top: 0; padding: 8px 14px; margin: -48px 0 0; border-radius: 999px; background: #fff; color: #11132a; font: 600 .95rem var(--font-body); white-space: nowrap; box-shadow: 0 8px 24px rgb(0 0 0 / .35); translate: -50% 0; pointer-events: none; }
.beacon::after { content: ""; position: absolute; bottom: -6px; left: 50%; width: 12px; height: 12px; background: #fff; transform: translateX(-50%) rotate(45deg); }
.beacon[hidden] { display: none; }

.world__canvas.is-dragging { cursor: grabbing !important; }

/* ---------- Bartender speech ---------- */
.world__bubble { position: absolute; z-index: 3; left: 50%; top: 88px; transform: translateX(-50%); max-width: min(420px, 86vw); margin: 0; padding: 12px 16px; border-radius: 16px; background: #fff; color: #1a1b2e; font: 500 .95rem/1.4 var(--font-body); box-shadow: 0 10px 30px rgb(0 0 0 / .4); pointer-events: none; animation: rise-c .35s ease-out; }
.world__bubble::before { content: "🤖 "; }
.world[data-state="camp"] .world__bubble::before { content: "🔥 "; } /* at the fire it's you talking, not the robot */
.world__bubble[hidden] { display: none; }
@keyframes rise-c { from { opacity: 0; } }
@media (max-width: 760px) { .world[data-state="seat"] .world__bubble { display: none; } }

/* ---------- The menu: an old-school tiki menu (lashed bamboo frame, parchment, tapa band) ----------
   Plain labels to scan, one line each on what's there. Nothing decorative is text. */
.menu { position: absolute; z-index: 5; right: max(16px, 4vw); top: 84px; bottom: 16px; display: grid; align-items: center; pointer-events: none; }
.menu[hidden] { display: none; }
.menu__card { --pole: 12px; position: relative; pointer-events: auto; width: min(380px, calc(100vw - 32px)); max-height: 100%; display: flex; padding: var(--pole); border-radius: 6px;
  /* four bamboo poles: nodes along each, then round shading across it */
  background:
    linear-gradient(rgb(255 255 255 / .28), transparent 35%, rgb(0 0 0 / .3)) top / 100% var(--pole) no-repeat,
    linear-gradient(rgb(255 255 255 / .28), transparent 35%, rgb(0 0 0 / .3)) bottom / 100% var(--pole) no-repeat,
    linear-gradient(90deg, rgb(255 255 255 / .28), transparent 35%, rgb(0 0 0 / .3)) left / var(--pole) 100% no-repeat,
    linear-gradient(90deg, rgb(255 255 255 / .28), transparent 35%, rgb(0 0 0 / .3)) right / var(--pole) 100% no-repeat,
    repeating-linear-gradient(90deg, var(--bamboo) 0 62px, var(--bamboo-node) 62px 65px, var(--bamboo-hi) 65px 67px) top / 100% var(--pole) no-repeat,
    repeating-linear-gradient(90deg, var(--bamboo) 0 62px, var(--bamboo-node) 62px 65px, var(--bamboo-hi) 65px 67px) bottom / 100% var(--pole) no-repeat,
    repeating-linear-gradient(var(--bamboo) 0 62px, var(--bamboo-node) 62px 65px, var(--bamboo-hi) 65px 67px) left / var(--pole) 100% no-repeat,
    repeating-linear-gradient(var(--bamboo) 0 62px, var(--bamboo-node) 62px 65px, var(--bamboo-hi) 65px 67px) right / var(--pole) 100% no-repeat,
    var(--lacquer);
  box-shadow: 0 24px 60px rgb(0 0 0 / .55); animation: rise-c .3s ease-out; }
/* lashings where the poles cross */
.menu__card::before { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background:
    radial-gradient(circle, var(--lacquer) 0 5px, transparent 6px) 0 0 / 24px 24px no-repeat,
    radial-gradient(circle, var(--lacquer) 0 5px, transparent 6px) 100% 0 / 24px 24px no-repeat,
    radial-gradient(circle, var(--lacquer) 0 5px, transparent 6px) 0 100% / 24px 24px no-repeat,
    radial-gradient(circle, var(--lacquer) 0 5px, transparent 6px) 100% 100% / 24px 24px no-repeat; }
.menu__sheet { position: relative; flex: 1; min-width: 0; overflow-y: auto; padding: 18px 18px 14px; color: var(--ink-dark);
  background: radial-gradient(ellipse at 50% 30%, transparent 55%, rgb(122 80 30 / .16)), repeating-linear-gradient(90deg, transparent 0 3px, rgb(120 70 20 / .035) 3px 4px), var(--paper);
  outline: 2px solid var(--lacquer); outline-offset: -8px; }
.menu__close { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: none; color: var(--ink-soft); font-size: 1.6rem; cursor: pointer; z-index: 1; }
.menu__close:hover { background: rgb(232 99 74 / .12); color: var(--lacquer); }
.menu__head { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 2px 0 0; }
.menu__bar { margin: 0; font: 400 2.5rem/1.25 var(--font-script); color: var(--coral); text-shadow: 2px 2px 0 var(--lava); letter-spacing: .01em; }
.menu__tiki { width: 26px; height: 36px; flex: none; fill: var(--lacquer); }
.menu__tiki-cut { fill: var(--paper); }
.menu__tiki--flip { transform: scaleX(-1); }
/* tapa-cloth band under the name: coral zigzag between two dark rules */
.menu__title { position: relative; margin: 10px 0 8px; padding-top: 24px; font: italic 600 1.15rem var(--font-display); text-align: center; color: var(--lacquer); }
.menu__title::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 12px; border-block: 2px solid var(--lacquer);
  background: linear-gradient(135deg, var(--coral) 25%, transparent 25%) -4px 0 / 8px 8px repeat-x, linear-gradient(225deg, var(--coral) 25%, transparent 25%) -4px 0 / 8px 8px repeat-x; background-position: 0 1px; }
.menu__list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; }
.menu__list li + li { border-top: 1px dotted rgb(74 44 26 / .3); }
.menu__list a { display: grid; justify-items: center; gap: 1px; min-height: 44px; padding: 8px 10px; border-radius: 6px; color: var(--ink-dark); text-decoration: none; text-align: center; }
.menu__list a:hover, .menu__list a:focus-visible { background: rgb(232 99 74 / .12); }
.menu__list a:hover .menu__label, .menu__list a:focus-visible .menu__label { color: var(--coral); }
.menu__list a[aria-current="page"] { background: rgb(15 94 99 / .1); }
.menu__label { font: 800 1.02rem/1.25 var(--font-display); text-transform: uppercase; letter-spacing: .08em; color: var(--lacquer); }
.menu__note { font: italic .84rem/1.35 var(--font-display); color: var(--ink-soft); }
.menu__foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; padding-top: 10px; border-top: 2px solid var(--lacquer); font-size: .88rem; }
.menu__foot a { color: var(--ink-soft); }
.menu__leave { font: 600 .9rem var(--font-body); color: var(--paper); background: var(--lacquer); border: 0; border-radius: 999px; min-height: 44px; padding: 0 18px; cursor: pointer; }
.menu__leave:hover { background: var(--coral); }
.menu[data-mode="nav"] .menu__leave { display: none; }
/* only the no-WebGL menu links out (at the bar every item opens in place) */
.menu__ext { display: none; font-weight: 600; }
.world[data-state="fallback"] .menu__ext { display: inline; }
/* while the 3D card flies up to your hands, the HTML menu fades in over it */
.menu.is-arriving .menu__card { opacity: 0; animation: none; }
.menu__card { transition: opacity .18s; }
@media (max-width: 760px) {
  .menu { left: 12px; right: 12px; top: auto; bottom: 12px; max-height: calc(100dvh - 96px); }
  /* the sheet's height isn't definite here, so cap the card itself (short landscape phones) */
  .menu__card { width: 100%; max-height: calc(100dvh - 96px); }
  .menu__bar { font-size: 2.1rem; }
}

/* Seated with the menu down: a way out that doesn't need the menu (Esc works too) */
.seat-leave { position: absolute; z-index: 3; left: 16px; bottom: max(16px, env(safe-area-inset-bottom)); min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid rgb(255 255 255 / .2); background: rgb(14 16 36 / .6); backdrop-filter: blur(10px); color: #fff; font: 600 .9rem var(--font-body); cursor: pointer; }
.seat-leave:hover { background: rgb(14 16 36 / .85); }
.seat-leave[hidden] { display: none; }
.camp-eat { position: absolute; z-index: 3; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); min-height: 44px; min-width: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid rgb(255 255 255 / .25); background: rgb(14 16 36 / .6); backdrop-filter: blur(10px); color: #fff; font: 600 .9rem var(--font-body); cursor: pointer; }
.camp-eat:hover { background: rgb(14 16 36 / .85); }
.camp-eat[hidden] { display: none; }
.camp-eat.is-burning { border-color: var(--coral); }
.world[data-state="camp"] .hint { bottom: calc(max(16px, env(safe-area-inset-bottom)) + 60px); } /* above the fire's buttons */

/* ---------- Content panel ---------- */
.panel { position: absolute; z-index: 5; top: 76px; right: 16px; bottom: 16px; width: min(460px, calc(100vw - 32px)); overflow-y: auto; overscroll-behavior: contain;
  background: var(--glass); backdrop-filter: blur(16px) saturate(1.2); border: 1px solid rgb(255 255 255 / .14); border-radius: 20px; box-shadow: 0 20px 60px rgb(0 0 0 / .5);
  animation: slide-in .45s cubic-bezier(.2, .9, .3, 1);
  --ink: #eef0fa; --ink-2: #b4b9d6; --ink-3: #7c82a8; --line: #2a3060; --bg-2: #161a33; --card: rgb(22 26 51 / .9); --link: #ff9ccb; --accent: #ff4fa3; --accent-ink: #fff; --accent-soft: #3a1830; color: var(--ink); }
.panel[hidden] { display: none; }
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } }
.panel__bar { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; padding: 12px 12px 0 20px; }
.panel__back { font: 500 .9rem var(--font-body); color: var(--ink-2); background: none; border: 0; cursor: pointer; min-height: 44px; padding: 0 4px; }
.panel__back:hover { color: #fff; }
.panel__close { width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgb(255 255 255 / .2); background: rgb(0 0 0 / .3); color: #fff; font-size: 1.3rem; line-height: 1; cursor: pointer; }
.panel__close:hover { border-color: var(--neon); }
.panel__body { padding: 8px 28px 32px; }
.panel h2 { font-size: 2rem; }
.panel h3 { font-size: 1rem; margin-top: 1.4em; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.panel .kicker { color: var(--teal); }
.panel p { color: var(--ink-2); }
@media (max-width: 760px) {
  .panel { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 78dvh; border-radius: 20px 20px 0 0; animation-name: slide-up; }
  @keyframes slide-up { from { transform: translateY(60px); opacity: 0; } }
}

.panel__photo { float: right; width: 96px; height: 96px; border-radius: 50%; object-fit: cover; margin: 0 0 12px 16px; box-shadow: 5px 5px 0 var(--neon); }
.panel__timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: .92rem; color: var(--ink-2); }
.panel__timeline span { display: block; font: .75rem var(--font-mono); color: var(--ink-3); }
.panel__timeline strong { color: var(--ink); }
.panel__links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; clear: both; }
.panel__menu { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.panel__menu a { display: flex; align-items: baseline; gap: 8px; padding: 10px 0; color: var(--ink); text-decoration: none; font: 600 1.05rem/1.3 var(--font-display); }
.panel__menu a:hover span { color: var(--link); }
.panel__menu i { flex: 1; border-bottom: 2px dotted var(--ink-3); transform: translateY(-4px); min-width: 20px; }
.panel__menu time { font: .78rem var(--font-mono); color: var(--teal); white-space: nowrap; }
.panel__books { font-size: .95rem; }
.panel__books em { color: var(--ink); font-style: normal; }
.panel__lab { display: grid; gap: 12px; }
.panel__lab .lab-card { padding: 18px; }
.panel__lab .lab-card__emoji { font-size: 1.5rem; margin-bottom: 6px; }
.panel__contact { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.panel__contact a { display: block; padding: 12px 16px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 500; }
.panel__contact a:hover { border-color: var(--neon); }
.panel__likes { color: var(--ink); display: grid; gap: 6px; padding-left: 1.2em; }
.panel__receipt { position: relative; background: #f7f3e8; color: #2a2a2a; padding: 20px 18px 24px; font: .82rem/1.5 var(--font-mono); border-radius: 4px 4px 0 0; transform: rotate(-.6deg); box-shadow: 0 10px 30px rgb(0 0 0 / .4); margin-bottom: 20px; }
.panel__receipt::after { content: ""; position: absolute; left: 0; right: 0; bottom: -10px; height: 10px; background: linear-gradient(135deg, #f7f3e8 50%, transparent 50%) 0 0 / 14px 10px, linear-gradient(-135deg, #f7f3e8 50%, transparent 50%) 0 0 / 14px 10px; }
.panel__receipt p { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 6px; color: #2a2a2a; }
.panel__receipt-total { border-top: 1px dashed #999; padding-top: 8px; margin-top: 8px !important; font-weight: 600; }
.panel .card--launch { min-height: 220px; margin: 8px 0 16px; }

/* ---------- Fallback: no WebGL, the menu is the page ---------- */
.world[data-state="fallback"] { background: linear-gradient(rgb(5 6 15 / .55), rgb(5 6 15 / .85)), #05060f url("../images/outer_space-p-1600.jpeg") center / cover; }
.world[data-state="fallback"] .world__canvas { display: none; }
.world[data-state="fallback"] .menu { position: absolute; inset: 84px 0 16px; justify-content: center; }
.world[data-state="fallback"] .menu__close { display: none; }

/* Served at the bar: the panel pours open out of the mug's mouth (--ox/--oy, set by main.js) */
.panel.is-pouring { animation: pour-open .6s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes pour-open {
  from { clip-path: circle(0 at var(--ox, 50%) var(--oy, 100%)); opacity: .6; }
  to { clip-path: circle(150vmax at var(--ox, 50%) var(--oy, 100%)); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .menu__card, .panel, .panel.is-pouring, .hint, .world__bubble { animation: none; }
  .veil { transition: none; }
}
