/* =========================================================
   HYLA — картка породи
   Токени: чорнозем / овес / пшениця / пасовище / глина
   ========================================================= */

:root {
    --ink: #211a12;
    --ink-soft: #3a2f21;
    --paper: #efe4cd;
    --paper-2: #e5d7b8;
    --wheat: #c99a2e;
    --wheat-dark: #9c7621;
    --pasture: #37502c;
    --pasture-2: #2a3d21;
    --fur: #8b7e68;
    --clay: #8c3b2e;
    --white: #fbf7ec;

    --font-display: "Fraunces", Georgia, serif;
    --font-body: "Work Sans", -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;

    --radius: 4px;
    --wrap: 1160px;
    --gap: clamp(2rem, 5vw, 5rem);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.wrap {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 clamp(1.25rem, 4vw, 2.5rem);
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
}

h1,
h2,
h3 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.08;
    margin: 0 0 0.5em;
    letter-spacing: -0.01em;
}

h1 {
    font-size: clamp(2.4rem, 5.4vw, 4.2rem);
    font-weight: 600;
}

h2 {
    font-size: clamp(1.7rem, 3.4vw, 2.6rem);
}

h3 {
    font-size: clamp(1.1rem, 1.8vw, 1.3rem);
    font-weight: 700;
}

p {
    margin: 0 0 1em;
}

.eyebrow {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--wheat-dark);
    margin: 0 0 0.9em;
    display: inline-block;
}

.eyebrow-light {
    color: var(--wheat);
}

.section-lede {
    max-width: 46em;
    font-size: 1.08rem;
    color: var(--ink-soft);
}

.prose p {
    max-width: 42em;
    color: var(--ink-soft);
}

.prose-light p {
    color: #d9d0bd;
}

/* ---------- grain overlay ---------- */
.grain-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    opacity: 0.035;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(239, 228, 205, 0.92);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid rgba(33, 26, 18, 0.12);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--ink);
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--pasture);
    color: var(--white);
    font-family: var(--font-display);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
}

.brand-text {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 0.02em;
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-sub {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fur);
}

.main-nav {
    display: flex;
    gap: clamp(1rem, 2vw, 1.8rem);
}

.main-nav a {
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--ink-soft);
    position: relative;
    padding: 4px 0;
}

.main-nav a:hover {
    color: var(--pasture);
}

.main-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 100%;
    bottom: 0;
    height: 2px;
    background: var(--wheat);
    transition: right 0.25s ease;
}

.main-nav a:hover::after {
    right: 0;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 34px;
    height: 34px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.nav-toggle span {
    display: block;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
}

/* ---------- buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85em 1.6em;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--wheat);
    color: var(--ink);
}

.btn-primary:hover {
    background: var(--wheat-dark);
}

.btn-ghost {
    background: transparent;
    border-color: currentColor;
    color: var(--ink);
}

.section-dark .btn-ghost {
    color: var(--white);
}

.btn-ghost:hover {
    background: rgba(0, 0, 0, 0.06);
}

.section-dark .btn-ghost:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* ---------- hero ---------- */
.hero {
    padding: clamp(2.5rem, 6vw, 5rem) 0 0;
    overflow: hidden;
}

.hero-inner {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: var(--gap);
    align-items: center;
}

.hero-lede {
    font-size: 1.12rem;
    color: var(--ink-soft);
    max-width: 34em;
}

.hero-cta {
    display: flex;
    gap: 0.9rem;
    flex-wrap: wrap;
    margin-top: 1.6rem;
}

.hero-media {
    margin: 0;
    position: relative;
}

.hero-media img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: var(--radius);
    border: 6px solid var(--white);
    box-shadow: 0 24px 48px -20px rgba(33, 26, 18, 0.35);
}

.hero-media figcaption {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--fur);
    margin-top: 0.7rem;
    letter-spacing: 0.02em;
}

.hero-stats {
    margin-top: clamp(2.5rem, 6vw, 4rem);
    border-top: 1px solid rgba(33, 26, 18, 0.15);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}

