/* ===== Feature spotlight pages (/funktsii/<slug>, /en/features/<slug>) =====
 * Loaded after styles.css. Uses its tokens (--brand, --cream, --radius, --ease…).
 * Sections: .fp-hero (copy + demo), .fp-strip, .fp-uses, .fp-how, .fp-safety, .fp-faq, final CTA (.final-cta from styles.css).
 * Demo "mini movie": .fd (player chrome) + props (.fd-window, .fd-msg, .fd-bars, .fd-table, .fd-flow, .fd-key…).
 * Page-specific tweaks go in the page's own <style> block, scoped by .fp-<slug>. */

/* ---------- page layout ---------- */
.fp-hero { padding: clamp(40px, 7vw, 88px) 0 clamp(36px, 5vw, 64px); position: relative; overflow: hidden; }
.fp-hero::before {
  content: ''; position: absolute; inset: -20% -10% auto auto; width: 620px; height: 620px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(96, 1, 210, 0.10), transparent 70%); pointer-events: none;
}
.fp-hero-inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: clamp(28px, 5vw, 64px); align-items: center; position: relative; }
.fp-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 0.82rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand); background: var(--brand-tint); padding: 6px 14px; border-radius: 999px; }
.fp-eyebrow .fp-new { background: var(--sun); color: var(--ink); border-radius: 999px; padding: 1px 8px; letter-spacing: 0.04em; }
.fp-hero h1 { margin: 18px 0 14px; }
.fp-hero h1 em { font-style: normal; color: var(--brand); }
.fp-lead { font-size: clamp(1.05rem, 1.6vw, 1.22rem); color: var(--ink-soft); max-width: 34em; }
.fp-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.fp-proof { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 22px; padding: 0; list-style: none; color: var(--ink-soft); font-size: 0.95rem; }
.fp-proof li::before { content: '✓'; color: var(--sage); font-weight: 900; margin-right: 6px; }

.fp-section { padding: clamp(44px, 7vw, 84px) 0; }
.fp-section.alt { background: var(--white); }
.fp-section-head { max-width: 760px; margin: 0 auto clamp(26px, 4vw, 44px); text-align: center; }
.fp-section-head p { color: var(--ink-soft); font-size: 1.08rem; }
.fp-kicker { display: block; font-weight: 800; color: var(--brand); font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 8px; }

/* strip of 3–4 short value props under the hero */
.fp-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.fp-strip .card { padding: 20px 22px; display: flex; gap: 14px; align-items: flex-start; }
.fp-ico { flex: 0 0 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-tint); color: var(--brand); font-size: 1.25rem; }
.fp-strip h3 { font-size: 1.02rem; margin: 2px 0 4px; }
.fp-strip p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }

