/*
  Global color system for the homepage.
  The background colors define the space gradient, while accent colors drive UI highlights.
*/
:root {
  --bg-space-top: #020611;
  --bg-space-mid: #061635;
  --bg-space-bottom: #0a2750;
  --surface: rgba(6, 16, 33, 0.58);
  --surface-strong: rgba(7, 18, 39, 0.85);
  --text-main: #f3f8ff;
  --text-soft: #b9d0ef;
  --accent: #70e2ff;
  --accent-soft: #bdefff;
  --line: rgba(167, 215, 255, 0.3);

  /* Global star speed multiplier (1 = original speed, 2 = twice as fast, 0.5 = half speed). */
  --star-rotation-speed: 1;
  --star-far-rotation-seconds: 820;
  --star-mid-rotation-seconds: 680;
  --star-near-rotation-seconds: 520;
}

* {
  /* Keep width/height calculations predictable across all components. */
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
}

body {
  /* Layered gradients create depth before stars and nebula are drawn on top. */
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(1300px 900px at 84% 14%, rgba(41, 120, 255, 0.26), transparent 55%),
    radial-gradient(1000px 760px at 12% 82%, rgba(108, 95, 255, 0.16), transparent 60%),
    linear-gradient(180deg, var(--bg-space-bottom) 0%, var(--bg-space-mid) 44%, var(--bg-space-top) 100%);
  overflow: hidden;
}

.scroll-pages {
  /* Main scroll container: one full-viewport section per snap step. */
  position: relative;
  height: 100vh;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  z-index: 1;
}

.page {
  /* Each section behaves like a full-screen "page" in the stack. */
  min-height: 100vh;
  width: min(1100px, 92vw);
  margin: 0 auto;
  padding: clamp(4.5rem, 9vh, 7rem) clamp(1.2rem, 3vw, 2rem);
  display: grid;
  align-content: center;
  gap: 1.2rem;
  scroll-snap-align: start;
  position: relative;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent-soft);
  font-size: 0.78rem;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.08;
  font-family: "Fraunces", Georgia, serif;
}

h1 {
  font-size: clamp(2.1rem, 7.6vw, 5.1rem);
  max-width: 19ch;
}

h2 {
  font-size: clamp(1.7rem, 5vw, 3.6rem);
  max-width: 26ch;
}

.lead,
.about-copy,
.fineprint {
  margin: 0;
  color: var(--text-soft);
  max-width: 65ch;
  font-size: clamp(1rem, 2.1vw, 1.25rem);
  line-height: 1.6;
}

/* Optional utility for secondary snippets that should feel softer than body text. */
.subtle-excerpt {
  color: rgba(185, 208, 239, 0.509);
  font-size: 0.92em;
}

.hero-actions {
  /* Group primary and secondary call-to-action buttons. */
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 0.8rem;
}

.btn {
  /* Reusable button style for both links and actions. */
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.72rem 1.2rem;
  text-decoration: none;
  color: var(--text-main);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(110deg, var(--accent) 0%, #5ec2ff 100%);
  color: #032033;
  border-color: transparent;
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  border-color: var(--accent-soft);
}

.cards {
  /* Responsive card grid for project highlights. */
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 0.6rem;
}

.card {
  /* Frosted panel look keeps cards readable over starfield motion. */
  text-decoration: none;
  color: var(--text-main);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1rem;
  backdrop-filter: blur(9px);
  min-height: 220px;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 0.65rem;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.card p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.45;
}

.card span {
  align-self: end;
  color: var(--accent-soft);
}

.card:hover,
.card:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(149, 224, 255, 0.75);
  background: var(--surface-strong);
}

.cover-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, auto));
  grid-auto-rows: 1fr;
  gap: 1.2rem;
  margin-top: 0.8rem;
  justify-content: center;
}

