/* ==========================================================================
   BONDEE — CHROME: nav, index rail, cursor, footer
   ========================================================================== */

/* --------------------------------------------------------------------------
   NAV
   -------------------------------------------------------------------------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 8000;
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.5rem);
  padding: 1.25rem var(--margin);
  color: var(--fg);
  mix-blend-mode: normal;
}

.nav::before {
  content: "";
  position: absolute; inset: 0;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 62%, transparent);
  opacity: 0;
  transition: opacity var(--d-ui) var(--e-soft);
  z-index: -1;
}
.nav[data-pinned="true"]::before { opacity: 1; }

/* ==========================================================================
   WORDMARK — Turn 4 direction
   "bond" roman + "ee" italic in Bodoni Moda. Bodoni's hairlines thin optically
   as the size drops, and thin further on ink than on washi, so weight climbs a
   step earlier here and tracking opens as it goes. The ladder below is the
   direction's on-ink ladder, not a guess.
   ========================================================================== */
.wm {
  display: inline-flex;
  align-items: baseline;
  font-family: var(--f-wordmark);
  font-optical-sizing: auto;
  line-height: 1;
  text-transform: lowercase;
  white-space: nowrap;
}
.wm__roman  { font-weight: 500; letter-spacing: 0.005em; }
.wm__italic { font-style: italic; font-weight: 500; }

/* 19px — nav */
.wm { font-size: 19px; }

/* 30px — mid */
.wm--30 { font-size: 30px; }
.wm--30 .wm__roman  { font-weight: 500; letter-spacing: -0.005em; }
.wm--30 .wm__italic { font-weight: 500; }

/* 52px — large */
.wm--52 { font-size: clamp(2.25rem, 5vw, 3.25rem); }
.wm--52 .wm__roman  { font-weight: 400; letter-spacing: -0.015em; }
.wm--52 .wm__italic { font-weight: 400; }

/* Accent variant: vermilion carries the italic, the same move the display type
   makes on accented words. Below ~40px it needs the heavier weight or the
   hairlines wash the colour out. */
.wm--accent .wm__italic { color: var(--signal); }
.wm--accent:not(.wm--52) .wm__roman,
.wm--accent:not(.wm--52) .wm__italic { font-weight: 500; }

/* Clearspace is the x-height of the b on all four sides. */
.nav__mark { display: inline-flex; padding: 0.32em 0; }

/* Signature lockup: wordmark, hairline at the wordmark's width, mono
   descriptor. The mono keeps the engineering register Bodoni alone would lose.
   The negative right margin cancels the trailing letter-space so the rule and
   the descriptor end flush. */
.lockup { display: inline-flex; flex-direction: column; align-items: stretch; gap: 0.5625rem; }
.lockup__rule { height: 1px; background: var(--rule); }
.lockup__desc {
  font-family: var(--f-label);
  font-weight: 300;
  font-size: 0.5625rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-right: -0.2em;
}

/* Seal — the monogram as an avatar. Bodoni b, vermilion ground. */
.seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--signal);
  color: var(--c-ink-fg);
  font-family: var(--f-wordmark);
  font-size: 26px;
  font-weight: 500;
  line-height: 1;
  flex: none;
}

.nav__links {
  display: none;
  gap: 1.75rem;
  margin-left: clamp(1rem, 4vw, 3.5rem);
}
@media (min-width: 900px) { .nav__links { display: flex; } }

.nav__end { margin-left: auto; display: flex; align-items: center; gap: 1rem; }

/* --- the roll -------------------------------------------------------------
   Trionn duplicates the label and clips a vertical roll. Ours swaps voice as
   well as position: the grotesk rolls out, the mono machine label rolls in.
   Heights are in rem so the two children stay aligned despite different
   font-sizes. ------------------------------------------------------------- */
.roll {
  --roll-h: 1.15rem;
  display: inline-block;
  height: var(--roll-h);
  overflow: hidden;
  vertical-align: bottom;
}
.roll__inner {
  display: block;
  transition: translate 0.42s var(--e-soft);
}
.roll:hover .roll__inner,
.roll:focus-visible .roll__inner { translate: 0 calc(var(--roll-h) * -1); }

