/* Kadros Games — one-page studio site.
   Self-hosted fonts (SIL OFL, licenses in /fonts). No third-party requests. */

@font-face {
  font-family: "Hanken Grotesk";
  src: url("fonts/HankenGrotesk-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/IBMPlexMono-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Tokens ---------- */

:root {
  --ink: #05090d;
  --ink-raised: #0a1118;
  --paper: #ece8de;
  --muted: #a5b6be;
  --dim: #8497a1;
  --accent: #9ad2d7;
  --accent-strong: #b6e2e6;
  --on-accent: #05090d;

  --line: rgb(154 210 215 / 0.18);
  --line-faint: rgb(154 210 215 / 0.1);
  --line-strong: rgb(154 210 215 / 0.4);

  --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;

  --gutter: clamp(1.25rem, 5vw, 4rem);
  --max: 77.5rem;
  --header-h: 4.25rem;
  --section-gap: clamp(2rem, 6vw, 6rem);
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--ink);
}

body {
  position: relative;
  isolation: isolate;
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
  color: var(--paper);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  background:
    radial-gradient(70rem 42rem at 88% -6%, rgb(154 210 215 / 0.075), transparent 70%),
    radial-gradient(60rem 40rem at -8% 58%, rgb(154 210 215 / 0.035), transparent 70%),
    var(--ink);
  background-repeat: no-repeat;
}

/* Starfield: original tiles, three layers, no repetition visible at normal sizes. */
body::before,
body::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(#000 38rem, rgb(0 0 0 / 0.45) 62rem);
  mask-image: linear-gradient(#000 38rem, rgb(0 0 0 / 0.45) 62rem);
}

body::before {
  background-image: url("assets/stars-near.svg"), url("assets/stars-far.svg");
  background-position: 0 0, 137px 211px;
}

body::after {
  background-image: url("assets/stars-twinkle.svg");
  background-position: 311px 97px;
}

h1,
h2,
h3,
p,
ul,
figure {
  margin: 0;
  padding: 0;
}

ul {
  list-style: none;
}

svg {
  display: block;
}

a {
  color: inherit;
}

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.wrap {
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 50;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 500;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

.svg-defs {
  position: absolute;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgb(5 9 13 / 0.8);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-faint);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--paper);
  text-decoration: none;
}

.brand-mark {
  width: 1.875rem;
  height: 1.875rem;
}

.brand-name {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.brand-name span {
  color: var(--muted);
  font-weight: 400;
}

.nav {
  display: flex;
  gap: clamp(1.25rem, 3.4vw, 2.75rem);
}

.nav a {
  padding-block: 0.5rem;
  color: var(--muted);
  font-size: 0.9375rem;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.45em;
}

.nav a:hover {
  color: var(--paper);
  text-decoration-color: var(--accent);
}

/* ---------- Shared type ---------- */

.label,
.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  line-height: 1.5;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  flex: none;
  width: 2.25rem;
  height: 1px;
  background: currentColor;
}

.title-xl {
  font-size: clamp(3.25rem, 8.6vw, 6.75rem);
  font-weight: 300;
  letter-spacing: -0.035em;
  line-height: 0.96;
}

.title-lg {
  font-size: clamp(2.125rem, 4.7vw, 3.75rem);
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1.06;
  text-wrap: balance;
}

.body-text {
  max-width: 38rem;
  color: var(--muted);
  font-size: clamp(1rem, 0.35vw + 0.93rem, 1.1875rem);
  line-height: 1.68;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: calc(100svh - var(--header-h));
  overflow: clip;
  padding-block: clamp(3.5rem, 8vw, 7rem) clamp(4rem, 9vw, 8rem);
  -webkit-mask-image: linear-gradient(#000 calc(100% - 7rem), transparent);
  mask-image: linear-gradient(#000 calc(100% - 7rem), transparent);
}

/* Quiet the stars behind the headline so they never read as punctuation. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgb(5 9 13 / 0.62), rgb(5 9 13 / 0.4) 42%, transparent 64%);
  pointer-events: none;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hero h1 {
  margin-top: clamp(1.25rem, 2.4vw, 2rem);
  font-size: clamp(3rem, 16.4vw, 7.75rem);
  font-weight: 300;
  letter-spacing: -0.04em;
  line-height: 0.93;
}

/* Art sits beside the text from here up: keep the headline clear of the star. */
@media (min-width: 48.0625rem) {
  .hero h1 {
    font-size: clamp(3rem, 8.9vw, 7.75rem);
  }
}

.hero h1 span {
  display: block;
}

.lead {
  max-width: 33rem;
  margin-top: clamp(1.5rem, 3vw, 2.5rem);
  color: var(--muted);
  font-size: clamp(1.0625rem, 0.6vw + 0.95rem, 1.3125rem);
  line-height: 1.6;
  text-wrap: pretty;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.875rem;
  margin-top: clamp(2rem, 4vw, 3rem);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 3.125rem;
  padding: 0 1.6rem;
  border: 1px solid transparent;
  border-radius: 2px;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
}

.btn svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: square;
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}

.btn-primary:hover {
  background: var(--accent-strong);
}

.btn-ghost {
  border-color: var(--line-strong);
  color: var(--paper);
}

.btn-ghost:hover {
  border-color: var(--accent);
  background: rgb(154 210 215 / 0.08);
}

/* Orrery: concentric orbits around a single bright star, drawn in SVG. */
.hero-art {
  position: absolute;
  z-index: -1;
  top: 0;
  left: min(68%, calc(50% + 27rem));
  height: 100%;
  aspect-ratio: 1;
  transform: translateX(-50%);
  -webkit-mask-image: radial-gradient(closest-side, #000 60%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 60%, transparent 100%);
  pointer-events: none;
}

.orrery {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.orrery .ring {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1;
  stroke-opacity: 0.32;
}

.orrery .ring-faint {
  stroke-opacity: 0.15;
}

.orrery .ring-dust {
  stroke-dasharray: 1 9;
  stroke-opacity: 0.6;
}

.orrery .ring-arcs {
  stroke-dasharray: 250 30 70 30;
  stroke-opacity: 0.36;
}

.orrery .body {
  fill: var(--accent);
}

.orrery .body-dim {
  fill-opacity: 0.55;
}

.orrery .halo {
  fill: none;
  stroke: var(--accent);
  stroke-opacity: 0.38;
  stroke-dasharray: 2 4;
}

.orrery .planet {
  fill: var(--ink);
  stroke: var(--accent);
  stroke-width: 1.2;
}

.orrery .trail path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
  stroke-linecap: round;
}

.orrery .dart {
  fill: var(--paper);
}

.orrery .star-glow {
  fill: url("#star-glow");
}

.orrery .flare {
  fill: none;
  stroke-width: 1.1;
}

.orrery .star-core {
  fill: #fff6e6;
}

/* ---------- Sections ---------- */

.section {
  position: relative;
  isolation: isolate;
  overflow: clip;
  padding-block: 0 clamp(4.5rem, 10vw, 9rem);
}

.section > .wrap {
  padding-top: 1.35rem;
  border-top: 1px solid var(--line);
}

.status-dot {
  position: relative;
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
}

.status-dot::after {
  content: "";
  position: absolute;
  inset: -0.3rem;
  border: 1px solid var(--accent);
  border-radius: 50%;
  opacity: 0.4;
}

/* Project Sirius */

.sirius-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: var(--section-gap);
  align-items: center;
  margin-top: clamp(2.5rem, 5vw, 4.5rem);
}

.subtitle {
  margin-top: clamp(1.25rem, 2.4vw, 1.75rem);
  font-size: clamp(1.25rem, 1vw + 1rem, 1.75rem);
  font-weight: 300;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.sirius-copy .body-text {
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
}

.sector {
  position: relative;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgb(10 17 24 / 0.92), rgb(7 12 17 / 0.92));
  box-shadow: 0 1.5rem 3rem -1.5rem rgb(0 0 0 / 0.6);
}

.sector::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: -1px;
  left: -1px;
  width: 2rem;
  height: 2px;
  background: var(--accent);
}

.sector svg {
  width: 100%;
  height: auto;
}

.map-grid {
  fill: none;
  stroke: var(--accent);
  stroke-opacity: 0.075;
}

.map-territory polygon {
  stroke: var(--accent);
  stroke-opacity: 0.4;
  stroke-width: 1;
  stroke-dasharray: 5 5;
  stroke-linejoin: round;
}

.map-hatch {
  stroke: var(--accent);
  stroke-opacity: 0.22;
}

.map-dot {
  fill: var(--accent);
  fill-opacity: 0.4;
}

.map-routes path {
  fill: none;
  stroke: var(--accent);
  stroke-opacity: 0.55;
  stroke-width: 1.2;
}

.map-routes .route-flow {
  stroke-dasharray: 2 7;
  stroke-linecap: round;
  stroke-opacity: 0.75;
}

.map-ships path {
  fill: var(--paper);
}

.map-stations circle {
  fill: var(--ink-raised);
  stroke: var(--accent);
  stroke-width: 1.3;
}

.map-stations .core {
  fill: var(--accent);
  stroke: none;
}

.map-stations .hub-orbit {
  fill: none;
  stroke-dasharray: 2 4;
  stroke-opacity: 0.6;
}

.map-frame {
  fill: none;
  stroke: var(--accent);
  stroke-opacity: 0.55;
  stroke-width: 1.2;
}

.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: clamp(3.5rem, 7vw, 6rem);
  border-top: 1px solid var(--line);
}

