/* Hatchwise — one stylesheet, no frameworks. */
@font-face { font-family: "Atkinson"; src: url("/assets/fonts/atkinson-regular.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("/assets/fonts/atkinson-italic.woff") format("woff"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("/assets/fonts/atkinson-bold.woff") format("woff"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --paper: #eef3f1;
  --surface: #ffffff;
  --ink: #1d2b36;
  --muted: #52636c;
  --line: #c6d4cf;
  --line-soft: #dde7e3;
  --grass: #2f7d4f;
  --grass-deep: #23613d;
  --grass-ink: #ffffff;
  --yolk: #f2b632;
  --yolk-soft: #fdf1d2;
  --shell: #fbfcf9;
  --shell-edge: #d9e3dd;
  --focus: #1f6fb2;
  --radius-s: 6px;
  --radius-m: 10px;
  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.2rem;
  --step-2: 1.5rem;
  --step-3: clamp(1.9rem, 1.4rem + 2vw, 2.6rem);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14212b;
    --surface: #1b2b36;
    --ink: #e4ede9;
    --muted: #9fb2b9;
    --line: #314855;
    --line-soft: #253945;
    --grass: #66c38d;
    --grass-deep: #85d4a6;
    --grass-ink: #0e1c15;
    --yolk: #f5c451;
    --yolk-soft: #3a3320;
    --shell: #213440;
    --shell-edge: #3a5260;
    --focus: #7cc0ff;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--step-0)/1.55 "Atkinson", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--grass-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.012em; margin: 0 0 0.5em; }
h1 { font-size: var(--step-3); font-weight: 700; letter-spacing: -0.025em; }
h2 { font-size: var(--step-2); margin-top: 1.6em; }
h3 { font-size: var(--step-1); }
p { margin: 0 0 1em; }
abbr[title] { text-decoration: underline dotted; cursor: help; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: var(--step--1); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }

.skip { position: absolute; left: 8px; top: -60px; background: var(--ink); color: var(--paper); padding: 8px 12px; border-radius: var(--radius-s); z-index: 10; }
.skip:focus { top: 8px; }

/* header */
.site-head { border-bottom: 1px solid var(--line); background: var(--surface); }
.head-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 24px; min-height: 60px; padding-top: 8px; padding-bottom: 8px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.2rem; letter-spacing: -0.02em; }
.brand-mark { width: 26px; height: 26px; }
.brand-mark path { fill: var(--yolk); stroke: var(--ink); stroke-width: 1.6; }
.brand-mark .crack { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.main-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 2px 4px; margin: 0; padding: 0; }
.main-nav a { display: block; padding: 6px 10px; border-radius: var(--radius-s); color: var(--ink); text-decoration: none; font-size: 0.95rem; }
.main-nav a:hover { background: var(--line-soft); }
.main-nav a[aria-current="page"] { background: var(--ink); color: var(--paper); }

body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
main { flex: 1 0 auto; width: 100%; padding-top: 28px; padding-bottom: 56px; min-height: 60vh; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 14px; padding: 0; font-size: var(--step--1); color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 4px; color: var(--line); }
.crumbs a { color: var(--muted); }

.intro { max-width: 46rem; }
.lede { font-size: 1.12rem; color: var(--muted); max-width: 44rem; }
.lede a { color: var(--grass-deep); }
.checked { font-size: var(--step--1); color: var(--muted); }

/* calculator */
.tool { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); margin: 18px 0 8px; }
.tabs { display: flex; gap: 0; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; position: relative; }
.tab-ink { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--grass); border-radius: 3px 3px 0 0; pointer-events: none; }
.tab-ink.glide { transition: transform 300ms cubic-bezier(.3,.8,.25,1), width 300ms cubic-bezier(.3,.8,.25,1); }
@media (min-width: 561px) { .tabs.has-ink [role="tab"][aria-selected="true"] { border-bottom-color: transparent; } }
@media (max-width: 560px) { .tab-ink { display: none; } }
.tabs::-webkit-scrollbar { display: none; }
@media (max-width: 560px) { .tabs { display: grid; grid-template-columns: 1fr 1fr; } .tabs [role="tab"] { white-space: normal; text-align: left; padding: 11px 14px 9px; } }
.tabs [role="tab"] {
  flex: 0 0 auto; appearance: none; border: 0; background: none; font: inherit; color: var(--muted);
  padding: 13px 16px 11px; border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap;
}
.tabs [role="tab"]:hover { color: var(--ink); }
.tabs [role="tab"][aria-selected="true"] { color: var(--ink); font-weight: 700; border-bottom-color: var(--grass); }
.panel { padding: 18px 16px 22px; }
@media (min-width: 720px) { .panel { padding: 24px 26px 28px; } }
.panel-h { font-size: var(--step-1); margin: 0 0 4px; }

