/* The main menu, on one deep estate green: the house and the name, and under them a big glass Spawn In over a small
   pill made like the valley's viewpoint bar (Settings, Controls, About). Opening one of those grows the pill itself,
   downward, into a single pane holding it (nothing else on the page moves). Spawning in turns the lot into a loading
   line; when the valley is ready the menu lifts away. */
.menu { --menu-bg: #1f3a31;                              /* the menu's one colour */
  position: fixed; inset: 0; z-index: 8; overflow: hidden; overflow: clip; background: var(--menu-bg); color: var(--ink);
  transition: opacity 1.1s var(--glide), visibility 0s linear 0s; }
.menu.gone { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 1.1s var(--glide), visibility 0s linear 1.1s; }

/* (the column sits a little above the middle, leaving room below for the pane to grow into; if a small screen still
   hasn't room, the menu scrolls) */
.menu-main { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 40px; overflow-y: auto; touch-action: pan-y;
  padding: calc(env(safe-area-inset-top, 0px) + 32px) 16px calc(env(safe-area-inset-bottom, 0px) + 32px + min(18vh, 180px)); box-sizing: border-box; text-align: center; }
.menu-title .logo { display: block; width: 108px; height: auto; margin: 0 auto 18px; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.28)); animation: rise 1s var(--spring) 0.05s both; }
.menu-title h1 { margin: 0; font: 500 clamp(50px, 8.2vw, 112px)/0.98 var(--serif); letter-spacing: 0.002em; color: var(--ink); text-shadow: 0 0 1px rgba(6, 12, 26, 0.35), 0 2px 24px rgba(0, 0, 0, 0.2); }
.menu-title h1 .word { display: inline-block; white-space: nowrap; }
.menu-title h1 .ch { display: inline-block; animation: letterIn 1.3s var(--glide) both; animation-delay: calc(0.25s + var(--i) * 38ms); }
@keyframes letterIn { from { opacity: 0; transform: translateY(0.3em); filter: blur(6px); } 60% { filter: blur(0); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes riseIn { from { opacity: 0; translate: 0 14px; } }

/* Spawn In and the pill, and in their place once you've spawned, the loading line */
.menu-stage { display: grid; justify-items: center; width: 100%; }
.menu-choices, .menu-loading { grid-area: 1 / 1; transition: opacity 0.45s var(--glide), transform 0.6s var(--spring); }
.menu-choices { display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 100%;
  animation: riseIn 0.9s var(--spring) 0.85s backwards; }   /* (backwards: once in, the loading state can fade it) */
/* the menu's glass is the pill's own, whatever its size: its shading is held to its rims (a brighter top edge, a
   fainter bottom one) rather than stretched over the whole pane, so a tall pane reads as the same clear glass as the
   pill rather than as frosting */
.menu .glass { background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04) 25px, rgba(255, 255, 255, 0.04) calc(100% - 16px), rgba(255, 255, 255, 0.09)), var(--glass-tint, rgba(20, 28, 48, 0.1)); }
/* Spawn In: a big pane of that glass, as wide as the pill under it */
.menu .go { -webkit-appearance: none; appearance: none; margin: 0; display: inline-flex; align-items: center; justify-content: center; gap: 9px; width: var(--navw, auto); height: 56px; padding: 0 28px;
  box-sizing: border-box; border-radius: 999px; cursor: pointer; white-space: nowrap; font: 600 17px var(--ui); letter-spacing: -0.005em; color: var(--ink); -webkit-tap-highlight-color: transparent;
  transition: transform 0.35s var(--spring); }
.menu .go:hover { --glass-tint: rgba(255, 255, 255, 0.06); transform: scale(1.03); }
.menu .go:active { transform: scale(0.96); }
.menu .go svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.4s var(--spring); }
.menu .go:hover svg { transform: translateX(3px); }
/* the pill's place keeps the pill's size; the pane grows out of it, over whatever is below, into a pane just big
   enough for what's opened, the pill staying at its top */
.menu-dock { position: relative; z-index: 1; width: var(--navw, auto); height: var(--navh, auto); }
.menu .menu-panel { position: absolute; top: 0; left: 50%; translate: -50% 0; display: flex; flex-direction: column; align-items: center; box-sizing: border-box; overflow: hidden;
  width: var(--pw, max-content); height: var(--ph, auto); border-radius: var(--pr, 24px); transition: width 0.4s var(--shrink) 0.06s, height 0.44s var(--shrink) 0.06s, border-radius 0.44s var(--shrink) 0.06s; }
