/* AB#479 loading states. Tokens and components come from the real btddev.org stylesheet (css/site.css). */
[hidden] { display: none !important; }
.ls-intro { padding-top: var(--space-7); display: grid; gap: var(--space-3); max-width: 48rem; }
.ls-intro h1 { font: 650 var(--text-section)/var(--leading-heading) var(--font-display); letter-spacing: var(--tracking-title); text-wrap: balance; }
.ls-controls { margin-top: var(--space-2); }
.site-footer { margin-top: var(--section-gap); padding-block: var(--space-6); border-top: 1px solid var(--line); color: var(--text-2); }

/* ---------- Skeleton (layout known, words not yet) ----------
   Static blocks in the real card grid, so the space is reserved. The shimmer starts only after 400 ms: a fast load
   swaps the skeleton out before anything moves. Reduced motion: no shimmer, the still blocks stay. */
.sk { display: block; border-radius: var(--radius-sm); background: var(--line); }
.sk-card { pointer-events: none; }
.sk-card:hover { border-color: var(--line); box-shadow: none; }
.sk-art { aspect-ratio: 280 / 132; border-radius: var(--radius-md); }
.sk-glyph { width: 40px; height: 40px; border-radius: var(--radius-md); }
.sk-title { grid-area: title; align-self: center; height: 1.25em; width: 70%; }
.sk-text { grid-area: text; display: grid; gap: var(--space-2); }
.sk-line { height: 0.9em; width: 100%; }
.sk-short { width: 60%; }
.sk-h2 { height: 1em; width: min(22rem, 80%); font-size: var(--text-section); }
.sk-lead { width: min(26rem, 90%); height: 1em; }
.motion-ok .sk {
  background: linear-gradient(90deg, var(--line) 0 40%, var(--surface-hover, var(--bg)) 50%, var(--line) 60% 100%) 0 0 / 300% 100%;
  animation: sk-shimmer 1.4s linear 400ms infinite;
}
@keyframes sk-shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* ---------- Loaded content entrance (2:02:02) ----------
   Fade plus an 12 px rise, 240 ms ease-out, 50 ms apart, the last one starting by 500 ms. Opacity and transform only.
   Reduced motion: no rise, no stagger (the content is simply there). */
.motion-ok .ls-enter { animation: ls-in 240ms var(--ease-out, cubic-bezier(.2, .8, .2, 1)) both; animation-delay: min(calc(var(--i, 0) * 50ms), 260ms); }
@keyframes ls-in { from { opacity: 0; transform: translateY(12px); } }

/* ---------- Branded loader (AB#484 pick "Two states fill") ----------
   The BTD Dev mark: the hollow ring draws, the link runs, the teal dot fills, then back. 1.6 s each way.
   Reduced motion: the full mark, still, with the words. */
.ls-loader-slot { min-height: 12rem; }
.ls-loader { display: flex; align-items: center; gap: var(--space-3); padding-block: var(--space-7); color: var(--text-2); }
.bl { width: 3rem; height: 3rem; overflow: visible; color: var(--text); flex: none; }
.bl-ring, .bl-link { fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; }
.bl-dot { fill: var(--accent); transform-box: fill-box; transform-origin: center; }
.motion-ok .bl-ring, .motion-ok .bl-link { stroke-dasharray: 1 2; }
.motion-ok .bl-ring { animation: bl-ring 1.6s cubic-bezier(.65, 0, .35, 1) infinite alternate; }
.motion-ok .bl-link { animation: bl-link 1.6s cubic-bezier(.65, 0, .35, 1) infinite alternate; }
.motion-ok .bl-dot  { animation: bl-dot  1.6s cubic-bezier(.65, 0, .35, 1) infinite alternate; }
@keyframes bl-ring { 0% { stroke-dashoffset: 1.01; } 45%, 100% { stroke-dashoffset: 0; } }
@keyframes bl-link { 0%, 40% { stroke-dashoffset: 1.01; } 60%, 100% { stroke-dashoffset: 0; } }
@keyframes bl-dot  { 0%, 55% { scale: 0; } 100% { scale: 1; } }

/* ---------- Contact form and the processing step (2:26:36) ---------- */
.ls-form { margin-top: var(--space-6); display: grid; gap: var(--space-2); max-width: 32rem; }
.ls-form label { font-weight: 600; margin-top: var(--space-2); }
.ls-form input, .ls-form textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius-md); padding: var(--space-2) var(--space-3); min-height: 48px; width: 100%;
}
.ls-form input:focus-visible, .ls-form textarea:focus-visible { outline: var(--focus-width, 2px) solid var(--focus, var(--accent)); outline-offset: var(--focus-offset, 2px); }
.ls-form [aria-invalid="true"] { border-color: var(--danger, #b3261e); }
.ls-error { color: var(--danger-text, var(--text)); font-weight: 600; }
/* Fixed size: both labels sit in the same grid cell, the wider one sets the width, so swapping them moves nothing. */
.ls-submit { margin-top: var(--space-4); justify-self: start; display: inline-grid; }
.ls-submit > span { grid-area: 1 / 1; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); }
.ls-submit-busy { visibility: hidden; }
.ls-submit[data-busy] .ls-submit-idle { visibility: hidden; }
.ls-submit[data-busy] .ls-submit-busy { visibility: visible; }
.ls-submit[aria-disabled="true"] { cursor: progress; opacity: 0.85; }
.motion-ok .ls-submit[aria-disabled="true"] { transform: none; translate: none; }
.ls-dots { display: inline-flex; gap: 3px; }
.ls-dots i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .5; }
.motion-ok .ls-dots i { animation: ls-dot 900ms ease-in-out infinite; }
.motion-ok .ls-dots i:nth-child(2) { animation-delay: 150ms; }
.motion-ok .ls-dots i:nth-child(3) { animation-delay: 300ms; }
@keyframes ls-dot { 50% { opacity: 1; transform: translateY(-2px); } }

/* ---------- Offline ---------- */
.ls-offline { margin-top: var(--section-gap); padding: var(--space-5); border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); display: grid; gap: var(--space-3); }
.ls-offline h2 { font: 650 var(--text-2xl)/var(--leading-heading) var(--font-display); }