.features li {
  padding: 2rem 2rem 0 0;
}

.features li + li {
  padding-left: 2rem;
  border-left: 1px solid var(--line);
}

.glyph {
  width: 2.25rem;
  height: 2.25rem;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.glyph .fill {
  fill: var(--accent);
  stroke: none;
}

.features h3 {
  margin-top: 1.25rem;
  font-size: 1.3125rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.features p {
  max-width: 22rem;
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

/* How we build */

.build-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: var(--section-gap);
  align-items: center;
  margin-top: clamp(2.5rem, 5vw, 4.5rem);
}

.build-copy .body-text {
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
}

.loop {
  width: 100%;
  max-width: 26rem;
  margin-block: -3.5rem;
  justify-self: end;
}

.loop svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.loop-outer {
  fill: none;
  stroke: var(--accent);
  stroke-opacity: 0.16;
  stroke-dasharray: 1 8;
}

.loop-pulse {
  fill: none;
  stroke: var(--accent);
  stroke-opacity: 0.32;
}

.loop-core {
  fill: var(--paper);
}

.loop-track {
  fill: none;
  stroke: var(--accent);
  stroke-opacity: 0.14;
}

.loop-arcs path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.4;
  stroke-opacity: 0.7;
}

.loop-chevrons path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
  stroke-linecap: square;
}

