/* The Refactory — styles. Dark only. No JavaScript anywhere. */

/* ---------- Fonts (self-hosted, Latin subset, SIL OFL) ---------- */
@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo-variable.woff2") format("woff2");
  font-weight: 400 800;
  font-stretch: 100% 125%;
  font-display: swap;
}
@font-face {
  font-family: "B612";
  src: url("/fonts/b612-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "B612";
  src: url("/fonts/b612-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: dark;
  --void: #000000;
  --gunmetal: #15181c;
  --spectral: #eef1f6;
  --muted: #98a1ac;
  --line: rgba(238, 241, 246, 0.16);
  --orange: #ff4f00;
  --phosphor: #4af626;
  --grid: rgba(255, 255, 255, 0.06);

  --gutter: 24px;
  --pad: 120px;
  --max: 1440px;
  --head: 72px;

  --wide: "Archivo", "Arial Narrow", Arial, sans-serif;
  --inst: "B612", "Lucida Console", monospace;
}
@media (max-width: 599px) {
  :root {
    --gutter: 18px;
    --pad: 72px;
    --head: 64px;
  }
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  background: var(--void);
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--void);
  color: var(--spectral);
  font-family: var(--wide);
  font-stretch: 100%;
  font-weight: 400;
  font-size: 18px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}
h1,
h2,
h3,
p,
dl,
dd,
ul {
  margin: 0;
}
ul {
  padding: 0;
  list-style: none;
}
img,
svg {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
}
:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
}

/* ---------- Shared layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
}
.band {
  padding-top: var(--pad);
  padding-bottom: var(--pad);
}
.band--gunmetal {
  background: var(--gunmetal);
}

/* ---------- Type roles ---------- */
.wordmark,
.h1 {
  font-family: var(--wide);
  font-stretch: 125%;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 0.92;
}
.h1 {
  font-size: clamp(48px, 8.3vw, 124px);
}
.h2 {
  font-family: var(--wide);
  font-stretch: 112%;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: 36px;
  line-height: 1.1;
}
.tagline {
  font-stretch: 100%;
  font-weight: 500;
  font-size: 28px;
  line-height: 1.25;
}
.body {
  max-width: 62ch;
}
.inst {
  font-family: var(--inst);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.5;
}
.muted {
  color: var(--muted);
}
@media (max-width: 599px) {
  .h2 {
    font-size: 28px;
  }
}

/* ---------- Skip link ---------- */
.skip {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 10;
  padding: 12px 16px;
  background: var(--orange);
  color: var(--void);
  font-family: var(--inst);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  transform: translateY(-200%);
}
.skip:focus-visible {
  transform: none;
  outline-color: var(--spectral);
}

/* ---------- Header ---------- */
.site-head {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  background: transparent;
}
.site-head .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--head);
}
.wordmark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 18px;
  text-decoration: none;
}
.nav {
  display: flex;
  gap: 32px;
}
.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--inst);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}
.nav a:hover {
  color: var(--orange);
}
@media (max-width: 359px) {
  .wordmark {
    font-size: 16px;
  }
}

/* ---------- Buttons and text links ---------- */
.btn {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  color: var(--void);
  font-family: var(--inst);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--orange);
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%);
}
.btn:hover::before {
  background: var(--spectral);
}
.btn:focus-visible {
  outline: 2px solid var(--spectral);
  outline-offset: 3px;
}
.link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--spectral);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(238, 241, 246, 0.4);
  text-underline-offset: 5px;
}
.link:hover {
  text-decoration-color: var(--orange);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  background-color: var(--void);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: center top;
}
/* Four corner brackets framing the viewport. Solid single-color paints, not visible gradients. */
.hero::after {
  content: "";
  position: absolute;
  inset: 12px;
  pointer-events: none;
  --b: linear-gradient(var(--muted), var(--muted));
  background: var(--b) left top / 20px 1px no-repeat, var(--b) left top / 1px 20px no-repeat,
    var(--b) right top / 20px 1px no-repeat, var(--b) right top / 1px 20px no-repeat,
    var(--b) left bottom / 20px 1px no-repeat, var(--b) left bottom / 1px 20px no-repeat,
    var(--b) right bottom / 20px 1px no-repeat, var(--b) right bottom / 1px 20px no-repeat;
}
.hero .wrap {
  min-height: 100svh;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: minmax(340px, 1fr) auto;
  column-gap: var(--gutter);
  padding-top: var(--head);
  padding-bottom: 36px;
}
.hero__art {
  grid-column: 5 / -1;
  grid-row: 1;
  min-height: 0;
  min-width: 0;
}
.hero__art svg {
  width: 100%;
  height: 100%;
}
.hero__copy {
  grid-column: 1 / -1;
  grid-row: 2;
  padding-top: 24px;
}
.hero__copy .tagline {
  margin-top: 14px;
}
.hero__copy .body {
  margin-top: 12px;
}
.hero__copy .actions {
  margin-top: 24px;
}
@media (max-width: 899px) {
  .hero__art {
    grid-column: 1 / -1;
  }
}
@media (min-width: 600px) and (max-height: 820px) {
  .hero .wrap {
    grid-template-rows: minmax(260px, 1fr) auto;
    padding-bottom: 32px;
  }
  .hero__copy {
    padding-top: 16px;
  }
}
@media (max-width: 599px) {
  .hero .wrap {
    grid-template-rows: minmax(240px, 1fr) auto;
    padding-bottom: 24px;
  }
  .hero__art {
    grid-column: 1 / -1;
    padding-top: 8px;
  }
  .hero__copy {
    padding-top: 16px;
  }
  .hero__copy .tagline {
    font-size: 24px;
  }
  .h1 {
    font-size: min(48px, 10.8vw);
  }
}

