:root {
  color-scheme: dark;
  --ink: #f5f7fb;
  --ink-2: rgb(233 238 248 / 0.74);
  --ink-3: rgb(233 238 248 / 0.5);
  /* Translucent, not blurred: the shader behind changes every frame, and
     re-blurring it constantly is what costs phones their frame rate. */
  --glass: rgb(14 16 23 / 0.68);
  --glass-hover: rgb(26 29 40 / 0.78);
  --focus: #9dbbff;
  --shadow-glass:
    inset 0 0 0 1px rgb(255 255 255 / 0.1),
    inset 0 1px 0 0 rgb(255 255 255 / 0.06),
    0 12px 32px -14px rgb(0 0 0 / 0.9);
  --shadow-glass-hover:
    inset 0 0 0 1px rgb(255 255 255 / 0.16),
    inset 0 1px 0 0 rgb(255 255 255 / 0.08),
    0 12px 32px -14px rgb(0 0 0 / 0.9);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-icon: cubic-bezier(0.2, 0, 0, 1);
  --ease-flip: cubic-bezier(0.34, 1.32, 0.64, 1);
  --font-display: "Michroma", "Eurostile", ui-sans-serif, system-ui, sans-serif;
  --font-text: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --gutter: clamp(16px, 4vw, 40px);
  /* Polished chrome, as in the poster's lettering: white above, a soft grey
     horizon, bright again at the baseline. Stops sit on Michroma's own lines
     (cap height 0.75em, x-height 0.5625em) inside a 1.42em line box, so
     lowercase and capitals catch the same light. */
  --chrome: linear-gradient(
    180deg,
    #ffffff 0.4em,
    #f6f8fb 0.6em,
    #dfe3eb 0.74em,
    #a7afbf 0.85em,
    #7c8598 0.9em,
    #b3bbc9 0.97em,
    #edf0f5 1.07em,
    #ffffff 1.16em,
    #9ca5b6 1.22em,
    #d9dee7 1.42em
  );
  /* The same metal for capitals only, horizon at mid cap height. */
  --chrome-caps: linear-gradient(
    180deg,
    #ffffff 0.4em,
    #edf0f5 0.62em,
    #a9b1c1 0.76em,
    #7f889b 0.81em,
    #bcc3d0 0.9em,
    #f5f7fa 1.04em,
    #ffffff 1.16em
  );
}

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

