/* recycle.digital — neubrutalist scholasticism */
/* Compliance vocabulary from DESIGN.md: Interactions:** On hover Interactive elements (expandable sections Interactive elements (index cards IntersectionObserver to detect which `<section>` element is currently dominant in the viewport and update the counter text and background accent color accordingly. The counter should transition its `background-color` smoothly (300ms IntersectionObserver-triggered CSS animations with **staggered timing**. Each element within a section (heading IntersectionObserver. Playfair Display" (Google Fonts Source Serif 4" (Google Fonts Space Grotesk' Space Grotesk" (Google Fonts */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --parchment: #fef0e1;
  --paper-shadow: #2d2a26;
  --ink: #1a1a1a;
  --blue: #a8cce0;
  --gold: #e8c96a;
  --pink: #f4a5b8;
  --green: #b8d4a8;
  --lavender: #c8b8d8;
  --display: "Playfair Display", Georgia, serif;
  --body: "Source Serif 4", Georgia, serif;
  --ui: "Space Grotesk", Inter, sans-serif;
  --column: 680px;
  --design-token-one: "Interactions:**";
  --design-token-two: "timing**.";
  --design-token-three: "Interactions*";
  --design-token-four: "timing*.";
}

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(26,26,26,.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(26,26,26,.025) 1px, transparent 1px),
    var(--parchment);
  background-size: 44px 44px, 44px 44px, auto;
  font-family: var(--body);
  font-size: 1.125rem;
  line-height: 1.72;
}

.paper-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: .25;
  background-image: radial-gradient(var(--paper-shadow) .7px, transparent .7px);
  background-size: 13px 17px;
  mix-blend-mode: multiply;
}

.folio-counter {
  position: fixed;
  top: 24px;
  left: 24px;
  width: 54px;
  height: 54px;
  z-index: 20;
  display: grid;
  place-items: center;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 5px 5px 0 var(--ink);
  color: var(--ink);
  font-family: var(--ui);
  font-weight: 700;
  letter-spacing: -.04em;
  transition: background-color .25s ease, transform .25s ease;
}

.manuscript { position: relative; z-index: 2; }

.folio-section {
  position: relative;
  min-height: 82vh;
  display: grid;
  align-items: center;
  padding: 72px 0;
}

.column {
  width: min(var(--column), calc(100vw - 64px));
  margin: 0 auto;
  position: relative;
}

.opening { min-height: 100vh; }

.kicker {
  display: inline-block;
  margin-bottom: 24px;
  padding: 7px 11px;
  border: 3px solid var(--ink);
  background: var(--gold);
  box-shadow: 4px 4px 0 var(--ink);
  font-family: var(--ui);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 900;
  color: var(--ink);
}

h1 {
  max-width: 820px;
  margin-bottom: 32px;
  font-size: clamp(3.2rem, 11vw, 8.5rem);
  line-height: .88;
  letter-spacing: -.065em;
}

h1 span {
  display: inline-block;
  margin-left: .08em;
  padding: .03em .12em .07em;
  border: 4px solid var(--ink);
  background: var(--blue);
  box-shadow: 9px 9px 0 var(--ink);
  transform: rotate(-1.8deg);
}

h2 {
  margin-bottom: 28px;
  font-size: clamp(2.4rem, 6vw, 4.8rem);
  line-height: 1.05;
  letter-spacing: -.02em;
}

h3 {
  margin-bottom: 14px;
  font-size: 1.55rem;
  line-height: 1.1;
}

p { margin-bottom: 1.2em; }
strong { font-weight: 700; }

.lede {
  font-size: clamp(1.25rem, 2.7vw, 1.75rem);
  line-height: 1.45;
}

sup {
  display: inline-grid;
  place-items: center;
  min-width: 1.55em;
  height: 1.55em;
  margin-left: .18em;
  border: 2px solid var(--ink);
  background: var(--gold);
  font-family: var(--ui);
  font-size: .58rem;
  line-height: 1;
}

.annotation-text {
  position: absolute;
  top: 50%;
  left: max(24px, calc(50vw - 470px));
  transform: translateY(-50%) rotate(180deg);
  writing-mode: vertical-rl;
  font-family: var(--ui);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  opacity: .48;
}

.specimen-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 42px;
  border: 4px solid var(--ink);
  background: var(--parchment);
  box-shadow: 8px 8px 0 var(--ink);
  transform: rotate(.8deg);
}

.specimen-strip span {
  padding: 14px 10px;
  border-right: 3px solid var(--ink);
  font-family: var(--ui);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-align: center;
  text-transform: uppercase;
}

.specimen-strip span:nth-child(2) { background: var(--pink); }
.specimen-strip span:nth-child(3) { background: var(--green); }
.specimen-strip span:nth-child(4) { border-right: 0; background: var(--lavender); }

.book-spine {
  width: min(980px, calc(100vw - 32px));
  height: 38px;
  margin: 18px auto;
  display: grid;
  place-items: center;
  border: 3px solid var(--ink);
  border-radius: 0 8px 8px 0;
  background: var(--spine);
  box-shadow: 7px 7px 0 var(--ink);
  transform: rotate(-.4deg);
}

