/* Refactored directly from tools.html. */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

:root {
  color-scheme: dark;
  --white: #fff;
  --muted: rgba(255, 255, 255, 0.68);
  --line: rgba(255, 255, 255, 0.15);
  --glass: rgba(0, 0, 0, 0.16);
  --accent: #d9ff45;
}

html {
  scroll-behavior: smooth;
}

body {
  overflow: hidden;
  min-width: 320px;
  background: #000;
  color: var(--white);
}

h1,
h2 {
  font-family: inherit;
}

/* Loading screen */
#loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, #151515, #000 68%);
}

#loader h1 {
  opacity: 0;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  font-weight: 650;
  letter-spacing: 0.15em;
  text-align: center;
  text-transform: uppercase;
  animation: fadeIn 0.5s ease forwards;
}

#loader small {
  display: block;
  margin-top: 0.9rem;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.56rem;
  font-weight: 600;
  letter-spacing: 0.24em;
}

#loader.loader-out {
  animation: fadeOut 0.5s ease forwards;
}

@keyframes fadeIn {
  to { opacity: 1; }
}

@keyframes fadeOut {
  to {
    visibility: hidden;
    opacity: 0;
  }
}

/* Main tools.html layout */
#app {
  display: block;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
  scroll-padding: 0;
  -webkit-overflow-scrolling: touch;
}

section {
  position: relative;
  display: flex;
  flex: 0 0 100vh;
  height: 100vh;
  flex-basis: 100dvh;
  height: 100dvh;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  isolation: isolate;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

section::before {
  position: absolute;
  inset: -5%;
  z-index: -2;
  background-position: center;
  background-size: cover;
  content: "";
  transform: scale(1.1);
  transition: transform 1.4s ease;
}

section.visible::before {
  transform: scale(1.04);
}

section::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.96) 0%, transparent 38%, transparent 62%, rgba(0, 0, 0, 0.96) 100%),
    rgba(0, 0, 0, 0.18);
  content: "";
}

/* Glass placeholder retained from the source template. */
.placeholder {
  display: flex;
  width: min(80%, 900px);
  min-height: 60%;
  padding: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--glass);
  box-shadow: 0 2rem 5rem rgba(0, 0, 0, 0.3);
  text-align: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.overline,
.app-index,
.select-prompt {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.app-index {
  display: none;
}

.intro-placeholder h1 {
  max-width: 800px;
  font-family: inherit;
  font-size: clamp(2.3rem, 5.4vw, 5rem);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.lead {
  max-width: 590px;
  color: var(--muted);
  font-size: clamp(0.9rem, 1.7vw, 1.1rem);
  line-height: 1.65;
}

/* App tiles retained from tools.html. */
#app-list {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin: clamp(1rem, 3vh, 2rem) 0;
}

.tile {
  display: flex;
  min-height: 7.5rem;
  padding: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.tile:hover,
.tile:focus-visible {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-5px);
}

.tile.available {
  color: #111;
  background: var(--accent);
}

.tile strong {
  font: 0.66rem ui-monospace, SFMono-Regular, Consolas, monospace;
  opacity: 0.65;
}

.tile span {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  opacity: 0.85;
}

/* App detail placeholders */
.app-placeholder h2,
.end-placeholder h2 {
  max-width: 780px;
  font-family: inherit;
  font-size: clamp(2.4rem, 5.5vw, 5.2rem);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.app-placeholder > p,
.end-placeholder > p {
  max-width: 610px;
  color: var(--muted);
  line-height: 1.7;
}

.feature-list {
  display: flex;
  margin: 0.7rem 0;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  list-style: none;
}

.feature-list li,
.status {
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 2rem;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.59rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

[hidden] {
  display: none !important;
}

.launch-button {
  display: inline-flex;
  min-width: 14rem;
  min-height: 3.4rem;
  margin-top: 0.7rem;
  padding: 0 0.75rem 0 1.1rem;
  align-items: center;
  justify-content: space-between;
  color: #111;
  background: var(--accent);
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-decoration: none;
  text-transform: uppercase;
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

.launch-button:hover {
  background: #ecff9e;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.launch-button span {
  display: grid;
  width: 2.35rem;
  height: 2.35rem;
  flex: 0 0 2.35rem;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #111;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.launch-button svg {
  display: block;
  width: 1rem;
  height: 1rem;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.upcoming {
  background: rgba(0, 0, 0, 0.23);
}

.return-link {
  margin-top: 1rem;
  color: var(--white);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Scroll arrow retained from tools.html. */
.scroll-arrow {
  position: absolute;
  bottom: 2.2rem;
  z-index: 2;
  color: #fff;
  font-size: 2rem;
  opacity: 0.38;
  text-decoration: none;
  user-select: none;
  transition: opacity 0.25s ease;
}

.scroll-arrow:hover {
  opacity: 0.8;
}

/* Original tools.html background images. */
.bg-space-1::before { background-image: url("https://images.unsplash.com/photo-1446776811953-b23d57bd21aa"); }
.bg-space-2::before { background-image: url("https://images.unsplash.com/photo-1451187580459-43490279c0fa"); }
.bg-space-3::before { background-image: url("https://images.unsplash.com/photo-1462331940025-496dfbfc7564"); }
.bg-earth-1::before { background-image: url("https://images.unsplash.com/photo-1446776653964-20c1d3a81b06"); }
.bg-earth-2::before { background-image: url("https://images.unsplash.com/photo-1472214103451-9374bd1c798e"); }
.bg-text-1::before { background-image: url("https://images.unsplash.com/photo-1506744038136-46273834b3fb"); }
.bg-text-2::before { background-image: url("https://images.unsplash.com/photo-1499084732479-de2c02d45fc4"); }

/* Standalone 404 page */
.coming-soon {
  display: flex;
  width: min(900px, calc(100% - 2rem));
  min-height: 100vh;
  margin: 0 auto;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
}

.coming-soon .eyebrow {
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.coming-soon h1 {
  font-size: clamp(3rem, 8vw, 7rem);
  letter-spacing: -0.06em;
}

.coming-soon .back-link {
  color: var(--muted);
}

@media (max-width: 800px) {
  .placeholder {
    width: calc(100% - 2rem);
    min-height: 68%;
  }

  #app-list {
    grid-auto-columns: minmax(105px, 1fr);
    grid-auto-flow: column;
    grid-template-columns: none;
    overflow-x: auto;
    padding-bottom: 0.5rem;
  }
}

@media (max-width: 520px) {
  .placeholder {
    padding: 1.25rem;
  }

  .intro-placeholder h1 {
    font-size: clamp(2.15rem, 11vw, 3.4rem);
  }

  .lead {
    font-size: 0.83rem;
  }

  #app-list {
    margin: 0.5rem 0;
  }

  .tile {
    min-height: 6.5rem;
  }

  .app-placeholder h2,
  .end-placeholder h2 {
    font-size: clamp(2.25rem, 11vw, 3.6rem);
  }

  .feature-list {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  #app {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