.hstat {
    padding: 1.6rem 1.4rem;
    border-right: 1px solid rgba(33, 26, 18, 0.15);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.hstat:last-child {
    border-right: none;
}

.hstat-num {
    font-family: var(--font-mono);
    font-size: clamp(1.3rem, 2.4vw, 1.8rem);
    font-weight: 700;
    color: var(--pasture);
}

.hstat-label {
    font-size: 0.82rem;
    color: var(--ink-soft);
    line-height: 1.35;
}

/* ---------- sections ---------- */
.section {
    padding: clamp(3.5rem, 8vw, 6.5rem) 0;
}

.section-alt {
    background: var(--paper-2);
}

.section-dark {
    background: var(--ink);
    color: var(--white);
}

.section-dark h2 {
    color: var(--white);
}

.two-col {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: var(--gap);
    align-items: start;
    margin-top: 1.5rem;
}

.two-col.reverse {
    grid-template-columns: 0.9fr 1.1fr;
}

.two-col.reverse>*:first-child {
    order: 2;
}

.two-col.reverse>*:last-child {
    order: 1;
}

/* fact card */
.fact-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius);
    padding: 1.6rem 1.7rem;
}

.fact-card h3 {
    color: var(--wheat);
    margin-bottom: 0.8rem;
}

.fact-card ul {
    margin: 0;
    padding-left: 1.1rem;
    color: #d9d0bd;
}

.fact-card li {
    margin-bottom: 0.5rem;
    font-size: 0.94rem;
}

/* spec sheet */
.spec-sheet {
    margin-top: 2.2rem;
    border-top: 1px solid rgba(33, 26, 18, 0.18);
}

.spec-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1.3fr;
    gap: 1rem;
    padding: 1.05rem 0;
    border-bottom: 1px solid rgba(33, 26, 18, 0.18);
    align-items: baseline;
}

.spec-key {
    font-weight: 600;
}

.spec-val {
    font-family: var(--font-mono);
    color: var(--pasture);
    font-weight: 700;
}

.spec-note {
    font-size: 0.86rem;
    color: var(--fur);
}

/* chart */
.chart-block {
    margin-top: clamp(2.5rem, 6vw, 4rem);
    background: var(--white);
    border-radius: var(--radius);
    padding: clamp(1.4rem, 3vw, 2.4rem);
    border: 1px solid rgba(33, 26, 18, 0.12);
}

.chart-note {
    max-width: 42em;
    color: var(--ink-soft);
    font-size: 0.95rem;
}

#growthChart {
    width: 100%;
    height: auto;
    margin-top: 1rem;
}

.axis {
    stroke: rgba(33, 26, 18, 0.35);
    stroke-width: 1;
}

.axis-label {
    font-family: var(--font-mono);
    font-size: 11px;
    fill: var(--fur);
}

.line-hyla {
    fill: none;
    stroke: var(--wheat-dark);
    stroke-width: 3.5;
    stroke-linecap: round;
    stroke-dasharray: 900;
    stroke-dashoffset: 900;
}

.line-normal {
    fill: none;
    stroke: var(--fur);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 6 7;
    stroke-dashoffset: 900;
    stroke-dasharray: 900;
}

.chart-block.in-view .line-hyla {
    animation: draw 1.6s ease forwards;
}

.chart-block.in-view .line-normal {
    animation: draw 1.6s ease forwards 0.25s;
}

@keyframes draw {
    to {
        stroke-dashoffset: 0;
    }
}

.chart-legend {
    display: flex;
    gap: 1.6rem;
    margin-top: 1.1rem;
    flex-wrap: wrap;
}

.legend-item {
    font-size: 0.86rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--ink-soft);
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.dot-hyla {
    background: var(--wheat-dark);
}

.dot-normal {
    background: var(--fur);
}

/* image frames */
.img-frame {
    margin: 0;
}

.img-frame img {
    width: 100%;
    border-radius: var(--radius);
    border: 6px solid var(--paper);
    box-shadow: 0 20px 40px -22px rgba(33, 26, 18, 0.35);
    object-fit: cover;
    aspect-ratio: 4/3;
}

.img-frame figcaption {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--fur);
    margin-top: 0.7rem;
}

.img-frame-wide img {
    aspect-ratio: 21/9;
}

.gallery-section {
    padding-top: 0;
}

/* card grid */
.card-grid {
    margin-top: 2rem;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.2rem;
}

