/* pedgree marketing site.
 *
 * Colour: "register ink" navy on cool paper, one accent per animal taken from
 * show rosettes (dog amber, cat plum, horse racing green). Type: Familjen
 * Grotesk for headings and interface, Newsreader for reading text and for the
 * names in a pedigree. The one memorable thing is the pedigree chart; the rest
 * stays quiet.
 *
 * Themes: light by default, dark from the device, or either pinned by
 * <html data-theme>. Animals: <html data-animal> (set by js/boot.js).
 */

/* ------------------------------------------------------------------ tokens */

:root {
    color-scheme: light;
    --paper: #f6f7f9;
    --surface: #ffffff;
    --ink: #16233f;
    --ink-soft: #4b5773;
    --rule: #d3d8e2;
    --rule-strong: #9aa3b5;
    --control-line: #7d879c;
    --on-accent: #ffffff;
    --danger: #b42318;
    --danger-wash: #fdecea;

    /* The animal's colours: light (--al*) and dark (--ad*) for each, set per
       animal below; the theme picks which pair --accent* means. */
    --accent: var(--al);
    --accent-ink: var(--al-ink);
    --accent-wash: var(--al-wash);

    --font-ui: "Familjen Grotesk", "Helvetica Neue", Arial, sans-serif;
    --font-text: "Newsreader", Georgia, "Times New Roman", serif;
    --radius: 12px;
    --wrap: 1180px;
    --gutter: 16px;
}

/* One line per animal: light accent, its text-safe ink (4.5:1 on the page) and
   wash, then the same three for dark. Taken from show rosettes and the
   animal's world; a new animal is one more line. Keyed on any element's
   data-animal, so the picker's tiles each show their own animal's colour. */
