/* ==========================================================================
   Components: chrome, buttons, glyphs, stickers, cursors, mockups, footer
   ========================================================================== */

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 120;
  height: var(--header-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding-inline: var(--gutter);
  color: var(--text);
  --logo-fg: currentColor;
  --logo-x: var(--primary);
  transition: transform 0.55s var(--ease-out), color 0.35s ease;
}
.site-header.is-hidden { transform: translateY(-110%); }
.site-header[data-tone="light"],
.site-header[data-tone="lavender"],
.site-header[data-tone="accent"] { color: var(--ink); }
body.menu-open .site-header { color: var(--text); transform: none; }

.brand { display: inline-flex; align-items: center; justify-self: start; }
.brand__logo { height: 26px; width: calc(26px * 3.79); }

.chapter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  height: 32px;
  padding: 0 0.9rem 0 0.4rem;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: var(--text);
  font-family: var(--f-display);
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--line);
}
.chapter-pill__num {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}
.chapter-pill__name { display: inline-block; }
body.menu-open .chapter-pill { opacity: 0; }

.site-header__actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  height: 44px;
  padding: 0 0.6rem 0 1.1rem;
  border-radius: var(--r-pill);
  border: 1px solid currentColor;
  font-family: var(--f-display);
  font-weight: 500;
  font-size: var(--fs-s);
  letter-spacing: 0;
  transition: background 0.3s, color 0.3s;
}
.menu-btn__icon {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: currentColor;
}
.menu-btn__icon i {
  position: absolute;
  left: 8px;
  width: 12px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.4s var(--ease-out);
}
.site-header[data-tone="light"] .menu-btn__icon i,
.site-header[data-tone="lavender"] .menu-btn__icon i { background: var(--paper); }
body.menu-open .menu-btn__icon i { background: var(--ink); }
.menu-btn__icon i:first-child { top: 11px; }
.menu-btn__icon i:last-child { top: 15px; }
.menu-btn[aria-expanded="true"] .menu-btn__icon i:first-child { transform: translateY(2px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .menu-btn__icon i:last-child { transform: translateY(-2px) rotate(-45deg); }

@media (max-width: 860px) {
  .site-header { grid-template-columns: 1fr auto; }
  .chapter-pill, .site-header__cta { display: none !important; }
  .brand__logo { height: 22px; width: calc(22px * 3.79); }
}

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--accent);
  --btn-fg: var(--accent-ink);
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 52px;
  padding: 0.4rem 0.45rem 0.4rem 1.4rem;
  border-radius: var(--r-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: -0.01em;
  line-height: 1.1;
  isolation: isolate;
  overflow: hidden;
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s;
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--btn-hover, var(--ink));
  transform: translateY(101%);
  transition: transform 0.5s var(--ease-out);
}
.btn:hover::before { transform: none; }
.btn:hover { color: var(--btn-hover-fg, var(--text)); }
.btn__arrow {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--btn-fg);
  color: var(--btn-bg);
  font-size: 1.05rem;
  transition: transform 0.5s var(--ease-out), background 0.3s, color 0.3s;
}
.btn:hover .btn__arrow { transform: rotate(45deg); background: var(--accent); color: var(--accent-ink); }
.btn--sm { min-height: 44px; font-size: var(--fs-s); padding-left: 1.1rem; }
.btn--sm .btn__arrow { width: 32px; height: 32px; font-size: 0.9rem; }
.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: currentColor;
  box-shadow: inset 0 0 0 1.5px currentColor;
}
.btn--ghost .btn__arrow { background: var(--text); color: var(--ink); }
.btn--ghost:hover { color: var(--text); }
[data-surface="light"] .btn--ghost .btn__arrow,
[data-surface="lavender"] .btn--ghost .btn__arrow { background: var(--ink); color: var(--paper); }
.btn--ink { --btn-bg: var(--ink); --btn-fg: var(--text); --btn-hover: var(--accent); --btn-hover-fg: var(--ink); }
.btn--ink .btn__arrow { background: var(--accent); color: var(--accent-ink); }
.btn--ink:hover .btn__arrow { background: var(--ink); color: var(--accent); }
.btn--paper { --btn-bg: var(--paper); --btn-fg: var(--ink); }
.btn--paper .btn__arrow { background: var(--ink); color: var(--paper); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--f-display);
  font-weight: 500;
  padding-bottom: 0.2rem;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1.5px no-repeat;
  transition: background-size 0.5s var(--ease-out);
}
.link-arrow:hover { background-size: 0% 1.5px; background-position: 100% 100%; }
.link-arrow span[aria-hidden] { transition: transform 0.4s var(--ease-out); }
.link-arrow:hover span[aria-hidden] { transform: translate(3px, -3px); }

