/* Mäyräkoirasivusto
   Värit mustan-ruskean mäyräkoiran mukaan: tumma turkki, ruskeat merkit, metsän vihreä.
   Ainoa iso temppu: visan mäyräkoira pitenee jokaisesta oikeasta vastauksesta. */

@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url("../fonts/bricolage-grotesque-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url("../fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Figtree"; font-style: normal; font-display: swap; font-weight: 300 900;
  src: url("../fonts/figtree-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Figtree"; font-style: normal; font-display: swap; font-weight: 300 900;
  src: url("../fonts/figtree-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #ffffff;
  --wash: #f4f1ec;
  --ink: #261e19;
  --muted: #6a625b;
  --line: #e6dfd7;
  --coat: #2b211b;
  --tan: #c98a4b;
  --tan-soft: #f7eadb;
  --moss: #2f6b45;
  --moss-dark: #22513a;
  --moss-soft: #e5f0e7;
  --red: #b4432f;
  --display: "Bricolage Grotesque", "Figtree", system-ui, sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 18px; line-height: 1.6; overflow-wrap: break-word; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--moss); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--moss-dark); text-decoration-thickness: 2px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.08; letter-spacing: -0.02em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.3rem, 6.5vw, 4.2rem); font-weight: 800; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.6rem, 3.6vw, 2.3rem); font-weight: 750; }
