@font-face {
  font-family: "Instrument Sans";
  src: url("/fonts/instrument-sans-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("/fonts/instrument-sans-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/geist-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --stone: #efeeea;
  --ink: #111111;
  --muted: #5f5e5a;
  --teal: #2e8c74;
  --saffron: #e8a92e;
  --cobalt: #2440c8;
  --vermilion: #d8462b;
  --gutter: clamp(20px, 4.4vw, 64px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html,
body {
  margin: 0;
  background: var(--stone);
  color: var(--ink);
}

body {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  font-family: "Instrument Sans", "Helvetica Neue", Helvetica, sans-serif;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

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

.mono {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.muted {
  color: var(--muted);
}

/* ---------- Header and footer ---------- */

.top,
.bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 24px;
  padding: 26px var(--gutter);
}
.top {
  border-bottom: 1px solid var(--ink);
}
.bottom {
  border-top: 1px solid var(--ink);
  padding-top: 20px;
  padding-bottom: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--vermilion);
  animation: blink 2.4s ease-in-out infinite;
}

/* ---------- Main ---------- */

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(36px, 6vh, 72px);
  padding: clamp(48px, 8vh, 88px) var(--gutter) clamp(40px, 6vh, 72px);
}

/* The plot */

.plot-wrap {
  position: relative;
  margin-left: 6px;
}
.plot {
  position: relative;
  height: clamp(200px, 34vh, 400px);
}
.axis-y,
.axis-x,
.bands {
  position: absolute;
}
.axis-y {
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--ink);
  transform-origin: bottom;
  animation: draw-y 1s cubic-bezier(0.65, 0, 0.35, 1) both;
}
.bands {
  left: -6px;
  top: 0;
  bottom: 0;
  width: 4px;
  display: flex;
  flex-direction: column;
  transform-origin: bottom;
  animation: draw-y 1s cubic-bezier(0.65, 0, 0.35, 1) both;
}
.bands span {
  flex: 1;
}
.bands span:nth-child(1) { background: var(--vermilion); }
.bands span:nth-child(2) { background: var(--cobalt); }
.bands span:nth-child(3) { background: var(--saffron); }
.bands span:nth-child(4) { background: var(--teal); }
.axis-x {
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--ink);
  transform-origin: left;
  animation: draw-x 1.1s cubic-bezier(0.65, 0, 0.35, 1) 0.15s both;
}
.axis-label {
  position: absolute;
}
.axis-label.y {
  left: -4px;
  top: -28px;
}
.axis-label.x {
  right: 0;
  bottom: -26px;
}

.tick {
  position: absolute;
  left: 0;
  top: calc((1 - var(--v)) * 100%);
  display: flex;
  align-items: center;
  gap: 8px;
  transform: translateY(-50%);
  font-size: 10px;
  animation: fade 0.8s ease 0.9s both;
}
.tick::before {
  content: "";
  width: 10px;
  height: 1px;
  background: var(--ink);
}

.pt {
  position: absolute;
  left: calc(var(--x) * 100%);
  top: calc((1 - var(--y)) * 100%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c);
  transform: translate(-50%, -50%);
  animation: fade 0.8s ease calc(1s + var(--d, 0s)) both;
}
.pt.main {
  width: 16px;
  height: 16px;
  animation: fade 0.8s ease 1.2s both, pulse 2.8s ease-out 2s infinite;
}
.pt-label {
  position: absolute;
  left: calc(var(--x) * 100% + 16px);
  top: calc((1 - var(--y)) * 100% + 10px);
  animation: fade 0.8s ease 1.3s both;
}

