/* Saint's board: a whiteboard canvas of frames joined by arrows. */
:root {
  /* brand: white field, a red core glowing out through orange to yellow */
  --paper: #ffffff;
  --red: #ff2a00;
  --orange: #ff7a00;
  --yellow: #ffc21a;
  --glow: radial-gradient(circle at 50% 50%, var(--red) 0%, var(--orange) 42%, var(--yellow) 66%, rgba(255, 194, 26, 0) 100%);

  /* contrast partners so text stays readable on white */
  --ink: #1c0f08;      /* warm black for text and shapes */
  --ink-soft: #5c4339;
  --pen: #c92c00;      /* deep red-orange marker: notes, selection (AA on white) */
  --label: #76625a;    /* 5.7:1 on white (was 4.0:1) */
  --label-dim: #9a8479; /* 3.5:1: dimmed handwritten arrow labels (large text) */
  --line: #ecdcd2;
  --dot: #f0d9cb;
  --sticky: #ffd54a;
  --wash: #fff3ea;

  --sans: "Schibsted Grotesk", system-ui, sans-serif;
  --hand: "Shantell Sans", "Comic Sans MS", cursive;

  --hand-radius: 18px 6px 16px 8px / 8px 16px 6px 18px;

  --on-bright: #1c0f08;  /* text on yellow / orange fills, in both themes */
  --arrow-dim: #dcc6b9;
  --hud-shadow: 0 0 0 1px rgba(0,0,0,.08), 0 4px 14px -4px rgba(0,0,0,.18);
  --print-blend: multiply;
  --handle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11'%3E%3Crect x='.75' y='.75' width='9.5' height='9.5' rx='1.5' fill='white' stroke='%23c92c00' stroke-width='1.5'/%3E%3C/svg%3E");
  color-scheme: light;
}