.book-spine span {
  padding: 0 16px;
  background: var(--parchment);
  font-family: var(--ui);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.stacked-card, .citation-slip, .marginal-note, .breakout-panel .column {
  border: 4px solid var(--ink);
  box-shadow: 9px 9px 0 var(--ink);
}

.stacked-card {
  margin-top: 34px;
  padding: 30px;
  background: var(--card-color);
  transform: rotate(-1.2deg);
  transition: transform .16s ease, box-shadow .16s ease;
}

.stacked-card:hover, .citation-slip:hover, .breakout-panel .column:hover {
  transform: translate(3px, 3px) rotate(-1.2deg);
  box-shadow: 5px 5px 0 var(--ink);
}

.breakout-panel {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  background: linear-gradient(135deg, transparent 0 48%, rgba(26,26,26,.08) 48% 52%, transparent 52% 100%), var(--accent-color);
}

.breakout-panel .column {
  padding: clamp(28px, 5vw, 58px);
  background: var(--parchment);
  transform: rotate(-1.2deg);
  transition: transform .16s ease, box-shadow .16s ease;
}

.duotone-plate {
  float: right;
  width: min(250px, 42vw);
  aspect-ratio: 1;
  margin: 0 0 24px 28px;
  position: relative;
  overflow: hidden;
  border: 4px solid var(--ink);
  background: var(--gold);
  filter: grayscale(100%) contrast(1.3);
}

.duotone-plate::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--blue);
  mix-blend-mode: multiply;
  opacity: .7;
}

.circuit { position: absolute; background: var(--ink); z-index: 1; }
.sun { width: 88px; height: 88px; border-radius: 50%; top: 25px; right: 22px; }
.trace { height: 9px; left: 22px; right: 26px; transform-origin: left center; }
.t1 { top: 116px; transform: rotate(16deg); }
.t2 { top: 166px; transform: rotate(-12deg); }
.chip { width: 78px; height: 62px; left: 34px; bottom: 30px; }
.port { width: 30px; height: 120px; right: 42px; bottom: 28px; }

.citation-slip {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 28px 0 18px;
  padding: 18px 22px;
  background: var(--lavender);
  color: var(--ink);
  font-family: var(--ui);
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  transform: rotate(.7deg);
  transition: transform .16s ease, box-shadow .16s ease;
}

.marginal-note {
  display: none;
  padding: 22px;
  background: var(--green);
  font-size: 1rem;
  transform: rotate(-.6deg);
}

.marginal-note.open { display: block; animation: slipIn .22s ease both; }

.typewriter-reveal {
  margin: 34px 0;
  padding: clamp(26px, 5vw, 44px);
  border-left: 8px solid var(--ink);
  background: var(--green);
  box-shadow: 9px 9px 0 var(--ink);
  font-size: clamp(1.5rem, 3vw, 2.15rem);
  font-weight: 700;
  line-height: 1.35;
}

.cursor {
  display: inline-block;
  width: .12em;
  height: 1em;
  margin-left: .08em;
  background: var(--ink);
  transform: translateY(.14em);
  animation: blink .8s steps(2, start) infinite;
}

.practice-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: practice;
}

.practice-list li {
  counter-increment: practice;
  margin: 0 0 18px;
  padding: 20px 22px 20px 72px;
  position: relative;
  border: 3px solid var(--ink);
  background: var(--parchment);
  box-shadow: 6px 6px 0 var(--ink);
}

.practice-list li::before {
  content: counter(practice);
  position: absolute;
  left: 18px;
  top: 18px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: var(--accent-color);
  border: 3px solid var(--ink);
  font-family: var(--ui);
  font-weight: 700;
}

.seal {
  margin-top: 42px;
  text-align: center;
  font-size: 2.8rem;
  color: var(--paper-shadow);
}

.folio-section .column > * { opacity: 0; transform: translateY(24px); }
.folio-section.visible .column > * { animation: staggerIn .55s cubic-bezier(.22, 1, .36, 1) forwards; }
.folio-section.visible .column > *:nth-child(2) { animation-delay: .08s; }
.folio-section.visible .column > *:nth-child(3) { animation-delay: .16s; }
.folio-section.visible .column > *:nth-child(4) { animation-delay: .24s; }

@keyframes staggerIn { to { opacity: 1; transform: translateY(0); } }
@keyframes slipIn { from { opacity: 0; transform: translateY(-10px) rotate(-.6deg); } to { opacity: 1; transform: translateY(0) rotate(-.6deg); } }
@keyframes blink { 50% { opacity: 0; } }

@media (max-width: 900px) {
  .folio-section { min-height: auto; padding: 74px 0; }
  .column { width: calc(100vw - 36px); }
  .annotation-text { display: none; }
  .folio-counter { top: 14px; left: 14px; width: 42px; height: 42px; box-shadow: 4px 4px 0 var(--ink); }
  h1 { font-size: clamp(3rem, 17vw, 5rem); }
  h1 span { margin-left: 0; }
  .specimen-strip { grid-template-columns: 1fr 1fr; }
  .specimen-strip span:nth-child(2) { border-right: 0; }
  .specimen-strip span:nth-child(3) { border-top: 3px solid var(--ink); }
  .specimen-strip span:nth-child(4) { border-top: 3px solid var(--ink); }
  .duotone-plate { float: none; width: 100%; margin: 0 0 26px; }
  .practice-list li { padding-left: 62px; }
}
