/* "First light, last look": dawn haze, teak ink, one film-orange accent. Minimal: one row of controls per mode. */
:root {
  --haze: #dce3e8; --paper: #f7f8f7; --glass: rgba(247, 248, 247, 0.92); --ink: #2e2620; --muted: #4a423c; --line: rgba(46, 38, 32, 0.14);
  --stamp: #ff6a13; --r: 12px;
  --ui: 'Atkinson Hyperlegible Next', system-ui, sans-serif; --serif: 'Literata', Georgia, serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --edge: max(16px, env(safe-area-inset-left)); --top: max(16px, env(safe-area-inset-top)); --bot: max(24px, env(safe-area-inset-bottom));
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--haze); font: 17px/1.5 var(--ui); color: var(--ink); }
main { position: fixed; inset: 0; }
#c { display: block; width: 100vw; height: 100vh; touch-action: none; }
[hidden] { display: none !important; }

button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.round { width: 44px; height: 44px; border-radius: 999px; background: var(--glass); display: grid; place-items: center; }
.round.outline { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }
.pill { min-height: 44px; padding: 0 18px; border-radius: 999px; background: var(--glass); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 16px; }
.pill.dark { background: var(--ink); color: var(--paper); }

/* Top: place name or close on the left, where you are in the middle, the menu on the right */
.top { position: fixed; top: var(--top); left: var(--edge); right: var(--edge); height: 44px; display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
.top > * { pointer-events: auto; }
.place-name { font: 500 16px/1.2 var(--serif); color: var(--ink); text-decoration: none; padding: 10px 0; }
.place-name:hover { text-decoration: underline; text-underline-offset: 3px; }
.where { position: absolute; left: 50%; transform: translateX(-50%); font: 500 16px/1.2 var(--serif); text-shadow: 0 0 12px rgba(247, 248, 247, 0.95), 0 0 2px rgba(247, 248, 247, 0.9); pointer-events: none; }
#btn-time { margin-left: auto; margin-right: 8px; }
#btn-lights { margin-left: auto; margin-right: 8px; }
#btn-lights:not([hidden]) + #btn-time { margin-left: 0; }
#btn-more { margin-left: 0; }
#btn-time:not([hidden]) + #btn-more { margin-left: 0; }
#btn-time[hidden] + #btn-more { margin-left: auto; }

/* Bottom: Rooms, then the three views */
.bottom { position: fixed; left: 0; right: 0; bottom: var(--bot); display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none; }
.bottom > * { pointer-events: auto; }
#btn-rooms { min-height: 40px; font-size: 15px; }
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 4px; background: var(--glass); border-radius: 999px; width: min(calc(100% - 32px), 400px); }
.seg button { min-height: 44px; border-radius: 999px; font-size: 16px; font-weight: 500; color: var(--muted); transition: background-color 0.2s var(--ease), color 0.2s var(--ease); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); font-weight: 600; }

/* Walkthrough: one slim bar */
.tourbar { position: fixed; left: var(--edge); right: var(--edge); bottom: var(--bot); max-width: 480px; margin: 0 auto; height: 60px; padding: 0 8px; border-radius: 999px; background: var(--glass); display: flex; align-items: center; gap: 8px; overflow: hidden; }
.tour-room { flex: 1; min-width: 0; text-align: left; padding: 8px 6px; font: 500 17px/1.2 var(--serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tour-room small { font: 400 14px var(--ui); color: var(--muted); margin-left: 6px; }
#btn-nextroom { min-height: 44px; padding: 0 16px; font-size: 15px; }
.progress { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--stamp); transform-origin: left; transform: scaleX(0); }
#btn-pause .i-play { display: none; }
#btn-pause[aria-pressed="true"] .i-pause { display: none; } #btn-pause[aria-pressed="true"] .i-play { display: inline; }

/* Sheets slide up from the bottom: welcome, menu, rooms */
dialog.sheet { position: fixed; inset: auto 0 0 0; margin: 0 auto; width: 100%; max-width: 480px; max-height: 85vh; border: 0; border-radius: 22px 22px 0 0; padding: 22px 22px calc(var(--bot) + 6px); background: var(--paper); color: var(--ink); box-shadow: 0 -12px 40px rgba(46, 38, 32, 0.16); }
dialog.sheet[open] { animation: sheet-up 0.32s var(--ease); }
dialog.sheet::backdrop { background: rgba(46, 38, 32, 0.12); }
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } }
@media (min-width: 640px) { dialog.sheet { bottom: 24px; border-radius: 22px; } }
.grab { width: 36px; height: 4px; border-radius: 999px; background: var(--line); margin: -8px auto 14px; }