/* dark: the same board after hours, warm charcoal with the glow turned up */
:root[data-theme="dark"] {
  --paper: #140c08;
  --ink: #f6ece5;
  --ink-soft: #cdb9ae;
  --pen: #ff7440;       /* 6.6:1 on paper */
  --label: #ad978c;     /* 6.4:1 */
  --label-dim: #806b61; /* 3.6:1 (large handwritten text) */
  --line: #3b2a21;
  --dot: #33241c;
  --sticky: #ffcf3d;
  --wash: #2a1a12;
  --arrow-dim: #4d3a30;
  --hud-shadow: 0 0 0 1px rgba(255,255,255,.09), 0 6px 18px -4px rgba(0,0,0,.6);
  --print-blend: screen;
  --handle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11'%3E%3Crect x='.75' y='.75' width='9.5' height='9.5' rx='1.5' fill='%23140c08' stroke='%23ff7440' stroke-width='1.5'/%3E%3C/svg%3E");
  color-scheme: dark;
}
body, .board, .frame, .card, .hud, .pages-list, .arrow-label, .cta { transition: background-color .35s, color .35s, border-color .35s; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font: 400 19px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
a { color: inherit; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
:focus-visible { outline: 2.5px solid var(--pen); outline-offset: 3px; border-radius: 4px; }

::selection { background: var(--yellow); color: var(--on-bright); }
.skip { position: fixed; left: 12px; top: -60px; z-index: 50; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 8px; }
.skip:focus { top: 12px; }

/* ---------- board + camera ---------- */
.board {
  position: fixed; inset: 0;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  user-select: none;
  background-color: var(--paper);
  background-image: radial-gradient(circle, var(--dot) 1.2px, transparent 1.4px);
  background-size: 24px 24px;
}
.board.dragging { cursor: grabbing; }
.world { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }

/* ---------- frames ---------- */
.frame {
  position: absolute;
  left: calc(var(--x) * 1px); top: calc(var(--y) * 1px);
  width: calc(var(--w) * 1px);
  padding: 64px 72px 72px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 2px;
}
.frame-title {
  position: absolute; left: -1px; bottom: 100%;
  margin: 0 0 10px;
  font: 500 17px/1 var(--sans);
  color: var(--label);
  white-space: nowrap;
}
/* selection box with corner handles on the frame you are in */
.frame::before, .frame::after { content: ""; position: absolute; pointer-events: none; opacity: 0; transition: opacity .35s; }
.frame::before { inset: -1px; border: 1.5px solid var(--pen); }
.frame::after {
  inset: -6px;
  --h: var(--handle);
  background: var(--h) left top / 11px no-repeat, var(--h) right top / 11px no-repeat,
              var(--h) left bottom / 11px no-repeat, var(--h) right bottom / 11px no-repeat;
}
.frame.is-current::before, .frame.is-current::after { opacity: 1; }
/* frames take focus when you jump to them; the selection box already marks them */
.frame:focus { outline: none; }
.frame.is-current .frame-title { color: var(--pen); }

/* ---------- type ---------- */
h1, h2, h3, h4 { margin: 0; font-family: var(--sans); }
.hero { display: flex; flex-direction: column; font-weight: 800; font-size: 104px; line-height: .94; letter-spacing: -.045em; margin: 28px 0 40px; }
.hero > span + span { font-weight: 500; color: var(--ink-soft); }
.small-hero { font-size: 84px; margin-top: 0; }
h2 { font-size: 52px; line-height: 1.02; letter-spacing: -.03em; font-weight: 800; margin-bottom: 28px; max-width: 18ch; }
h3 { font-size: 28px; line-height: 1.15; letter-spacing: -.015em; font-weight: 700; margin: 36px 0 14px; }
h4 { font-size: 17px; font-weight: 700; margin: 22px 0 8px; }
p { margin: 0 0 14px; max-width: 62ch; }
.lede { font-size: 22px; color: var(--ink-soft); max-width: 52ch; }
.kicker { font-weight: 700; font-size: 23px; margin-top: 22px; }
.small { font-size: 16px; color: var(--ink-soft); }
.muted { color: var(--label); }

.home-top { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; }
.wordmark { margin: 0; font: 800 26px/1 var(--sans); letter-spacing: -.02em; display: flex; align-items: center; gap: 12px; }
/* the logo: a glowing head over glowing shoulders */
.mark { position: relative; width: 34px; height: 38px; flex: none; }
.mark::before, .mark::after { content: ""; position: absolute; left: 50%; transform: translateX(-50%); background: var(--glow); border-radius: 50%; }
.mark::before { top: 0; width: 18px; height: 18px; }
.mark::after { bottom: -10px; width: 34px; height: 30px; clip-path: inset(0 0 10px 0); }
.role { margin: 0; font-size: 17px; color: var(--ink-soft); }
.home-copy p { font-size: 21px; max-width: 54ch; }

/* ---------- buttons ---------- */
.ctas { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.cta {
  display: inline-block; padding: 14px 24px;
  font: 700 18px/1 var(--sans); text-decoration: none;
  border: 2px solid var(--ink); border-radius: var(--hand-radius);
  background: var(--paper); color: var(--ink);
  transition: transform .15s;
}
.cta.solid { background: linear-gradient(100deg, var(--red), var(--orange) 70%, var(--yellow)); color: var(--on-bright); }
.cta:hover { transform: rotate(-1.2deg) translateY(-1px); }

/* ---------- cards / shapes ---------- */
.cards.two { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-top: 32px; }
.card { border: 2px solid var(--ink); border-radius: var(--hand-radius); padding: 30px 32px; background: var(--paper); }
.card:nth-child(2) { border-radius: 8px 18px 6px 16px / 16px 6px 18px 8px; }
.card h3 { margin-top: 0; }
.card p { font-size: 18px; }
.card .q { font-family: var(--hand); color: var(--pen); font-size: 20px; }
.tags { list-style: none; padding: 0; margin: 0 0 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { font-size: 14px; font-weight: 500; padding: 4px 12px; border: 1.5px solid var(--line); border-radius: 999px; color: var(--ink-soft); }
.tags .status { border-color: var(--pen); color: var(--pen); font-family: var(--hand); }
.card-links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 18px; font-weight: 700; }
.ticks { margin: 0; padding: 0; list-style: none; font-size: 17px; }
.ticks li { padding-left: 22px; position: relative; margin: 4px 0; }
.ticks li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 9px; height: 5px; border-left: 2px solid var(--pen); border-bottom: 2px solid var(--pen); transform: rotate(-45deg); }
.empty-note { font-family: var(--hand); color: var(--pen); font-size: 22px; margin-top: 28px; }

.stickies { list-style: none; padding: 0; margin: 8px 0 30px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.stickies li {
  background: var(--sticky); padding: 18px 16px 26px; min-height: 120px;
  font: 500 18px/1.3 var(--hand); color: var(--on-bright);
  box-shadow: 0 1px 1px rgba(0,0,0,.08), 0 6px 10px -6px rgba(0,0,0,.25);
  transform: rotate(var(--r, -1deg));
}
.stickies li:nth-child(3n+2) { --r: 1.2deg; }
.stickies li:nth-child(3n) { --r: -.4deg; }

.process { list-style: none; padding: 0; margin: 10px 0 30px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 34px; counter-reset: step; }
.process li { position: relative; border: 2px solid var(--ink); border-radius: var(--hand-radius); padding: 18px 16px; counter-increment: step; font-size: 15.5px; line-height: 1.45; }
.process strong { display: block; font-size: 20px; margin-bottom: 6px; }
.process strong::before { content: counter(step) ". "; font-family: var(--hand); color: var(--pen); }
.process li + li::before {
  content: ""; position: absolute; left: -32px; top: 34px; width: 26px; height: 2px; background: var(--pen);
}
.process li + li::after {
  content: ""; position: absolute; left: -14px; top: 29px; width: 8px; height: 8px;
  border-top: 2px solid var(--pen); border-right: 2px solid var(--pen); transform: rotate(45deg);
}

.faq details { border-bottom: 1.5px solid var(--line); padding: 16px 0; }
.faq summary { cursor: pointer; font-weight: 700; font-size: 22px; list-style: none; display: flex; justify-content: space-between; gap: 20px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--hand); color: var(--pen); font-size: 28px; line-height: .8; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin-top: 10px; font-size: 18px; color: var(--ink-soft); }

.signoff { font-family: var(--hand); color: var(--pen); font-size: 28px; line-height: 1.3; margin-top: 30px; transform: rotate(-1.5deg); transform-origin: left; }
.elsewhere { margin-top: 26px; font-weight: 500; }
.email-line { margin-top: 14px; font: 500 22px/1.3 var(--hand); color: var(--pen); user-select: all; }
.colophon { margin-top: 44px; padding-top: 22px; border-top: 1.5px solid var(--line); font-size: 16px; color: var(--ink-soft); display: grid; grid-template-columns: repeat(4, auto); gap: 6px 26px; justify-content: start; }
.colophon p { margin: 0; }

/* ---------- handwritten margin notes ---------- */
.scribbles { list-style: none; margin: 0; padding: 0; }
.scribble {
  position: absolute; left: var(--sx); top: var(--sy);
  font: 500 27px/1.2 var(--hand); color: var(--pen);
  transform: rotate(var(--r)); white-space: nowrap; pointer-events: none;
}
.scribble small { display: block; font-size: 19px; color: var(--ink-soft); margin-top: 6px; }
.hint { width: 320px; white-space: normal; }

/* ---------- arrows ---------- */
.arrows { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; }
.arrow path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.arrow .line, .arrow .head { stroke: var(--ink); stroke-width: 3; transition: stroke .3s, opacity .3s; }
.arrow.dim .line, .arrow.dim .head { stroke: var(--arrow-dim); }
.arrow .hit { stroke: transparent; stroke-width: 36; pointer-events: stroke; cursor: pointer; }
.arrow .trace { stroke-width: 7; opacity: 0; }
.arrow:hover .line, .arrow:hover .head, .arrow.hover .line, .arrow.hover .head { stroke: var(--pen); }

.arrow-labels { position: absolute; left: 0; top: 0; }
.arrow-label {
  position: absolute; transform: translate(-50%, -50%);
  font: 500 22px/1.15 var(--hand); color: var(--ink);
  background: var(--paper); border: 0; padding: 4px 10px; border-radius: 6px;
  cursor: pointer; white-space: nowrap;
  transition: color .3s;
}
.arrow-label.dim { color: var(--label-dim); }
.arrow-label:hover, .arrow-label.hover { color: var(--pen); }

/* ---------- HUD ---------- */
.hud { position: fixed; z-index: 20; display: flex; gap: 6px; padding: 6px; background: var(--paper); border-radius: 12px; box-shadow: var(--hud-shadow); }
.hud-top { left: 12px; top: 12px; }
.hud-bottom { left: 50%; bottom: 14px; transform: translateX(-50%); }
.hud-btn { font: 500 15px/1 var(--sans); color: var(--ink); background: none; border: 0; padding: 9px 12px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.hud-btn:hover { background: var(--wash); }
.hud-btn.icon { width: 36px; font-size: 20px; padding: 6px 0; }
#pages-btn .mark, #pages-btn .menu-icon, .swipe-hint, .case-more { display: none; }
.theme-btn { display: grid; place-items: center; }
.theme-btn svg { width: 19px; height: 19px; grid-area: 1 / 1; transition: transform .4s, opacity .3s; }
.theme-btn .i-sun { opacity: 0; transform: rotate(-90deg) scale(.6); }
:root[data-theme="dark"] .theme-btn .i-sun { opacity: 1; transform: none; color: var(--yellow); }
:root[data-theme="dark"] .theme-btn .i-moon { opacity: 0; transform: rotate(90deg) scale(.6); }
.zoom-read { min-width: 62px; font-variant-numeric: tabular-nums; }
.pages { position: relative; }
.pages-list { position: absolute; left: -6px; top: calc(100% + 12px); margin: 0; padding: 6px; list-style: none; background: var(--paper); border-radius: 12px; min-width: 230px; box-shadow: 0 0 0 1px rgba(0,0,0,.08), 0 8px 24px -6px rgba(0,0,0,.2); }
.pages-list button { width: 100%; text-align: left; }
.pages-list button[aria-current="true"] { color: var(--pen); font-weight: 700; }

/* ---------- unapproved content: shown only with ?draft ---------- */
.pending { display: none !important; }
.show-drafts .pending { display: block !important; outline: 2px dashed #e03131; outline-offset: 6px; }
.show-drafts span.pending { display: inline !important; }
.show-drafts article.pending::before { content: "Draft: needs approval before launch"; display: block; font: 600 14px var(--hand); color: #e03131; margin-bottom: 10px; }

.next-link { display: none; }

/* ---------- work cards and case studies ---------- */
.card-media { display: block; width: calc(100% + 64px); margin: -30px -32px 22px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 16px 4px 0 0 / 6px 14px 0 0; border-bottom: 2px solid var(--ink); background: var(--wash); }
.case h2 { max-width: none; }
.film { margin: 34px 0 0; }
.film video { display: block; width: 100%; aspect-ratio: 16 / 9; background: var(--ink); border: 2px solid var(--ink); border-radius: var(--hand-radius); }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 26px 0 8px; border: 2px solid var(--ink); border-radius: var(--hand-radius); }
.facts div { padding: 16px 22px; }
.facts div + div { border-left: 1.5px solid var(--line); }
.facts dt { font: 500 16px/1.2 var(--hand); color: var(--pen); margin-bottom: 4px; }
.facts dd { margin: 0; font-weight: 700; font-size: 19px; }
.case-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.storyboard { margin: 10px 0 0; }
.storyboard img { display: block; width: 100%; height: auto; border: 2px solid var(--ink); border-radius: var(--hand-radius); }
.storyboard figcaption { font: 500 18px/1.3 var(--hand); color: var(--pen); margin-top: 10px; }
.beats { list-style: none; padding: 0; margin: 40px 0 10px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.beats.three { grid-template-columns: repeat(3, 1fr); }
.disclaimer { display: inline-block; font: 500 17px/1.3 var(--hand); color: var(--pen); border: 1.5px dashed var(--pen); border-radius: 8px; padding: 6px 12px; }
.loop { list-style: none; padding: 0; margin: 8px 0 26px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 34px; counter-reset: loop; }
.loop li { position: relative; padding: 16px 16px 18px; border-radius: var(--hand-radius); background: var(--wash); font-size: 15.5px; line-height: 1.45; counter-increment: loop; }
.loop strong { display: block; font-size: 19px; margin-bottom: 4px; }
.loop strong::before { content: counter(loop) ". "; font-family: var(--hand); color: var(--pen); }
.loop li + li::before { content: ""; position: absolute; left: -30px; top: 28px; width: 24px; height: 2px; background: var(--pen); }
.loop li + li::after { content: ""; position: absolute; left: -13px; top: 23px; width: 8px; height: 8px; border-top: 2px solid var(--pen); border-right: 2px solid var(--pen); transform: rotate(45deg); }
.beats li { display: flex; flex-direction: column; gap: 4px; font-size: 16px; line-height: 1.4; }
.beats img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border: 2px solid var(--ink); border-radius: 10px 4px 12px 6px / 6px 12px 4px 10px; margin-bottom: 8px; }
.beats strong { font-size: 19px; }
.beats span { color: var(--ink-soft); }

.mascot-grid { list-style: none; padding: 0; margin: 30px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.mascot-grid li { display: flex; flex-direction: column; gap: 4px; font-size: 15.5px; line-height: 1.4; }
.mascot-grid video { width: 100%; aspect-ratio: 1; object-fit: cover; border: 2px solid var(--ink); border-radius: var(--hand-radius); margin-bottom: 8px; background: var(--wash); }
.mascot-grid strong { font-size: 19px; }
.mascot-grid span { color: var(--ink-soft); }
.mascot-grid .mascot-cta { justify-content: center; padding: 22px; border: 2px dashed var(--pen); border-radius: var(--hand-radius); background: var(--wash); }
.mascot-cta a { margin-top: 10px; font-weight: 700; }

/* ---------- portal section: Remotion Effects Library ---------- */
.frame.portal-frame, .frame.portal-frame.is-framed { cursor: pointer; }
.portal-cols { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.portal-kicker { font: 500 18px/1.2 var(--hand); color: var(--pen); margin-bottom: 14px; }
.portal-frame h2 { font-size: 64px; max-width: 12ch; }
.portal-stats { list-style: none; padding: 0; margin: 26px 0 6px; display: flex; gap: 34px; }
.portal-stats li { display: flex; flex-direction: column; }
.portal-stats strong { font-size: 44px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.portal-stats span { font: 500 16px/1.3 var(--hand); color: var(--ink-soft); margin-top: 6px; }
.portal-door { position: relative; aspect-ratio: 16 / 9; }
.portal-door video { display: block; width: 100%; height: 100%; object-fit: cover; background: #0c0d0f; border: 2px solid var(--ink); border-radius: var(--hand-radius); transition: transform .3s; }
.portal-frame:hover .portal-door video { transform: rotate(-.6deg) scale(1.01); }
.portal-hint {
  position: absolute; right: 64px; bottom: 26px; margin: 0;
  font: 500 22px/1.2 var(--hand); color: var(--pen); transform: rotate(-2deg);
}
.portal-frame:hover .portal-hint { animation: portal-jitter .5s steps(2) infinite; }
@keyframes portal-jitter { 50% { transform: rotate(-1deg) translate(2px, -1px); text-shadow: -2px 0 var(--yellow), 2px 0 var(--red); } }

/* first-visit note on phones: this is a board you can move */
.board-hint {
  position: fixed; z-index: 30; left: 14px; right: 14px; bottom: calc(76px + env(safe-area-inset-bottom));
  display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; align-items: center;
  padding: 14px 16px; background: var(--paper); color: var(--ink);
  border: 2px solid var(--ink); border-radius: var(--hand-radius);
  box-shadow: 4px 5px 0 var(--pen);
  opacity: 0; transform: translateY(14px) rotate(-1deg); transition: opacity .35s, transform .45s cubic-bezier(.3,1.5,.5,1);
}
.board-hint.in { opacity: 1; transform: rotate(-1deg); }
.board-hint p { margin: 0; font: 500 15px/1.35 var(--hand); }
.board-hint strong { font-family: var(--sans); font-weight: 800; display: block; font-size: 16px; margin-bottom: 2px; }
.board-hint .hint-ok { grid-column: 2; justify-self: end; font: 700 15px/1 var(--sans); padding: 9px 16px; border: 2px solid var(--ink); border-radius: var(--hand-radius); background: linear-gradient(100deg, var(--red), var(--orange) 70%, var(--yellow)); color: var(--on-bright); cursor: pointer; }
.board-hint .pinch { width: 54px; height: 40px; }
.board-hint .pinch circle { fill: var(--pen); }
.board-hint .pinch path { fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.board-hint .f1, .board-hint .a1 { animation: pinch-l 1.6s ease-in-out infinite; }
.board-hint .f2, .board-hint .a2 { animation: pinch-r 1.6s ease-in-out infinite; }
@keyframes pinch-l { 0%, 15% { transform: translateX(6px); } 55%, 70% { transform: translateX(-4px); } 100% { transform: translateX(6px); } }
@keyframes pinch-r { 0%, 15% { transform: translateX(-6px); } 55%, 70% { transform: translateX(4px); } 100% { transform: translateX(-6px); } }
#zoom-fit.nudge { animation: nudge 1.4s ease-in-out 3; background: var(--wash); }
@keyframes nudge { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--pen) 35%, transparent); } }

/* the vortex overlay and what it hides while it runs */
.portal-fx { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 100; pointer-events: none; opacity: 0; }
.portal-on .portal-fx { pointer-events: auto; }
.portal-on, .portal-on body { cursor: progress; }

/* ---------- zoomable cards ---------- */
.frame:not(.is-framed) { cursor: zoom-in; }
.card, .process li, .stickies li, .beats li, .mascot-grid li:not(.mascot-cta) { cursor: zoom-in; transition: box-shadow .3s; }
.card:hover, .process li:hover { box-shadow: 0 0 0 4px var(--wash); }
.card.is-zoomed, .process li.is-zoomed, .stickies li.is-zoomed, .beats li.is-zoomed, .mascot-grid li.is-zoomed { cursor: zoom-out; box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--pen); }

/* ---------- misregistered print headings ---------- */
.vw { position: relative; display: inline-block; }
.vk { position: relative; }
.vfx > span {
  position: absolute; left: 0; top: 0; white-space: nowrap; opacity: 0;
  pointer-events: none; user-select: none;
}
.vp { mix-blend-mode: var(--print-blend); }
.vp:nth-child(1) { color: var(--red); }
.vp:nth-child(2) { color: var(--orange); }
.vp:nth-child(3) { color: var(--yellow); }
.vm {
  -webkit-mask-image: repeating-linear-gradient(to bottom, #000 0 var(--band, .07em), transparent var(--band, .07em) calc(var(--band, .07em) * 2));
          mask-image: repeating-linear-gradient(to bottom, #000 0 var(--band, .07em), transparent var(--band, .07em) calc(var(--band, .07em) * 2));
}
.vs { -webkit-text-stroke: .02em var(--ink); }


/* ---------- no JavaScript: the board unrolls into a single column ---------- */
@media (scripting: none) {
  .hud { display: none; }
  body { overflow: auto; font-size: 17px; }
  .board { position: static; overflow: visible; touch-action: auto; cursor: auto; user-select: text; min-height: 100%; }
  .world { position: static; transform: none !important; padding: 30px 14px 80px; }
  .arrows, .arrow-labels { display: none; }
  .frame { position: relative; left: auto; top: auto; width: auto; padding: 30px 22px 34px; margin-top: 34px; }
  .frame::before, .frame::after { display: none; }
  .frame-title { position: static; margin-bottom: 10px; }
  .scribble { position: static; white-space: normal; }
}

/* ---------- phones: still the whiteboard, with phone-sized frames (see canvas.js) ---------- */
@media (max-width: 760px), (pointer: coarse) and (max-height: 540px) {
  body { font-size: 17px; -webkit-tap-highlight-color: transparent; }
  .board { cursor: auto; }
  .frame { padding: 26px 22px 30px; }
  .frame-title { font-size: 15px; }
  .hero { font-size: 44px; margin: 18px 0 22px; }
  .small-hero { font-size: 38px; }
  h2 { font-size: 31px; margin-bottom: 18px; max-width: none; }
  h3 { font-size: 22px; margin-top: 28px; }
  p { max-width: none; }
  .lede, .home-copy p { font-size: 18px; }
  .home-top { flex-direction: column; gap: 6px; }
  .cards.two, .stickies, .process, .case-cols, .portal-cols { grid-template-columns: 1fr; }
  .cards.two { gap: 22px; }
  .case-cols { gap: 0; }
  .beats, .beats.three, .mascot-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .beats li, .mascot-grid li { font-size: 14.5px; }
  .beats strong, .mascot-grid strong { font-size: 16px; }
  .stickies { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stickies li { min-height: 0; font-size: 15px; padding: 14px 12px 18px; }
  .process { gap: 26px; }
  .process li, .loop li { padding: 14px 16px; }
  .process strong { font-size: 18px; }
  .process li + li::before { left: 28px; top: -24px; width: 2px; height: 20px; }
  .process li + li::after { left: 23px; top: -12px; transform: rotate(135deg); }
  .loop { grid-template-columns: 1fr; gap: 24px; }
  .loop li + li::before { left: 26px; top: -22px; width: 2px; height: 18px; }
  .loop li + li::after { left: 21px; top: -11px; transform: rotate(135deg); }
  .card { padding: 22px; }
  .card p { font-size: 16px; }
  .card-media { width: calc(100% + 44px); margin: -22px -22px 18px; }
  .colophon { grid-template-columns: 1fr; }
  .cta { padding: 13px 20px; font-size: 17px; }
  /* margin notes sit inside the frame instead of floating off a narrow one */
  .scribbles { margin-top: 26px; display: grid; gap: 14px; }
  .scribble { position: static; white-space: normal; font-size: 20px; justify-self: start; max-width: 100%; }

  /* facts: a compact two-up grid */
  .facts { grid-template-columns: 1fr 1fr; }
  .facts div { padding: 12px 16px; }
  .facts div + div { border-left: 0; }
  .facts div:nth-child(2) { border-left: 1.5px solid var(--line); }
  .facts div:nth-child(3) { grid-column: 1 / -1; border-top: 1.5px solid var(--line); }
  .facts dt { font-size: 14px; }
  .facts dd { font-size: 16px; line-height: 1.3; }
  .film { margin-top: 24px; }

  /* sections become rows of tiles on the board (built by canvas.js) */
  .frame.strip { display: flex; align-items: flex-start; width: max-content !important; padding: 0; border: 0; background: none; }
  .frame.strip::before { inset: -14px; }
  .frame.strip::after { inset: -19px; }
  .tile {
    flex: none; width: 340px; padding: 22px 20px 24px;
    background: var(--paper); border: 1.5px solid var(--line); border-radius: 4px;
    box-shadow: 0 1px 0 var(--line);
  }
  .tile.bare { padding: 0; border: 0; background: none; box-shadow: none; }
  .tile > :first-child, .tile > section > :first-child { margin-top: 0; }
  .tile > :last-child { margin-bottom: 0; }
  .tile h2 { font-size: 30px; }
  .tile .hero { font-size: 40px; margin: 16px 0 0; }
  .tile .home-copy p:first-child { margin-top: 0; }
  .tile .ctas { margin-top: 20px; }
  .tile .film { margin-top: 0; }
  .tile .facts { margin-bottom: 0; }
  .tile .beats, .tile .mascot-grid, .tile .stickies, .tile .process, .tile .loop { margin-top: 14px; margin-bottom: 0; }
  .tile.faq details:first-child { padding-top: 0; }
  .tile.faq details:last-child { border-bottom: 0; }
  .tile .scribbles { margin-top: 0; }
  /* the hand-drawn arrow between tiles: tap it to slide on */
  .tile-step {
    flex: none; width: 64px; height: 48px; margin-top: 46px; padding: 0 4px;
    background: none; border: 0; color: var(--pen); cursor: pointer;
  }
  .tile-step svg { width: 100%; height: 100%; }
  .case-more { display: none; }

  /* portal section */
  .portal-frame h2 { font-size: 34px; }
  .portal-door { margin: 4px 0 0; }
  .portal-stats { gap: 22px; flex-wrap: wrap; }
  .portal-stats strong { font-size: 32px; }
  .portal-hint { position: static; margin-top: 18px; font-size: 19px; }

  /* HUD: a slim pill up top (section name, menu, theme), a compact zoom bar below */
  .hud-top { left: 10px; right: 10px; top: calc(8px + env(safe-area-inset-top)); padding: 4px 4px 4px 10px; align-items: center; }
  .pages { flex: 1; min-width: 0; }
  #pages-btn { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 4px; font-weight: 700; }
  #pages-btn:hover { background: none; }
  #pages-btn .caret { display: none; }
  #pages-btn .mark, #pages-btn .menu-icon { display: block; }
  #pages-btn .mark { width: 22px; height: 25px; transform: scale(.7); transform-origin: left center; margin-right: -4px; }
  #pages-btn .now { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #pages-btn .menu-icon { margin-left: auto; width: 20px; height: 12px; position: relative; flex: none; }
  #pages-btn .menu-icon::before, #pages-btn .menu-icon::after { content: ""; position: absolute; left: 0; right: 0; height: 2px; border-radius: 2px; background: currentColor; transition: transform .3s; }
  #pages-btn .menu-icon::before { top: 1px; }
  #pages-btn .menu-icon::after { bottom: 1px; }
  #pages-btn[aria-expanded="true"] .menu-icon::before { transform: translateY(4px) rotate(45deg); }
  #pages-btn[aria-expanded="true"] .menu-icon::after { transform: translateY(-4px) rotate(-45deg); }
  .theme-btn { width: 42px; height: 42px; flex: none; }
  .pages-list { left: -10px; right: -52px; min-width: 0; max-height: min(70vh, 560px); overflow-y: auto; overscroll-behavior: contain; }
  .pages-list button { font-size: 18px; padding: 13px 12px; }
  .hud-bottom { bottom: calc(12px + env(safe-area-inset-bottom)); gap: 2px; padding: 4px; }
  .hud-bottom .hud-btn { font-size: 14px; padding: 10px 10px; }
  .hud-bottom .hud-btn.icon { width: 40px; font-size: 19px; }
  .zoom-read { min-width: 52px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  .cta, .frame::before, .frame::after, .card, .faq summary::after, .arrow-label, .arrow path { transition: none; }
  .portal-frame:hover .portal-hint { animation: none; }
  .board-hint .pinch *, #zoom-fit.nudge { animation: none; }
  .cta:hover { transform: none; }
}