.page.covers {
  /* Approximate: X = 100% - 2Y, where Y is heading/eyebrow vertical footprint. */
  --covers-heading-space: clamp(5.4rem, 13vh, 9.2rem);
  --covers-band-height: calc(100vh - (2 * var(--covers-heading-space)));
  align-content: stretch;
  grid-template-rows: auto minmax(0, var(--covers-band-height));
  gap: 0.1vw;
  width: 96vw;
}

.covers-heading {
  width: fit-content;
  margin: 0 auto;
}

.page.covers .cover-cards {
  height: 100%;
  margin-top: 0.45rem;
}

.cover-card {
  text-decoration: none;
  color: var(--text-main);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1rem;
  backdrop-filter: blur(9px);
  display: flex;
  flex-direction: row;
  gap: 0.75rem;
  min-height: 0;
  height: 100%;
  align-items: start;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
  width:fit-content;
}

.cover-card:hover,
.cover-card:focus-within,
.cover-card:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(149, 224, 255, 0.75);
  background: var(--surface-strong);
}

.cover-card-image {
  width: auto;
  height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: 0.7rem;
  border: 1px solid rgba(161, 216, 255, 0.16);
  background: rgba(3, 10, 20, 0.44);
  flex-shrink: 0;
  align-self: stretch;
}

.cover-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-width: 0;
  width: auto;
  flex-shrink: 0;
  height: 100%;
}
.cover-card-body h3 {

}

.cover-card-body p {
  margin: 0;
  width:15rem;
  color: var(--text-soft);
  line-height: 1.45;
}

.cover-card-body span {
  margin-top: auto;
  align-self: flex-end;
  color: var(--accent-soft);
}

.signup {
  /* Form layout wraps naturally on narrower screens. */
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.signup input,
.signup button {
  border-radius: 0.8rem;
  border: 1px solid var(--line);
  font-size: 1rem;
  padding: 0.75rem 0.95rem;
  font-family: inherit;
}

.signup input {
  min-width: min(320px, 100%);
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.18);
}

.signup input::placeholder {
  color: #a4c3df;
}

.signup input:focus-visible {
  outline: 1px solid var(--accent-soft);
  outline-offset: 2px;
}

.signup button {
  background: linear-gradient(110deg, var(--accent) 0%, #5ec2ff 100%);
  color: #032033;
  cursor: pointer;
}

.dot-nav {
  /* Quick section navigation that mirrors current scroll position. */
  position: fixed;
  top: 50%;
  right: 1rem;
  transform: translateY(-50%);
  display: grid;
  gap: 0.6rem;
  z-index: 5;
}

.dot {
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.13);
}

.dot.is-active {
  background: var(--accent-soft);
  border-color: var(--accent-soft);
  box-shadow: 0 0 0 4px rgba(189, 239, 255, 0.22);
}

.fineprint {
  font-size: 0.9rem;
}

.fineprint a {
  color: var(--accent-soft);
}

.page.longread {
  align-content: start;
  width: min(1100px, 92vw);
}

.longread-columns {
  columns: 2;
  column-width: auto;
  column-gap: clamp(1.5rem, 3vw, 2.4rem);
  column-rule: 1px solid var(--line);
  column-fill: balance;
}

.longread-columns p {
  margin: 0 0 1rem;
  color: var(--text-soft);
  line-height: 1.65;
  break-inside: avoid;
  break-inside: avoid-column;
  -webkit-column-break-inside: avoid;
}

/* Highlight one key paragraph in the longread block. */
.longread-columns p.longread-highlight {
  color: var(--text-main);
  background: rgba(9, 27, 53, 0.52);
  border: 1px solid rgba(138, 208, 255, 0.34);
  border-radius: 0.8rem;
  padding: 0.85rem 0.95rem;
  box-shadow: 0 10px 26px rgba(2, 8, 18, 0.35);
}

/* Tiny in-column heading you can place between paragraph blocks. */
.column-mini-header {
  margin: 0.5rem 0 0.45rem;
  color: var(--accent-soft);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.35;
}

