/* Palette sampled directly from the logo PNG. */
:root {
  --cream: #FCF9F4;
  --ink:   #111315;
  --red:   #E01D1C;
  --gold:  #F9C015;

  --measure: 62rem;
  --pad: clamp(1.25rem, 5vw, 3rem);
}

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

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  font-synthesis-weight: none;
  line-height: 1.45;
  text-rendering: optimizeLegibility;
}

/* The logo's three colours as a poster stripe across the top. */
.stripe {
  height: 10px;
  background: linear-gradient(
    to right,
    var(--red)  0 33.333%,
    var(--gold) 33.333% 66.666%,
    var(--ink)  66.666% 100%
  );
}

main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(2rem, 7vw, 5rem) var(--pad) 0;
}

/* ---------- hero ---------- */

.hero { text-align: center; }

.logo {
  display: block;
  width: min(100%, 34rem);
  height: auto;
  margin: 0 auto;
}

.tagline {
  /* Top padding is the room the handwritten "Ideas" is drawn into. */
  padding-top: 1.05em;
  margin: clamp(0.25rem, 1vw, 0.75rem) 0 0;
  font-size: clamp(1.5rem, 6.2vw, 2.75rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  text-wrap: balance;
}

/* ---------- the "pasta" -> "Ideas" correction ---------- */

.swap {
  position: relative;
  display: inline-block;
  white-space: nowrap;
}

/* Our own drawn stroke replaces the browser's line-through. */
.struck { text-decoration: none; }

.strike,
.written {
  position: absolute;
  overflow: visible;
  fill: none;
  stroke: var(--red);
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.strike {
  top: 50%;
  left: -5%;
  width: 110%;
  height: 0.42em;
  transform: translateY(-45%);
  /* This SVG is stretched non-uniformly (preserveAspectRatio="none"), which
     would squash the stroke too. non-scaling-stroke keeps it even, and an em
     width keeps it in proportion to the clamped tagline size. */
  vector-effect: non-scaling-stroke;
  stroke-width: 0.075em;
}

.strike path { vector-effect: non-scaling-stroke; }

.written {
  bottom: 82%;
  left: 50%;
  width: 2.5em;              /* a touch wider than the word it corrects */
  height: auto;
  transform: translateX(-50%) rotate(-4deg);
  stroke-width: 8;
}

/* Each stroke draws itself: pathLength="1" normalises every path to the same
   length so one dash animation serves all of them, whatever their real size. */
.strike path,
.written path {
  stroke-dasharray: 1 1;
  stroke-dashoffset: 1;
  animation: draw 0.34s ease-out forwards;
}

.strike path { animation-duration: 0.42s; animation-delay: 1s; }

.written path:nth-child(1) { animation-delay: 1.62s; }
.written path:nth-child(2) { animation-delay: 1.78s; }
.written path:nth-child(3) { animation-delay: 1.94s; }
.written path:nth-child(4) { animation-delay: 2.12s; animation-duration: 0.5s; }
.written path:nth-child(5) { animation-delay: 2.5s;  animation-duration: 0.44s; }
.written path:nth-child(6) { animation-delay: 2.84s; animation-duration: 0.44s; }

@keyframes draw {
  to { stroke-dashoffset: 0; }
}

/* Narrow screens wrap the tagline, which puts "HIGH-VELOCITY" directly above
   the corrected word. The handwriting is drawn into the space above that word,
   so the wrapped case needs real leading or the two collide. */
@media (max-width: 46rem) {
  .tagline { line-height: 2; }
  .written { width: 2.15em; }
}

/* Visually hidden but read aloud — carries "Ideas" to screen readers. */
.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  margin: clamp(1.25rem, 4vw, 2rem) 0 0;
  padding: 0.5em 1.1em;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  font-size: clamp(0.8rem, 2.4vw, 0.95rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.dot {
  width: 0.7em;
  height: 0.7em;
  border-radius: 50%;
  background: var(--red);
  animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1;   transform: scale(1); }
  50%      { opacity: 0.35; transform: scale(0.82); }
}

/* ---------- specs ---------- */

.specs { margin-top: clamp(3rem, 9vw, 5.5rem); }

.specs dl {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: clamp(0.75rem, 2vw, 1.25rem);
  margin: 0;
}

.spec {
  padding: clamp(1rem, 3vw, 1.5rem);
  border: 3px solid var(--ink);
  background: #fff;
  box-shadow: 6px 6px 0 var(--ink);
}

.spec dt {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
}

.spec dd {
  margin: 0.35rem 0 0;
  font-size: clamp(1.1rem, 3.2vw, 1.4rem);
  font-weight: 900;
  letter-spacing: -0.01em;
}

/* ---------- note ---------- */

.note {
  margin: clamp(3rem, 9vw, 5.5rem) auto 0;
  max-width: 34rem;
  border-top: 3px solid var(--ink);
  padding-top: clamp(1.5rem, 4vw, 2rem);
}

.note p {
  margin: 0;
  font-size: clamp(1rem, 2.8vw, 1.2rem);
  text-wrap: pretty;
}

/* ---------- footer ---------- */

footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  margin-top: clamp(3.5rem, 10vw, 6rem);
  padding: clamp(1.5rem, 4vw, 2rem) var(--pad) clamp(2.5rem, 6vw, 3.5rem);
  font-size: 0.9rem;
}

footer p { margin: 0; }

a {
  color: var(--ink);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
a:hover { color: var(--red); }

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

/* ---------- dark mode ---------- */

@media (prefers-color-scheme: dark) {
  :root { --cream: #14100C; }
  body { color: #FCF9F4; }
  /* The logo art is transparent-backed and its wordmark is black ink, so on a
     dark page it needs its own cream plate or "SPAGHETTI" disappears. */
  .logo {
    background: #FCF9F4;
    border-radius: 14px;
    padding: clamp(0.75rem, 3vw, 1.5rem);
  }
  .spec, .status { background: #1D1813; border-color: #FCF9F4; }
  .spec { box-shadow: 6px 6px 0 var(--gold); }
  .spec dt { color: var(--gold); }
  .note { border-top-color: #FCF9F4; }
  .strike, .written { stroke: var(--gold); }
  a { color: #FCF9F4; }
  a:hover { color: var(--gold); }
  :focus-visible { outline-color: var(--gold); }
}

@media (prefers-reduced-motion: reduce) {
  .dot { animation: none; }
  /* Skip the drawing, keep the result — the correction still reads. */
  .strike path,
  .written path {
    animation: none;
    stroke-dashoffset: 0;
  }
}