.loop-nodes circle {
  fill: var(--ink-raised);
  stroke: var(--accent);
  stroke-width: 1.5;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 clamp(1rem, 2.5vw, 2.5rem);
  margin-top: clamp(3.5rem, 7vw, 6rem);
}

.stats li {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--line);
}

.stats li::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 2rem;
  height: 2px;
  background: var(--accent);
}

.stat-value {
  font-size: clamp(2.6rem, 5.6vw, 4.75rem);
  font-weight: 300;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.035em;
  line-height: 1;
  white-space: nowrap;
}

.stat-value .unit {
  color: var(--accent);
}

.stat-value .unit-word {
  margin-inline: 0.02em;
  font-size: 0.5em;
  letter-spacing: 0;
}

.stat-caption {
  max-width: 15rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.45;
}

/* Contact */

.contact {
  padding-bottom: clamp(5rem, 11vw, 10rem);
}

.contact::before,
.contact::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: 50%;
  aspect-ratio: 1;
  border: 1px solid var(--line-faint);
  border-radius: 50%;
  pointer-events: none;
}

.contact::before {
  right: -14rem;
  width: 34rem;
  transform: translateY(-38%);
}

.contact::after {
  right: -22rem;
  width: 50rem;
  transform: translateY(-38%);
  border-style: dashed;
  border-color: var(--line-faint);
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--section-gap);
  align-items: end;
  margin-top: clamp(2.5rem, 5vw, 4.5rem);
}

.contact-text {
  color: var(--muted);
  font-size: clamp(1.25rem, 1.4vw + 0.95rem, 1.875rem);
  font-weight: 300;
  line-height: 1.35;
  padding-bottom: 0.4rem;
}