.cta-row { display: flex; flex-wrap: wrap; gap: 0.8rem 1rem; align-items: center; }

/* ---------- Inline glyph pills & squiggles (inside headlines) ---------- */
.glyph {
  display: inline-grid;
  place-items: center;
  width: 0.86em;
  height: 0.86em;
  margin-inline: 0.06em;
  border-radius: 50%;
  vertical-align: -0.06em;
  background: var(--g-bg, var(--accent));
  color: var(--g-fg, var(--ink));
}
.glyph svg { width: 52%; height: 52%; }
.glyph--spark { --g-bg: var(--spark); }
.glyph--soft { --g-bg: var(--soft); }
.glyph--primary { --g-bg: var(--primary); --g-fg: var(--on-primary); }
.glyph--ink { --g-bg: var(--ink); --g-fg: var(--soft); }
.glyph--paper { --g-bg: var(--paper); --g-fg: var(--ink); }
.glyph--outline { --g-bg: transparent; --g-fg: currentColor; box-shadow: inset 0 0 0 0.05em currentColor; }
.glyph--wide { width: 1.6em; border-radius: var(--r-pill); }
.glyph--spin svg { animation: pk-spin 9s linear infinite; }
@keyframes pk-spin { to { transform: rotate(360deg); } }

.glyph-stack {
  display: inline-flex;
  align-items: center;
  height: 0.86em;
  padding: 0.06em 0.12em;
  margin-inline: 0.08em;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.55);
  vertical-align: -0.06em;
  gap: 0;
}
.glyph-stack .glyph { width: 0.72em; height: 0.72em; margin: 0 -0.08em; box-shadow: 0 0 0 0.04em var(--lav); }

.squiggle {
  display: inline-block;
  width: 1.5em;
  height: 0.6em;
  vertical-align: 0.06em;
  overflow: visible;
}
.squiggle path {
  fill: none;
  stroke: currentColor;
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.squiggle--accent { color: var(--accent); }
.squiggle--muted { color: color-mix(in srgb, var(--text) 35%, transparent); }
[data-surface="light"] .squiggle--muted,
[data-surface="lavender"] .squiggle--muted { color: color-mix(in srgb, var(--ink) 30%, transparent); }

/* ---------- Pill labels (under mockups) ---------- */
.label-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: min(100%, 22rem);
  padding: 1.1rem 2.4rem;
  border-radius: var(--r-pill);
  background: #fff;
  color: var(--ink);
  font-family: var(--f-display);
  font-weight: 500;
  font-size: clamp(0.95rem, 1.4vw, 1.25rem);
  letter-spacing: -0.01em;
  text-align: center;
  box-shadow: 0 10px 30px color-mix(in srgb, var(--ink) 6%, transparent);
}

/* ---------- Stickers (draggable phrases) ---------- */
.sticker {
  position: absolute;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  background: var(--s-bg, var(--soft));
  color: var(--ink);
  font-family: var(--f-display);
  font-weight: 500;
  font-size: clamp(0.8rem, 1vw, 0.95rem);
  white-space: nowrap;
  transform: rotate(var(--rot, -6deg));
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.45);
  touch-action: none;
  user-select: none;
}
.sticker svg { width: 1em; height: 1em; }
.sticker[data-drag] { cursor: grab; }
.sticker.is-dragging { cursor: grabbing; }
.sticker--primary { --s-bg: var(--primary); color: var(--on-primary); }
.sticker--spark { --s-bg: var(--spark); }
.sticker--pink { --s-bg: var(--note-pink); }
.sticker--blue { --s-bg: var(--note-blue); }
.sticker--paper { --s-bg: var(--paper); }
@media (max-width: 760px) { .sticker { display: none; } }

