/* ─── ZaDeteto parenting lead-gen landings (tests.zadeteto.com/tree, /otvatre, /mk-tree) ───
 * Self-contained ZaDeteto-branded styling for the three lead-gen heroes. PT Serif headings +
 * Inter body, ZaDeteto purple. Triad-polished: mesh-gradient + grain backdrop, custom easing,
 * staggered entrance, transform/opacity-only motion, prefers-reduced-motion honoured.
 * Shared by tree.html (Коренът), otvatre.html (отвътре навън), mk-tree.html (Коренът + code gate). */

:root {
  --accent: #7c4dff; --accent-deep: #6034e0; --gold: #f5d76e;
  --bg: #fdfcfb; --surface: #fff; --text: #1a103c; --body: #4b4170;
  --muted: #8b80b0; --border: #ece8f3; --lav: #efeafc;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-card: 0 28px 70px -22px rgba(26, 16, 60, 0.30);
  --shadow-btn: 0 12px 28px rgba(124, 77, 255, 0.30);
}
* { box-sizing: border-box; }
/* PT Serif (headings) + Inter (body) is the established ZaDeteto brand pair — a deliberate
   brand lock, kept consistent with zadeteto.com, not the generic Inter default. */
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.6; position: relative; overflow-x: hidden;
}
/* mesh-gradient backdrop */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(42rem 32rem at 86% -8%, rgba(124, 77, 255, 0.11), transparent 60%),
    radial-gradient(34rem 30rem at -6% 112%, rgba(245, 215, 110, 0.09), transparent 60%),
    radial-gradient(52rem 42rem at 50% 38%, rgba(157, 135, 240, 0.05), transparent 70%);
}
/* grain */
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E");
}

.top { display: flex; justify-content: space-between; align-items: center; padding: 20px 32px; border-bottom: 1px solid var(--border); }
.brand { font-family: 'PT Serif', serif; font-weight: 700; color: var(--accent-deep); font-size: 18px; text-decoration: none; }

.hero { max-width: 800px; margin: 0 auto; padding: 56px 28px 78px; text-align: center; }
.eyebrow { font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--accent-deep); font-weight: 600; margin: 0 0 18px; }
h1 { font-family: 'PT Serif', serif; font-weight: 700; font-size: 48px; line-height: 1.08; margin: 0; letter-spacing: -.015em; text-wrap: balance; }
h1 .suffix { display: block; font-size: 30px; color: var(--accent-deep); font-weight: 400; font-style: italic; margin-top: 8px; }

/* tree photo (Коренът): duotone-purple, clip-path grow + slow Ken-Burns */
.tree { position: relative; isolation: isolate; max-width: 620px; margin: 40px auto 22px; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-card); clip-path: inset(100% 0 0 0); }
.tree img { display: block; width: 100%; filter: grayscale(1) contrast(1.02) brightness(1.12); transform-origin: center; }
.tree::after { content: ""; position: absolute; inset: 0; background: linear-gradient(155deg, #6034e0 0%, #a98ff0 58%, #dccff7 100%); mix-blend-mode: multiply; opacity: .82; }

/* prism graphic (отвътре навън) */
.graphic { margin: 44px auto 28px; max-width: 720px; }
.graphic svg { width: 100%; height: auto; display: block; overflow: visible; }
/* SVG labels inherit the page font (Inter) — avoids an FOUT reflow inside the graphic */
.graphic svg text { font-family: inherit; }

.caption { font-size: 13px; color: var(--muted); margin: 0 auto; max-width: 540px; font-style: italic; text-wrap: pretty; }
.graphic .caption { margin-top: 14px; font-style: normal; max-width: 560px; }

.intro { max-width: 572px; margin: 32px auto 38px; text-align: left; }
.intro p { color: var(--body); font-size: 17px; margin: 0 0 16px; text-wrap: pretty; }

.btn { display: inline-block; background: var(--text); color: #fff; font-weight: 600; font-size: 16px; text-decoration: none; padding: 16px 38px; border: none; border-radius: 10px; box-shadow: var(--shadow-btn); cursor: pointer; transition: transform 180ms var(--ease-out), box-shadow 220ms var(--ease-out); }
.btn:active { transform: scale(.97); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) { .btn:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(124, 77, 255, .36); } }
.sub { display: block; color: var(--muted); font-size: 13px; margin-top: 15px; }

/* price note (mk-tree): 19 € struck → 0 € */
.price-note { max-width: 540px; margin: 26px auto 0; padding: 14px 20px; background: var(--lav); border: 1px solid var(--border); border-radius: 12px; color: var(--body); font-size: 15px; }
.price-note .old { color: var(--muted); text-decoration: line-through; }
.price-note .free { color: var(--accent-deep); font-weight: 600; }

/* code gate (mk-tree) */
.gate { max-width: 460px; margin: 30px auto 0; text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 24px; box-shadow: var(--shadow-card); }
.gate h2 { font-family: 'PT Serif', serif; font-size: 22px; margin: 0 0 6px; color: var(--text); text-wrap: balance; }
.gate p { margin: 0 0 16px; color: var(--body); font-size: 14px; }
.gate form { display: flex; flex-wrap: wrap; gap: 10px; }
.gate input { flex: 1 1 180px; min-width: 0; padding: 13px 16px; font-family: inherit; font-size: 16px; letter-spacing: .04em; text-transform: uppercase; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 10px; }
.gate input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.gate .btn { flex: 0 0 auto; }
/* error stays in the DOM as a live region; :empty hides it until JS sets the text, so the
   aria-live announcement fires reliably across screen readers (no display:none toggle) */
.gate .err { margin: 12px 0 0; color: #c0392b; font-size: 13px; }
.gate .err:empty { display: none; }

footer { border-top: 1px solid var(--border); padding: 22px 32px; color: var(--muted); font-size: 13px; text-align: center; }
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--accent-deep); text-decoration: underline; }

/* ── entrance choreography ── */
[data-reveal] { opacity: 0; transform: translateY(18px); }
body.is-in [data-reveal] { animation: rise 760ms var(--ease-out) both; animation-delay: calc(var(--d, 0) * 1ms); }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* tree grows up from its base, then drifts (Ken-Burns) */
body.is-in .tree { animation: grow 1150ms var(--ease-out) 240ms both; }
@keyframes grow { from { clip-path: inset(100% 0 0 0); opacity: 0; } to { clip-path: inset(0 0 0 0); opacity: 1; } }
body.is-in .tree img { animation: kb 26s ease-in-out 1500ms infinite alternate; }
@keyframes kb { from { transform: scale(1); } to { transform: scale(1.05); } }

/* prism pieces assemble; --d staggers each group */
.g-rev { opacity: 0; transform: translateY(8px); transform-box: fill-box; transform-origin: center; }
body.is-in .g-rev { animation: gin 640ms var(--ease-out) both; animation-delay: calc(var(--d, 0) * 1ms); }
@keyframes gin { to { opacity: 1; transform: none; } }
.pulse { transform-box: fill-box; transform-origin: center; }
body.is-in .pulse { animation: pulse 3s ease-in-out infinite; animation-delay: 1400ms; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }

@media (prefers-reduced-motion: reduce) {
  [data-reveal], .g-rev { opacity: 1 !important; transform: none !important; animation: none !important; }
  .tree { clip-path: none !important; animation: none !important; opacity: 1 !important; }
  .tree img, .pulse { animation: none !important; }
  body::after { display: none; }
}

@media (max-width: 600px) {
  h1 { font-size: 36px; }
  h1 .suffix { font-size: 24px; }
  .hero { padding: 40px 20px 60px; }
}
