:root {
  --coral: #F06F5A;
  --burgundy: #5A1026;
  --oxblood: #2A0713;
  --teal: #167C82;
  --cream: #F4E6C8;
  --mustard: #D99B27;
  --aqua: #78D6D0;
  --display: "Jost", "Poppins", "Futura", "Trebuchet MS", sans-serif;
  --punch: "League Spartan", "Poppins", "Trebuchet MS", sans-serif;
  --body: "Nunito Sans", "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--burgundy);
  background:
    radial-gradient(circle at 12% 18%, rgba(240, 111, 90, .16), transparent 24rem),
    radial-gradient(circle at 85% 8%, rgba(120, 214, 208, .14), transparent 22rem),
    linear-gradient(135deg, var(--oxblood), #3a0a1a 55%, var(--oxblood));
  font-family: var(--body);
  overflow-x: hidden;
}

.tabletop {
  min-height: 100vh;
  padding: clamp(18px, 3vw, 42px);
  position: relative;
}

.folio-nav {
  position: fixed;
  z-index: 20;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.folio-nav a {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--punch);
  color: var(--cream);
  text-decoration: none;
  background: var(--burgundy);
  border: 2px solid var(--mustard);
  box-shadow: -4px 4px 0 var(--oxblood);
  transition: transform .25s ease, background .25s ease;
}

.folio-nav a.active,
.folio-nav a:hover { background: var(--teal); transform: translateX(-6px) scale(1.06); }

.magazine { display: grid; gap: clamp(28px, 5vw, 70px); }

.spread {
  min-height: calc(100vh - clamp(36px, 6vw, 84px));
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(12px, 1.6vw, 24px);
  padding: clamp(24px, 5vw, 78px);
  background:
    linear-gradient(90deg, transparent calc(50% - 1px), rgba(90,16,38,.24) calc(50% - 1px), rgba(90,16,38,.24) calc(50% + 1px), transparent calc(50% + 1px)),
    var(--cream);
  border-radius: 30px;
  box-shadow: 0 28px 0 rgba(42, 7, 19, .72), 0 45px 90px rgba(0,0,0,.38);
}

.paper-grain,
.spread::before,
.spread::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.paper-grain {
  z-index: -1;
  background-image:
    radial-gradient(rgba(90,16,38,.09) 1px, transparent 1.5px),
    radial-gradient(rgba(217,155,39,.12) 1px, transparent 1.5px);
  background-size: 16px 16px, 23px 23px;
  mix-blend-mode: multiply;
  opacity: .44;
}

.spread::before {
  border: 2px solid rgba(90, 16, 38, .76);
  inset: 18px;
  border-radius: 20px;
}

.spread::after {
  background: repeating-linear-gradient(90deg, rgba(90,16,38,.08) 0 1px, transparent 1px calc(8.333%));
  opacity: .36;
}

.gutter {
  position: absolute;
  z-index: 1;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 32px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, rgba(42,7,19,.08), rgba(90,16,38,.24), rgba(42,7,19,.07));
  box-shadow: inset 11px 0 20px rgba(90,16,38,.08), inset -11px 0 20px rgba(90,16,38,.08);
}

.kicker,
.caption-rail,
.machine-label,
.lens-label,
.closing-folio {
  font-family: var(--punch);
  text-transform: uppercase;
  letter-spacing: .09em;
}

.kicker { margin: 0 0 16px; color: var(--teal); font-weight: 800; }

h1, h2, h3 { margin: 0; line-height: .9; font-family: var(--display); }

h1 {
  font-size: clamp(76px, 13vw, 190px);
  letter-spacing: -.07em;
  color: var(--burgundy);
  text-shadow: -5px 5px 0 var(--coral), 5px -4px 0 rgba(120,214,208,.65);
}

h1 span { display: block; }
.registration { margin-left: clamp(22px, 5vw, 80px); }

h2 { font-size: clamp(44px, 6vw, 92px); color: var(--burgundy); letter-spacing: -.055em; }
h3 { font-size: clamp(24px, 2.6vw, 38px); color: var(--oxblood); }
p { font-size: clamp(17px, 1.35vw, 22px); line-height: 1.48; }

.caption-rail {
  position: absolute;
  z-index: 4;
  top: 38px;
  bottom: 38px;
  width: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  writing-mode: vertical-rl;
  color: var(--cream);
  background: var(--burgundy);
  border-radius: 999px;
  padding: 24px 0;
  box-shadow: 6px 0 0 var(--mustard);
  font-size: 12px;
}

.left-rail { left: 26px; }
.right-rail { right: 26px; box-shadow: -6px 0 0 var(--mustard); }

.left-page, .right-page, .diagram-copy, .notes-intro, .bench-copy, .exploded-machine, .note-columns, .workbench-board { z-index: 3; }
.hero-copy { grid-column: 2 / 7; align-self: center; }
.hero-copy .lede { max-width: 650px; font-weight: 700; }
.lens-stage { grid-column: 7 / 13; position: relative; display: grid; place-items: center; }