/* ---------- Multiplayer cursors ---------- */
.mp-layer { position: absolute; inset: 0; z-index: 4; pointer-events: none; overflow: hidden; }
.mp-cursor {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: flex-start;
  will-change: transform;
}
.mp-cursor svg { width: 22px; height: 22px; fill: var(--c, var(--primary)); stroke: #fff; stroke-width: 1.2; }
.mp-cursor span {
  margin: 18px 0 0 -4px;
  padding: 0.25rem 0.65rem;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--c, var(--primary)) 35%, white);
  color: var(--ink);
  font-family: var(--f-display);
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 0 0 1.5px var(--c, var(--primary));
}
.mp-cursor--you { opacity: 0; transition: opacity 0.25s; }
.mp-cursor--you.is-on { opacity: 1; }
@media (hover: none) { .mp-cursor--you { display: none; } }

/* ---------- Sticky notes ---------- */
.note {
  position: relative;
  padding: 1.6rem 1.5rem 1.8rem;
  width: min(100%, 20rem);
  min-height: 15rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
  background: var(--n-bg, var(--note-yellow));
  color: var(--ink);
  border-radius: 4px 4px 22px 4px;
  transform: rotate(var(--rot, -3deg));
  box-shadow: 0 28px 40px -24px rgba(0, 0, 0, 0.6), 0 2px 0 rgba(0, 0, 0, 0.05);
  touch-action: none;
}
.note::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  width: 70px;
  height: 22px;
  transform: translateX(-50%) rotate(-2deg);
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(2px);
}
.note__q { font-family: var(--f-display); font-weight: 600; font-size: clamp(1.35rem, 2.1vw, 1.85rem); line-height: 1.14; letter-spacing: var(--track-snug); }
.note__meta { display: flex; align-items: center; gap: 0.6rem; font-size: var(--fs-s); font-weight: 500; }
.note__meta .glyph { font-size: 1.6rem; }
.note--pink { --n-bg: var(--note-pink); }
.note--blue { --n-bg: var(--note-blue); }
.note--lime { --n-bg: var(--note-lime); }
.note--violet { --n-bg: var(--lav-2); }
.note[data-drag] { cursor: grab; }

/* ---------- Marquee ---------- */
.marquee { overflow: hidden; white-space: nowrap; }
.marquee__track { display: inline-flex; align-items: center; gap: 0.5em; will-change: transform; }
.marquee__track > * { flex: none; }
.marquee__item { display: inline-flex; align-items: center; gap: 0.5em; }

.ticker {
  border-block: 1px solid var(--line);
  padding-block: 0.9rem;
  font-family: var(--f-display);
  font-size: 1.05rem;
  letter-spacing: 0;
}
[data-surface="light"] .ticker, [data-surface="lavender"] .ticker { border-color: var(--line-ink); }
.ticker .marquee__item { gap: 1.4em; padding-right: 1.4em; }
.ticker svg { width: 0.9em; height: 0.9em; color: var(--accent); }

