:root {
  color-scheme: dark;
  --page-background: #000;
  --title-color: #f0f4ff;
  --muted: rgba(222, 230, 247, 0.56);
  --line: rgba(211, 224, 255, 0.17);
  --line-hover: rgba(211, 231, 255, 0.55);
  --content-width: min(46rem, calc(100vw - 2rem));
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: var(--page-background);
  -ms-overflow-style: none;
  scrollbar-width: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
}

body {
  overflow-x: hidden;
  color: var(--title-color);
  font-family: Arial, Helvetica, sans-serif;
  cursor: default;
  touch-action: pan-y;
  -webkit-font-smoothing: antialiased;
}

body.star-target {
  cursor: crosshair;
}

a {
  color: inherit;
}

#starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

main {
  position: relative;
  z-index: 1;
}

section {
  position: relative;
  width: 100%;
  height: 100svh;
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.hero {
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
  text-align: center;
}

.hero-content {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: center;
}

h1,
h2,
p {
  margin: 0;
}

h1,
h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
}

h1 {
  font-size: clamp(3.15rem, 9vw, 8.6rem);
  letter-spacing: -0.055em;
  line-height: 0.82;
  text-wrap: balance;
  pointer-events: none;
  text-shadow:
    0 0 10px rgba(225, 233, 255, 0.4),
    0 0 42px rgba(142, 162, 220, 0.13);
}

.hero-controls {
  width: var(--content-width);
  margin-top: clamp(2rem, 5vh, 3.25rem);
}

.social-links {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(0.35rem, 1vw, 0.75rem);
  width: 100%;
}

.social-button {
  display: flex;
  min-width: 0;
  height: clamp(3.35rem, 7vh, 4rem);
  align-items: center;
  justify-content: center;
  gap: clamp(0.35rem, 0.8vw, 0.65rem);
  border: 1px solid var(--line);
  border-radius: 0.2rem;
  background: rgba(0, 0, 0, 0.38);
  color: rgba(244, 247, 255, 0.86);
  font-family: "Courier New", monospace;
  font-size: clamp(0.5rem, 1vw, 0.68rem);
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
  backdrop-filter: blur(5px);
  transition:
    border-color 180ms ease,
    color 180ms ease,
    transform 180ms ease,
    background 180ms ease;
}

.social-button:hover,
.social-button:focus-visible {
  border-color: var(--line-hover);
  background: rgba(15, 20, 31, 0.76);
  color: #fff;
  outline: none;
  transform: translateY(-2px);
}

.social-button img {
  display: block;
  width: 1.35rem;
  height: 1.35rem;
  flex: 0 0 auto;
  object-fit: contain;
  background: transparent;
}

.social-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.social-button--text {
  padding-inline: 0.5rem;
}

.social-button:nth-child(3) img,
.social-button:nth-child(4) img {
  width: 1.55rem;
  height: 1.55rem;
}

.ca-field {
  display: grid;
  grid-template-columns: auto 1fr;
  width: 100%;
  height: clamp(3.1rem, 6.5vh, 3.65rem);
  margin-top: clamp(0.5rem, 1vw, 0.75rem);
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 0.2rem;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(5px);
}

.ca-field span {
  padding: 0 1rem;
  color: rgba(226, 235, 255, 0.7);
  font-family: "Courier New", monospace;
  font-size: 0.66rem;
  letter-spacing: 0.18em;
}

.ca-field input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0 1rem;
  border: 0;
  border-left: 1px solid var(--line);
  outline: none;
  background: transparent;
  color: #fff;
  font-family: "Courier New", monospace;
  font-size: clamp(0.65rem, 1.3vw, 0.82rem);
}

.ca-field input::placeholder {
  color: rgba(226, 235, 255, 0.36);
}

.cosmos-section,
.dex-section {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: #000;
}

.section-shell {
  width: min(90rem, 100%);
  height: 100%;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 4rem);
}

