/* ========================================
   CSS Variables & Reset
   ======================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Backgrounds */
  --bg-deepest: #0d0618;
  --bg-deep: #150a24;
  --bg-mid: #1f1333;
  --bg-surface: #2a1f42;

  /* Purples / Lavenders */
  --purple-900: #2d1b4e;
  --purple-700: #4a2e7a;
  --purple-500: #7c5eb8;
  --purple-300: #a78bfa;
  --lavender: #c4b5fd;
  --lavender-bright: #ddd6fe;

  /* Accents */
  --pink-bright: #f0abfc;
  --pink-soft: #e9d5ff;
  --cyan-bright: #67e8f9;
  --green-soft: #86efac;

  /* Text */
  --text-primary: #faf5ff;
  --text-secondary: #e9d5ff;
  --text-muted: #c4b5fd;
  --text-dim: #a78bfa;

  /* Borders */
  --border-subtle: rgba(167, 139, 250, 0.15);
  --border-medium: rgba(167, 139, 250, 0.25);
  --border-bright: rgba(196, 181, 253, 0.4);

  /* Fonts */
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Fira Code", Monaco, Consolas, monospace;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;
}

::selection {
  background: rgba(240, 171, 252, 0.3);
  color: var(--text-primary);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px; /* for skip link + sticky UI */
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;

  background:
    radial-gradient(ellipse 120% 80% at 50% 0%, rgba(124, 94, 184, 0.15), transparent 50%),
    radial-gradient(ellipse 100% 70% at 80% 30%, rgba(240, 171, 252, 0.08), transparent 60%),
    radial-gradient(ellipse 80% 60% at 20% 70%, rgba(103, 232, 249, 0.06), transparent 70%),
    linear-gradient(180deg, var(--bg-deepest) 0%, var(--bg-deep) 100%);

  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
}

/* Floating glow orbs */
body::before,
body::after {
  content: "";
  position: fixed;
  z-index: 0;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.4;
}

body::before {
  width: 600px;
  height: 600px;
  top: -300px;
  right: -200px;
  background: radial-gradient(circle, var(--purple-500), transparent);
  animation: float 30s ease-in-out infinite;
}

body::after {
  width: 500px;
  height: 500px;
  bottom: -250px;
  left: -150px;
  background: radial-gradient(circle, var(--pink-bright), transparent);
  animation: float 35s ease-in-out infinite reverse;
}

/* ========================================
   Typography
   ======================================== */

h1,
h2,
h3 {
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

h1 {
  margin-bottom: var(--space-sm);
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-family: var(--font-display);

  background: linear-gradient(
    135deg,
    var(--text-primary) 0%,
    var(--lavender-bright) 40%,
    var(--pink-bright) 70%,
    var(--cyan-bright) 100%
  );
  background-size: 200% auto;

  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;

  animation: shimmer 8s ease-in-out infinite;
}

h2 {
  margin-bottom: var(--space-md);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  color: var(--lavender-bright);
}

h3 {
  margin-bottom: var(--space-md);
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  color: var(--lavender);
}

p {
  max-width: 65ch;
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-muted);
}

.tagline {
  margin-bottom: var(--space-lg);
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-dim);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.label {
  display: inline-block;
  margin-bottom: var(--space-md);
  padding: 0.4rem 1rem;

  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;

  color: var(--lavender-bright);
  background: rgba(124, 94, 184, 0.2);
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(124, 94, 184, 0.15);
}

/* ========================================
   Layout
   ======================================== */

.container {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

section {
  padding: var(--space-2xl) 0;
}

/* ========================================
   Page Components (Animal Friends + shared)
   ======================================== */

/* Header shared with index */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(13, 6, 24, 0.85);
  border-bottom: 1px solid var(--border-medium);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.header-shell {
  padding: 18px 0;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

/* Brand */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--text-primary);
  transition: opacity 0.2s ease;
}

.brand:hover {
  opacity: 0.85;
}