/* ---------- Mockups (pure CSS UI, Pixknot-flavoured) ---------- */
.mock-stage { position: relative; display: grid; place-items: center; gap: 1.6rem; padding: clamp(1.5rem, 4vw, 3.5rem); }
.mock {
  position: relative;
  z-index: 2;
  background: var(--card);
  color: var(--text);
  box-shadow: 0 40px 80px -40px color-mix(in srgb, var(--ink) 65%, transparent), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  overflow: hidden;
  font-family: var(--f-display);
}
.mock-browser { width: min(100%, 680px); aspect-ratio: 16 / 10.4; border-radius: 28px; display: grid; grid-template-rows: auto 1fr; }
.mock-browser__bar { display: flex; align-items: center; gap: 0.9rem; padding: 0.9rem 1.1rem; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.mock-dots { display: flex; gap: 6px; }
.mock-dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, 0.18); }
.mock-dots i:first-child { background: var(--spark); }
.mock-url { flex: 1; max-width: 55%; margin-inline: auto; padding: 0.35rem 0.9rem; border-radius: var(--r-pill); background: rgba(255, 255, 255, 0.06); font-size: 0.7rem; color: var(--muted); text-align: center; }
.mock-browser__body { display: grid; grid-template-columns: 1.1fr 1fr; grid-template-rows: 1fr auto; gap: 0.9rem; padding: 1.2rem 1.4rem 1.3rem; }
.mock-h { font-size: clamp(1.1rem, 2.6vw, 2.3rem); font-weight: 600; letter-spacing: -0.02em; line-height: 0.95; }
.mock-h em { font-style: normal; color: var(--primary); }
.mock-copy { display: grid; gap: 6px; margin-top: 0.8rem; }
.mock-copy i { display: block; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.12); }
.mock-copy i:nth-child(2) { width: 80%; }
.mock-copy i:nth-child(3) { width: 60%; }
.mock-btn { display: inline-flex; margin-top: 0.9rem; padding: 0.45rem 0.9rem; border-radius: var(--r-pill); background: var(--primary); color: var(--on-primary); font-size: 0.7rem; font-weight: 600; }
.mock-art {
  border-radius: 18px;
  background:
    radial-gradient(circle at 70% 30%, var(--spark) 0 14%, transparent 15%),
    radial-gradient(120% 90% at 20% 100%, var(--primary), transparent 60%),
    linear-gradient(160deg, var(--ink-3), var(--ink));
  position: relative;
  overflow: hidden;
}
.mock-art::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 42%;
  background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--soft) 90%, transparent) 0 10px, transparent 10px 14px);
  clip-path: polygon(0 60%, 12% 30%, 25% 55%, 40% 10%, 55% 50%, 70% 25%, 85% 60%, 100% 35%, 100% 100%, 0 100%);
  opacity: 0.75;
}
.mock-cards { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.7rem; }
.mock-cards i { height: clamp(36px, 6vw, 56px); border-radius: 12px; background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05); }
.mock-cards i:nth-child(2) { background: color-mix(in srgb, var(--primary) 22%, transparent); }

.mock-phone { width: min(78%, 290px); aspect-ratio: 9 / 18.5; border-radius: 42px; padding: 1.1rem 1rem; display: flex; flex-direction: column; gap: 0.8rem; }
.mock-phone__top { display: flex; justify-content: space-between; align-items: center; }
.mock-phone__top svg { width: 22px; height: 22px; color: var(--primary); fill: var(--primary); }
.mock-list { display: grid; gap: 0.45rem; font-size: 0.72rem; }
.mock-list li { display: flex; align-items: center; gap: 0.5rem; padding: 0.55rem 0.7rem; border-radius: 12px; background: rgba(255, 255, 255, 0.04); color: var(--muted); }
.mock-list b { width: 12px; height: 12px; border-radius: 4px; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.3); }
.mock-list .is-done { color: var(--text); }
.mock-list .is-done b { background: var(--soft); box-shadow: none; }
.mock-phone__top b { width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, var(--spark), var(--primary)); }
.mock-phone__title { font-size: 1.6rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1; }
.mock-phone__title small { display: block; font-size: 0.62rem; font-weight: 400; letter-spacing: 0.02em; color: var(--spark); margin-bottom: 0.4rem; }
.mock-stat { display: grid; grid-template-columns: auto 1fr; gap: 0.2rem 0.7rem; align-items: end; padding: 0.8rem; border-radius: 18px; background: rgba(255, 255, 255, 0.05); }
.mock-stat strong { font-size: 1.8rem; line-height: 1; letter-spacing: -0.02em; }
.mock-stat span { font-size: 0.6rem; color: var(--muted); }
.mock-bars { grid-column: 1 / -1; display: flex; align-items: end; gap: 6px; height: 46px; margin-top: 0.4rem; }
.mock-bars i { flex: 1; border-radius: 4px; background: rgba(255, 255, 255, 0.12); height: var(--h); }
.mock-bars i:nth-child(4) { background: var(--primary); }
.mock-tabs { display: flex; gap: 4px; padding: 4px; border-radius: var(--r-pill); background: rgba(255, 255, 255, 0.05); font-size: 0.58rem; }
.mock-tabs span { flex: 1; text-align: center; padding: 0.4rem 0; border-radius: var(--r-pill); color: var(--muted); }
.mock-tabs span:first-child { background: rgba(255, 255, 255, 0.1); color: var(--text); }
.mock-task { padding: 0.75rem; border-radius: 16px; background: rgba(255, 255, 255, 0.05); display: grid; gap: 0.45rem; }
.mock-task b { font-size: 0.85rem; font-weight: 500; }
.mock-task .chips { display: flex; gap: 4px; }
.mock-task .chips i { font-style: normal; font-size: 0.5rem; padding: 0.2rem 0.45rem; border-radius: var(--r-pill); background: color-mix(in srgb, var(--primary) 30%, transparent); }
.mock-task .chips i:nth-child(2) { background: color-mix(in srgb, var(--spark) 30%, transparent); }
.mock-progress { height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.mock-progress::after { content: ""; display: block; width: 68%; height: 100%; background: var(--spark); }

.mock-game { width: min(100%, 640px); aspect-ratio: 16 / 10; border-radius: 28px; padding: 10px; background: var(--ink); }
.mock-game canvas { width: 100%; height: 100%; border-radius: 20px; image-rendering: pixelated; background: var(--ink); }
.mock-game__hud {
  position: absolute;
  inset: 20px 22px auto;
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--soft);
  pointer-events: none;
}

