@media (max-width: 600px) {
  #app .station-shell:not(.has-studio-landing) .wordmark .fourth-surface-logo {
    --logo-width: clamp(126px, 38vw, 174px);
    --logo-scale: 119.946%;
    --logo-position: 50% 49.855%;
    --logo-ratio: 1484 / 215;
  }
}

@media (max-width: 760px) and (orientation: portrait) {
  #app#app .station-shell[data-camera]:not(.has-studio-landing) {
    --scene-gutter: 12px;
    --scene-control: 44px;
    --scene-type: 13px;
    --scene-landmark-type: 12px;
    --scene-notebook-width: 64px;
    --scene-mobile-hud-surface: var(--ui-glass);
    --scene-mobile-hud-shadow: 0 2px 8px rgba(24, 37, 26, .10);
  }

  #app#app .station-shell[data-camera]:not(.has-studio-landing) .site-header {
    min-height: 0;
    gap: 0;
    padding-block: max(10px, env(safe-area-inset-top)) 10px;
  }

  #app#app .station-shell[data-camera]:not(.has-studio-landing) .wordmark {
    width: auto;
    margin-inline-end: 8px;
  }

  #app#app .station-shell[data-camera="room"]:not(.has-studio-landing) .site-header :is(.header-nav a[data-nav="about"], .sound-button) {
    display: none;
  }

  #app#app .station-shell[data-camera="room"]:not(.has-studio-landing) .display-scene-actions {
    display: grid;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--ui-line);
  }

  /* The three top actions share one surface. Each retains its own touch target. */
  #app#app .station-shell[data-camera]:not(.has-studio-landing) :is(.header-nav, .time-toggle, .display-toggle) {
    flex-shrink: 0;
    height: var(--scene-control);
    border-color: var(--ui-line);
    background: var(--scene-mobile-hud-surface);
  }

  #app#app .station-shell[data-camera]:not(.has-studio-landing) .header-nav {
    gap: 0;
    padding: 0;
    border: 1px solid var(--ui-line);
    border-inline-end: 0;
    border-radius: 24px 0 0 24px;
  }

  #app#app .station-shell[data-camera]:not(.has-studio-landing) .header-nav a[data-nav="projects"] {
    min-width: 46px;
    padding-inline: 9px 7px;
    border-radius: 24px 0 0 24px;
  }

  #app#app .station-shell[data-camera]:not(.has-studio-landing) .time-toggle {
    width: clamp(59px, 18vw, 74px);
    gap: 4px;
    padding-inline: 4px;
    border-inline: 0;
    border-radius: 0;
    box-shadow: inset 1px 0 var(--ui-line), inset -1px 0 var(--ui-line);
  }

  #app#app .station-shell[data-camera]:not(.has-studio-landing) .time-toggle-value {
    font-variant-numeric: tabular-nums;
  }

  #app#app .station-shell[data-camera]:not(.has-studio-landing) .display-toggle {
    border-inline-start: 0;
    border-radius: 0 24px 24px 0;
  }

  #app#app .station-shell[data-camera]:not(.has-studio-landing) :is(.time-toggle, .display-toggle)[aria-expanded="true"] {
    color: var(--ui-on-forest);
    background: var(--ui-forest);
  }

  #app#app .station-shell[data-camera="overview"] .drive-tools {
    gap: 0;
    border: 1px solid var(--ui-line);
    border-radius: 24px;
    background: var(--scene-mobile-hud-surface);
    box-shadow: var(--scene-mobile-hud-shadow);
  }

  #app#app .station-shell[data-camera="overview"] .drive-tools .utility-button {
    position: relative;
    padding-inline: 12px;
    border-color: transparent;
    border-radius: 24px;
    background: transparent;
    box-shadow: none;
    font-size: 12px;
  }

  #app#app .station-shell[data-camera="overview"] .drive-tools .room-button ~ .utility-button:not([hidden])::before {
    content: "";
    position: absolute;
    top: 50%;
    inset-inline-start: -1px;
    width: 1px;
    height: 17px;
    background: var(--ui-line);
    transform: translateY(-50%);
  }

  #app#app .station-shell[data-camera="overview"] .keyboard-hint {
    border-radius: 14px;
    background: var(--scene-mobile-hud-surface);
    box-shadow: var(--scene-mobile-hud-shadow);
  }

  #app#app .station-shell[data-camera="drive"] .drive-tools :is(.utility-button, .reset-button, .drive-perspective) {
    border-color: var(--ui-line);
    border-radius: 24px;
    background: var(--scene-mobile-hud-surface);
    font-size: 12px;
  }

  #app#app .station-shell:is([data-camera="overview"], [data-camera="drive"]) .hotspot-label {
    padding: 3px 7px;
    border-color: var(--ui-line);
    border-radius: 20px;
    background: var(--scene-mobile-hud-surface);
    box-shadow: var(--scene-mobile-hud-shadow);
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: 0;
  }

  #app#app .station-shell:is([data-camera="overview"], [data-camera="drive"]) .hotspot-anchor {
    left: calc(50% - 3px);
    width: 6px;
    height: 6px;
  }

  #app#app .station-shell:is([data-camera="overview"], [data-camera="drive"]) .hotspot-anchor::before {
    left: 1.5px;
    bottom: 5px;
    height: 5px;
  }

  #app#app .station-shell[data-camera="overview"] .studio-hotspot.next-stop-entry {
    isolation: isolate;
    min-width: 72px;
    gap: 5px;
    padding-inline: 8px;
    border-color: transparent;
    color: var(--ui-forest);
    background: transparent;
    box-shadow: none;
    font-size: 12px;
  }

  #app#app .station-shell[data-camera="overview"] .studio-hotspot.next-stop-entry::before {
    position: absolute;
    inset: 9px 0;
    z-index: -1;
    border: 1px solid var(--ui-line);
    border-radius: 20px;
    background: var(--scene-mobile-hud-surface);
    box-shadow: var(--scene-mobile-hud-shadow);
    content: "";
  }

  #app#app .station-shell:is([data-camera="overview"], [data-camera="drive"]) :is(.scene-toolbar, .discovery-trigger) {
    border-color: var(--ui-line);
    border-radius: 28px;
    background: var(--scene-mobile-hud-surface);
    box-shadow: var(--scene-mobile-hud-shadow);
  }

  #app#app .station-shell:is([data-camera="overview"], [data-camera="drive"]) .scene-toolbar button {
    border-radius: 22px;
    font-size: 12px;
  }

  #app#app .station-shell:is([data-camera="overview"], [data-camera="drive"]) .discovery-trigger {
    flex-direction: row;
    gap: 5px;
    padding-inline: 7px;
  }

  #app#app .station-shell:is([data-camera="overview"], [data-camera="drive"]) .discovery-trigger > svg {
    width: 15px;
    height: 15px;
  }

  #app#app .station-shell:is([data-camera="overview"], [data-camera="drive"]) .discovery-trigger-copy .discovery-count {
    font-size: 10px;
    white-space: nowrap;
  }

  #app#app .station-shell:is([data-camera="overview"], [data-camera="drive"]) {
    --scene-dock-width: 276px;
    --scene-dock-inset: max(var(--scene-left), var(--scene-right), calc((100vw - var(--scene-dock-width)) / 2));
  }

  #app#app .station-shell:is([data-camera="overview"], [data-camera="drive"]) .scene-toolbar {
    width: calc(var(--scene-dock-width) - var(--scene-notebook-width));
    max-width: none;
    gap: 2px;
    border-inline-end: 0;
    border-radius: 28px 0 0 28px;
    box-shadow: none;
  }

  #app#app .station-shell:is([data-camera="overview"], [data-camera="drive"]) .scene-modes {
    flex: 2 1 0;
  }

  #app#app .station-shell:is([data-camera="overview"], [data-camera="drive"]) .scene-toolbar button {
    flex: 1 1 0;
    min-width: 44px;
    gap: 4px;
    padding-inline: 4px;
  }

  #app#app .station-shell:is([data-camera="overview"], [data-camera="drive"]) .scene-toolbar [data-mode].is-active {
    display: inline-flex;
  }

  #app#app .station-shell[data-camera="overview"] .scene-toolbar [data-mode="drive"]:not(.is-active) {
    color: var(--ui-ink);
    background: transparent;
  }

  #app#app .station-shell:is([data-camera="overview"], [data-camera="drive"]) .scene-toolbar .toolbar-divider {
    margin-inline: 0;
  }

  #app#app .station-shell:is([data-camera="overview"], [data-camera="drive"]) .discovery-trigger {
    position: relative;
    border-inline-start: 0;
    border-radius: 0 28px 28px 0;
    box-shadow: none;
  }

  #app#app .station-shell:is([data-camera="overview"], [data-camera="drive"]) .discovery-trigger::before {
    position: absolute;
    inset-inline-start: 0;
    top: 50%;
    width: 1px;
    height: 17px;
    background: var(--ui-line);
    transform: translateY(-50%);
    content: "";
  }

  #app#app .station-shell[data-camera="overview"] .keyboard-hint {
    left: 50%;
    width: max-content;
    padding-block: 0;
    transform: translateX(-50%);
  }

  #app#app .station-shell[data-camera="overview"] .keyboard-hint .orbit-symbol { display: none; }

  #app#app .station-shell[data-camera="overview"] .keyboard-hint .orbit-hint-copy {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    white-space: nowrap;
  }

  #app#app .station-shell[data-camera="overview"] .keyboard-hint .orbit-hint-copy > span:not(.orbit-symbol) {
    color: var(--ui-muted);
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .station-shell.is-arriving-world :is(.site-header, .drive-tools, .hotspot-layer, .studio-hotspot-layer, .station-footer, .discovery-trail) {
    animation: world-interface-in 280ms ease-out both;
  }

  @keyframes world-interface-in {
    from { opacity: 0; }
    to { opacity: 1; }
  }
}

