/* ============================================================
   Мустай Карим глазами ИИ — стили лендинга
   Тёмная кинематографичная тема с тёплыми природными акцентами.
   Все цвета и пороги вынесены в переменные (см. :root).
   ============================================================ */

:root {
  --bg:            #07090d;
  --bg-soft:       #0c0f15;
  --bg-card:       #11151d;
  --bg-card-2:     #161b25;
  --ink:           #eef2f6;
  --ink-dim:       #9aa6b2;
  --ink-faint:     #5d6772;
  --line:          rgba(255,255,255,.08);
  --line-2:        rgba(255,255,255,.14);

  --teal:          #5fd0c8;   /* «ИИ» акцент */
  --gold:          #d9a441;   /* природный/тёплый акцент */
  --amber:         #c9772f;
  --green:         #8bc34a;

  --r:             18px;
  --r-sm:          12px;
  --maxw:          1180px;
  --ease:          cubic-bezier(.22,.61,.36,1);
  --shadow:        0 24px 60px -20px rgba(0,0,0,.7);
  --font:          "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --serif:         "Cormorant Garamond", "Georgia", serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.eyebrow {
  font-size: 12px; letter-spacing: .28em; text-transform: uppercase;
  color: var(--teal); font-weight: 600;
}
.section { padding: 110px 0; position: relative; }
.section-head { max-width: 720px; margin-bottom: 56px; }
.section-head h2 {
  font-size: clamp(30px, 4.4vw, 52px); line-height: 1.05; font-weight: 800;
  letter-spacing: -.02em; margin: 14px 0 16px;
}
.section-head p { color: var(--ink-dim); font-size: 17px; }

/* ---------- NAV ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px;
  backdrop-filter: blur(10px);
  background: linear-gradient(to bottom, rgba(7,9,13,.85), rgba(7,9,13,0));
  transition: background .3s var(--ease);
}
.nav.scrolled { background: rgba(7,9,13,.92); border-bottom: 1px solid var(--line); }
.nav .brand { font-weight: 800; letter-spacing: .18em; font-size: 15px; }
.nav .brand b { color: var(--teal); }
.nav .links { display: flex; gap: 28px; font-size: 13px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-dim); }
.nav .links a { transition: color .2s; }
.nav .links a:hover { color: var(--ink); }
@media (max-width: 820px){ .nav .links { display: none; } }

/* ---------- HERO ---------- */
.hero { position: relative; height: 100vh; min-height: 680px; overflow: hidden; }
#hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-grad {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(95,208,200,.10), transparent 60%),
    radial-gradient(90% 60% at 70% 90%, rgba(217,164,65,.10), transparent 60%),
    linear-gradient(to bottom, rgba(7,9,13,0) 40%, rgba(7,9,13,.9) 100%);
}
.hero-copy {
  position: absolute; left: 0; right: 0; bottom: 8vh; z-index: 5;
  pointer-events: none;
}
.hero-copy .wrap { pointer-events: auto; }
.hero-copy h1 {
  font-family: var(--serif);
  font-size: clamp(44px, 9vw, 128px); line-height: .92; font-weight: 700;
  letter-spacing: .01em; margin: 12px 0 18px;
  text-shadow: 0 8px 40px rgba(0,0,0,.6);
}
.hero-copy .sub { color: var(--gold); font-weight: 600; letter-spacing: .2em;
  text-transform: uppercase; font-size: 13px; }
.hero-copy .lead { max-width: 560px; color: var(--ink-dim); font-size: 17px; margin-top: 8px; }
.hero-cta { display: flex; gap: 14px; margin-top: 30px; flex-wrap: wrap; }

.scene-tabs {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  z-index: 6; display: flex; gap: 8px; pointer-events: auto;
}
.scene-tabs button {
  width: 9px; height: 9px; border-radius: 50%;
  background: rgba(255,255,255,.22); transition: all .3s var(--ease);
}
.scene-tabs button.active { background: var(--teal); width: 26px; border-radius: 6px; }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 13px 24px; border-radius: 100px; font-weight: 600; font-size: 14px;
  transition: transform .2s var(--ease), background .2s, box-shadow .2s;
}
.btn-primary { background: var(--teal); color: #062018;
  box-shadow: 0 10px 30px -8px rgba(95,208,200,.5); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -8px rgba(95,208,200,.6); }
