/* ─── Whavester public-surface design tokens ─────────────────────────
   One source of truth for the landing page, the sign-in / sign-up
   pages and the style tile (static/landing/style-tile.html). Plain
   CSS on purpose: the Docker-time Tailwind build scans templates only,
   and these pages must render identically from the offline bundle.

   Direction — "the night desk": an analyst's reading room after dark.
   Deep ink surfaces, warm paper text, the brand cyan as the only
   signal colour, a wheat gold reserved for the harvest motif (the mark
   is a wheat ear in a chat bubble). Fraunces for display type, Inter
   for everything read at small sizes, a monospace for data labels.
   The app's own dark palette (slate-950 / cyan-400) is kept as the
   base so the hand-off from landing → sign-in → dashboard feels like
   one product.                                                       */

:root {
  /* Surfaces (ink) */
  --whv-ink-0: #04070f;
  --whv-ink-1: #0a1020;
  --whv-ink-2: #111a2e;
  --whv-ink-3: #1b2640;
  --whv-line: rgba(226, 232, 240, 0.10);
  --whv-line-strong: rgba(226, 232, 240, 0.20);

  /* Text on ink (paper) */
  --whv-paper: #f3efe6;
  --whv-paper-2: #cdd2dc;
  --whv-paper-3: #8c94a5;
  --whv-paper-4: #5b6476;

  /* Brand */
  --whv-cyan: #22d3ee;          /* app accent, dark theme (cyan-400) */
  --whv-cyan-deep: #0e7490;     /* app accent, light theme (cyan-700) */
  --whv-cyan-ink: #063b47;      /* cyan pressed into the ink */
  --whv-cyan-glow: rgba(34, 211, 238, 0.35);
  --whv-wheat: #f0c75e;         /* harvest gold — the wheat ear, one highlight per screen */
  --whv-wheat-deep: #b98a1f;
  --whv-violet: #a78bfa;        /* the app's chats / propagation family */
  --whv-rose: #fb7185;          /* alerts, negative sentiment */
  --whv-emerald: #34d399;       /* positive sentiment, healthy */
  --whv-amber: #fbbf24;         /* warnings, questionable */

  /* Type */
  --whv-font-display: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --whv-font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --whv-font-mono: ui-monospace, 'Cascadia Mono', 'SF Mono', Menlo, Consolas, monospace;

  /* Fluid type scale (rem), 360px → 1440px */
  --whv-step--1: clamp(0.8125rem, 0.78rem + 0.15vw, 0.875rem);
  --whv-step-0: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --whv-step-1: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  --whv-step-2: clamp(1.5rem, 1.25rem + 1.2vw, 2.25rem);
  --whv-step-3: clamp(2rem, 1.5rem + 2.4vw, 3.5rem);
  --whv-step-4: clamp(2.625rem, 1.6rem + 4.8vw, 5.75rem);

  /* Display settings (Fraunces axes) */
  --whv-display-weight: 500;
  --whv-display-axes: 'opsz' 144, 'SOFT' 30, 'WONK' 1;
  --whv-display-axes-small: 'opsz' 48, 'SOFT' 10, 'WONK' 0;

  /* Spacing */
  --whv-space-1: 0.25rem;
  --whv-space-2: 0.5rem;
  --whv-space-3: 0.75rem;
  --whv-space-4: 1rem;
  --whv-space-5: 1.5rem;
  --whv-space-6: 2rem;
  --whv-space-7: 3rem;
  --whv-space-8: 4.5rem;
  --whv-space-9: 7rem;

  /* Shape */
  --whv-radius-s: 0.375rem;
  --whv-radius-m: 0.75rem;
  --whv-radius-l: 1.25rem;
  --whv-radius-pill: 999px;

  /* Elevation */
  --whv-shadow-card: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 20px 50px -30px rgba(0, 0, 0, 0.8);
  --whv-shadow-glow: 0 0 0 1px rgba(34, 211, 238, 0.28), 0 12px 48px -12px rgba(34, 211, 238, 0.45);
  --whv-focus-ring: 0 0 0 2px var(--whv-ink-0), 0 0 0 4px var(--whv-cyan);

  /* Motion */
  --whv-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --whv-ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --whv-dur-fast: 160ms;
  --whv-dur: 320ms;
  --whv-dur-slow: 640ms;

  /* Layout */
  --whv-nav-h: 3.5rem;                       /* 56px bar, outside any pinned stage */
  --whv-tap: 44px;                           /* minimum touch target */
  --whv-safe-top: env(safe-area-inset-top, 0px);
  --whv-safe-right: env(safe-area-inset-right, 0px);
  --whv-safe-bottom: env(safe-area-inset-bottom, 0px);
  --whv-safe-left: env(safe-area-inset-left, 0px);
  --whv-measure: 62ch;                       /* body copy line length */
  --whv-content-max: 72rem;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --whv-dur-fast: 0ms;
    --whv-dur: 0ms;
    --whv-dur-slow: 0ms;
  }
}

/* ─── Shared primitives (used by the landing, sign-in and style tile) ── */

.whv-display {
  font-family: var(--whv-font-display);
  font-weight: var(--whv-display-weight);
  font-variation-settings: var(--whv-display-axes);
  letter-spacing: -0.015em;
  line-height: 1.02;
  text-wrap: balance;
}
.whv-display-small {
  font-family: var(--whv-font-display);
  font-weight: 500;
  font-variation-settings: var(--whv-display-axes-small);
  letter-spacing: -0.01em;
  line-height: 1.12;
  text-wrap: balance;
}
.whv-display em, .whv-display-small em {
  font-style: italic;
  font-weight: 400;
  color: var(--whv-wheat);
}
.whv-eyebrow {
  font-family: var(--whv-font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--whv-cyan);
}
.whv-lede {
  font-family: var(--whv-font-body);
  font-size: var(--whv-step-1);
  line-height: 1.45;
  color: var(--whv-paper-2);
  max-width: var(--whv-measure);
  text-wrap: pretty;
}
.whv-body {
  font-family: var(--whv-font-body);
  font-size: var(--whv-step-0);
  line-height: 1.6;
  color: var(--whv-paper-2);
  max-width: var(--whv-measure);
}

