/* =============================================================================
   Weaion Labs — World G: the loom
   -----------------------------------------------------------------------------
   A sparse page held by one copper thread. No cards, no sections of prose.
   Six disciplines are beads on a warp; automation is a braid; security is a
   knot; the facts that used to take three sections live in the colophon.

   The magic is the thread: it draws itself through the hero, the rail tightens
   as you scroll, and the shuttle follows. Everything stops under reduced motion.
   ========================================================================== */

:root {
  --night: #e7e3d8;
  --bone: #1b1917;
  --muted: #5f5a51;
  --faint: #8a8376;
  --copper: #5c2a4d;
  --copper-deep: #421c37;
  --line: rgba(27, 25, 23, 0.14);
  --line-strong: rgba(27, 25, 23, 0.3);

  --nav-bg: rgba(231, 227, 216, 0.9);
  --grid: rgba(27, 25, 23, 0.045);
  --warp: rgba(27, 25, 23, 0.16);
  --echo: rgba(27, 25, 23, 0.22);
  --knot: rgba(27, 25, 23, 0.34);
  --panel: rgba(239, 235, 226, 0.72);
  --cloth-accent: rgba(92, 42, 77, 0.05);
  --vignette: rgba(231, 227, 216, 0.5);

  --font-display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Geist", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "SF Mono", monospace;

  --shell: 78rem;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --section: clamp(4rem, 8vw, 7rem);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

body {
  margin: 0;
  background: var(--night);
  color: var(--bone);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  font-weight: 300;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

::selection {
  background: var(--copper);
  color: var(--night);
}

:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 4px;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
dt,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

.shell {
  width: min(100% - var(--gutter) * 2, var(--shell));
  margin-inline: auto;
}

.skip {
  position: fixed;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.65rem 1rem;
  background: var(--copper);
  color: var(--night);
  font-weight: 500;
  transition: top 0.2s var(--ease);
}
.skip:focus {
  top: 1rem;
}

/* ---- The cloth --------------------------------------------------------- */

.cloth {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, transparent 0 39px, var(--grid) 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, var(--grid) 39px 40px),
    radial-gradient(90% 70% at 50% 0%, var(--cloth-accent), transparent 60%),
    var(--night);
}
.cloth::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 50% 0%, transparent 40%, var(--vignette) 100%);
}

main,
.nav,
.colophon {
  position: relative;
  z-index: 2;
}

/* ---- Rail -------------------------------------------------------------- */

.rail {
  position: fixed;
  left: 1rem;
  top: 50%;
  z-index: 3;
  width: 2.5rem;
  height: 32vh;
  transform: translateY(-50%);
  overflow: visible;
  pointer-events: none;
}
.rail path {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.rail__dot {
  fill: var(--copper);
}

/* ---- Type -------------------------------------------------------------- */

.kicker {
  margin-bottom: 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--copper);
}

h1,
h2 {
  font-family: var(--font-display);
  font-weight: 300;
  letter-spacing: -0.035em;
}

h1 {
  font-size: clamp(3.4rem, 7.6vw, 7.8rem);
  line-height: 0.9;
  text-wrap: balance;
}
h1 em {
  font-style: normal;
  position: relative;
  white-space: nowrap;
}
h1 em::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.02em;
  height: 2px;
  background: var(--copper);
  transform-origin: 0 50%;
  animation: underline 1.6s var(--ease) 0.6s both;
}
@keyframes underline {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

h2 {
  font-size: clamp(2.6rem, 5.2vw, 5rem);
  line-height: 0.94;
}

.section {
  padding: var(--section) 0;
}

/* ---- Nav --------------------------------------------------------------- */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.1rem var(--gutter);
  border-bottom: 1px solid transparent;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}
.nav.is-scrolled {
  background: var(--nav-bg);
  border-bottom-color: var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9375rem;
  font-weight: 400;
}
.mark__glyph {
  display: inline-flex;
  width: 1.5rem;
  height: 1.5rem;
  color: var(--copper);
}
.mark__glyph svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.nav__cta {
  padding: 0.55rem 0.95rem;
  border: 1px solid var(--copper);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--copper);
  transition: background 0.3s, color 0.3s;
}
.nav__cta:hover {
  background: var(--copper);
  color: var(--night);
}