.tab-stack { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 28px; }
.tab-stack span,
.file-tabs span {
  background: var(--mustard);
  color: var(--oxblood);
  border: 2px solid var(--burgundy);
  border-radius: 999px 999px 999px 8px;
  padding: 10px 18px;
  font-family: var(--punch);
  text-transform: uppercase;
  box-shadow: -4px 4px 0 var(--burgundy);
}

.page-number {
  position: absolute;
  right: clamp(34px, 5vw, 82px);
  top: clamp(24px, 4vw, 55px);
  font-family: var(--punch);
  font-size: clamp(90px, 12vw, 180px);
  line-height: .8;
  color: rgba(90, 16, 38, .13);
}
.left-num { left: clamp(54px, 7vw, 110px); right: auto; }

.bubble-lens,
.mini-bubble {
  border: 0;
  cursor: pointer;
  position: relative;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 24%, rgba(244,230,200,.9) 0 7%, rgba(120,214,208,.78) 8% 42%, rgba(22,124,130,.58) 66%, rgba(120,214,208,.3));
  box-shadow: inset -18px -25px 45px rgba(22,124,130,.35), inset 16px 16px 30px rgba(244,230,200,.42), 0 24px 0 rgba(90,16,38,.18), 0 32px 65px rgba(22,124,130,.25);
  transition: transform .45s cubic-bezier(.2,.8,.2,1), filter .45s ease;
}

.hero-lens {
  width: clamp(300px, 37vw, 540px);
  height: clamp(300px, 37vw, 540px);
  animation: lensEntrance 1.6s ease both, buoy 7s ease-in-out infinite 1.4s;
}

.bubble-lens svg { width: 82%; height: 82%; filter: blur(2.2px); transition: filter .45s ease, transform .45s ease; }
.bubble-lens.is-focused svg,
.bubble-lens:hover svg { filter: blur(0); transform: scale(1.03); }
.bubble-lens.is-focused,
.bubble-lens:hover { transform: scale(1.08) rotate(-1.4deg); filter: saturate(1.1); }
.lens-label { position: absolute; left: 50%; bottom: 14%; transform: translateX(-50%); color: var(--burgundy); font-size: 12px; }

.lens-wash { fill: rgba(120, 214, 208, .22); stroke: var(--teal); stroke-width: 5; }
.circuit-line, .rule-path, .arrow-path { fill: none; stroke: var(--burgundy); stroke-width: 8; stroke-linecap: round; stroke-linejoin: round; }
.circuit-line.thin { stroke-width: 5; }
.panel-shape { fill: var(--burgundy); }
.cream-mark { fill: var(--cream); }
.node { fill: var(--teal); stroke: var(--cream); stroke-width: 5; }
.node.coral { fill: var(--coral); }
.node.mustard { fill: var(--mustard); }
.check-pipe { fill: none; stroke: var(--mustard); stroke-width: 11; stroke-linecap: round; stroke-linejoin: round; }
.cursor-mark { fill: none; stroke: var(--coral); stroke-width: 7; stroke-linecap: round; }

.bubble-cluster span,
.final-bubbles span { position: absolute; border-radius: 50%; background: rgba(120,214,208,.45); border: 2px solid rgba(22,124,130,.58); animation: drift 8s ease-in-out infinite; }
.bubble.tiny { width: 26px; height: 26px; }
.bubble.small { width: 54px; height: 54px; }
.bubble.medium { width: 82px; height: 82px; }
.b1 { left: 4%; bottom: 15%; }
.b2 { left: 17%; top: 20%; animation-delay: -2s !important; }
.b3 { right: 11%; bottom: 27%; animation-delay: -4s !important; }
.b4 { right: 20%; top: 12%; animation-delay: -1s !important; }
.rotated-note { position: absolute; right: 5%; bottom: 10%; max-width: 190px; transform: rotate(-7deg); color: var(--teal); font-family: var(--punch); text-transform: uppercase; }

