/* New elements stay absent from the established desktop composition. */
.mobile-menu-toggle,.mobile-home-explore{display:none}

@media(max-width:700px){
  :root{--site-nav-top:max(12px,env(safe-area-inset-top));--site-nav-height:104px}
  body .frame>.nav,body:not(.light) .nav{
    grid-template-columns:minmax(0,1fr) 30px 44px;
    grid-template-rows:48px 44px;
    gap:0 8px;height:104px;min-height:104px;
    margin:var(--site-nav-top) max(12px,env(safe-area-inset-left)) 0;
    padding:5px 12px;top:var(--site-nav-top);background:#040405f2;
  }
  body .nav .brand{grid-column:1;grid-row:1;font-size:15px;letter-spacing:-.045em;min-width:0}
  body .nav .nav-details{grid-column:2;grid-row:1;gap:0;justify-self:center}
  body .nav .nav-globe{width:25px;height:25px}
  body .nav .nav-symbol{display:none}
  body .nav .mobile-menu-toggle{display:grid;place-items:center;grid-column:3;grid-row:1;width:44px;height:44px;padding:10px;background:none;color:inherit;border:0;touch-action:manipulation}
  .mobile-menu-toggle svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.2}
  body .nav .links{grid-column:1/-1;grid-row:2;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;width:100%;margin:0;order:0}
  body .nav .links a,body .nav .links a.active{display:flex;align-items:center;justify-content:center;min-height:44px;min-width:0;padding:8px 0;font-size:11px;white-space:nowrap}
  body .nav:not(.mobile-nav-open) .links a:nth-child(n+5){display:none}
  body .nav.mobile-nav-open .links{position:absolute;top:100%;left:-1px;width:calc(100% + 2px);grid-template-columns:1fr 1fr;padding:12px;border:1px solid #aaa;background:#08090afb;box-shadow:0 18px 32px #000a;max-height:calc(100dvh - 140px);overflow-y:auto;overscroll-behavior:contain}
  body .nav.mobile-nav-open .links a{justify-content:start;padding:12px;font-size:13px}
  body:not(.editor-active) .nav .links a.edit-only{display:none}
  body[data-page=home] .nav .links a.active{color:#ff923e;border-color:#ff923e}
  body .nav .mobile-menu-toggle:focus-visible,body .nav .links a:focus-visible{outline:2px solid #ffa463;outline-offset:0}

  body[data-page=home]{background-color:#02050b;background-image:linear-gradient(90deg,#000c,#0009 65%,#000b),url('/neon-grid-background.png');background-size:auto 1050px;background-position:center top;background-attachment:scroll}
  body[data-page=home] #home{padding-bottom:0;min-height:0;overflow:hidden;color:#eeeae5}
  body[data-page=home] #home::before{content:'';position:absolute;inset:0;z-index:0;background:linear-gradient(#0005,#0002 60%,#0008);pointer-events:none}
  #home .home-stage{height:auto;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:start;gap:0 22px;padding:20px 22px calc(16px + env(safe-area-inset-bottom));isolation:isolate}
  #home .home-stage::before{content:'';position:absolute;left:0;right:0;bottom:48px;height:min(780px,95%);background:url('/mobile-autumn-scene.png') center bottom / 120% auto no-repeat;z-index:1;pointer-events:none}
  #home .rail{position:relative;grid-column:1/-1;left:auto;top:auto;width:auto;min-width:0;max-width:none;margin:0 0 18px;z-index:3}
  #home .rail-panel{display:block;border:0;padding:0}
  #home .rail-heading{display:flex;align-items:center;gap:18px}
  #home .rail strong{font-size:24px;line-height:1.15;white-space:pre-line;margin:0;max-width:40%;overflow-wrap:anywhere}
  #home .rail-description{border-left:1px solid #d2d4d4;padding-left:16px;margin:0;font-size:11px;line-height:1.45;white-space:pre-line;overflow-wrap:anywhere}
  #home .rail-panel::before,#home .rail-panel::after,#home .rail .wire-sphere,#home .rail-index,#home .archive-code,#home .rail-year{display:none}
  #home .hero-copy{position:relative;grid-column:1/-1;left:auto;top:auto;width:100%;margin:0;padding:0;z-index:3;min-width:0}
  #home .tagline{font-size:11px;letter-spacing:.065em;line-height:1.6;white-space:pre-line;margin:0 0 16px;max-width:100%;overflow-wrap:anywhere}
  #home .hero-copy h1{font-size:clamp(74px,22.5vw,146px);line-height:.83;letter-spacing:-.025em;transform:none;margin:0;max-width:100%;overflow-wrap:anywhere;color:#f2f0eb}
  /* Let names wrap naturally; saved trailing newlines must not add empty rows. */
  #home .hero-copy h1 .editable-copy{white-space:normal}
  #home .hero-copy h1{position:relative}
  #home .hero-copy h1 .text-edit{position:absolute;right:0;top:0;width:44px;height:44px;min-width:44px;margin:0}
  #home .intro{font-size:11px;line-height:1.6;letter-spacing:.06em;gap:0;margin:14px 0 0;max-width:90%;min-width:0}
  #home .intro p{overflow-wrap:anywhere}
  #home .intro .star{display:none}
  #home .hero-cta{margin-top:14px;padding:0;width:100%}
  #home .hero-cta .cta{width:min(100%,240px);height:44px;font-size:13px;padding:8px 16px;border-color:#ffd7b8;box-shadow:0 0 0 1px #d65c18,0 0 12px #f16c3844;background:#030304e8;gap:25px}
  #home .hero-cta .cta:hover{background:#371908;border-color:#ff923e}
  #home .chrome{position:absolute;top:5px;right:-46%;width:95%;height:auto;z-index:2;opacity:.95;pointer-events:none}
  #home .scene-note{position:relative;grid-column:1/-1;display:block;left:auto;top:auto;margin:22px 0 0;padding:6px 0 0 36px;min-height:64px;width:45%;font-size:10px;line-height:1.65;letter-spacing:.12em;background:none;z-index:3;overflow-wrap:anywhere}
  #home .scene-note::before{content:'✦';position:absolute;left:0;top:0;font:48px/1 Georgia,serif;color:#ff862e}
  #home .note-rule,#home .note-star,#home .home-landscape{display:none}
  #home .record-player{position:relative;grid-column:1;left:auto;top:auto;bottom:auto;width:100%;margin:0;align-self:end;z-index:4;min-width:0}
  #home .player-deck{width:110%;max-width:245px;margin-left:-4%}
  #home .player-control svg{opacity:.65;width:38%}
  #home .player-status{display:block;max-width:none;width:100%;margin:4px 0 0;padding:7px 8px;font-size:10px;line-height:1.5;letter-spacing:.025em;color:#eee;border:1px solid #bfc1c1;background:#030405ef;overflow-wrap:anywhere}
  #home .queue-controls{display:flex!important;gap:10px;margin-top:10px}
  #home .queue-controls button{min-width:44px;min-height:44px;width:50%;font-size:22px;border-color:#bfc1c1;background:#030405ef}
  #home .queue-controls button:disabled{opacity:.45;cursor:default}
  #home .coordinates{position:relative;grid-column:2;right:auto;bottom:auto;width:100%;min-width:0;padding:10px 9px 12px;margin:0 0 5px;align-self:end;z-index:4;border-color:#bfc1c1;background:#030405ed;box-shadow:0 0 0 4px #000b}
  #home .coordinates::before{border-color:#969b98}
  #home .coordinates .wire-sphere{height:auto;aspect-ratio:2.6;object-fit:fill;margin-bottom:12px}
  #home .coordinate-label{font-size:9px;line-height:1.45;overflow-wrap:anywhere;max-width:95%}
  #home .coordinate-star{color:#ff862e;right:5px;bottom:5px;font-size:26px}
  #home .mobile-home-explore{position:relative;grid-column:1/-1;z-index:4;display:flex;flex-direction:column;align-items:center;gap:7px;min-height:58px;width:max-content;max-width:100%;margin:22px auto 0;font-size:10px;letter-spacing:.18em;padding:6px 12px;text-align:center;touch-action:manipulation}
  .mobile-home-explore>span{font:28px/1 Arial,sans-serif;letter-spacing:0}
  body.has-editor #home .home-stage{padding-bottom:calc(125px + env(safe-area-inset-bottom))}
  #home .home-connect{margin:8px 22px 0;padding:22px 0 calc(28px + env(safe-area-inset-bottom));gap:16px}
  #home .home-connect nav{display:grid;grid-template-columns:1fr 1fr;width:100%;gap:10px}
  #home .home-connect a{font-size:11px;padding:12px;gap:12px}
  body.has-editor #home .home-connect{padding-bottom:calc(125px + env(safe-area-inset-bottom))}
  #home .editable-copy{max-width:100%}
}

@media(min-width:540px) and (max-width:700px){
  #home .home-stage{padding-inline:32px;gap:0 32px}
  #home .hero-copy{max-width:90%}
  #home .tagline,#home .intro{font-size:13px}
  #home .scene-note{font-size:12px;min-height:170px}
  #home .record-player{max-width:250px}
  #home .coordinates{max-width:205px;justify-self:end}
}

@media(max-width:360px){
  body .nav .brand{font-size:13px}
  #home .home-stage{padding-inline:18px;gap:0 18px}
  #home .hero-copy h1{font-size:23vw}
  #home .rail strong{font-size:21px}
  #home .scene-note{width:50%;min-height:64px}
  #home .coordinate-label{font-size:8px}
}