@media (max-width: 760px) and (orientation: portrait) {
  #app .studio-landing {
    padding-top: max(clamp(82px, 12svh, 110px), calc(env(safe-area-inset-top) + 72px));
    background:
      radial-gradient(ellipse 75% 58% at 50% 10%, rgb(255 253 247 / 57%), transparent 92%),
      linear-gradient(163deg, rgb(248 246 238 / 26%), rgb(248 231 210 / 42%));
  }

  #app .studio-landing-intro { margin-bottom: 22px; }

  #app .studio-landing-cards {
    gap: 0;
    border: 1px solid var(--landing-edge);
    border-radius: 20px;
    background: rgb(255 253 246 / 91%);
    box-shadow: 0 6px 24px rgb(44 40 29 / 10%);
  }

  #app .studio-landing-card,
  #app .studio-landing-card--works {
    --landing-card-radius: 18px;
    grid-template-columns: clamp(78px, 24vw, 106px) minmax(0, 1fr) 44px;
    grid-template-rows: auto;
    min-height: 91px;
    gap: 12px;
    padding: 10px 13px;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  #app .studio-landing-card + .studio-landing-card {
    border-top: 1px solid rgb(58 74 60 / 15%);
    border-start-start-radius: 0;
    border-start-end-radius: 0;
  }

  #app .studio-landing-card .studio-landing-art { grid-area: 1 / 1; }

  #app .studio-landing-card h2 {
    grid-area: 1 / 2;
    align-self: center;
    font-size: clamp(17px, 4.8vw, 22px);
  }

  #app#app .studio-landing-action {
    grid-area: 1 / 3;
    align-self: center;
    width: 44px;
    border-color: transparent;
  }

  #app .studio-landing-card--map .studio-landing-action:not(:focus-visible) {
    background: rgb(43 81 61 / 9%);
    color: #2c513c;
  }

  #app .studio-landing-footer { flex-grow: 0; margin-top: 18px; }
}
