/* Shared site chrome: one control grammar across all three scenes. */
.site-mark { position:fixed; z-index:100; left:max(20px,env(safe-area-inset-left)); top:calc(6px + env(safe-area-inset-top)); min-height:var(--site-touch-target); padding:10px 0; color:#fff8e4; font:25px/1 var(--hand); text-decoration:none; text-shadow:0 1px 3px #2a1b11,var(--chrome-mark-shadow,0 1px 4px #174f9270); background:var(--chrome-mark-bg,transparent); border-radius:8px; box-shadow:var(--chrome-halo,none); }
.site-mark-dot { display:inline-block; width:.13em; height:.13em; margin:0 .015em .02em; overflow:hidden; border-radius:50%; background:#fff8e4; color:transparent; font-size:1em; line-height:0; }

/* Quiet, persistent access to the three compositions. */
.view-switcher { position:fixed; z-index:100; left:max(13px,env(safe-area-inset-left)); top:calc(56px + env(safe-area-inset-top)); display:flex; gap:0; padding:var(--chrome-nav-padding,0); color:var(--chrome-ink,#fff8e4); background:var(--chrome-nav-bg,#17223773); border-radius:8px; box-shadow:var(--chrome-halo,none); backdrop-filter:blur(3px); -webkit-backdrop-filter:blur(3px); }
.site-menu { display:flex; }
.site-menu-toggle,.view-name,.sound-label,.sound-state { display:none; }
.view-switcher a { display:grid; place-items:center; width:var(--site-touch-target); height:var(--site-touch-target); color:inherit; opacity:var(--chrome-icon-opacity,.72); border-radius:4px; transition:opacity var(--site-control-motion),background var(--site-control-motion); }
.view-switcher svg { width:18px; height:18px; filter:var(--chrome-icon-shadow,none); }
.view-switcher a[aria-current="page"] { opacity:var(--chrome-current-opacity,1); }
.view-switcher a:hover,.view-switcher a:focus-visible { opacity:1; background:#ffffff18; }
.view-switcher a:focus-visible { outline:1px solid currentColor; outline-offset:1px; }
/* First-load nudge: a slow double-pulse that settles back to the resting icons. */
.view-switcher.attention a { animation:view-switch-attention 4.36s ease-in-out both; }
.view-switcher.attention a:nth-child(2) { animation-delay:.32s; }
.view-switcher.attention a:nth-child(3) { animation-delay:.64s; }
@keyframes view-switch-attention {
  0%,100% { transform:scale(1); background:transparent; box-shadow:none; }
  22%,58% { transform:scale(1.16); background:#fff6d92e; box-shadow:0 0 12px 3px #ffedb873; }
  40% { transform:scale(1.05); background:#fff6d914; box-shadow:0 0 4px 1px #ffedb82e; }
}
@media(prefers-reduced-motion:reduce) { .view-switcher a { transition:none; } .view-switcher.attention a { animation:none; background:#fff6d92e; box-shadow:0 0 8px 2px #ffedb873; } }


/* SFX-only speaker toggle, riding with the view switcher. */
.sound-toggle { display:grid; place-items:center; width:var(--site-touch-target); height:var(--site-touch-target); padding:0; color:inherit; opacity:.72; background:none; border:0; border-radius:4px; cursor:pointer; transition:opacity var(--site-control-motion),background var(--site-control-motion); }
.sound-toggle svg { width:18px; height:18px; }
.sound-toggle:hover,.sound-toggle:focus-visible { opacity:1; background:#ffffff18; }
.sound-toggle:focus-visible { outline:1px solid currentColor; outline-offset:1px; }
.sound-toggle .sound-slash { display:none; }
.sound-toggle[data-muted="true"] .sound-slash { display:block; }
.sound-toggle[data-muted="true"] .sound-waves { display:none; }
.view-switcher.attention .sound-toggle { animation:none; }

/* The compact menu also applies to a phone turned sideways. Opened surfaces
   have one site Back instead of a competing toolbar. */
@media(max-width:650px), (max-height:500px) and (pointer:coarse) {
  .site-mark { left:max(14px,calc(env(safe-area-inset-left) + 8px)); top:calc(2px + env(safe-area-inset-top)); padding:11px 0; font-size:21px; }
  .view-switcher { left:max(7px,calc(env(safe-area-inset-left) + 7px)); top:calc(50px + env(safe-area-inset-top)); padding:0; color:#fff8e9; background:transparent; box-shadow:none; backdrop-filter:none; -webkit-backdrop-filter:none; }
  .view-switcher.has-mobile-menu .site-menu-toggle { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-width:44px; min-height:44px; padding:7px 13px; border:1px solid #fff4df6b; border-radius:23px; color:#fff8e9; background:#281e18e8; box-shadow:0 2px 12px #17110e70; font:18px/1 var(--hand); cursor:pointer; }
  .site-menu-toggle:hover,.site-menu-toggle[aria-expanded="true"] { background:#443021f2; }
  .site-menu-toggle:focus-visible { outline:2px solid #ffe5a8; outline-offset:3px; }
  .site-menu-icon { font:15px/1 var(--ui); }
  .site-menu { position:absolute; top:calc(100% + 6px); left:0; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:2px; box-sizing:border-box; width:min(234px,calc(100vw - 14px - env(safe-area-inset-left) - env(safe-area-inset-right))); padding:5px; color:#fff8e9; background:#281e18f2; border:1px solid #fff4df6b; border-radius:12px; box-shadow:0 5px 18px #17110e80; backdrop-filter:blur(9px); -webkit-backdrop-filter:blur(9px); }
  .has-mobile-menu .site-menu-toggle[aria-expanded="false"] + .site-menu { display:none; }
  .site-menu a,.site-menu .sound-toggle { display:flex; align-items:center; justify-content:flex-start; gap:8px; box-sizing:border-box; width:100%; min-width:0; height:44px; padding:0 9px; color:inherit; opacity:1; background:transparent; border-radius:6px; font:17px/1 var(--hand); text-decoration:none; }
  .site-menu a[aria-current="page"] { background:#fff5dc22; }
  .site-menu a:hover,.site-menu a:focus-visible,.site-menu .sound-toggle:hover,.site-menu .sound-toggle:focus-visible { background:#fff5dc22; }
  .site-menu .view-name,.site-menu .sound-label,.site-menu .sound-state { display:inline; }
  .site-menu .sound-state { margin-left:auto; font:11px/1 var(--ui); }
  .sound-state::before { content:'On'; }
  .sound-toggle[data-muted="true"] .sound-state::before { content:'Off'; }
  .view-switcher.attention a { animation:none; }
  .view-switcher.attention .site-menu-toggle { box-shadow:0 0 12px 3px #ffedb873; }
  body[data-mobile-surface="open"] .view-switcher,
  body[data-notebook-open="true"] .view-switcher { visibility:hidden; pointer-events:none; }
}