.pair-row { display: grid; grid-template-columns: 1fr; gap: 6px; align-items: end; }
@media (min-width: 640px) { .pair-row { grid-template-columns: 1fr auto 1fr; gap: 14px; } }
.plus { font-size: 1.6rem; color: var(--muted); text-align: center; padding-bottom: 8px; line-height: 1; }

.picker { position: relative; margin-bottom: 12px; }
.picker label { display: block; font-weight: 700; font-size: 0.95rem; margin-bottom: 5px; }
.picker-box { position: relative; }
.picker input, .field input, .field textarea, .table-tools input {
  width: 100%; font: inherit; color: var(--ink); background: var(--paper);
  border: 1.5px solid var(--line); border-radius: var(--radius-s); padding: 11px 40px 11px 12px; min-height: 46px;
}
.field textarea { padding-right: 12px; resize: vertical; }
.picker input:focus, .field input:focus, .field textarea:focus, .table-tools input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
.picker-clear { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; background: none; font-size: 1.4rem; color: var(--muted); cursor: pointer; border-radius: var(--radius-s); }
.picker-clear:hover { color: var(--ink); background: var(--line-soft); }
.picker-list {
  position: absolute; z-index: 5; left: 0; right: 0; top: 100%; margin: 4px 0 0; padding: 4px; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--ink) 14%, transparent); max-height: 320px; overflow-y: auto;
}
.picker-list li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 10px; border-radius: 4px; cursor: pointer; }
.picker-list li[aria-selected="true"], .picker-list li:hover { background: var(--line-soft); }
.picker-list .opt-meta { color: var(--muted); font-size: var(--step--1); white-space: nowrap; }
.picker-list .opt-empty { color: var(--muted); cursor: default; }

/* the egg: the one bold element */
.egg-wrap { display: grid; justify-items: center; gap: 12px; margin-top: 10px; }
.egg {
  width: min(260px, 74vw); aspect-ratio: 0.8; display: grid; place-items: center; text-align: center; padding: 26px 22px 18px;
  background: var(--shell); border: 2px solid var(--shell-edge);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  position: relative;
}
.egg.has-result { border-color: var(--yolk); background: radial-gradient(circle at 50% 60%, var(--yolk-soft) 0 33%, var(--shell) calc(33% + 1px)); }
.egg-empty { color: var(--muted); margin: 0; max-width: 12rem; }
.egg-name { font-size: clamp(1.5rem, 1.1rem + 2vw, 2.1rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; margin: 0 0 6px; color: var(--ink); text-decoration: none; display: block; }
.egg-name:hover { text-decoration: underline; }
.egg-meta { margin: 0; color: var(--muted); font-size: var(--step--1); }
.egg-tag { display: inline-block; margin-top: 8px; font-size: 0.8rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--yolk); color: #2a2205; }
/* hatch animation overlay (drawn by app.js, removed when done) */
.egg.hatching { background: transparent; border-color: transparent; }
.hatch { position: absolute; inset: -2px; width: calc(100% + 4px); height: calc(100% + 4px); overflow: visible; pointer-events: none; transform-origin: 50% 92%; z-index: 1; }
.hatch-shell { fill: var(--shell); stroke: var(--shell-edge); stroke-width: 2px; vector-effect: non-scaling-stroke; }
.hatch-half { transform-box: fill-box; transform-origin: 50% 100%; }
.hatch-crack { fill: none; stroke: var(--ink); stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.hatch-shard { fill: var(--shell); stroke: var(--yolk); stroke-width: 1; vector-effect: non-scaling-stroke; opacity: 0; transform-box: view-box; transform-origin: 0 0; }
.egg-notes { max-width: 34rem; text-align: center; color: var(--muted); font-size: 0.95rem; }
.egg-notes p { margin: 0 0 6px; }
.gender-split { display: grid; gap: 10px; grid-template-columns: 1fr; width: 100%; max-width: 560px; }
@media (min-width: 560px) { .gender-split { grid-template-columns: 1fr 1fr; } }
.gender-split .egg { width: 100%; max-width: 230px; justify-self: center; }

.check { display: flex; align-items: center; gap: 9px; margin: 4px 0 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--grass); }
.results { margin-top: 6px; }
.results .count { font-weight: 700; margin-bottom: 8px; }

.btn, .btn-quiet {
  appearance: none; font: inherit; font-weight: 700; cursor: pointer; border-radius: var(--radius-s); padding: 10px 16px; min-height: 44px;
}
.btn { background: var(--grass); color: var(--grass-ink); border: 1.5px solid var(--grass); }
.btn:hover { background: var(--grass-deep); border-color: var(--grass-deep); }
.btn-quiet { background: none; color: var(--ink); border: 1.5px solid var(--line); }
.btn-quiet:hover { border-color: var(--ink); }
.btn, .btn-quiet, .chips button, .picker-clear { transition: transform 90ms ease-out, background-color 120ms, border-color 120ms; }
.btn:active, .btn-quiet:active, .chips button:active { transform: scale(.97); }
.picker-clear:active { transform: translateY(-50%) scale(.92); }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

.plan-grid { display: grid; gap: 22px; }
@media (min-width: 820px) { .plan-grid { grid-template-columns: 1fr 1.25fr; gap: 34px; } }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 0; padding: 0; min-height: 10px; }
.chips li { display: inline-flex; align-items: center; gap: 2px; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 2px 4px 2px 12px; font-size: 0.93rem; }
.chips button { border: 0; background: none; color: var(--muted); font-size: 1.15rem; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; }
.chips button:hover { background: var(--line-soft); color: var(--ink); }
.steps { margin: 6px 0 0; padding-left: 1.4em; }
.steps li { margin-bottom: 10px; padding-left: 4px; }
.steps .gen { display: block; font-size: var(--step--1); color: var(--muted); }

