/* The opening experience on phone screens. The desktop entrance and 3D study
   keep their existing layout. */
#threshold[hidden] { display: none !important; }
@media (max-width: 700px) {
  #threshold[data-stage="world"] {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    min-height: 100svh;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #08191b;
    -webkit-overflow-scrolling: touch;
  }

  #threshold[data-stage="world"] .gateway-world {
    position: fixed;
    opacity: .42;
  }
  #threshold[data-stage="world"] .gateway-world svg {
    top: 22%;
    right: -66%;
    width: 180%;
    height: 65%;
    opacity: .52;
  }
  #threshold[data-stage="world"] .gateway-world::before {
    background: linear-gradient(90deg, #071719ee 0%, #071719a9 50%, #07171977 100%);
  }
  #threshold[data-stage="world"] .gateway-orbit { opacity: .22; }
  #threshold[data-stage="world"] .threshold-shade {
    position: fixed;
    background: linear-gradient(180deg, #071719 0%, #071719d8 28%, transparent 75%, #071719dc 100%);
  }

  #threshold[data-stage="world"] .threshold-top {
    position: absolute;
    left: 22px;
    right: auto;
    top: max(22px, env(safe-area-inset-top));
    max-width: 52%;
    z-index: 9;
    font-size: 11px;
    line-height: 1.2;
    letter-spacing: .12em;
    white-space: nowrap;
    color: #efd4a3;
  }
  #threshold[data-stage="world"] .gateway-skip {
    position: absolute;
    top: max(18px, env(safe-area-inset-top));
    right: 20px;
    z-index: 9;
    min-height: 34px;
    padding: 5px 0;
    font-size: 11px;
    line-height: 1.25;
    color: #f3e9d4;
    border-bottom-color: #c4ad77;
    white-space: nowrap;
  }

  #threshold[data-stage="world"] .gateway-intro {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    z-index: 4;
    flex: none;
    width: 100%;
    max-width: none;
    transform: none;
    margin: 0;
    padding: clamp(94px, 14vh, 124px) 22px 24px;
  }
  #threshold[data-stage="world"] .gateway-intro .eyebrow {
    max-width: 330px;
    margin: 0;
    font: 600 10px/1.45 Arial, sans-serif;
    letter-spacing: .17em;
    color: #e8bd7e;
    text-wrap: balance;
  }
  #threshold[data-stage="world"] .gateway-intro h1 {
    max-width: 640px;
    margin: 18px 0 17px;
    font: 400 clamp(45px, 11vw, 64px)/1.01 Georgia, serif;
    letter-spacing: -.045em;
    text-shadow: 0 6px 32px #061415;
    text-wrap: balance;
  }
  #threshold[data-stage="world"] .gateway-intro h1 em {
    color: #e8c88e;
    font-style: italic;
  }
  #threshold[data-stage="world"] .gateway-intro > p:not(.eyebrow):not(.gateway-help) {
    max-width: 480px;
    margin: 0;
    color: #e1e9de;
    font: 16px/1.48 Arial, sans-serif;
    text-shadow: 0 2px 12px #061415;
  }
  #threshold[data-stage="world"] .gateway-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 9px;
    width: 100%;
    max-width: 530px;
    margin: 25px 0 0;
  }
  #threshold[data-stage="world"] .gateway-actions button {
    min-width: 0;
    min-height: 50px;
    padding: 10px 11px;
    border: 1px solid #a99772;
    background: #132b2cdb;
    color: #f3e7ce;
    font: 600 12px/1.25 Arial, sans-serif;
    letter-spacing: .01em;
    text-align: center;
  }
  #threshold[data-stage="world"] .gateway-actions button:first-child {
    grid-column: 1 / -1;
    min-height: 57px;
    background: #e5c891;
    border-color: #f4daa6;
    color: #102224;
    font-size: 15px;
    box-shadow: 0 8px 26px #0008;
  }
  #threshold[data-stage="world"] .gateway-actions button:hover,
  #threshold[data-stage="world"] .gateway-actions button:focus-visible {
    background: #f0dcac;
    color: #102224;
  }
  #threshold[data-stage="world"] .gateway-actions button::after {
    content: " →";
    padding-left: 3px;
    font-family: Arial, sans-serif;
  }
  #threshold[data-stage="world"] .gateway-help {
    display: block;
    max-width: 470px;
    margin: 18px 0 0;
    color: #bdccbf;
    font: 11px/1.55 Arial, sans-serif;
    letter-spacing: .03em;
  }

  #threshold[data-stage="world"] .gateway-forts {
    position: relative;
    z-index: 5;
    left: auto;
    right: auto;
    bottom: auto;
    flex: none;
    width: 100%;
    max-width: none;
    gap: 9px;
    margin: auto 0 0;
    padding: 20px 22px max(24px, env(safe-area-inset-bottom));
    overflow-x: auto;
    scroll-padding-left: 22px;
  }
  #threshold[data-stage="world"] .gateway-forts::before {
    content: "START WITH A PLACE";
    position: absolute;
    left: 22px;
    top: 0;
    color: #dfba80;
    font: 600 10px Arial, sans-serif;
    letter-spacing: .16em;
  }
  #threshold[data-stage="world"] .gateway-forts button {
    flex: 0 0 min(68vw, 260px);
    min-width: 0;
    padding: 13px 14px;
    border-color: #a88d61;
    background: #102627f5;
    scroll-snap-align: start;
  }
  #threshold[data-stage="world"] .gateway-forts b { font-size: 9px; }
  #threshold[data-stage="world"] .gateway-forts span { font-size: 18px; }
  #threshold[data-stage="world"] .gateway-forts small { font-size: 11px; }
}

@media (max-width: 370px) {
  #threshold[data-stage="world"] .gateway-intro {
    padding-left: 18px;
    padding-right: 18px;
    padding-top: 88px;
  }
  #threshold[data-stage="world"] .gateway-intro h1 {
    font-size: 42px;
  }
  #threshold[data-stage="world"] .gateway-intro > p:not(.eyebrow):not(.gateway-help) {
    font-size: 14px;
  }
  #threshold[data-stage="world"] .gateway-forts {
    padding-left: 18px;
    padding-right: 18px;
  }
}

@media (max-width: 700px) and (max-height: 680px) {
  #threshold[data-stage="world"] .gateway-intro {
    padding-top: 82px;
  }
  #threshold[data-stage="world"] .gateway-intro h1 {
    font-size: clamp(40px, 9vw, 52px);
    margin-top: 10px;
    margin-bottom: 12px;
  }
  #threshold[data-stage="world"] .gateway-actions {
    margin-top: 16px;
  }
}
