/*
  404-10 — Premium Editorial Typography, standalone HTML/CSS implementation.
  No build step, no framework, no external dependency: copy this file and
  index.html into any project and open it as-is. The layout itself is built
  from three oversized numerals — not a centered layer behind the content.

  Below 768px the numerals collapse to a simple, safe in-flow row above the
  content — no absolute positioning, so nothing can clip or overflow on a
  small screen. From 768px up, the numerals become an `aria-hidden`
  decorative overlay absolutely positioned within the SAME `.intro` wrapper
  the content sits in (never the viewport independently) — but `.content`
  itself always stays in normal document flow, which is what makes `.intro`
  always grow to fit it. That's deliberate: positioning `.content` itself
  absolutely against a fixed `min-height` risks it getting hard-clipped by
  `.notfound`'s own `overflow: hidden` (which exists only to contain the
  numerals' edge-bleed) whenever real content is taller than that fixed
  height. `.content`'s own `padding-top` stands in for "~60–68% down the
  composition" — tuned to roughly match the numeral cluster's own vertical
  footprint above it. The 768–1279px range gets its own, independently-tuned
  reduced offsets/scale — not the 1280px+ desktop composition just shrunk
  proportionally.
*/

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

:root {
  --brand: #39ff14;
  --brand-foreground: #0a0a0a;
  --foreground: #0a0a0a;
  --background: #ffffff;
  --border: #e2e2e2;
  --muted-foreground: #737373;
  --font-sans:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji";
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--foreground);
  background-color: var(--background);
  line-height: 1.5;
}

a {
  text-decoration: none;
  color: inherit;
}

.notfound {
  overflow: hidden;
  background-color: var(--background);
}

/* Motion — a small, staggered per-numeral entrance; disabled entirely under
   reduced motion, where every element already renders at its final, fully
   visible state. The typography/composition carries the premium feel, not
   animation. */
@media (prefers-reduced-motion: no-preference) {
  @keyframes al-in-left {
    from {
      opacity: 0;
      transform: translateX(-12px);
    }
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }

  @keyframes al-in-right {
    from {
      opacity: 0;
      transform: translateX(12px);
    }
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }

  @keyframes al-in-scale {
    from {
      opacity: 0;
      transform: scale(0.97);
    }
    to {
      opacity: 1;
      transform: scale(1);
    }
  }

  @keyframes al-up {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .numeral--a {
    animation: al-in-left 550ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .numeral--zero {
    animation: al-in-scale 550ms cubic-bezier(0.16, 1, 0.3, 1) 70ms both;
  }

  .numeral--b {
    animation: al-in-right 550ms cubic-bezier(0.16, 1, 0.3, 1) 140ms both;
  }

  .content {
    animation: al-up 550ms cubic-bezier(0.16, 1, 0.3, 1) 220ms both;
  }
}

/* Introduction — the one composition wrapper both the numerals and the
   content are positioned against. */
.intro {
  position: relative;
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 3.5rem 1rem;
}

/* Numeral row — decorative, `aria-hidden` in the markup. Below 768px this
   is a plain in-flow flex row; from 768px up it becomes `display: contents`
   so its three spans participate directly in `.intro`'s positioning
   context instead of a flex box that no longer applies once they're
   absolutely positioned. */
.numerals {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  line-height: 1;
  font-weight: 900;
  color: rgba(10, 10, 10, 0.07);
  user-select: none;
}

.numeral--a,
.numeral--b {
  font-size: clamp(3.25rem, 3vw + 2.5rem, 4.5rem);
}

.numeral--zero {
  font-size: clamp(2.5rem, 3vw + 1.75rem, 3.5rem);
  color: var(--brand);
}

.content {
  position: relative;
  z-index: 10;
  margin-top: 2.5rem;
  max-width: 32rem;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  background-color: var(--background);
  color: var(--foreground);
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.heading {
  margin: 1.5rem 0 0;
  font-weight: 600;
  font-size: clamp(1.75rem, 1.3rem + 2vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--foreground);
}

.description {
  margin: 1.25rem auto 0;
  max-width: 28rem;
  font-size: clamp(1rem, 0.94rem + 0.3vw, 1.125rem);
  line-height: 1.65;
  color: var(--muted-foreground);
}

.actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.875rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    opacity 150ms ease;
}

.button--primary {
  color: var(--brand-foreground);
  background-color: var(--brand);
}

.button--primary:hover {
  opacity: 0.9;
}

.button--secondary {
  color: var(--foreground);
  background-color: transparent;
  border: 1px solid var(--border);
}

.button--secondary:hover {
  background-color: rgba(0, 0, 0, 0.03);
}

.button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Structural breakpoints */
@media (min-width: 640px) {
  .actions {
    flex-direction: row;
  }
}

@media (min-width: 768px) {
  .intro {
    padding-top: 4rem;
    padding-bottom: 4rem;
  }

  .numerals {
    display: contents;
  }

  .numeral--a,
  .numeral--zero,
  .numeral--b {
    position: absolute;
  }

  .numeral--a {
    top: 0.5rem;
    left: 5%;
    font-size: clamp(5.5rem, 8vw, 7.5rem);
  }

  .numeral--zero {
    top: 2.5rem;
    left: 50%;
    /* The separate `translate` property (not `transform`), so this
       positioning offset never conflicts with `.numeral--zero`'s own
       `transform`-based scale-in entrance keyframe above — both can be set
       independently instead of one overwriting the other. */
    translate: -50% 0;
    font-size: clamp(4rem, 6vw, 5.5rem);
  }

  .numeral--b {
    top: 1.5rem;
    right: 6%;
    font-size: clamp(6rem, 9vw, 8.5rem);
  }

  .content {
    /* Stays in normal flow (see the file header comment) — this padding is
       what visually "surrounds" it with the numeral cluster above, tuned to
       roughly match that cluster's own tallest extent (~10rem here) with a
       small deliberate overlap rather than a hard gap. */
    margin-top: 0;
    padding-top: 9rem;
    max-width: 400px;
    margin-left: 6%;
    text-align: left;
  }

  .description {
    margin-left: 0;
    margin-right: 0;
  }

  .actions {
    align-items: flex-start;
    justify-content: flex-start;
  }
}

@media (min-width: 1280px) {
  .intro {
    padding-top: 5rem;
    padding-bottom: 5rem;
  }

  .numeral--a {
    top: 1rem;
    left: 9%;
    font-size: clamp(8.5rem, 13vw, 13rem);
  }

  .numeral--zero {
    top: 3.5rem;
    font-size: clamp(6.5rem, 10vw, 9.5rem);
  }

  .numeral--b {
    top: 2.5rem;
    right: 9%;
    font-size: clamp(9.5rem, 15vw, 14.5rem);
  }

  .content {
    padding-top: 14rem;
    max-width: 520px;
    margin-left: 28%;
  }
}