/* The reading line: rises on load, then hovers just short of the top. */
.reader {
  --c: var(--teal);
  --fg: var(--stone);
  position: absolute;
  left: 0;
  right: 0;
  top: 4%;
  height: 0;
  animation: rise 6.5s var(--ease) 0.6s both, hover 5s ease-in-out 7.1s infinite alternate;
}
.reader .line {
  position: absolute;
  left: 0;
  right: 0;
  top: -1px;
  height: 2px;
  background: var(--c);
  transition: background-color 0.4s ease;
}
.reader .dot {
  position: absolute;
  left: 0;
  top: 0;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--c);
  transform: translate(-50%, -50%);
  transition: background-color 0.4s ease;
}
.reader .chip {
  position: absolute;
  right: 0;
  bottom: 8px;
  padding: 5px 8px;
  white-space: nowrap;
  text-transform: none;
  background: var(--c);
  color: var(--fg);
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* The words */

h1 {
  margin: 0;
  font-size: clamp(52px, 8.6vw, 128px);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.88;
  animation: lift 1.1s var(--ease) 0.3s both;
}
.stop {
  display: inline-block;
  color: var(--vermilion);
  transform-origin: 50% 100%;
  animation: bounce 1.1s linear 2.4s both;
}
.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px 48px;
  margin-top: clamp(24px, 4vh, 40px);
  animation: lift 1.1s var(--ease) 0.6s both;
}
.lede {
  margin: 0;
  max-width: 34ch;
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.4;
  letter-spacing: -0.01em;
}
.contact {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.contact a {
  font-size: clamp(20px, 2vw, 26px);
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 100% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  padding-bottom: 3px;
  transition: background-size 0.4s var(--ease), color 0.25s ease;
}
.contact a:hover {
  color: var(--vermilion);
  background-size: 0% 1px;
}

.btn {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 52px;
  padding: 0 24px;
  background: var(--ink);
  color: var(--stone);
  font-size: 15px;
  text-decoration: none;
  transition: background-color 0.25s ease, color 0.25s ease;
}
.btn:hover {
  background: var(--vermilion);
  color: var(--ink);
}
.btn svg {
  transition: transform 0.25s ease;
}
.btn:hover svg {
  transform: translateX(5px);
}

/* ---------- 404: the point is off the chart ---------- */

.off .plot-wrap {
  margin-top: clamp(40px, 8vh, 96px);
}
.off .pt.out {
  left: 92%;
  top: -22%;
  width: 18px;
  height: 18px;
  animation: fade 0.6s ease 1.4s both, pulse 2.8s ease-out 2.2s infinite;
}
.off .reach {
  position: absolute;
  left: 0;
  right: 8%;
  top: -22%;
  border-top: 1.5px dashed var(--vermilion);
  transform-origin: left;
  animation: draw-x 1s var(--ease) 1.1s both;
}
.off .reach-chip {
  position: absolute;
  right: 8%;
  top: -22%;
  transform: translate(-12px, calc(-100% - 8px));
  padding: 5px 8px;
  background: var(--vermilion);
  color: var(--ink);
  white-space: nowrap;
  text-transform: none;
  animation: fade 0.6s ease 1.8s both;
}

/* ---------- Motion ---------- */

@keyframes draw-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes draw-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes lift { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { top: 100%; } to { top: 4%; } }
@keyframes hover { from { transform: translateY(0); } to { transform: translateY(14px); } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(216, 70, 43, 0.45); }
  70% { box-shadow: 0 0 0 16px rgba(216, 70, 43, 0); }
  100% { box-shadow: 0 0 0 0 rgba(216, 70, 43, 0); }
}
@keyframes bounce {
  0% { transform: translateY(-1.1em); opacity: 0; animation-timing-function: cubic-bezier(0.55, 0, 1, 0.45); }
  8% { opacity: 1; }
  45% { transform: translateY(0) scale(1.25, 0.75); animation-timing-function: cubic-bezier(0, 0.55, 0.45, 1); }
  62% { transform: translateY(-0.32em) scale(0.95, 1.06); animation-timing-function: cubic-bezier(0.55, 0, 1, 0.45); }
  76% { transform: translateY(0) scale(1.12, 0.88); animation-timing-function: cubic-bezier(0, 0.55, 0.45, 1); }
  86% { transform: translateY(-0.1em); animation-timing-function: cubic-bezier(0.55, 0, 1, 0.45); }
  94% { transform: translateY(0) scale(1.04, 0.96); }
  100% { transform: none; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before {
    animation: none !important;
  }
}

/* ---------- Small screens ---------- */

@media (max-width: 600px) {
  .tick.minor,
  .pt-label,
  .hide-sm {
    display: none;
  }
  .plot {
    height: clamp(180px, 30vh, 260px);
  }
}
