:root {
  color-scheme: dark;
  --ink: #090c0e;
  --paper: #e9e3d6;
  --muted: #8f918b;
  --grid: rgba(233, 227, 214, 0.105);
  --amber: #ca954a;
  --petrol: #2e6965;
  --signal: #a94f45;
  --px: 0;
  --py: 0;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-synthesis: none;
  text-rendering: geometricPrecision;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 72% 42%, rgba(46, 105, 101, 0.12), transparent 34rem),
    var(--ink);
  color: var(--paper);
  transition: background-color 600ms ease, color 600ms ease;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -3;
  content: "";
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: clamp(46px, 6vw, 96px) clamp(46px, 6vw, 96px);
  background-position:
    calc(var(--px) * -10px)
    calc(var(--py) * -10px);
  mask-image: linear-gradient(to bottom, black, transparent 86%);
  transition: background-position 180ms ease-out;
}

body::after {
  position: fixed;
  inset: 0;
  z-index: 10;
  content: "";
  pointer-events: none;
  border: 1px solid rgba(233, 227, 214, 0.14);
}

button {
  color: inherit;
  font: inherit;
}

.stage {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100svh;
  max-width: 100vw;
  padding: clamp(1rem, 2.2vw, 2.5rem);
  overflow: clip;
  isolation: isolate;
}

.system-bar,
.footer {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 2rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: clamp(0.62rem, 0.7vw, 0.78rem);
  letter-spacing: 0.16em;
  line-height: 1;
  text-transform: uppercase;
}

