/* Shared finish for the interior worlds. Home and arcade never load this file. */
html {
  scroll-padding-top: 92px;
}
body {
  --world-accent: #c4b5fd;
}
a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--world-accent);
  outline-offset: 5px;
}
[id] {
  scroll-margin-top: 92px;
}
.skip-link {
  position: fixed;
  left: 20px;
  top: -90px;
  z-index: 1000;
  background: #f3e9ff;
  color: #110d20;
  padding: 14px 20px;
  border-radius: 8px;
}
.skip-link:focus {
  top: 12px;
}
body #top-nav,
body .detail-nav {
  height: 72px;
  background: rgba(5, 8, 20, 0.94);
  border-bottom: 1px solid #ffffff1c;
}
body #universe-title,
body .brand {
  font-size: 12px;
  letter-spacing: 0.12em;
}
body .nav-links,
body .back,
body .stellar,
body .footer-links {
  font-size: 12px;
  line-height: 1.5;
}
body .nav-links a,
body .back,
body .stellar a,
body .footer-links a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.world-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}
.world-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 48px;
  padding: 13px 20px;
  border: 1px solid #ffffff38;
  border-radius: 8px;
  background: #090d20d9;
  color: #f5f3ff;
  font:
    600 14px/1.4 "Space Grotesk",
    sans-serif;
  text-decoration: none;
  transition:
    background 0.2s,
    transform 0.2s;
}
.world-button.primary {
  background: var(--world-accent);
  border-color: var(--world-accent);
  color: #111322;
}
.world-button:hover {
  transform: translateY(-2px);
  filter: brightness(1.12);
}
.world-note {
  font-size: 14px;
  line-height: 1.6;
  color: #c2bed2;
}

