/* Оболочка сайта. Палитра — как у лендинга kezzo.kz («тёплая бумага»). */

:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --soft: #f1ede7;
  --ink: #1d1a17;
  --muted: #6f675f;
  --line: #e7e1d9;
  --accent: #ff5c1f;
  --accent-text: #d9480f;
  --radius: 22px;
  --gutter: 16px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 130px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 500 16px/1.55 "Manrope", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
button, input { font: inherit; color: inherit; }
h1, h2, h3 { font-family: "Unbounded", sans-serif; font-weight: 600; letter-spacing: -0.02em; line-height: 1.12; margin: 0; }
.muted { color: var(--muted); }
body.locked { overflow: hidden; }

/* ---------- Шапка ---------- */

.top {
  position: sticky; top: 0; z-index: 20;
  background: rgb(250 248 245 / 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.top-in {
  max-width: 1240px; margin: 0 auto;
  padding: 12px var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.logo img { width: 28px; height: 28px; filter: brightness(0); }
.logo b { font-family: "Unbounded", sans-serif; font-weight: 600; font-size: 18px; }
.logo span { font-size: 13px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-text); }
.top-actions { display: flex; align-items: center; gap: 8px; }

.nav {
  max-width: 1240px; margin: 0 auto;
  padding: 0 var(--gutter) 10px;
  display: flex; gap: 6px;
  overflow-x: auto; scrollbar-width: none;
  mask-image: linear-gradient(90deg, #000 90%, transparent);
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  flex: none;
  padding: 8px 14px; border-radius: 999px;
  text-decoration: none; font-size: 14px; font-weight: 700;
  color: var(--muted);
}
.nav a:hover { color: var(--ink); background: var(--soft); }
.nav a[aria-current="page"] { background: var(--ink); color: var(--bg); }

/* ---------- Кнопки ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 8px 16px;
  border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer;
  font-size: 14px; font-weight: 700; white-space: nowrap;
  text-decoration: none;
}
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn.primary:hover { background: #000; }
.btn.ghost { background: transparent; }
.btn.icon { width: 40px; padding: 0; font-size: 17px; }
.btn.sm { min-height: 32px; padding: 4px 12px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: progress; }
.btn:focus-visible, .nav a:focus-visible, .seg button:focus-visible, .card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--soft); }
.seg button {
  border: 0; background: transparent; cursor: pointer;
  min-width: 40px; min-height: 34px; padding: 0 10px; border-radius: 999px;
  font-size: 13px; font-weight: 800; letter-spacing: 0.04em; color: var(--muted);
}
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / 0.12); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line); background: var(--surface); cursor: pointer;
  padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 700;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---------- Страница ---------- */

.page { max-width: 1240px; margin: 0 auto; padding: 32px var(--gutter) 64px; }
.eyebrow-s { font-size: 12px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent-text); margin-bottom: 10px; }
.hero { padding: 16px 0 36px; max-width: 820px; }
.hero h1 { font-size: clamp(30px, 6vw, 56px); }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { font-size: 18px; color: var(--muted); margin: 18px 0 0; max-width: 640px; }

.section { padding: 36px 0; border-top: 1px solid var(--line); }
.section:first-of-type { border-top: 0; }
.section > h2 { font-size: clamp(22px, 3.4vw, 30px); margin-bottom: 8px; }
.section > .lead { color: var(--muted); margin: 0 0 22px; max-width: 700px; }
.head-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; }

.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 16px; }
.box {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px;
}
.box h3 { font-size: 18px; margin-bottom: 14px; }
.box.dark { background: #131110; color: #f3efe9; border-color: #131110; }
.box.dark .muted, .box.dark dt { color: #a39a90; }
dl.kv { display: grid; grid-template-columns: 110px 1fr; gap: 10px 14px; margin: 0; }
dl.kv dt { font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
dl.kv dd { margin: 0; }
@media (max-width: 480px) { dl.kv { grid-template-columns: 1fr; gap: 2px; } dl.kv dd { margin-bottom: 10px; } }

/* Таблица, которая на телефоне превращается в карточки */
.table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 15px; }
.table th { font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); background: var(--soft); }
.table tr:last-child td { border-bottom: 0; }
.table td:first-child { font-weight: 800; white-space: nowrap; }
@media (max-width: 720px) {
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table thead { display: none; }
  .table { border: 0; background: none; }
  .table tr { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 8px 4px; margin-bottom: 10px; }
  .table td { border: 0; padding: 6px 14px; white-space: normal !important; }
  .table td[data-l]::before { content: attr(data-l); display: block; font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
}

.steps { list-style: none; padding: 0; margin: 0; counter-reset: s; display: grid; gap: 10px; }
.steps li {
  counter-increment: s; position: relative;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 16px 18px 16px 62px;
}
.steps li::before {
  content: counter(s, decimal-leading-zero);
  position: absolute; left: 18px; top: 16px;
  font-family: "Unbounded", sans-serif; font-size: 14px; font-weight: 600; color: var(--accent-text);
}
.steps b { display: block; }
.steps span { color: var(--muted); font-size: 15px; }
ul.dots { margin: 0; padding-left: 20px; }
ul.dots li { margin: 6px 0; }

/* ---------- Карточки постов ---------- */

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 20px; }
.card {
  display: flex; flex-direction: column; gap: 12px;
  background: none; border: 0; padding: 0; text-align: left; cursor: pointer;
}
.card .frame { border-radius: 16px; box-shadow: 0 1px 0 var(--line), 0 12px 30px -18px rgb(29 26 23 / 0.35); transition: transform 0.2s; }
.card:hover .frame { transform: translateY(-3px); }
.card-meta { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.card-meta b { font-size: 16px; }
.card-meta span { font-size: 13px; color: var(--muted); white-space: nowrap; }
.card p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.45; }
.badge { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: #fff1e8; color: var(--accent-text); }
.badge.warn { background: #fde8e8; color: #b42318; }

/* Уменьшенный холст */
.frame { position: relative; overflow: hidden; aspect-ratio: 1080 / 1350; background: var(--soft); }
.frame.story { aspect-ratio: 1080 / 1920; }
.frame > .canvas { position: absolute; top: 0; left: 0; transform-origin: 0 0; transform: scale(var(--s, 0.25)); }

/* Сетка профиля */
.profile { max-width: 480px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.profile-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.profile-ava { width: 64px; height: 64px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line); display: grid; place-items: center; flex: none; }
.profile-ava img { width: 38px; filter: brightness(0); }
.profile-bio { font-size: 13px; line-height: 1.45; white-space: pre-line; }
.profile-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.profile-grid .frame { border-radius: 0; }

/* Идеи Reels */
.reel { display: flex; flex-direction: column; gap: 10px; }
.reel h3 { font-size: 17px; margin: 0; }
.reel .hook { font-family: "Unbounded", sans-serif; font-weight: 500; font-size: 15px; background: var(--ink); color: var(--bg); padding: 12px 14px; border-radius: 14px; line-height: 1.35; }
.reel .hook small { display: block; font-family: "Manrope", sans-serif; font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: #ff7a45; margin-bottom: 4px; }
.reel p { margin: 0; font-size: 15px; color: var(--muted); }
.reel .row-meta { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 700; }
.reel:target { outline: 2px solid var(--accent); }
.reel .setup { font-size: 14px; color: var(--ink); }
.reel details.script { border-top: 1px solid var(--line); padding-top: 10px; }
.reel details.script summary { cursor: pointer; font-weight: 700; font-size: 14px; }
.reel details.script ol { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 8px; }
.reel details.script li { display: grid; grid-template-columns: 64px 1fr; gap: 10px; font-size: 14px; line-height: 1.4; }
.reel details.script .t { font-family: ui-monospace, monospace; font-size: 12px; color: var(--accent-text, #d9480f); padding-top: 2px; }
.reel details.script em { display: block; font-style: normal; color: var(--muted); margin-top: 2px; }

/* План */
.week { margin-bottom: 26px; }
.week h3 { font-size: 17px; margin: 0 0 10px; }
.plan-row {
  display: grid; grid-template-columns: 44px 92px 70px 1fr auto; gap: 12px; align-items: center;
  padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 6px;
  font-size: 15px;
}
.plan-row .d { font-weight: 800; }
.acc { font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; padding: 4px 8px; border-radius: 999px; text-align: center; }
.acc.kezzo { background: #fff1e8; color: var(--accent-text); }
.acc.blog { background: #1d1a17; color: #f3efe9; }
.plan-row .f { font-size: 13px; color: var(--muted); font-weight: 700; }
@media (max-width: 640px) {
  .plan-row { grid-template-columns: 36px auto 1fr; grid-template-areas: "d a f" "t t t" "o o o"; row-gap: 6px; }
  .plan-row .d { grid-area: d; } .plan-row .acc { grid-area: a; justify-self: start; } .plan-row .f { grid-area: f; justify-self: end; }
  .plan-row .t { grid-area: t; } .plan-row .btn { grid-area: o; justify-self: start; }
}

/* Скрипты и шапки профиля */
.copy-box { position: relative; }
.copy-text { white-space: pre-line; background: var(--soft); border-radius: 14px; padding: 14px 16px; font-size: 15px; margin: 10px 0; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.swatch { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--surface); cursor: pointer; text-align: left; padding: 0; }
.swatch i { display: block; height: 72px; }
.swatch span { display: block; padding: 10px 12px; font-size: 13px; }
.swatch code { display: block; color: var(--muted); font-size: 12px; }

/* ---------- Просмотр поста ---------- */

.viewer {
  position: fixed; inset: 0; z-index: 50;
  background: #131110; color: #f3efe9;
  display: flex; flex-direction: column;
}
.viewer[hidden] { display: none; }
.viewer .btn { background: #1c1a18; border-color: #2e2a26; color: #f3efe9; }
.viewer .btn:hover { border-color: #f3efe9; }
.viewer .btn.primary { background: #ff5c1f; border-color: #ff5c1f; color: #fff; }
.viewer .btn[aria-pressed="true"] { background: #f3efe9; color: #131110; }
.viewer .seg { background: #2a2623; }
.viewer .seg button { color: #a39a90; }
.viewer .seg button[aria-pressed="true"] { background: #f3efe9; color: #131110; }
.viewer-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px var(--gutter); padding-top: max(10px, env(safe-area-inset-top));
  border-bottom: 1px solid #2e2a26;
}
.viewer-title { flex: 1; min-width: 0; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.viewer-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 360px; }
.strip {
  display: flex; gap: 20px; align-items: flex-start;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory;
  padding: 24px;
}
.slide { flex: none; scroll-snap-align: center; display: flex; flex-direction: column; gap: 10px; }
.slide .frame { border-radius: 10px; box-shadow: 0 0 0 1px #2e2a26; }
.slide-bar { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: #a39a90; font-weight: 700; }
.viewer-side { border-left: 1px solid #2e2a26; overflow-y: auto; padding: 20px; }
.viewer-side h4 { font-size: 12px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: #a39a90; margin: 0 0 8px; }
.viewer-side .caption { white-space: pre-line; font-size: 15px; background: #1c1a18; border: 1px solid #2e2a26; border-radius: 14px; padding: 14px; margin-bottom: 10px; }
.viewer-side .tags { color: #ff7a45; }
.viewer-side section { margin-bottom: 22px; }
.viewer-side .warn { background: #3a1616; color: #ffc9c9; border-radius: 14px; padding: 12px 14px; font-size: 14px; }
.hint { font-size: 13px; color: #a39a90; }

@media (max-width: 900px) {
  .viewer-body { display: block; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .strip { padding: 16px; gap: 12px; }
  .viewer-side { border-left: 0; border-top: 1px solid #2e2a26; overflow: visible; }
  .viewer-actions { width: 100%; }
  .viewer-actions .seg { margin-right: auto; }
}

/* ---------- Диалог и уведомление ---------- */

.dialog { border: 0; border-radius: 24px; padding: 0; width: min(420px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); }
.dialog::backdrop { background: rgb(19 17 16 / 0.5); }
.dialog form { padding: 24px; display: grid; gap: 12px; }
.dialog h3 { font-size: 20px; }
.dialog p { margin: 0; font-size: 14px; }
.dialog label { display: grid; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.dialog input { border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; font-size: 16px; font-weight: 600; color: var(--ink); background: var(--bg); }
.dialog input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

.toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 80;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 700; transition: 0.2s; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.foot {
  max-width: 1240px; margin: 0 auto; padding: 24px var(--gutter) 40px;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-size: 13px; color: var(--muted); border-top: 1px solid var(--line);
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