.info-card {
    background: var(--white);
    border: 1px solid rgba(33, 26, 18, 0.12);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.info-card h3 {
    color: var(--pasture-2);
    margin-bottom: 0.6rem;
}

.info-card p {
    font-size: 0.92rem;
    color: var(--ink-soft);
    margin: 0;
}

/* callout */
.callout {
    border-radius: var(--radius);
    padding: 1.5rem 1.7rem;
    border-left: 4px solid var(--clay);
    background: rgba(140, 59, 46, 0.12);
}

.callout-title {
    font-family: var(--font-mono);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: #e2a89c;
    margin-bottom: 0.6em;
}

.callout p:last-child {
    margin: 0;
    color: #f1e3df;
}

/* pros / cons */
.pros-cons {
    margin-top: 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.pc-col {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.8rem 2rem;
    border-top: 4px solid var(--fur);
}

.pc-good {
    border-top-color: var(--pasture);
}

.pc-bad {
    border-top-color: var(--clay);
}

.pc-col h3 {
    margin-bottom: 1rem;
}

.pc-col ul {
    margin: 0;
    padding-left: 1.1rem;
}

.pc-col li {
    margin-bottom: 0.7rem;
    color: var(--ink-soft);
    font-size: 0.95rem;
}

/* faq */
.faq-list {
    margin-top: 2rem;
    border-top: 1px solid rgba(33, 26, 18, 0.18);
}

.faq-item {
    border-bottom: 1px solid rgba(33, 26, 18, 0.18);
}

.faq-q {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--ink);
    padding: 1.3rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.faq-icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    position: relative;
}

.faq-icon::before,
.faq-icon::after {
    content: "";
    position: absolute;
    background: var(--pasture);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: transform 0.25s ease;
}

.faq-icon::before {
    width: 14px;
    height: 2px;
}

.faq-icon::after {
    width: 2px;
    height: 14px;
}

.faq-q[aria-expanded="true"] .faq-icon::after {
    transform: translate(-50%, -50%) rotate(90deg);
    opacity: 0;
}

.faq-a {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-a p {
    padding: 0 0 1.3rem;
    max-width: 42em;
    color: var(--ink-soft);
}

/* cta */
.cta-section {
    text-align: center;
}

.cta-inner {
    max-width: 40em;
    margin: 0 auto;
}

.cta-inner p {
    color: #d9d0bd;
}

.cta-inner .btn {
    margin-top: 1rem;
}

/* footer */
.site-footer {
    background: var(--ink);
    color: var(--fur);
    padding: 1.8rem 0 2.4rem;
}

.footer-inner p {
    margin: 0;
    font-size: 0.82rem;
    max-width: 46em;
}

/* reveal-on-scroll */
.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
    opacity: 1;
    transform: none;
}

/* =========================================================
   АДАПТИВ
   ========================================================= */

/* Планшети */
@media (max-width: 960px) {
    .hero-inner {
        grid-template-columns: 1fr;
    }

    .hero-media {
        order: -1;
        max-width: 420px;
        margin: 0 auto;
    }

    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .hstat {
        border-right: 1px solid rgba(33, 26, 18, 0.15);
    }

    .hstat:nth-child(2n) {
        border-right: none;
    }

    .hstat:nth-child(n+3) {
        border-top: 1px solid rgba(33, 26, 18, 0.15);
    }

    .two-col,
    .two-col.reverse {
        grid-template-columns: 1fr;
    }

    .two-col.reverse>*:first-child,
    .two-col.reverse>*:last-child {
        order: 0;
    }

    .two-col .img-frame {
        max-width: 480px;
    }

    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .spec-row {
        grid-template-columns: 1fr 1fr;
    }

    .spec-note {
        grid-column: 1 / -1;
    }
}

/* Мобільна навігація */
@media (max-width: 760px) {
    .main-nav {
        position: absolute;
        top: 68px;
        left: 0;
        right: 0;
        background: var(--paper);
        flex-direction: column;
        padding: 0.5rem clamp(1.25rem, 4vw, 2.5rem) 1.2rem;
        border-bottom: 1px solid rgba(33, 26, 18, 0.12);
        display: none;
        gap: 0.2rem;
    }

    .main-nav.is-open {
        display: flex;
    }

    .main-nav a {
        padding: 0.7rem 0;
        border-bottom: 1px solid rgba(33, 26, 18, 0.08);
    }

    .nav-toggle {
        display: flex;
    }
}

/* Мобільні телефони */
@media (max-width: 640px) {
    h1 {
        font-size: 2.3rem;
    }

    .hero-stats {
        grid-template-columns: 1fr 1fr;
    }

    .pros-cons {
        grid-template-columns: 1fr;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .btn {
        width: 100%;
    }

    .hero-cta {
        flex-direction: column;
    }

    .hero-cta .btn {
        width: 100%;
    }

    .spec-row {
        grid-template-columns: 1fr;
        gap: 0.3rem;
    }
}

@media (max-width: 400px) {
    .hero-stats {
        grid-template-columns: 1fr;
    }

    .hstat {
        border-right: none !important;
        border-top: 1px solid rgba(33, 26, 18, 0.15);
    }

    .hstat:first-child {
        border-top: none;
    }
}