/* example questions / use cases */
.fp-uses { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.fp-q { position: relative; padding: 18px 20px 18px 52px; border-radius: var(--radius); background: var(--cream); border: 1px solid var(--border-soft); font-weight: 700; transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.fp-section.alt .fp-q { background: var(--cream); }
.fp-q::before { content: '“'; position: absolute; left: 16px; top: 6px; font: 700 2.2rem/1 'Fredoka', sans-serif; color: var(--brand); opacity: 0.55; }
.fp-q small { display: block; font-weight: 600; color: var(--ink-soft); margin-top: 6px; }
.fp-q:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }

/* numbered how-it-works timeline */
.fp-how { counter-reset: fp; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.fp-how .card { position: relative; padding: 26px 22px 22px; counter-increment: fp; }
.fp-how .card::before { content: counter(fp); position: absolute; top: -16px; left: 22px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; font: 700 1rem 'Fredoka', sans-serif; box-shadow: 0 6px 16px rgba(96, 1, 210, 0.3); }
.fp-how h3 { font-size: 1.05rem; margin: 6px 0 6px; }
.fp-how p { margin: 0; color: var(--ink-soft); }
.fp-ui { font-weight: 800; color: var(--ink); background: var(--brand-tint); border-radius: 6px; padding: 0 6px; white-space: nowrap; }

/* safety / control */
.fp-safety { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.fp-safety .card { padding: 22px; border-left: 4px solid var(--sage); }
.fp-safety h3 { font-size: 1.02rem; margin: 0 0 6px; display: flex; gap: 8px; align-items: center; }
.fp-safety h3::before { content: '🛡'; font-size: 1rem; }
.fp-safety p { margin: 0; color: var(--ink-soft); }

/* two-column compare (e.g. built-in AI vs your own AI) */
.fp-compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.fp-compare .card { padding: 26px; }
.fp-compare .card.is-here { outline: 2px solid var(--brand); }
.fp-compare ul { margin: 10px 0 16px; padding-left: 20px; color: var(--ink-soft); }

/* FAQ */
.fp-faq { max-width: 820px; margin: 0 auto; display: grid; gap: 10px; }
.fp-faq details { background: var(--white); border-radius: var(--radius-sm); border: 1px solid var(--border-soft); padding: 4px 20px; }
.fp-faq summary { cursor: pointer; font-weight: 800; padding: 14px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.fp-faq summary::-webkit-details-marker { display: none; }
.fp-faq summary::after { content: '+'; font: 700 1.3rem/1 'Fredoka', sans-serif; color: var(--brand); transition: transform var(--dur) var(--ease); }
.fp-faq details[open] summary::after { transform: rotate(45deg); }
.fp-faq details > div { color: var(--ink-soft); padding-bottom: 16px; }

/* cross-link card to the sister feature */
.fp-next { display: flex; gap: 18px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 26px 28px; background: linear-gradient(120deg, var(--brand-tint), var(--orange-tint)); border-radius: var(--radius); }
.fp-next h3 { margin: 0 0 4px; }
.fp-next p { margin: 0; color: var(--ink-soft); }

/* ---------- the demo player ---------- */
.fd { margin: 0; position: relative; }
.fd-viewport { position: relative; aspect-ratio: 16 / 11; border-radius: 22px; }
.fd-scene { position: absolute; inset: 0; opacity: 0; visibility: hidden; transform: translateY(10px) scale(0.985); transition: opacity 0.5s var(--ease), transform 0.6s var(--ease), visibility 0s linear 0.5s; }
.fd-scene.is-active { opacity: 1; visibility: visible; transform: none; transition: opacity 0.5s var(--ease), transform 0.6s var(--ease), visibility 0s; }
.fd [data-at] { opacity: 0; transform: translateY(8px); transition: opacity 0.45s var(--ease), transform 0.5s var(--ease); }
.fd [data-at].is-on { opacity: 1; transform: none; }
.fd [data-type] { min-height: 1.4em; }
.fd [data-off].is-off { display: none; }
.fd-body > * { flex-shrink: 0; }
.fd [data-type].is-typing::after { content: ''; display: inline-block; width: 2px; height: 1.05em; margin-left: 2px; vertical-align: -0.15em; background: currentColor; animation: fd-caret 0.8s steps(1) infinite; }
.fd-ui { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 14px; }
.fd-caption { margin: 0; min-height: 1.5em; text-align: center; font-weight: 700; color: var(--ink); font-size: 0.98rem; }
.fd-controls { display: flex; align-items: center; gap: 12px; }
.fd-dots { display: flex; gap: 6px; }
.fd-dot { width: 34px; height: 6px; padding: 0; border: 0; border-radius: 999px; background: rgba(96, 1, 210, 0.15); cursor: pointer; overflow: hidden; }
.fd-dot span { display: block; height: 100%; width: calc(var(--p, 0) * 100%); background: var(--brand); border-radius: inherit; }
.fd-dot.is-active span { min-width: 6px; }
.fd-static .fd-dot.is-active span { width: 100%; }
.fd-dot:focus-visible, .fd-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.fd-toggle { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--brand-tint); color: var(--brand); cursor: pointer; position: relative; }
.fd-toggle::before, .fd-toggle::after { content: ''; position: absolute; top: 9px; width: 3px; height: 12px; background: currentColor; border-radius: 2px; }
.fd-toggle::before { left: 11px; }
.fd-toggle::after { left: 16px; }
.fd-toggle.is-paused::before { left: 12px; width: 0; height: 0; background: none; border-style: solid; border-width: 6px 0 6px 10px; border-color: transparent transparent transparent currentColor; border-radius: 0; }
.fd-toggle.is-paused::after { display: none; }
.fd-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@keyframes fd-caret { 50% { opacity: 0; } }

/* ---------- demo props ---------- */
/* app / desktop window */
.fd-window { position: absolute; inset: 0; background: var(--white); border-radius: 18px; box-shadow: 0 30px 60px -20px rgba(78, 0, 171, 0.35), 0 0 0 1px var(--border-soft); overflow: hidden; display: flex; flex-direction: column; }
.fd-window.is-dark { background: #1E1A2B; color: #EDE9F6; }
.fd-titlebar { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border-soft); font-size: 0.82rem; font-weight: 800; color: var(--ink-soft); }
.fd-window.is-dark .fd-titlebar { border-color: rgba(255, 255, 255, 0.08); color: #B9B2CC; }
.fd-titlebar i { width: 10px; height: 10px; border-radius: 50%; background: #F1C9C0; }
.fd-titlebar i:nth-child(2) { background: #F7E2A8; }
.fd-titlebar i:nth-child(3) { background: #CDE8D9; }
.fd-titlebar span { margin-left: 8px; }
.fd-body { flex: 1 1 auto; padding: clamp(12px, 2.4vw, 22px); display: flex; flex-direction: column; gap: 10px; overflow: hidden; font-size: clamp(0.78rem, 1.25vw, 0.95rem); }

/* chat */
.fd-msg { max-width: 86%; padding: 10px 14px; border-radius: 16px; line-height: 1.4; }
.fd-msg.user { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 6px; }
.fd-msg.ai { align-self: flex-start; background: var(--cream); color: var(--ink); border-bottom-left-radius: 6px; }
.fd-window.is-dark .fd-msg.ai { background: #2C2640; color: #EDE9F6; }
.fd-msg.human { align-self: flex-start; background: var(--sage-light); color: var(--ink); border-bottom-left-radius: 6px; }
.fd-who { display: block; font-size: 0.72em; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.7; margin-bottom: 2px; }
.fd-typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: 12px 14px; border-radius: 16px; background: var(--cream); }
.fd-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-soft); animation: fd-bounce 1s infinite; }
.fd-typing i:nth-child(2) { animation-delay: 0.15s; }
.fd-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes fd-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.5; } 30% { transform: translateY(-4px); opacity: 1; } }
.fd-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fd-chip { font-size: 0.82em; font-weight: 700; padding: 5px 10px; border-radius: 999px; background: var(--brand-tint); color: var(--brand); }
.fd-input { margin-top: auto; display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--border-soft); color: var(--ink-soft); background: var(--white); }
.fd-input::after { content: '↑'; margin-left: auto; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 900; }
.fd-window.is-dark .fd-input { background: #2C2640; border-color: rgba(255, 255, 255, 0.08); color: #B9B2CC; }

/* mini bar chart: <div class="fd-bars"><div class="fd-bar" data-at=".." style="--h:60%"><b>12k</b><span>Яну</span></div>…</div> */
.fd-bars { display: flex; align-items: flex-end; gap: 8px; height: 92px; padding: 8px 4px 0; }
.fd-bar { flex: 1; position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.fd-bar::before { content: ''; width: 100%; height: 0; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, var(--brand), #8B3DF0); transition: height 0.9s var(--ease); }
.fd-bar.is-on::before { height: var(--h, 50%); }
.fd-bar.hot::before { background: linear-gradient(180deg, var(--orange), var(--sun)); }
.fd-bar b { position: absolute; top: 0; font-size: 0.72em; }
.fd-bar span { font-size: 0.7em; color: var(--ink-soft); margin-top: 4px; }

/* data table rows */
.fd-table { display: grid; gap: 6px; }
.fd-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--cream); font-size: 0.92em; }
.fd-window.is-dark .fd-row { background: #2C2640; }
.fd-row b { font-variant-numeric: tabular-nums; }
.fd-tag { font-size: 0.75em; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--orange-tint); color: #A85F00; }
.fd-tag.ok { background: var(--sage-tint); color: var(--sage-dark); }
.fd-tag.bad { background: #FDE2DE; color: #B03A2E; }

/* stat tile */
.fd-stat { padding: 10px 14px; border-radius: 14px; background: var(--brand-tint); }
.fd-stat small { display: block; color: var(--ink-soft); font-weight: 700; font-size: 0.75em; }
.fd-stat strong { font: 700 1.5em/1.1 'Fredoka', sans-serif; color: var(--brand); }

/* connection flow (MCP): three nodes + animated connectors */
.fd-flow { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: 0; padding: 6%; }
.fd-node { justify-self: center; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-weight: 800; font-size: clamp(0.72rem, 1.2vw, 0.9rem); }
.fd-node .fd-badge { width: clamp(56px, 9vw, 86px); height: clamp(56px, 9vw, 86px); border-radius: 22px; display: grid; place-items: center; background: var(--white); box-shadow: var(--shadow); font: 700 clamp(1.1rem, 2.2vw, 1.6rem) 'Fredoka', sans-serif; color: var(--brand); }
.fd-node .fd-badge.brand { background: var(--brand); color: #fff; }
.fd-link { width: clamp(40px, 9vw, 110px); height: 4px; border-radius: 4px; background: rgba(96, 1, 210, 0.15); position: relative; overflow: hidden; }
.fd-link::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, var(--brand), transparent); }
.fd-link.is-on::after { animation: fd-pulse 1.4s var(--ease) infinite; }
@keyframes fd-pulse { to { transform: translateX(100%); } }

/* code / config snippet */
.fd-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.82em; line-height: 1.55; padding: 12px 14px; border-radius: 12px; background: #1E1A2B; color: #D9D2EC; white-space: pre; overflow: hidden; }
.fd-code .k { color: #F7C948; }
.fd-code .s { color: #9FE0C0; }

/* API key reveal */
.fd-key { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; border: 1px dashed var(--brand); background: var(--brand-tint); font-family: ui-monospace, Menlo, monospace; font-size: 0.85em; color: var(--brand-dark); }
.fd-key::before { content: '🔑'; }
.fd-btn { align-self: flex-start; padding: 8px 14px; border-radius: 10px; background: var(--brand); color: #fff; font-weight: 800; font-size: 0.88em; box-shadow: 0 6px 14px rgba(96, 1, 210, 0.25); }
.fd-btn.is-on { animation: fd-press 0.5s var(--ease) 0.35s; }
@keyframes fd-press { 50% { transform: scale(0.94); } }
.fd-toast { position: absolute; right: 16px; bottom: 16px; display: flex; gap: 8px; align-items: center; padding: 10px 14px; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 700; font-size: 0.85em; box-shadow: var(--shadow-hover); }
.fd-toast::before { content: '✓'; color: var(--sun); font-weight: 900; }
.fd-note { font-size: 0.72em; color: var(--ink-soft); text-align: right; }

/* floating decoration behind the stage */
.fp-stage { position: relative; }
.fp-stage::before { content: ''; position: absolute; inset: 8% -4% -6% 6%; border-radius: 28px; background: linear-gradient(135deg, var(--peach), var(--sun)); opacity: 0.55; transform: rotate(3deg); z-index: -1; }
@media (prefers-reduced-motion: no-preference) {
  .fp-stage { animation: hero-rise 0.7s var(--ease) 0.2s both; }
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .fp-hero-inner { grid-template-columns: 1fr; }
  .fp-stage { max-width: 640px; width: 100%; margin: 0 auto; }
}
@media (max-width: 520px) {
  .fd-viewport { aspect-ratio: 4 / 5; }
  .fd-flow { grid-template-columns: 1fr; grid-template-rows: 1fr auto 1fr auto 1fr; padding: 8% 10%; }
  .fd-link { width: 4px; height: clamp(26px, 6vh, 46px); justify-self: center; }
  .fd-link::after { transform: translateY(-100%); background: linear-gradient(180deg, transparent, var(--brand), transparent); }
  .fd-link.is-on::after { animation-name: fd-pulse-y; }
  @keyframes fd-pulse-y { to { transform: translateY(100%); } }
}
@media (prefers-reduced-motion: reduce) {
  .fd-scene, .fd [data-at], .fd-bar::before { transition: none !important; }
  .fd-link.is-on::after, .fd-typing i, .fd-btn.is-on { animation: none !important; }
}

/* ---------- sticky page sub-menu (built by js/feature-demo.js) ---------- */
:root { --fp-hdr-h: 69px; --fp-sub-h: 52px; }
.fp-subnav {
  position: sticky;
  top: var(--fp-hdr-h);
  z-index: 40;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  backdrop-filter: blur(12px) saturate(1.4);
  border-bottom: 1px solid var(--border-soft);
}
.fp-subnav-inner { display: flex; align-items: stretch; gap: 22px; height: 52px; }
.fp-subnav-title {
  flex: 0 1 auto;
  align-self: center;
  min-width: 0;
  max-width: 34ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: 'Fredoka', 'Nunito', sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
  padding-right: 22px;
  border-right: 1px solid var(--border-soft);
  line-height: 24px;
}
.fp-subnav-tabs {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: stretch;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.fp-subnav-tabs::-webkit-scrollbar { display: none; }
.fp-subnav-tabs a {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 12px;
  white-space: nowrap;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink-soft);
  transition: color 0.15s ease;
}
.fp-subnav-tabs a::after {
  content: '';
  position: absolute;
  left: 12px; right: 12px; bottom: -1px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--brand);
  transform: scaleX(0);
  transition: transform var(--dur) var(--ease);
}
.fp-subnav-tabs a:hover { color: var(--brand-dark); }
.fp-subnav-tabs a[aria-current] { color: var(--brand-dark); }
.fp-subnav-tabs a[aria-current]::after { transform: scaleX(1); }
.fp-subnav-tabs a:focus-visible { outline: 2px solid var(--brand); outline-offset: -4px; border-radius: 8px; }
.fp-subnav-cta {
  align-self: center;
  margin-left: auto;
  flex: none;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), visibility 0s linear var(--dur);
}
.fp-subnav.has-cta .fp-subnav-cta { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
[data-subnav][id] { scroll-margin-top: calc(var(--fp-hdr-h) + var(--fp-sub-h) + 4px); }
@media (max-width: 700px) {
  .fp-subnav-inner { gap: 10px; }
  .fp-subnav { background: rgba(255, 255, 255, 0.98); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .fp-subnav-title { max-width: 42vw; padding-right: 10px; font-size: 0.98rem; }
  .fp-subnav-tabs a { padding: 0 10px; font-size: 0.88rem; }
  .fp-subnav-tabs a::after { left: 10px; right: 10px; }
  .fp-subnav-cta { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fp-subnav-tabs a, .fp-subnav-tabs a::after, .fp-subnav-cta { transition: none; }
}
