/* The Whavester logo, "Ripe" (feedback #97, docs/plan-logo.md): its gold,
   its one motion and the logo used as a progress indicator. The drawings
   are templates/_logo.html's macros; static/whv_logo.js moves the meters.
   Plain CSS: the Tailwind build scans templates, not this file. Only
   transform, opacity and stroke-dashoffset ever move.

   The class names are the shipped drawing's own (whv-ear-*), so nothing
   here reaches the concept drawings on the /design/logo review page. */

:root { --whv-gold: #f0c75e; --whv-ear-ease: cubic-bezier(.22, 1, .36, 1); }
html.light { --whv-gold: #b98a1f; }
.whv-ear-tip { fill: var(--whv-gold); }

/* ── the mark sways once, like wheat in a breeze, when the sidebar's
   logo is pointed at (a mouse only: a tap would leave it swaying) ──── */
[data-whv-logo-mark] { transform-origin: 50% 94%; }
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  [data-whv-brand]:hover > [data-whv-logo-mark] { animation: whv-ear-sway 900ms cubic-bezier(.45, 0, .55, 1); }
}
@keyframes whv-ear-sway {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-7deg); }
  55% { transform: rotate(4deg); }
  80% { transform: rotate(-1.5deg); }
}

/* ── the logo as progress ([data-whv-ear], logo_progress) ─────────────
   A faint whole ear (the ghost) under the ear that builds: the stem is
   drawn along its pathLength of 100, each grain grows out of the stem
   from its point of attachment (--f, 0..1). At 100% the tip turns gold
   (.is-done) and the ear sways once (.is-celebrate, whv_logo.js). */