:root, [data-animal="dog"] { --al: #b7791f; --al-ink: #85560f; --al-wash: #f7ecdb; --ad: #e2a54b; --ad-ink: #edbb6e; --ad-wash: #2b2418; }
[data-animal="cat"]     { --al: #8e4ba3; --al-ink: #6a3380; --al-wash: #f2e7f6; --ad: #c58adb; --ad-ink: #d7a8e8; --ad-wash: #261c33; }
[data-animal="horse"]   { --al: #2f7a55; --al-ink: #22593e; --al-wash: #e3f0e8; --ad: #63bd8e; --ad-ink: #86d1a9; --ad-wash: #15291f; }
[data-animal="rabbit"]  { --al: #c0566f; --al-ink: #9a3550; --al-wash: #f8e6eb; --ad: #e48aa0; --ad-ink: #f0a9bb; --ad-wash: #2e1a22; }
[data-animal="goat"]    { --al: #7a7a2a; --al-ink: #5c5c17; --al-wash: #efefdc; --ad: #c4c46a; --ad-ink: #d5d58a; --ad-wash: #24240f; }
[data-animal="sheep"]   { --al: #8a7a5c; --al-ink: #66573b; --al-wash: #f1ece2; --ad: #c7b48f; --ad-ink: #d8c8a8; --ad-wash: #27221a; }
[data-animal="alpaca"]  { --al: #2a8a8a; --al-ink: #1d6767; --al-wash: #e0f1f1; --ad: #5cc4c4; --ad-ink: #84d6d6; --ad-wash: #10292a; }
[data-animal="pigeon"]  { --al: #5d5fa8; --al-ink: #42448a; --al-wash: #e8e8f6; --ad: #9a9ce0; --ad-ink: #b4b6ec; --ad-wash: #1d1e38; }
[data-animal="dragon"]  { --al: #c0392b; --al-ink: #9b2a1f; --al-wash: #f9e3df; --ad: #ec7a6c; --ad-ink: #f39b90; --ad-wash: #321713; }
[data-animal="unicorn"] { --al: #b03ca8; --al-ink: #8c2c86; --al-wash: #f7e3f5; --ad: #e48adc; --ad-ink: #eda9e7; --ad-wash: #2f1730; }

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --paper: #0e1524;
        --surface: #162036;
        --ink: #e6eaf2;
        --ink-soft: #a7b1c6;
        --rule: #26324d;
        --rule-strong: #4a5878;
        --control-line: #6b7894;
        --on-accent: #10131c;
        --danger: #f2877d;
        --danger-wash: #3a1a1c;
        --accent: var(--ad);
        --accent-ink: var(--ad-ink);
        --accent-wash: var(--ad-wash);
    }
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --paper: #0e1524;
    --surface: #162036;
    --ink: #e6eaf2;
    --ink-soft: #a7b1c6;
    --rule: #26324d;
    --rule-strong: #4a5878;
    --control-line: #6b7894;
    --on-accent: #10131c;
    --danger: #f2877d;
    --danger-wash: #3a1a1c;
    --accent: var(--ad);
    --accent-ink: var(--ad-ink);
    --accent-wash: var(--ad-wash);
}

@media (min-width: 640px) { :root { --gutter: 24px; } }

/* -------------------------------------------------------------------- base */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 400 1.125rem/1.6 var(--font-text);
    font-optical-sizing: auto;
    overflow-x: clip;
    transition: background-color .25s ease, color .25s ease;
}
h1, h2, h3 { font-family: var(--font-ui); font-weight: 600; line-height: 1.1; margin: 0 0 .5em; letter-spacing: -0.015em; text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 6.2vw, 4.75rem); letter-spacing: -0.03em; line-height: 1; }
h2 { font-size: clamp(1.75rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.25rem; letter-spacing: -0.005em; }
p { margin: 0 0 1em; max-width: 66ch; }
a { color: var(--accent-ink); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
img, svg { display: block; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: var(--gutter); top: -100px; z-index: 100; background: var(--surface); color: var(--ink); padding: .6rem 1rem; border-radius: var(--radius); font-family: var(--font-ui); }
.skip-link:focus { top: 12px; }
.lede { font-size: clamp(1.2rem, 1.9vw, 1.4rem); line-height: 1.5; color: var(--ink-soft); max-width: 40ch; }

/* ----------------------------------------------------------------- buttons */

.button {
    display: inline-flex; align-items: center; justify-content: center; gap: .5em;
    font: 600 1rem/1.2 var(--font-ui);
    padding: .75em 1.25em; border-radius: 999px; border: 1.5px solid transparent;
    text-decoration: none; cursor: pointer; white-space: nowrap;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.button-large { font-size: 1.0625rem; padding: .9em 1.5em; }
.button-primary { background: var(--accent-ink); color: var(--on-accent); }
.button-primary:hover { background: var(--ink); color: var(--paper); }
.button-quiet { background: transparent; color: var(--ink); border-color: var(--control-line); }
.button-quiet:hover { border-color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-top: 2rem; }

/* ------------------------------------------------------------------ header */

.site-header {
    position: sticky; top: 0; z-index: 50;
    background: color-mix(in srgb, var(--paper) 88%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--rule);
}
.header-inner { display: flex; align-items: center; gap: 1rem; min-height: 68px; position: relative; }
.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--ink); text-decoration: none; margin-right: auto; }
.mark { width: 30px; height: 30px; fill: var(--accent); stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; }
.mark path { fill: none; }
.mark circle:first-child { fill: var(--ink); stroke: none; }
.mark circle:not(:first-child) { stroke: none; }
.brand-word { font: 700 1.5rem/1 var(--font-ui); letter-spacing: -0.035em; }

/* The animal picker: a button, and a panel of tiles each in its own colour. */
.animal-picker { position: relative; }
.ap-button {
    display: inline-flex; align-items: center; gap: .4rem; height: 40px; padding: 0 .7rem 0 .45rem;
    border: 1px solid var(--rule); border-radius: 999px; background: var(--accent-wash); color: var(--accent-ink);
    font: 600 .95rem/1 var(--font-ui); cursor: pointer;
}
.ap-button:hover { border-color: var(--accent); }
.ap-button .sil { width: 26px; height: 26px; fill: currentColor; }
.ap-chevron { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s ease; }
.ap-button[aria-expanded="true"] .ap-chevron { transform: rotate(180deg); }
.ap-panel {
    position: absolute; top: calc(100% + .6rem); right: 0; z-index: 60; width: min(25rem, calc(100vw - 2 * var(--gutter)));
    background: var(--surface); border: 1px solid var(--rule); border-radius: 18px; padding: 1rem;
    box-shadow: 0 24px 60px -24px rgb(14 21 36 / .45);
}
.ap-panel fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.ap-legend { font: 600 .95rem/1.2 var(--font-ui); color: var(--ink-soft); padding: 0 0 .7rem; }
.ap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); gap: .5rem; }
.ap-option {
    --tile: var(--al-ink); --tile-wash: var(--al-wash);
    position: relative; display: grid; justify-items: center; gap: .35rem; padding: .7rem .4rem .6rem;
    border: 1.5px solid var(--rule); border-radius: 14px; cursor: pointer; font: 500 .9rem/1.2 var(--font-ui); color: var(--ink);
    transition: border-color .15s ease, background-color .15s ease;
}
.ap-option input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.ap-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--tile-wash); color: var(--tile); }
.ap-icon .sil { width: 36px; height: 36px; fill: currentColor; }
.ap-option:hover { border-color: var(--tile); }
.ap-option:has(input:checked) { border-color: var(--tile); background: var(--tile-wash); }
.ap-option:has(input:checked) .ap-icon { background: var(--surface); }
.ap-option:has(input:focus-visible) { outline: 3px solid var(--tile); outline-offset: 2px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ap-option { --tile: var(--ad-ink); --tile-wash: var(--ad-wash); } }
:root[data-theme="dark"] .ap-option { --tile: var(--ad-ink); --tile-wash: var(--ad-wash); }

.site-menu { display: flex; align-items: center; gap: 1.25rem; }
.site-nav ul { list-style: none; display: flex; gap: 1.25rem; margin: 0; padding: 0; }
.site-nav a { font: 500 1rem/1 var(--font-ui); color: var(--ink); text-decoration: none; padding: .5rem 0; border-bottom: 2px solid transparent; }
.site-nav a:hover { border-bottom-color: var(--rule-strong); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--accent); }
.header-cta { display: flex; flex-wrap: wrap; justify-content: flex-end; position: relative; }

.theme-toggle { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--rule); background: var(--surface); color: var(--ink); cursor: pointer; padding: 0; }
.theme-toggle:hover { border-color: var(--control-line); }
.ti { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; display: none; }
.ti .fill { fill: currentColor; stroke: none; }
.theme-toggle[data-state="system"] .ti-system, .theme-toggle[data-state="light"] .ti-light, .theme-toggle[data-state="dark"] .ti-dark { display: block; }
.theme-toggle:not([data-state]) .ti-system { display: block; }

.menu-toggle { display: none; width: 44px; height: 44px; border: 1px solid var(--rule); border-radius: 50%; background: var(--surface); cursor: pointer; place-items: center; padding: 0; color: var(--ink); }
.menu-icon, .menu-icon::before, .menu-icon::after { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; position: relative; transition: transform .2s ease; }
.menu-icon::before, .menu-icon::after { content: ""; position: absolute; left: 0; }
.menu-icon::before { top: -6px; }
.menu-icon::after { top: 6px; }
.menu-toggle[aria-expanded="true"] .menu-icon { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-icon::before { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-icon::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 899px) {
    .menu-toggle { display: inline-grid; }
    .site-menu {
        display: none; position: absolute; top: 100%; left: 0; right: 0;
        flex-direction: column; align-items: stretch; gap: 1rem;
        padding: 1rem var(--gutter) 1.5rem; background: var(--paper); border-bottom: 1px solid var(--rule);
    }
    .site-menu.is-open { display: flex; }
    .site-nav ul { flex-direction: column; gap: 0; }
    .site-nav a { display: block; padding: .8rem 0; font-size: 1.15rem; border-bottom: 1px solid var(--rule); }
    .site-nav a[aria-current="page"] { border-bottom-color: var(--rule); color: var(--accent-ink); }
    .header-cta { justify-content: flex-start; }
}
@media (max-width: 559px) {
    .ap-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .ap-button { padding: 0 .55rem 0 .4rem; }
    .ap-panel { position: fixed; top: 76px; left: var(--gutter); right: var(--gutter); width: auto; }
    .brand-word { font-size: 1.3rem; }
}

/* -------------------------------------------------------------------- hero */

.hero { padding: clamp(2.5rem, 7vw, 6rem) 0 clamp(2.5rem, 6vw, 5rem); }
.hero-inner { display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
@media (min-width: 1000px) { .hero-inner { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); } }
.hero h1 { max-width: 11ch; }
.hero-chart { margin: 0; }
.hero-chart figcaption { font: 400 .95rem/1.45 var(--font-ui); color: var(--ink-soft); margin-top: 1rem; max-width: 46ch; }

/* The pedigree chart */
.chart { width: 100%; height: auto; overflow: visible; }
.chart line { stroke: var(--rule-strong); stroke-width: 1.5; stroke-linecap: round; transition: stroke .2s ease, stroke-width .2s ease; }
.chart .node.g0 line { stroke: var(--ink); stroke-width: 2.25; }
.chart text { fill: var(--ink); font-family: var(--font-text); transition: fill .2s ease, opacity .2s ease; }
.chart .g0 text { font-size: 23px; font-weight: 600; }
.chart .g1 text { font-size: 17.5px; font-weight: 500; }
.chart .g2 text { font-size: 15px; }
.chart .g3 text { font-size: 13.5px; fill: var(--ink-soft); }
.chart .coi { font: 600 13px var(--font-ui) !important; fill: var(--accent-ink) !important; }
.chart .badge { fill: var(--accent-wash); stroke: var(--accent); stroke-width: 1.5; }
.chart .badge-animal { fill: var(--accent-ink); }
.chart .node { cursor: default; }
.chart.has-lit .node:not(.is-lit) text { opacity: .4; }
.chart .is-lit line, .chart line.is-lit { stroke: var(--accent); stroke-width: 2.75; }
.chart .is-lit text { fill: var(--accent-ink); }

/* Drawn out a generation at a time — the page's one orchestrated moment. */
.js .chart line { stroke-dasharray: 1; stroke-dashoffset: 1; }
.js .chart text, .js .chart .badge, .js .chart .badge-animal { opacity: 0; }
.js .chart.is-drawn line { stroke-dashoffset: 0; transition: stroke-dashoffset .45s ease-out, stroke .2s ease, stroke-width .2s ease; }
.js .chart.is-drawn text, .js .chart.is-drawn .badge, .js .chart.is-drawn .badge-animal { opacity: 1; transition: opacity .4s ease, fill .2s ease; }
.js .chart.is-drawn.has-lit .node:not(.is-lit) text { opacity: .4; }
.js .chart.is-drawn .g0 line { transition-delay: .1s; }
.js .chart.is-drawn .b0 { transition-delay: .45s; }
.js .chart.is-drawn .g1 line, .js .chart.is-drawn .g1 text { transition-delay: .65s; }
.js .chart.is-drawn .b1 { transition-delay: 1s; }
.js .chart.is-drawn .g2 line, .js .chart.is-drawn .g2 text { transition-delay: 1.2s; }
.js .chart.is-drawn .b2 { transition-delay: 1.55s; }
.js .chart.is-drawn .g3 line, .js .chart.is-drawn .g3 text { transition-delay: 1.75s; }
.js .chart.is-drawn.has-lit line, .js .chart.is-drawn.has-lit text { transition-delay: 0s !important; }

/* Narrow screens: three generations, set larger so the names stay readable. */
@media (max-width: 639px) {
    .chart .g3, .chart .b2 { display: none; }
    .chart .g0 text { font-size: 27px; }
    .chart .g1 text { font-size: 22px; }
    .chart .g2 text { font-size: 20px; }
    .chart .coi { font-size: 14px !important; }
}

/* -------------------------------------------------------------- highlights */

.highlights { padding: clamp(3rem, 7vw, 5.5rem) 0; border-top: 1px solid var(--rule); }
.highlight-list { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; gap: 2rem; }
@media (min-width: 820px) { .highlight-list { grid-template-columns: repeat(3, 1fr); gap: 0; } }
.highlight-list li { position: relative; padding-left: 1.6rem; }
@media (min-width: 820px) {
    .highlight-list li { padding: 0 2rem 0 3.6rem; }
    .highlight-list li + li { border-left: 1px solid var(--rule); }
    .highlight-list li:first-child { padding-left: 1.6rem; }
}
/* A small bracket: the same shape as the chart and the logo. */
.highlight-list li::before {
    content: ""; position: absolute; left: 0; top: .35rem; width: .7rem; height: 1.6rem;
    border: 2.5px solid var(--accent); border-right: 0; border-radius: 3px 0 0 3px;
}
@media (min-width: 820px) { .highlight-list li + li::before { left: 2rem; } }
.highlight-list h3 { font-size: 1.3rem; }
.highlight-list p { color: var(--ink-soft); font-size: 1.0625rem; }

/* ---------------------------------------------------------------- showcase */

.showcase { padding: clamp(2rem, 6vw, 4rem) 0; }
.show-row { display: grid; gap: 2rem; align-items: center; padding: clamp(2rem, 5vw, 3.5rem) 0; }
.show-row + .show-row { border-top: 1px solid var(--rule); }
@media (min-width: 900px) {
    .show-row { grid-template-columns: 1fr 1fr; gap: 4rem; }
    .show-row-flip .show-text { order: 2; }
}
.show-text p { color: var(--ink-soft); }
.show-demo {
    background: var(--surface); border: 1px solid var(--rule); border-radius: 18px;
    padding: clamp(1.25rem, 3vw, 2rem); font-family: var(--font-text);
}

/* builder */
.demo-builder { display: grid; gap: .9rem; }
.db-slot { border-bottom: 2px solid var(--rule-strong); padding: .35rem 0; font-size: 1.2rem; min-height: 2.4rem; display: flex; align-items: flex-end; }
.db-filled { color: var(--ink); }
.db-typing { border-bottom-color: var(--accent); color: var(--ink); background: var(--accent-wash); padding-inline: .6rem; border-radius: 8px 8px 0 0; }
.db-caret { display: inline-block; width: 2px; height: 1.2em; background: var(--accent-ink); margin-left: 2px; animation: caret 1.1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.db-suggest { list-style: none; margin: -.4rem 0 0; padding: .35rem; border: 1px solid var(--rule); border-radius: 0 0 10px 10px; font: 500 1rem/1.3 var(--font-ui); }
.db-suggest li { padding: .55rem .6rem; border-radius: 6px; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.db-match { background: var(--paper); }
.db-hint { color: var(--ink-soft); font-weight: 400; }
.db-suggest li.db-new { display: block; color: var(--accent-ink); }

/* planned mating
 * One grid: the sire's underline ends row 1, the dam's ends row 3, and the
 * bracket fills rows 2-3 in its own column. So its top and bottom edges are
 * the two underlines (pulled up by the stroke width so the top one meets the
 * sire's line rather than sitting under it), whatever length the names are. */
.demo-mating { display: grid; grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr); grid-template-rows: auto 2.2rem auto; }
.dm-sire { grid-area: 1 / 1; }
.dm-dam { grid-area: 3 / 1; }
.dm-parent { margin: 0; border-bottom: 2px solid var(--rule-strong); padding-bottom: .3rem; font-size: 1.1rem; display: grid; align-content: end; }
.dm-role { font: 500 .85rem/1.2 var(--font-ui); color: var(--ink-soft); }
.dm-join { grid-area: 2 / 2 / 4 / 3; margin-top: -2px; border: 2px solid var(--rule-strong); border-left: 0; border-radius: 0 6px 6px 0; position: relative; }
.dm-join::after { content: ""; position: absolute; left: 100%; top: calc(50% - 1px); width: 14px; border-top: 2px solid var(--accent); }
.dm-result { grid-area: 1 / 3 / 4 / 4; align-self: center; padding-left: 1.4rem; }
.dm-coi { font: 600 clamp(2.4rem, 5vw, 3.2rem)/1 var(--font-ui); color: var(--accent-ink); margin: 0; letter-spacing: -0.03em; }
.dm-label { font: 500 .95rem/1.3 var(--font-ui); color: var(--ink-soft); margin: .2rem 0 .8rem; }
.dm-through { font-size: 1rem; margin: 0; }
@media (max-width: 479px) {
    .demo-mating { grid-template-columns: 1fr; grid-template-rows: auto 1.6rem auto auto; }
    .dm-join { display: none; }
    .dm-result { grid-area: 4 / 1; padding: 1.6rem 0 0; }
}

/* certificate */
.demo-cert { background: var(--accent-wash); }
.dc-paper {
    background: #fffdf8; color: #1d2433; border-radius: 4px; padding: 1.6rem 1.6rem 1.2rem;
    outline: 1.5px solid #c9b48a; outline-offset: -8px; box-shadow: 0 18px 40px -24px rgb(22 35 63 / .45);
    max-width: 380px; margin-inline: auto; transform: rotate(-1.2deg);
}
.dc-club { font: 600 .9rem/1.2 var(--font-ui); color: #6a5a3a; margin: 0 0 .3rem; text-align: center; }
.dc-name { font: italic 500 1.6rem/1.2 var(--font-text); text-align: center; margin: 0 0 1.1rem; }
.dc-lines { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem 1.2rem; margin-bottom: 1.2rem; }
.dc-lines span { height: 2px; background: #d9cdb3; }
.dc-lines span:nth-child(odd) { width: 80%; }
.dc-foot { display: flex; gap: .9rem; align-items: center; }
.dc-foot p { font: 500 .85rem/1.35 var(--font-ui); color: #4a4f5c; margin: 0; }
.qr { width: 64px; height: 64px; flex: none; background: #fff; }
.qr path { fill: #1d2433; }

/* -------------------------------------------------------------------- more */

.more { padding: clamp(3rem, 7vw, 5rem) 0; border-top: 1px solid var(--rule); }
.more-list { display: grid; gap: 0 3rem; margin: 2rem 0 1.5rem; }
@media (min-width: 720px) { .more-list { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1080px) { .more-list { grid-template-columns: repeat(3, 1fr); } }
.more-list > div { border-top: 1px solid var(--rule); padding: 1.1rem 0 1.4rem; }
.more-list dt { font: 600 1.1rem/1.3 var(--font-ui); margin-bottom: .35rem; }
.more-list dd { margin: 0; color: var(--ink-soft); font-size: 1.0625rem; }
.more-link { font: 600 1.05rem var(--font-ui); }

/* ------------------------------------------------------------------- trust */

.trust { background: var(--accent-wash); padding: clamp(3rem, 7vw, 5rem) 0; transition: background-color .25s ease; }
.trust-inner { display: grid; gap: 1rem 4rem; align-items: baseline; }
@media (min-width: 900px) { .trust-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); } }
.trust h2 { margin: 0; }
.trust p { font-size: 1.25rem; margin: 0; }

/* ------------------------------------------------------------------ teaser */

.teaser { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.teaser-intro { color: var(--ink-soft); }
.teaser-list { list-style: none; margin: 2rem 0; padding: 0; display: grid; gap: 1.5rem; }
@media (min-width: 640px) { .teaser-list { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .teaser-list { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .teaser-list { grid-template-columns: repeat(5, 1fr); } }
.teaser-list li { border-top: 2px solid var(--rule); padding-top: 1rem; display: grid; gap: .25rem; align-content: start; }
.teaser-list li.is-featured { border-top-color: var(--accent); }
.teaser-name { font: 600 1.5rem/1.15 var(--font-ui); letter-spacing: -0.02em; }
.teaser-price { font: 500 1.05rem/1.3 var(--font-ui); color: var(--accent-ink); }
.teaser-summary { color: var(--ink-soft); font-size: 1rem; }
.pricing-error { color: var(--accent-ink); font: 500 1rem var(--font-ui); }

/* ----------------------------------------------------------------- closing */

.closing { padding: clamp(3rem, 8vw, 6rem) 0; border-top: 1px solid var(--rule); }
.closing-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem 3rem; }
.closing h2 { margin: 0; max-width: 18ch; }

/* ------------------------------------------------------------------ footer */

.site-footer { border-top: 1px solid var(--rule); padding: 2.5rem 0 3rem; font-family: var(--font-ui); }
.footer-inner { display: grid; gap: 1.25rem 3rem; }
@media (min-width: 820px) { .footer-inner { grid-template-columns: 1.4fr 1fr; } }
.definition { font-family: var(--font-text); font-size: 1.1rem; max-width: 46ch; margin: 0; }
.definition dfn { font-style: normal; font-weight: 600; font-size: 1.35rem; margin-right: .35rem; }
.definition .pos { font-style: italic; color: var(--ink-soft); margin-right: .35rem; }
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.footer-links a { color: var(--ink); }
.footer-note, .footer-copy { margin: 0; color: var(--ink-soft); font-size: .95rem; }

/* ------------------------------------------------------------- inner pages */

.page-head { padding: clamp(2.5rem, 7vw, 5rem) 0 clamp(1.5rem, 4vw, 3rem); }
.page-head h1 { max-width: 16ch; }
.page-head .lede { max-width: 52ch; }
.notfound { min-height: 50vh; }

.feature-groups { padding-bottom: 3rem; }
.feature-group { display: grid; gap: 1rem 4rem; padding: 2.5rem 0; border-top: 1px solid var(--rule); }
@media (min-width: 900px) {
    .feature-group { grid-template-columns: 15rem 1fr; }
    .feature-group h2 { position: sticky; top: 100px; align-self: start; font-size: 1.6rem; }
}
.feature-items { display: grid; gap: 1.75rem 3rem; }
@media (min-width: 640px) { .feature-items { grid-template-columns: 1fr 1fr; } }
.feature-items h3 { font-size: 1.15rem; margin-bottom: .35rem; }
.feature-items p { color: var(--ink-soft); font-size: 1.0625rem; margin: 0; }

/* ----------------------------------------------------------------- pricing */

.plans { padding-bottom: clamp(2.5rem, 6vw, 4rem); }
.plan-controls { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; margin-bottom: 2rem; font-family: var(--font-ui); }
.segmented { display: inline-flex; border: 1px solid var(--control-line); border-radius: 999px; padding: 3px; margin: 0; }
.segmented label { position: relative; padding: .5rem 1rem; border-radius: 999px; cursor: pointer; font-weight: 500; color: var(--ink-soft); }
.segmented input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.segmented label:has(input:checked) { background: var(--ink); color: var(--paper); }
.segmented label:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.field { display: inline-flex; align-items: center; gap: .6rem; font-weight: 500; }
.field select { font: 500 1rem var(--font-ui); color: var(--ink); background: var(--surface); border: 1px solid var(--control-line); border-radius: 999px; padding: .5rem 2rem .5rem 1rem; }

.plan-grid { display: grid; gap: 1.25rem 1rem; }
/* Free across the top, the biggest plan across the bottom, the three in
   between in a row. The two at the ends are strips, not cards: name and price,
   the plan in a sentence with its limits as short tags, and the button. Free
   is the quiet one; the biggest plan is set in reverse, in the page's ink. */
@media (min-width: 760px) {
    .plan-grid { grid-template-columns: repeat(3, 1fr); }
    .plan.plan-wide { grid-column: 1 / -1; }
}
.plan.plan-wide { display: grid; gap: .9rem 2.5rem; align-items: center; padding: 1.4rem 1.5rem; }
@media (min-width: 1000px) {
    .plan.plan-wide { grid-template-columns: minmax(12rem, auto) minmax(0, 1fr) auto; }
}
.pw-head .plan-name { margin-bottom: .15rem; }
.pw-head .price { margin: 0; }
.pw-body .plan-summary { min-height: 0; margin: 0 0 .6rem; }
.pw-body .plan-note { margin: .6rem 0 0; }
.pw-facts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .45rem; font: 500 .9rem/1.2 var(--font-ui); }
.pw-facts li { padding: .4rem .75rem; border-radius: 999px; background: var(--accent-wash); color: var(--ink); }
.plan-wide .plan-cta .button { width: auto; }

.plan.plan-wide-first { background: transparent; border-style: dashed; border-color: var(--rule-strong); }
.plan.plan-wide-last { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.plan-wide-last .plan-summary, .plan-wide-last .price-unit, .plan-wide-last .plan-note { color: color-mix(in srgb, var(--paper) 78%, var(--ink)); }
.plan-wide-last .pw-facts li { background: color-mix(in srgb, var(--paper) 14%, var(--ink)); color: var(--paper); }
.plan-wide-last .button-quiet { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.plan-wide-last .button-quiet:hover { background: var(--accent-wash); border-color: var(--accent-wash); }
.plan-wide-last .button:focus-visible { outline-color: var(--paper); }

.plan { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--rule); border-radius: 18px; padding: 1.6rem 1.4rem 1.4rem; }
.plan-featured { border: 2px solid var(--accent); }
.plan-flag { position: absolute; top: -.8rem; left: 1.2rem; margin: 0; background: var(--accent-ink); color: var(--on-accent); font: 600 .8rem/1 var(--font-ui); padding: .4rem .7rem; border-radius: 999px; }
.plan-name { font-size: 1.7rem; letter-spacing: -0.025em; margin-bottom: .25rem; }
.plan-summary { color: var(--ink-soft); font-size: 1rem; min-height: 3em; }
.price { display: flex; align-items: baseline; flex-wrap: wrap; gap: .4rem; margin: .25rem 0 1.25rem; font-family: var(--font-ui); }
.price-amount { font-size: 2.4rem; font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.price-unit { color: var(--ink-soft); font-size: .95rem; }
.plan-points { list-style: none; margin: 0 0 1rem; padding: 0; font: 400 .95rem/1.35 var(--font-ui); }
.plan-points li { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-top: 1px solid var(--rule); }
.plan-points li > span:last-child { font-weight: 600; text-align: right; }
.plan-point-label { color: var(--ink-soft); }
.plan-note { font: 400 .875rem/1.4 var(--font-ui); color: var(--ink-soft); margin: 0 0 1rem; }
.footnote-mark { color: var(--accent-ink); font-weight: 700; margin-left: .1em; }
.plan-footnotes { margin-top: 1rem; }
.plan-footnote { margin: 0; font: 400 .95rem/1.45 var(--font-ui); color: var(--ink-soft); }
.plan-footnote .footnote-mark { margin: 0 .3em 0 0; }
.plan-cta { margin-top: auto; display: flex; flex-wrap: wrap; }
.plan-cta .button { width: 100%; }

.compare-section { padding: clamp(2.5rem, 6vw, 4rem) 0; border-top: 1px solid var(--rule); }
/* position: relative keeps the table's visually-hidden text (absolutely
   positioned) inside the scroll box; without it, it widened the whole page. */
.table-scroll { position: relative; overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); margin-top: 1.5rem; }
.compare { width: 100%; min-width: 760px; border-collapse: collapse; font: 400 .975rem/1.4 var(--font-ui); }
.compare th, .compare td { padding: .8rem 1rem; text-align: left; border-bottom: 1px solid var(--rule); vertical-align: top; }
.compare thead th { font-size: 1.1rem; font-weight: 600; position: sticky; top: 0; background: var(--surface); }
.compare tbody th { font-weight: 500; width: 30%; }
.compare tr:last-child > * { border-bottom: 0; }
.compare .is-featured { background: var(--accent-wash); }
.compare-price td { font-weight: 600; }
.q-row { display: inline-flex; align-items: center; gap: .45rem; }
.q-btn {
    flex: none; display: inline-grid; place-items: center; width: 1.1rem; height: 1.1rem; padding: 0 0 .09em;
    border: 1.5px solid var(--control-line); border-radius: 50%; background: transparent; color: var(--ink-soft);
    font: 700 .78rem/1 var(--font-ui); cursor: pointer;
}
/* Drawn small, but the area you can tap stays 24px (WCAG 2.5.8). */
.q-btn { position: relative; }
.q-btn::before { content: ""; position: absolute; inset: -4px; border-radius: 50%; }
.q-btn:hover { border-color: var(--accent); color: var(--accent-ink); }
.q-btn[aria-expanded="true"] { background: var(--accent-ink); border-color: var(--accent-ink); color: var(--on-accent); }
.q-detail { display: block; max-width: 34ch; margin-top: .45rem; font-size: .85rem; font-weight: 400; line-height: 1.45; color: var(--ink-soft); }
.v-yes { color: var(--accent-ink); font-weight: 700; }
.v-no { color: var(--ink-soft); }
.v-unlimited { font-weight: 600; }
.v-na { color: var(--ink-soft); }

.included { padding: clamp(2.5rem, 6vw, 4rem) 0; background: var(--accent-wash); }
.included-inner { display: grid; gap: 1rem 4rem; }
@media (min-width: 900px) { .included-inner { grid-template-columns: 15rem 1fr; } }
.included-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem 2rem; font-size: 1.125rem; }
@media (min-width: 640px) { .included-list { grid-template-columns: 1fr 1fr; } }
.included-list li { padding-left: 1.6rem; position: relative; }
.included-list li::before { content: ""; position: absolute; left: 0; top: .45em; width: .7rem; height: .4rem; border-left: 2.5px solid var(--accent-ink); border-bottom: 2.5px solid var(--accent-ink); transform: rotate(-45deg); }

.faq { padding: clamp(2.5rem, 6vw, 4rem) 0 clamp(3rem, 7vw, 5rem); }
.faq-list { max-width: 52rem; margin-top: 1.5rem; }
.faq details { border-top: 1px solid var(--rule); }
.faq details:last-child { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; padding: 1.1rem 2rem 1.1rem 0; font: 600 1.15rem/1.35 var(--font-ui); list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: .25rem; top: 1rem; font-weight: 400; font-size: 1.4rem; color: var(--accent-ink); }
.faq details[open] summary::after { content: "−"; }
.faq details p { color: var(--ink-soft); margin: 0 0 1.2rem; }

/* ---------------------------------------------------------------- waitlist */

.wl {
    width: min(36rem, calc(100% - 2 * var(--gutter))); max-height: calc(100dvh - 2rem);
    margin: auto; padding: 0; border: 1px solid var(--rule); border-radius: 20px;
    background: var(--surface); color: var(--ink); overflow: auto;
    box-shadow: 0 30px 80px -30px rgb(14 21 36 / .55);
}
.wl::backdrop { background: rgb(14 21 36 / .55); backdrop-filter: blur(3px); }
.wl[open] { animation: wl-in .18s ease-out; }
@keyframes wl-in { from { opacity: 0; transform: translateY(8px); } }
.wl-intro, .wl-form, .wl-done { padding: 0 clamp(1.25rem, 4vw, 2rem); }
.wl-intro { padding-top: clamp(1.5rem, 4vw, 2rem); }
.wl-intro p { color: var(--ink-soft); font-size: 1.05rem; margin-bottom: 1.25rem; }
.wl-title { font-size: 1.6rem; margin-bottom: .5rem; padding-right: 2.5rem; }
.wl-x { position: absolute; top: .9rem; right: .9rem; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--rule); background: var(--surface); color: var(--ink); font: 400 1.5rem/1 var(--font-ui); cursor: pointer; display: grid; place-items: center; }
.wl-x:hover { border-color: var(--control-line); }
.wl-form { display: grid; gap: 1.25rem; padding-bottom: clamp(1.25rem, 4vw, 2rem); font-family: var(--font-ui); }
.form-field { display: grid; gap: .35rem; margin: 0; padding: 0; border: 0; min-width: 0; }
.form-field > label, .form-field > legend { font-weight: 600; font-size: 1rem; padding: 0; }
.form-hint { margin: 0; color: var(--ink-soft); font-size: .92rem; }
.form-field input[type="email"], .form-field input[type="text"], .form-field textarea, .form-field select {
    font: 400 1.05rem/1.3 var(--font-ui); color: var(--ink); background: var(--paper);
    border: 1.5px solid var(--control-line); border-radius: 10px; padding: .7rem .8rem; width: 100%;
}
.form-field input:focus-visible, .form-field textarea:focus-visible, .form-field select:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.form-field textarea { min-height: 9rem; resize: vertical; line-height: 1.45; }
.form-optional { font-weight: 400; color: var(--ink-soft); }
.form-options { display: grid; gap: .4rem; margin-top: .35rem; }
.form-options-animals { grid-template-columns: repeat(auto-fill, minmax(8.25rem, 1fr)); }
.form-options-herd_size { grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); }
.form-option { display: flex; align-items: center; gap: .55rem; padding: .55rem .7rem; border: 1px solid var(--rule); border-radius: 10px; cursor: pointer; font-size: .98rem; }
.form-option:hover { border-color: var(--control-line); }
.form-option input { width: 1.1rem; height: 1.1rem; margin: 0; accent-color: var(--accent-ink); flex: none; }
.form-option:has(input:checked) { border-color: var(--accent); background: var(--accent-wash); }
.form-option:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.has-error input[type="email"], .has-error input[type="text"], .has-error textarea, .has-error select { border-color: var(--danger); }
.has-error .form-option { border-color: var(--danger); }
.form-error { margin: 0; color: var(--danger); font-size: .92rem; font-weight: 500; font-family: var(--font-ui); }
.form-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-captcha:not(:has(iframe)):not(.has-error) { display: none; }
.form-small { margin: 0; color: var(--ink-soft); font-size: .88rem; }
.form-alert { margin: 0; padding: .7rem .9rem; border-radius: 10px; background: var(--danger-wash); color: var(--danger); font-weight: 500; font-family: var(--font-ui); }
.form-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.wl-done { padding-top: clamp(1.5rem, 4vw, 2rem); padding-bottom: clamp(1.5rem, 4vw, 2rem); }
.wl-done p { color: var(--ink-soft); }
.wl-done strong { color: var(--ink); }
.wl-done:focus { outline: none; }
.button.is-submitting { opacity: .75; cursor: progress; }

.confirm h1:focus { outline: none; }

/* ----------------------------------------------------------------- contact */

.multi-club {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem;
    margin-top: 1.75rem; padding: 1.4rem 1.5rem; border-radius: 18px; background: var(--accent-wash);
}
.multi-club-title { font-size: 1.3rem; margin: 0 0 .25rem; }
.multi-club p { margin: 0; color: var(--ink-soft); }

.contact { padding-bottom: clamp(3rem, 7vw, 5rem); }
.contact-inner { display: grid; gap: 2.5rem 4rem; align-items: start; }
@media (min-width: 900px) { .contact-inner { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); } }
.contact-form { display: grid; gap: 1.25rem; font-family: var(--font-ui); max-width: 38rem; }
.contact-done h2 { font-size: 1.6rem; }
.contact-done p { color: var(--ink-soft); }
.contact-done:focus { outline: none; }
.contact-aside { padding: 1.4rem 1.5rem; border-radius: 18px; background: var(--accent-wash); }
.contact-aside h2 { font-size: 1.3rem; }
.contact-aside p { margin: 0; color: var(--ink-soft); }

/* ------------------------------------------------------------------- legal */

.legal { padding-bottom: clamp(3rem, 7vw, 5rem); }
.legal-inner > * { max-width: 46rem; }
.legal-head .lede { margin: 0; }
.legal-banner { padding: 1.3rem 1.5rem; border-radius: 18px; background: var(--accent-wash); margin-bottom: 2.5rem; }
.legal-banner p { margin: 0; max-width: none; }
.legal-banner-title { font: 600 1.05rem/1.4 var(--font-ui); margin-bottom: .5rem !important; }
.legal h2 { font-size: 1.35rem; margin: 2.25rem 0 .6rem; }
.legal h3 { font-size: 1.05rem; margin: 1.5rem 0 .4rem; }
.legal p, .legal li { font-size: 1.0625rem; }
.legal .legal-inner > p, .legal .legal-inner > ul { max-width: 46rem; }
.legal ul { padding-left: 1.3rem; margin: 0 0 1em; }
.legal li { margin-bottom: .35rem; }
.legal-caps { font-size: .95rem !important; letter-spacing: .01em; }
.legal-todo { background: #ffe58a; color: #3d2e00; padding: 0 .25em; border-radius: 3px; font-weight: 600; }

/* ------------------------------------------------------- motion, contrast */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
    .js .chart line { stroke-dashoffset: 0; }
    .js .chart text, .js .chart .badge, .js .chart .badge-animal { opacity: 1; }
}

@media (forced-colors: active) {
    .chart line, .dm-join { stroke: CanvasText; border-color: CanvasText; }
    .chart text { fill: CanvasText; }
    .chart .is-lit line { stroke: Highlight; }
    .ap-option:has(input:checked), .segmented label:has(input:checked) { outline: 2px solid Highlight; }
    .button { border-color: ButtonText; }
    .highlight-list li::before { border-color: CanvasText; }
}
