@font-face {
  font-family: "Barlow Condensed";
  src: url("fonts/BarlowCondensed-Regular.ttf") format("truetype");
  font-display: swap;
  font-style: normal;
  font-weight: 400;
}

@font-face {
  font-family: "Barlow Condensed";
  src: url("fonts/BarlowCondensed-SemiBold.ttf") format("truetype");
  font-display: swap;
  font-style: normal;
  font-weight: 600;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/IBMPlexMono-Regular.ttf") format("truetype");
  font-display: swap;
  font-style: normal;
  font-weight: 400;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/IBMPlexMono-SemiBold.ttf") format("truetype");
  font-display: swap;
  font-style: normal;
  font-weight: 600;
}

:root {
  --void: #07090a;
  --carbon: #1d1c1a;
  --carbon-raised: #242625;
  --cyan: #37c6c7;
  --cyan-muted: #218f91;
  --yellow: #ead23b;
  --oxide: #ca402b;
  --paper: #d8d6c8;
  --muted: #849193;
  --rule: #3f4848;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--void);
  color: var(--paper);
  font-family: var(--mono);
  line-height: 1.6;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(55, 198, 199, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(55, 198, 199, 0.025) 1px, transparent 1px),
    var(--void);
  background-size: 72px 72px;
}

a {
  color: var(--cyan);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  touch-action: manipulation;
}

a:hover {
  color: var(--yellow);
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.6rem 0.8rem;
  color: var(--void);
  background: var(--yellow);
  transform: translateY(-160%);
}

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

.site-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  max-width: 1440px;
  margin: 0 auto;
  padding: 2rem clamp(1.25rem, 4vw, 4rem) 1rem;
  border-bottom: 1px solid var(--rule);
}

.wordmark {
  display: flex;
  flex-direction: column;
  color: var(--paper);
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 0.86;
  text-decoration: none;
  text-transform: uppercase;
}

.wordmark span:last-child {
  color: var(--cyan);
}

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 0.25rem 1.2rem;
  font-family: var(--display);
  font-size: 1.05rem;
}

nav a {
  color: var(--muted);
  text-decoration: none;
}

nav a[aria-current="page"] {
  color: var(--yellow);
}

.sponsor-rail {
  display: grid;
  grid-template-columns: auto 42px minmax(30px, 1fr) minmax(140px, 290px);
  align-items: center;
  gap: 1rem;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.65rem clamp(1.25rem, 4vw, 4rem);
  color: var(--muted);
  font-size: 0.67rem;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--rule);
}

.sunet-logo {
  width: 28px;
  height: 36px;
  object-fit: contain;
  padding: 3px;
  background: var(--paper);
}

.rail-junction {
  height: 1px;
  background:
    linear-gradient(
      90deg,
      var(--oxide) 0 10%,
      var(--rule) 10% 80%,
      var(--yellow) 80%
    );
}

.ono-logo {
  width: 100%;
  height: 44px;
  object-fit: contain;
  object-position: right center;
}

.page-shell {
  max-width: 1440px;
  min-height: 70vh;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 5rem) clamp(1.25rem, 4vw, 4rem);
}

.page-shell > :first-child {
  margin-top: 0;
}

.page-shell > h1,
.page-shell > h2,
.page-shell > h3 {
  max-width: 900px;
}

.page-shell > p,
.page-shell > ul,
.page-shell > ol {
  max-width: 76ch;
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1;
  scroll-margin-top: 1rem;
  text-wrap: balance;
}

h1 {
  margin: 0 0 1.5rem;
  color: var(--paper);
  font-size: clamp(3.5rem, 11vw, 9.5rem);
  letter-spacing: -0.035em;
  text-transform: uppercase;
}

h2 {
  margin: 0 0 1rem;
  color: var(--paper);
  font-size: clamp(2.25rem, 5vw, 4.4rem);
}

h3 {
  font-size: 1.8rem;
}

.system-label {
  margin: 0 0 0.6rem;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 0.72rem;
}

.system-label::before {
  content: "[";
  color: var(--yellow);
}

.system-label::after {
  content: "]";
  color: var(--yellow);
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(240px, 0.8fr);
  min-height: 600px;
  overflow: hidden;
  border-bottom: 1px solid var(--rule);
}

.hero-copy {
  position: relative;
  z-index: 2;
  align-self: center;
  padding: 2rem 0 4rem;
}