/* Inline emphasis with Cherenkov-like cyan glow and ghost afterimages. */
.cherenkov-inline {
  position: relative;
  display: inline-block;
  isolation: isolate;
  font-weight: 700;
  color: #5dc7ff;
  text-shadow:
    0 0 0.34rem rgba(38, 202, 255, 0.94),
    0 0 0.98rem rgba(28, 150, 255, 0.86),
    0 0 1.9rem rgba(34, 96, 255, 0.74);
  animation: cherenkovPulse 1.7s steps(2, end) infinite;
}

.cherenkov-inline::before,
.cherenkov-inline::after {
  content: attr(data-glow);
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.48;
}

.cherenkov-inline::before {
  color: rgba(30, 101, 255, 0.9);
  text-shadow: 0 0 0.95rem rgba(14, 19, 178, 0.86);
  filter: blur(0.03em);
  animation: cherenkovGhostA 170ms steps(1, end) infinite;
}

.cherenkov-inline::after {
  color: rgba(74, 109, 255, 0.9);
  text-shadow: 0 0 1.05rem rgba(68, 118, 255, 0.88);
  filter: blur(0.04em);
  animation: cherenkovGhostB 230ms steps(1, end) infinite;
}

@keyframes cherenkovPulse {
  0% {
    text-shadow:
      0 0 0.3rem rgba(40, 206, 255, 0.95),
      0 0 0.82rem rgba(31, 162, 255, 0.86),
      0 0 1.65rem rgba(42, 116, 255, 0.74);
  }
  45% {
    text-shadow:
      0 0 0.58rem rgba(56, 218, 255, 0.97),
      0 0 1.35rem rgba(38, 178, 255, 0.92),
      0 0 2.35rem rgba(69, 138, 255, 0.84);
  }
  100% {
    text-shadow:
      0 0 0.36rem rgba(46, 208, 255, 0.95),
      0 0 0.9rem rgba(35, 170, 255, 0.88),
      0 0 1.9rem rgba(59, 132, 255, 0.79);
  }
}

@keyframes cherenkovGhostA {
  0% {
    transform: translate(-0.03em, 0.02em);
    opacity: 0.24;
  }
  20% {
    transform: translate(-0.24em, -0.11em);
    opacity: 0.62;
  }
  45% {
    transform: translate(-0.14em, 0.16em);
    opacity: 0.36;
  }
  75% {
    transform: translate(-0.28em, 0.12em);
    opacity: 0.55;
  }
  100% {
    transform: translate(-0.18em, -0.14em);
    opacity: 0.3;
  }
}

@keyframes cherenkovGhostB {
  0% {
    transform: translate(0.04em, -0.02em);
    opacity: 0.21;
  }
  18% {
    transform: translate(0.2em, -0.14em);
    opacity: 0.5;
  }
  40% {
    transform: translate(0.27em, 0.11em);
    opacity: 0.42;
  }
  70% {
    transform: translate(0.14em, 0.17em);
    opacity: 0.3;
  }
  100% {
    transform: translate(0.23em, 0.13em);
    opacity: 0.56;
  }
}

@media (max-width: 900px) {
  /* Collapse cards for tablet and smaller screens. */
  .cards {
    grid-template-columns: 1fr;
  }

  .cover-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dot-nav {
    right: 0.55rem;
  }
}

@media (max-width: 640px) {
  /* Mobile tuning: easier scrolling and relocated dot navigation. */
  body {
    overflow: auto;
  }

  .scroll-pages {
    scroll-snap-type: y proximity;
  }

  .page {
    padding-top: 5.2rem;
    padding-bottom: 4rem;
  }

  .dot-nav {
    top: auto;
    bottom: 1rem;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    grid-auto-flow: column;
  }

  .signup input,
  .signup button {
    width: 100%;
  }

  .cover-cards {
    grid-template-columns: 1fr;
  }

  .longread-columns {
    columns: 1;
    column-width: auto;
  }
}