/* Buttons: 44px minimum, visible focus, no colour-only states. */
.whv-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: var(--whv-tap); padding: 0 1.25rem;
  border-radius: var(--whv-radius-pill);
  font-family: var(--whv-font-body); font-size: 0.9375rem; font-weight: 600;
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: transform var(--whv-dur-fast) var(--whv-ease-out),
              background-color var(--whv-dur-fast), border-color var(--whv-dur-fast),
              box-shadow var(--whv-dur-fast);
}
.whv-btn:focus-visible { outline: none; box-shadow: var(--whv-focus-ring); }
.whv-btn:active { transform: translateY(1px); }
.whv-btn-primary { background: var(--whv-cyan); color: var(--whv-ink-0); }
.whv-btn-primary:hover { background: #5ee3f5; box-shadow: var(--whv-shadow-glow); }
.whv-btn-ghost { background: transparent; color: var(--whv-paper); border-color: var(--whv-line-strong); }
.whv-btn-ghost:hover { border-color: var(--whv-paper-3); background: rgba(255, 255, 255, 0.04); }
.whv-btn-quiet { background: transparent; color: var(--whv-paper-2); padding-inline: 0.75rem; }
.whv-btn-quiet:hover { color: var(--whv-paper); }

/* Links in running text: underlined, never colour-only. */
.whv-link {
  color: var(--whv-cyan); text-decoration: underline; text-underline-offset: 0.18em;
  text-decoration-thickness: 1px; text-decoration-color: rgba(34, 211, 238, 0.45);
}
.whv-link:hover { text-decoration-color: currentColor; }
.whv-link:focus-visible { outline: none; box-shadow: var(--whv-focus-ring); border-radius: 2px; }

/* Cards and chips: the app's message-card grammar, on ink. */
.whv-card {
  background: linear-gradient(180deg, var(--whv-ink-2), var(--whv-ink-1));
  border: 1px solid var(--whv-line); border-radius: var(--whv-radius-l);
  box-shadow: var(--whv-shadow-card);
}
.whv-chip {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.15rem 0.55rem; border-radius: var(--whv-radius-pill);
  font-family: var(--whv-font-mono); font-size: 0.6875rem; letter-spacing: 0.02em;
  border: 1px solid var(--whv-line-strong); color: var(--whv-paper-2); background: rgba(255, 255, 255, 0.03);
}
.whv-chip-cyan { color: var(--whv-cyan); border-color: rgba(34, 211, 238, 0.4); background: rgba(34, 211, 238, 0.08); }
.whv-chip-violet { color: var(--whv-violet); border-color: rgba(167, 139, 250, 0.4); background: rgba(167, 139, 250, 0.08); }
.whv-chip-rose { color: var(--whv-rose); border-color: rgba(251, 113, 133, 0.4); background: rgba(251, 113, 133, 0.08); }
.whv-chip-emerald { color: var(--whv-emerald); border-color: rgba(52, 211, 153, 0.4); background: rgba(52, 211, 153, 0.08); }
.whv-chip-wheat { color: var(--whv-wheat); border-color: rgba(240, 199, 94, 0.4); background: rgba(240, 199, 94, 0.08); }

/* Form fields on ink (sign-in / sign-up). */
.whv-field { display: grid; gap: 0.375rem; }
.whv-label { font-family: var(--whv-font-body); font-size: 0.8125rem; font-weight: 500; color: var(--whv-paper-2); }
.whv-input {
  width: 100%; min-height: var(--whv-tap); padding: 0 0.875rem;
  background: var(--whv-ink-1); color: var(--whv-paper);
  border: 1px solid var(--whv-line-strong); border-radius: var(--whv-radius-m);
  font-family: var(--whv-font-body); font-size: 1rem;      /* 16px: no iOS zoom on focus */
  transition: border-color var(--whv-dur-fast), box-shadow var(--whv-dur-fast);
}
.whv-input::placeholder { color: var(--whv-paper-4); }
.whv-input:focus { outline: none; border-color: var(--whv-cyan); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.2); }
.whv-hint { font-size: 0.75rem; color: var(--whv-paper-3); }
.whv-alert {
  padding: 0.75rem 0.875rem; border-radius: var(--whv-radius-m);
  border: 1px solid rgba(251, 113, 133, 0.4); background: rgba(251, 113, 133, 0.1); color: #fecdd3;
  font-size: 0.875rem;
}

/* Texture: a faint ledger rule and grain, for atmosphere without weight. */
.whv-ledger {
  background-image:
    linear-gradient(to bottom, rgba(226, 232, 240, 0.045) 1px, transparent 1px);
  background-size: 100% 2.25rem;
}
.whv-grain::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  opacity: 0.06; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='160' height='160' filter='url(%23n)' opacity='0.9'/></svg>");
}

/* Skip links and screen-reader-only text. */
.whv-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;
}
.whv-skip {
  position: fixed; left: 1rem; top: calc(var(--whv-safe-top) + 0.75rem); z-index: 1000;
  transform: translateY(-200%); transition: transform var(--whv-dur-fast) var(--whv-ease-out);
}
.whv-skip:focus { transform: none; }
