/* =========================================================
   Головна AI Fabrika: пульт. Знак сервісу — темна плашка з чотирма кольоровими
   квадратами — тут стає справжнім пристроєм: екран і чотири клавіші. Навколо —
   світлий спокійний алюміній і графіт (тема .theme-light у base.css); колір мають
   лише чотири формати: зображення — жовтий, відео — корал, музика — м'ята, тексти — лаванда.
   ========================================================= */

/* Гострі кути Geologica — для всіх великих заголовків головної */
.hero__title, .line__title, .step::before, .plan__amount, .final__title { font-variation-settings: "SHRP" 100; }
.page-landing .h2 { font-size: clamp(2rem, 1.25rem + 2.5vw, 3.4rem); line-height: 1.02; }

/* На темних плашках фокус — білий */
.console :focus-visible, .plan--popular :focus-visible, .final__plate :focus-visible, .feat-hero :focus-visible { outline-color: #fff; }

.section { padding-block: var(--section-y); }
.section__head { display: grid; gap: 16px; max-width: 780px; margin-bottom: clamp(36px, 5vw, 64px); }
.page-landing .lead { color: var(--ink-2); max-width: 46ch; }

/* ---------- Перший екран ---------- */
.hero { padding: clamp(28px, 5vw, 72px) 0 clamp(56px, 8vw, 112px); }
.hero__grid { display: grid; grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr); gap: clamp(32px, 4vw, 64px); align-items: center; }
.hero__title { font-weight: 820; font-size: clamp(3rem, 1rem + 4.4vw, 5rem); line-height: 0.95; letter-spacing: -0.05em; text-wrap: balance; }
.hero__lead { margin-top: 24px; max-width: 40ch; font-size: clamp(1.06rem, 1rem + 0.35vw, 1.22rem); line-height: 1.55; color: var(--ink-2); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px 12px; margin-top: 34px; }
.hero__actions .btn { padding-inline: 20px; }
.hero__note { margin-top: 20px; font-size: 0.92rem; color: var(--ink-3); }

/* ---------- Пульт ---------- */
.console {
  --c: var(--k-image);
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 232px;
  gap: 16px;
  padding: 16px;
  border-radius: 30px;
  background: linear-gradient(180deg, #2a2338 0%, var(--plate) 18%);
  color: var(--screen-ink);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -3px 0 rgba(0, 0, 0, 0.45),
    0 30px 60px -30px rgba(23, 19, 31, 0.55),
    0 70px 120px -60px rgba(23, 19, 31, 0.5);
}
.console--video { --c: var(--k-video); }
.console--music { --c: var(--k-music); }
.console--text { --c: var(--k-text); }

.console__screen {
  display: grid;
  gap: 12px;
  align-content: start;
  min-width: 0;
  padding: 16px;
  border-radius: 18px;
  background: var(--screen);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07), inset 0 10px 30px rgba(0, 0, 0, 0.7);
}
.screen__status { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 0.82rem; font-weight: 600; color: var(--screen-ink-3); }
.screen__kind { display: inline-flex; align-items: center; gap: 8px; color: var(--screen-ink); }
.screen__kind::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); transition: background-color 200ms ease, box-shadow 200ms ease; }
.screen__meta { display: inline-flex; gap: 14px; }
.screen__line { display: grid; gap: 3px; }
.screen__label { font-size: 0.74rem; font-weight: 550; color: var(--screen-ink-3); }
.screen__idea { min-height: calc(2 * 1.4em); font-size: 1.02rem; font-weight: 600; line-height: 1.4; color: var(--screen-ink); }
.screen__idea [data-type]::before { content: "«"; }
.screen__idea [data-type]::after { content: "»"; }
.screen__idea:not(.is-typing) [data-type]:empty::before, .screen__idea:not(.is-typing) [data-type]:empty::after { content: none; }
.screen__prompt { min-height: calc(3 * 1.45em); font-size: 0.86rem; line-height: 1.45; color: var(--screen-ink-2); }
/* Курсор, поки текст друкується */
.is-typing [data-type]::after { content: ""; display: inline-block; width: 0.5em; height: 1.05em; margin-left: 2px; vertical-align: -0.16em; background: var(--c); animation: caret 0.9s steps(2) infinite; }
@keyframes caret { 50% { opacity: 0; } }

