:root {
  color-scheme: dark;
  --bg: #070809;
  --text: #f5f5f2;
  --muted: #aaa9a5;
  --line: #2c2e31;
  --orange: #ff7a1a;
  --blue: #2574ff;
  --page-x: clamp(1.5rem, 5.5vw, 6.5rem);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.skip-link {
  position: fixed;
  z-index: 10;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.7rem 1rem;
  background: var(--text);
  color: var(--bg);
  transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

.topbar {
  min-height: 6.25rem;
  padding: 0 var(--page-x);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  text-decoration: none;
  font-size: clamp(1.2rem, 2vw, 1.75rem);
  font-weight: 700;
  letter-spacing: 0.18em;
}

.brand span { color: var(--orange); }

nav { display: flex; gap: clamp(1.5rem, 4vw, 4.5rem); }

nav a {
  position: relative;
  padding: 2.25rem 0;
  color: var(--muted);
  text-decoration: none;
  font-size: 1rem;
}

nav a:hover,
nav a:focus-visible,
nav a.active { color: var(--text); }

nav a.active { color: var(--orange); }

nav a.active::after {
  position: absolute;
  right: 0;
  bottom: 1.4rem;
  left: 0;
  height: 2px;
  background: var(--orange);
  content: "";
}

.hero {
  min-height: calc(100vh - 20.6875rem);
  padding: clamp(3.5rem, 7vh, 7rem) var(--page-x) clamp(3rem, 5vh, 5rem);
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(28rem, 1.08fr);
  align-items: center;
  gap: clamp(2rem, 4vw, 6rem);
}

.hero-copy { max-width: 48rem; }

h1 {
  max-width: none;
  margin: 0;
  font-size: clamp(4rem, 5.7vw, 6.2rem);
  font-weight: 470;
  letter-spacing: -0.055em;
  line-height: 0.95;
  white-space: nowrap;
}

.hero-copy > p {
  max-width: 31ch;
  margin: clamp(2rem, 4vh, 3.2rem) 0;
  color: var(--muted);
  font-size: clamp(1.25rem, 1.9vw, 1.85rem);
  line-height: 1.55;
}

.repository-link {
  width: fit-content;
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--orange);
  text-underline-offset: 0.45rem;
  font-size: clamp(1.15rem, 1.6vw, 1.55rem);
}

.repository-link svg {
  width: 2rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.boundary-visual { min-width: 0; height: 29.25rem; }
.boundary-visual svg { width: 100%; height: 100%; display: block; overflow: visible; }
.mesh path { fill: none; stroke: #777b82; stroke-width: 1; opacity: 0.58; }
.rays path { fill: none; stroke: var(--orange); stroke-width: 1; opacity: 0.64; }
.horizon { fill: none; stroke: var(--orange); stroke-width: 1.5; }
.root-path { fill: none; stroke: var(--blue); stroke-width: 2; }
.probe { fill: none; stroke: var(--orange); stroke-dasharray: 4 4; stroke-width: 1.5; }
.probe.muted { stroke: #a8acb4; }
.probe-point { fill: var(--orange); }

.status-rail {
  min-height: 5.5rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.status-item {
  padding: 1.5rem var(--page-x);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: clamp(0.75rem, 1.2vw, 1rem);
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.status-item + .status-item { border-left: 1px solid var(--line); }

.status-item svg {
  width: 2.8rem;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--orange);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.broken-ring {
  width: 2.8rem;
  height: 2.8rem;
  flex: 0 0 auto;
  border: 4px dashed var(--orange);
  border-radius: 50%;
}

footer {
  min-height: 8.5rem;
  padding: 0 var(--page-x);
  color: #8f8e8a;
  display: flex;
  align-items: center;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  letter-spacing: 0.11em;
}

:focus-visible { outline: 2px solid var(--blue); outline-offset: 5px; }

@media (max-width: 960px) {
  .topbar { min-height: 5rem; }
  nav a { padding: 1.75rem 0; }
  nav a.active::after { bottom: 1rem; }
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 4rem;
  }
  .boundary-visual {
    width: min(100%, 40rem);
    height: auto;
    margin: 0 auto;
  }
  .boundary-visual svg { height: auto; }
  .status-rail { grid-template-columns: 1fr; }
  .status-item { min-height: 5rem; }
  .status-item + .status-item { border-top: 1px solid var(--line); border-left: 0; }
}

@media (max-width: 560px) {
  .topbar { align-items: flex-start; flex-direction: column; padding-top: 1.5rem; }
  nav { width: 100%; justify-content: space-between; }
  .hero { gap: 2.5rem; }
  h1 { font-size: clamp(3.4rem, 17vw, 5rem); }
  h1 { white-space: normal; }
  .hero-copy > p { font-size: 1.2rem; }
  .status-item { white-space: normal; }
}

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