/* ============================================
   MatchSire — Horse Breeding Simulator
   Standing Stallions — ai.standingstallions.com
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-deep: #0a0a1a;
  --bg-card: #111127;
  --bg-card-hover: #1a1a3a;
  --gold: #d4a843;
  --gold-light: #e8c76a;
  --gold-dark: #b8922e;
  --silver: #c0c0c0;
  --silver-light: #e0e0e0;
  --teal: #00d4aa;
  --danger: #ef4444;
  --success: #4ade80;
  --warning: #f59e0b;
  --text: #f5f5f5;
  --text-muted: #6b7280;
  --text-dim: #4a4a6a;
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --border-radius: 12px;
  --glow-gold: 0 0 30px rgba(212, 168, 67, 0.3);
  --glow-teal: 0 0 20px rgba(0, 212, 170, 0.3);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); text-decoration: none; transition: color 0.3s; }
a:hover { color: var(--gold-light); }

h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 700; }

/* --- Navbar --- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(10, 10, 26, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(212, 168, 67, 0.1);
  transition: all 0.3s;
}

.navbar.scrolled {
  padding: 0.6rem 2rem;
  background: rgba(10, 10, 26, 0.95);
  border-bottom-color: rgba(212, 168, 67, 0.25);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.nav-brand-text {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--gold);
  letter-spacing: 0.5px;
}

.nav-brand-text span { color: var(--text); font-weight: 400; }

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  transition: color 0.3s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gold);
  transition: width 0.3s;
}

.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }

.nav-cta {
  padding: 0.5rem 1.25rem;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: var(--bg-deep) !important;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: all 0.3s;
}

.nav-cta:hover {
  box-shadow: var(--glow-gold);
  transform: translateY(-1px);
  color: var(--bg-deep) !important;
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 5px;
}

.nav-hamburger span {
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: all 0.3s;
}

/* --- Hero Section --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  padding: 2rem;
}

.hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at center, transparent 0%, var(--bg-deep) 75%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background: rgba(212, 168, 67, 0.1);
  border: 1px solid rgba(212, 168, 67, 0.3);
  border-radius: 50px;
  font-size: 0.8rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 2rem;
  opacity: 0;
}

.hero-badge .pulse {
  width: 8px;
  height: 8px;
  background: var(--gold);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.5); }
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1.1;
  margin-bottom: 1.5rem;
  opacity: 0;
}

.hero h1 .gold { color: var(--gold); }
.hero h1 .line { display: block; }

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 2.5rem;
  opacity: 0;
}

.hero-cta-group {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  opacity: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  border: none;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: var(--bg-deep);
}

.btn-primary:hover {
  box-shadow: var(--glow-gold);
  transform: translateY(-2px);
  color: var(--bg-deep);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-outline:hover {
  border-color: var(--gold);
  color: var(--gold);
  transform: translateY(-2px);
}

.hero-scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-dim);
  font-size: 0.75rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  animation: bobble 2s infinite;
}

@keyframes bobble {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--gold), transparent);
}

/* --- Section Styles --- */
.section {
  padding: 6rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-tag {
  display: inline-block;
  color: var(--gold);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 1rem;
  font-weight: 600;
}

.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 1rem;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* --- How It Works --- */
.how-it-works {
  position: relative;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  position: relative;
}

.step-card {
  background: var(--bg-card);
  border: 1px solid rgba(212, 168, 67, 0.1);
  border-radius: var(--border-radius);
  padding: 2.5rem 2rem;
  text-align: center;
  transition: all 0.4s;
  position: relative;
  overflow: hidden;
}

.step-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0;
  transition: opacity 0.4s;
}

.step-card:hover {
  transform: translateY(-5px);
  border-color: rgba(212, 168, 67, 0.3);
  box-shadow: var(--glow-gold);
}

.step-card:hover::before { opacity: 1; }

.step-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(212, 168, 67, 0.1);
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 1.2rem;
  color: var(--gold);
  margin: 0 auto 1.5rem;
}

.step-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.step-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.step-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* --- Simulator Section --- */
.simulator-section {
  padding: 6rem 2rem;
  position: relative;
}

.simulator-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at center, rgba(212, 168, 67, 0.03) 0%, transparent 70%);
  pointer-events: none;
}

