/*
 * Puppy of the Month — shared design system
 *
 * Every public page links this file first. It owns the design tokens,
 * base typography, and the shared components (site header, footer,
 * buttons, cards, badges, form fields, states). Page-specific styles
 * live in each page's own stylesheet and must use these tokens rather
 * than hard-coded colors.
 */

@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");

/* ---------------------------------------------------------------- tokens */
:root {
  /* Brand */
  --brand-50:  #FFF4EE;
  --brand-100: #FFE3D4;
  --brand-200: #FFC3A6;
  --brand-400: #FF8A5B;
  --brand-500: #F2643D;
  --brand-600: #E5482A;
  --brand-700: #BF3518;
  --honey-100: #FFF1CC;
  --honey-400: #F6B93B;
  --honey-600: #C98A0B;
  --sage-100:  #DFF3E8;
  --sage-600:  #23855A;
  --sky-100:   #E3EEFF;
  --sky-600:   #2F5FD0;
  --rose-100:  #FDE2E4;
  --rose-600:  #C2334A;

  /* Neutrals (warm) */
  --ink-900: #1E1914;
  --ink-700: #3D352D;
  --ink-500: #6B6157;
  --ink-400: #8F857A;
  --line:    #EADFD3;
  --line-strong: #D9CBBB;
  --cream:   #FFF8F1;
  --paper:   #FFFFFF;
  --sand:    #FBF1E6;

  /* Semantic */
  --bg: var(--cream);
  --surface: var(--paper);
  --surface-muted: var(--sand);
  --text: var(--ink-900);
  --text-muted: var(--ink-500);
  --text-subtle: var(--ink-400);
  --primary: var(--brand-600);
  --primary-hover: var(--brand-700);
  --primary-soft: var(--brand-50);
  --on-primary: #FFFFFF;
  --accent: var(--honey-400);
  --success: var(--sage-600);
  --success-soft: var(--sage-100);
  --info: var(--sky-600);
  --info-soft: var(--sky-100);
  --danger: var(--rose-600);
  --danger-soft: var(--rose-100);
  --warning: var(--honey-600);
  --warning-soft: var(--honey-100);
  --focus-ring: 0 0 0 3px rgba(229, 72, 42, 0.35);

  /* Gradients */
  --gradient-brand: linear-gradient(135deg, var(--brand-400) 0%, var(--brand-600) 100%);
  --gradient-hero: radial-gradient(1200px 500px at 85% -10%, rgba(246, 185, 59, 0.28), transparent 60%),
                   radial-gradient(900px 500px at -10% 110%, rgba(255, 138, 91, 0.22), transparent 60%),
                   var(--cream);

  /* Type */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.375rem;
  --fs-2xl: clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem);
  --fs-3xl: clamp(2.1rem, 1.4rem + 3vw, 3.5rem);
  --lh-tight: 1.15;
  --lh-body: 1.6;

  /* Space, radius, shadow */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(30, 25, 20, 0.06), 0 1px 1px rgba(30, 25, 20, 0.04);
  --shadow-md: 0 6px 18px -6px rgba(30, 25, 20, 0.14), 0 2px 6px rgba(30, 25, 20, 0.05);
  --shadow-lg: 0 24px 48px -16px rgba(30, 25, 20, 0.22);
  --shadow-brand: 0 10px 24px -8px rgba(229, 72, 42, 0.45);

  --container: 1160px;
  --header-h: 68px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  /* Infinite loops would flicker at 0.01ms; stop them outright. */
  .skeleton, .badge--live::before { animation: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--lh-tight);
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0 0 var(--space-3);
}
h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
p  { margin: 0 0 var(--space-4); }

a { color: var(--primary); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--primary-hover); }

img { max-width: 100%; height: auto; display: block; }

:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }

::selection { background: var(--brand-200); color: var(--ink-900); }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: var(--space-4); top: -60px; z-index: 1000;
  background: var(--ink-900); color: #fff; padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm); text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: var(--space-3); color: #fff; }

/* ------------------------------------------------------------- layout */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--space-4); }
@media (min-width: 768px) { .container { padding-inline: var(--space-6); } }

.section { padding-block: var(--space-7); }
@media (min-width: 768px) { .section { padding-block: var(--space-8); } }

.section-head { max-width: 680px; margin: 0 auto var(--space-6); text-align: center; }
.section-head p { color: var(--text-muted); font-size: var(--fs-lg); margin: 0; }