.diagram-copy { grid-column: 2 / 6; align-self: end; padding-bottom: 4vh; }
.exploded-machine { grid-column: 6 / 12; position: relative; min-height: 520px; align-self: center; }
.rule-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.orbit { fill: none; stroke: var(--teal); stroke-width: 4; stroke-dasharray: 10 13; }
.packet-dots circle { fill: var(--coral); }
.machine-label { position: absolute; z-index: 4; background: var(--cream); border: 2px solid var(--burgundy); padding: 10px 16px; border-radius: 4px 20px 20px 4px; box-shadow: 5px 5px 0 var(--mustard); }
.label-a { left: 5%; top: 19%; transform: rotate(-8deg); }
.label-b { right: 9%; top: 38%; transform: rotate(6deg); }
.label-c { left: 28%; bottom: 18%; transform: rotate(-3deg); }
.mini-bubble { position: absolute; z-index: 5; width: 145px; height: 145px; display: grid; place-items: center; }
.mini-bubble span { width: 62%; height: 36%; border-radius: 22px; background: var(--burgundy); display: block; position: relative; filter: blur(1.5px); transition: filter .3s ease; }
.mini-bubble span::before, .mini-bubble span::after { content: ""; position: absolute; height: 8px; border-radius: 8px; background: var(--cream); left: 18px; right: 18px; top: 14px; }
.mini-bubble span::after { top: 34px; right: 34px; }
.mini-bubble i { position: absolute; width: 36px; height: 36px; border-radius: 50%; border: 6px solid var(--mustard); }
.mini-bubble:hover, .mini-bubble.is-focused { transform: scale(1.22); }
.mini-bubble:hover span, .mini-bubble.is-focused span { filter: blur(0); }
.lens-a { left: 8%; top: 24%; }
.lens-b { right: 15%; top: 29%; }
.lens-c { left: 39%; bottom: 12%; }

.notes-spread { align-items: center; }
.notes-intro { grid-column: 2 / 7; }
.note-columns { grid-column: 7 / 12; display: grid; gap: 18px; transform: rotate(-1.5deg); }
.note-card { position: relative; border: 3px solid var(--burgundy); border-radius: 24px 24px 24px 5px; padding: 25px 28px 22px 82px; box-shadow: -8px 8px 0 var(--burgundy); background: rgba(244,230,200,.78); }
.note-card p { margin-bottom: 0; font-size: 17px; }
.note-num { position: absolute; left: 20px; top: 20px; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-family: var(--punch); font-size: 28px; background: var(--mustard); color: var(--oxblood); }
.coral-note { background: rgba(240,111,90,.18); }
.teal-note { background: rgba(120,214,208,.22); }
.mustard-note { background: rgba(217,155,39,.23); }
.side-lens { position: absolute; left: 45%; bottom: 7%; width: 230px; height: 230px; z-index: 5; }

.bench-copy { grid-column: 2 / 7; align-self: center; }
.workbench-board { grid-column: 7 / 12; align-self: center; min-height: 520px; border: 4px solid var(--burgundy); border-radius: 34px; background: linear-gradient(140deg, rgba(120,214,208,.24), rgba(244,230,200,.7) 42%, rgba(217,155,39,.2)); box-shadow: -13px 13px 0 var(--teal); position: relative; overflow: hidden; }
.starburst { position: absolute; right: 34px; top: 36px; width: 150px; height: 150px; display: grid; place-items: center; text-align: center; padding: 22px; color: var(--cream); background: var(--coral); font-family: var(--punch); text-transform: uppercase; clip-path: polygon(50% 0%,60% 30%,90% 12%,72% 42%,100% 50%,72% 59%,90% 88%,60% 70%,50% 100%,40% 70%,10% 88%,28% 59%,0% 50%,28% 42%,10% 12%,40% 30%); }
.file-tabs { position: absolute; left: 34px; top: 50px; display: grid; gap: 13px; }
.appliance-panel { position: absolute; left: 68px; right: 68px; bottom: 70px; height: 150px; border-radius: 28px; background: var(--burgundy); display: flex; align-items: center; justify-content: space-around; padding: 28px; }
.appliance-panel i { width: 58px; height: 58px; border-radius: 50%; background: var(--aqua); border: 7px solid var(--cream); box-shadow: inset -8px -8px 0 var(--teal); }
.final-bubbles span:nth-child(1) { width: 78px; height: 78px; left: 45%; top: 28%; }
.final-bubbles span:nth-child(2) { width: 48px; height: 48px; left: 31%; top: 38%; animation-delay: -3s; }
.final-bubbles span:nth-child(3) { width: 116px; height: 116px; right: 12%; bottom: 26%; animation-delay: -1.5s; }
.closing-folio { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); color: var(--teal); }

@keyframes lensEntrance { from { transform: scale(.62); filter: blur(10px); opacity: .4; } to { transform: scale(1); filter: blur(0); opacity: 1; } }
@keyframes buoy { 0%,100% { translate: 0 0; } 50% { translate: 0 -18px; } }
@keyframes drift { 0%,100% { transform: translateY(0) translateX(0); opacity: .65; } 50% { transform: translateY(-34px) translateX(12px); opacity: .95; } }

@media (max-width: 900px) {
  .tabletop { padding: 12px; }
  .spread { grid-template-columns: 1fr; padding: 64px 24px; gap: 28px; }
  .gutter, .caption-rail, .folio-nav { display: none; }
  .hero-copy, .lens-stage, .diagram-copy, .exploded-machine, .notes-intro, .note-columns, .bench-copy, .workbench-board { grid-column: 1; }
  .side-lens { position: relative; left: auto; bottom: auto; margin: auto; }
  .exploded-machine { min-height: 430px; }
  .workbench-board { min-height: 420px; }
}