/* ---------- Fan of cards ---------- */
.fan {
  position: relative;
  height: clamp(340px, 46vw, 560px);
  perspective: 1400px;
}
.fan__card {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: clamp(170px, 22vw, 300px);
  aspect-ratio: 3 / 4;
  margin-left: calc(clamp(170px, 22vw, 300px) / -2);
  border-radius: 22px;
  overflow: hidden;
  transform-origin: 50% 120%;
  box-shadow: 0 40px 60px -30px color-mix(in srgb, var(--ink) 55%, transparent);
  transition: box-shadow 0.4s;
  will-change: transform;
}
.fan__card:hover { box-shadow: 0 50px 80px -30px color-mix(in srgb, var(--ink) 70%, transparent); }
.fan__art { position: absolute; inset: 0; }
.fan__label {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.8rem;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--ink) 72%, transparent);
  color: var(--text);
  backdrop-filter: blur(8px);
  font-family: var(--f-display);
  font-size: 0.78rem;
}

/* Generative card art */
.art { position: absolute; inset: 0; overflow: hidden; }
.art--web { background: radial-gradient(circle at 30% 30%, var(--primary-2), transparent 55%), linear-gradient(150deg, var(--primary), color-mix(in srgb, var(--primary) 40%, black)); }
.art--app { background: radial-gradient(circle at 70% 70%, var(--spark), transparent 50%), linear-gradient(200deg, var(--spark), color-mix(in srgb, var(--spark) 40%, black)); }
.art--game { background: radial-gradient(circle at 50% 20%, color-mix(in srgb, var(--soft) 40%, white), transparent 45%), linear-gradient(170deg, var(--soft), color-mix(in srgb, var(--soft) 35%, black)); }
.art--ink { background: radial-gradient(circle at 50% 40%, var(--ink-3), transparent 60%), var(--ink-2); }
.art--paper { background: radial-gradient(circle at 60% 30%, #fff, transparent 60%), var(--lav); }
.art::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.14) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, #000, transparent 85%);
}
.art svg.art__mark {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 46%;
  height: auto;
  transform: translate(-50%, -50%);
  color: color-mix(in srgb, var(--ink) 85%, transparent);
}

/* ---------- Chips / form ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 1.15rem;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--line);
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 0.95rem;
  transition: background 0.25s, color 0.25s, border-color 0.25s, transform 0.3s var(--ease-back);
}
.chip:hover span { border-color: var(--text); }
.chip input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); transform: rotate(-2deg); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- Knot canvas + fallback ---------- */
.knot-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: var(--knot-o, 1);
  transition: opacity 0.7s var(--ease-out);
}
.knot-canvas.is-hidden { opacity: 0; }
@media (max-width: 860px) { .knot-canvas { opacity: calc(var(--knot-o, 1) * 0.42); } .knot-canvas.is-hidden { opacity: 0; } }
.knot-fallback { display: none; color: var(--primary); }
.knot-fallback svg { width: 100%; height: 100%; fill: currentColor; }
.no-webgl .knot-fallback,
.reduced-motion .knot-fallback,
html:not(.js) .knot-fallback,
.no-motion .knot-fallback { display: block; }