/* ---------- Hero drawing: linework and the one moment of motion ---------- */
.art path {
  fill: none;
  stroke: var(--spectral);
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.art .thin {
  stroke: var(--muted);
  stroke-width: 1;
}
.art .axis {
  stroke: var(--muted);
  stroke-width: 1;
  stroke-dasharray: 12 3 2 3;
}
.art .fill {
  fill: var(--spectral);
  stroke: none;
}
.art .screen {
  fill: var(--void);
}
.art .glow {
  fill: var(--phosphor);
  stroke: none;
}
.art .dot {
  fill: var(--orange);
  stroke: none;
}

/* Draw-in: terminal, then arm, then rocket (old to new), labels last. */
.art path:not(.fill):not(.glow):not(.dot):not(.axis) {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 0.7s linear forwards;
}
.art .g-arm path:not(.fill):not(.glow):not(.dot):not(.axis) {
  animation-delay: 0.45s;
}
.art .g-rocket path:not(.fill):not(.glow):not(.dot):not(.axis) {
  animation-delay: 0.9s;
}
.art .fill,
.art .glow,
.art .axis {
  opacity: 0;
  animation: fade 0.3s ease-out forwards;
}
.art .g-relic .fill,
.art .g-relic .glow,
.art .g-relic .axis {
  animation-delay: 0.6s;
}
.art .g-arm .fill,
.art .g-arm .axis {
  animation-delay: 1.05s;
}
.art .g-rocket .fill,
.art .g-rocket .axis {
  animation-delay: 1.5s;
}
.art .g-labels {
  opacity: 0;
  animation: fade 0.5s ease-out 1.6s forwards;
}
@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes fade {
  to {
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  /* Same specificity as the draw-in rules above, so these win by order. */
  .art path:not(.fill):not(.glow):not(.dot):not(.axis),
  .art .g-arm path:not(.fill):not(.glow):not(.dot):not(.axis),
  .art .g-rocket path:not(.fill):not(.glow):not(.dot):not(.axis) {
    animation: none;
    stroke-dasharray: none;
    stroke-dashoffset: 0;
  }
  .art .fill,
  .art .glow,
  .art .axis,
  .art .g-relic .fill,
  .art .g-relic .glow,
  .art .g-relic .axis,
  .art .g-arm .fill,
  .art .g-arm .axis,
  .art .g-rocket .fill,
  .art .g-rocket .axis,
  .art .g-labels {
    animation: none;
    opacity: 1;
  }
}

/* Callout labels and dots: HTML, so they stay 14px however the drawing scales.
   --s is one drawing unit in px (viewBox 1200x640, meet, anchored bottom right). */
.hero__art {
  position: relative;
  container-type: size;
}
.callouts {
  --s: min(0.0833333cqw, 0.15625cqh);
  opacity: 0;
  animation: fade 0.5s ease-out 1.6s forwards;
}
.co,
.co-dot {
  position: absolute;
}
.co {
  font-family: var(--inst);
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
}
.co-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
}
.co--relic {
  left: calc(100cqw - 1066 * var(--s));
  bottom: calc(350 * var(--s) + 5px);
}
.co-dot--relic {
  left: calc(100cqw - 1077.5 * var(--s) - 4px);
  bottom: calc(315 * var(--s) - 4px);
}
.co--arm {
  left: calc(100cqw - 590 * var(--s));
  bottom: calc(510 * var(--s) + 5px);
}
.co-dot--arm {
  left: calc(100cqw - 552.8 * var(--s) - 4px);
  bottom: calc(392.8 * var(--s) - 4px);
}
.co--rocket {
  right: calc(220 * var(--s));
  bottom: calc(560 * var(--s) + 5px);
}
.co-dot--rocket {
  left: calc(100cqw - 187.8 * var(--s) - 4px);
  bottom: calc(520 * var(--s) - 4px);
}
@media (prefers-reduced-motion: reduce) {
  .callouts {
    animation: none;
    opacity: 1;
  }
}

/* ---------- Listen badges (official artwork, self-hosted) ---------- */
.listen {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-left: auto;
}
.listen a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.listen img {
  height: 56px;
  width: auto;
}
@media (max-width: 599px) {
  .listen {
    margin-left: 0;
    gap: 8px 12px;
  }
  .listen img {
    height: 44px;
  }
}

/* ---------- Footer ---------- */
.site-foot {
  background: var(--gunmetal);
  padding-top: 40px;
  padding-bottom: 40px;
}
.foot {
  display: grid;
  gap: 12px;
}
.foot .link {
  min-height: 44px;
}
@media (min-width: 900px) {
  .foot {
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 32px;
  }
}

/* ---------- 404 ---------- */
.notfound {
  min-height: 100svh;
  display: grid;
  align-content: center;
  padding-top: var(--head);
  padding-bottom: var(--pad);
}
.notfound .h2 {
  font-size: clamp(32px, 6vw, 72px);
}
.notfound .body {
  margin-top: 20px;
}
.notfound .actions {
  margin-top: 32px;
}

/* main receives focus from the skip link; no ring needed on the landmark itself */
main:focus {
  outline: none;
}