.menu .menu-panel.open { transition: width 0.5s var(--grow), height 0.56s var(--grow), border-radius 0.5s var(--grow); }
.menu-nav { flex: none; flex-wrap: nowrap; max-width: none; }
.menu-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; font: 500 12px var(--ui); letter-spacing: 0.02em; color: var(--ink-soft);
  opacity: 0; transform: translateY(6px); pointer-events: none; }
.menu-loading .stage { transition: opacity 0.25s var(--glide); animation: breathe 2.4s ease-in-out infinite; }
.menu-loading .stage.swap { opacity: 0; animation: none; }
@keyframes breathe { 50% { opacity: 0.55; } }
.progress { position: relative; width: 200px; height: 5px; border-radius: 6px; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.36); box-shadow: 0 1px 5px rgba(8, 16, 36, 0.22); background: rgba(255, 255, 255, 0.08); }
.progress i { position: absolute; inset: 0; border-radius: inherit; transform: scaleX(0); transform-origin: left; background: linear-gradient(90deg, rgba(255, 255, 255, 0.5), #fff); transition: transform 0.6s var(--glide); }
.menu[data-state="loading"] .menu-choices { opacity: 0; transform: scale(0.96); pointer-events: none; }
.menu[data-state="loading"] .menu-loading { opacity: 1; transform: none; }

/* what's opened: laid out at its full size under the pill from the start, so it's only uncovered as the pane grows
   (nothing reflows); it comes in just after the pane starts to open and leaves at once as it closes */
.menu-sheets { position: relative; flex: none; width: 0; height: 0; }
.menu .sheet { position: absolute; left: 0; top: 0; translate: -50% 0; width: max-content; max-width: calc(100vw - 34px); box-sizing: border-box; padding: 8px 18px 18px; text-align: left;
  opacity: 0; transform: translateY(-6px); visibility: hidden; pointer-events: none;
  transition: opacity 0.14s var(--glide), transform 0.2s var(--glide), visibility 0s linear 0.2s; }
.menu .sheet.show { opacity: 1; transform: none; visibility: visible; pointer-events: auto; transition: opacity 0.4s var(--glide) 0.12s, transform 0.55s var(--spring) 0.08s, visibility 0s; }
.menu .sheet[hidden] { display: block; }
.sheet-row { display: flex; align-items: center; gap: 14px; }
.sheet-row + .sheet-row { margin-top: 10px; }
.sheet-row > .hl { width: 104px; flex: none; }
/* the six hours and the six places sit in one row of six, or where there isn't room, two rows of three; the rows'
   pills end together, their words spread evenly */
.sheet-row > .seg { flex: 1; display: grid; grid-template-columns: repeat(6, auto); justify-content: normal; background: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12); }
.sheet-row > .seg .seg-item { justify-content: center; }
/* the day at one end, the sound at the other, mirrored */
.sheet-row.toggles { justify-content: space-between; gap: 28px; padding-top: 2px; }
.toggle { display: flex; align-items: center; gap: 12px; }
.toggle.end { flex-direction: row-reverse; }
.toggle.end .hl { align-items: flex-end; text-align: right; }
.sheet .keys { grid-template-columns: auto auto auto auto; gap: 10px 12px; padding: 4px 4px 2px; }
.sheet .keys dd { margin-right: 16px; }
.sheet .keys-touch { grid-template-columns: auto auto; }
.about { max-width: 34em; margin: 4px 6px; font: 500 13.5px/1.6 var(--ui); color: var(--ink-soft); }
.about a { color: var(--ink); text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.45); text-underline-offset: 3px; transition: text-decoration-color 0.2s; }
.about a:hover { text-decoration-color: var(--ink); }

@media (max-width: 700px) { .sheet-row > .seg { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) {
  .menu-main { gap: 32px; }
  .menu-title .logo { width: 84px; margin-bottom: 14px; }
  .menu-title h1 { font-size: clamp(42px, 12.5vw, 60px); }
  .seg.large .seg-item { padding: 8px 12px; font-size: 13px; }
  .menu .go { height: 52px; font-size: 16px; }
  .sheet-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .sheet-row > .hl { width: auto; }
  .sheet-row.toggles { flex-direction: row; justify-content: space-between; }
  .sheet .keys { grid-template-columns: auto 1fr; }
  .sheet .keys dd { margin-right: 0; }
}
@media (max-height: 560px) { .menu-main { gap: 22px; } .menu-title .logo { display: none; } .menu-title h1 { font-size: clamp(40px, 11vh, 72px); } }
