html { scrollbar-gutter: stable; }
:root {
  --site-header-h: 66px;
  --color-navy: #f1ebdb;
  --color-cyan: #2ba0e0;
  --color-cyan-bright: #1f8fce;
  --color-text: #34302a;
  --color-muted: #6c6350;
  --color-border: rgba(150,125,90,0.3);
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  height: var(--site-header-h);
  border-bottom: 1px solid var(--color-border);
  background:
    linear-gradient(180deg, rgba(252, 248, 240, 0.95), rgba(255, 254, 250, 0.95));
  backdrop-filter: blur(18px);
  box-shadow: 0 8px 26px rgba(60, 78, 112, 0.1);
}

.header-inner {
  width: min(1180px, calc(100% - 24px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand-row {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--color-text);
  text-decoration: none;
}

/* logo as a blended circular mascot emblem — no boxed border */
.brand-logo {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid rgba(133, 190, 212, 0.28);
  box-shadow:
    0 0 0 3px rgba(108,191,60,0.1),
    0 4px 14px rgba(60,78,112,0.12),
    inset 0 0 12px rgba(60, 78, 112, 0.1);
}

.brand-row:hover .brand-logo {
  box-shadow:
    0 0 0 3px rgba(108,191,60,0.2),
    0 4px 18px rgba(60,78,112,0.12);
}

.brand {
  font-family: "Baloo 2", "Manrope", system-ui, sans-serif;
  font-size: 1.24rem;
  font-weight: 800;
  letter-spacing: -0.05em;
}

.brand span {
  color: transparent;
  background: linear-gradient(120deg, var(--color-cyan-bright), var(--color-cyan));
  -webkit-background-clip: text;
  background-clip: text;
}

.main-nav {
  display: flex;
  align-items: stretch;
  align-self: stretch;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.main-nav::-webkit-scrollbar { display: none; }

.nav-link {
  position: relative;
  min-height: 44px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  color: var(--color-muted);
  font-family: "Manrope", system-ui, -apple-system, sans-serif;
  font-size: 0.86rem;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

.nav-link:hover { color: var(--color-text); }

.nav-link.active {
  color: var(--color-cyan-bright);
}

.nav-link.active::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 2px;
  border-radius: 999px 999px 0 0;
  background: var(--color-cyan);
  box-shadow: 0 0 12px rgba(108,191,60,0.55);
}

.nav-link.disabled {
  opacity: 0.42;
  cursor: default;
}

/* per-item glyphs (shown only on mobile) */
.nav-link::before {
  content: "";
  display: none;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  background: currentColor;
  -webkit-mask: var(--nav-ic) center / 22px no-repeat;
  mask: var(--nav-ic) center / 22px no-repeat;
}
.nav-link[data-nav="breeding"] { --nav-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22c4 0 7-3 7-7 0-5-3-13-7-13S5 10 5 15c0 4 3 7 7 7z'/%3E%3C/svg%3E"); }
.nav-link[data-nav="map"] { --nav-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E"); }
.nav-link[data-nav="pals"] { --nav-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 11c-1.7 0-3 1.6-3 3.5S7.3 18 9 18h6c1.7 0 3-1.6 3-3.5S16.7 11 15 11'/%3E%3Ccircle cx='6.5' cy='8.5' r='1.6'/%3E%3Ccircle cx='10.5' cy='6.5' r='1.6'/%3E%3Ccircle cx='13.5' cy='6.5' r='1.6'/%3E%3Ccircle cx='17.5' cy='8.5' r='1.6'/%3E%3C/svg%3E"); }
.nav-link[data-nav="items"] { --nav-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 8a2 2 0 0 0-1-1.7l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.7l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z'/%3E%3Cpath d='m3.3 7 8.7 5 8.7-5'/%3E%3Cpath d='M12 22V12'/%3E%3C/svg%3E"); }
.nav-link[data-nav="tiers"] { --nav-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9H4.5a2.5 2.5 0 0 1 0-5H6'/%3E%3Cpath d='M18 9h1.5a2.5 2.5 0 0 0 0-5H18'/%3E%3Cpath d='M4 22h16'/%3E%3Cpath d='M10 14.7V17c0 .6-.5 1-1 1.2C7.8 18.8 7 20.2 7 22'/%3E%3Cpath d='M14 14.7V17c0 .6.5 1 1 1.2 1.2.5 2 1.9 2 3.8'/%3E%3Cpath d='M18 2H6v7a6 6 0 0 0 12 0V2Z'/%3E%3C/svg%3E"); }
.nav-link[data-nav="tech"] { --nav-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76Z'/%3E%3C/svg%3E"); }
.nav-link[data-nav="capture"] { --nav-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Ccircle cx='12' cy='12' r='6'/%3E%3Ccircle cx='12' cy='12' r='2'/%3E%3C/svg%3E"); }

/* scroll affordance chevron (mobile, only when nav overflows) */
.nav-hint { display: none; }

/* language switch — flag dropdown */
.lang-switch { flex: 0 0 auto; margin-left: auto; position: relative; }
.ls-flag {
  width: 20px; height: 14px; flex: 0 0 auto; display: inline-block; overflow: hidden;
  border-radius: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
}
.ls-flag svg { width: 100%; height: 100%; display: block; }
.ls-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px; border: 1px solid var(--color-border); border-radius: 999px;
  background: rgba(255,255,255,0.6); cursor: pointer;
  font-family: "Manrope", system-ui, sans-serif; font-size: 0.76rem; font-weight: 800;
  color: var(--color-muted); transition: 150ms;
}
.ls-btn:hover { color: var(--color-text); border-color: var(--color-border-strong); }
.ls-code { letter-spacing: 0.02em; }
.ls-caret { width: 0; height: 0; border-left: 3.5px solid transparent; border-right: 3.5px solid transparent; border-top: 4px solid currentColor; opacity: 0.65; }
.ls-menu {
  position: absolute; top: calc(100% + 6px); right: 0; min-width: 158px;
  margin: 0; padding: 6px; list-style: none;
  background: var(--color-card, #fffefa); border: 1px solid var(--color-border);
  border-radius: 14px; box-shadow: 0 16px 40px rgba(60,78,112,0.18);
  opacity: 0; visibility: hidden; transform: translateY(-4px); transition: 130ms; z-index: 10001;
}
.lang-switch.open .ls-menu { opacity: 1; visibility: visible; transform: none; }
.ls-item {
  display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 9px;
  color: var(--color-text); text-decoration: none; font-size: 0.84rem; font-weight: 650;
}
.ls-item:hover { background: rgba(108,191,60,0.1); text-decoration: none; }
.ls-item.on { color: var(--color-cyan-bright); font-weight: 800; }

.visitor-count {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: rgba(43, 160, 224, 0.08);
  color: var(--color-muted);
  font-family: "Manrope", system-ui, sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}
.visitor-count .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #35c46a;
  box-shadow: 0 0 8px rgba(53, 196, 106, 0.75);
}
.visitor-count b { color: var(--color-cyan); font-weight: 800; }

body.has-site-header {
  padding-top: var(--site-header-h);
}

@media (max-width: 860px) { .visitor-count { display: none; } }

@media (max-width: 760px) {
  :root { --site-header-h: 58px; }

  .header-inner { gap: 8px; }

  .brand-logo {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .brand { display: none; } /* logo alone on mobile — frees width for the nav */

  /* nav becomes the flexible scroll region between logo and lang.
     No scroll-behavior:smooth here — the bar must sit still on load. */
  .main-nav {
    flex: 1 1 auto;
    min-width: 0;
    margin-left: 0;
    gap: 4px;
    align-items: center;
  }

  /* compact icon buttons; active one expands snugly to show its label */
  .nav-link {
    min-height: 34px;
    padding: 0 7px;
    gap: 0;
    font-size: 0;
    border-radius: 999px;
  }
  .nav-link::before { display: block; width: 20px; height: 20px; }
  .nav-link.active {
    padding: 0 11px 0 8px;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 750;
    color: var(--color-cyan-bright);
    background: rgba(255, 255, 255, 0.62);
    box-shadow: inset 0 0 0 1px rgba(150, 125, 90, 0.2);
  }
  .nav-link.active::before { background: var(--color-cyan-bright); }
  .nav-link.active::after { display: none; }
  .nav-link.disabled { display: none; }

  /* compact language switch, pinned right, never squeezes the nav */
  .lang-switch { margin-left: 0; }
  .ls-btn { padding: 4px 7px; font-size: 0.72rem; gap: 5px; }

  /* directional scroll hints: overlap the nav edges with a fade.
     Left appears when content is hidden left, right when hidden right. */
  .nav-hint {
    flex: 0 0 auto;
    align-self: stretch;
    width: 30px;
    z-index: 3;
    align-items: center;
    border: 0;
    color: var(--color-cyan-bright);
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms;
    cursor: pointer;
  }
  .nav-hint::before {
    content: "";
    width: 9px;
    height: 9px;
    border-top: 2.4px solid currentColor;
    border-right: 2.4px solid currentColor;
  }
  .nav-hint.show { display: inline-flex; opacity: 1; pointer-events: auto; }

  .nav-hint-right {
    margin-left: -30px;
    justify-content: flex-end;
    padding-right: 3px;
    background: linear-gradient(90deg, rgba(253, 250, 244, 0), #fdfaf4 66%);
  }
  .nav-hint-right::before { transform: rotate(45deg); animation: navnudge-r 1.4s ease-in-out infinite; }

  .nav-hint-left {
    margin-right: -30px;
    justify-content: flex-start;
    padding-left: 3px;
    background: linear-gradient(270deg, rgba(253, 250, 244, 0), #fdfaf4 66%);
  }
  .nav-hint-left::before { transform: rotate(225deg); animation: navnudge-l 1.4s ease-in-out infinite; }
}

@keyframes navnudge-r {
  0%, 100% { transform: rotate(45deg) translate(0, 0); }
  50% { transform: rotate(45deg) translate(2px, -2px); }
}
@keyframes navnudge-l {
  0%, 100% { transform: rotate(225deg) translate(0, 0); }
  50% { transform: rotate(225deg) translate(2px, -2px); }
}

/* ── Shared SEO / FAQ / footer (all pages) ───────────── */
.seo-block, .faq {
  margin-top: 40px;
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid var(--color-border, rgba(150,125,90,0.3));
  border-radius: 26px;
  background: linear-gradient(150deg, rgba(255, 254, 249, 0.9), rgba(247, 240, 225, 0.85));
  box-shadow: 0 20px 46px rgba(60,78,112,0.13);
}
.seo-block h2, .faq h2 {
  margin: 0 0 14px;
  font-family: "Baloo 2", "Manrope", system-ui, sans-serif;
  font-size: clamp(1.35rem, 3.4vw, 1.9rem);
  line-height: 1.15; letter-spacing: -0.01em;
  color: var(--color-text, #34302a);
}
.seo-block h3, .faq-item h3 { margin: 22px 0 6px; font-size: 1.02rem; font-weight: 800; color: var(--color-text, #34302a); }
.seo-block p, .faq-item p { margin: 0 0 10px; color: var(--color-muted, #6c6350); font-size: 0.95rem; line-height: 1.6; }
.seo-block a, .faq-item a { color: var(--color-cyan, #2ba0e0); font-weight: 700; text-decoration: none; }
.seo-block a:hover, .faq-item a:hover { text-decoration: underline; }
.seo-list { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 8px; }
.seo-list li { color: var(--color-muted, #6c6350); font-size: 0.95rem; line-height: 1.55; }
.seo-list li strong, .seo-block p strong, .faq-item p strong { color: var(--color-text, #34302a); }
.faq-item { padding: 14px 0; border-top: 1px solid var(--color-border, rgba(150,125,90,0.3)); }
.faq-item:first-of-type { border-top: 0; padding-top: 4px; }
.site-foot { margin: 40px 0 0; padding-top: 22px; border-top: 1px solid var(--color-border, rgba(150,125,90,0.3)); text-align: center; }
.site-foot .foot-brand { margin: 0 0 8px; font-family: "Baloo 2", "Manrope", system-ui, sans-serif; font-size: 1rem; font-weight: 700; color: var(--color-text, #34302a); }
.site-foot .foot-org { margin: 0 auto; max-width: 640px; color: var(--color-faint, #8a7d63); font-size: 0.78rem; line-height: 1.5; }
.site-foot .foot-org strong { color: var(--color-muted, #6c6350); }
.site-foot .foot-report { margin: 14px auto 0; color: var(--color-faint, #8a7d63); font-size: 0.8rem; }
.site-foot .foot-report a { color: var(--color-cyan-bright, #1f8fce); font-weight: 700; text-decoration: none; }
.site-foot .foot-report a:hover { text-decoration: underline; }

/* ── Scroll-to-top button ────────────────────────────── */
.to-top {
  position: fixed; left: 50%; bottom: 22px; z-index: 9000;
  transform: translateX(-50%) translateY(16px);
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border: 1px solid var(--color-border-strong, rgba(108,191,60,0.5));
  border-radius: 999px; background: rgba(255,254,250,0.96); color: var(--color-text, #34302a);
  font-family: "Manrope", system-ui, sans-serif; font-size: 0.8rem; font-weight: 800; cursor: pointer;
  box-shadow: 0 10px 30px rgba(60,78,112,0.2); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease, transform 0.2s ease;
}
.to-top.show { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.to-top svg { width: 15px; height: 15px; }