/* ---------- Page wipe (pixel transition) ---------- */
.wipe {
  position: fixed;
  inset: 0;
  z-index: 180;
  display: none;
  grid-template-columns: repeat(var(--cols, 12), 1fr);
  grid-auto-rows: 1fr;
  pointer-events: none;
}
.wipe.is-on { display: grid; pointer-events: all; }
.wipe i { display: block; transform: scale(0); background: var(--deep); }
.is-wiping .wipe { display: grid; background: var(--deep); animation: wipe-failsafe 0.01s linear 3s forwards; }
.is-wiping .wipe.is-built { background: transparent; }
@keyframes wipe-failsafe { to { opacity: 0; visibility: hidden; } }

/* ---------- Menu overlay ---------- */
.site-menu {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: var(--ink);
  color: var(--text);
  clip-path: circle(0% at calc(100% - 60px) 38px);
  transition: clip-path 0.8s var(--ease-io);
  overflow-y: auto;
}
.site-menu.is-open { clip-path: circle(150% at calc(100% - 60px) 38px); }
.site-menu__inner {
  min-height: 100%;
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 3rem;
  align-items: end;
  padding-top: calc(var(--header-h) + 3rem);
  padding-bottom: 3rem;
}
.site-menu__list { counter-reset: m; }
.site-menu__list a {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding-block: 0.15rem;
  font-family: var(--f-display);
  font-weight: 600;
  font-size: clamp(2.6rem, 7.6vw, 7.4rem);
  line-height: 1.06;
  letter-spacing: var(--track-tight);
  transition: color 0.3s, transform 0.5s var(--ease-out);
}
.site-menu__list a .num { font-size: 0.9rem; font-weight: 500; letter-spacing: 0.1em; color: var(--muted); transform: translateY(-2.2em); }
.site-menu__list a:hover { color: var(--primary); transform: translateX(0.3em); }
.site-menu__list a[aria-current="page"] .label { text-decoration: underline; text-decoration-thickness: 0.06em; text-underline-offset: 0.12em; }
.site-menu__list li {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.5s, transform 0.7s var(--ease-out);
}
.site-menu.is-open .site-menu__list li { opacity: 1; transform: none; }
.site-menu.is-open .site-menu__list li:nth-child(1) { transition-delay: 0.18s; }
.site-menu.is-open .site-menu__list li:nth-child(2) { transition-delay: 0.23s; }
.site-menu.is-open .site-menu__list li:nth-child(3) { transition-delay: 0.28s; }
.site-menu.is-open .site-menu__list li:nth-child(4) { transition-delay: 0.33s; }
.site-menu.is-open .site-menu__list li:nth-child(5) { transition-delay: 0.38s; }
.site-menu__side { display: grid; gap: 1.4rem; align-content: end; padding-bottom: 0.8rem; }
.site-menu__services { display: grid; gap: 0.4rem; }
.site-menu__services a { font-family: var(--f-display); font-size: 1.35rem; letter-spacing: -0.02em; }
.site-menu__services a:hover { color: var(--soft); }
.site-menu__tag { font-size: clamp(1.6rem, 3vw, 2.6rem); }
@media (max-width: 860px) {
  .site-menu__inner { grid-template-columns: 1fr; align-items: start; gap: 2.5rem; }
}

