/* Skip-to-content link */
.skip-link {
  position: fixed;
  top: -100%;
  left: var(--space-m, 1rem);
  z-index: 9999;
  padding: 0.5rem 1rem;
  background: var(--c-blue, #045cfa);
  color: #fff;
  font-family: var(--f-display, sans-serif);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 2px;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: var(--space-m, 1rem);
  outline: 2px solid #fff;
  outline-offset: 2px;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--c-canvas); color: var(--c-text);
  font-family: var(--f-body); font-size: var(--fs-step-0); line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3 { font-family: var(--f-display); line-height: 1.05; font-weight: 700; }
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; height: auto; }
.container { max-width: var(--content-max); margin-inline: auto; padding-inline: var(--space-m); }
/* Anchor targets (rail/nav #section jumps) clear the sticky header */
:is(section, main)[id] { scroll-margin-top: var(--anchor-offset); }
.mono-label { font-family: var(--f-mono); font-size: var(--fs-step--1); letter-spacing: .12em; text-transform: uppercase; color: var(--c-blue-text); }
/* Terminal-type caret while a [data-type] label types itself in (mono-type.js) */
.mono-label.is-typing::after { content: "▍"; margin-left: 1px; color: var(--c-blue); animation: mono-caret 1s steps(1) infinite; }
@keyframes mono-caret { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .mono-label.is-typing::after { display: none; animation: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
/* [data-rv] hidden/reveal states live in motion.css, gated on html.motion-ready — an earlier
   UNCONDITIONAL copy here made every data-rv section invisible for no-JS visitors (motion.css's
   own comment documents the intended no-JS/SSR-visible design). Removed 2026-07-15. */
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
/* Programmatic focus targets (e.g. Blazor FocusOnNavigate's h1, tabindex=-1) aren't keyboard-tabbable, so they need no focus ring; keyboard :focus-visible elsewhere is unaffected. */
[tabindex="-1"]:focus { outline: none; }

/* View Transitions: snappy cross-fade; disabled under reduced-motion */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.28s; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* ── Contact success ceremony (markup injected by js/contact-form.js — JS-created nodes carry
      no Blazor scope attribute, so these rules must live globally, like the progress rail) ── */
.contact-success {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-m);
  padding-block: var(--space-l);
}
.contact-success-icon {
  width: 64px;
  height: 64px;
  color: var(--c-brand-green-text);
}
.cs-ring, .cs-check {
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
}
.contact-success.is-in .cs-ring {
  transition: stroke-dashoffset 0.7s var(--ease-out);
  stroke-dashoffset: 0;
}
.contact-success.is-in .cs-check {
  transition: stroke-dashoffset 0.45s var(--ease-out) 0.55s;
  stroke-dashoffset: 0;
}
@media (prefers-reduced-motion: reduce) {
  .cs-ring, .cs-check { stroke-dashoffset: 0; }
  .contact-success.is-in .cs-ring, .contact-success.is-in .cs-check { transition: none; }
}

/* ── Loop-check progress rail (built by js/motion/progress-rail.js; desktop only) ────────── */
.progress-rail {
  position: fixed; right: 20px; top: 50%; transform: translateY(-50%);
  z-index: 40; display: flex; flex-direction: column; align-items: center;
  justify-content: space-between; gap: .35rem; min-height: 42vh; max-height: 62vh;
  opacity: 0; transition: opacity .5s var(--ease-out);
  padding-block: 6px;
}
.progress-rail.is-ready { opacity: 1; }
/* JS only builds the rail ≥1380px; this guards a post-build viewport shrink (enhanced nav). */
@media (max-width: 1379px) { .progress-rail { display: none; } }

.progress-rail-track {
  position: absolute; top: 10px; bottom: 10px; left: 50%; width: 1px;
  transform: translateX(-50%); background: var(--c-line); border-radius: 1px;
}
.progress-rail-fill {
  position: absolute; left: 0; top: 0; width: 1px; height: 0;
  background: var(--c-blue); box-shadow: 0 0 6px var(--c-blue);
  transition: height .12s linear;
}

.progress-rail-tick {
  position: relative; z-index: 1; width: 22px; height: 22px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: none; border: 0; cursor: pointer; color: var(--c-muted);
}
.progress-rail-tick::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  border: 1px solid var(--c-muted); background: var(--c-canvas);
  transition: background var(--dur-micro) var(--ease-out),
              border-color var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out);
}
.progress-rail-tick:hover::before { border-color: var(--c-blue-text); }
.progress-rail-tick.is-active::before {
  border-color: var(--c-blue); background: var(--c-blue);
  box-shadow: 0 0 0 3px rgba(4, 92, 250, .25); transform: scale(1.15);
}
/* Done ticks swap the dot for a drawn check — the "loop-check" completing itself */
.progress-rail-tick.is-done::before { opacity: 0; }
.progress-rail-tick svg {
  position: absolute; width: 15px; height: 15px; color: var(--c-blue);
  opacity: 0; transition: opacity var(--dur-micro) var(--ease-out);
}
.rail-check-path { stroke-dasharray: 26; stroke-dashoffset: 26; transition: stroke-dashoffset .4s var(--ease-out); }
.progress-rail-tick.is-done svg { opacity: 1; }
.progress-rail-tick.is-done .rail-check-path { stroke-dashoffset: 0; }

.progress-rail-label {
  position: absolute; right: 26px; top: 50%; transform: translateY(-50%) translateX(4px);
  white-space: nowrap; font-family: var(--f-mono); font-size: var(--fs-step--1);
  letter-spacing: .04em; color: var(--c-text); background: rgba(12, 20, 31, .9);
  padding: .15em .5em; border: 1px solid var(--c-line); border-radius: 3px;
  opacity: 0; pointer-events: none; transition: opacity var(--dur-micro) var(--ease-out),
              transform var(--dur-micro) var(--ease-out);
}
.progress-rail-tick:hover .progress-rail-label,
.progress-rail-tick:focus-visible .progress-rail-label,
.progress-rail-tick.is-active .progress-rail-label { opacity: 1; transform: translateY(-50%) translateX(0); }
.progress-rail-tick:focus-visible { outline: 2px solid var(--c-blue); outline-offset: 2px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  .progress-rail, .progress-rail-fill, .progress-rail-tick::before,
  .progress-rail-tick svg, .rail-check-path, .progress-rail-label { transition: none; }
}