.system-mark {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 0.7rem;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.system-mark::after {
  width: 0;
  height: 1px;
  content: "";
  background: var(--amber);
  transition: width 300ms ease;
}

.system-mark:hover::after,
.system-mark:focus-visible::after {
  width: 2.4rem;
}

.system-mark:focus-visible {
  outline: 1px solid var(--amber);
  outline-offset: 0.55rem;
}

.system-mark__dot,
.status__pulse {
  width: 0.52rem;
  height: 0.52rem;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 1.2rem rgba(202, 149, 74, 0.85);
}

.coordinates {
  display: flex;
  gap: 1.4rem;
  color: var(--muted);
}

.clock {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 1rem;
}

.clock__label {
  color: var(--muted);
}

#local-time {
  min-width: 5.4rem;
  color: var(--amber);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.hero {
  position: relative;
  display: grid;
  align-content: center;
  min-height: 0;
  padding-block: clamp(3.5rem, 9vh, 7rem);
}

.eyebrow {
  display: flex;
  align-items: center;
  width: min(36rem, 50vw);
  margin: 0 0 clamp(1.2rem, 3vh, 2.6rem) 0.4vw;
  gap: 1rem;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: clamp(0.58rem, 0.7vw, 0.76rem);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.eyebrow__line {
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, var(--amber), transparent);
}

.title {
  position: relative;
  z-index: 2;
  margin: 0;
  font-size: clamp(4rem, 13.4vw, 13rem);
  font-weight: 500;
  letter-spacing: -0.075em;
  line-height: 0.73;
  text-transform: uppercase;
}

.title__line {
  position: relative;
  display: block;
  width: max-content;
  transform: translate3d(
    calc(var(--px) * 7px),
    calc(var(--py) * 4px),
    0
  );
  transition: transform 160ms ease-out;
}

.title__line--bottom {
  margin-left: 21vw;
  color: transparent;
  -webkit-text-stroke: 1px var(--paper);
}

.title__line::after {
  position: absolute;
  inset: 0;
  content: attr(data-text);
  color: var(--amber);
  clip-path: inset(48% 0 44% 0);
  opacity: 0;
  transform: translateX(-0.02em);
  animation: signal-glitch 11s steps(1, end) infinite;
  pointer-events: none;
}

.statement {
  position: absolute;
  right: 2vw;
  bottom: clamp(2.5rem, 7vh, 6rem);
  z-index: 3;
  padding-left: 1.1rem;
  border-left: 1px solid var(--amber);
}

.statement p {
  margin: 0;
  font-size: clamp(1rem, 1.65vw, 1.6rem);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.18;
}

.signal-field {
  position: absolute;
  top: 50%;
  right: 7vw;
  width: min(42vw, 42rem);
  aspect-ratio: 1;
  opacity: 0.62;
  transform: translate3d(
    calc(var(--px) * -14px),
    calc(-50% + var(--py) * -10px),
    0
  );
  transition: transform 220ms ease-out;
}

.signal-field svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.orbit,
.axis,
.signal-path {
  fill: none;
  vector-effect: non-scaling-stroke;
}

.orbit {
  stroke: var(--petrol);
  stroke-width: 1;
  stroke-dasharray: 4 9;
  transform-origin: center;
}

.orbit--outer {
  animation: orbit 58s linear infinite;
}

.orbit--middle {
  stroke: rgba(202, 149, 74, 0.72);
  animation: orbit-reverse 37s linear infinite;
}

.orbit--inner {
  stroke-dasharray: 2 5;
  animation: breathe 5s ease-in-out infinite;
}

.axis {
  stroke: rgba(233, 227, 214, 0.12);
  stroke-width: 1;
}

.signal-path {
  stroke: var(--amber);
  stroke-width: 1.25;
  stroke-dasharray: 12 9;
  animation: signal-flow 9s linear infinite;
}

.signal-node {
  fill: var(--signal);
  filter: drop-shadow(0 0 10px rgba(169, 79, 69, 0.9));
  animation: breathe 3.5s ease-in-out infinite;
}

.footer {
  color: var(--muted);
}

.footer p {
  margin: 0;
}

.status {
  display: flex;
  align-items: center;
  justify-self: center;
  gap: 0.7rem;
  color: inherit;
  text-decoration: none;
}

.status:hover,
.status:focus-visible {
  color: var(--paper);
}

.status:focus-visible {
  outline: 1px solid var(--amber);
  outline-offset: 0.55rem;
}

.status__pulse {
  width: 0.42rem;
  height: 0.42rem;
  background: var(--petrol);
  animation: status-pulse 2.8s ease-out infinite;
}

.edition {
  justify-self: end;
}

.grain {
  position: fixed;
  inset: -70%;
  z-index: 8;
  pointer-events: none;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.82'/%3E%3C/svg%3E");
  animation: grain 0.22s steps(2) infinite;
}

.scan {
  position: fixed;
  inset: -30% 0 auto;
  z-index: 7;
  height: 18vh;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(to bottom, transparent, rgba(202, 149, 74, 0.055), transparent);
  animation: scan 18s ease-in-out infinite;
}

.noscript {
  position: fixed;
  inset: auto 1rem 1rem;
  margin: 0;
  color: var(--paper);
  font: 0.75rem ui-monospace, monospace;
}

body.archive {
  color-scheme: light;
  --ink: #ded8cc;
  --paper: #131719;
  --muted: #5f625d;
  --grid: rgba(19, 23, 25, 0.12);
  background: var(--ink);
}

body.archive .grain {
  opacity: 0.035;
  mix-blend-mode: multiply;
}

body.archive .system-mark__dot {
  background: var(--signal);
}

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

@keyframes orbit-reverse {
  to { transform: rotate(-360deg); }
}

@keyframes signal-flow {
  to { stroke-dashoffset: -126; }
}

@keyframes breathe {
  0%, 100% { opacity: 0.45; transform: scale(0.97); }
  50% { opacity: 1; transform: scale(1.03); }
}

@keyframes status-pulse {
  0% { box-shadow: 0 0 0 0 rgba(46, 105, 101, 0.7); }
  75%, 100% { box-shadow: 0 0 0 0.65rem rgba(46, 105, 101, 0); }
}

@keyframes signal-glitch {
  0%, 82%, 86%, 100% { opacity: 0; transform: translateX(-0.02em); }
  83% { opacity: 0.65; transform: translateX(0.025em); }
  84% { opacity: 0.2; transform: translateX(-0.045em); }
  85% { opacity: 0.8; transform: translateX(0.01em); }
}

@keyframes grain {
  0% { transform: translate3d(0, 0, 0); }
  25% { transform: translate3d(3%, -2%, 0); }
  50% { transform: translate3d(-2%, 3%, 0); }
  75% { transform: translate3d(4%, 2%, 0); }
  100% { transform: translate3d(-3%, -4%, 0); }
}

@keyframes scan {
  0%, 66% { top: -30%; opacity: 0; }
  69% { opacity: 1; }
  88% { top: 112%; opacity: 0.85; }
  90%, 100% { top: 112%; opacity: 0; }
}

@media (max-width: 760px) {
  .stage {
    padding: 1rem;
  }

  .system-bar {
    grid-template-columns: 1fr auto;
  }

  .coordinates {
    display: none;
  }

  .hero {
    padding-block: 5rem 7rem;
  }

  .eyebrow {
    width: 100%;
    margin-bottom: 2rem;
  }

  .title {
    font-size: clamp(3.45rem, 20.5vw, 6rem);
    line-height: 0.8;
  }

  .title__line--bottom {
    margin-top: 0.08em;
    margin-left: 0;
  }

  .signal-field {
    top: 44%;
    right: -25vw;
    width: 105vw;
    opacity: 0.42;
  }

  .statement {
    right: auto;
    bottom: 2.5rem;
    left: 0;
  }

  .footer {
    grid-template-columns: 1fr auto;
  }

  .status {
    justify-self: end;
  }

  .edition {
    display: none;
  }
}

@media (max-width: 390px) {
  .clock__label,
  .eyebrow > span:first-child {
    display: none;
  }

  .eyebrow {
    width: 56%;
  }

  .title {
    font-size: clamp(3rem, 20vw, 4.9rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .grain,
  .scan {
    display: none;
  }
}
