/* Site-wide motion language (2026-09-29): spring marks, masked heading lines and the
   gait HUD. Loaded on every page before design-system.css; enabled by site-motion.js.
   Without JavaScript nothing here hides content. */
:root {
  --ed-spring: cubic-bezier(0.22, 1, 0.36, 1);
  --ed-spring: linear(
    0,
    0.009,
    0.035 2.1%,
    0.141 4.4%,
    0.723 12.9%,
    0.938 16.7%,
    1.017 20.4%,
    1.061 24.3%,
    1.052 29.8%,
    1.01 38.2%,
    0.993 47.4%,
    0.999 59.1%,
    1
  );
  /* Underdamped springs: overshoot, swing back, settle. Wobble for small marks,
     soft for blocks. */
  --ed-wobble: cubic-bezier(0.34, 1.8, 0.5, 1);
  --ed-wobble: linear(
    0,
    0.112 2.3%,
    0.386 4.5%,
    0.724 6.8%,
    1.039 9.1%,
    1.268 11.4%,
    1.384 13.6%,
    1.39 15.9%,
    1.311 18.2%,
    1.185 20.5%,
    1.05 22.7%,
    0.937 25%,
    0.866 27.3%,
    0.84 29.5%,
    0.855 31.8%,
    0.897 34.1%,
    0.951 36.4%,
    1.002 38.6%,
    1.04 40.9%,
    1.061 43.2%,
    1.063 45.5%,
    1.051 47.7%,
    1.032 50%,
    1.01 52.3%,
    0.991 54.5%,
    0.979 56.8%,
    0.975 59.1%,
    0.976 61.4%,
    0.983 63.6%,
    0.991 65.9%,
    1 68.2%,
    1.006 70.5%,
    1.01 72.7%,
    1.01 75%,
    1.008 77.3%,
    1.005 79.5%,
    1.002 81.8%,
    0.999 84.1%,
    0.997 86.4%,
    0.996 90.9%,
    0.998 95.5%,
    1
  );
  --ed-soft: cubic-bezier(0.34, 1.4, 0.6, 1);
  --ed-soft: linear(
    0,
    0.059 2.3%,
    0.206 4.5%,
    0.401 6.8%,
    0.608 9.1%,
    0.801 11.4%,
    0.963 13.6%,
    1.083 15.9%,
    1.161 18.2%,
    1.199 20.5%,
    1.204 22.7%,
    1.185 25%,
    1.151 27.3%,
    1.109 29.5%,
    1.067 31.8%,
    1.029 34.1%,
    0.999 36.4%,
    0.977 38.6%,
    0.964 40.9%,
    0.958 43.2%,
    0.959 45.5%,
    0.964 47.7%,
    0.972 50%,
    0.98 52.3%,
    0.989 54.5%,
    0.996 56.8%,
    1.002 59.1%,
    1.006 61.4%,
    1.008 63.6%,
    1.009 65.9%,
    1.008 68.2%,
    1.005 72.7%,
    1.002 77.3%,
    0.999 84.1%,
    0.998 90.9%,
    1
  );
  --ed-calm: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---- Hand-drawn spring marks ------------------------------------------------------ */
.coil-mark {
  display: inline-block;
  width: 30px;
  height: 12px;
  margin-right: 12px;
  vertical-align: middle;
  overflow: visible;
  color: var(--site-accent, #0875ac);
  transform-origin: left center;
}
.coil-mark[data-tone='dark'] {
  color: #93c6e0;
}
.coil-line,
.coil-ghost {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.coil-ghost {
  opacity: 0.35;
  transform: translate(0.6px, 0.8px);
}
.site-motion .coil-mark {
  transform: scaleX(0.4);
  opacity: 0;
}
.site-motion .is-in .coil-mark {
  transform: scaleX(1);
  opacity: 1;
  transition:
    transform 1.5s var(--ed-wobble),
    opacity 0.3s;
}

/* ---- Headings: each line rises from behind a mask, no bounce ------------------- */
.ed-line,
.ed-hero-line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.14em;
  margin-bottom: -0.14em;
  font-style: normal;
}
.ed-line-inner,
.ed-hero-line-inner {
  display: block;
  font-style: normal;
}
.site-motion .ed-line-inner {
  transform: translateY(110%);
}
.site-motion .is-in .ed-line-inner {
  transform: none;
  transition: transform 1s var(--ed-calm);
  transition-delay: calc(var(--i) * 110ms + 60ms);
}

/* ---- Gait HUD: the contact entry as an instrument ---------------------------------- */
.site-hud {
  position: fixed;
  right: 0;
  bottom: calc(10px + env(safe-area-inset-bottom));
  z-index: 6;
  display: flex;
  align-items: center;
  visibility: hidden;
  pointer-events: none;
  font-family: var(--site-font, inherit);
  --hud-ink: #1b2932;
  --hud-muted: #4f616c;
  --hud-paper: rgba(248, 249, 250, 0.9);
  --hud-rule: #1b293233;
  --hud-accent: #0875ac;
}
.site-hud[data-tone='dark'] {
  --hud-ink: #f2f6f8;
  --hud-muted: #b4c6d1;
  --hud-paper: rgba(22, 35, 44, 0.9);
  --hud-rule: #ffffff33;
  --hud-accent: #93c6e0;
}
.site-hud-link {
  position: relative;
  display: block;
  width: 152px;
  height: 152px;
  margin-right: -18px;
  border-radius: 50%;
  pointer-events: none;
}
/* Only the ring itself is the target, so the readout above it never blocks content. */
.site-hud-link::after {
  content: '';
  position: absolute;
  inset: 30px;
  border-radius: 50%;
  pointer-events: auto;
}
.site-hud.is-open .site-hud-link::after {
  inset: 0;
}
.site-hud-link:focus-visible {
  outline: 0;
}
.site-hud-link:focus-visible canvas {
  filter: drop-shadow(0 0 3px var(--hud-accent));
}
.site-hud-link canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.site-hud-link svg {
  position: absolute;
  inset: 0;
  width: 26px;
  height: 26px;
  margin: auto;
  color: var(--hud-accent);
  opacity: 0;
  transform: scale(0.6);
  transition:
    opacity 0.25s,
    transform 1.1s var(--ed-wobble);
}
.site-hud.is-open .site-hud-link svg {
  opacity: 1;
  transform: none;
}
/* Callouts: right-aligned readings tied to a hairline beside the ring, no card. */
.site-hud-panel {
  display: grid;
  justify-items: end;
  gap: 9px;
  margin-right: -2px;
  padding: 20px 24px 20px 72px;
  border-right: 1px solid transparent;
  text-align: right;
  white-space: nowrap;
  visibility: hidden;
  background: linear-gradient(to left, var(--hud-paper) 50%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  -webkit-mask-image:
    linear-gradient(to left, #000 62%, transparent),
    linear-gradient(to bottom, transparent, #000 22%, #000 78%, transparent);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to left, #000 62%, transparent),
    linear-gradient(to bottom, transparent, #000 22%, #000 78%, transparent);
  mask-composite: intersect;
  opacity: 0;
  transition:
    opacity 0.3s,
    border-color 0.3s,
    visibility 0s 0.3s;
}
.site-hud.is-open .site-hud-panel {
  visibility: visible;
  opacity: 1;
  border-right-color: var(--hud-rule);
  pointer-events: auto;
  transition:
    opacity 0.3s,
    border-color 0.3s,
    visibility 0s;
}
.site-hud-panel a {
  position: relative;
  display: block;
  color: var(--hud-muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  line-height: 1.5;
  opacity: 0;
  transform: translateX(16px);
  transition:
    opacity 0.3s,
    transform 0.9s var(--ed-soft),
    color 0.2s;
}
.site-hud-panel a::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -24px;
  width: 12px;
  height: 1px;
  background: var(--hud-rule);
}
.site-hud.is-open .site-hud-panel a {
  opacity: 1;
  transform: none;
  transition-delay: calc(var(--i) * 70ms + 60ms);
}
.site-hud-panel a:is(:hover, :focus-visible) {
  color: var(--hud-ink);
}
.site-hud-panel a:is(:hover, :focus-visible)::after {
  background: var(--hud-accent);
  width: 18px;
}
.site-hud-panel .site-hud-primary {
  margin-bottom: 6px;
  color: var(--hud-ink);
  font-size: 18px;
  font-weight: 550;
  letter-spacing: -0.01em;
}
.site-hud-panel .site-hud-primary::after {
  background: var(--hud-accent);
  width: 18px;
}
body:has(.site-navigation details[open]) .site-hud,
body:has([data-mobile-toggle][aria-expanded='true']) .site-hud,
body:has(dialog[open]) .site-hud {
  display: none;
}
@media (max-width: 900px), (prefers-reduced-motion: reduce) {
  .site-hud {
    display: none;
  }
}
@media (min-width: 901px) and (prefers-reduced-motion: no-preference) {
  .site-hud-on .site-contact-shortcut {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .site-motion .ed-line-inner,
  .site-motion .coil-mark {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