/* Literary canopy: quiet framing, with books occupying the clear centre. */
body[data-world="books"] {
  --world-accent: #e7c38a;
}
[data-world="books"] .forest-hero {
  min-height: 1060px;
  background: #080e21;
}
[data-world="books"] .intro {
  padding-top: 58px;
  width: min(720px, calc(100% - 40px));
}
[data-world="books"] .intro h1 {
  font-size: clamp(44px, 6.3vw, 76px);
  line-height: 1.05;
}
[data-world="books"] .intro p {
  max-width: 480px;
  font-size: 16px;
  color: #e0dbe8;
}
[data-world="books"] .trees {
  inset: 390px -23vw 0;
  opacity: 0.46;
}
[data-world="books"] .trees picture {
  width: max(1600px, 145vw);
}
[data-world="books"] .atmosphere::after {
  background:
    linear-gradient(180deg, #070d21aa, transparent 70%, #090713),
    radial-gradient(ellipse at 50% 20%, #07132c 0, transparent 60%);
}
[data-world="books"] .books-layer {
  inset: 500px 0 auto;
  height: 480px;
  width: min(1100px, 92vw);
}
[data-world="books"] .book-node {
  width: 158px;
}
[data-world="books"] .book-node:nth-child(1) {
  --x: 12%;
  --y: 24%;
  --r: -4deg;
}
[data-world="books"] .book-node:nth-child(2) {
  --x: 37%;
  --y: 31%;
  --r: 2deg;
}
[data-world="books"] .book-node:nth-child(3) {
  --x: 62%;
  --y: 24%;
  --r: -2deg;
}
[data-world="books"] .book-node:nth-child(4) {
  --x: 82%;
  --y: 61%;
  --r: 4deg;
  width: 124px;
}
[data-world="books"] .book-node:nth-child(5) {
  --x: 18%;
  --y: 78%;
  --r: -3deg;
  width: 124px;
}
[data-world="books"] .book-node::after,
[data-world="books"] .book-float::before {
  display: none;
}
[data-world="books"] .book-node::before {
  opacity: 0.3;
  animation: none;
}
[data-world="books"] .book-float {
  animation-duration: 9s;
}
[data-world="books"] .book-label {
  font-size: 12px;
  letter-spacing: 0;
  max-width: 190px;
  opacity: 1;
  background: #080d1ee8;
}
[data-world="books"] .soon,
[data-world="books"] .eyebrow,
[data-world="books"] .scroll-hint,
[data-world="books"] .section-tag {
  font-size: 12px;
}
[data-world="books"] .leaf-field {
  opacity: 0.35;
}
[data-world="books"] .grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
[data-world="books"] .catalog-card {
  padding: 28px;
  border-radius: 8px;
  border-top: 2px solid var(--card);
  min-height: 270px;
}
[data-world="books"] .catalog-card h3 {
  font-size: 27px;
  line-height: 1.15;
}
[data-world="books"] .catalog-card p {
  font-size: 16px;
}
[data-world="books"] .catalog-card small,
[data-world="books"] .catalog-card strong {
  font-size: 12px;
  line-height: 1.5;
}

/* TI: the building and its directory share the opening viewport. */
body[data-world="ti"] {
  --world-accent: #c4b5fd;
  --sun: #c4b5fd;
}
[data-world="ti"] #sky {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  min-height: 780px;
  padding: 100px max(24px, calc((100vw - 1240px) / 2)) 32px;
}
[data-world="ti"] .hero {
  text-align: left;
  padding: 30px 24px 30px 0;
}
[data-world="ti"] .hero h1 {
  font-size: clamp(40px, 4.6vw, 64px);
  line-height: 1.08;
  margin: 22px 0;
}
[data-world="ti"] .hero p {
  font-size: 17px;
  line-height: 1.7;
  max-width: 450px;
  margin: 0;
}
[data-world="ti"] .badge {
  font-size: 12px;
}
[data-world="ti"] .sun {
  opacity: 0.18;
  background: #a78bfa;
}
[data-world="ti"] .scene-atmosphere {
  filter: saturate(0.6) brightness(0.65);
}
[data-world="ti"] .city {
  min-height: 0;
  padding: 0;
  width: 100%;
}
[data-world="ti"] .building {
  width: min(430px, 100%) !important;
}
[data-world="ti"] .floor-window .floor-name {
  right: auto;
  left: 8px;
  top: 50%;
  translate: 0 -50%;
  font-size: 12px;
  opacity: 1;
  padding: 9px 12px;
  background: #120d22ed;
  border-color: #c4b5fd;
}
[data-world="ti"] .floor-window::after {
  display: none;
}
[data-world="ti"] .ti-ground-actions .knob small {
  font-size: 11px;
}
.service-directory {
  display: grid;
  gap: 0;
  max-width: 450px;
  margin-top: 28px;
  border-top: 1px solid #ffffff25;
}
.service-directory a {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 48px;
  padding: 10px 0;
  border-bottom: 1px solid #ffffff20;
  color: #eee8ff;
  font-size: 15px;
  text-decoration: none;
}
.service-directory a span {
  color: #b8a3e8;
  font:
    12px "JetBrains Mono",
    monospace;
}
.service-directory a::after {
  content: "↗";
  margin-left: auto;
  color: #c4b5fd;
}
.service-directory a:hover {
  color: #c4b5fd;
  padding-left: 8px;
}

/* Service rooms use the existing room artwork, with readable object labels. */
[data-world="service"] .room {
  background:
    linear-gradient(180deg, #06091499, transparent 65%, #060914ba),
    var(--room-image) center/cover;
}
[data-world="service"] .room > .ceiling,
[data-world="service"] .room > .lamp,
[data-world="service"] .room > .window,
[data-world="service"] .room > .floorplane,
[data-world="service"] .room > .bench {
  visibility: hidden;
}
[data-world="service"] .roomhead {
  padding-top: 32px;
}
[data-world="service"] .roomhead h1 {
  font-size: clamp(30px, 4vw, 52px);
  max-width: 780px;
  line-height: 1.12;
}
[data-world="service"] .roomhead .hint {
  font-size: 16px;
}
[data-world="service"] .spot {
  min-width: 44px;
  min-height: 44px;
}
[data-world="service"] .spot::after {
  content: attr(aria-label);
  position: absolute;
  left: 50%;
  top: 35px;
  transform: translateX(-50%);
  padding: 8px 12px;
  width: max-content;
  max-width: 170px;
  border: 1px solid #c4b5fd65;
  border-radius: 6px;
  background: #080d20eb;
  color: #eee8ff;
  font:
    500 12px/1.4 "Space Grotesk",
    sans-serif;
}
[data-world="service"] .spot .card {
  background: #0b1024fa;
  border-color: #c4b5fd88;
}
[data-world="service"] .spot .card .tx,
[data-world="service"] .card2 p,
[data-world="service"] .steps {
  font-size: 16px;
  line-height: 1.7;
}
[data-world="service"] .spot .card b,
[data-world="service"] .btn {
  font-size: 14px;
}
[data-world="service"] .btn {
  min-height: 48px;
}
[data-world="service"] .tag,
[data-world="service"] .fl {
  font-size: 12px;
  line-height: 1.5;
}
[data-world="service"] .card2 {
  background: #101326;
  border-radius: 10px;
  border-color: #ffffff20;
}

/* Dev: large, legible terminal choices, with a mobile layout independent of the artwork. */
body[data-world="dev"] {
  --world-accent: #67e8f9;
}
[data-world="dev"] .hero {
  min-height: 740px;
}
[data-world="dev"] .outdoor-wrap {
  width: min(1280px, 98vw);
  margin-top: 20px;
}
[data-world="dev"] .screen {
  gap: 24px;
}
[data-world="dev"] .screen h1 {
  font-size: clamp(32px, 4.2vw, 56px);
  line-height: 1.02;
}
[data-world="dev"] .status {
  font-size: 12px;
  letter-spacing: 0.08em;
}
[data-world="dev"] .screen-copy p {
  font-size: 14px;
  font-family: "Space Grotesk", sans-serif;
}
[data-world="dev"] .option {
  min-height: 100px;
  border-radius: 3px;
  padding: 16px;
  border-width: 0 0 1px 3px;
  background: #031420cf;
}
[data-world="dev"] .option small {
  font-size: 12px;
  letter-spacing: 0.08em;
}
[data-world="dev"] .option strong {
  font-size: 22px;
}
[data-world="dev"] .option span {
  font-size: 14px;
}
[data-world="dev"] .option:hover {
  transform: translateX(3px);
  background: #08303e;
}
[data-world="dev"] .instruction {
  font-size: 12px;
  bottom: 12px;
}
.dev-work {
  padding: 70px 24px;
  background: #040c18;
  border-top: 1px solid #67e8f92e;
}
.dev-work-inner {
  max-width: 1100px;
  margin: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
.dev-work small {
  color: #67e8f9;
  font:
    12px "JetBrains Mono",
    monospace;
}
.dev-work h2 {
  font:
    700 clamp(28px, 4vw, 42px)/1.12 Montserrat,
    sans-serif;
  margin: 18px 0;
}
.dev-work p {
  font-size: 17px;
  line-height: 1.8;
  color: #aec8d4;
}
.project-preview {
  display: block;
  padding: 28px;
  border: 1px solid #67e8f93b;
  background: linear-gradient(135deg, #102235, #080e1f);
  border-radius: 10px;
}
.project-preview img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 16px;
  margin-bottom: 20px;
}
.project-preview strong {
  display: block;
  font-size: 24px;
}
.project-preview span {
  display: block;
  font-size: 14px;
  color: #67e8f9;
  margin-top: 18px;
}

@media (max-width: 800px) {
  body #universe-title,
  body .brand {
    font-size: 11px;
    letter-spacing: 0.04em;
  }
  body .nav-links {
    gap: 14px;
  }
  [data-world="books"] .forest-hero {
    min-height: 1330px;
  }
  [data-world="books"] .trees {
    inset: 470px -65vw 0;
    opacity: 0.28;
  }
  [data-world="books"] .books-layer {
    inset: 450px 0 auto;
    height: 760px;
  }
  [data-world="books"] .book-node {
    width: 138px;
  }
  [data-world="books"] .book-node:nth-child(1) {
    --x: 25%;
    --y: 8%;
  }
  [data-world="books"] .book-node:nth-child(2) {
    --x: 75%;
    --y: 12%;
  }
  [data-world="books"] .book-node:nth-child(3) {
    --x: 50%;
    --y: 50%;
  }
  [data-world="books"] .book-node:nth-child(4) {
    --x: 23%;
    --y: 85%;
    width: 114px;
  }
  [data-world="books"] .book-node:nth-child(5) {
    --x: 77%;
    --y: 85%;
    width: 114px;
  }
  [data-world="books"] .book-label {
    max-width: 150px;
  }
  [data-world="books"] .grid {
    grid-template-columns: 1fr;
  }
  [data-world="books"] .catalog-card {
    min-height: 0;
  }
  [data-world="ti"] #sky {
    display: block;
    padding: 100px 20px 30px;
  }
  [data-world="ti"] .hero {
    padding: 0;
  }
  [data-world="ti"] .hero h1 {
    font-size: 42px;
  }
  [data-world="ti"] .building {
    width: min(410px, 100%) !important;
  }
  [data-world="ti"] .city {
    margin-top: 20px;
  }
  [data-world="service"] .spot::after {
    max-width: 96px;
    font-size: 11px;
  }
  [data-world="service"] .spot .card {
    position: fixed;
    left: 50%;
    bottom: 110px;
    width: min(280px, 80vw);
  }
  [data-world="dev"] .hero {
    min-height: 0;
    padding-bottom: 50px;
  }
  [data-world="dev"] .outdoor-wrap {
    width: calc(100% - 32px);
    aspect-ratio: auto;
    margin: 36px auto 0;
    padding: 16px;
    border: 1px solid #67e8f959;
    background: #05111de8;
    box-shadow: 0 0 50px #22d3ee15;
  }
  [data-world="dev"] .outdoor-structure {
    display: none;
  }
  [data-world="dev"] .screen {
    position: relative;
    inset: auto;
    width: 100%;
    height: auto;
    display: block;
    padding: 18px 8px;
    overflow: visible;
  }
  [data-world="dev"] .screen-copy {
    text-align: left;
  }
  [data-world="dev"] .screen h1 {
    font-size: clamp(36px, 9vw, 56px);
    margin: 20px 0;
  }
  [data-world="dev"] .screen-grid {
    margin-top: 30px;
    gap: 12px;
  }
  [data-world="dev"] .option {
    min-height: 124px;
    padding: 12px;
  }
  [data-world="dev"] .option span {
    display: block;
  }
  [data-world="dev"] .instruction {
    display: none;
  }
  .dev-work-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto !important;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .layer,
  .depth,
  .outdoor-wrap,
  [data-depth] {
    transform: none !important;
  }
  canvas,
  .leaf-field {
    display: none !important;
  }
  [data-world="books"] .book-node {
    transform: translate(-50%, -50%) !important;
  }
}
.service-dialog {
  width: min(480px, calc(100% - 40px));
  max-height: 80svh;
  overflow: auto;
  padding: 28px;
  border: 1px solid #c4b5fd88;
  border-radius: 12px;
  background: #101528;
  color: #f4efff;
  box-shadow: 0 30px 100px #0009;
}
.service-dialog::backdrop {
  background: #020614b8;
  backdrop-filter: blur(5px);
}
.service-dialog h2 {
  font:
    600 26px/1.2 "Space Grotesk",
    sans-serif;
  margin: 0 0 18px;
}
.service-dialog p {
  font:
    400 17px/1.8 "Space Grotesk",
    sans-serif;
  color: #c7c8db;
}
.service-dialog button {
  cursor: pointer;
  margin-top: 14px;
}
[data-world="service"] .spot .card {
  display: none;
}
