@font-face {
  font-family: "Martian Mono";
  src: url("/assets/home/fonts/martian-mono-latin.woff2?v=f9c1655c2c9d") format("woff2");
  font-weight: 100 800;
  font-stretch: 75% 112.5%;
  font-style: normal;
  font-display: swap;
}

:root {
  --void: #03080b;
  --deep: #0a2229;
  --haze: #1d4c55;
  --sodium: #ffae52;
  --ember: #c4622d;
  --paper: #f2e6cf;
  --paper-dim: #cbbfa8;
  --phosphor: #93d8ca;
  --shade: rgb(2 7 10 / 0.92);
  --mono: "Martian Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --lift: clamp(0px, 6vw - 16px, 13rem);
  color-scheme: dark;
}

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

html {
  height: 100%;
  padding-block: env(safe-area-inset-top, 0px) env(safe-area-inset-bottom, 0px);
  background: var(--void);
}

body {
  height: 100%;
  margin: 0;
  overflow-x: clip;
  background: var(--void);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--void);
}

.still,
.scene-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.still[hidden] {
  display: none;
}

.still-tall {
  display: none;
}

@media (max-aspect-ratio: 4/5) {
  .still-wide {
    display: none;
  }

  .still-tall {
    display: block;
  }
}

@media (scripting: enabled) {
  .still {
    visibility: hidden;
  }

  .has-failed .still {
    visibility: visible;
  }
}

.page {
  position: relative;
  z-index: 1;
  min-height: 100%;
  overflow-x: clip;
  display: grid;
  grid-template-rows: 1fr auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 1rem 0.5rem;
}

.plate {
  position: relative;
  align-self: end;
  justify-self: start;
  max-width: 100%;
  margin: 0 0 clamp(3.75rem, 11dvh, 9rem) var(--lift);
}

.plate::before {
  content: "";
  position: absolute;
  inset: -2.5rem -4rem -2.5rem -3rem;
  z-index: -1;
  background: radial-gradient(closest-side, rgb(2 7 10 / 0.5), rgb(2 7 10 / 0.25) 62%, transparent);
  pointer-events: none;
}

.title {
  position: relative;
  margin: 0;
  width: max-content;
  max-width: 100%;
  font-size: clamp(2.2rem, 0.6rem + 5vw, 9.5rem);
  font-weight: 200;
  font-stretch: 112.5%;
  line-height: 1.04;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  white-space: nowrap;
}

.title-text {
  text-shadow:
    -0.035rem 0 rgb(255 92 60 / 0.35),
    0.035rem 0 rgb(80 224 210 / 0.3),
    0 0 0.06em var(--shade),
    0 0 0.25em rgb(2 7 10 / 0.7),
    0 0 0.6em rgb(255 174 82 / 0.2);
}

.is-ciphering .title-text {
  color: transparent;
  text-shadow: none;
}

.title-cipher {
  position: absolute;
  inset: 0;
  visibility: hidden;
  pointer-events: none;
  user-select: none;
}

.is-ciphering .title-cipher {
  visibility: visible;
}

.title-cell {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transition: color 0.6s ease-out, text-shadow 0.6s ease-out;
}

.title-cell[data-tone="scramble"] {
  opacity: 0.92;
  color: var(--phosphor);
  text-shadow: 0 0 0.3em rgb(110 228 205 / 0.5), 0 0 0.08em var(--shade);
  transition: none;
}

.title-cell[data-tone="locked"] {
  opacity: 1;
  color: var(--sodium);
  text-shadow: 0 0 0.35em rgb(255 150 70 / 0.55), 0 0 0.08em var(--shade);
}

.title-cell[data-tone="final"] {
  opacity: 1;
  color: var(--paper);
  text-shadow:
    -0.035rem 0 rgb(255 92 60 / 0.35),
    0.035rem 0 rgb(80 224 210 / 0.3),
    0 0 0.06em var(--shade),
    0 0 0.25em rgb(2 7 10 / 0.7),
    0 0 0.6em rgb(255 174 82 / 0.2);
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25em 1.8em;
  margin: 0.9rem 0 0 0.12em;
  padding: 0;
  list-style: none;
  font-size: clamp(0.95rem, 0.82rem + 0.35vw, 1.4rem);
}

a {
  color: var(--paper);
  text-decoration-line: underline;
  text-decoration-color: rgb(242 230 207 / 0.4);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.35em;
  text-shadow: 0 0 0.15em var(--shade), 0 0 0.7em var(--shade);
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

a:hover {
  color: var(--sodium);
  text-decoration-color: currentColor;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--phosphor);
  outline-offset: 0.3em;
  border-radius: 2px;
}