.simulator-container {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Parent Selection */
.parent-selection {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 2rem;
  align-items: start;
  margin-bottom: 3rem;
}

.parent-card {
  background: var(--bg-card);
  border: 1px solid rgba(212, 168, 67, 0.15);
  border-radius: var(--border-radius);
  padding: 2rem;
  transition: all 0.3s;
}

.parent-card:hover {
  border-color: rgba(212, 168, 67, 0.3);
}

.parent-card.stallion { border-top: 3px solid var(--gold); }
.parent-card.mare { border-top: 3px solid var(--silver); }

.parent-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.parent-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.stallion .parent-icon { background: rgba(212, 168, 67, 0.15); }
.mare .parent-icon { background: rgba(192, 192, 192, 0.15); }

.parent-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
}

.parent-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
}

.stallion .parent-title { color: var(--gold); }
.mare .parent-title { color: var(--silver-light); }

.gene-group {
  margin-bottom: 1.25rem;
}

.gene-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.gene-label .info-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--text-dim);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  cursor: help;
  color: var(--text-dim);
  transition: all 0.3s;
}

.gene-label .info-icon:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.gene-select {
  width: 100%;
  padding: 0.65rem 1rem;
  background: rgba(10, 10, 26, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  appearance: none;
  cursor: pointer;
  transition: all 0.3s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.gene-select:hover { border-color: rgba(212, 168, 67, 0.3); }
.gene-select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212, 168, 67, 0.1); }

.gene-select option {
  background: var(--bg-deep);
  color: var(--text);
}

/* Center connector */
.breed-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding-top: 3rem;
}

.connector-line {
  width: 2px;
  height: 60px;
  background: linear-gradient(to bottom, var(--gold), var(--silver));
  border-radius: 1px;
}

.connector-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid rgba(212, 168, 67, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: all 0.3s;
}

/* Simulate Button */
.simulate-area {
  text-align: center;
  margin-bottom: 3rem;
}

.btn-simulate {
  padding: 1rem 3rem;
  font-size: 1.1rem;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold), var(--gold-light));
  background-size: 200% 200%;
  color: var(--bg-deep);
  border: none;
  border-radius: 12px;
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.4s;
  position: relative;
  overflow: hidden;
}

.btn-simulate::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
  transform: rotate(45deg);
  transition: all 0.6s;
}

.btn-simulate:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 40px rgba(212, 168, 67, 0.4);
  animation: shimmer 2s infinite;
}

.btn-simulate:hover::before {
  left: 100%;
}

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

.btn-simulate:active { transform: translateY(-1px); }

.btn-simulate:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* DNA Animation Overlay */
.dna-animation-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 10, 26, 0.92);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2rem;
}

.dna-animation-overlay.active { display: flex; }

.dna-animation-overlay canvas {
  max-width: 400px;
  max-height: 400px;
}

.dna-status-text {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--gold);
  letter-spacing: 2px;
  animation: fadeInOut 2s infinite;
}

@keyframes fadeInOut {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Results Panel */
.results-panel {
  display: none;
  background: var(--bg-card);
  border: 1px solid rgba(212, 168, 67, 0.2);
  border-radius: var(--border-radius);
  overflow: hidden;
  animation: slideUp 0.6s ease-out;
}

.results-panel.active { display: block; }

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

.results-header {
  background: linear-gradient(135deg, rgba(212, 168, 67, 0.1), rgba(0, 212, 170, 0.05));
  padding: 2rem;
  border-bottom: 1px solid rgba(212, 168, 67, 0.1);
  text-align: center;
}

.results-header h2 {
  font-size: 1.75rem;
  margin-bottom: 0.25rem;
}

.results-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.results-body {
  padding: 2rem;
}

.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

/* Foal Card */
.foal-card {
  background: rgba(10, 10, 26, 0.5);
  border: 1px solid rgba(212, 168, 67, 0.15);
  border-radius: var(--border-radius);
  padding: 2rem;
  text-align: center;
}

.foal-silhouette {
  width: 200px;
  height: 160px;
  margin: 0 auto 1.5rem;
  position: relative;
}

.foal-silhouette svg {
  width: 100%;
  height: 100%;
}

.foal-name {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.foal-genotype {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--gold);
  padding: 0.25rem 0.75rem;
  background: rgba(212, 168, 67, 0.1);
  border-radius: 4px;
  display: inline-block;
}

/* Probability Bars */
.prob-section {
  margin-bottom: 2rem;
}

.prob-section h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.prob-item {
  margin-bottom: 0.75rem;
}

.prob-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}