.hero-intro {
  max-width: 60ch;
  color: var(--muted);
  font-size: clamp(1rem, 1.8vw, 1.25rem);
}

.event-window {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 0.15rem 1rem;
  max-width: 560px;
  margin-top: 2.5rem;
  padding: 1rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.event-window span {
  color: var(--muted);
  font-size: 0.72rem;
}

.event-window time {
  color: var(--yellow);
}

.hero-seal {
  position: relative;
  min-height: 540px;
}

.hero-seal::before {
  content: "";
  position: absolute;
  inset: 8% -10% 8% 10%;
  border: 1px solid var(--cyan-muted);
  clip-path: polygon(0 0, 90% 0, 100% 12%, 100% 100%, 10% 100%, 0 88%);
}

.hero-seal img {
  position: absolute;
  top: 50%;
  left: 55%;
  width: min(680px, 54vw);
  height: auto;
  max-width: none;
  opacity: 0.5;
  filter: saturate(0.9) contrast(1.1);
  transform: translate(-50%, -50%);
  animation: seal-sync 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes seal-sync {
  from {
    opacity: 0;
    transform: translate(-47%, -50%);
    clip-path: inset(0 100% 0 0);
  }
  to {
    opacity: 0.5;
    transform: translate(-50%, -50%);
    clip-path: inset(0);
  }
}

.federation {
  position: relative;
  padding: 4rem 0;
  border-bottom: 1px solid var(--rule);
}

.section-heading {
  margin-bottom: 2rem;
}

.inline-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.federation-line {
  position: absolute;
  right: 7%;
  bottom: 6.5rem;
  left: 7%;
  height: 1px;
  background: var(--cyan-muted);
}

.nodes {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(0.5rem, 2vw, 2rem);
}

.nodes a {
  position: relative;
  min-height: 110px;
  padding: 1rem;
  color: var(--paper);
  background: var(--void);
  border: 1px solid var(--rule);
  text-decoration: none;
  clip-path: polygon(0 0, 90% 0, 100% 16%, 100% 100%, 0 100%);
}

.nodes a::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 50%;
  width: 9px;
  height: 9px;
  background: var(--yellow);
  border: 2px solid var(--void);
  transform: rotate(45deg);
}

.nodes a:hover,
.nodes a:focus-visible {
  color: var(--yellow);
  border-color: var(--cyan);
}

.nodes strong,
.nodes span {
  display: block;
}

.nodes strong {
  font-family: var(--display);
  font-size: clamp(1.4rem, 3vw, 2.2rem);
}

.nodes span {
  color: var(--muted);
  font-size: 0.7rem;
}

.operations {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 0.7fr);
  border-bottom: 1px solid var(--rule);
}

.scoreboard-panel {
  padding: 4rem 3rem 4rem 0;
  border-right: 1px solid var(--rule);
}

.event-panel {
  padding: 4rem 0 4rem 3rem;
}

.event-state {
  margin: 0;
  color: var(--yellow);
  font-family: var(--display);
  font-size: 2.5rem;
  line-height: 1;
}

.countdown {
  margin: 1rem 0 2rem;
  color: var(--cyan);
  font-size: clamp(1.5rem, 4vw, 3rem);
}

.scoreboard-header,
.scoreboard li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px 170px;
  gap: 1rem;
  align-items: baseline;
}

.scoreboard-header {
  padding: 0.5rem 0;
  color: var(--muted);
  font-size: 0.65rem;
  border-bottom: 1px solid var(--cyan-muted);
}

.scoreboard {
  margin: 0;
  padding: 0;
  list-style: none;
}

.scoreboard li {
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--rule);
}

.scoreboard .rank {
  display: inline-block;
  width: 2.5rem;
  color: var(--muted);
}

.scoreboard .score {
  color: var(--yellow);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.scoreboard .capture-time {
  color: var(--muted);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.scoreboard li > span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.empty-row {
  display: block !important;
  color: var(--muted);
}

.submission-zone {
  padding: 4rem 0;
  border-bottom: 1px solid var(--rule);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}

form {
  display: grid;
  gap: 1rem;
  padding: clamp(1.25rem, 3vw, 2.5rem);
  background: var(--carbon);
}

form h3 {
  margin: 0 0 0.5rem;
}

label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.76rem;
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  width: 100%;
  color: var(--paper);
  background: var(--void);
  border: 1px solid var(--rule);
  border-radius: 0;
  padding: 0.75rem 0.85rem;
}

textarea {
  resize: vertical;
  line-height: 1.5;
}

input:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 3px;
}

