/* ─────────────────────────────────────────────────────────
   Project Kestrel — Polish Layer
   Loaded after styles.css and dark-theme.css.
   Tuned for the dark theme that the site ships in.
   Borrows the motion + component vocabulary from Perch
   while keeping Kestrel's American-Kestrel orange + sky identity.
   ───────────────────────────────────────────────────────── */

:root {
  --font-display: "Source Serif 4", Georgia, "Times New Roman", serif;

  --k-ease: cubic-bezier(0.36, 0.07, 0.19, 0.97);
  --k-shadow-card-hover: 0 18px 44px rgba(0, 0, 0, 0.45);
  --k-shadow-btn-primary-hover: 0 10px 28px rgba(212, 107, 42, 0.32);
  --k-shadow-btn-secondary-hover: 0 10px 28px rgba(74, 163, 255, 0.22);
}

/* ─────────────────────────────────────────────────────────
   Motion library — opt-in via classes / utility selectors
   ───────────────────────────────────────────────────────── */
@keyframes k-card-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes k-pop {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.18); }
  65%  { transform: scale(0.94); }
  100% { transform: scale(1); }
}
@keyframes k-slide-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes k-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Apply to value cards in a soft, staggered entrance */
.home-value-row { animation: k-card-in 0.36s ease-out both; }
.home-value-list .home-value-row:nth-child(1) { animation-delay: 0.00s; }
.home-value-list .home-value-row:nth-child(2) { animation-delay: 0.06s; }
.home-value-list .home-value-row:nth-child(3) { animation-delay: 0.12s; }
.home-value-list .home-value-row:nth-child(4) { animation-delay: 0.18s; }

/* Hero copy and demo widget chrome ease in */
.demo-hero-left .eyebrow,
.demo-hero-left h1,
.demo-hero-left .lead,
.demo-hero-buttons,
.demo-hero-badges,
.hero-demo-callout { animation: k-slide-in 0.42s ease-out both; }
.demo-hero-left h1 { animation-delay: 0.04s; }
.demo-hero-left .lead { animation-delay: 0.10s; }
.demo-hero-buttons { animation-delay: 0.16s; }
.demo-hero-badges { animation-delay: 0.22s; }

/* Quick "pop" feedback when buttons are pressed */
.btn:active { animation: k-pop 0.28s var(--k-ease) both; }

/* Reusable shimmer placeholder — for any future loading skeletons */
.k-shimmer {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 0%,
    rgba(255, 255, 255, 0.10) 50%,
    rgba(255, 255, 255, 0.04) 100%
  );
  background-size: 200% 100%;
  animation: k-shimmer 1.4s linear infinite;
}

/* ─────────────────────────────────────────────────────────
   Typography — display headings shift to serif (Source Serif 4),
   bringing Perch's softer, less tech-leaning rhythm to Kestrel.
   Space Grotesk stays for chrome (eyebrows, badges, buttons, nav).
   ───────────────────────────────────────────────────────── */

/* Hero headline (the centerpiece of every page entrance) */
.demo-hero-left h1,
.hero h1,
.hero--centered h1 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.06;
}
.demo-hero-left h1 {
  font-size: clamp(2.4rem, 4.6vw, 3.8rem);
}
.hero h1,
.hero--centered h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
}

/* The italic <em> Kestrel uses inside hero h1s
   reads more elegantly in the serif voice */
.demo-hero-left h1 em,
.hero h1 em,
.hero--centered h1 em {
  font-style: italic;
  font-weight: 500;
}

/* Section headings throughout the site */
.section-heading h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  letter-spacing: -0.01em;
  line-height: 1.18;
}

/* ─────────────────────────────────────────────────────────
   Card hover polish — lift, shadow, border tint
   Mirrors Perch's signature card feel, using Kestrel's orange tint.
   ───────────────────────────────────────────────────────── */
.home-value-row {
  transition:
    border-color 0.22s ease,
    box-shadow 0.24s ease,
    transform 0.24s ease,
    background 0.24s ease;
}
.home-value-row:hover {
  box-shadow: var(--k-shadow-card-hover);
  transform: translateY(-3px);
}

/* Reusable hover utility for any other card-shaped element */
.k-card-hover {
  transition:
    border-color 0.22s ease,
    box-shadow 0.24s ease,
    transform 0.24s ease;
}
.k-card-hover:hover,
.k-card-hover:focus-visible {
  border-color: rgba(212, 107, 42, 0.40);
  box-shadow: var(--k-shadow-card-hover);
  transform: translateY(-3px);
}

/* Demo widget on the homepage hero — refine the chrome only.
   The widget INTERIOR (rendered by demo-hero.js) is left intact
   so it still reads as a marketing teaser of the desktop app. */
.demo-widget {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.demo-widget:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

/* ─────────────────────────────────────────────────────────
   Refined uppercase pill — small, letter-spaced, tinted
   Drop-in replacement / addition next to existing badges.
   ───────────────────────────────────────────────────────── */
.k-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  border: 1px solid transparent;
  white-space: nowrap;
}
.k-pill--orange {
  background: rgba(212, 107, 42, 0.14);
  color: #f0a273;
  border-color: rgba(212, 107, 42, 0.34);
}
.k-pill--sky {
  background: rgba(74, 163, 255, 0.14);
  color: #8cc2ff;
  border-color: rgba(74, 163, 255, 0.34);
}
.k-pill--muted {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.72);
  border-color: rgba(255, 255, 255, 0.12);
}

/* ─────────────────────────────────────────────────────────
   Button polish — colored-shadow lift on hover
   ───────────────────────────────────────────────────────── */
.btn {
  /* Make sure the existing btn transition includes box-shadow */
  transition: transform 0.2s ease, box-shadow 0.22s ease, background 0.2s ease;
}
.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--k-shadow-btn-primary-hover);
}
.btn.secondary:hover,
.btn.ghost:hover {
  transform: translateY(-2px);
  box-shadow: var(--k-shadow-btn-secondary-hover);
}

/* ─────────────────────────────────────────────────────────
   Focus-visible — consistent keyboard ring across the site
   ───────────────────────────────────────────────────────── */
:where(a, button, .btn, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid rgba(74, 163, 255, 0.65);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ─────────────────────────────────────────────────────────
   Respect reduced-motion — disable entrances and fancy hovers,
   keep static end-states.
   ───────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .home-value-row,
  .demo-hero-left .eyebrow,
  .demo-hero-left h1,
  .demo-hero-left .lead,
  .demo-hero-buttons,
  .demo-hero-badges,
  .hero-demo-callout {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .home-value-row:hover,
  .demo-widget:hover,
  .btn:hover,
  .btn.primary:hover,
  .btn.secondary:hover,
  .btn.ghost:hover,
  .k-card-hover:hover {
    transform: none !important;
  }
}