.eyebrow {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-family: var(--font-body); font-size: var(--fs-xs); font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--primary);
  margin-bottom: var(--space-3);
}

.grid { display: grid; gap: var(--space-5); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }

.stack > * + * { margin-top: var(--space-4); }
.muted { color: var(--text-muted); }
.center { text-align: center; }

/* -------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 248, 241, 0.86);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex; align-items: center; gap: var(--space-4);
  height: var(--header-h);
}
.brand {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-family: var(--font-display); font-weight: 700; font-size: 1.2rem;
  color: var(--text); text-decoration: none; white-space: nowrap;
}
.brand:hover { color: var(--text); }
.brand img, .brand svg { width: 34px; height: 34px; border-radius: 9px; }

.site-nav { display: none; align-items: center; gap: var(--space-1); margin-left: auto; }
.site-nav a {
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-pill);
  color: var(--ink-700); font-weight: 600; font-size: var(--fs-sm); text-decoration: none;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.site-nav a:hover { background: var(--surface-muted); color: var(--text); }
.site-nav a[aria-current="page"], .site-nav a.active { background: var(--primary-soft); color: var(--primary); }

.site-header__actions { display: flex; align-items: center; gap: var(--space-2); margin-left: auto; }
.site-header__actions .btn-sm { min-height: 44px; }

.nav-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  cursor: pointer; font-size: 1.05rem;
}

.mobile-nav {
  display: none; border-top: 1px solid var(--line); background: var(--surface);
  padding: var(--space-3) var(--space-4) var(--space-5);
}
.mobile-nav.open { display: block; }
.mobile-nav a {
  display: block; padding: var(--space-3) var(--space-2); border-bottom: 1px solid var(--line);
  color: var(--text); font-weight: 600; text-decoration: none;
}
.mobile-nav a:last-child { border-bottom: 0; }

@media (min-width: 960px) {
  .site-nav { display: flex; }
  .site-nav + .site-header__actions { margin-left: var(--space-3); }
  .site-header__actions .btn-sm { min-height: 36px; }
  .nav-toggle, .mobile-nav, .mobile-nav.open { display: none; }
}
@media (max-width: 400px) {
  .site-header__inner { gap: var(--space-2); }
  .brand { font-size: 1rem; gap: 6px; flex-shrink: 0; }
  .brand img, .brand svg { width: 30px; height: 30px; }
  .site-header__actions { gap: 6px; }
  .site-header__actions .btn-sm { padding-inline: 0.75rem; }
}

/* ------------------------------------------------------------- buttons */
.btn {
  --btn-bg: var(--surface); --btn-fg: var(--text); --btn-border: var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 44px; padding: 0.65rem 1.25rem;
  border-radius: var(--radius-pill); border: 1.5px solid var(--btn-border);
  background: var(--btn-bg); color: var(--btn-fg);
  font: 700 var(--fs-sm)/1 var(--font-body); letter-spacing: 0.01em;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease), background 0.15s var(--ease);
}
.btn:hover { color: var(--btn-fg); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }
.btn[disabled], .btn.is-disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-primary { --btn-bg: var(--primary); --btn-fg: var(--on-primary); --btn-border: var(--primary); box-shadow: var(--shadow-brand); }
.btn-primary:hover { --btn-bg: var(--primary-hover); --btn-border: var(--primary-hover); box-shadow: var(--shadow-brand); }
.btn-dark { --btn-bg: var(--ink-900); --btn-fg: #fff; --btn-border: var(--ink-900); }
.btn-ghost { --btn-bg: transparent; --btn-border: transparent; }
.btn-ghost:hover { --btn-bg: var(--surface-muted); box-shadow: none; }
.btn-lg { min-height: 52px; padding: 0.85rem 1.6rem; font-size: var(--fs-base); }
.btn-sm { min-height: 36px; padding: 0.45rem 0.9rem; font-size: var(--fs-xs); }
.btn-block { width: 100%; }

/* --------------------------------------------------------------- cards */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: var(--space-5); box-shadow: var(--shadow-sm);
}
.card--hover { transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease); }
.card--hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card h3 { margin-bottom: var(--space-2); }
.card p:last-child { margin-bottom: 0; }