.prob-label span:last-child {
  font-family: var(--font-mono);
  color: var(--gold);
}

.prob-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
}

.prob-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0;
}

.prob-fill.bay { background: linear-gradient(90deg, #8B4513, #cd853f); }
.prob-fill.black { background: linear-gradient(90deg, #1a1a2e, #333); }
.prob-fill.chestnut { background: linear-gradient(90deg, #8B2500, #cd5c3c); }
.prob-fill.gold-fill { background: linear-gradient(90deg, var(--gold-dark), var(--gold)); }
.prob-fill.teal-fill { background: linear-gradient(90deg, #007a5e, var(--teal)); }

/* Health / Disease Risk */
.health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.health-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(10, 10, 26, 0.5);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.health-shield {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.health-shield.clear { background: rgba(74, 222, 128, 0.15); color: var(--success); }
.health-shield.carrier { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.health-shield.affected { background: rgba(239, 68, 68, 0.15); color: var(--danger); }

.health-info .health-name {
  font-size: 0.85rem;
  font-weight: 600;
}

.health-info .health-status {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Gait Section */
.gait-section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.gait-display {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.gait-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 200px;
  padding: 1rem;
  background: rgba(10, 10, 26, 0.5);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.gait-icon {
  font-size: 2rem;
  min-width: 40px;
  text-align: center;
}

.gait-name {
  font-weight: 600;
  font-size: 1rem;
}

.gait-prob {
  font-family: var(--font-mono);
  color: var(--teal);
  font-size: 0.9rem;
}

/* --- Punnett Square Section --- */
.punnett-section {
  padding: 6rem 2rem;
  background: linear-gradient(180deg, var(--bg-deep), rgba(17, 17, 39, 0.5), var(--bg-deep));
}

.punnett-container {
  max-width: 1000px;
  margin: 0 auto;
}

.punnett-controls {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.punnett-btn {
  padding: 0.5rem 1.25rem;
  background: rgba(212, 168, 67, 0.1);
  border: 1px solid rgba(212, 168, 67, 0.3);
  border-radius: 8px;
  color: var(--gold);
  font-family: var(--font-body);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s;
}

.punnett-btn:hover, .punnett-btn.active {
  background: rgba(212, 168, 67, 0.2);
  border-color: var(--gold);
}

.punnett-grid-wrapper {
  display: flex;
  justify-content: center;
}

.punnett-grid {
  display: grid;
  grid-template-columns: auto repeat(2, 1fr);
  grid-template-rows: auto repeat(2, 1fr);
  gap: 4px;
  max-width: 400px;
  width: 100%;
}

.punnett-cell {
  padding: 1.25rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  border-radius: 8px;
  transition: all 0.3s;
}

.punnett-header {
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
}

.punnett-header.stallion-header { color: var(--gold); }
.punnett-header.mare-header { color: var(--silver); }

.punnett-result {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  position: relative;
}

.punnett-result:hover {
  border-color: var(--gold);
  transform: scale(1.05);
  z-index: 1;
}

.punnett-result .genotype {
  font-size: 1rem;
  font-weight: 700;
}

.punnett-result .phenotype {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.punnett-result .pct {
  font-size: 0.75rem;
  color: var(--teal);
  margin-top: 0.15rem;
}

.punnett-corner { background: transparent; }

.punnett-legend {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* --- Foal Gallery --- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.gallery-item {
  background: var(--bg-card);
  border: 1px solid rgba(212, 168, 67, 0.1);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s;
  cursor: default;
}

.gallery-item:hover {
  border-color: rgba(212, 168, 67, 0.3);
  transform: translateY(-3px);
}

.gallery-horse {
  width: 120px;
  height: 100px;
  margin: 0 auto 1rem;
}

.gallery-horse svg { width: 100%; height: 100%; }

.gallery-color {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.gallery-genotype {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--gold);
}

.gallery-prob {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  color: var(--teal);
  margin-top: 0.5rem;
}

/* Compatibility Score */
.compat-ring-container {
  display: flex;
  justify-content: center;
  margin: 2rem 0;
}

.compat-ring {
  position: relative;
  width: 180px;
  height: 180px;
}

.compat-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.compat-ring .ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.05);
  stroke-width: 8;
}

.compat-ring .ring-fill {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.compat-score {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.compat-number {
  font-family: var(--font-mono);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--gold);
}

.compat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* --- Footer --- */
.footer {
  border-top: 1px solid rgba(212, 168, 67, 0.1);
  padding: 4rem 2rem 2rem;
  background: rgba(10, 10, 26, 0.5);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
}

.footer-brand .brand-name {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--gold);
  margin-bottom: 0.75rem;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
  max-width: 400px;
}

.footer-col h4 {
  color: var(--text);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 1rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 0.5rem;
}

.footer-col a {
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color 0.3s;
}

.footer-col a:hover { color: var(--gold); }

.footer-bottom {
  max-width: 1200px;
  margin: 3rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-bottom p {
  color: var(--text-dim);
  font-size: 0.8rem;
}

.footer-standing-stallions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: color 0.3s;
}

.footer-standing-stallions:hover { color: var(--gold); }

/* --- Sound Toggle --- */
.sound-toggle {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid rgba(212, 168, 67, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 999;
  transition: all 0.3s;
  font-size: 1.1rem;
}

.sound-toggle:hover {
  border-color: var(--gold);
  box-shadow: var(--glow-gold);
}

/* --- Tooltip --- */
.tooltip {
  position: absolute;
  background: var(--bg-card);
  border: 1px solid rgba(212, 168, 67, 0.3);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  color: var(--text);
  max-width: 250px;
  z-index: 3000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.tooltip.visible { opacity: 1; }

/* --- Loading Shimmer --- */
@keyframes shimmerLoad {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.loading-shimmer {
  background: linear-gradient(90deg, var(--bg-card), var(--bg-card-hover), var(--bg-card));
  background-size: 200% 100%;
  animation: shimmerLoad 1.5s infinite;
}

/* --- Mobile Responsive --- */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(10, 10, 26, 0.98);
    padding: 1.5rem 2rem;
    gap: 1rem;
    border-bottom: 1px solid rgba(212, 168, 67, 0.1);
  }

  .steps-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .parent-selection {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .breed-connector {
    flex-direction: row;
    padding-top: 0;
  }

  .connector-line {
    width: 60px;
    height: 2px;
    background: linear-gradient(to right, var(--gold), var(--silver));
  }

  .results-grid {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero h1 { font-size: 2.2rem; }
  .section { padding: 4rem 1.5rem; }
}

@media (max-width: 600px) {
  .navbar { padding: 0.75rem 1rem; }
  .hero { min-height: 90vh; padding: 1.5rem; }
  .hero h1 { font-size: 1.8rem; }
  .hero-subtitle { font-size: 0.95rem; }
  .btn { padding: 0.7rem 1.5rem; font-size: 0.9rem; }
  .btn-simulate { padding: 0.85rem 2rem; font-size: 1rem; }
  .punnett-cell { padding: 0.75rem; font-size: 0.9rem; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
}

/* --- Accessibility --- */
@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;
  }
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ═══════════════════════════════════════════
   DOCUMENT UPLOAD & OCR SECTION
   ═══════════════════════════════════════════ */

.upload-section {
  padding: 6rem 2rem;
  background: linear-gradient(180deg, var(--bg-deep), rgba(17, 17, 39, 0.3), var(--bg-deep));
  position: relative;
}

.upload-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(0, 212, 170, 0.03) 0%, transparent 60%);
  pointer-events: none;
}

.upload-container {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Moat badge */
.moat-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background: rgba(0, 212, 170, 0.08);
  border: 1px solid rgba(0, 212, 170, 0.25);
  border-radius: 50px;
  font-size: 0.78rem;
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 1rem;
}

.moat-badge .lock-icon { font-size: 0.9rem; }

/* Target selection (stallion/mare) */
.upload-target-row {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.target-btn {
  padding: 0.5rem 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s;
}

.target-btn:hover { border-color: rgba(212, 168, 67, 0.3); color: var(--text); }

.target-btn.active {
  border-color: var(--gold);
  background: rgba(212, 168, 67, 0.1);
  color: var(--gold);
}

.target-btn.active.stallion-target { border-color: var(--gold); color: var(--gold); }
.target-btn.active.mare-target { border-color: var(--silver); color: var(--silver-light); }

/* Document type tabs */
.doc-type-row {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.doc-type-btn {
  padding: 0.6rem 1.25rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.doc-type-btn:hover { border-color: rgba(0, 212, 170, 0.3); color: var(--text); }

.doc-type-btn.active {
  border-color: var(--teal);
  background: rgba(0, 212, 170, 0.08);
  color: var(--teal);
}

.doc-type-btn .doc-icon { font-size: 1.1rem; }

.doc-type-hint {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
  margin-bottom: 2rem;
  min-height: 1.2rem;
}

/* ── Dropzone ── */
.upload-dropzone {
  position: relative;
  border: 2px dashed rgba(212, 168, 67, 0.25);
  border-radius: 16px;
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.4s;
  background: rgba(17, 17, 39, 0.5);
  overflow: hidden;
}

.upload-dropzone::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at center, rgba(212, 168, 67, 0.02), transparent 70%);
  transition: all 0.4s;
}

.upload-dropzone:hover {
  border-color: rgba(212, 168, 67, 0.5);
  background: rgba(17, 17, 39, 0.7);
}

.upload-dropzone:hover::before {
  background: radial-gradient(circle at center, rgba(212, 168, 67, 0.05), transparent 70%);
}

.upload-dropzone.dragover {
  border-color: var(--teal);
  border-style: solid;
  background: rgba(0, 212, 170, 0.05);
  transform: scale(1.01);
}

.upload-dropzone.dragover::before {
  background: radial-gradient(circle at center, rgba(0, 212, 170, 0.08), transparent 70%);
}

.upload-dropzone.has-file {
  border-style: solid;
  border-color: rgba(212, 168, 67, 0.3);
}

.upload-dropzone.error {
  border-color: var(--danger);
  animation: shake 0.4s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.dropzone-content {
  position: relative;
  z-index: 1;
}

.dropzone-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}

.dropzone-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.dropzone-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.dropzone-formats {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.format-tag {
  padding: 0.2rem 0.6rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.dropzone-size-hint {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-dim);
}

#upload-error {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 0.5rem;
  min-height: 1.2rem;
}

.upload-dropzone.has-file .dropzone-content { display: none; }

/* ── File Preview ── */
.file-preview-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(10, 10, 26, 0.5);
  border: 1px solid rgba(212, 168, 67, 0.15);
  border-radius: 10px;
  text-align: left;
  position: relative;
  z-index: 1;
}

.file-preview-icon {
  font-size: 2rem;
  min-width: 40px;
  text-align: center;
}

.file-preview-info { flex: 1; }

.file-preview-name {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}

.file-preview-meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

.file-preview-remove {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.file-preview-remove:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--danger);
}

.file-preview-thumb {
  margin-top: 1rem;
  height: 200px;
  border-radius: 8px;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  background-color: rgba(10, 10, 26, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
  z-index: 1;
}

/* Extract Button */
#extract-btn {
  display: none;
  margin: 1.5rem auto 0;
  padding: 0.85rem 2.5rem;
  background: linear-gradient(135deg, #007a5e, var(--teal));
  color: var(--bg-deep);
  border: none;
  border-radius: 10px;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  gap: 0.5rem;
  align-items: center;
}

#extract-btn:hover {
  box-shadow: var(--glow-teal);
  transform: translateY(-2px);
}

#extract-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

.extract-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(10, 10, 26, 0.3);
  border-top-color: var(--bg-deep);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Extraction Results ── */
.extraction-results {
  display: none;
  margin-top: 2rem;
}

.extraction-results.active { display: block; }

#extraction-status {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--teal);
  padding: 1rem 0;
  min-height: 3rem;
}

.pulse-text { animation: fadeInOut 1s ease-in-out; }

.extraction-results:not(.complete) #extracted-data { display: none; }
.extraction-results.complete #extraction-status { display: none; }

/* Extraction Card */
.extraction-card {
  background: var(--bg-card);
  border: 1px solid rgba(0, 212, 170, 0.15);
  border-radius: var(--border-radius);
  padding: 2rem;
  animation: slideUp 0.5s ease-out;
}

.extraction-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 1rem;
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.3);
  border-radius: 50px;
  font-size: 0.75rem;
  color: var(--success);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 1.5rem;
}

.extraction-badge.lab-badge {
  background: rgba(0, 212, 170, 0.1);
  border-color: rgba(0, 212, 170, 0.3);
  color: var(--teal);
}

.verified-icon {
  font-weight: 700;
}

.extraction-header {
  margin-bottom: 1.5rem;
}

.extraction-horse-name {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--gold);
}

.extraction-reg {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.extraction-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.extraction-field {
  padding: 0.75rem;
  background: rgba(10, 10, 26, 0.4);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.extraction-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  margin-bottom: 0.25rem;
}

.extraction-value {
  font-size: 1rem;
  font-weight: 600;
}

.extraction-value.gold { color: var(--gold); }

.extraction-genotypes {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.genotype-chips {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.genotype-chip {
  padding: 0.3rem 0.75rem;
  background: rgba(212, 168, 67, 0.1);
  border: 1px solid rgba(212, 168, 67, 0.2);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.genotype-chip strong { color: var(--gold); }

/* Genetic Test Results Grid */
.test-results-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.test-result-row {
  display: grid;
  grid-template-columns: 100px 80px 1fr;
  gap: 1rem;
  align-items: center;
  padding: 0.6rem 0.75rem;
  background: rgba(10, 10, 26, 0.4);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.test-gene {
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
}

.test-genotype code {
  font-family: var(--font-mono);
  background: rgba(212, 168, 67, 0.1);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  color: var(--gold);
  font-size: 0.85rem;
}

.test-status {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.test-status.clear { color: var(--success); }
.test-status.carrier { color: var(--warning); }
.test-status.info { color: var(--teal); }

/* Pedigree Tree */
.pedigree-tree {
  padding: 1.5rem 0;
}

.pedigree-level {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.pedigree-node {
  padding: 1rem;
  background: rgba(10, 10, 26, 0.5);
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
}

.pedigree-node.sire {
  border-left: 3px solid var(--gold);
}

.pedigree-node.dam {
  border-left: 3px solid var(--silver);
}

.pedigree-sub {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.pedigree-sub span {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-muted);
  padding-left: 0.75rem;
  position: relative;
}

.pedigree-sub span::before {
  content: '└';
  position: absolute;
  left: 0;
  color: var(--text-dim);
}

/* Auto-fill area */
.autofill-area {
  text-align: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.autofill-btn {
  font-size: 1rem;
  padding: 0.85rem 2.5rem;
}

.autofill-hint {
  color: var(--text-dim);
  font-size: 0.8rem;
  margin-top: 0.75rem;
}

/* Auto-fill toast */
.autofill-toast {
  position: fixed;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-card);
  border: 1px solid rgba(74, 222, 128, 0.3);
  border-radius: 12px;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 3000;
  opacity: 0;
  transition: all 0.3s;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  font-size: 0.9rem;
}

.autofill-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-icon { font-size: 1.1rem; }

/* ── Mobile responsive for upload ── */
@media (max-width: 900px) {
  .extraction-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .test-result-row {
    grid-template-columns: 80px 70px 1fr;
    gap: 0.5rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 600px) {
  .upload-dropzone { padding: 2rem 1.5rem; }
  .extraction-grid { grid-template-columns: 1fr; }
  .pedigree-level { grid-template-columns: 1fr; }
  .upload-target-row { gap: 0.5rem; }
  .doc-type-btn { padding: 0.5rem 0.75rem; font-size: 0.75rem; }
  .file-preview-name { max-width: 180px; }
}

/* ── Auth Nav ── */
.nav-user-name {
  color: var(--gold);
  font-size: 0.88rem;
  font-weight: 500;
}
.nav-auth-link {
  color: var(--gold) !important;
  font-weight: 600;
}
.nav-logout-link {
  color: var(--text-muted) !important;
  font-size: 0.82rem !important;
}
.nav-login-cta {
  padding: 0.4rem 1rem;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: #0a0a1a !important;
  border-radius: 8px;
  font-weight: 700 !important;
  font-size: 0.85rem !important;
}