.screen__out {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  background: #13111a radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1.5px) 0 0 / 12px 12px;
}
.screen__out > img, .screen__out > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.screen__out[data-state="working"]::before { content: "Створюємо…"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 0.86rem; font-weight: 600; color: var(--screen-ink-3); }
.screen__out[data-state="working"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--c); transform-origin: left; animation: work 700ms ease-in-out both; }
@keyframes work { from { transform: scaleX(0); } }
/* Результат проявляється згори донизу, як на друку */
.screen__out[data-state="done"] > * { animation: reveal 650ms var(--ease-out) both; }
@keyframes reveal { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }
.screen__text { position: absolute; inset: 0; padding: 16px 18px; overflow: hidden; font-size: 0.95rem; line-height: 1.55; color: #e9e5f7; }
.screen__out .player { position: absolute; inset: 0; border-radius: 0; background: radial-gradient(70% 100% at 12% 50%, rgba(78, 230, 201, 0.2), transparent 70%); }

.console__side { display: grid; grid-template-rows: auto auto 1fr; gap: 12px; }
.console__brand { padding: 4px 4px 0; font-family: var(--font-display); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: #6f6885; }
.console__grille { height: 52px; border-radius: 12px; background: radial-gradient(circle, #07060b 2.2px, transparent 2.7px) center / 10px 10px; }
.console__keys { align-self: end; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 12px; padding-bottom: 6px; }

/* Клавіші пульта (колір і натиск — .key у base.css) */
.console__keys .key { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; aspect-ratio: 1; padding: 11px 10px 11px 12px; font-size: 0.84rem; line-height: 1.1; }

/* ---------- Плеєр треку ---------- */
.player { display: grid; grid-template-columns: auto minmax(0, 1fr); align-content: center; align-items: center; gap: 16px 18px; padding: 22px; border-radius: 18px; background: var(--screen); color: var(--screen-ink); }
.player__play { display: grid; place-items: center; width: 56px; height: 56px; border: 0; border-radius: 50%; background: var(--k-music); color: #06231d; box-shadow: 0 4px 0 var(--e-music), 0 10px 20px -8px rgba(78, 230, 201, 0.6); transition: transform 90ms var(--ease-out), box-shadow 90ms var(--ease-out); }
.player__play:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--e-music); }
.player__play svg { width: 22px; height: 22px; }
.player .i-pause { display: none; }
.player.is-playing .i-play { display: none; }
.player.is-playing .i-pause { display: inline; }
.player__wave { display: flex; align-items: center; gap: 3px; height: 56px; }
.player__wave i { flex: 1; height: 40%; border-radius: 2px; background: rgba(78, 230, 201, 0.4); }
.player__wave i:nth-child(3n) { height: 75%; }
.player__wave i:nth-child(4n) { height: 95%; }
.player__wave i:nth-child(5n) { height: 55%; }
.player__wave i:nth-child(7n) { height: 25%; }
.player.is-playing .player__wave i { background: var(--k-music); animation: eq 0.9s ease-in-out infinite; }
.player.is-playing .player__wave i:nth-child(odd) { animation-delay: -0.3s; }
.player.is-playing .player__wave i:nth-child(3n) { animation-delay: -0.6s; }
@keyframes eq { 50% { transform: scaleY(0.5); } }
.player__caption { grid-column: 1 / -1; font-size: 0.9rem; color: var(--screen-ink-2); }

/* ---------- Чотири формати ---------- */
.lines { border-top: 1px solid var(--line-strong); }
.line { --c: var(--k-image); --edge: var(--e-image); display: grid; grid-template-columns: 56px minmax(0, 1fr) minmax(0, 0.78fr); gap: 0 clamp(20px, 3vw, 48px); align-items: start; padding-block: clamp(28px, 4vw, 48px); border-bottom: 1px solid var(--line-strong); }
.line--video { --c: var(--k-video); --edge: var(--e-video); }
.line--music { --c: var(--k-music); --edge: var(--e-music); }
.line--text { --c: var(--k-text); --edge: var(--e-text); }
.line__key { width: 56px; height: 56px; border-radius: 14px; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 82%, #fff), var(--c) 45%); box-shadow: 0 5px 0 var(--edge), inset 0 1px 0 rgba(255, 255, 255, 0.55); }
.line--text .line__key { border-radius: 50%; }
.line__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 16px; }
.line__title { font-size: clamp(1.8rem, 1.3rem + 1.4vw, 2.5rem); font-weight: 760; line-height: 1; letter-spacing: -0.035em; }
.line__price { font-size: 0.95rem; color: var(--ink-3); white-space: nowrap; }
.line__price b { font-size: 1.1rem; font-weight: 750; color: var(--ink); }
.line__body > p { margin-top: 14px; max-width: 52ch; font-size: 1.05rem; color: var(--ink-2); }
.line__specs { display: grid; gap: 8px; margin-top: 18px; font-size: 0.95rem; color: var(--ink-2); }
.line__specs li { position: relative; padding-left: 20px; }
.line__specs li::before { content: ""; position: absolute; left: 0; top: 0.6em; width: 8px; height: 8px; border-radius: 2px; background: var(--c); box-shadow: 0 1.5px 0 var(--edge); }
.line__art { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 18px; background: var(--studio); }
.line__art.player, .line__art.note { aspect-ratio: auto; }
.line__art.player { background: var(--screen) radial-gradient(70% 100% at 12% 50%, rgba(78, 230, 201, 0.16), transparent 70%); }
.line--image .line__art { object-position: 50% 40%; }

.note { display: grid; align-content: start; gap: 14px; padding: 24px; border-radius: 18px; background: #fff; box-shadow: 0 1px 0 var(--line), 0 24px 40px -32px rgba(23, 19, 31, 0.5); line-height: 1.6; }
.note__ask { padding-bottom: 14px; border-bottom: 1px dashed var(--line-strong); font-size: 0.9rem; color: var(--ink-3); }

/* ---------- Як це працює ---------- */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 3vw, 44px); counter-reset: step; }
.step { counter-increment: step; display: grid; gap: 10px; align-content: start; padding-top: 18px; border-top: 2px solid var(--ink); }
.step::before { content: counter(step); margin-bottom: 10px; font-size: clamp(3rem, 2rem + 3vw, 4.6rem); font-weight: 300; line-height: 1; letter-spacing: -0.04em; }
.step h3 { font-size: 1.3rem; font-weight: 720; line-height: 1.2; letter-spacing: -0.02em; }
.step p { max-width: 38ch; color: var(--ink-2); }

/* ---------- Можливості ---------- */
.feat-hero { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: center; padding: clamp(16px, 2.2vw, 24px); padding-right: clamp(16px, 4vw, 48px); border-radius: 28px; background: var(--plate); color: var(--screen-ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 30px 60px -36px rgba(23, 19, 31, 0.6); }
.feat-hero__pair { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; }
.feat-hero__pair img, .feat-hero__pair video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 14px; }
.feat-hero__arrow { position: relative; width: 32px; height: 32px; border-radius: 50%; background: var(--k-video); box-shadow: 0 3px 0 var(--e-video); }
.feat-hero__arrow::after { content: ""; position: absolute; left: 9px; top: 11px; width: 9px; height: 9px; border-top: 2.5px solid var(--ink); border-right: 2.5px solid var(--ink); transform: rotate(45deg); }
.feat-hero__copy { display: grid; gap: 10px; padding-block: 12px; }
.feat-hero__copy h3 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); font-weight: 760; line-height: 1.05; letter-spacing: -0.03em; font-variation-settings: "SHRP" 100; }
.feat-hero__copy p { max-width: 40ch; color: var(--screen-ink-2); }