.logo-mark {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  border: 1px solid var(--border-medium);
  background: rgba(42, 31, 66, 0.5);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.wordmark {
  display: grid;
  gap: 4px;
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.1;
}

.brand-tagline {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* Nav (single definition — removed duplicates) */
.nav-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.nav-row a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.nav-row a:hover {
  color: var(--text-primary);
  background: rgba(42, 31, 66, 0.6);
  border-color: var(--border-medium);
  text-decoration: none;
}

.nav-row a[aria-current="page"] {
  color: var(--text-primary);
  background: rgba(124, 94, 184, 0.22);
  border-color: var(--border-medium);
}

/* Top bar inside the big Rainkeep header (kept, but deduped brand/nav styles above) */
.site-topbar {
  position: relative;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;

  padding: 14px 16px;
  margin: -24px -16px 18px;
  border-radius: 18px;

  background: rgba(13, 6, 24, 0.35);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(8px);
}

/* Responsive header adjustments */
@media (max-width: 760px) {
  .header-shell {
    padding: 14px 0;
  }

  .logo-mark {
    width: 44px;
    height: 44px;
  }

  .brand-name {
    font-size: 1.1rem;
  }

  .brand-tagline {
    font-size: 0.8rem;
  }

  .nav-row a {
    padding: 8px 14px;
    font-size: 0.9rem;
  }
}

@media (max-width: 768px) {
  .site-topbar {
    flex-direction: column;
    align-items: flex-start;
    margin: -18px -10px 16px;
  }
}

/* Hero title image (Animal Friends) */
.hero h1 {
  margin-bottom: var(--space-xs);
}

.hero-with-image .tagline {
  margin-top: var(--space-sm);
  margin-bottom: 0;
}

.hero-with-image {
  padding: var(--space-sm) 0 var(--space-sm);
}

.hero-with-image .hero-title-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--space-xl);
  margin-bottom: var(--space-lg);
}

.hero-title-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.hero-title-image {
  width: 100%;
  max-width: 320px;
  height: auto;
  border-radius: 20px;
  border: 2px solid var(--border-medium);
  background: rgba(13, 6, 24, 0.65);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.5),
    0 8px 16px rgba(124, 94, 184, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transform: translateY(-4px);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.hero-with-image .hero-title-image {
  backdrop-filter: blur(6px);
}

.hero-title-image:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.6),
    0 12px 24px rgba(124, 94, 184, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

@media (max-width: 920px) {
  .hero-with-image .hero-title-row {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    text-align: center;
  }

  .hero-title-image {
    max-width: 400px;
    margin: 0 auto;
    justify-self: center;
  }

  .hero-title-content {
    align-items: center;
  }

  .hero-with-image .tagline {
    max-width: 100%;
  }
}

@media (max-width: 560px) {
  .hero-title-image {
    max-width: 100%;
  }
}

/* Hero meta row */
.hero-meta {
  margin-top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  flex-wrap: wrap;
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-subtle);
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 760px) {
  .hero-meta {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    gap: var(--space-md);
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
  }
}

/* Skip link (single definition) */
.skip-link {
  position: absolute;
  top: -48px;
  left: 16px;
  padding: 10px 12px;
  background: rgba(31, 19, 51, 0.95);
  border: 1px solid var(--border-medium);
  border-radius: 10px;
  color: var(--text-primary);
  text-decoration: none;
  z-index: 9999;
}

.skip-link:focus {
  top: 16px;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: var(--space-lg) 0 var(--space-md);
  padding: 12px 14px;
  background: rgba(42, 31, 66, 0.55);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
}

.breadcrumb a {
  color: var(--lavender-bright);
  text-decoration: none;
  font-weight: 650;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb strong {
  color: var(--text-primary);
}

.breadcrumb span {
  color: var(--text-dim);
}

/* Hero */
.hero {
  padding: var(--space-xl) 0 var(--space-md);
}

.byline {
  color: var(--text-dim);
  margin-top: var(--space-xs);
}

/* Cards */
.card {
  background: rgba(42, 31, 66, 0.55);
  border: 1px solid var(--border-subtle);
  border-radius: 22px;
  padding: var(--space-lg);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}

.inset {
  margin-top: var(--space-md);
  padding: var(--space-md);
  background: rgba(21, 10, 36, 0.5);
}

.callout {
  margin: var(--space-md) 0;
  padding: var(--space-md);
  border-radius: 16px;
  border: 1px solid var(--border-medium);
  background: rgba(124, 94, 184, 0.08);
  position: relative;
  overflow: hidden;
}

.callout::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--purple-300), var(--pink-bright));
}

