:root {
  --paper: #F4F0E8;
  --ink: #111111;
  --red: #E21B1B;
  --kraft: #B9A98B;
  --gray: #6D6A63;
  --bone: #FFFDF7;
  --ease-hard: cubic-bezier(.2,0,.1,1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Noto Sans", sans-serif;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  opacity: .22;
  background:
    linear-gradient(90deg, rgba(17,17,17,.035) 1px, transparent 1px) 0 0 / 64px 64px,
    radial-gradient(circle at 20% 30%, rgba(255,253,247,.55), transparent 26%),
    radial-gradient(circle at 80% 70%, rgba(185,169,139,.24), transparent 32%);
}

.page-grid {
  display: grid;
  grid-template-columns: minmax(150px, 18vw) 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--ink);
  background: var(--bone);
  padding: clamp(18px, 2.4vw, 34px);
  display: grid;
  grid-template-rows: 1fr auto auto auto;
  gap: 24px;
  z-index: 10;
}

.side-lockup {
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(3.6rem, 6.5vw, 8.5rem);
  line-height: .82;
  letter-spacing: .01em;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.side-lockup small {
  font: 500 11px/1 "IBM Plex Mono", monospace;
  margin-top: 14px;
  letter-spacing: .18em;
}

.side-rule {
  width: 100%;
  height: clamp(9px, 1.2vw, 16px);
  background: var(--ink);
  margin: 8px 0 10px;
}

.side-register {
  display: grid;
  gap: 9px;
  font: 500 11px/1.2 "IBM Plex Mono", monospace;
  color: var(--gray);
}

.side-register span {
  border-top: 1px solid var(--ink);
  padding-top: 7px;
}

.pulse-block {
  width: 20px;
  height: 20px;
  background: var(--red);
  transform-origin: center;
  animation: pulseAttention 2.8s var(--ease-hard) infinite;
}

.side-note {
  margin: 0;
  max-width: 15ch;
  color: var(--gray);
  font: 500 10px/1.55 "IBM Plex Mono", monospace;
  letter-spacing: .08em;
}

.stage { min-width: 0; }

.panel {
  min-height: 100vh;
  position: relative;
  padding: clamp(28px, 5vw, 72px);
  display: grid;
  align-items: center;
  border-bottom: 1px solid var(--ink);
  overflow: hidden;
}

.panel-code {
  position: absolute;
  top: clamp(18px, 2.2vw, 32px);
  left: clamp(28px, 5vw, 72px);
  font: 500 11px/1 "IBM Plex Mono", monospace;
  letter-spacing: .12em;
  color: var(--gray);
  border: 1px solid var(--ink);
  background: var(--bone);
  padding: 8px 11px;
}

.hero-grid, .shelf-layout, .final-composition {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(14px, 2vw, 24px);
  width: 100%;
}

.hero-words { grid-column: 1 / 8; }

h1, h2 {
  font-family: "Bebas Neue", sans-serif;
  font-weight: 400;
  margin: 0;
  letter-spacing: .005em;
}

h1 {
  font-size: clamp(5rem, 18vw, 16rem);
  line-height: .78;
  display: flex;
  flex-direction: column;
}

h1 i {
  display: block;
  width: min(68vw, 760px);
  height: clamp(16px, 2vw, 28px);
  margin: clamp(8px, 1vw, 14px) 0;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 900ms var(--ease-hard);
}

.panel.is-visible h1 i { transform: scaleX(1); }

.hero-words p {
  width: min(460px, 88%);
  margin: 28px 0 0;
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  line-height: 1.55;
}

.manual-object {
  grid-column: 9 / 13;
  min-height: 420px;
  border: 1px solid var(--ink);
  background: var(--bone);
  position: relative;
  transform: rotate(-2deg) translateY(16px);
  transition: transform 800ms var(--ease-hard);
}

.panel.is-visible .manual-object { transform: rotate(-2deg) translateY(0); }

.black-slab {
  position: absolute;
  left: 18%;
  top: 18%;
  width: 40%;
  height: 64%;
  background: var(--ink);
}

.red-chip { position: absolute; right: 19%; top: 28%; }

.kraft-card {
  position: absolute;
  left: 11%;
  right: 11%;
  bottom: 12%;
  border: 1px solid var(--ink);
  background: var(--kraft);
  padding: 14px;
  font: 500 12px/1 "IBM Plex Mono", monospace;
}

.reg-mark {
  position: absolute;
  width: 36px;
  height: 36px;
  border-color: var(--ink);
  border-style: solid;
}

.top-left { top: 14px; left: 14px; border-width: 2px 0 0 2px; }
.bottom-right { right: 14px; bottom: 14px; border-width: 0 2px 2px 0; }

.shelf-panel { background: linear-gradient(180deg, var(--paper), var(--bone)); }
.shelf-layout { align-items: end; }
.shelf-layout h2 {
  grid-column: 1 / 5;
  font-size: clamp(4rem, 10vw, 10rem);
  line-height: .82;
}

.label-stack {
  grid-column: 5 / 13;
  display: grid;
  gap: 18px;
}

.label-strip {
  min-height: 112px;
  border: 1px solid var(--ink);
  background: var(--kraft);
  display: grid;
  grid-template-columns: 1.2fr 2fr 90px;
  align-items: center;
  gap: 20px;
  padding: 18px 22px;
  transform: translateX(-12px);
  opacity: .74;
  transition: transform 700ms var(--ease-hard), opacity 700ms var(--ease-hard);
}

.panel.is-visible .label-strip { transform: translateX(0); opacity: 1; }
.panel.is-visible .label-strip:nth-child(2) { transition-delay: 110ms; }
.panel.is-visible .label-strip:nth-child(3) { transition-delay: 220ms; }

.label-strip span, .final-copy p {
  font: 500 12px/1 "IBM Plex Mono", monospace;
  letter-spacing: .12em;
}

.label-strip p { margin: 0; line-height: 1.45; }
.token { justify-self: end; display: block; border: 1px solid var(--ink); }
.square-token { width: 54px; height: 54px; background: var(--bone); transform: rotate(3deg); }
.circle-token { width: 58px; height: 58px; border-radius: 50%; background: var(--paper); transform: translateX(8px); }
.bar-token { width: 78px; height: 18px; background: var(--ink); transform: rotate(-4deg); }

.quiet-panel { background: var(--bone); align-items: stretch; }
.quiet-copy {
  align-self: center;
  width: min(850px, 92%);
  margin-left: 8vw;
}

.warning-dot { margin-bottom: 26px; }
.mono-line {
  font: 500 12px/1 "IBM Plex Mono", monospace;
  color: var(--gray);
  letter-spacing: .14em;
  opacity: 0;
}
.panel.is-visible .mono-line { animation: blinkOnce 850ms steps(2, end) 1 forwards; }

.quiet-copy h2 {
  margin-top: 28px;
  font-size: clamp(3.5rem, 8vw, 9rem);
  line-height: .86;
  max-width: 9ch;
}

.empty-frame {
  position: absolute;
  right: clamp(28px, 6vw, 90px);
  bottom: clamp(28px, 6vw, 90px);
  width: min(32vw, 370px);
  height: min(22vw, 250px);
  border: 1px solid var(--ink);
  transform: rotate(2deg);
}

.empty-frame span:first-child { position: absolute; inset: 22px auto auto 22px; width: 42px; height: 42px; border: 1px solid var(--ink); }
.empty-frame span:last-child { position: absolute; right: 26px; bottom: 24px; width: 90px; height: 12px; background: var(--ink); }

.final-panel { background: var(--paper); }
.final-composition { align-items: center; }
.severe-frame {
  grid-column: 1 / 8;
  min-height: 62vh;
  position: relative;
}

.frame-bar { position: absolute; background: var(--ink); transition: transform 900ms var(--ease-hard); }
.frame-bar.top, .frame-bar.bottom { height: 22px; left: 0; right: 0; transform: scaleX(0); }
.frame-bar.left, .frame-bar.right { width: 22px; top: 0; bottom: 0; transform: scaleY(0); }
.frame-bar.top { top: 0; transform-origin: left; }
.frame-bar.bottom { bottom: 0; transform-origin: right; }
.frame-bar.left { left: 0; transform-origin: bottom; }
.frame-bar.right { right: 0; transform-origin: top; }
.panel.is-visible .frame-bar.top, .panel.is-visible .frame-bar.bottom { transform: scaleX(1); }
.panel.is-visible .frame-bar.left, .panel.is-visible .frame-bar.right { transform: scaleY(1); }

.converge { position: absolute; border: 1px solid var(--ink); transition: transform 1000ms var(--ease-hard); }
.square-a { width: 88px; height: 88px; background: var(--kraft); left: 18%; top: 20%; transform: translate(-28px, 18px) rotate(4deg); }
.circle-a { width: 130px; height: 130px; border-radius: 50%; background: var(--bone); right: 18%; top: 28%; transform: translate(22px, -16px); }
.bar-a { width: 220px; height: 24px; background: var(--ink); left: 32%; bottom: 28%; transform: translateY(28px) rotate(-3deg); }
.red-a { right: 22%; bottom: 22%; }
.panel.is-visible .converge { transform: translate(0,0) rotate(0deg); }

.final-copy { grid-column: 8 / 13; }
.final-copy h2 { font-size: clamp(4rem, 9vw, 10rem); line-height: .84; }
.final-copy span { display: block; margin-top: 26px; color: var(--gray); font: 500 12px/1.5 "IBM Plex Mono", monospace; }

@keyframes pulseAttention {
  0%, 100% { transform: scale(1); opacity: .55; }
  50% { transform: scale(1.08); opacity: 1; }
}

@keyframes blinkOnce {
  0% { opacity: 0; }
  18% { opacity: 1; }
  34% { opacity: 0; }
  52%, 100% { opacity: 1; }
}

@media (max-width: 780px) {
  .page-grid { display: block; }
  .sidebar {
    position: sticky;
    top: 0;
    height: auto;
    min-height: 82px;
    border-right: 0;
    border-bottom: 1px solid var(--ink);
    grid-template-columns: 1fr auto auto;
    grid-template-rows: auto;
    align-items: center;
    padding: 14px 18px;
  }
  .side-lockup { flex-direction: row; align-items: center; gap: 10px; font-size: 2.5rem; }
  .side-rule { width: 32px; height: 8px; margin: 0; }
  .side-register, .side-note { display: none; }
  .panel { padding: 96px 22px 40px; }
  .panel-code { left: 22px; top: 26px; }
  .hero-grid, .shelf-layout, .final-composition { display: block; }
  .manual-object { margin-top: 46px; min-height: 300px; }
  .label-stack { margin-top: 36px; }
  .label-strip { grid-template-columns: 1fr; gap: 12px; }
  .token { justify-self: start; }
  .quiet-copy { margin-left: 0; }
  .empty-frame { position: relative; right: auto; bottom: auto; width: 78vw; height: 190px; margin-top: 40px; }
  .severe-frame { min-height: 420px; }
  .final-copy { margin-top: 38px; }
}