.whv-ear { display: inline-flex; flex: none; vertical-align: middle; line-height: 0; color: var(--accent, #22d3ee); }
.whv-ear > svg { display: block; overflow: visible; transform-origin: 50% 94%; }
.whv-ear-ghost { opacity: .2; }
.whv-ear-ghost .whv-ear-tip,
.whv-ear:not(.is-done) .whv-ear-fill .whv-ear-tip { fill: currentColor; }
.whv-ear-fill [data-whv-step] {
  transform-box: fill-box; transform-origin: 50% 100%;
  transform: scale(var(--f, 1));
  transition: transform 320ms var(--whv-ear-ease);
}
.whv-ear-fill .whv-ear-stem { stroke-dasharray: 100; transition: stroke-dashoffset 320ms var(--whv-ear-ease); }
.whv-ear.is-instant * { transition: none !important; }
.whv-ear.is-celebrate > svg { animation: whv-ear-sway 900ms cubic-bezier(.45, 0, .55, 1); }
.whv-ear[data-state="error"] { color: #f87171; }
html.light .whv-ear[data-state="error"] { color: #be123c; }
.whv-ear[data-state="cancelled"] { color: var(--text-faint, #64748b); }

/* A wait of unknown length (.is-loop): the whole ear, a light climbing
   it pair by pair. --whv-ear-phase (whv_logo.js) keeps every loop on the
   page in step with the clock, so a meter drawn again carries on. */
.whv-ear.is-loop .whv-ear-ghost { display: none; }
.whv-ear.is-loop .whv-ear-fill .whv-ear-stem { opacity: .45; }
.whv-ear.is-loop .whv-ear-fill .whv-ear-grain {
  animation: whv-ear-climb 1600ms cubic-bezier(.65, 0, .35, 1) infinite;
  animation-delay: calc(var(--whv-ear-phase, 0ms) - 1600ms);
}
.whv-ear.is-loop .whv-ear-fill [data-whv-step="1"] { animation-delay: calc(var(--whv-ear-phase, 0ms) - 1440ms); }
.whv-ear.is-loop .whv-ear-fill [data-whv-step="2"] { animation-delay: calc(var(--whv-ear-phase, 0ms) - 1280ms); }
.whv-ear.is-loop .whv-ear-fill [data-whv-step="3"] { animation-delay: calc(var(--whv-ear-phase, 0ms) - 1120ms); }
@keyframes whv-ear-climb { 0%, 100% { opacity: .22; } 30% { opacity: 1; } 60% { opacity: .22; } }

/* ── the wait sign (logo_wait / whvLogo.waitHTML) ─────────────────────
   Every spinner in the app is this (owner, 2026-10-20: "all of them"):
   the small drawing's climbing light, sized by its caller (1em inline,
   1.5rem in a block, the full drawing at 2.5rem over a graph). In a
   button it takes the button's own text colour: an accent sign on an
   accent button would vanish. */
.whv-ear-wait { vertical-align: -0.15em; }
button .whv-ear-wait, .ui-btn .whv-ear-wait, [role="button"] .whv-ear-wait { color: inherit; }
/* .whv-ear-tone: the sign takes its line's colour (an amber "connecting"
   state, a status badge) instead of the accent. */
.whv-ear.whv-ear-tone { color: inherit; }
/* A busy button is dimmed (.whv-busy, opacity .6): there the light climbs
   from a higher floor, or the sign all but vanishes between steps. */
.whv-busy .whv-ear.is-loop .whv-ear-fill .whv-ear-stem { opacity: .8; }
.whv-busy .whv-ear.is-loop .whv-ear-fill .whv-ear-grain { animation-name: whv-ear-climb-busy; }
@keyframes whv-ear-climb-busy { 0%, 100% { opacity: .5; } 30% { opacity: 1; } 60% { opacity: .5; } }

/* The Report button's progress row: the ear beside the status line, and
   no empty row (nor its gap) when neither is showing. */
.ui-menu-progress { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.ui-menu-progress:not(:has(> [data-report-bar]:not([hidden]))):not(:has(> .ui-menu-status:not(:empty))) { display: none; }

/* ── the wait while the next page loads (whv_nav_loader.js; owner,
   2026-10-21: "Dim page + logo") ──────────────────────────────────────
   Over the content area only: the script sets left / top to the right of
   the rail and below the phone bar. The page fades back under its own
   colour; the climbing logo and its line sit in the middle. Below the
   phone bar (z 40), the drawer's backdrop (45) and the rail / drawer
   (50), so those stay usable; above the page's own sticky rows. */
.whv-nav-veil {
  position: fixed; inset: 0; z-index: 35;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
  background: rgba(2, 6, 23, .55);
  background: color-mix(in srgb, var(--bg-page, #020617) 55%, transparent);
  opacity: 0; transition: opacity 160ms var(--whv-ear-ease);
  cursor: progress; -webkit-tap-highlight-color: transparent;
}
.whv-nav-veil[hidden] { display: none; }
.whv-nav-veil.is-on { opacity: 1; }
/* A page's own dialog (z 50) is open: over it, or the dialog hides the wait. */
.whv-nav-veil.is-top { z-index: 60; }
/* One size for both lines: the box does not jump when "Loading…" becomes
   the two-line "Still loading…" at 6 s. */
.whv-nav-box {
  display: flex; flex-direction: column; align-items: center; gap: .625rem;
  width: 19rem; max-width: 100%; box-sizing: border-box; padding: 1.25rem 1.5rem 1rem;
  border-radius: 1rem; text-align: center;
  background: var(--bg-card, #0f172a); border: 1px solid var(--border, #1e293b);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .28);
}
.whv-nav-text {
  margin: 0; min-height: 2.9em; display: flex; align-items: center; justify-content: center;
  font-size: .875rem; line-height: 1.45; text-wrap: balance; color: var(--text-primary, #e2e8f0);
}
.whv-sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
/* A region the user asked for (an htmx GET swap with no indicator of its
   own): its content fades back, the small logo in its middle. */
.whv-region-busy > :not(.whv-region-veil) { opacity: .45; transition: opacity 160ms var(--whv-ear-ease); }
.whv-region-veil {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
}
/* The note by a send Esc's stop cut (whv_nav_stop.js) is help text: in a
   menu's root (a Report button) it sits off the button, on its middle. */
.ui-menu > .whv-stop-note { align-self: center; margin: 0 0 0 .5rem; }

/* Reduced motion: nothing sways, grows or climbs; a value still shows
   at once (progress is information), and a wait only breathes. */
@media (prefers-reduced-motion: reduce) {
  [data-whv-logo-mark], .whv-ear > svg, .whv-ear * { animation: none !important; transition: none !important; }
  .whv-ear.is-loop .whv-ear-fill { animation: whv-ear-breathe 2400ms ease-in-out infinite !important; }
  .whv-nav-veil, .whv-region-busy > * { transition: none !important; }
}
@keyframes whv-ear-breathe { 0%, 100% { opacity: .4; } 50% { opacity: 1; } }