/* ---- Hero -------------------------------------------------------------- */

.hero {
  padding: clamp(8rem, 14vh, 11rem) 0 clamp(3rem, 6vw, 5rem);
}
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
.hero__lede {
  max-width: 34rem;
  margin-top: 1.6rem;
  color: var(--muted);
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 2.1rem;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1.15rem;
  border: 1px solid transparent;
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  transition: background 0.25s, border-color 0.25s, color 0.25s;
}
.btn i { font-style: normal; }
.btn--solid {
  background: var(--copper);
  color: var(--night);
}
.btn--solid:hover { background: var(--bone); }
.btn--line {
  border-color: var(--line-strong);
  color: var(--bone);
}
.btn--line:hover {
  border-color: var(--copper);
  color: var(--copper);
}
.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.5rem;
  margin-top: 1.8rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--faint);
}

/* ---- Loom -------------------------------------------------------------- */

.loom { margin: 0; }
.loom svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.loom__frame path {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.loom__frame .loom__tick { stroke: var(--copper); }
.loom__warp path {
  fill: none;
  stroke: var(--warp);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.loom__thread {
  fill: none;
  stroke: var(--copper);
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.loom__thread--echo {
  stroke: var(--echo);
  stroke-width: 1.2;
}
.loom__shuttle rect { fill: var(--copper); }
.loom__shuttle circle { fill: var(--night); }
.loom__pins circle {
  fill: var(--night);
  stroke: var(--copper);
  stroke-width: 1;
}
.loom__marginalia text {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  fill: var(--faint);
}
.loom figcaption {
  margin-top: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--faint);
  text-align: right;
}

/* ---- Mini headings ----------------------------------------------------- */

.mini-head {
  max-width: 46rem;
  margin-bottom: clamp(1.8rem, 4vw, 2.8rem);
}
.mini-head h2 {
  margin-bottom: 0.6rem;
}
.mini-head p:last-child {
  max-width: 38rem;
  color: var(--muted);
  font-size: 0.9375rem;
}
.mini-head--wide {
  max-width: 60rem;
}

/* ---- Beads ------------------------------------------------------------- */

.beads {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border-top: 1px solid var(--copper);
}
.bead {
  position: relative;
  padding: 1.1rem 1rem 1.4rem 0;
  border-right: 1px solid var(--line);
}
.bead:last-child {
  border-right: 0;
}
.bead::before {
  content: "";
  position: absolute;
  top: -3px;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--copper);
}
.bead summary {
  position: relative;
  display: block;
  padding-right: 1.1rem;
  list-style: none;
  cursor: pointer;
}
.bead summary::-webkit-details-marker {
  display: none;
}
.bead summary::after {
  content: "+";
  position: absolute;
  top: 0;
  right: 0;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1;
  color: var(--copper);
}
.bead[open] summary::after {
  content: "\2212";
}
.bead__n {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  color: var(--faint);
}
.bead__name {
  display: block;
  margin-top: 0.4rem;
  font-family: var(--font-display);
  font-size: clamp(0.98rem, 1.25vw, 1.2rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--bone);
}
.bead__body {
  padding-top: 0.7rem;
}
.bead__body p {
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.55;
}
.bead__when {
  margin-top: 0.5rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.625rem;
  line-height: 1.55;
  color: var(--faint);
}

/* ---- Braid ------------------------------------------------------------- */

.braid {
  margin: 0;
  padding: 1.5rem 0 0.7rem;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
}
.braid svg {
  display: block;
  width: 100%;
  height: auto;
}
.braid__strands path {
  fill: none;
  stroke: rgba(233, 228, 214, 0.16);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.braid__pins circle {
  fill: var(--night);
  stroke: var(--copper);
  stroke-width: 1.2;
}
.braid__labels text {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  fill: var(--faint);
}
.braid__route {
  fill: none;
  stroke: var(--copper);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 2.2s var(--ease);
}
.braid.is-woven .braid__route {
  stroke-dashoffset: 0;
}
.braid__shuttle { fill: var(--copper); }
.braid figcaption {
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--faint);
}
.braid__legend {
  display: flex;
  flex-wrap: wrap;
  margin-top: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--muted);
}
.braid__legend li {
  display: flex;
  align-items: center;
}
.braid__legend li:not(:last-child)::after {
  content: "\2192";
  margin: 0 0.55rem;
  color: var(--copper);
}

