/* ---------------------------------------------------------------------------
   PostLane base element styling + signature keyframes
   ---------------------------------------------------------------------------
   Applies the token system to bare HTML so any page that links styles.css
   reads as PostLane out of the box. Keep this thin — components own their
   own treatment; this is the floor.
   --------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--text-body);          /* 14px UI default */
  line-height: var(--text-body-lh);
  letter-spacing: var(--tracking-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  letter-spacing: var(--tracking-tight);
  font-weight: var(--weight-semibold);
}

/* Native form controls don't inherit the body font (UA falls back to serif
   on macOS/iOS). Pin the brand sans on every control. */
select, option, optgroup, input, textarea, button {
  font-family: var(--font-sans);
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Focus — WCAG 2.2: every interactive element gets a visible state.
   Default is a 2px accent outline with a 2px offset. */
:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Selection — accent-soft highlight */
::selection {
  background: var(--accent-soft);
  color: var(--fg);
}

/* Scrollbars — subtle, themed */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

/* ---------------------------------------------------------------------------
   Signature keyframes
   --------------------------------------------------------------------------- */

/* Active timer chip — a slow accent glow that breathes (3s). "Alive, but not
   anxious." Attach .animate-timer-glow to the chip. */
@keyframes pl-timer-glow {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--accent) 0%, transparent); }
  50%      { box-shadow: 0 0 14px 2px color-mix(in oklab, var(--accent) 22%, transparent); }
}
.animate-timer-glow {
  animation: pl-timer-glow 3s ease-in-out infinite;
}

/* Live ping dot — the small pulse on the timer's status dot. */
@keyframes pl-ping {
  75%, 100% { transform: scale(2); opacity: 0; }
}
.animate-ping {
  animation: pl-ping 1s var(--ease-out) infinite;
}

/* Confirm pop — one restrained scale-settle for a success checkmark after a
   high-stakes action. Quiet confidence, no bounce. */
@keyframes pl-confirm-pop {
  0%   { transform: scale(0.6); opacity: 0; }
  55%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
.animate-confirm-pop {
  animation: pl-confirm-pop var(--duration-slow) var(--ease-out) both;
}

/* Reduced motion — collapse everything to near-instant. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
