:root {
  --ink: #171717;
  --paper: #f2f0e8;
  --cream: #fffdf4;
  --acid: #c7ff38;
  --blue: #74b9ff;
  --orange: #ff7043;
  --pink: #ff94c8;
  --border: 2px solid var(--ink);
  color-scheme: light;
  font-family: Arial, Helvetica, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(to right, rgba(23, 23, 23, 0.055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(23, 23, 23, 0.055) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.page-shell {
  width: min(1440px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px clamp(20px, 4vw, 64px) 20px;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.site-header,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-header {
  padding-bottom: 18px;
  border-bottom: var(--border);
}

.wordmark {
  color: inherit;
  font-size: 1rem;
  letter-spacing: -0.045em;
  text-decoration: none;
  text-transform: lowercase;
}

.wordmark span {
  color: var(--orange);
}

.status {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 9px;
  height: 9px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 0 3px rgba(199, 255, 56, 0.35);
}

.hero {
  min-height: 660px;
  padding: clamp(48px, 8vh, 100px) 0;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(330px, 0.85fr);
  align-items: center;
  gap: clamp(48px, 8vw, 140px);
}

.content-section {
  padding: clamp(72px, 10vw, 132px) 0;
  border-top: var(--border);
}

.section-heading {
  margin-bottom: clamp(34px, 6vw, 64px);
  display: grid;
  grid-template-columns: minmax(130px, 0.45fr) minmax(240px, 1fr) minmax(180px, 0.7fr);
  align-items: end;
  gap: 28px;
}

.section-number,
.section-note,
.card-label {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section-note {
  justify-self: end;
  text-align: right;
}

h2 {
  margin: 0;
  font-size: clamp(3.5rem, 8vw, 7.5rem);
  font-weight: 900;
  letter-spacing: -0.075em;
  line-height: 0.8;
}

.eyebrow {
  margin: 0 0 22px;
  font-size: clamp(0.68rem, 1vw, 0.78rem);
  font-weight: 800;
  letter-spacing: 0.14em;
}

h1 {
  margin: 0;
  font-size: clamp(5rem, 12.2vw, 11rem);
  font-weight: 900;
  letter-spacing: -0.09em;
  line-height: 0.72;
  text-transform: lowercase;
}

h1 span {
  display: block;
}

h1 span:last-child {
  margin-left: 0.3em;
  color: transparent;
  -webkit-text-stroke: clamp(1.5px, 0.16vw, 3px) var(--ink);
}

.lede {
  max-width: 520px;
  margin: clamp(36px, 6vh, 64px) 0 0;
  font-size: clamp(1.05rem, 2vw, 1.45rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.25;
}

.playground {
  display: grid;
  justify-items: center;
  gap: 34px;
}

.block-stack {
  position: relative;
  width: min(34vw, 430px);
  aspect-ratio: 1;
}

.block {
  --move-x: 0px;
  --move-y: 0px;
  --turn: 0deg;
  position: absolute;
  width: 43%;
  aspect-ratio: 1;
  border: var(--border);
  padding: 0;
  display: grid;
  place-items: center;
  font-size: clamp(3rem, 7vw, 6.5rem);
  font-weight: 900;
  font-family: inherit;
  color: var(--ink);
  line-height: 1;
  box-shadow: 8px 8px 0 var(--ink);
  transform: translate(var(--move-x), var(--move-y)) rotate(var(--turn));
  transition: transform 500ms cubic-bezier(0.2, 0.8, 0.2, 1), background-color 250ms ease;
  cursor: pointer;
}

.block:hover {
  filter: brightness(1.04);
}

.block:focus-visible {
  outline: 4px solid var(--pink);
  outline-offset: 5px;
}

.block.is-tapped {
  animation: block-pop 380ms ease;
}

.block-a {
  top: 2%;
  left: 4%;
  z-index: 2;
  background: var(--acid);
  --turn: -8deg;
}

.block-b {
  top: 3%;
  right: 3%;
  z-index: 1;
  background: var(--cream);
  --turn: 5deg;
}

.block-c {
  bottom: 3%;
  left: 5%;
  z-index: 3;
  background: var(--blue);
  --turn: 4deg;
}

.block-d {
  right: 2%;
  bottom: 4%;
  z-index: 4;
  background: var(--orange);
  --turn: -5deg;
}

.block-stack.is-shuffling .block-a {
  --move-x: 116%;
  --move-y: 106%;
  --turn: 8deg;
}

.block-stack.is-shuffling .block-b {
  --move-x: -116%;
  --move-y: 108%;
  --turn: -7deg;
}

.block-stack.is-shuffling .block-c {
  --move-x: 116%;
  --move-y: -110%;
  --turn: -4deg;
}

.block-stack.is-shuffling .block-d {
  --move-x: -116%;
  --move-y: -108%;
  --turn: 6deg;
}

.shuffle-button {
  width: min(100%, 280px);
  border: var(--border);
  padding: 15px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink);
  background: var(--cream);
  box-shadow: 5px 5px 0 var(--ink);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.shuffle-button:hover {
  background: var(--pink);
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--ink);
}

.shuffle-button:active {
  transform: translate(4px, 4px);
  box-shadow: 1px 1px 0 var(--ink);
}

.shuffle-button:focus-visible,
.wordmark:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 4px;
}

.secret-message {
  min-height: 1.2em;
  margin: -17px 0 0;
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
  opacity: 0.58;
}

.current-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(18px, 2.5vw, 34px);
}

.current-card {
  min-height: 260px;
  border: var(--border);
  padding: clamp(22px, 3vw, 34px);
  display: flex;
  flex-direction: column;
  box-shadow: 7px 7px 0 var(--ink);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.current-card:hover {
  transform: translate(-3px, -3px) rotate(-0.5deg);
  box-shadow: 11px 11px 0 var(--ink);
}

.current-card-acid {
  background: var(--acid);
}

.current-card-blue {
  background: var(--blue);
}

.current-card-orange {
  background: var(--orange);
}

.current-card h3 {
  margin: auto 0 14px;
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 900;
  letter-spacing: -0.065em;
  line-height: 0.92;
}

.current-card-link {
  display: inline-block;
  max-width: 100%;
  color: inherit;
  font-size: clamp(1.45rem, 2.4vw, 2.4rem);
  line-height: 0.98;
  overflow-wrap: anywhere;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.12em;
}

.current-card-link:hover {
  text-decoration-style: wavy;
}

.current-card-link:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 5px;
}

.current-card > p:last-child {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
}

.change-list {
  border-top: var(--border);
}

.change-entry {
  padding: 30px 0;
  border-bottom: var(--border);
  display: grid;
  grid-template-columns: minmax(220px, 0.45fr) minmax(0, 1fr);
  gap: 36px;
}

.change-meta {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.version-pill {
  border: 1.5px solid var(--ink);
  padding: 4px 7px;
  background: var(--cream);
}

.change-meta time {
  padding-top: 5px;
}

.change-entry h3 {
  margin: 0 0 8px;
  font-size: clamp(1.5rem, 3vw, 2.4rem);
  letter-spacing: -0.05em;
}

.change-entry p {
  max-width: 670px;
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.45;
}

.secret-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 44px));
  border: var(--border);
  padding: 15px 18px;
  color: var(--ink);
  background: var(--pink);
  box-shadow: 5px 5px 0 var(--ink);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: translateY(160%);
  transition: transform 260ms ease;
}

.secret-toast.is-visible {
  transform: translateY(0);
}

.confetti-square {
  position: fixed;
  left: var(--x);
  top: -32px;
  z-index: 15;
  width: var(--size);
  height: var(--size);
  border: 2px solid var(--ink);
  background: var(--color);
  pointer-events: none;
  animation: block-fall var(--duration) var(--delay) cubic-bezier(0.2, 0.7, 0.4, 1) forwards;
}

body.milk-mode .status-dot {
  background: var(--pink);
  box-shadow: 0 0 0 3px rgba(255, 148, 200, 0.35);
}

body.milk-mode .wordmark span {
  color: var(--blue);
}

.error-page .page-shell {
  min-height: 100vh;
}

.error-main {
  padding: clamp(70px, 12vh, 150px) 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.7fr);
  align-items: center;
  gap: clamp(40px, 8vw, 120px);
}

.error-code {
  margin: 0;
  color: transparent;
  font-size: clamp(8rem, 23vw, 20rem);
  font-weight: 900;
  letter-spacing: -0.11em;
  line-height: 0.7;
  -webkit-text-stroke: clamp(2px, 0.22vw, 4px) var(--ink);
}

.error-copy {
  margin: 40px 0 28px;
  font-size: clamp(1.5rem, 3.4vw, 2.7rem);
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 1;
}

.home-link {
  width: min(100%, 250px);
  border: var(--border);
  padding: 15px 18px;
  display: flex;
  justify-content: space-between;
  color: var(--ink);
  background: var(--acid);
  box-shadow: 5px 5px 0 var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
}

.lost-blocks {
  position: relative;
  width: min(34vw, 390px);
  aspect-ratio: 1;
}

.lost-block {
  position: absolute;
  width: 47%;
  aspect-ratio: 1;
  border: var(--border);
  box-shadow: 7px 7px 0 var(--ink);
}

.lost-block:first-child {
  top: 3%;
  left: 6%;
  background: var(--blue);
  transform: rotate(-10deg);
}

.lost-block:nth-child(2) {
  right: 3%;
  bottom: 8%;
  background: var(--orange);
  transform: rotate(8deg);
}

.lost-block:last-child {
  right: 10%;
  top: 4%;
  background: var(--acid);
  transform: rotate(4deg);
}

@keyframes block-pop {
  50% {
    transform: translate(var(--move-x), var(--move-y)) rotate(var(--turn)) scale(1.15);
  }
}

@keyframes block-fall {
  to {
    transform: translateY(115vh) rotate(540deg);
  }
}

.site-footer {
  padding-top: 18px;
  border-top: var(--border);
}

.site-footer p {
  margin: 0;
}

@media (max-width: 820px) {
  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 70px;
  }

  h1 {
    font-size: clamp(4.6rem, 21vw, 8rem);
  }

  .block-stack {
    width: min(82vw, 430px);
  }

  .section-heading {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .section-note {
    justify-self: start;
    text-align: left;
  }

  .current-grid {
    grid-template-columns: 1fr;
  }

  .current-card {
    min-height: 220px;
  }

  .error-main {
    grid-template-columns: 1fr;
  }

  .lost-blocks {
    width: min(80vw, 390px);
    justify-self: center;
  }
}

@media (max-width: 520px) {
  .page-shell {
    padding: 18px 16px;
  }

  .site-header,
  .site-footer {
    font-size: 0.64rem;
  }

  .hero {
    padding: 52px 0 60px;
  }

  .eyebrow {
    max-width: 220px;
    line-height: 1.45;
  }

  .site-footer {
    align-items: flex-end;
  }

  .site-footer p:last-child {
    max-width: 110px;
    text-align: right;
    line-height: 1.4;
  }

  .change-entry {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .change-meta {
    justify-content: space-between;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