.icon-tile {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 14px; margin-bottom: var(--space-4);
  background: var(--primary-soft); color: var(--primary); font-size: 1.25rem;
}
.icon-tile--honey { background: var(--honey-100); color: var(--honey-600); }
.icon-tile--sage  { background: var(--success-soft); color: var(--success); }
.icon-tile--sky   { background: var(--info-soft); color: var(--info); }

.stat { display: flex; flex-direction: column; gap: 2px; }
.stat__value { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-2xl); line-height: 1.1; }
.stat__label { font-size: var(--fs-sm); color: var(--text-muted); font-weight: 600; }

/* -------------------------------------------------------------- badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: var(--radius-pill);
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.02em;
  background: var(--surface-muted); color: var(--ink-700); border: 1px solid var(--line);
}
.badge--brand   { background: var(--primary-soft); color: var(--primary); border-color: var(--brand-100); }
.badge--success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge--honey   { background: var(--honey-100); color: var(--honey-600); border-color: transparent; }
.badge--live::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor;
  animation: pulse-dot 1.6s infinite;
}
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* --------------------------------------------------------------- forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--space-4); }
.field label, .label { font-size: var(--fs-sm); font-weight: 700; color: var(--ink-700); }
.input, .field input, .field select, .field textarea {
  width: 100%; min-height: 46px; padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-md);
  background: var(--surface); color: var(--text); font: inherit;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.input:focus, .field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: var(--focus-ring);
}
.field small, .hint { color: var(--text-subtle); font-size: var(--fs-xs); }

/* -------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th {
  text-align: left; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); background: var(--surface-muted); padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--line);
}
.table td { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------- page states */
.state {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  gap: var(--space-2); padding: var(--space-7) var(--space-4);
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius-lg); background: var(--surface);
  color: var(--text-muted);
}
.state__icon { font-size: 2rem; color: var(--brand-400); }
.state h3 { color: var(--text); margin: 0; }
.state--error { border-color: var(--rose-100); background: #FFF7F8; }
.state--error .state__icon { color: var(--danger); }

.skeleton {
  background: linear-gradient(90deg, var(--sand) 0%, #fff 50%, var(--sand) 100%);
  background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: var(--radius-md);
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.alert {
  display: flex; gap: var(--space-3); align-items: flex-start;
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); font-size: var(--fs-sm);
  background: var(--info-soft); color: var(--info);
}
.alert--success { background: var(--success-soft); color: var(--success); }
.alert--warning { background: var(--warning-soft); color: var(--warning); }
.alert--danger  { background: var(--danger-soft); color: var(--danger); }

/* --------------------------------------------------------- page hero */
.page-hero { background: var(--gradient-hero); padding: var(--space-7) 0 var(--space-6); border-bottom: 1px solid var(--line); }
.page-hero h1 { max-width: 780px; }
.page-hero p { max-width: 640px; color: var(--text-muted); font-size: var(--fs-lg); }
.page-hero--center { text-align: center; }
.page-hero--center h1, .page-hero--center p { margin-inline: auto; }

/* -------------------------------------------------------------- footer */
.site-footer { background: var(--ink-900); color: #CFC6BC; margin-top: var(--space-8); padding: var(--space-7) 0 var(--space-5); font-size: var(--fs-sm); }
.site-footer a { color: #EDE6DE; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer .brand { color: #fff; margin-bottom: var(--space-3); }
.site-footer__grid { display: grid; gap: var(--space-5); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.site-footer__grid > :first-child { grid-column: 1 / -1; }
.site-footer__grid > :first-child p { max-width: 280px; margin: 0 0 var(--space-3); }
@media (max-width: 959px) {
  .site-footer ul { gap: 0; }
  .site-footer ul a, .site-footer__grid > :first-child > a:last-child { display: inline-flex; align-items: center; min-height: 44px; }
}
@media (min-width: 960px) {
  .site-footer__grid { gap: var(--space-6); grid-template-columns: minmax(240px, 1.5fr) repeat(4, minmax(0, 1fr)); }
  .site-footer__grid > :first-child { grid-column: auto; }
}
.site-footer h4 { font-family: var(--font-body); color: #fff; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: var(--space-3); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.site-footer__bottom {
  display: flex; flex-wrap: wrap; gap: var(--space-3); justify-content: space-between;
  margin-top: var(--space-6); padding-top: var(--space-5); border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: #A39A90; font-size: var(--fs-xs);
}