.cosmos-shell {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: clamp(2rem, 7vh, 5.5rem);
  align-content: center;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
}

.section-heading h2 {
  margin-top: 1rem;
  font-size: clamp(3rem, 7.5vw, 7.5rem);
  letter-spacing: -0.055em;
  line-height: 0.82;
}

.space-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  min-height: 0;
  gap: clamp(0.45rem, 1vw, 0.85rem);
}

.space-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(0.85rem, 1.7vw, 1.5rem);
  border: 1px solid rgba(211, 224, 255, 0.16);
  border-radius: 0.55rem;
  background:
    linear-gradient(145deg, rgba(18, 23, 34, 0.92), rgba(4, 6, 10, 0.96));
  text-decoration: none;
  transition:
    border-color 180ms ease,
    transform 180ms ease,
    background 180ms ease;
}

.space-card::after {
  position: absolute;
  right: -3rem;
  bottom: -4rem;
  width: 10rem;
  height: 10rem;
  border-radius: 50%;
  background: rgba(116, 152, 225, 0.09);
  box-shadow: 0 0 4rem rgba(116, 152, 225, 0.12);
  content: "";
  pointer-events: none;
}

.space-card:hover,
.space-card:focus-visible {
  border-color: rgba(192, 217, 255, 0.52);
  background:
    linear-gradient(145deg, rgba(23, 31, 48, 0.96), rgba(6, 9, 15, 0.98));
  outline: none;
  transform: translateY(-2px);
}

.space-card-feature {
  grid-column: span 2;
  grid-row: span 2;
  padding: clamp(1.2rem, 2.8vw, 2.5rem);
  background:
    radial-gradient(circle at 78% 24%, rgba(68, 99, 173, 0.25), transparent 38%),
    linear-gradient(145deg, rgba(18, 27, 48, 0.98), rgba(3, 5, 9, 0.98));
}

.space-card-top {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: rgba(214, 227, 250, 0.48);
  font-family: "Courier New", monospace;
  font-size: clamp(0.46rem, 0.65vw, 0.58rem);
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.space-card-content {
  position: relative;
  z-index: 1;
  margin-block: auto;
}

.space-card strong {
  display: block;
  margin-bottom: clamp(0.35rem, 1vh, 0.8rem);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.1rem, 3.2vw, 3.6rem);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 0.95;
}

.space-card-feature strong {
  font-size: clamp(3.5rem, 7vw, 7.5rem);
}

.space-card strong small {
  color: rgba(225, 234, 250, 0.55);
  font-family: "Courier New", monospace;
  font-size: 0.22em;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.space-card strong sub {
  font-size: 0.45em;
  vertical-align: -0.12em;
}

.space-card h3 {
  max-width: 21rem;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1rem, 1.55vw, 1.45rem);
  font-weight: 400;
  line-height: 1.08;
}

.space-card-feature h3 {
  max-width: 30rem;
  font-size: clamp(1.7rem, 3.1vw, 3.2rem);
  line-height: 1;
}

.space-card p {
  max-width: 28rem;
  margin-top: clamp(0.4rem, 1vh, 0.75rem);
  color: rgba(225, 233, 248, 0.62);
  font-size: clamp(0.62rem, 0.82vw, 0.76rem);
  line-height: 1.42;
}

.space-card-feature p {
  margin-top: 1rem;
  font-size: clamp(0.78rem, 1.1vw, 0.98rem);
  line-height: 1.55;
}