.callout strong {
  color: var(--lavender-bright);
}

/* Actions / Buttons */
.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: var(--space-md);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.01em;
  border: 1px solid var(--border-medium);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);

  position: relative;
  overflow: hidden;
}

.btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.25), rgba(240, 171, 252, 0.18));
  color: var(--text-primary);
}

.btn-ghost {
  background: rgba(21, 10, 36, 0.45);
  color: var(--lavender-bright);
}

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-sm);
  margin: var(--space-md) 0 var(--space-xl);
}

.stat {
  background: rgba(42, 31, 66, 0.45);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: var(--space-md);
}

.stat-num {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  color: var(--lavender-bright);
  margin-bottom: 6px;
}

.stat-title {
  color: var(--text-primary);
  font-weight: 750;
  margin-bottom: 4px;
}

.stat-text {
  color: var(--text-muted);
}

/* Grids */
.grid-2 {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: var(--space-lg);
  align-items: start;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.stack > * + * {
  margin-top: var(--space-sm);
}

/* Media */
.media-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 18px;
  border: 1px solid var(--border-subtle);
  background: rgba(13, 6, 24, 0.6);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.media-img:hover {
  transform: scale(1.02);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.5);
}

/* Lists */
.steps-list {
  margin-left: 18px;
  color: var(--text-muted);
  line-height: 1.8;
}

.steps-list li + li {
  margin-top: 8px;
}

.bullets {
  list-style: none;
  padding-left: 0;
  margin-top: var(--space-sm);
}

.bullets li {
  position: relative;
  padding-left: 18px;
  color: var(--text-muted);
  line-height: 1.9;
}

.bullets li::before {
  content: "•";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--pink-bright);
}

/* Steps */
.step-card {
  background: rgba(21, 10, 36, 0.45);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: var(--space-md);
  transition: all 0.3s ease;
}

.step-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-bright);
  background: rgba(31, 19, 51, 0.65);
}

.step-badge {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  color: var(--text-primary);
  background: rgba(240, 171, 252, 0.18);
  border: 1px solid var(--border-medium);
  transition: all 0.3s ease;
}

.step-card:hover .step-badge {
  background: rgba(240, 171, 252, 0.3);
  transform: scale(1.1);
}

/* CTA (fixed missing brace + formatting) */
.cta {
  text-align: center;
  background:
    radial-gradient(ellipse 120% 80% at 50% 0%, rgba(124, 94, 184, 0.18), transparent 55%),
    rgba(42, 31, 66, 0.55);
  padding: var(--space-sm);
  border-radius: 18px;
  border: 1px solid var(--border-subtle);
}

/* Footer */
.site-footer {
  margin: var(--space-xl) 0 var(--space-xl);
  padding: var(--space-lg);
  border-radius: 22px;
  border: 1px solid var(--border-subtle);
  background: rgba(21, 10, 36, 0.65);
}

.site-footer a {
  color: var(--lavender-bright);
  text-decoration: none;
  transition: color 0.2s ease;
}

.site-footer a:hover {
  text-decoration: underline;
}

.fineprint {
  margin-top: var(--space-sm);
  color: var(--text-dim);
  font-size: 0.95rem;
}

/* ========================================
   Animations
   ======================================== */

@keyframes shimmer {
  0%,
  100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes float {
  0%,
  100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Scroll reveal animations */
.card,
.hero {
  animation: fadeInUp 0.6s ease-out;
}

.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.2s; }

/* ========================================
   Enhanced Component Styles
   ======================================== */

.content-column,
.media-column {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* Hero title image enhancement (kept) */
.hero-title-image:hover {
  transform: translateY(0) scale(1.03);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.55),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* Better focus states for accessibility */
a:focus-visible,
button:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--purple-300);
  outline-offset: 4px;
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 980px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .grid-4 { grid-template-columns: 1fr; }
  .card { padding: var(--space-md); }
  .btn { width: 100%; }
  .hero { padding: var(--space-lg) 0; }
  .actions { flex-direction: column; }
  .actions .btn { width: 100%; }
}

/* Reduce animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html { scroll-behavior: auto; }
}