.links a {
  display: inline-block;
  padding-block: 0.4rem;
}

.foot {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-inline: var(--lift);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.elsewhere {
  display: flex;
  gap: 0 1.6em;
  margin: 0;
  padding: 0;
  list-style: none;
}

.foot a,
.motion-toggle {
  padding: 0.6rem 0;
  color: var(--paper-dim);
}

.motion-toggle {
  margin: 0;
  border: 0;
  background: none;
  font: inherit;
  letter-spacing: inherit;
  text-shadow: 0 0 0.15em var(--shade), 0 0 0.7em var(--shade);
  cursor: pointer;
}

.motion-toggle:hover {
  color: var(--sodium);
}

.motion-toggle[hidden] {
  display: none;
}

@media (prefers-reduced-motion: no-preference) {
  :is(.links, .foot) {
    animation: arrive 0.8s ease-out 0.2s both;
  }
}

@keyframes arrive {
  0% {
    opacity: 0;
    visibility: hidden;
  }

  15% {
    visibility: hidden;
  }
}

.hud {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  color: var(--phosphor);
  font-size: 11px;
  font-stretch: 100%;
  line-height: 1.45;
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  text-shadow: 0 0 2px var(--void), 0 0 6px var(--void), 0 0 12px var(--void);
}

.hud svg {
  display: block;
  overflow: visible;
}

.hud-line {
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.hud-read {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 0.9rem);
  display: grid;
  white-space: pre;
}

.hud-read::before {
  content: "";
  position: absolute;
  inset: -1.4rem -2.2rem;
  z-index: -1;
  background: radial-gradient(closest-side, rgb(2 7 10 / 0.72), rgb(2 7 10 / 0.4) 60%, transparent);
}

.hud-read-left {
  left: calc(max(16px, env(safe-area-inset-left, 0px)) + var(--lift));
}

.hud-read-right {
  right: calc(max(16px, env(safe-area-inset-right, 0px)) + var(--lift));
  text-align: right;
}

.hud-scale {
  position: absolute;
  left: 0;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 2.9rem);
  width: 100%;
  height: 28px;
  color: rgb(147 216 202 / 0.85);
}

.hud-tick {
  fill: currentColor;
  stroke: none;
  font-family: var(--mono);
  font-size: 10px;
  text-anchor: middle;
}

.hud-label {
  position: absolute;
  top: 0;
  left: 0;
  white-space: pre;
}

.gate-label {
  font-size: 10px;
  letter-spacing: 0.08em;
}

.bracket {
  position: absolute;
  top: -20px;
  left: -20px;
  width: 40px;
  height: 40px;
  color: var(--sodium);
}

.bracket svg {
  width: 100%;
  height: 100%;
}

.bracket-frame {
  transform-origin: 50% 50%;
}

.bracket .hud-label {
  top: 44px;
  left: 0;
  color: var(--phosphor);
}

.reticle {
  position: absolute;
  top: -30px;
  left: -30px;
  width: 60px;
  height: 60px;
  color: var(--paper);
}

.reticle svg {
  width: 100%;
  height: 100%;
}

.reticle-read {
  position: absolute;
  top: 8px;
  left: 50px;
  display: grid;
  white-space: pre;
}

.is-flipped .reticle-read {
  left: auto;
  right: 50px;
  text-align: right;
}

@media (max-aspect-ratio: 4/5) {
  .title {
    font-size: min(calc((100vw - 2.4rem) / 6.6), 7rem, 8.6dvh);
    letter-spacing: 0.14em;
  }

  .word {
    display: block;
  }

  .plate {
    margin-bottom: clamp(3.5rem, 9dvh, 8rem);
  }

  .links {
    gap: 0.25em 1.25em;
  }

  .hud-read-right {
    display: none;
  }
}

@media (orientation: landscape) and (max-height: 32rem) {
  .title {
    font-size: clamp(1.6rem, 0.4rem + 4.5vw, 3rem);
  }

  .plate {
    margin-bottom: 2.6rem;
  }

  .links {
    margin-top: 0.3rem;
  }

  .links a {
    padding-block: 0.2rem;
  }

  .hud-scale {
    display: none;
  }
}

@media (min-width: 1100px) and (min-height: 600px) {
  .foot {
    font-size: clamp(0.8rem, 0.4rem + 0.4vw, 1.3rem);
  }

  .hud {
    font-size: clamp(11px, 0.25rem + 0.4vw, 18px);
  }
}