/* ---- Knot -------------------------------------------------------------- */

.knot__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
}
.knot__intro h2 {
  margin-bottom: 1rem;
}
.knot__intro > p {
  max-width: 27rem;
  color: var(--muted);
}
.knot__note {
  margin-top: 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  line-height: 1.65;
  color: var(--faint);
}
.knot__note a {
  color: var(--copper);
  border-bottom: 1px solid rgba(201, 122, 69, 0.5);
}
.knot__body {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
  gap: 2rem;
  align-items: start;
}
.knot__figure { margin: 0; }
.knot__figure svg {
  display: block;
  width: 100%;
  max-width: 24rem;
  height: auto;
}
.knot__figure .knot__line {
  fill: none;
  stroke: var(--knot);
  stroke-width: 1.2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.knot__core { fill: var(--copper); }
.knot__figure figcaption {
  max-width: 14rem;
  margin-top: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  line-height: 1.55;
  color: var(--faint);
}
.findings {
  border-top: 1px solid var(--line-strong);
}
.finding {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  gap: 1rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
}
.finding__ref {
  padding-top: 0.2rem;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  color: var(--copper);
}
.finding h3 {
  margin-bottom: 0.25rem;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 1.35rem;
  line-height: 1.1;
}
.finding > div > p {
  color: var(--muted);
  font-size: 0.875rem;
}
.finding__meta {
  margin-top: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  line-height: 1.7;
  color: var(--faint);
}
.finding__meta span {
  color: var(--copper);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ---- Contact ----------------------------------------------------------- */

.contact {
  padding-bottom: clamp(4rem, 8vw, 7rem);
}
.contact__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: end;
  padding-top: clamp(2rem, 5vw, 4rem);
  border-top: 1px solid var(--line-strong);
}
.contact h2 {
  font-size: clamp(2.8rem, 6.6vw, 6.4rem);
  line-height: 0.91;
}
.contact__lede {
  max-width: 32rem;
  margin-top: 1.1rem;
  color: var(--muted);
}
.contact__ways {
  display: grid;
  gap: 0.8rem;
}
.contact__mail {
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  padding-bottom: 0.1rem;
  border-bottom: 1px solid var(--copper);
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 2.4rem);
  letter-spacing: -0.03em;
  color: var(--copper);
  overflow-wrap: anywhere;
}
.way__value {
  color: var(--bone);
}
.way__value a {
  border-bottom: 1px solid var(--line-strong);
}
.way__note {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--faint);
}

/* ---- Colophon ---------------------------------------------------------- */

.colophon {
  padding: 2.2rem 0 4.4rem;
  border-top: 1px solid var(--line);
}
.colophon__row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem 2rem;
}
.colophon__label {
  margin-bottom: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--copper);
}
.colophon__row p:last-child {
  max-width: 23rem;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--muted);
}
.colophon__base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.4rem 2rem;
  margin-top: 1.4rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: var(--faint);
}

/* ---- Responsive -------------------------------------------------------- */

@media (max-width: 1100px) {
  .rail { display: none; }
  .hero__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
  }
  .loom {
    max-width: 34rem;
    margin-inline: auto;
  }
  .beads {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .bead {
    border-bottom: 1px solid var(--line);
  }
  .bead:nth-child(3n) {
    border-right: 0;
  }
  .bead:nth-child(n + 4) {
    border-bottom: 0;
  }
  .knot__grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .contact__grid {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }
}

