/* Redesigned homepage. Loaded after /style.css; everything is prefixed h- so the
   inner pages (guides, landing pages, legal) keep their own look. */
html.js-home, body.home { overflow-x: clip; }
body.home { background: var(--bg); }
.h-wrap { max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.home h1, .home h2, .home h3 { font-family: 'Fredoka', 'Nunito Sans', sans-serif; letter-spacing: -0.01em; margin: 0; color: var(--text); }
:lang(ru) .home h1, :lang(ru).home h1 { font-family: 'Nunito Sans', sans-serif; font-weight: 800; }

/* ---------- Navigation ---------- */
.h-nav { position: sticky; top: 0; z-index: 30; background: rgba(255, 248, 241, 0.78);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .3s; }
.h-nav.scrolled { border-color: var(--border); }
.h-nav-in { display: flex; align-items: center; gap: 16px; height: 68px; }
.h-logo { display: flex; align-items: center; gap: 10px; font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 1.3rem; color: var(--text); }
.h-logo img { border-radius: 10px; }
.h-links { display: flex; gap: 26px; margin-left: 28px; font-weight: 700; font-size: .95rem; }
.h-links a { color: var(--text-secondary); }
.h-links a:hover { color: var(--primary-deep); text-decoration: none; }
.h-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.h-btn { display: inline-flex; align-items: center; justify-content: center; height: 44px; padding: 0 22px; border-radius: 999px;
  font-weight: 800; font-size: .95rem; white-space: nowrap; transition: transform .2s, box-shadow .2s, filter .2s; }
.h-btn:hover { text-decoration: none; filter: brightness(1.04); }
.h-btn-primary { background: var(--primary); color: #fff; box-shadow: 0 10px 24px rgba(255, 107, 44, .28); }
.h-btn-primary:hover { box-shadow: 0 14px 30px rgba(255, 107, 44, .36); }

/* ---------- Hero ---------- */
.h-hero { position: relative; padding: 64px 0 56px; }
.h-hero-grid { display: grid; grid-template-columns: 1.02fr 1fr; gap: 48px; align-items: center; }
.h-eyebrow { display: inline-flex; background: var(--primary-soft); color: var(--primary-deep); font-weight: 800; font-size: .8rem; padding: 7px 14px; border-radius: 999px; }
.h-hero h1 { font-size: clamp(2.3rem, 4.8vw, 3.7rem); line-height: 1.06; margin: 20px 0 18px; }
.h-hero h1 .accent { color: var(--primary); }
.h-hero h1, .h-head h2 { text-wrap: balance; }
:lang(ja) .h-hero h1 { font-size: clamp(2rem, 4vw, 3.1rem); word-break: auto-phrase; line-height: 1.25; }
.h-lead { font-size: 1.15rem; color: var(--text-secondary); max-width: 520px; margin: 0 0 28px; line-height: 1.6; }
.h-facts { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 26px 0 0; padding: 0; list-style: none; color: var(--text-secondary); font-size: .9rem; font-weight: 700; }
.h-facts li { display: inline-flex; align-items: center; gap: 7px; }
.h-facts svg { color: var(--primary); flex: none; }

/* Aurora wash + dotted grid behind the hero */
.h-hero::before { content: ''; position: absolute; inset: -120px 0 0 0; z-index: -2;
  background:
    radial-gradient(40% 50% at 78% 28%, rgba(255, 140, 66, .26), transparent 70%),
    radial-gradient(34% 44% at 16% 72%, rgba(120, 190, 120, .16), transparent 70%),
    radial-gradient(30% 40% at 62% 88%, rgba(20, 166, 224, .12), transparent 70%);
  background-size: 160% 160%; animation: h-aurora 24s ease-in-out infinite alternate; }
.h-hero::after { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(rgba(46, 41, 38, .10) 1px, transparent 1px); background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(60% 70% at 70% 40%, #000 30%, transparent 75%);
  mask-image: radial-gradient(60% 70% at 70% 40%, #000 30%, transparent 75%); }
@keyframes h-aurora { 0% { background-position: 0% 0%; } 50% { background-position: 60% 40%; } 100% { background-position: 100% 100%; } }

/* ---------- Demo card ---------- */
.h-stage { position: relative; perspective: 1400px; max-width: 460px; margin: 0 auto; width: 100%; }
.h-orbit { position: absolute; left: 50%; top: 50%; width: 122%; aspect-ratio: 1; transform: translate(-50%, -50%); pointer-events: none; z-index: -1; }
.h-orbit i { position: absolute; inset: 0; border-radius: 50%; border: 1.5px dashed rgba(255, 107, 44, .22); animation: h-turn 70s linear infinite; }
.h-orbit i + i { inset: 10%; border-style: solid; border-color: rgba(255, 107, 44, .10); animation-duration: 100s; animation-direction: reverse; }
@keyframes h-turn { to { transform: rotate(360deg); } }
.h-card { background: var(--surface); border-radius: 28px; padding: 22px; box-shadow: 0 24px 60px rgba(70, 40, 20, .14), 0 4px 10px rgba(70, 40, 20, .06);
  border: 1px solid var(--border); transition: transform .25s ease-out; will-change: transform; transform-style: preserve-3d; }
.demo-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 12px; }
.demo-pet { display: flex; align-items: center; gap: 10px; min-width: 0; }
.demo-pet .pet-av { width: 40px; height: 40px; border-radius: 50%; background: var(--primary-soft); display: grid; place-items: center; font-size: 1.3rem; flex: none; }
.demo-pet small { display: block; color: var(--text-muted); font-weight: 700; font-size: .75rem; line-height: 1.2; }
.demo-pet b { font-family: 'Fredoka', 'Nunito Sans', sans-serif; font-size: 1.15rem; line-height: 1.2; }
.demo-count { font-weight: 800; font-size: .85rem; padding: 6px 12px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-deep); white-space: nowrap; font-variant-numeric: tabular-nums; }
.demo-bar { height: 6px; border-radius: 6px; background: #F2E9E2; overflow: hidden; margin-bottom: 14px; }
.demo-bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--primary), #FF9A5C); border-radius: 6px; transition: width .6s ease-out; }
.demo-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.demo-row { display: grid; grid-template-columns: 40px 1fr auto 28px; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px;
  background: #FFF7F0; border: 1px solid #F6E8DC; transition: background .4s, border-color .4s; }
.demo-row .ic { width: 40px; height: 40px; border-radius: 12px; background: #fff; display: grid; place-items: center; font-size: 1.15rem; box-shadow: 0 1px 2px rgba(70, 40, 20, .08); }
.demo-row .txt b { display: block; font-size: .95rem; color: var(--text); line-height: 1.25; }
.demo-row .txt small { color: var(--text-muted); font-weight: 700; font-size: .75rem; }
.demo-row .who { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 800; color: var(--text-secondary);
  background: #fff; padding: 4px 9px 4px 4px; border-radius: 999px; box-shadow: 0 1px 2px rgba(70, 40, 20, .08); transition: opacity .4s, transform .4s; }
.demo-row .who i { width: 20px; height: 20px; border-radius: 50%; font-style: normal; display: grid; place-items: center; font-size: .68rem; color: #fff; background: var(--primary); }
.demo-row .who.a2 i { background: #14A6E0; } .demo-row .who.a3 i { background: #43A047; }
.demo-row .tick { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #E8DFD8; display: grid; place-items: center; color: #fff; transition: background .35s, border-color .35s, transform .35s; }
.demo-row .tick svg { width: 14px; height: 14px; opacity: 0; transform: scale(.5); transition: opacity .3s, transform .3s; }
.demo-row.done { background: var(--success-soft, #EAF7EA); border-color: #D5EDD6; }
.demo-row.done .tick { background: #43A047; border-color: #43A047; }
.demo-row.done .tick svg { opacity: 1; transform: none; }
.demo-row.done .txt b { color: #3B6B3E; }
.js-home .demo-row:not(.done) .who { opacity: 0; transform: translateX(6px); }
.demo-note { margin: 14px 2px 0; color: var(--text-muted); font-size: .76rem; font-weight: 700; }

.h-chip { position: absolute; background: var(--surface); border-radius: 14px; padding: 9px 13px; box-shadow: 0 16px 36px rgba(70, 40, 20, .16);
  font-size: .8rem; font-weight: 800; display: flex; align-items: center; gap: 8px; max-width: 250px; opacity: 0; transform: translateY(8px);
  transition: opacity .6s ease, transform .6s ease; border: 1px solid var(--border); }
.h-chip.c1 { right: -14px; top: -22px; } .h-chip.c2 { left: -20px; bottom: -26px; }
.h-stage.in .h-chip { opacity: 1; transform: none; }
.h-stage.in .h-chip.c1 { transition-delay: 1.4s; } .h-stage.in .h-chip.c2 { transition-delay: 2.2s; }
html:not(.js-home) .h-chip { opacity: 1; transform: none; }

/* ---------- Sections ---------- */
.h-sec { padding: 84px 0; }
.h-head { text-align: center; max-width: 700px; margin: 0 auto 48px; }
.h-kicker { color: var(--primary-deep); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: .78rem; }
.h-head h2 { font-size: clamp(1.8rem, 3.8vw, 2.7rem); line-height: 1.14; margin: 10px 0 12px; }
.h-head p { color: var(--text-secondary); font-size: 1.08rem; margin: 0; line-height: 1.6; }

.h-strip { padding: 30px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: rgba(255, 255, 255, .5); }
.h-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; text-align: center; margin: 0; padding: 0; list-style: none; }
.h-stats b { display: block; font-family: 'Fredoka', 'Nunito Sans', sans-serif; font-size: 2.6rem; font-weight: 700; color: var(--primary); line-height: 1.1; font-variant-numeric: tabular-nums; }
:lang(ru) .h-stats b { font-family: 'Nunito Sans', sans-serif; }
.h-stats span { color: var(--text-secondary); font-weight: 700; font-size: .9rem; }

.h-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.h-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.h-tile { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 24px;
  box-shadow: 0 8px 24px rgba(70, 40, 20, .05); transition: transform .3s, box-shadow .3s, border-color .3s; color: var(--text); }
a.h-tile:hover { border-color: var(--primary); box-shadow: 0 16px 36px rgba(70, 40, 20, .10); text-decoration: none; }
.h-tile h3 { font-size: 1.15rem; margin: 0 0 8px; }
.h-tile p { margin: 0; color: var(--text-secondary); font-size: .95rem; line-height: 1.6; }
.h-tile .ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 1.3rem; margin-bottom: 16px; }
.h-tile .more { display: inline-block; margin-top: 14px; font-weight: 800; font-size: .9rem; color: var(--primary-deep); }

/* Steps: a line drawn across as they come into view */
.h-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; position: relative; margin: 0; padding: 0; list-style: none; }
.h-steps::before { content: ''; position: absolute; left: 40px; right: 40px; top: 44px; height: 2px; background: var(--border); z-index: 0; }
.h-steps::after { content: ''; position: absolute; left: 40px; top: 44px; height: 2px; width: 0; background: var(--primary); z-index: 0; transition: width 1.6s cubic-bezier(.4, 0, .2, 1) .2s; }
.h-steps.drawn::after { width: calc(100% - 80px); }
.h-step { position: relative; z-index: 1; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 24px 22px; box-shadow: 0 8px 24px rgba(70, 40, 20, .05); }
.h-step .num { width: 40px; height: 40px; border-radius: 13px; background: var(--primary); color: #fff; display: grid; place-items: center; font-family: 'Fredoka', sans-serif; font-weight: 700; margin-bottom: 16px; }
.h-step h3 { font-size: 1.1rem; margin-bottom: 8px; }
.h-step p { margin: 0; color: var(--text-secondary); font-size: .95rem; line-height: 1.6; }

.h-shots .gallery-scroll { padding-top: 0; }
.h-quote { background: var(--surface); border: 1px solid var(--border); border-radius: 28px; padding: 44px 40px; display: flex; gap: 32px; align-items: center; box-shadow: 0 8px 24px rgba(70, 40, 20, .05); }
.h-quote img { border-radius: 26px; flex: none; }
.h-quote h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin-bottom: 10px; }
.h-quote p { margin: 0; color: var(--text-secondary); font-size: 1.05rem; line-height: 1.65; max-width: 56ch; }

.h-faq { max-width: 780px; margin: 0 auto; }
.h-faq .faq details { border-radius: 18px; padding: 2px 22px; }
.h-faq .faq summary { font-size: 1.02rem; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.h-faq .faq summary::-webkit-details-marker { display: none; }
.h-faq .faq summary::after { content: '+'; font-size: 1.5rem; line-height: 1; color: var(--primary); transition: transform .3s; flex: none; }
.h-faq .faq details[open] summary::after { transform: rotate(45deg); }

.h-final { background: linear-gradient(135deg, #E8551C, #FF7A3D); color: #fff; border-radius: 36px; padding: 64px 32px; text-align: center; position: relative; overflow: hidden; }
.h-final h2 { color: #fff; font-size: clamp(1.8rem, 4vw, 2.8rem); line-height: 1.12; margin-bottom: 12px; position: relative; }
.h-final p { color: rgba(255, 255, 255, .88); font-size: 1.08rem; margin: 0 auto 28px; max-width: 560px; position: relative; }
.h-final .store-badges { justify-content: center; position: relative; }
.h-final i { position: absolute; border: 2px solid rgba(255, 255, 255, .14); border-radius: 50%; }
.h-final i.a { width: 420px; height: 420px; right: -120px; top: -170px; } .h-final i.b { width: 280px; height: 280px; left: -90px; bottom: -130px; }
.h-contact { text-align: center; padding: 40px 0 8px; color: var(--text-secondary); }
.h-contact a { font-weight: 800; }

/* Reveal on scroll (only when JS is running) */
.js-home .reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
.js-home .reveal.in { opacity: 1; transform: none; }
.d1 { transition-delay: .08s !important; } .d2 { transition-delay: .16s !important; } .d3 { transition-delay: .24s !important; } .d4 { transition-delay: .32s !important; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .h-hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .h-links { display: none; }
  .h-grid-4, .h-steps { grid-template-columns: 1fr 1fr; }
  .h-grid-3 { grid-template-columns: 1fr 1fr; }
  .h-steps::before, .h-steps::after { display: none; }
  .h-orbit { width: 108%; }
  .h-chip.c1 { right: 8px; top: -22px; } .h-chip.c2 { left: 8px; bottom: -22px; }
  .h-quote { flex-direction: column; text-align: center; padding: 34px 24px; }
}
@media (max-width: 600px) {
  .h-hero { padding: 36px 0 48px; }
  .h-grid-4, .h-grid-3, .h-steps { grid-template-columns: 1fr; }
  .h-stats { grid-template-columns: 1fr 1fr; }
  .h-nav-cta { display: none; }
  .h-logo { font-size: 1.15rem; }
  .h-sec { padding: 60px 0; }
  .h-final { padding: 48px 22px; border-radius: 28px; }
  .h-card { padding: 16px; border-radius: 24px; }
  .demo-row { grid-template-columns: 36px 1fr auto 24px; gap: 8px; padding: 9px 10px; }
  .demo-row .ic { width: 36px; height: 36px; }
  .demo-row .who { font-size: .72rem; }
  .h-chip { font-size: .74rem; padding: 7px 10px; max-width: 200px; }
}

@media (prefers-reduced-motion: reduce) {
  .h-hero::before, .h-orbit i { animation: none !important; }
  .js-home .reveal { opacity: 1; transform: none; transition: none; }
  .h-card, .demo-row, .demo-row .tick, .demo-row .tick svg, .demo-row .who, .demo-bar i, .h-chip, .h-steps::after { transition: none !important; }
  .js-home .demo-row:not(.done) .who { opacity: 1; transform: none; }
  .h-chip { opacity: 1; transform: none; }
  .h-steps::after { width: calc(100% - 80px); }
}