html {
  -webkit-text-size-adjust: 100%;
  background: #000;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  margin: 0;
  font: 400 16px/1.5 var(--font-text);
  color: var(--ink);
  background: #000;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* No WebGL (or no JS): a still suggestion of the ribbons. */
:root:not([data-js]) body,
:root[data-no-gl] body {
  background:
    radial-gradient(55% 32% at 22% 2%, rgb(255 150 60 / 0.22), transparent 70%),
    radial-gradient(45% 30% at 86% 12%, rgb(80 120 255 / 0.26), transparent 70%),
    radial-gradient(65% 30% at 72% 98%, rgb(80 120 255 / 0.24), transparent 70%),
    radial-gradient(45% 26% at 10% 86%, rgb(255 150 60 / 0.2), transparent 70%),
    #000;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

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

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Backdrop ---------- */

.ribbons {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 900ms ease-out;
}

.ribbons[data-live] {
  opacity: 1;
}

.frame {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* The frame is part of the backdrop, so it lights up with the ribbons. */
:root[data-js]:not([data-ready]) .frame {
  animation: fade 1200ms ease-out 3s backwards;
}

:root[data-ready] .frame {
  animation: fade 1200ms ease-out 300ms backwards;
}

.frame > * {
  position: absolute;
}

.hairline {
  top: var(--top);
  bottom: var(--bottom);
  left: var(--x);
  width: 1px;
  translate: -50% 0;
  background: linear-gradient(to bottom, rgb(255 255 255 / 0), rgb(255 255 255 / 0.5) 14%, rgb(255 255 255 / 0.5) 86%, rgb(255 255 255 / 0));
}

.ring {
  top: var(--y);
  left: var(--x);
  width: 7px;
  height: 7px;
  translate: -50% -50%;
  border-radius: 50%;
  background: #000;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.72);
}

.sparkle {
  top: var(--y);
  left: var(--x);
  width: var(--size, 28px);
  height: var(--size, 28px);
  translate: -50% -50%;
  animation: twinkle 6s ease-in-out var(--d, 0s) infinite;
}

/* Where the poster had them, turned upside down with it. */
.hairline-left {
  --x: 6%;
  --top: 16%;
  --bottom: 60%;
}

.ring-left {
  --x: 6%;
  --y: 40%;
}

.sparkle-left {
  --x: 6%;
  --y: 31%;
  --d: -1.2s;
}

.hairline-right {
  --x: 94%;
  --top: 58%;
  --bottom: 14%;
}

.ring-right {
  --x: 94%;
  --y: 58%;
}

.sparkle-right {
  --x: 94%;
  --y: 71%;
  --d: -3.4s;
}

.sparkle-high {
  --x: 93.6%;
  --y: 36%;
  --size: 20px;
  --d: -4.6s;
}

.sparkle-orbit {
  --x: 5.5%;
  --y: 87.5%;
  --d: -2.2s;
}

/* On phones and tablets the buttons reach the right edge: keep the
   right-hand line below them. */
@media (max-width: 900px) {
  .hairline-right {
    --top: 77%;
    --bottom: 5%;
  }

  .ring-right {
    --y: 77%;
  }

  .sparkle-right {
    --y: 88%;
  }
}

.orbit {
  top: 81%;
  left: -3%;
  width: 52%;
  height: 12%;
  rotate: -4deg;
  overflow: visible;
  fill: none;
  stroke: rgb(255 255 255 / 0.5);
  stroke-width: 1;
}

.orbit ellipse {
  vector-effect: non-scaling-stroke;
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.55;
    scale: 0.8;
  }
  50% {
    opacity: 1;
    scale: 1;
  }
}

/* ---------- Poster ---------- */

.poster {
  position: relative;
  z-index: 2;
  display: flex;
  overflow-x: clip; /* flare streaks may run off the edge, never widen the page */
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(env(safe-area-inset-top) + 48px) max(var(--gutter), env(safe-area-inset-right)) 32px max(var(--gutter), env(safe-area-inset-left));
  text-align: center;
}

.chrome-text {
  background: var(--chrome-caps);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* The poster's "— SI —", upside down, which is the whole joke. */
.rule {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 24px);
  margin: 0 0 clamp(6px, 1.6svh, 18px);
  font: 400 clamp(18px, 2.3vw, 30px)/1.42 var(--font-display);
  letter-spacing: 0.06em;
}

.rule::before,
.rule::after {
  content: "";
  width: clamp(56px, 17vw, 250px);
  height: 1px;
  background: linear-gradient(to left, rgb(255 255 255 / 0.62), rgb(255 255 255 / 0));
}

.rule::after {
  background: linear-gradient(to right, rgb(255 255 255 / 0.62), rgb(255 255 255 / 0));
}

.title {
  --size: clamp(50px, min(16.5vw, 17.5svh), 184px);
  --shine: -0.6;
  position: relative;
  display: grid;
  justify-items: center;
  margin: 0;
  font: 400 var(--size) / 1 var(--font-display);
  letter-spacing: 0.01em;
}

/* Three copies of each line stacked in one grid cell: a bevel and glow
   underneath, the chrome face, and a moving highlight on top. The 1.42em line
   box is Michroma's full height, so no descender gets clipped; the negative
   margins pull the two lines back together. */
.title-line {
  position: relative;
  display: grid;
  margin-block: -0.24em;
}

.title-line > span:not(.flare) {
  grid-area: 1 / 1;
  padding-inline: 0.06em;
  line-height: 1.42;
  white-space: nowrap;
}

/* Shadows only, no fill: a bright rim along the top edges, the metal's
   thickness below, and blue light bleeding off it. */
.chrome-depth {
  color: transparent;
  text-shadow:
    0 -0.012em 0 rgb(255 255 255 / 0.8),
    0 0.022em 0 #4a5264,
    0 0.02em 0.3em rgb(70 120 255 / 0.5);
}

.chrome-face {
  background: var(--chrome);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* A glint with a prism's fringe either side, sliding over the metal. */
.chrome-shine {
  background: linear-gradient(
      100deg,
      rgb(255 255 255 / 0) 44%,
      rgb(130 165 255 / 0.55) 47.6%,
      rgb(255 255 255 / 0.95) 50%,
      rgb(255 185 115 / 0.55) 52.4%,
      rgb(255 255 255 / 0) 56%
    )
    no-repeat;
  background-size: 300% 100%;
  background-position: calc(75% - var(--shine) * 50%) 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Anamorphic lens flares caught on the letter edges. */
.flare {
  --tint: 140 175 255;
  position: absolute;
  top: var(--y);
  left: var(--x);
  width: 0;
  height: 0;
  mix-blend-mode: screen;
  animation: flare 7s ease-in-out var(--d, 0s) infinite;
}

.flare::before,
.flare::after {
  content: "";
  position: absolute;
  translate: -50% -50%;
}

.flare::before {
  width: 2.4em;
  height: max(1.5px, 0.01em);
  background: linear-gradient(90deg, rgb(var(--tint) / 0), rgb(var(--tint) / 0.55) 32%, rgb(255 255 255 / 0.95) 50%, rgb(var(--tint) / 0.55) 68%, rgb(var(--tint) / 0));
}

.flare::after {
  width: 0.2em;
  height: 0.2em;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(255 255 255) 18%, rgb(var(--tint) / 0.4) 45%, rgb(var(--tint) / 0));
}

.flare-warm {
  --tint: 255 170 95;
}

@keyframes flare {
  0%,
  100% {
    opacity: 0.55;
    scale: 0.9;
  }
  50% {
    opacity: 1;
    scale: 1.06;
  }
}

/* Where the White House sat in the poster: a dog house, upside down. */
.emblem {
  display: block;
  margin: clamp(6px, 1.4svh, 14px) 0 0;
  padding: 8px 12px;
  border: 0;
  border-radius: 14px;
  background: none;
  color: rgb(255 255 255 / 0.84);
  cursor: pointer;
  transition-property: scale, color;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
  -webkit-tap-highlight-color: transparent;
}

.emblem svg {
  display: block;
  width: clamp(84px, 8.6vw, 118px);
  height: auto;
  overflow: visible;
  rotate: calc(var(--turns, 1) * 180deg);
  transition: rotate 700ms var(--ease-flip);
  filter: drop-shadow(0 0 6px rgb(150 180 255 / 0.35));
}

.emblem svg * {
  vector-effect: non-scaling-stroke;
}

.emblem:active {
  scale: 0.96;
}

.lede {
  max-width: 34ch;
  margin: clamp(12px, 2.2svh, 22px) 0 0;
  font-size: clamp(15px, 1.3vw, 18px);
  color: var(--ink-2);
  text-wrap: balance;
  text-shadow: 0 0 12px #000, 0 0 3px #000;
}

/* ---------- Actions ---------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  width: min(100%, 780px);
  margin-top: clamp(16px, 3svh, 28px);
}

.ca,
.button {
  height: 48px;
  border: 0;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition-property: scale, background-color, box-shadow, filter;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
  -webkit-tap-highlight-color: transparent;
}

.ca:active,
.button:active {
  scale: 0.96;
}

.ca {
  display: flex;
  flex: 1 1 380px;
  align-items: center;
  gap: 12px;
  min-width: 0;
  max-width: 470px;
  padding: 0 16px 0 6px;
  background: var(--glass);
  box-shadow: var(--shadow-glass);
  color: var(--ink);
  font: 450 14px/1 var(--font-mono);
}

/* Pill in a pill: 18px radius + 6px inset = the outer 24px. */
.ca-label {
  display: grid;
  flex: none;
  place-items: center;
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.08);
  color: var(--ink-2);
  font: 400 10.5px/1 var(--font-display);
  letter-spacing: 0.08em;
}

/* Truncates in the middle when space runs out, so both familiar ends stay. */
.ca-value {
  display: flex;
  flex: 1;
  min-width: 0;
}

.ca-head {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ca-icon {
  position: relative;
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--ink-2);
}

.ca-icon .icon {
  position: absolute;
  inset: 0;
  transition-property: opacity, scale, filter;
  transition-duration: 300ms;
  transition-timing-function: var(--ease-icon);
}

.icon-check,
.ca[data-copied] .icon-copy {
  opacity: 0;
  scale: 0.25;
  filter: blur(4px);
}

.ca[data-copied] .icon-check {
  opacity: 1;
  scale: 1;
  filter: blur(0);
}

.links {
  display: flex;
  gap: 10px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  font: 600 15px/1 var(--font-text);
}

.button .icon {
  width: 17px;
  height: 17px;
}

.button-glass {
  padding-inline: 18px 20px;
  background: var(--glass);
  box-shadow: var(--shadow-glass);
  color: var(--ink);
}

.button-square {
  width: 48px;
  padding: 0;
}

.icon-x {
  width: 16px;
  height: 16px;
  fill: currentColor;
  stroke: none;
}

.button-chrome {
  padding-inline: 24px;
  background: linear-gradient(180deg, #ffffff 0%, #eef1f6 42%, #b9c1cf 54%, #dde2ea 74%, #ffffff 100%);
  box-shadow:
    inset 0 0 0 1px rgb(255 255 255 / 0.55),
    inset 0 -1px 0 0 rgb(0 0 0 / 0.18),
    0 0 0 1px rgb(0 0 0 / 0.6),
    0 10px 30px -10px rgb(120 160 255 / 0.6);
  color: #0a0c12;
}

@media (hover: hover) and (pointer: fine) {
  .ca:hover,
  .button-glass:hover {
    background: var(--glass-hover);
    box-shadow: var(--shadow-glass-hover);
  }

  .button-chrome:hover {
    filter: brightness(1.07);
  }

  .emblem:hover {
    color: #fff;
  }
}

@media (max-width: 640px) {
  .ca {
    flex-basis: 100%;
    max-width: none;
  }

  .links {
    flex: 1 1 100%;
  }

  .button-chrome {
    flex: 1;
  }
}

.fineprint {
  position: relative;
  z-index: 2;
  margin: 0;
  padding: 0 max(var(--gutter), env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 18px) max(var(--gutter), env(safe-area-inset-left));
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-3);
  text-align: center;
  text-wrap: balance;
  text-shadow: 0 0 10px #000, 0 0 3px #000;
}

.card-tag {
  display: none;
}

/* ---------- Arrival ---------- */

/* Staged once, on load: the rule, then the title, the dog house, the words,
   the buttons and the small print, 100ms apart. Held until the fonts are in;
   if a script never gets that far, everything fades in after 3s anyway. */
:root[data-js]:not([data-ready]) .enter {
  animation: fade 600ms ease-out 3s backwards;
}

:root[data-ready] .enter {
  animation: enter 900ms var(--ease-out) calc(120ms + var(--i, 0) * 100ms) backwards;
}

@keyframes enter {
  from {
    opacity: 0;
    translate: 0 12px;
    filter: blur(8px);
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root[data-ready] .enter {
    animation-name: fade;
  }

  .sparkle,
  .flare {
    animation: none;
  }

  .emblem svg {
    transition-duration: 0ms;
  }
}

/* ---------- Social card (?card), screenshotted at 1200×630 for og.png ---------- */

:root[data-card] body {
  width: 1200px;
  height: 630px;
  min-height: 0;
  overflow: hidden;
}

:root[data-card] .enter,
:root[data-card] .frame {
  animation: none;
}

:root[data-card] .poster {
  padding: 0;
}

:root[data-card] .title {
  --size: 118px;
}

:root[data-card] .lede,
:root[data-card] .actions,
:root[data-card] .fineprint {
  display: none;
}

:root[data-card] .card-tag {
  display: block;
  margin: 16px 0 0;
  font: 400 24px/1 var(--font-display);
  letter-spacing: 0.06em;
  color: var(--ink);
  text-shadow: 0 0 12px #000, 0 0 3px #000;
}