.space-card-source {
  position: relative;
  z-index: 1;
  color: rgba(211, 226, 250, 0.38);
  font-family: "Courier New", monospace;
  font-size: clamp(0.44rem, 0.58vw, 0.54rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.dex-shell {
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 2.5vh, 2rem);
}

.dex-heading {
  display: flex;
  flex: 0 0 auto;
  align-items: end;
  justify-content: space-between;
}

.dex-heading h2 {
  margin-top: 0.45rem;
  font-size: clamp(2.35rem, 5vw, 5rem);
  letter-spacing: -0.045em;
  line-height: 0.9;
}

.dex-heading > a {
  padding-bottom: 0.25rem;
  color: var(--muted);
  font-family: "Courier New", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 180ms ease;
}

.dex-heading > a:hover,
.dex-heading > a:focus-visible {
  color: #fff;
  outline: none;
}

.dex-heading > a[hidden] {
  display: none;
}

.dex-window {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(225, 234, 255, 0.18);
  border-radius: 0.35rem;
  background: #08090b;
}

.dex-window-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  height: 2.5rem;
  flex: 0 0 2.5rem;
  align-items: center;
  gap: 0.65rem;
  padding: 0 0.85rem;
  border-bottom: 1px solid rgba(225, 234, 255, 0.12);
  background: #090a0d;
  color: rgba(231, 238, 255, 0.58);
  font-family: "Courier New", monospace;
  font-size: 0.56rem;
  letter-spacing: 0.14em;
}

.dex-window-bar img {
  width: 1.15rem;
  height: 1.15rem;
  object-fit: contain;
}

.dex-window-bar i {
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 50%;
  background: #65e8bd;
  box-shadow: 0 0 0.75rem rgba(101, 232, 189, 0.7);
}

.dex-window iframe {
  width: 100%;
  min-height: 0;
  flex: 1 1 auto;
  border: 0;
  background: #08090b;
}

@media (max-width: 700px) {
  :root {
    --content-width: calc(100vw - 1.25rem);
  }

  .hero {
    padding-inline: 0.625rem;
  }

  h1 {
    line-height: 0.87;
  }

  .social-links {
    gap: 0.3rem;
  }

  .social-button {
    height: 3.4rem;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.35rem 0.15rem;
    font-size: clamp(0.42rem, 2vw, 0.56rem);
    letter-spacing: 0.03em;
  }

  .social-button img,
  .social-button:nth-child(3) img,
  .social-button:nth-child(4) img {
    width: 1.35rem;
    height: 1.35rem;
  }

  .section-shell {
    padding: 1.25rem;
  }

  .cosmos-shell {
    gap: 1.35rem;
  }

  .section-heading h2 {
    margin-top: 0.65rem;
    font-size: clamp(2.65rem, 14vw, 4.4rem);
  }

  .space-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
  }

  .space-card-feature {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .space-card,
  .space-card-feature {
    padding: 0.65rem;
    border-radius: 0.38rem;
  }

  .space-card-top {
    font-size: 0.4rem;
    letter-spacing: 0.05em;
  }

  .space-card strong,
  .space-card-feature strong {
    margin-bottom: 0.2rem;
    font-size: clamp(1.65rem, 7.5vw, 2.4rem);
  }

  .space-card h3,
  .space-card-feature h3 {
    font-size: clamp(0.76rem, 3.5vw, 1rem);
    line-height: 1.03;
  }

  .space-card p,
  .space-card-feature p {
    margin-top: 0.3rem;
    font-size: clamp(0.5rem, 2.25vw, 0.64rem);
    line-height: 1.26;
  }

  .space-card-source {
    font-size: 0.38rem;
    letter-spacing: 0.04em;
  }

  .dex-heading {
    align-items: start;
  }

  .dex-heading h2 {
    font-size: 2.6rem;
  }

  .dex-heading > a {
    max-width: 6rem;
    padding-top: 0.2rem;
    text-align: right;
    line-height: 1.4;
  }
}

@media (max-height: 650px) and (min-width: 701px) {
  .hero-controls {
    margin-top: 1.4rem;
  }

  .cosmos-shell {
    gap: 1.5rem;
  }

  .section-heading h2 {
    font-size: 3.7rem;
  }

  .space-card p,
  .space-card-feature p {
    margin-top: 0.35rem;
  }

  .section-shell {
    padding-block: 1.5rem;
  }
}

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

  .social-button,
  .space-card {
    transition: none;
  }
}
