/* Declared before Tailwind's own layers so its utilities always win over these. */
@layer components;
:root {
  --ink: #2a2a2a; --navy: #141416; --blue: #3172c8; --yellow: #cadef8;
  --sky: #e3ecf8; --muted: #6f6a73;
}
html { scroll-behavior: smooth; }
html, body { margin: 0; background: #fff; overflow-x: clip; }
body { font-family: 'Onest', sans-serif; color: var(--ink); -webkit-font-smoothing: antialiased; }
.ff-manrope { font-family: 'Onest', sans-serif; }
.ff-montserrat { font-family: 'Montserrat', sans-serif; }
.ff-impact { font-family: Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif; }
.ff-hand { font-family: 'Bradley Hand', 'Segoe Script', cursive; }
.ff-sf { font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif; }

@layer components {
/* ---- Type scale: one style per level, used everywhere ---- */
/* Line heights: headings use "1em + a fixed gap", so the ratio tightens as
   the fluid size grows (H1 ≈1.09 at 64px, ≈1.17 at 36px; H2 ≈1.15 → 1.25)
   — big display type needs less leading, small headings more. Reading text
   is set compact at 1.3 (design choice; tighter than WCAG's 1.5 guideline,
   and the layout still reflows if users raise it). 1.3 rather than 1.2
   leaves room for Cyrillic marks (й, ї, Й). Headings balance their lines
   so they don't leave a lone word on the last line. */
.t-h1, .t-h2, .t-h3, .t-h4 { text-wrap: balance; }
.t-h1    { font-weight: 700; font-size: clamp(36px, 5.6vw, 64px); line-height: calc(1em + 6px);  letter-spacing: -0.045em; }
.t-h2    { font-weight: 700; font-size: clamp(32px, 4.2vw, 54px); line-height: calc(1em + 8px);  letter-spacing: -0.04em; }
.t-h3    { font-weight: 700; font-size: clamp(22px, 2.2vw, 30px); line-height: calc(1em + 6px);  letter-spacing: -0.025em; }
.t-h4    { font-weight: 700; font-size: clamp(17px, 1.4vw, 20px); line-height: calc(1em + 7px);  letter-spacing: -0.02em; }
.t-lead  { font-weight: 400; font-size: clamp(17px, 1.5vw, 20px); line-height: 1.3; letter-spacing: -0.015em; }
.t-body  { font-weight: 400; font-size: 16px; line-height: 1.3; letter-spacing: -0.01em; }
.t-small { font-weight: 400; font-size: 14px; line-height: 1.35; }
.t-label { font-weight: 700; font-size: 12px; line-height: 1.35; letter-spacing: 0.08em; text-transform: uppercase; }
.brand   { color: var(--blue); }

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 54px; padding: 0 26px;
       border-radius: 999px; font-weight: 800; font-size: 16px; line-height: 21px; white-space: nowrap;
       transition: filter .15s, background-color .15s, translate .25s var(--ease), box-shadow .25s var(--ease); }
.btn:hover { filter: brightness(1.08); translate: 0 -2px; box-shadow: 0 8px 16px -10px rgba(52,92,144,.30); }
.btn:active { translate: 0 0; box-shadow: none; }
.btn-navy   { background: var(--navy); color: #fff; }
.btn-blue   { background: var(--blue); color: #fff; }
.btn-yellow { background: var(--yellow); color: #141416; }
.btn-outline { border: 2px solid var(--navy); color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: #fff; filter: none; }
/* TikTok brand: black with the logo's cyan/pink offset glow. */
.btn-tiktok { background: #010101; color: #fff; box-shadow: -3px -2px 0 0 #25f4ee, 3px 2px 0 0 #fe2c55; }
.btn-tiktok img { filter: drop-shadow(-1.5px -1px 0 #25f4ee) drop-shadow(1.5px 1px 0 #fe2c55); }
.btn-tiktok:hover { box-shadow: -4px -3px 0 0 #25f4ee, 4px 3px 0 0 #fe2c55; }
/* Quiet brand-coloured icon buttons (header socials): the SVG is used as a
   mask so it takes the text colour. */
.btn-mono { background: var(--sky); color: var(--navy); }
.btn-mono:hover { background: var(--navy); color: #fff; filter: none; }
.btn-soft { background: #f2f2f4; color: var(--navy); }
.btn-soft:hover { background: var(--navy); color: #fff; filter: none; translate: none; box-shadow: none; }
.lang-toggle { display: flex; align-items: center; height: 44px; padding: 4px; border-radius: 999px; background: var(--sky); margin-right: 4px; }
.lang-opt { display: flex; align-items: center; height: 36px; padding: 0 13px; border-radius: 999px;
            font-size: 14px; font-weight: 700; color: rgba(20,20,22,.5); transition: color .15s, background-color .15s; }
a.lang-opt:hover { color: var(--navy); }
.lang-opt.is-active { background: #fff; color: var(--navy); box-shadow: 0 1px 2px rgba(20,20,22,.10); }
/* Set the icon inline: style="-webkit-mask-image:url(assets/x.svg);mask-image:url(assets/x.svg)". (A url() inside a CSS variable would resolve against this file's folder.) */
.icon-mask { display: inline-block; background: currentColor; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
.btn-sm { min-height: 44px; padding: 0 22px; font-size: 14px; }
.link { text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--blue); }

/* ---- Email form pill ---- */
.signup { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 600px; border-radius: 999px; padding: 8px 8px 8px 24px; }
.signup input { flex: 1; min-width: 0; background: transparent; outline: none; font-size: 16px; }
@media (max-width: 479px) {
  .signup { padding: 6px 6px 6px 18px; }
  .signup .btn { min-height: 46px; padding: 0 16px; font-size: 14px; }
}

/* A "stage" keeps a fixed-size piece of the Figma canvas and scales it to the
   width it is given. --w/--h is the visible region, --x/--y its offset. */
.stage { position: relative; overflow: hidden; width: 100%; max-width: calc(var(--w) * 1px); }
.stage > .stage-inner { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.stage-cover { position: absolute; inset: 0; max-width: none; }

.wave { position: absolute; left: 0; width: 100%; height: 55px; pointer-events: none; transform: scaleY(-1); }
/* Meme captions: uppercase Impact with a classic black outline (stroke painted under the fill). */
.meme-caps p, .meme-caps span { text-transform: uppercase; }
.meme-caps .ff-impact, .meme-caps .ff-impact * { -webkit-text-stroke: 4px #000; paint-order: stroke fill; }

.faq summary { list-style: none; cursor: pointer; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary img { transition: transform .2s ease; }
.faq details[open] summary img { transform: rotate(180deg); }
.faq details[open] { background: #eef4fb; }

}
/* ---- Motion ---- */
:root { --ease: cubic-bezier(.16, 1, .3, 1); --spring: cubic-bezier(.34, 1.56, .64, 1); }
@keyframes floaty  { 0%, 100% { translate: 0 0; } 50% { translate: 0 var(--amp, -10px); } }
@keyframes wiggle  { 0%, 84%, 100% { rotate: 0deg; } 88% { rotate: -5deg; } 92% { rotate: 4deg; } 96% { rotate: -2deg; } }
@keyframes doodle  { 0%, 100% { translate: 0 0; rotate: 0deg; } 50% { translate: 5px 8px; rotate: 7deg; } }
@keyframes breathe { 0%, 100% { scale: 1; } 50% { scale: 1.06; } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes shine   { 0% { transform: translateX(-130%) skewX(-20deg); } 35%, 100% { transform: translateX(260%) skewX(-20deg); } }
@keyframes faq-in  { from { opacity: 0; transform: translateY(-8px); } }
@keyframes blink   { 50% { opacity: 0; } }
@keyframes pulse   { 0% { box-shadow: 0 0 0 0 rgba(19,140,209,.55); } 70%, 100% { box-shadow: 0 0 0 10px rgba(19,140,209,0); } }
@keyframes hop     { 40% { translate: 0 -5px; scale: 1.12; } 70% { translate: 0 1px; scale: .96; } }

.lift { transition: translate .35s var(--ease), box-shadow .35s var(--ease); }
.lift:hover { translate: 0 -6px; box-shadow: 0 16px 32px -20px rgba(52,92,144,.18); }
.hop:hover > img { animation: hop .5s var(--ease); }

@media (prefers-reduced-motion: no-preference) {
  /* Reveal on entering the viewport: [data-reveal] (variant) + [data-d] (delay, ms). */
  .js [data-reveal] {
    opacity: 0; transform: var(--from, translateY(32px));
    transition: opacity .7s var(--ease) var(--d, 0ms), transform .9s var(--ease) var(--d, 0ms),
                clip-path 1.1s var(--ease) var(--d, 0ms), translate .35s var(--ease), scale .35s var(--ease), box-shadow .35s var(--ease);
  }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
  [data-reveal="down"]  { --from: translateY(-24px); }
  [data-reveal="zoom"]  { --from: scale(.9); }
  [data-reveal="pop"]   { --from: scale(.55); }
  [data-reveal="rise"]  { --from: translateY(140px); }
  [data-reveal="left"]  { --from: translateX(-56px); }
  [data-reveal="right"] { --from: translateX(56px); }
  [data-reveal="drop"]  { --from: translateY(-70px) rotate(-12deg) scale(1.12); }
  [data-reveal="toss"]  { --from: translateY(90px) rotate(16deg) scale(.8); }
  [data-reveal="tilt"]  { --from: rotate(-12deg) scale(.86); }
  [data-reveal="fade"]  { --from: none; }
  [data-reveal="grow"]  { --from: scaleX(0); }
  [data-reveal="fly"]   { --from: translate(calc(var(--fx, 0) * 1px), calc(var(--fy, 0) * 1px)) scale(.35); }
  .js [data-reveal="fly"] { transition-duration: .5s, 1.1s, 1.1s, .35s, .35s, .35s; }
  .js [data-reveal="line"] { transform: none; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.6s var(--ease) var(--d, 0ms); }
  .js [data-reveal="line"].is-in { stroke-dashoffset: 0; }
  .js .ring-progress { stroke-dashoffset: 94.25; transition: stroke-dashoffset 1.4s var(--ease) .7s; }
  .js .stage.is-in .ring-progress { stroke-dashoffset: 47; }
  .caret::after { content: ""; display: inline-block; width: 2px; height: 1.1em; margin-left: 2px; vertical-align: -0.2em; background: #3172c8; animation: blink 1s steps(1) infinite; }
  .pulse { animation: pulse 2.2s ease-out 1.6s infinite; }
  .js [data-reveal="pop"], .js [data-reveal="toss"], .js [data-reveal="tilt"] {
    transition-timing-function: var(--ease), var(--spring), var(--ease), var(--ease), var(--ease), var(--ease);
  }
  .js [data-reveal="draw"] { transform: none; clip-path: inset(0 100% 0 0); }
  .js [data-reveal="draw"].is-in { clip-path: inset(0 0 0 0); }

  /* Idle loops */
  .float   { animation: floaty var(--dur, 6s) ease-in-out var(--fd, 0s) infinite; }
  .wiggle  { animation: wiggle 5s ease-in-out var(--fd, 1.6s) infinite; transform-origin: 50% 100%; }
  .doodle  { animation: doodle 3.4s ease-in-out infinite; }
  .breathe { animation: breathe 9s ease-in-out infinite; }
  .shimmer { background: linear-gradient(90deg, #e3ecf8 0%, #f8fcfe 40%, #e3ecf8 80%) 0 0 / 200% 100%; animation: shimmer 2.2s linear infinite; }
  .btn-shine { position: relative; overflow: hidden; isolation: isolate; }
  .btn-shine::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 45%; pointer-events: none;
                      background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent); animation: shine 5s ease-in-out 1.8s infinite; }
  .faq details[open] > p { animation: faq-in .4s var(--ease); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
@supports (interpolate-size: allow-keywords) {
  @media (prefers-reduced-motion: no-preference) {
    :root { interpolate-size: allow-keywords; }
    .faq details::details-content { height: 0; overflow: clip; transition: height .4s var(--ease), content-visibility .4s allow-discrete; }
    .faq details[open]::details-content { height: auto; }
  }
}

/* Sign-up form messages: errors, and "did you mean…?" typo hints. */
.form-msg { font-size: 14px; line-height: 1.4; text-align: center; color: #c62828; }
.form-msg[data-kind="hint"] { color: #3172c8; }
.form-msg-dark { color: #ffb4b4; }
.form-msg-dark[data-kind="hint"] { color: #cadef8; }
.form-fix { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.signup:has(input[aria-invalid="true"]) { box-shadow: 0 0 0 2px #e5484d; }
button:disabled { opacity: .6; cursor: progress; }
input::placeholder { color: inherit; opacity: 1; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

/* ---- Blog ---- */
/* Header button of the page you're on. */
.btn-mono[aria-current="page"] { background: var(--navy); color: #fff; }
/* Rodent filter chips: same pill as the "Для кого" tags, filled when chosen. */
.chip { display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; border: 2px solid rgba(20,20,22,.2);
        background: #fff; padding: 8px 16px; font-weight: 600; font-size: 16px; line-height: 1.3; white-space: nowrap; cursor: pointer;
        transition: border-color .15s, color .15s, background-color .15s, translate .25s var(--ease); }
.chip:hover { border-color: var(--blue); color: var(--blue); }
.chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip .chip-n { font-size: 12px; font-weight: 700; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--sky); color: var(--navy); text-align: center; }
.chip[aria-pressed="true"] .chip-n { background: rgba(255,255,255,.18); color: #fff; }
.chip:disabled { opacity: .45; cursor: default; }
.chip:disabled:hover { border-color: rgba(20,20,22,.2); color: inherit; }
@media (min-width: 768px) { .chip { padding: 10px 20px; } }
.blog-search input::-webkit-search-cancel-button { display: none; }
.blog-card mark { background: rgba(202,222,248,.7); color: inherit; border-radius: 4px; padding: 0 2px; }
.blog-card--hero mark { background: rgba(202,222,248,.9); color: #141416; }
.blog-hero-title { font-size: clamp(28px, 3vw, 42px); }
/* Polaroid photo: tilted a little (--tilt), straightens on hover. Sticker: rotated label. */
.polaroid { rotate: var(--tilt, 0deg); transition: rotate .5s var(--spring), scale .5s var(--ease); }
.group:hover .polaroid { rotate: 0deg; scale: 1.015; }
.sticker { rotate: var(--st, -5deg); transition: rotate .5s var(--spring); }
.group:hover .sticker { rotate: calc(var(--st, -5deg) * -1); }
@keyframes card-in { from { opacity: 0; transform: translateY(24px); } }
@media (prefers-reduced-motion: no-preference) {
  .blog-card { animation: card-in .6s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }
}
@media (prefers-reduced-motion: reduce) {
  .polaroid, .sticker { transition: none; }
}

/* Phones: a tighter language toggle so the logo, blog and CTA buttons fit in the header. */
@media (max-width: 639px) {
  .lang-toggle { margin-right: 0; }
  .lang-opt { padding: 0 10px; }
}

/* ---- Phones: the email gets a full row, the button sits under it ---- */
@media (max-width: 639px) {
  form[data-signup] .signup { flex-wrap: wrap; gap: 6px; padding: 8px; border-radius: 30px; }
  form[data-signup] .signup > img { width: 18px; height: 16px; margin-left: 14px; }
  form[data-signup] .signup input { flex: 1 1 0; min-height: 52px; }
  form[data-signup] .signup .btn { flex: 1 0 100%; min-height: 54px; padding: 0 20px; font-size: 16px; }
}

/* ---- Touch screens: small links keep a finger-sized hit area ---- */
@media (max-width: 1023px) {
  .lang-opt { position: relative; min-width: 44px; justify-content: center; }
  .lang-opt::after { content: ""; position: absolute; inset: -4px 0; }
  a[aria-label^="Roddi Health"] { position: relative; }
  a[aria-label^="Roddi Health"]::after { content: ""; position: absolute; inset: -6px; }
  footer nav a { display: inline-flex; align-items: center; min-height: 44px; }
  form[data-signup] label { min-height: 44px; align-items: center; }
}

/* ---- Phone header: logo centred, controls either side ---- */
@media (max-width: 639px) {
  header > .breathe { display: none; }
  header > nav > a[aria-label^="Roddi Health"] { position: absolute; left: 50%; top: 36px; transform: translate(-50%, -50%); }
  header > nav > a[aria-label^="Roddi Health"] > img { width: 38px; height: 38px; }
  header > nav > div:last-child { width: 100%; gap: 6px; }
  header > nav .btn-sm { min-height: 32px; padding: 0 11px; font-size: 12px; position: relative; }
  header > nav .btn-sm::before { content: ""; position: absolute; inset: -6px 0; }
  header > nav .btn-navy { margin-left: auto; }
  header > nav .lang-toggle { height: 32px; padding: 2px; }
  header > nav .lang-opt { height: 28px; min-width: 32px; padding: 0 6px; font-size: 12px; }
  header > nav .lang-opt::after { inset: -8px 0; }
}


/* ---- Phone side menu ---- */
.menu-btn { display: none; }
@media (max-width: 639px) {
  .menu-btn { display: inline-flex; align-items: center; justify-content: center; position: relative; width: 32px; height: 32px; flex: none; border-radius: 999px; background: var(--sky); color: var(--navy); }
  .menu-btn::before { content: ""; position: absolute; inset: -6px; }
}
.menu-close { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-right: -6px; border-radius: 999px; background: var(--sky); color: var(--navy); }
.site-menu { position: fixed; inset: 0 auto 0 0; width: min(320px, 84vw); max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; border-radius: 0 28px 28px 0; background: #fff; color: var(--navy); box-shadow: 0 24px 60px -20px rgba(20,20,22,.5); }
.site-menu::backdrop { background: rgba(20,20,22,.45); }
.site-menu-inner { height: 100%; padding: 22px 20px; overflow-y: auto; }
.site-menu-link { display: flex; align-items: center; justify-content: space-between; min-height: 58px; border-bottom: 1px solid rgba(20,20,22,.1); font-size: 20px; font-weight: 700; }
.site-menu-link[aria-current="page"] { color: var(--blue); }
html:has(.site-menu[open]) { overflow: hidden; }
@keyframes menu-in { from { transform: translateX(-100%); } }
@keyframes menu-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: no-preference) {
  .site-menu[open] { animation: menu-in .3s var(--ease); }
  .site-menu[open]::backdrop { animation: menu-fade .3s ease; }
}

/* ---- Email field: hint and icon share one soft colour ---- */
form[data-signup] .signup input::placeholder { color: rgba(42,42,42,.45); opacity: 1; }
form[data-signup] .signup > img { opacity: .643; } /* the icon is already 70% #2a2a2a */

/* ---- "Who it's for" photo carousel ---- */
.pet-carousel { --pet-w: clamp(180px, 21vw, 300px); position: relative; height: calc(var(--pet-w) * 1.25 + var(--arc-room, clamp(112px, 17.7vw - 130px, 240px))); overflow: hidden; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.pet-card { position: absolute; top: 16px; left: 0; width: var(--pet-w); aspect-ratio: 4 / 5; padding: 7px; border-radius: 28px; background: #fff; box-shadow: 0 1px 3px rgba(20,20,22,.10), 0 6px 14px -8px rgba(20,20,22,.20); will-change: transform; }
.pet-card img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 21px; pointer-events: none; }
@media (max-width: 767px) {
  .pet-carousel { --pet-w: min(54vw, 250px); --arc-room: 76px; }
}

/* Blog articles in the HTML for crawlers and no-JS readers; the page script draws the cards. */
.js .blog-static { display: none; }

/* Skip link: hidden until a keyboard user tabs to it. */
.skip-link { position: fixed; left: 12px; top: 12px; z-index: 100; padding: 12px 18px; border-radius: 999px; background: #0f0f11; color: #fff; font: 500 14px Onest, system-ui, sans-serif; text-decoration: none; transform: translateY(-160%); transition: transform .2s ease; }
.skip-link:focus { transform: none; }
@media (prefers-reduced-motion: reduce) { .skip-link { transition: none; } }
