/* ========================================
   PrezPetz — Styles
   Deliberately archival. Warm paper tones,
   oxblood/green/gold palette, serif display,
   clean sans for labels.
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Archivo:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;0,9..144,700;1,9..144,400;1,9..144,500&display=swap');

:root {
  --cream: #faf6ee;
  --paper: #f3ead7;
  --dark: #2b2118;
  --muted: #6b5d4e;
  --oxblood: #7a2e1d;
  --green: #3f5d3a;
  --gold: #b98a2f;
  --light-gold: #f3e7c8;
  --light-green: #e3ebdd;
  --light-ink: #f0e2cd;
  --line: #d4c8b4;
  --line-light: #ece4d2;
  --sticker-bg: #fdfbf7;
  --white: #ffffff;
  --shadow: rgba(43, 33, 24, 0.08);

  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-sans: 'Archivo', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;

  --rarity-common: #8a7a66;
  --rarity-uncommon: #3f5d3a;
  --rarity-rare: #b98a2f;
  --rarity-legendary: #7a2e1d;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: #e8dcc3;
  font-family: var(--font-sans);
  color: var(--dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ===== Layout ===== */
.container {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 20px;
}
.container-wide {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== Site Header ===== */
.site-header {
  background: var(--dark);
  color: var(--cream);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.site-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--gold);
  text-decoration: none;
  letter-spacing: 0.04em;
}
.site-logo:hover { color: var(--light-gold); }
.site-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.site-nav a {
  color: #b8a88a;
  text-decoration: none;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}
.site-nav a:hover {
  background: rgba(255,255,255,0.08);
  color: var(--cream);
}

/* ===== Sticker Strip (header) ===== */
.sticker-strip {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #b8a88a;
}
.sticker-strip-bar {
  width: 60px;
  height: 4px;
  background: #5a4a36;
  border-radius: 2px;
  overflow: hidden;
}
.sticker-strip-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* ===== Breadcrumb ===== */
.breadcrumb {
  font-size: 12px;
  padding: 14px 0 0;
  color: var(--muted);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--green); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* ===== Fact Box (baseball card) ===== */
.fact-box {
  margin: 16px 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  overflow: hidden;
  position: relative;
}
.fact-box .portrait {
  width: 180px;
  min-height: 220px;
  background: var(--light-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-right: 1px solid var(--line);
}
.fact-box .portrait-placeholder {
  width: 120px;
  height: 150px;
  background: #dccfc0;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
  padding: 8px;
}
.fact-box .info {
  padding: 16px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.fact-box .info h1 {
  margin: 0 0 2px;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--oxblood);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.fact-box .info .subtitle {
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 6px;
}
.fact-box .info .stats {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 12px;
  font-size: 13px;
  margin-top: auto;
}
.fact-box .info .stats .lbl { color: var(--muted); font-weight: 500; }
.fact-box .info .stats .val { color: var(--dark); }
.fact-box .rarity-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 600;
}
.rarity-badge.common { background: #e8e0d4; color: #5a4a36; border: 1px solid var(--rarity-common); }
.rarity-badge.uncommon { background: var(--light-green); color: #2a4a24; border: 1px solid var(--rarity-uncommon); }
.rarity-badge.rare { background: var(--light-gold); color: #805d1a; border: 1px solid var(--rarity-rare); }
.rarity-badge.legendary { background: #f0e2cd; color: var(--oxblood); border: 1px solid var(--rarity-legendary); }

/* ===== Bio ===== */
.bio {
  padding: 8px 0 4px;
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.7;
  color: var(--dark);
  font-weight: 400;
}
.bio p {
  margin: 0 0 14px;
}
.bio .stub-note {
  background: var(--light-green);
  border: 1px solid #c8d8c0;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
  font-family: var(--font-sans);
  color: #2a4a24;
  margin-bottom: 14px;
}

/* ===== Quick Facts ===== */
.quick-facts {
  margin: 8px 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--cream);
}
.quick-facts table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.quick-facts th {
  background: var(--paper);
  padding: 8px 14px;
  text-align: left;
  font-weight: 600;
  color: var(--oxblood);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.quick-facts td {
  padding: 7px 14px;
  border-bottom: 1px solid var(--line-light);
}
.quick-facts tr:last-child td { border: none; }
.quick-facts td:first-child { font-weight: 500; color: var(--muted); width: 120px; }

/* ===== Sections ===== */
.section-header {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--oxblood);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 20px 0 8px;
  padding: 0 0 4px;
  border-bottom: 1px solid var(--line-light);
}

/* ===== Sticker Reveal ===== */
.sticker-reveal {
  margin: 4px 0 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  background: var(--sticker-bg);
  border: 1px dashed var(--line);
  border-radius: 10px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.sticker-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.sticker-reveal .sticker-frame {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid;
  position: relative;
  overflow: hidden;
}
.sticker-reveal .sticker-frame svg {
  width: 100%;
  height: 100%;
  display: block;
}
.sticker-reveal .sticker-text {
  flex: 1;
}
.sticker-reveal .sticker-text .earned {
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}
.sticker-reveal .sticker-text .earned.rarity-common { color: var(--rarity-common); }
.sticker-reveal .sticker-text .earned.rarity-uncommon { color: var(--rarity-uncommon); }
.sticker-reveal .sticker-text .earned.rarity-rare { color: var(--rarity-rare); }
.sticker-reveal .sticker-text .earned.rarity-legendary { color: var(--rarity-legendary); }
.sticker-reveal .sticker-text .sticker-name { font-size: 14px; font-weight: 600; color: var(--dark); }
.sticker-reveal .sticker-text .sticker-subtitle { font-size: 11px; color: var(--muted); }
.sticker-reveal .sticker-text .sticker-hint {
  font-size: 11px;
  color: #a09080;
  font-style: italic;
}

/* ===== Cross-links ===== */
.cross-links {
  margin: 12px 0 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.cross-link {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}
.cross-link h3 {
  margin: 0 0 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--oxblood);
}
.cross-link ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.cross-link li {
  font-size: 13px;
  padding: 3px 0;
  border-bottom: 1px solid var(--line-light);
}
.cross-link li:last-child { border: none; }
.cross-link li a { color: var(--green); text-decoration: none; }
.cross-link li a:hover { text-decoration: underline; }
.cross-link .more {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
}
.cross-link .more a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--line); }

/* ===== Sources ===== */
.sources {
  margin: 12px 0 24px;
  font-size: 11px;
  color: var(--muted);
}
.sources h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 6px;
}
.sources ol { margin: 0; padding-left: 18px; }
.sources li { margin-bottom: 2px; }
.sources a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--line); }