h3 { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0 0 0.9em; }
ul, ol { padding-left: 1.25em; }
strong { font-weight: 700; }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--tan); outline-offset: 2px; border-radius: 4px; }
[tabindex="-1"]:focus { outline: none; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; z-index: 10; background: #fff; padding: 8px 12px; }
.wrap { width: min(100% - 32px, 1120px); margin-inline: auto; }
.narrow { width: min(100% - 32px, 760px); margin-inline: auto; }
.lead { font-size: clamp(1.1rem, 2.2vw, 1.3rem); color: var(--muted); line-height: 1.5; }
.small { font-size: 0.88rem; color: var(--muted); }
.src { font-size: 0.8rem; color: var(--muted); white-space: nowrap; }

/* Mäyräkoira-SVG */
.dog { display: block; height: auto; max-width: 100%; overflow: visible; }
.dog .dog-body, .dog .dog-head, .dog .dog-leg, .dog .dog-ear { fill: var(--coat); }
.dog .dog-tail, .dog .dog-neck { stroke: var(--coat); }
.dog .tan { fill: var(--tan); }
.dog .dog-nose { fill: #120d0a; }
.dog .dog-eye { fill: #fff; }
.dog .dog-ear { fill: #19120e; }

/* Ylätunniste */
.site-header { border-bottom: 1px solid var(--line); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 24px; padding: 12px 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--display); font-weight: 750; font-size: 1.2rem; letter-spacing: -0.02em; }
.brand-dog { width: 66px; height: auto; }
.site-header nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 20px; }
.site-header nav a { color: var(--ink); text-decoration: none; font-weight: 500; }
.site-header nav a:hover { color: var(--moss); }
.site-header nav a[aria-current="page"] { color: var(--moss); text-decoration: underline; text-decoration-thickness: 2px; }

/* Napit */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; font-size: 1rem; color: #fff; background: var(--moss); border: 0; border-radius: 999px; padding: 12px 22px; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--moss-dark); color: #fff; }
.btn-big { font-size: 1.12rem; padding: 15px 28px; }
.btn-ghost { background: transparent; color: var(--moss); box-shadow: inset 0 0 0 2px var(--moss); }
.btn-ghost:hover { background: var(--moss-soft); color: var(--moss-dark); }

/* Hero */
.hero { padding: clamp(28px, 6vw, 64px) 0 clamp(24px, 4vw, 48px); }
.hero-grid { display: grid; gap: 28px; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.05fr 1fr; gap: 48px; } }
.hero h1 { margin-bottom: 0.3em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.hero .photo img { border-radius: 22px; width: 100%; height: auto; }

/* Kuvat */
.photo { margin: 0; }
.photo img { border-radius: 16px; background: var(--wash); }
.photo figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 8px; line-height: 1.4; }
.photo .cap { color: var(--ink); font-weight: 600; }
.photo .credit { display: block; font-size: 0.75rem; }
.photo .credit a { color: var(--muted); }

/* Osiot */
.section { padding: clamp(36px, 6vw, 72px) 0; }
.section.wash { background: var(--wash); }
.section-head { max-width: 720px; margin-bottom: 28px; }
.section-head p { color: var(--muted); }

/* Miksi paras */
.reasons { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
@media (min-width: 600px) { .reasons { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
@media (min-width: 960px) { .reasons { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.reason { position: relative; margin: 0; aspect-ratio: 16 / 11; border-radius: 18px; overflow: hidden; background: var(--coat); isolation: isolate; }
@media (min-width: 600px) { .reason { aspect-ratio: 4 / 3; } }
@media (min-width: 960px) { .reason { aspect-ratio: 4 / 5; } }
.reason img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--pos-w); z-index: -2; transition: transform 0.6s ease; }
@media (min-width: 960px) { .reason img { object-position: var(--pos); } }
.reason::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(24, 16, 11, 0.94) 0%, rgba(24, 16, 11, 0.72) 30%, rgba(24, 16, 11, 0.12) 62%, rgba(24, 16, 11, 0) 75%); }
.reason:hover img { transform: scale(1.04); }
.reason-no { position: absolute; top: 12px; left: 12px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--tan); color: var(--coat); font-family: var(--display); font-weight: 800; font-size: 1rem; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25); }
.reason-text { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px; color: #fff; }
.reason h3 { margin: 0 0 4px; color: #fff; font-size: 1.3rem; line-height: 1.12; text-wrap: balance; }
.reason p { margin: 0; color: rgba(255, 255, 255, 0.9); font-size: 0.95rem; line-height: 1.4; }
.reason .src { color: #f3d3ae; text-decoration: underline; text-underline-offset: 2px; }
.reason-credit { margin-top: 6px !important; font-size: 0.68rem !important; color: rgba(255, 255, 255, 0.62) !important; line-height: 1.3 !important; }
.reason-credit a { color: inherit; }
@media (min-width: 960px) { .reason h3 { font-size: 1.2rem; } .reason p { font-size: 0.88rem; } .reason-text { padding: 14px; } }

/* Koot ja turkit: 3 x 3 */
.matrix { display: grid; gap: 14px; }
@media (min-width: 760px) { .matrix { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.coat-card { background: var(--bg); border-radius: 18px; padding: 14px; border: 1px solid var(--line); }
.coat-card h3 { margin: 12px 0 4px; }
.coat-card p { margin: 0; font-size: 0.95rem; color: var(--muted); }
.coat-card .photo img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.coat-card .photo figcaption .cap { display: none; }
.sizes { margin-top: 28px; display: grid; gap: 12px; }
@media (min-width: 760px) { .sizes { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.size { padding: 16px 18px; border-radius: 16px; background: var(--tan-soft); }
.size h3 { margin-bottom: 4px; }
.size .measure { font-family: var(--display); font-size: 1.6rem; font-weight: 750; color: var(--coat); letter-spacing: -0.02em; margin: 0 0 4px; }
.size p { margin: 0; font-size: 0.95rem; }
.size .dog { margin: 4px 0 10px; }

/* Visa */
.quiz { background: var(--coat); color: #f5ede6; border-radius: 26px; padding: clamp(20px, 4vw, 36px); }
.quiz a { color: #f0c690; }
.quiz-dog { min-height: 75px; display: flex; align-items: flex-end; overflow: hidden; margin-bottom: 14px; }
.quiz .dog .dog-body, .quiz .dog .dog-head, .quiz .dog .dog-leg { fill: #6b4a33; }
.quiz .dog .dog-ear { fill: #4a3222; }
.quiz .dog .dog-tail, .quiz .dog .dog-neck { stroke: #6b4a33; }
.quiz .dog .tan { fill: var(--tan); }
.quiz-kicker { color: #d9cbbf; margin-bottom: 16px; }
.quiz .btn { background: var(--tan); color: #1f160f; }
.quiz .btn:hover { background: #e0a565; }
.quiz .btn-ghost { background: transparent; color: #f0c690; box-shadow: inset 0 0 0 2px #f0c690; }
.quiz-progress { display: flex; justify-content: space-between; font-size: 0.9rem; color: #cbb9aa; margin-bottom: 8px; }
.quiz-q { font-size: clamp(1.3rem, 3.2vw, 1.75rem); color: #fff; margin-bottom: 16px; }
.quiz-options { display: grid; gap: 10px; }
@media (min-width: 640px) { .quiz-options { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.quiz-opt { text-align: left; font-size: 1.05rem; font-weight: 600; color: #fff; background: rgba(255, 255, 255, 0.08); border: 2px solid rgba(255, 255, 255, 0.18); border-radius: 14px; padding: 14px 16px; cursor: pointer; }
.quiz-opt:hover:not(:disabled) { border-color: var(--tan); background: rgba(201, 138, 75, 0.18); }
.quiz-opt:disabled { cursor: default; opacity: 0.55; }
.quiz-opt.is-correct { opacity: 1; background: #2f6b45; border-color: #6fbf8b; }
.quiz-opt.is-wrong { opacity: 1; background: #7a2e22; border-color: #e07a62; }
.quiz-feedback { margin-top: 16px; }
.quiz-verdict { font-family: var(--display); font-weight: 750; font-size: 1.3rem; margin-bottom: 4px; }
.quiz-verdict.ok { color: #8fd6a6; }
.quiz-verdict.no { color: #f09a85; }
.quiz-explain { color: #e8ddd3; }
.quiz .src { color: #cbb9aa; }
.quiz-result-score { font-family: var(--display); font-size: clamp(3.5rem, 12vw, 6rem); font-weight: 800; line-height: 1; margin: 0 0 6px; color: var(--tan); letter-spacing: -0.04em; }
.quiz-result-title { font-size: 1.8rem; color: #fff; }
.quiz-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }

/* Tiesitkö */
.dyk { border-radius: 22px; background: var(--tan-soft); padding: 22px 24px; }
.dyk h2 { font-size: 1.4rem; margin-bottom: 8px; }
.dyk-text { font-size: 1.15rem; min-height: 3.2em; }
.dyk.flip .dyk-text { animation: dyk-in 0.3s ease-out; }
@keyframes dyk-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Tilastot */
.stats { display: grid; gap: 14px; }
@media (min-width: 760px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.stat { padding: 18px 20px; border-radius: 18px; border: 1px solid var(--line); background: var(--bg); }
.stat .num { font-family: var(--display); font-size: clamp(2rem, 5vw, 2.8rem); font-weight: 800; letter-spacing: -0.03em; color: var(--coat); line-height: 1.05; margin: 0 0 4px; }
.stat p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; margin: 16px 0; position: relative; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; font-variant-numeric: tabular-nums; }
caption { text-align: left; padding: 10px 12px 4px; font-weight: 600; color: var(--muted); font-size: 0.9rem; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
td.n, th.n { text-align: right; }
thead th { background: var(--wash); font-size: 0.85rem; color: var(--muted); }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
.bar { display: inline-block; height: 10px; border-radius: 5px; background: var(--tan); vertical-align: middle; margin-right: 8px; }

/* Linkit ja tekstisivut */
.links { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
@media (min-width: 760px) { .links { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.links li { margin: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; }
.links a { font-weight: 700; }
.links span { display: block; color: var(--muted); font-size: 0.93rem; }
.prose { max-width: 720px; }
.prose li { margin-bottom: 0.4em; }
.facts { list-style: none; padding: 0; margin: 0; }
.facts li { padding: 12px 0; border-bottom: 1px solid var(--line); margin: 0; }
.page-head { padding: clamp(28px, 5vw, 56px) 0 8px; }

/* Galleria */
.gallery { columns: 1; column-gap: 16px; }
@media (min-width: 640px) { .gallery { columns: 2; } }
@media (min-width: 1000px) { .gallery { columns: 3; } }
.gallery .photo { break-inside: avoid; margin-bottom: 18px; }

/* Alatunniste */
.site-footer { background: var(--coat); color: #d8ccc1; margin-top: 56px; padding: 36px 0 30px; font-size: 0.92rem; }
.site-footer a { color: #f0c690; }
.site-footer .small { color: #b5a596; }
.footer-grid { display: grid; gap: 22px; }
@media (min-width: 860px) { .footer-grid { grid-template-columns: 2fr 1fr; } }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 6px; }

@media (prefers-reduced-motion: reduce) { .dyk.flip .dyk-text { animation: none; } }

/* Rotusivu */
.rotu-grid { display: grid; gap: 32px; }
@media (min-width: 960px) { .rotu-grid { grid-template-columns: minmax(0, 1fr) 280px; } .rotu-aside { position: sticky; top: 20px; align-self: start; } }
.rotu-grid .prose h2 { margin-top: 1.6em; }
.rotu-grid .prose h2:first-child { margin-top: 0; }
.rotu-grid .photo { margin: 18px 0 8px; }
.toc { background: var(--wash); border-radius: 16px; padding: 16px 18px; margin-bottom: 16px; font-size: 0.95rem; }
.toc p { margin: 0 0 4px; }
.toc ul { margin: 0; padding-left: 1.1em; }
.cols-2 { display: grid; gap: 16px; }
@media (min-width: 900px) { .cols-2 { grid-template-columns: 1fr 1fr; align-items: start; } }
tr.total th, tr.total td { background: var(--wash); }

/* Mikä mäyräkoira olet? -testi */
.persona { background: var(--coat); color: #f5ede6; border-radius: 26px; padding: clamp(20px, 4vw, 36px); }
.persona a { color: #f0c690; }
.persona .btn { background: var(--tan); color: #1f160f; }
.persona .btn:hover { background: #e0a565; }
.persona .btn-ghost { background: transparent; color: #f0c690; box-shadow: inset 0 0 0 2px #f0c690; }
.persona-progress { display: flex; justify-content: space-between; align-items: center; min-height: 32px; font-size: 0.9rem; color: #cbb9aa; margin-bottom: 6px; }
.persona-back { background: none; border: 0; color: #f0c690; font: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; padding: 4px 0; }
.persona-bar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.12); margin-bottom: 18px; overflow: hidden; }
.persona-bar span { display: block; height: 100%; background: var(--tan); transition: width 0.3s ease; }
.persona-q { font-size: clamp(1.3rem, 3.2vw, 1.75rem); color: #fff; margin: 0 0 16px; outline: none; }
.persona-note { margin-top: 12px; }
.persona-result { display: grid; gap: 18px; grid-template-areas: "head" "photos" "body"; }
@media (min-width: 860px) {
  .persona-result { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); grid-template-areas: "photos head" "photos body"; grid-template-rows: auto 1fr; column-gap: 32px; }
}
.persona-head { grid-area: head; }
.persona-photos { grid-area: photos; position: relative; }
.persona-body { grid-area: body; }
.persona-kicker { margin: 0; color: #cbb9aa; font-size: 0.95rem; letter-spacing: 0.06em; text-transform: uppercase; }
.persona-name { margin: 2px 0 4px; color: var(--tan); font-size: clamp(2.1rem, 6vw, 3.1rem); line-height: 1.02; letter-spacing: -0.02em; outline: none; }
.persona-sub { margin: 0; color: #fff; font-weight: 650; font-size: 1.05rem; }
.persona-photo { margin: 0; overflow: hidden; background: #3a2c23; }
.persona-photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; }
.persona-photo.main { border-radius: 18px; aspect-ratio: 4 / 3; }
.persona-photo.inset { position: absolute; right: -6px; bottom: 34px; width: 38%; aspect-ratio: 1; border: 5px solid #f5ede6; border-radius: 12px; transform: rotate(4deg); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); }
.persona-credit { margin: 8px 0 0; font-size: 0.72rem; color: #a9978a; line-height: 1.35; }
.persona-credit a { color: inherit; }
.persona-desc { color: #f5ede6; font-size: 1.05rem; margin: 0 0 12px; }
.persona-traits { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.persona-traits li { margin: 0; padding: 5px 12px; border-radius: 999px; background: rgba(201, 138, 75, 0.2); border: 1px solid rgba(240, 198, 144, 0.45); color: #fbe3c4; font-weight: 650; font-size: 0.92rem; }
.persona-fact { font-size: 0.88rem; color: #d9cbbf; margin: 0 0 6px; }
.persona-copied { min-height: 1.2em; margin: 8px 0 0; color: #cbb9aa; font-size: 0.9rem; word-break: break-all; }
.persona-teaser { display: grid; gap: 14px; align-items: center; background: var(--coat); color: #f5ede6; border-radius: 22px; padding: clamp(20px, 4vw, 32px); }
@media (min-width: 760px) { .persona-teaser { grid-template-columns: auto minmax(0, 1fr) auto; gap: 24px; } }
.persona-teaser h2 { color: #fff; margin: 0 0 4px; }
.persona-teaser p { margin: 0; color: #d9cbbf; }
.persona-teaser .btn { background: var(--tan); color: #1f160f; justify-self: start; }
.persona-teaser .dog .dog-body, .persona-teaser .dog .dog-head, .persona-teaser .dog .dog-leg { fill: #6b4a33; }
.persona-teaser .dog .dog-ear { fill: #4a3222; }
.persona-teaser .dog .dog-tail, .persona-teaser .dog .dog-neck { stroke: #6b4a33; }
.persona-teaser .dog .tan { fill: var(--tan); }