.contact-text a {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin-top: 0.4rem;
  color: var(--paper);
  font-weight: 400;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
}

.contact-text a:hover {
  color: var(--accent);
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line-faint);
  background: rgb(5 9 13 / 0.72);
}

.footer-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-block: 1.75rem;
}

.footer-mark {
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
}

.site-footer p {
  color: var(--dim);
  font-size: 0.875rem;
  line-height: 1.55;
}

.site-footer .sep {
  margin-inline: 0.35rem;
}

/* ---------- Responsive ---------- */

@media (max-width: 60rem) {
  .sirius-grid,
  .build-grid,
  .contact-grid {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .loop {
    justify-self: start;
    max-width: 19rem;
    margin-block: 0;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 2.5rem;
  }

  .contact-text {
    padding-bottom: 0;
  }
}

@media (max-width: 48rem) {
  .site-header {
    position: static;
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .header-row {
    flex-wrap: wrap;
    gap: 0;
    padding-top: 0.5rem;
  }

  .nav {
    width: 100%;
    justify-content: space-between;
    margin-top: 0.25rem;
    border-top: 1px solid var(--line-faint);
  }

  .nav a {
    padding-block: 0.8rem;
  }

  .hero {
    min-height: 0;
    align-items: flex-start;
    padding-block: 3rem 17rem;
  }

  .hero-art {
    top: auto;
    bottom: -9.5rem;
    left: 70%;
    width: 36rem;
    height: auto;
  }

  .features {
    grid-template-columns: minmax(0, 1fr);
    border-top: 0;
  }

  .features li,
  .features li + li {
    padding: 1.75rem 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .features li:last-child {
    padding-bottom: 0;
  }

  .features p {
    max-width: none;
  }

  .contact::before {
    right: -20rem;
  }

  .contact::after {
    right: -26rem;
  }

  .footer-row {
    align-items: flex-start;
  }

  .site-footer .sep {
    display: none;
  }

  .site-footer p span {
    display: block;
  }
}

/* ---------- Motion (opt-in) ---------- */

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  .nav a,
  .btn,
  .contact-text a {
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, text-decoration-color 0.2s ease;
  }

  .btn svg {
    transition: transform 0.2s ease;
  }

  .btn-primary:hover svg {
    transform: translateY(2px);
  }

  @keyframes rise {
    from {
      opacity: 0;
      transform: translateY(0.75rem);
    }
  }

  @keyframes settle {
    from {
      opacity: 0;
    }
  }

  @keyframes spin {
    to {
      transform: rotate(360deg);
    }
  }

  @keyframes twinkle {
    from {
      opacity: 0.35;
    }
    to {
      opacity: 1;
    }
  }

  @keyframes flow {
    to {
      stroke-dashoffset: -18;
    }
  }

  @keyframes beacon {
    from {
      transform: scale(0.7);
      opacity: 0.55;
    }
    to {
      transform: scale(1.5);
      opacity: 0;
    }
  }

  .hero-copy > * {
    animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .hero-copy > :nth-child(2) {
    animation-delay: 0.08s;
  }

  .hero-copy > :nth-child(3) {
    animation-delay: 0.16s;
  }

  .hero-copy > :nth-child(4) {
    animation-delay: 0.24s;
  }

  .hero-art {
    animation: settle 1.8s ease-out both;
  }

  body::after {
    animation: twinkle 7s ease-in-out infinite alternate;
  }

  .orbit,
  .loop-outer,
  .hub-orbit {
    animation: spin linear infinite;
  }

  .orbit-a {
    animation-duration: 140s;
  }

  .orbit-b {
    animation-duration: 220s;
    animation-direction: reverse;
  }

  .orbit-c {
    animation-duration: 300s;
  }

  .orbit-d {
    animation-duration: 380s;
    animation-direction: reverse;
  }

  .orbit-e {
    animation-duration: 520s;
  }

  .orbit,
  .hub-orbit {
    transform-origin: 0 0;
  }

  .loop-outer {
    transform-origin: 180px 180px;
    animation-duration: 160s;
  }

  .hub-orbit {
    animation-duration: 40s;
  }

  .map-routes .route-flow {
    animation: flow 5s linear infinite;
  }

  .status-dot::after {
    animation: beacon 2.4s ease-out infinite;
  }
}