.roll__a,
.roll__b {
  display: block;
  height: var(--roll-h);
  line-height: var(--roll-h);
}
.roll__a {
  font-family: var(--f-display);
  font-size: 0.9375rem;
  letter-spacing: -0.03em;
  text-transform: lowercase;
}
.roll__b {
  font-family: var(--f-label);
  font-weight: 300;
  font-size: var(--t-micro);
  letter-spacing: var(--t-micro-ls);
  text-transform: uppercase;
  color: var(--signal);
}

/* --- READ AS switch ------------------------------------------------------ */
.mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-family: var(--f-label);
  font-size: var(--t-micro);
  letter-spacing: var(--t-micro-ls);
  text-transform: uppercase;
  color: var(--fg-muted);
  transition: border-color var(--d-micro) var(--e-soft);
}
.mode-switch:hover { border-color: var(--signal); }
.mode-switch__legend { display: none; }
@media (min-width: 640px) { .mode-switch__legend { display: inline; } }

.mode-switch__states { display: inline-flex; align-items: center; gap: 0.5rem; }
.mode-switch__state { transition: color var(--d-micro) var(--e-soft); }
.mode-switch__state[data-active="true"] { color: var(--signal); }
.mode-switch__sep { opacity: 0.4; }

/* --------------------------------------------------------------------------
   INDEX RAIL — the crawler's ledger. Desktop only.
   -------------------------------------------------------------------------- */
.rail {
  display: none;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--rail-w);
  z-index: 7500;
  padding: 6.5rem 0 1.5rem;
  border-right: 1px solid var(--rule);
  color: var(--fg-muted);
  pointer-events: none;
}
@media (min-width: 1280px) { .rail { display: flex; flex-direction: column; align-items: center; } }

.rail__num {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 1.5rem;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--signal);
}

.rail__slug {
  margin-top: 1.25rem;
  writing-mode: vertical-rl;
  font-family: var(--f-label);
  font-size: var(--t-micro);
  letter-spacing: var(--t-micro-ls);
  text-transform: uppercase;
}

.rail__depth { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 0.75rem; }
.rail__track { width: 1px; height: 96px; background: var(--rule); position: relative; }
.rail__fill { position: absolute; inset: 0 0 auto 0; height: 0%; background: var(--signal); }
.rail__pct {
  font-family: var(--f-label);
  font-size: var(--t-micro);
  letter-spacing: var(--t-micro-ls);
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   CURSOR — 8px dot, magnetic, mode-aware label. Suppressed on touch.
   -------------------------------------------------------------------------- */
.cursor {
  position: fixed;
  top: 0; left: 0;
  z-index: 9500;
  pointer-events: none;
  display: none;
  align-items: center;
  justify-content: center;
  width: 8px; height: 8px;
  margin: -4px 0 0 -4px; /* centre the dot on the pointer, not below-right of it */
  border-radius: 999px;
  background: var(--signal);
  will-change: transform;
}
@media (hover: hover) and (pointer: fine) and (min-width: 900px) {
  .cursor { display: flex; }
  body:not(.no-cursor) { cursor: none; }
  body:not(.no-cursor) a,
  body:not(.no-cursor) button,
  body:not(.no-cursor) input { cursor: none; }
}
.cursor__label {
  position: absolute;
  font-family: var(--f-label);
  font-size: var(--t-micro);
  letter-spacing: var(--t-micro-ls);
  text-transform: uppercase;
  color: var(--signal);
  white-space: nowrap;
  translate: 0 1.5rem;
  opacity: 0;
  transition: opacity var(--d-micro) var(--e-soft);
}
.cursor[data-label]:not([data-label=""]) .cursor__label { opacity: 1; }

/* --------------------------------------------------------------------------
   FOOTER
   -------------------------------------------------------------------------- */
.footer { padding-block: clamp(3rem, 8vh, 6rem) 2rem; }

.footer__grid {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  grid-template-columns: 1fr;
}
@media (min-width: 768px) { .footer__grid { grid-template-columns: 2fr 1fr 1fr; } }

.footer__col h3 { margin-bottom: 1.25rem; color: var(--fg-muted); }
.footer__col li + li { margin-top: 0.625rem; }
.footer__col a { font-size: 0.9375rem; letter-spacing: -0.02em; }

/* Self-referential trust signal: the site publishes its own readability score. */
.selfscore {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
}
.selfscore__val {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 1.75rem;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--signal);
}

.footer__base {
  margin-top: clamp(3rem, 8vh, 5rem);
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  color: var(--fg-muted);
}
.footer__base > :last-child { margin-left: auto; }