.feat-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 clamp(24px, 3vw, 44px); margin-top: clamp(28px, 4vw, 48px); }
.feat-list li { display: grid; gap: 8px; align-content: start; padding-block: 22px 26px; border-top: 1px solid var(--line-strong); }
.feat-list h3 { font-size: 1.15rem; font-weight: 700; line-height: 1.25; letter-spacing: -0.015em; }
.feat-list p { color: var(--ink-2); }

/* ---------- Ціни ---------- */
.price-sheet { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 clamp(20px, 3vw, 44px); margin-bottom: clamp(40px, 5vw, 64px); border-top: 1px solid var(--line-strong); }
.price-row { --c: var(--k-image); --edge: var(--e-image); display: flex; align-items: center; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); color: var(--ink-2); }
.price-row::before { content: ""; flex: none; width: 12px; height: 12px; border-radius: 3px; background: var(--c); box-shadow: 0 2px 0 var(--edge); }
.price-row--video { --c: var(--k-video); --edge: var(--e-video); }
.price-row--music { --c: var(--k-music); --edge: var(--e-music); }
.price-row--text { --c: var(--k-text); --edge: var(--e-text); }
.price-row span { flex: 1; }
.price-row b { font-weight: 750; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.price-row b::after { content: " кр."; font-weight: 500; color: var(--ink-3); }

.plans { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: stretch; }
.plan { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 26px 22px 22px; border-radius: 22px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line), 0 1px 0 rgba(23, 19, 31, 0.06); }
.plan--popular { background: var(--plate); color: var(--screen-ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 30px 60px -30px rgba(23, 19, 31, 0.6); }
.plan__badge { position: absolute; top: -12px; left: 22px; padding: 3px 10px; border-radius: 8px; background: var(--k-image); color: var(--ink); font-size: 0.78rem; font-weight: 700; box-shadow: 0 3px 0 var(--e-image); }
.plan__name { font-size: 1.35rem; font-weight: 750; letter-spacing: -0.02em; }
.plan__note { font-size: 0.92rem; color: var(--ink-3); }
.plan__price { margin-top: 18px; font-size: 1.1rem; font-weight: 650; }
.plan__amount { font-size: 2.8rem; font-weight: 780; letter-spacing: -0.04em; }
.plan__credits { flex: 1; margin-bottom: 20px; font-size: 0.92rem; color: var(--ink-2); }
.plan__credits b { color: var(--ink); font-weight: 800; }
.plan__save { display: inline-block; padding: 1px 7px; border-radius: 6px; background: rgba(35, 168, 145, 0.16); color: #0b6a59; font-size: 0.78rem; font-weight: 750; }
.plan--popular .plan__note, .plan--popular .plan__credits { color: var(--screen-ink-2); }
.plan--popular .plan__credits b { color: #fff; }
.plan--popular .plan__save { background: rgba(78, 230, 201, 0.16); color: var(--k-music); }
.plan .btn { margin-top: auto; }
.plan .btn--light { background: transparent; border: 1.5px solid var(--line-strong); color: var(--ink); }
.pricing__fine { margin-top: 26px; color: var(--ink-2); font-size: 0.95rem; }

/* ---------- Відгуки ---------- */
.reviews__row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(280px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 12px; scroll-snap-type: x mandatory; }
.review { scroll-snap-align: start; padding: 24px; border-radius: 20px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.review blockquote { margin: 0; font-size: 1.05rem; line-height: 1.55; }
.review figcaption { margin-top: 14px; font-size: 0.9rem; font-weight: 700; }
.review figcaption span { color: var(--ink-3); font-weight: 500; }

/* ---------- Питання ---------- */
.faq__grid { display: grid; grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.faq__aside { position: sticky; top: calc(var(--header-h) + 24px); display: grid; gap: 16px; }
.faq__aside-note { color: var(--ink-2); }
.faq__aside-note a { color: var(--ink); font-weight: 700; text-underline-offset: 3px; }
.faq__list { border-top: 1px solid var(--line-strong); }
.faq__list details { border-bottom: 1px solid var(--line-strong); }
.faq__list summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 22px 0; font-size: 1.1rem; font-weight: 650; letter-spacing: -0.01em; cursor: pointer; list-style: none; }
.faq__list summary::-webkit-details-marker { display: none; }
.faq__list summary::after {
  content: "";
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background:
    linear-gradient(var(--ink), var(--ink)) center / 12px 2px no-repeat,
    linear-gradient(var(--ink), var(--ink)) center / 2px 12px no-repeat,
    var(--paper);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: transform 200ms var(--ease-out);
}
.faq__list details[open] summary::after { transform: rotate(45deg); }
.faq__answer { max-width: 62ch; padding: 0 0 22px; line-height: 1.65; color: var(--ink-2); }

/* ---------- Фінал ---------- */
.final { padding-top: 0; }
.final__plate { display: grid; justify-items: center; gap: 24px; padding: clamp(48px, 7vw, 96px) 24px; border-radius: 32px; background: var(--plate); color: var(--screen-ink); text-align: center; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 40px 80px -40px rgba(23, 19, 31, 0.6); }
.final__keys { display: grid; grid-template-columns: repeat(2, 22px); gap: 7px; }
.final__keys i { width: 22px; height: 22px; border-radius: 6px; background: var(--k-image); box-shadow: 0 3px 0 var(--e-image); }
.final__keys i:nth-child(2) { background: var(--k-video); box-shadow: 0 3px 0 var(--e-video); }
.final__keys i:nth-child(3) { background: var(--k-music); box-shadow: 0 3px 0 var(--e-music); }
.final__keys i:nth-child(4) { border-radius: 50%; background: var(--k-text); box-shadow: 0 3px 0 var(--e-text); }
.final__title { max-width: 16ch; font-size: clamp(2.2rem, 1.4rem + 3vw, 4rem); font-weight: 800; line-height: 1; letter-spacing: -0.045em; text-wrap: balance; }
.final__note { font-size: 0.92rem; color: #a49dbb; }

/* ---------- Адаптивність ---------- */
@media (max-width: 1100px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__copy { max-width: 720px; }
  .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 24px; }
}
@media (max-width: 900px) {
  .steps { grid-template-columns: 1fr; }
  .feat-hero { grid-template-columns: 1fr; padding-right: clamp(16px, 2.2vw, 24px); }
  .feat-hero__copy { padding: 4px 8px 12px; }
  .feat-list { grid-template-columns: 1fr 1fr; }
  .price-sheet { grid-template-columns: 1fr 1fr; }
  .faq__grid { grid-template-columns: 1fr; }
  .faq__aside { position: static; }
  .line { grid-template-columns: 48px minmax(0, 1fr); }
  .line__key { width: 48px; height: 48px; border-radius: 12px; }
  .line__art { grid-column: 2; margin-top: 24px; max-width: 520px; }
}
@media (max-width: 640px) {
  .console { grid-template-columns: 1fr; gap: 14px; padding: 12px; border-radius: 24px; }
  .console__screen { padding: 12px; border-radius: 14px; }
  .console__brand, .console__grille { display: none; }
  .console__side { display: block; }
  .console__keys { gap: 10px; }
  .console__keys .key { flex-direction: row; justify-content: flex-start; align-items: center; gap: 10px; aspect-ratio: auto; min-height: 56px; padding: 0 14px; border-radius: 14px; font-size: 0.92rem; }
  .screen__idea { font-size: 0.95rem; }
  .screen__prompt { min-height: calc(4 * 1.45em); font-size: 0.8rem; }
  .screen__text { padding: 12px 14px; font-size: 0.8rem; line-height: 1.5; }
  .screen__out .player { padding: 14px; gap: 10px 14px; }
  .screen__out .player__play { width: 46px; height: 46px; }
  .screen__out .player__wave { height: 44px; }
  .screen__out .player__caption { font-size: 0.8rem; }
  .line { grid-template-columns: 1fr; }
  .line__key { width: 40px; height: 40px; margin-bottom: 16px; border-radius: 11px; }
  .line__art { grid-column: 1; }
  .feat-hero__pair { grid-template-columns: 1fr; justify-items: center; }
  .feat-hero__arrow { transform: rotate(90deg); }
  .feat-list, .plans, .price-sheet { grid-template-columns: 1fr; }
  .hero__actions .btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
  .is-typing [data-type]::after, .screen__out[data-state="working"]::after, .screen__out[data-state="done"] > *, .player.is-playing .player__wave i { animation: none; }
  .page-landing .btn--marker { transition: none; }
}
/* Поки скрипт пульта не запустився, екран порожній, щоб текст не блимав перед друком.
   Якщо скрипт так і не запуститься, приклад з'явиться сам за 2,5 с. */
@media (scripting: enabled) and (prefers-reduced-motion: no-preference) {
  .console:not([data-ready]) [data-type], .console:not([data-ready]) .screen__out > * { animation: console-wait 0s linear 2.5s both; }
}
@keyframes console-wait { from { visibility: hidden; } to { visibility: visible; } }
