@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=Source+Serif+4:wght@300;400&display=swap');

:root {
  --bg: #0a1628;
  --text: #e8dcc8;
  --accent: #7aadcc;
  --accent-light: #9dc8e0;
  --heading: #f0e8d5;
  --muted: #7a8898;
  --annotation-bg: rgba(122, 173, 204, 0.07);
  --annotation-text: #b8a898;
  --card-bg: rgba(255,255,255,0.04);
  --card-border: rgba(122, 173, 204, 0.2);
  --warm: #e8a870;
  --warm-dark: #c08878;
  --gold: #e8d090;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Source Serif 4', serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(22, 78, 130, 0.3) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 30%, rgba(10, 45, 90, 0.4) 0%, transparent 50%),
    radial-gradient(ellipse at 60% 80%, rgba(5, 30, 70, 0.3) 0%, transparent 40%);
  pointer-events: none;
  z-index: 0;
}

.container {
  position: relative;
  z-index: 1;
  max-width: 860px;
  width: 100%;
}

header {
  text-align: center;
  margin-bottom: 48px;
  animation: fadeDown 0.8s ease both;
}

header .label {
  font-size: 11px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
  opacity: 0.8;
}

header h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 700;
  color: var(--heading);
  line-height: 1.2;
}

header h1 em {
  font-style: italic;
  color: var(--accent);
}

.back-link {
  display: inline-block;
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  margin-bottom: 20px;
  opacity: 0.7;
  transition: opacity 0.2s;
  letter-spacing: 0.5px;
}

.back-link:hover {
  opacity: 1;
}

.diagram-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 4px;
  padding: 40px 36px 36px;
  animation: fadeUp 0.9s ease 0.15s both;
}

.zoom-reset-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(10, 22, 40, 0.85);
  border: 1px solid rgba(122, 173, 204, 0.25);
  color: var(--accent);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 3px;
  cursor: pointer;
  font-family: 'Source Serif 4', serif;
  letter-spacing: 1px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 10;
}
.zoom-reset-btn.visible { opacity: 0.7; pointer-events: auto; }
.zoom-reset-btn:hover { opacity: 1; border-color: var(--accent); }

.svg-wrap {
  position: relative;
}

.zoom-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(10, 22, 40, 0.88);
  border: 1px solid rgba(122, 173, 204, 0.25);
  color: var(--text);
  font-size: 13px;
  font-family: 'Source Serif 4', serif;
  padding: 8px 16px;
  border-radius: 4px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 10;
}
.zoom-hint.visible { opacity: 1; }

svg.panning { cursor: grabbing; }

svg { width: 100%; height: auto; display: block; cursor: default; }

.teat-interactive,
.slit-interactive,
.patch-interactive { touch-action: none; }

.annotations {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 32px;
  animation: fadeUp 1s ease 0.3s both;
}

.annotation {
  background: var(--annotation-bg);
  border-left: 2px solid var(--accent);
  padding: 14px 16px;
  border-radius: 0 3px 3px 0;
}

.annotation h3 {
  font-family: 'Playfair Display', serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-light);
  margin-bottom: 6px;
}

.annotation p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--annotation-text);
  font-weight: 300;
}

/* Milk Profile Section */
.milk-profile {
  margin-top: 24px;
  background: rgba(232, 168, 112, 0.05);
  border: 1px solid rgba(232, 168, 112, 0.15);
  border-radius: 4px;
  padding: 28px 32px 24px;
  animation: fadeUp 1s ease 0.45s both;
}

.milk-profile h2 {
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--warm);
  margin-bottom: 20px;
  text-align: center;
  letter-spacing: 0.5px;
}

.milk-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.milk-stat {
  text-align: center;
  padding: 12px 8px;
  background: rgba(255,255,255,0.03);
  border-radius: 4px;
  border: 1px solid rgba(122, 173, 204, 0.1);
}

.milk-stat .value {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--heading);
  line-height: 1;
  margin-bottom: 4px;
}

.milk-stat .unit {
  font-size: 12px;
  color: var(--accent);
  font-weight: 300;
}

.milk-stat .label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
  margin-top: 6px;
}

/* Serving Size Comparison */
.serving-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
  position: relative;
}

.serving-card {
  padding: 16px 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(122, 173, 204, 0.12);
  border-radius: 4px;
  text-align: center;
}

.serving-card .serving-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 10px;
}

.serving-card .serving-amount {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--heading);
  line-height: 1;
  margin-bottom: 4px;
}

.serving-card .serving-frequency {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 10px;
}

.serving-card .serving-calories {
  font-size: 13px;
  color: var(--warm);
  font-weight: 400;
}

.serving-comparison .vs {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(10, 22, 40, 0.9);
  padding: 4px 8px;
  border-radius: 3px;
  border: 1px solid rgba(122, 173, 204, 0.15);
}

.milk-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.milk-detail {
  padding: 12px 14px;
  background: rgba(122, 173, 204, 0.05);
  border-radius: 3px;
}

.milk-detail h4 {
  font-family: 'Playfair Display', serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--warm);
  margin-bottom: 5px;
}

.milk-detail p {
  font-size: 12px;
  line-height: 1.55;
  color: var(--annotation-text);
  font-weight: 300;
}

footer {
  text-align: center;
  margin-top: 28px;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(122, 173, 204, 0.4);
  animation: fadeUp 1s ease 0.45s both;
}

.leader { stroke-dasharray: 4 3; animation: dash 3s linear infinite; }

@keyframes fadeDown { from { opacity:0; transform:translateY(-16px); } to { opacity:1; transform:translateY(0); } }
@keyframes fadeUp   { from { opacity:0; transform:translateY(16px);  } to { opacity:1; transform:translateY(0); } }
@keyframes dash     { to { stroke-dashoffset: -28; } }

/* Ad spot – disabled until AdSense approval
.ad-spot {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 220px;
  background: rgba(10, 22, 40, 0.92);
  border: 1px solid rgba(122, 173, 204, 0.2);
  border-radius: 6px;
  padding: 14px 16px 12px;
  z-index: 1000;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: fadeUp 0.6s ease 1.5s both;
  transition: opacity 0.3s;
  font-family: 'Source Serif 4', serif;
}

.ad-spot-label {
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.ad-spot-body {
  margin-bottom: 10px;
}

.ad-spot-close {
  position: absolute;
  top: 6px;
  right: 8px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  padding: 2px 4px;
  line-height: 1;
  transition: color 0.2s;
}

.ad-spot-close:hover {
  color: var(--text);
}

@media (max-width: 600px) {
  .ad-spot {
    bottom: 12px;
    right: 12px;
    left: 12px;
    width: auto;
  }
}
*/

@media (max-width: 600px) {
  .annotations { grid-template-columns: 1fr; }
  .diagram-card { padding: 20px 16px 16px; }
  .milk-stats { grid-template-columns: repeat(2, 1fr); }
  .milk-details { grid-template-columns: 1fr; }
  .serving-comparison { grid-template-columns: 1fr 1fr; }
  .milk-profile { padding: 20px 16px 16px; }
}