/* ---------- Dock (bottom pill nav) ---------- */
.dock {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 115;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--ink) 86%, transparent);
  backdrop-filter: blur(14px);
  box-shadow: 0 0 0 1px var(--line), 0 20px 40px -20px rgba(0, 0, 0, 0.6);
  transform: translateX(-50%);
  transition: transform 0.6s var(--ease-out), opacity 0.4s;
}
.dock a {
  position: relative;
  padding: 0.5rem 0.95rem;
  border-radius: var(--r-pill);
  color: var(--muted);
  font-family: var(--f-display);
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.25s, background 0.25s;
}
.dock a:hover { color: var(--text); }
.dock a[aria-current="page"] { background: var(--paper); color: var(--ink); }
.dock a.dock__cta { background: var(--accent); color: var(--accent-ink); }
.dock.is-tucked { transform: translate(-50%, 140%); opacity: 0; }
body.menu-open .dock { opacity: 0; pointer-events: none; }
@media (max-width: 860px) { .dock { display: none; } }

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  background: var(--ink);
  color: var(--text);
  padding-top: clamp(3rem, 7vw, 6rem);
  border-top: 1px solid var(--line);
  overflow: hidden;
  --logo-fg: var(--text);
  --logo-x: var(--primary);
}
.footer-marquee {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: clamp(2rem, 4.8vw, 4.4rem);
  letter-spacing: var(--track-tight);
  line-height: 1;
  padding-bottom: clamp(2.2rem, 4.5vw, 4rem);
}
.footer-marquee .marquee__item { gap: 0.35em; padding-right: 0.35em; }
.footer-marquee .glyph { font-size: 0.8em; }
.site-footer__top {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(3rem, 6vw, 6rem);
  align-items: start;
  padding-top: clamp(3rem, 6vw, 5rem);
  border-top: 1px solid var(--line);
}
.site-footer__lead { display: grid; gap: 1rem; justify-items: start; max-width: 32rem; }
.site-footer__lead .btn { margin-top: 0.4rem; }
.site-footer__tag { font-size: clamp(1.6rem, 2.4vw, 2.1rem); line-height: 1.1; letter-spacing: var(--track-snug); }
.site-footer__desc { color: var(--muted); max-width: 36ch; }
.site-footer__nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; }
.site-footer__label {
  font-family: var(--f-display);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
}
.site-footer__nav ul { list-style: none; padding: 0; margin-top: 1.1rem; display: grid; gap: 0.6rem; }
.site-footer__nav a { font-family: var(--f-display); font-size: 1.05rem; }
.site-footer a:not(.btn) { transition: color 0.25s; }
.site-footer a:not(.btn):hover { color: var(--soft); }

/* The signature: crisp full-width wordmark + live knot badge + sticker */
.site-footer__mark {
  position: relative;
  margin-top: clamp(6rem, 13vw, 12rem);
  margin-bottom: clamp(4rem, 9vw, 8rem);
}
.site-footer__wordmark { display: block; width: 100%; height: auto; aspect-ratio: 819 / 216; overflow: visible; }
/* the knot draws above the footer panel while it sits in the badge */
.knot-canvas.is-full { z-index: 2; }
.site-footer__badge {
  position: absolute;
  right: -1%;
  top: -52%;
  width: 13%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}
.site-footer__badge-x { width: 62%; height: 62%; fill: var(--primary); }
.knot-live:not(.no-webgl):not(.reduced-motion) .site-footer__badge-x { opacity: 0; }
.site-footer__sticker {
  position: absolute;
  right: -2.5%;
  bottom: -9%;
  z-index: 2;
  padding: 0.7em 1.6em 0.75em;
  border-radius: var(--r-pill);
  background: var(--primary);
  color: var(--on-primary);
  font-family: var(--f-display);
  font-weight: 600;
  font-size: clamp(0.9rem, 1.9vw, 1.7rem);
  letter-spacing: -0.01em;
  text-transform: uppercase;
  white-space: nowrap;
  transform: rotate(-5deg);
  box-shadow: 0 24px 40px -18px rgba(0, 0, 0, 0.7);
}
.site-footer__base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem 1.5rem;
  padding-block: 1.4rem 6rem;
  border-top: 1px solid var(--line);
  font-size: var(--fs-s);
  color: var(--muted);
}
@media (max-width: 860px) {
  .site-footer__top { grid-template-columns: 1fr; align-items: start; }
  .site-footer__nav { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .site-footer__base { padding-bottom: 2rem; }
  .site-footer__badge { top: -64%; width: 17%; }
  .site-footer__sticker { bottom: -34%; }
  .site-footer__mark { margin-bottom: 4rem; }
}
@media (max-width: 860px) { .knot-canvas.is-full:not(.is-hidden) { opacity: 1; } }

/* ---------- Intro (home, once per session) ---------- */
.intro {
  position: fixed;
  inset: 0;
  z-index: 170;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--text);
  animation: wipe-failsafe 0.01s linear 4s forwards;
}
.intro-seen .intro,
.reduced-motion .intro,
html:not(.js) .intro { display: none; }
.intro__words {
  display: flex;
  align-items: center;
  gap: 0.15em;
  font-size: clamp(2.6rem, 11vw, 11rem);
}
.intro__words span { display: inline-block; overflow: hidden; }
.intro__words span > b { display: inline-block; font-weight: 600; }
.intro__loop { width: 1.6em; height: 0.8em; color: var(--primary); overflow: visible; }
.intro__loop path { fill: none; stroke: currentColor; stroke-width: 9; stroke-linecap: round; }
.intro__count {
  position: absolute;
  left: var(--gutter);
  bottom: 2rem;
  font-family: var(--f-display);
  font-size: var(--fs-s);
  letter-spacing: 0.14em;
  color: var(--muted);
}