.passive-form { display: grid; gap: 4px 22px; max-width: 640px; }
@media (min-width: 640px) { .passive-form { grid-template-columns: 1fr 1fr; } .passive-form .check { grid-column: 1 / -1; } }
.field { margin-bottom: 10px; }
.field label { display: block; font-weight: 700; font-size: 0.95rem; margin-bottom: 5px; }
.field input { padding-right: 12px; max-width: 140px; }
.hint { font-size: var(--step--1); color: var(--muted); margin: 5px 0 0; }
.odds { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 8px 0 12px; }
.odds div { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 12px; background: var(--paper); }
.odds dt { font-size: var(--step--1); color: var(--muted); }
.odds dd { margin: 2px 0 0; font-size: 1.45rem; font-weight: 700; letter-spacing: -0.02em; }
.noscript { padding: 16px; margin: 0; }

/* Lottie motion graphics: sized up front so nothing shifts when they load */
.anim { width: 100%; }
.anim svg { display: block; }
.hero-row { display: grid; gap: 0 28px; align-items: center; }
@media (min-width: 900px) { .hero-row { grid-template-columns: minmax(0, 1fr) 430px; } }
.anim-hero { aspect-ratio: 560 / 380; max-width: 430px; justify-self: center; }
@media (max-width: 899px) { .hero-row .anim-hero { max-width: 300px; margin: -4px auto 0; } }
.anim-formula { aspect-ratio: 520 / 180; max-width: 440px; margin: 2px 0 8px; }
.anim-special { aspect-ratio: 380 / 200; max-width: 300px; margin: 2px 0 6px; }
.anim-passive { aspect-ratio: 460 / 210; max-width: 420px; margin: 2px 0 8px; }
.anim-chain { aspect-ratio: 420 / 130; max-width: 340px; margin: 0 0 6px; }
.anim-badge { aspect-ratio: 1; }
.page-badge { float: right; width: 92px; margin: -6px 0 6px 16px; }
@media (max-width: 560px) { .page-badge { width: 64px; margin-left: 10px; } }
.anim-pair { aspect-ratio: 160 / 96; }
.anim-inline { width: 118px; margin: 0 auto 6px; }
.anim-small { max-width: 170px; }
.anim-lost { aspect-ratio: 320 / 220; max-width: 300px; margin: 4px 0 12px; }
.anim-sent { display: block; aspect-ratio: 1; width: 56px; margin-bottom: 6px; }
.anim-loader { display: inline-block; aspect-ratio: 1; width: 26px; vertical-align: middle; margin: -4px 2px 0 -4px; }
.anim-feature { max-width: 360px; }
.egg-empty-wrap { display: grid; justify-items: center; }