/* ===== Site Footer ===== */
.site-footer {
  background: var(--dark);
  color: #b8a88a;
  padding: 20px;
  text-align: center;
  font-size: 11px;
  margin-top: 40px;
}
.site-footer a { color: var(--gold); text-decoration: none; }

/* ===== Home Page ===== */
.hero {
  text-align: center;
  padding: 60px 20px 40px;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: 40px;
  color: var(--oxblood);
  margin: 0 0 10px;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.hero .tagline {
  font-size: 16px;
  color: var(--muted);
  max-width: 500px;
  margin: 0 auto 6px;
  font-family: var(--font-display);
  font-style: italic;
}
.hero .sub-tagline {
  font-size: 13px;
  color: var(--muted);
  max-width: 480px;
  margin: 0 auto;
}

.browse-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 24px 0;
}
.browse-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  text-decoration: none;
  color: var(--dark);
  transition: transform 0.2s, box-shadow 0.2s;
}
.browse-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow);
}
.browse-card .icon { font-size: 32px; margin-bottom: 8px; }
.browse-card h3 {
  font-family: var(--font-display);
  font-size: 16px;
  margin: 0 0 4px;
  color: var(--oxblood);
}
.browse-card p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}
.browse-card .count {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
}

/* ===== Browse Pages ===== */
.browse-page-header {
  padding: 20px 0 4px;
}
.browse-page-header h1 {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--oxblood);
  margin: 0 0 4px;
}
.browse-page-header p {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}

.pet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin: 20px 0;
}
.pet-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  text-decoration: none;
  color: var(--dark);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.pet-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow);
}
.pet-card .mini-portrait {
  width: 80px;
  height: 80px;
  background: var(--light-ink);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  font-size: 10px;
  color: var(--muted);
}
.pet-card .pet-name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--oxblood);
}
.pet-card .pet-detail {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.pet-card .pet-rarity {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 4px;
  font-weight: 600;
}
.pet-rarity.common { color: var(--rarity-common); }
.pet-rarity.uncommon { color: var(--rarity-uncommon); }
.pet-rarity.rare { color: var(--rarity-rare); }
.pet-rarity.legendary { color: var(--rarity-legendary); }

/* ===== Timeline ===== */
.timeline {
  overflow-x: auto;
  padding: 20px 0 40px;
  margin: 20px 0;
}
.timeline-track {
  position: relative;
  height: 120px;
  min-width: 1200px;
}
.timeline-track::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--line);
}
.timeline-marker {
  position: absolute;
  top: 50%;
  transform: translateX(-50%);
  text-align: center;
}
.timeline-marker .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--cream);
  margin: 0 auto 6px;
  position: relative;
  z-index: 1;
}
.timeline-marker .year {
  font-size: 11px;
  font-weight: 600;
  color: var(--dark);
}
.timeline-marker .label {
  font-size: 9px;
  color: var(--muted);
  margin-top: 2px;
  max-width: 80px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== Album Page ===== */
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  margin: 20px 0;
}
.album-slot {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  position: relative;
}
.album-slot .sticker-mini {
  width: 50px;
  height: 50px;
  margin: 0 auto 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid;
}
.album-slot .sticker-mini svg { width: 100%; height: 100%; }
.album-slot .sticker-label {
  font-size: 10px;
  color: var(--muted);
  font-weight: 500;
}
.album-slot.unearned {
  opacity: 0.4;
  filter: grayscale(1);
}
.album-slot.unearned .sticker-mini {
  border-color: var(--line);
  background: #e8e0d4;
}
.album-slot.earned .sticker-mini {
  border-color: var(--line);
}
.album-progress {
  text-align: center;
  padding: 20px 0;
}
.album-progress .count {
  font-family: var(--font-display);
  font-size: 32px;
  color: var(--oxblood);
}
.album-progress .label {
  font-size: 14px;
  color: var(--muted);
}

/* ===== Responsive ===== */
@media (max-width: 700px) {
  .fact-box { flex-direction: column; }
  .fact-box .portrait { width: 100%; min-height: 100px; border-right: none; border-bottom: 1px solid var(--line); }
  .cross-links { grid-template-columns: 1fr; }
  .browse-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 28px; }
}

/* ===== Utilities ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}