.site-footer__cookie-btn { color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 0.2em; }
.site-footer__cookie-btn:hover { color: var(--soft); }

/* ---------- Cookie consent ---------- */
.consent {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 160;
  width: min(420px, calc(100vw - 32px));
  display: grid;
  gap: 0.7rem;
  padding: 1.3rem 1.3rem 1.1rem;
  border-radius: var(--r-m);
  background: var(--ink-2);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.7);
  transform: translateY(calc(100% + 24px));
  opacity: 0;
  transition: transform 0.6s var(--ease-out), opacity 0.4s;
}
.consent.is-in { transform: none; opacity: 1; }
.consent__title { font-family: var(--f-display); font-weight: 600; font-size: 1.15rem; letter-spacing: -0.02em; }
.consent__text { font-size: 0.92rem; color: var(--muted); line-height: 1.5; }
.consent__text a, .consent-dialog__intro a { color: var(--text); text-decoration: underline; text-underline-offset: 0.2em; }
.consent__actions, .consent-dialog__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1.1rem; margin-top: 0.2rem; }
.consent__link {
  font-family: var(--f-display);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text);
  padding: 0.4rem 0;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 0.3em;
  transition: text-decoration-color 0.2s;
}
.consent__link:hover { text-decoration-color: currentColor; }
@media (max-width: 600px) {
  .consent { left: 8px; right: 8px; bottom: 8px; width: auto; }
}

.consent-dialog { position: fixed; inset: 0; z-index: 175; display: grid; place-items: center; padding: 16px; }
.consent-dialog[hidden] { display: none !important; }
.consent-dialog__scrim { position: absolute; inset: 0; background: rgba(8, 4, 18, 0.6); opacity: 0; transition: opacity 0.3s; }
.consent-dialog__panel {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100svh - 32px);
  overflow-y: auto;
  display: grid;
  gap: 1rem;
  padding: clamp(1.3rem, 3vw, 2rem);
  border-radius: var(--r-l);
  background: var(--ink-2);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.8);
  transform: translateY(20px) scale(0.98);
  opacity: 0;
  transition: transform 0.4s var(--ease-out), opacity 0.3s;
}
.consent-dialog.is-open .consent-dialog__scrim { opacity: 1; }
.consent-dialog.is-open .consent-dialog__panel { transform: none; opacity: 1; }
.consent-dialog__head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.consent-dialog__head h2 { font-family: var(--f-display); font-size: clamp(1.4rem, 3vw, 1.8rem); letter-spacing: -0.03em; line-height: 1.1; }
.consent-dialog__x { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); font-size: 1.4rem; line-height: 1; color: var(--text); }
.consent-dialog__x:hover { border-color: var(--text); }
.consent-dialog__intro { color: var(--muted); font-size: 0.95rem; }
.consent-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.consent-item { display: flex; justify-content: space-between; align-items: center; gap: 1.2rem; padding-block: 1rem; border-bottom: 1px solid var(--line); }
.consent-item__name { font-family: var(--f-display); font-weight: 600; font-size: 1.02rem; }
.consent-item__text { color: var(--muted); font-size: 0.88rem; margin-top: 0.2rem; line-height: 1.45; }
body.consent-open { overflow: hidden; }

.switch { position: relative; flex: none; display: inline-block; width: 48px; height: 28px; cursor: pointer; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: inherit; }
.switch__track { position: absolute; inset: 0; border-radius: 999px; background: var(--ink-3); border: 1px solid var(--line); transition: background 0.25s, border-color 0.25s; }
.switch__thumb { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--text); transition: transform 0.3s var(--ease-out); }
.switch input:checked + .switch__track { background: var(--primary); border-color: var(--primary); }
.switch input:checked + .switch__track .switch__thumb { transform: translateX(20px); background: var(--on-primary); }
.switch input:disabled { cursor: not-allowed; }
.switch input:disabled + .switch__track { opacity: 0.55; }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--soft); outline-offset: 3px; }