/* content */
.prose { max-width: 46rem; }
.prose li { margin-bottom: 0.4em; }
.cols { display: grid; gap: 0 48px; max-width: none; }
@media (min-width: 900px) { .cols { grid-template-columns: 1fr 1fr; } }
.cols section { max-width: 40rem; }

.pal-grid { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; margin: 0 0 12px; padding: 0; }
.pal-grid a { display: flex; flex-direction: column; gap: 2px; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); text-decoration: none; color: var(--ink); height: 100%; }
.pal-grid a:hover { border-color: var(--grass); }
.pg-name { font-weight: 700; }
.pg-meta { font-size: var(--step--1); color: var(--muted); }
.pal-grid.compact a { padding: 8px 12px; }

table.pairs { width: 100%; border-collapse: collapse; margin: 6px 0 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; font-size: 0.97rem; }
table.pairs th, table.pairs td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
table.pairs thead th { background: var(--paper); font-size: var(--step--1); color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--line); }
table.pairs tbody tr:last-child > * { border-bottom: 0; }
table.pairs th[scope="row"] { font-weight: 700; background: var(--paper); }
table.pairs.compact { max-width: 30rem; }
.table-tools { max-width: 420px; margin: 12px 0; }
.table-tools label { display: block; font-weight: 700; font-size: 0.95rem; margin-bottom: 5px; }
.table-tools input { padding-right: 12px; }
.list-main table.pairs { display: block; overflow-x: auto; }
@media (min-width: 720px) { .list-main table.pairs { display: table; } }

/* pal page */
.pal-head { max-width: none; }
.pal-head .lede, .pal-head h1 { max-width: 46rem; }
.dex { margin: 0 0 4px; color: var(--muted); font-weight: 700; }
.answer { color: var(--ink); }
.pal-layout { display: grid; gap: 28px; margin-top: 8px; }
@media (min-width: 900px) { .pal-layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 44px; } }
.pal-main h2:first-child { margin-top: 0.8em; }
.pal-side { align-self: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 16px 18px; }
@media (min-width: 900px) { .pal-side { position: sticky; top: 16px; margin-top: 1.2em; } }
.side-h { font-size: 1rem; margin: 14px 0 8px; }
.side-h:first-child { margin-top: 0; }
.facts { margin: 0; }
.facts div { display: grid; grid-template-columns: 8.5rem 1fr; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); font-size: 0.95rem; }
.facts div:last-child { border-bottom: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.langs div { grid-template-columns: 9.5rem 1fr; }
.near { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 12px; font-size: 0.95rem; }
.near li { margin-bottom: 4px; break-inside: avoid; }
ul.plain { padding-left: 1.2em; }

/* faq */
.faq { max-width: 46rem; margin-top: 2.2em; }
.faq details { border-top: 1px solid var(--line); padding: 2px 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 700; padding: 12px 0; list-style-position: outside; }
.faq-a p { margin: 0 0 14px; color: var(--ink); }

/* report form */
.report-form { max-width: 34rem; margin-top: 12px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-status { font-weight: 700; }
.form-status.error { color: #b3261e; }
@media (prefers-color-scheme: dark) { .form-status.error { color: #ff8a80; } }

/* footer */
.site-foot { border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 0.92rem; padding: 26px 0 34px; }
.foot-grid { display: grid; gap: 14px 40px; }
@media (min-width: 760px) { .foot-grid { grid-template-columns: 1.6fr 1fr; } }
.foot-brand { color: var(--ink); font-weight: 700; margin-bottom: 6px; }
.foot-links { list-style: none; margin: 0; padding: 0; }
.foot-links li { margin-bottom: 6px; }
.foot-links a { color: var(--muted); }

@media print {
  .site-head, .site-foot, .tool, .crumbs { display: none; }
  body { background: #fff; color: #000; }
}

/* page-to-page transitions (cross-document View Transitions; ignored by browsers without support) */
@view-transition { navigation: auto; }
.site-head { view-transition-name: site-head; }
.vt-title, .pal-head h1 { view-transition-name: pal-title; }
::view-transition-old(root) { animation: 140ms ease-in both vt-out; }
::view-transition-new(root) { animation: 260ms cubic-bezier(.2,.7,.3,1) both vt-in; }
::view-transition-group(pal-title) { animation-duration: 380ms; animation-timing-function: cubic-bezier(.3,.8,.25,1); }
::view-transition-old(pal-title) { animation: 160ms ease-out both vt-fade; }
::view-transition-new(pal-title) { animation: 300ms ease-out both vt-fade reverse; height: 100%; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes vt-fade { to { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