.mono-input {
  color: var(--cyan);
  font-family: var(--mono);
}

.terms-check {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: start;
}

.terms-check input {
  width: 18px;
  height: 18px;
  margin-top: 0.2rem;
  accent-color: var(--cyan);
}

button {
  justify-self: start;
  padding: 0.75rem 1rem;
  color: var(--void);
  font-family: var(--mono);
  font-weight: 600;
  background: var(--cyan);
  border: 1px solid var(--cyan);
  border-radius: 0;
  cursor: pointer;
  touch-action: manipulation;
}

button:hover {
  background: var(--yellow);
  border-color: var(--yellow);
}

button:disabled {
  color: var(--muted);
  background: transparent;
  border-color: var(--rule);
  cursor: not-allowed;
}

.quiet-button {
  color: var(--cyan);
  background: transparent;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.form-status {
  min-height: 1.6rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.form-status.success {
  color: var(--cyan);
}

.form-status.error {
  color: #f06a53;
}

.protocol-note {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) auto;
  gap: 2rem;
  align-items: start;
  padding: 3rem 0 0;
}

.protocol-note p {
  margin: 0;
}

.text-link {
  white-space: nowrap;
}

.report-form {
  max-width: 960px;
  margin-top: 2rem;
  border: 1px solid var(--rule);
}

.field-pair {
  display: grid;
  grid-template-columns: 1fr 0.5fr;
  gap: 1rem;
}

table {
  width: 100%;
  margin: 2rem 0;
  border-collapse: collapse;
}

th,
td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--rule);
}

th {
  color: var(--cyan);
  font-family: var(--display);
  font-size: 1.1rem;
}

code {
  color: var(--yellow);
  font-family: var(--mono);
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  max-width: 1440px;
  margin: 0 auto;
  padding: 2rem clamp(1.25rem, 4vw, 4rem);
  color: var(--muted);
  font-size: 0.68rem;
  border-top: 1px solid var(--rule);
}

footer p {
  max-width: 70ch;
  margin: 0;
}

.system-signature {
  color: var(--cyan);
  white-space: nowrap;
}

dialog {
  max-width: 680px;
  overscroll-behavior: contain;
  color: var(--paper);
  background: var(--carbon);
  border: 1px solid var(--cyan);
  padding: 0;
}

dialog::backdrop {
  background: rgba(7, 9, 10, 0.86);
}

.token-panel {
  padding: 2rem;
}

.issued-token {
  display: block;
  overflow-wrap: anywhere;
  padding: 1rem;
  color: var(--yellow);
  background: var(--void);
  border: 1px solid var(--rule);
}

@media (max-width: 900px) {
  .site-header {
    align-items: start;
    flex-direction: column;
  }

  nav {
    justify-content: start;
  }

  .sponsor-rail {
    grid-template-columns: auto 38px 1fr 160px;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .hero-seal {
    position: absolute;
    z-index: 1;
    inset: 10% -20% auto 40%;
    opacity: 0.5;
  }

  .nodes {
    grid-template-columns: repeat(2, 1fr);
  }

  .federation-line {
    display: none;
  }

  .operations {
    grid-template-columns: 1fr;
  }

  .scoreboard-panel {
    padding-right: 0;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }

  .event-panel {
    padding-left: 0;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .protocol-note {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

@media (max-width: 620px) {
  .sponsor-rail {
    grid-template-columns: auto 34px 1fr;
  }

  .ono-logo {
    display: none;
  }

  .hero {
    min-height: auto;
  }

  .hero-copy {
    padding-top: 1rem;
  }

  .hero-seal {
    display: none;
  }

  .nodes {
    grid-template-columns: 1fr;
  }

  .scoreboard-header,
  .scoreboard li {
    grid-template-columns: minmax(0, 1fr) 70px;
  }

  .scoreboard-header span:last-child,
  .scoreboard .capture-time {
    display: none;
  }

  .field-pair {
    grid-template-columns: 1fr;
  }

  footer {
    flex-direction: column;
  }
}

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

  .hero-seal img {
    animation: none;
  }
}