.welcome h2 { margin: 2px 52px 8px 0; font: 500 27px/1.15 var(--serif); }
.welcome p { margin: 0 0 20px; color: var(--muted); }
.welcome .sound { position: absolute; top: 18px; right: 18px; background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }
.welcome .sound .waves, .welcome .sound[aria-pressed="false"] .waves { display: none; }
.welcome .sound[aria-pressed="true"] .waves { display: inline; } .welcome .sound[aria-pressed="true"] .mute { display: none; }
.big { width: 100%; min-height: 52px; border-radius: 999px; font-weight: 600; font-size: 17px; box-shadow: inset 0 0 0 1.5px var(--line); }
.big.dark { background: var(--ink); color: var(--paper); box-shadow: none; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.welcome .tip { margin: 18px 0 0; text-align: center; font-size: 15px; }

.menu .row { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 12px; min-height: 54px; border-bottom: 1px solid var(--line); font-size: 17px; text-align: left; color: var(--ink); text-decoration: none; }
.menu .link:hover { text-decoration: underline; text-underline-offset: 3px; }
.times { display: flex; gap: 2px; }
.times button { min-height: 36px; padding: 0 10px; border-radius: 999px; font-size: 14px; color: var(--muted); }
.times button[aria-pressed="true"] { background: var(--ink); color: var(--paper); font-weight: 600; }
.switch { width: 48px; height: 28px; border-radius: 999px; background: var(--line); position: relative; transition: background-color 0.2s var(--ease); }
.switch::after { content: ''; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 999px; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); transition: transform 0.2s var(--ease); }
.switch[aria-checked="true"] { background: var(--ink); } .switch[aria-checked="true"]::after { transform: translateX(20px); }
.credit { margin: 16px 0 0; font-size: 14px; color: var(--muted); }
.credit a { color: inherit; }
.credit + .credit { margin-top: 6px; font-size: 12px; }

.roomgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.roomgrid button { min-height: 52px; padding: 0 16px; border-radius: var(--r); text-align: left; font-weight: 600; box-shadow: inset 0 0 0 1.5px var(--line); }
.roomgrid button[aria-current="true"] { box-shadow: inset 0 0 0 2px var(--ink); }

/* Walk: aim dot, use button, joystick, a short first-time hint */
.aim { position: fixed; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; display: grid; place-items: center; pointer-events: none; }
.aim i { width: 6px; height: 6px; border-radius: 999px; background: var(--paper); box-shadow: 0 0 0 1.5px rgba(46, 38, 32, 0.55); transition: transform 0.2s var(--ease); }
.aim.on i { transform: scale(2); background: var(--stamp); box-shadow: none; }
.use { position: fixed; left: 50%; transform: translateX(-50%); top: calc(50% + 26px); min-height: 40px; font-size: 15px; }
.pad { position: fixed; left: 24px; bottom: calc(var(--bot) + 64px); width: 104px; height: 104px; border-radius: 999px; background: rgba(247, 248, 247, 0.18); border: 1.5px solid rgba(247, 248, 247, 0.85); display: grid; place-items: center; pointer-events: none; }
.pad span { width: 42px; height: 42px; border-radius: 999px; background: rgba(247, 248, 247, 0.92); }
.hint { position: fixed; left: 50%; transform: translateX(-50%); top: calc(var(--top) + 56px); max-width: min(90vw, 360px); padding: 10px 16px; background: var(--glass); border-radius: 999px; font-size: 15px; text-align: center; pointer-events: none; }
.skip { position: fixed; top: var(--top); right: var(--edge); background: transparent; }

/* Calm: after a few seconds untouched the controls fade, so only the place is left */
.top, .bottom, .tourbar, .pad, .hint { transition: opacity 0.6s var(--ease); }
body.idle .top, body.idle .bottom, body.idle .tourbar, body.idle .pad, body.idle .hint { opacity: 0.08; }

/* Controls ease in instead of popping */
@keyframes ui-in { from { opacity: 0; transform: translateY(6px); } }
.top > :not(.where), .bottom > *, .tourbar { animation: ui-in 0.45s var(--ease) both; }

@media (prefers-reduced-motion: reduce) { *, *::backdrop { transition: none !important; animation: none !important; } }