.btn-ghost { border: 1px solid var(--line-2); color: var(--ink); }
.btn-ghost:hover { background: rgba(255,255,255,.06); transform: translateY(-2px); }
.tag-ai {
  display: inline-flex; align-items: center; gap: 7px; font-size: 11px;
  letter-spacing: .12em; text-transform: uppercase; color: var(--teal);
  border: 1px solid rgba(95,208,200,.35); border-radius: 100px; padding: 5px 11px;
}
.tag-ai .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--teal);
  box-shadow: 0 0 10px var(--teal); animation: pulse 1.8s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }

/* ---------- HOW IT WORKS ---------- */
.how { background: var(--bg-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.steps { display: grid; grid-template-columns: repeat(3,1fr); gap: 22px; }
.step { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 30px; position: relative; }
.step .n { font-family: var(--serif); font-size: 46px; color: var(--teal); opacity: .55; line-height: 1; }
.step h3 { font-size: 19px; margin: 10px 0 8px; }
.step p { color: var(--ink-dim); font-size: 15px; }
@media (max-width: 820px){ .steps { grid-template-columns: 1fr; } }

/* ---------- CATALOG ---------- */
.books { display: grid; grid-template-columns: repeat(4,1fr); gap: 18px; }
@media (max-width: 980px){ .books { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 560px){ .books { grid-template-columns: 1fr; } }
.book {
  background: linear-gradient(160deg, var(--bg-card), var(--bg-card-2));
  border: 1px solid var(--line); border-radius: var(--r); padding: 26px 22px;
  cursor: pointer; position: relative; overflow: hidden;
  transition: transform .25s var(--ease), border-color .25s, box-shadow .25s;
}
.book::before { content:""; position:absolute; inset:0; opacity:0; transition:opacity .3s;
  background: radial-gradient(120% 80% at 50% 0%, var(--acc-glow), transparent 60%); }
.book:hover { transform: translateY(-5px); border-color: var(--line-2); box-shadow: var(--shadow); }
.book:hover::before { opacity:.18; }
.book.active { border-color: var(--acc); }
.book .fit { font-size: 11px; letter-spacing:.1em; color: var(--acc); text-transform: uppercase; }
.book h3 { font-family: var(--serif); font-size: 27px; line-height:1.1; margin: 14px 0 6px; }
.book .type { color: var(--ink-faint); font-size: 13px; }
.book .theme { color: var(--ink-dim); font-size: 14px; margin-top: 12px; min-height: 42px; }
.book .count { display:flex; align-items:baseline; gap:8px; margin-top: 18px;
  padding-top: 16px; border-top: 1px solid var(--line); }
.book .count .num { font-family: var(--serif); font-size: 40px; font-weight: 700; color: var(--acc);
  font-variant-numeric: tabular-nums; }
.book .count .lab { color: var(--ink-dim); font-size: 13px; }
.book .open { position:absolute; top:22px; right:20px; color: var(--ink-faint);
  transition: transform .25s, color .25s; }
.book.active .open { transform: rotate(45deg); color: var(--acc); }

/* ---------- POEM CLOUD ---------- */
.cloud-wrap { margin-top: 26px; }
.cloud {
  position: relative; min-height: 0; height: 0; overflow: hidden;
  border-radius: var(--r); transition: height .5s var(--ease), padding .5s var(--ease);
  background: radial-gradient(80% 120% at 50% -10%, rgba(95,208,200,.06), transparent 60%), var(--bg-soft);
  border: 1px solid transparent;
}
.cloud.open { border-color: var(--line); padding: 38px 30px; }
.cloud-hint { text-align:center; color: var(--ink-dim); font-size: 14px; margin-bottom: 26px; }
.cloud-hint .tag-ai { margin-right: 8px; vertical-align: middle; }
.poem-field { display:flex; flex-wrap:wrap; align-items:center; justify-content:center;
  gap: 10px 26px; }
.poem {
  font-family: var(--serif); cursor: pointer; color: var(--ink);
  transition: color .2s, transform .25s var(--ease), text-shadow .2s;
  position: relative; line-height: 1.1; opacity: 0; transform: translateY(14px);
  animation: poemIn .6s var(--ease) forwards;
}
@keyframes poemIn { to { opacity: 1; transform: translateY(0); } }
.poem:hover { color: var(--teal); text-shadow: 0 0 22px rgba(95,208,200,.5); transform: scale(1.06); }
.poem .seq { font-family: var(--font); font-size: .42em; color: var(--ink-faint);
  vertical-align: super; margin-right: 4px; }
.poem.revealed::after { content:"●"; font-size:.3em; color: var(--green); vertical-align: middle;
  margin-left: 6px; opacity:.8; }

/* ---------- VIEWER MODAL ---------- */
.viewer {
  position: fixed; inset: 0; z-index: 100; display: none;
  align-items: center; justify-content: center; padding: 24px;
  background: rgba(4,6,9,.86); backdrop-filter: blur(8px);
}
.viewer.show { display: flex; }
.viewer-card {
  width: min(960px, 100%); background: var(--bg-card); border: 1px solid var(--line-2);
  border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow);
  display: grid; grid-template-columns: 1.25fr .9fr; max-height: 90vh;
}
@media (max-width: 760px){ .viewer-card { grid-template-columns: 1fr; max-height: 92vh; overflow:auto; } }
.viewer-stage { position: relative; aspect-ratio: 16/11; background: #05070a; overflow: hidden; }
.viewer-stage canvas { position:absolute; inset:0; width:100%; height:100%; }
.viewer-stage img { position:absolute; inset:0; width:100%; height:100%; object-fit: cover;
  opacity:0; transition: opacity 1.1s var(--ease); }
.viewer-stage img.show { opacity:1; }
.viewer-status {
  position:absolute; left:0; right:0; bottom:0; padding: 16px 20px; z-index:4;
  background: linear-gradient(to top, rgba(5,7,10,.92), transparent);
  display:flex; align-items:center; gap:12px; font-size:13px; color: var(--teal);
  letter-spacing:.06em;
}
.viewer-status .spin { width:14px; height:14px; border-radius:50%;
  border:2px solid rgba(95,208,200,.25); border-top-color: var(--teal); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.viewer-info { padding: 30px 28px; display:flex; flex-direction:column; }
.viewer-info .bk { font-size:12px; letter-spacing:.16em; text-transform:uppercase; color: var(--gold); }
.viewer-info h3 { font-family: var(--serif); font-size: 32px; line-height:1.05; margin: 10px 0 14px; }
.viewer-info .scene { color: var(--ink-dim); font-size:15px; flex: 1; }
.viewer-info .prompt {
  margin-top: 18px; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 11.5px;
  color: var(--ink-faint); background: var(--bg-soft); border:1px solid var(--line);
  border-radius: var(--r-sm); padding: 12px 14px; max-height: 120px; overflow:auto;
}
.viewer-info .actions { display:flex; gap:10px; margin-top: 20px; flex-wrap:wrap; }
.viewer-close { position: absolute; top: 16px; right: 18px; z-index: 6; width: 38px; height: 38px;
  border-radius: 50%; background: rgba(0,0,0,.45); border: 1px solid var(--line-2);
  display:flex; align-items:center; justify-content:center; font-size:18px; color: var(--ink);
  transition: background .2s; }
.viewer-close:hover { background: rgba(255,255,255,.12); }

/* ---------- MEDIA STRIP (reads / videos / songs) ---------- */
.media-grid { display:grid; grid-template-columns: repeat(3,1fr); gap: 22px; }
@media (max-width: 880px){ .media-grid { grid-template-columns: 1fr; } }
.media-col h3 { font-size: 20px; margin-bottom: 4px; display:flex; align-items:center; gap:10px; }
.media-col .note { color: var(--ink-faint); font-size: 13px; margin-bottom: 18px; }
.track {
  display:flex; align-items:center; gap:14px; padding: 14px 16px; border-radius: var(--r-sm);
  background: var(--bg-card); border: 1px solid var(--line); margin-bottom: 10px;
  transition: border-color .2s, transform .2s; cursor: pointer;
}
.track:hover { border-color: var(--line-2); transform: translateX(3px); }
.track .play { width: 38px; height: 38px; border-radius: 50%; flex:0 0 auto;
  background: rgba(95,208,200,.12); color: var(--teal); display:flex; align-items:center;
  justify-content:center; font-size: 14px; }
.track .meta { flex:1; min-width:0; }
.track .meta b { font-weight: 600; font-size: 14px; display:block;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.track .meta span { color: var(--ink-faint); font-size: 12px; }
.track .dur { color: var(--ink-dim); font-size: 12px; font-variant-numeric: tabular-nums; }
.video-card { aspect-ratio: 16/9; border-radius: var(--r-sm); overflow:hidden; position:relative;
  border:1px solid var(--line); margin-bottom: 12px; cursor:pointer; }
.video-card img { width:100%; height:100%; object-fit:cover; transition: transform .4s; }
.video-card:hover img { transform: scale(1.06); }
.video-card .ov { position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  background: linear-gradient(to top, rgba(5,7,10,.7), transparent 60%); }
.video-card .pbtn { width:54px; height:54px; border-radius:50%; background: rgba(255,255,255,.92);
  color:#062018; display:flex; align-items:center; justify-content:center; font-size:18px; }
.video-card .lab { position:absolute; left:14px; bottom:12px; font-size:13px; font-weight:600;
  text-shadow:0 2px 8px rgba(0,0,0,.7); }

/* ---------- MERCH ---------- */
.merch { background: var(--bg-soft); border-top: 1px solid var(--line); }
.merch-grid { display:grid; grid-template-columns: repeat(4,1fr); gap: 18px; }
@media (max-width: 980px){ .merch-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 520px){ .merch-grid { grid-template-columns: 1fr; } }
.product { background: var(--bg-card); border:1px solid var(--line); border-radius: var(--r);
  overflow:hidden; transition: transform .25s var(--ease), border-color .25s; }
.product:hover { transform: translateY(-4px); border-color: var(--line-2); }
.product .ph { aspect-ratio: 4/5; overflow:hidden; }
.product .ph img { width:100%; height:100%; object-fit:cover; transition: transform .4s; }
.product:hover .ph img { transform: scale(1.05); }
.product .pinfo { padding: 16px; }
.product .pinfo b { font-size: 14px; font-weight: 600; display:block; }
.product .pinfo .row { display:flex; align-items:center; justify-content:space-between; margin-top: 10px; }
.product .price { color: var(--gold); font-weight: 700; }
.product .buy { font-size:12px; color: var(--teal); border:1px solid rgba(95,208,200,.3);
  padding: 6px 12px; border-radius: 100px; }

/* ---------- BOT ---------- */
.bot { background: linear-gradient(160deg, #0a1a24, #0a0f16); border:1px solid var(--line);
  border-radius: calc(var(--r) + 6px); padding: 44px; display:grid;
  grid-template-columns: 1.2fr .8fr; gap: 34px; align-items:center; }
@media (max-width: 760px){ .bot { grid-template-columns: 1fr; } }
.bot h2 { font-size: clamp(26px,3.4vw,38px); line-height:1.1; margin: 14px 0 12px; }
.bot p { color: var(--ink-dim); }
.phone { background: #0e1218; border:1px solid var(--line-2); border-radius: 26px; padding: 16px;
  box-shadow: var(--shadow); }
.phone .bubble { background: var(--bg-card); border:1px solid var(--line); border-radius: 14px;
  padding: 12px 14px; font-size: 13px; margin-bottom: 8px; }
.phone .bubble.me { background: rgba(95,208,200,.12); border-color: rgba(95,208,200,.25);
  margin-left: 30px; }
.phone .kbd { display:flex; gap:6px; flex-wrap:wrap; margin-top: 4px; }
.phone .kbd span { font-size:11px; color: var(--teal); border:1px solid rgba(95,208,200,.3);
  border-radius: 8px; padding: 5px 9px; }

/* ---------- FOOTER ---------- */
footer { border-top: 1px solid var(--line); padding: 50px 0 40px; color: var(--ink-faint); font-size: 13px; }
footer .frow { display:flex; justify-content:space-between; gap:20px; flex-wrap:wrap; align-items:flex-start; }
footer .rights { max-width: 520px; line-height: 1.6; }
footer a:hover { color: var(--ink); }

.reveal { opacity:0; transform: translateY(26px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity:1; transform: none; }

/* ---------- Просмотрщик: крупнее + зум по наведению ---------- */
.viewer-card { width: min(1280px, 96vw); grid-template-columns: 1.55fr .85fr; max-height: 94vh; }
.viewer-stage { aspect-ratio: 16 / 10; }
.viewer-stage img.show { cursor: zoom-in; transition: opacity 1.1s var(--ease), transform .35s var(--ease); will-change: transform; }
.viewer-stage.zooming img.show { transition: transform .12s linear; }
@media (max-width: 760px){ .viewer-card { grid-template-columns: 1fr; } .viewer-stage { aspect-ratio: 16 / 11; } }