@media (max-width: 700px) {
  body { font-size: 1rem; }
  .hero { padding-top: 6.5rem; }
  h1 { font-size: clamp(2.9rem, 12vw, 4.2rem); }
  h2 { font-size: clamp(2.3rem, 9vw, 3.2rem); }
  .loom { max-width: 24rem; }
  .beads {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 0;
    border-left: 1px solid var(--copper);
  }
  .bead {
    padding: 1.1rem 1rem 1.3rem 1.2rem;
    border-bottom: 1px solid var(--line);
  }
  .bead::before {
    top: 1.35rem;
    left: -3px;
  }
  .bead:nth-child(3n) {
    border-right: 1px solid var(--line);
  }
  .bead:nth-child(2n) {
    border-right: 0;
  }
  .bead:nth-child(n + 5) {
    border-bottom: 0;
  }
  .knot__body {
    grid-template-columns: minmax(0, 1fr);
  }
  .knot__figure svg { max-width: 16rem; }
  .knot__figure figcaption { max-width: 22rem; }
  .braid__labels { display: none; }
  .colophon__row {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 460px) {
  .nav {
    gap: 0.9rem;
    padding-inline: 1rem;
  }
  .nav__cta {
    padding: 0.5rem 0.7rem;
    font-size: 0.625rem;
  }
  .mark { font-size: 0.875rem; }
  .hero { padding-top: 5.8rem; }
  .btn {
    width: 100%;
    justify-content: center;
  }
  .loom { max-width: 20rem; }
  .beads {
    grid-template-columns: minmax(0, 1fr);
  }
  .bead {
    border-right: 0 !important;
    border-bottom: 1px solid var(--line);
    padding-left: 1.2rem;
  }
  .bead:last-child { border-bottom: 0; }
  .bead::before {
    top: 1.35rem;
    left: -3px;
  }
  .finding {
    grid-template-columns: 2.4rem minmax(0, 1fr);
  }
  .contact__mail { font-size: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  h1 em::after,
  .braid__route,
  .braid__shuttle {
    animation: none !important;
    transition: none !important;
  }
  .braid__route { stroke-dashoffset: 0; }
  .braid__shuttle { display: none; }
  .rail__dot { display: none; }
}

/* =============================================================================
   Themes — switch with the palette control or ?theme=sage|linen|ink
   ========================================================================== */

html[data-theme="sage"] {
  --night: #e3e5d9;
  --bone: #1a1c17;
  --muted: #5c5f52;
  --faint: #858876;
  --copper: #7a2f2a;
  --copper-deep: #5a1f1c;
  --line: rgba(26, 28, 23, 0.14);
  --line-strong: rgba(26, 28, 23, 0.3);
  --nav-bg: rgba(227, 229, 217, 0.9);
  --grid: rgba(26, 28, 23, 0.045);
  --warp: rgba(26, 28, 23, 0.16);
  --echo: rgba(26, 28, 23, 0.22);
  --knot: rgba(26, 28, 23, 0.34);
  --panel: rgba(235, 237, 227, 0.72);
  --cloth-accent: rgba(122, 47, 42, 0.05);
  --vignette: rgba(227, 229, 217, 0.5);
}

html[data-theme="linen"] {
  --night: #e7e1d4;
  --bone: #171512;
  --muted: #5c574c;
  --faint: #817a6b;
  --copper: #2f49d6;
  --copper-deep: #2238a8;
  --line: rgba(23, 21, 18, 0.14);
  --line-strong: rgba(23, 21, 18, 0.32);
  --nav-bg: rgba(231, 225, 212, 0.92);
  --grid: rgba(23, 21, 18, 0.04);
  --warp: rgba(23, 21, 18, 0.16);
  --echo: rgba(23, 21, 18, 0.22);
  --knot: rgba(23, 21, 18, 0.34);
  --panel: rgba(243, 238, 228, 0.72);
  --cloth-accent: rgba(47, 73, 214, 0.05);
  --vignette: rgba(231, 225, 212, 0.5);
}

html[data-theme="ink"] {
  --night: #080d16;
  --bone: #ece7da;
  --muted: #a6a093;
  --faint: #6e6a60;
  --copper: #d6a45f;
  --copper-deep: #a97a3d;
  --line: rgba(236, 231, 218, 0.13);
  --line-strong: rgba(236, 231, 218, 0.28);
  --nav-bg: rgba(8, 13, 22, 0.9);
  --grid: rgba(236, 231, 218, 0.028);
  --warp: rgba(236, 231, 218, 0.15);
  --echo: rgba(236, 231, 218, 0.22);
  --knot: rgba(236, 231, 218, 0.34);
  --panel: rgba(8, 13, 22, 0.7);
  --cloth-accent: rgba(214, 164, 95, 0.04);
  --vignette: rgba(5, 7, 6, 0.55);
}

/* ---- The weave: beads and shuttle ------------------------------------- */

.weave-graph {
  margin: 0;
  padding: 1.4rem 0 0.8rem;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
}
.weave-graph svg {
  display: block;
  width: 100%;
  height: auto;
}
.weave__grid path {
  fill: none;
  stroke: var(--grid);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.weave__strands path {
  fill: none;
  stroke: var(--warp);
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
}
.weave__node .weave__halo {
  fill: var(--copper);
  opacity: 0.07;
}
.weave__ring {
  fill: var(--night);
  stroke: var(--copper);
  stroke-width: 1.4;
}
.weave__dot {
  fill: var(--copper);
}
.weave__label {
  fill: var(--bone);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-anchor: middle;
}
.weave__sub {
  fill: var(--faint);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.02em;
  text-anchor: middle;
}
.weave__note {
  fill: var(--faint);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.weave__journey {
  fill: none;
  stroke: var(--copper);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 2s var(--ease);
}
.weave-graph.is-live .weave__journey {
  stroke-dashoffset: 0;
}
.weave__packet {
  fill: var(--copper);
  opacity: 0;
  transition: opacity 0.4s;
}
.weave-graph.is-live .weave__packet {
  opacity: 1;
}
.weave-graph figcaption {
  margin-top: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--faint);
}

.weave-mobile {
  display: none;
}

@media (max-width: 700px) {
  .weave-graph svg {
    display: none;
  }
  .weave-mobile {
    display: block;
    position: relative;
    padding-left: 1.4rem;
  }
  .weave-mobile::before {
    content: "";
    position: absolute;
    left: 0.42rem;
    top: 0.8rem;
    bottom: 0.8rem;
    width: 1px;
    background: var(--copper);
    opacity: 0.55;
  }
  .weave-mobile::after {
    content: "";
    position: absolute;
    left: 0.1rem;
    top: 0.8rem;
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 50%;
    background: var(--copper);
    animation: weave-down 4.5s linear infinite;
  }
  .weave-mobile ol {
    display: grid;
    gap: 0.5rem;
  }
  .weave-mobile li {
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr);
    gap: 0.25rem 0.5rem;
    align-items: start;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--line-strong);
    background: var(--panel);
  }
  .weave-mobile__n {
    padding-top: 0.15rem;
    font-family: var(--font-mono);
    font-size: 0.625rem;
    letter-spacing: 0.08em;
    color: var(--copper);
  }
  .weave-mobile b {
    display: block;
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.2;
  }
  .weave-mobile div span {
    display: block;
    margin-top: 0.15rem;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    color: var(--faint);
  }
  .weave-mobile__note {
    margin-top: 0.7rem;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    color: var(--faint);
  }
  @keyframes weave-down {
    0% { top: 0.8rem; opacity: 0; }
    8% { opacity: 1; }
    92% { opacity: 1; }
    100% { top: calc(100% - 1rem); opacity: 0; }
  }
}

@media (prefers-reduced-motion: reduce) {
  .weave__packet {
    display: none;
  }
  .weave__journey {
    stroke-dashoffset: 0;
  }
  .weave-mobile::after {
    display: none;
  }
}

/* ---- Palette control --------------------------------------------------- */

.palette {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 30px -20px rgba(0, 0, 0, 0.5);
}
.palette__label {
  padding-inline: 0.25rem;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}
.palette__btn {
  width: 16px;
  height: 16px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sw-a) 0 50%, var(--sw-b) 50% 100%);
  cursor: pointer;
  transition: transform 0.2s var(--ease);
}
.palette__btn:hover {
  transform: scale(1.12);
}
.palette__btn[aria-pressed="true"] {
  outline: 2px solid var(--copper);
  outline-offset: 2px;
}
@media (max-width: 520px) {
  .palette {
    right: 0.75rem;
    bottom: 0.75rem;
  }
  .palette__label {
    display: none;
  }
}

.colophon__base a {
  color: var(--bone);
  border-bottom: 1px solid var(--line-strong);
}
