/* ==========================================================================
   pavelpanfilov.com — Навыки устойчивой психики
   Единый стиль. Тёплая, спокойная палитра (чай/медитация, НЕ медицина/эзотерика).
   Fonts: Fraunces (display, Google Fonts) + Satoshi (body, Fontshare).
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  /* Palette (из брифа) */
  --bg:            #FAF8F5; /* тёплый off-white, чай-крем */
  --surface:       #F5F1EA; /* карточки */
  --surface-2:     #FFFFFF; /* белые карточки поверх surface */
  --text:          #28251D; /* тёплый near-black */
  --text-muted:    #6E6C64; /* немного темнее брифа для AA-контраста */
  --text-faint:    #9A968C;
  --accent:        #A84B2F; /* терракота — CTA */
  --accent-hover:  #8E3D25;
  --accent-soft:   #F3E4DC; /* мягкий терракотовый фон */
  --teal:          #20808D; /* deep teal — ссылки, акценты */
  --teal-hover:    #196570;
  --teal-soft:     #E1EDEE;
  --border:        #E5DFD5; /* мягкая тёплая граница */
  --border-strong: #D8D0C2;

  /* Type */
  --font-display: 'Fraunces', 'Georgia', 'Times New Roman', serif;
  --font-body:    'Satoshi', 'Inter', system-ui, -apple-system, sans-serif;

  /* Type scale (base 18px) */
  --text-hero:  clamp(2.5rem, 6vw, 4.25rem);   /* H1 hero */
  --text-3xl:   clamp(2rem, 4.5vw, 3rem);      /* section H2 */
  --text-2xl:   clamp(1.6rem, 3vw, 2.15rem);
  --text-xl:    1.4rem;
  --text-lg:    1.2rem;
  --text-base:  1.125rem; /* 18px */
  --text-sm:    1rem;     /* 16px */
  --text-xs:    0.875rem; /* 14px */

  /* Spacing / layout */
  --maxw: 1120px;
  --maxw-narrow: 760px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(40,37,29,.04), 0 2px 8px rgba(40,37,29,.05);
  --shadow-md: 0 6px 24px rgba(40,37,29,.08);
  --gap: 1.5rem;
  --section-y: clamp(3.5rem, 8vw, 6.5rem);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-hover); text-decoration: underline; }
ul { list-style: none; padding: 0; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--text);
}
h1 { font-size: var(--text-hero); font-weight: 550; }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-xl); font-weight: 550; }
strong { font-weight: 700; }

/* ---------- Layout helpers ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1.15rem, 4vw, 2rem); }
.narrow { max-width: var(--maxw-narrow); }
.section { padding-block: var(--section-y); }
.section--surface { background: var(--surface); }
.eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.9rem;
}
.section__head { max-width: 640px; margin-bottom: 2.6rem; }
.section__head p { color: var(--text-muted); font-size: var(--text-lg); margin-top: 0.9rem; }
.lead { font-size: var(--text-lg); color: var(--text-muted); }
.center { text-align: center; margin-inline: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 700;
  line-height: 1;
  padding: 0.95rem 1.7rem;
  border-radius: 999px;
  border: 1.5px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background .18s ease, color .18s ease, transform .1s ease, border-color .18s ease;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.97); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-hover); color: #fff; }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn--ghost:hover { background: var(--surface); color: var(--text); border-color: var(--text-muted); }
.btn--block { width: 100%; }
.btn:focus-visible, a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250,248,245,.86);
  backdrop-filter: saturate(120%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; color: var(--text); }
.brand:hover { text-decoration: none; color: var(--text); }
.brand svg { flex: none; }
.nav__links { display: flex; align-items: center; gap: 1.5rem; }
.nav__links a { color: var(--text); font-size: var(--text-sm); font-weight: 500; white-space: nowrap; }
.nav__links a:hover { color: var(--accent); text-decoration: none; }
.nav__links a[aria-current="page"] { color: var(--accent); }
.nav__cta { display: flex; align-items: center; gap: 0.9rem; }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 0.5rem; color: var(--text); }
.nav-toggle svg { width: 26px; height: 26px; }

@media (max-width: 1024px) {
  .nav__cta .btn--ghost { display: none; }
}
@media (max-width: 860px) {
  .nav__links {
    position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem clamp(1.15rem, 4vw, 2rem) 1.2rem;
    box-shadow: var(--shadow-md);
    display: none;
  }
  .nav__links.is-open { display: flex; }
  .nav__links a { padding: 0.8rem 0; width: 100%; font-size: var(--text-lg); border-bottom: 1px solid var(--border); }
  .nav__links a:last-child { border-bottom: 0; }
  .nav-toggle { display: inline-flex; }
  .nav__cta .btn--ghost { display: none; }
}

/* ---------- Hero ---------- */
.hero { padding-top: clamp(2.5rem, 6vw, 4.5rem); padding-bottom: var(--section-y); }
.hero__grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero h1 { margin-bottom: 1.25rem; }
.hero__sub { font-size: var(--text-lg); color: var(--text-muted); max-width: 34ch; margin-bottom: 2rem; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem; }
.hero__soft-cta { font-size: var(--text-sm); color: var(--text-muted); margin: 0 0 1.6rem 0; line-height: 1.55; }
.hero__soft-cta a { color: var(--text); border-bottom: 1px solid var(--border-strong); transition: color 200ms ease-out, border-color 200ms ease-out; }
.hero__soft-cta a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.hero__trust { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.4rem; font-size: var(--text-sm); color: var(--text-muted); }
.hero__trust .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--border-strong); }
.stars { color: var(--accent); letter-spacing: 2px; }
@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__media { order: -1; }
  .hero__sub { max-width: none; }
}

/* ---------- Photo placeholders ---------- */
.photo {
  position: relative;
  border-radius: var(--radius-lg);
  background: linear-gradient(150deg, #EFE6DB 0%, #E7D6C6 45%, #E3C9B4 100%);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  color: #8a6a54;
  overflow: hidden;
}
.photo::after {
  content: attr(data-label);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 1rem;
  max-width: 80%;
  opacity: 0.85;
}
.photo--portrait { aspect-ratio: 4 / 5; }
.photo--wide { aspect-ratio: 16 / 10; }
.photo--square { aspect-ratio: 1 / 1; }
.photo svg { position: absolute; opacity: 0.35; width: 46%; height: auto; }

/* Real photos fill the container and hide the placeholder decorations */
.photo--filled { background: #d8c5b0; }
.photo--filled::after { content: none; }
.photo--filled img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  box-shadow: var(--shadow-sm);
}
.card h3 { font-size: var(--text-lg); margin-bottom: 0.5rem; }
.card p { color: var(--text-muted); font-size: var(--text-sm); }
.card__icon {
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center; margin-bottom: 1rem;
}
.card__icon svg { width: 22px; height: 22px; }

/* ---------- Problem cards ---------- */
.problem-card { border-left: 3px solid var(--accent); }
.problem-card h3 { font-family: var(--font-display); font-weight: 500; font-size: var(--text-lg); }

/* ---------- Methodology highlight block ---------- */
.method {
  background: var(--text);
  color: #F3EFE8;
  border-radius: var(--radius-lg);
  padding: clamp(2.2rem, 5vw, 3.6rem);
  text-align: center;
}
.method .eyebrow { color: #E3C9B4; }
.method blockquote {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.5rem, 3.2vw, 2.3rem);
  line-height: 1.25;
  color: #FBF7F1;
  max-width: 22ch;
  margin: 0 auto 1.5rem;
}
.method p { color: #C9C3B7; max-width: 52ch; margin: 0 auto; font-size: var(--text-base); }
.method__cite { display: block; font-family: var(--font-body); font-size: var(--text-sm); color: #C9C3B7; margin-top: 1.4rem; font-style: normal; }

/* ---------- vs. others compare ---------- */
.compare { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--gap); }
@media (max-width: 780px){ .compare { grid-template-columns: 1fr; } }
.compare .card p { font-size: var(--text-sm); }
.compare .card strong { color: var(--text); }

/* ---------- Program blocks ---------- */
.blocks { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); margin-bottom: 2.4rem; }
@media (max-width: 820px){ .blocks { grid-template-columns: 1fr; } }
.block {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.7rem; box-shadow: var(--shadow-sm);
}
.block__num { font-family: var(--font-display); font-size: 2.4rem; color: var(--accent-soft); font-weight: 600; line-height: 1; }
.block__num span { color: var(--accent); }
.block h3 { font-size: var(--text-lg); margin: 0.4rem 0 0.5rem; }
.block .meta { font-size: var(--text-xs); color: var(--text-faint); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 0.7rem; }
.block p { color: var(--text-muted); font-size: var(--text-sm); }

/* ---------- Lessons list (accordion or plain) ---------- */
.lessons { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }
.lesson-row { display: flex; align-items: flex-start; gap: 1rem; padding: 1.05rem 1.4rem; border-bottom: 1px solid var(--border); }
.lesson-row:last-child { border-bottom: 0; }
.lesson-row .n { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--teal-soft); color: var(--teal-hover); font-weight: 700; font-size: var(--text-sm); display: flex; align-items: center; justify-content: center; }
.lesson-row .body h4 { font-family: var(--font-body); font-weight: 700; font-size: var(--text-base); margin-bottom: 0.15rem; letter-spacing: 0; }
.lesson-row .body p { color: var(--text-muted); font-size: var(--text-sm); }

.block-label { font-family: var(--font-body); font-weight: 700; font-size: var(--text-xs); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); padding: 1.4rem 1.4rem 0.4rem; }

/* ---------- Inside a lesson ---------- */
.inside { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
@media (max-width: 780px){ .inside { grid-template-columns: 1fr; } }

/* ---------- Testimonials ---------- */
.testi { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap); }
@media (max-width: 820px){ .testi { grid-template-columns: 1fr; } }
.quote {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.9rem; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
}
.quote__stars { color: var(--accent); letter-spacing: 2px; margin-bottom: 1rem; font-size: var(--text-sm); }
.quote p { font-size: var(--text-base); line-height: 1.62; color: var(--text); margin-bottom: 1.3rem; }
.quote__who { display: flex; align-items: center; gap: 0.8rem; margin-top: auto; }
.quote__ava { width: 44px; height: 44px; border-radius: 50%; flex: none;
  background: linear-gradient(150deg,#E7D6C6,#E3C9B4); color:#8a6a54;
  display:flex; align-items:center; justify-content:center; font-family: var(--font-display); font-weight:600; }
.quote__who b { font-family: var(--font-body); font-weight: 700; font-size: var(--text-sm); }
.quote__who span { display: block; color: var(--text-faint); font-size: var(--text-xs); }

/* ---------- Fears / guarantees ---------- */
.fears { display: grid; grid-template-columns: repeat(2,1fr); gap: var(--gap); }
@media (max-width: 780px){ .fears { grid-template-columns: 1fr; } }
.fear { background: var(--surface-2); border:1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.fear h3 { font-family: var(--font-display); font-weight: 500; font-size: var(--text-lg); margin-bottom: 0.5rem; }
.fear h3::before { content: "«"; color: var(--accent); }
.fear h3::after { content: "»"; color: var(--accent); }
.fear p { color: var(--text-muted); font-size: var(--text-sm); }

/* ---------- Pricing ---------- */
.pricing { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--gap); align-items: stretch; }
@media (max-width: 900px){ .pricing { grid-template-columns: 1fr; max-width: 480px; margin-inline:auto; } }
.tier {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 2rem 1.7rem; display: flex; flex-direction: column; box-shadow: var(--shadow-sm);
}
.tier--featured { border: 2px solid var(--accent); box-shadow: var(--shadow-md); position: relative; }
.tier__badge {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #fff; font-size: var(--text-xs); font-weight: 700;
  padding: 0.3rem 0.9rem; border-radius: 999px; letter-spacing: 0.02em; white-space: nowrap;
}
.tier__name { font-family: var(--font-display); font-weight: 550; font-size: var(--text-xl); margin-bottom: 0.5rem; }
.tier__price { font-family: var(--font-display); font-size: 2.3rem; font-weight: 600; color: var(--text); line-height: 1; }
.tier__price small { font-family: var(--font-body); font-size: var(--text-sm); font-weight: 500; color: var(--text-faint); }
.tier__desc { color: var(--text-muted); font-size: var(--text-sm); margin: 0.6rem 0 1.3rem; }
.tier ul.feat { display: flex; flex-direction: column; gap: 0.7rem; margin-bottom: 1.6rem; }
.tier ul.feat li { position: relative; padding-left: 1.7rem; font-size: var(--text-sm); color: var(--text); }
.tier ul.feat li::before {
  content: ""; position: absolute; left: 0; top: 0.35em; width: 16px; height: 9px;
  border-left: 2px solid var(--teal); border-bottom: 2px solid var(--teal);
  transform: rotate(-45deg); border-radius: 1px;
}
.tier .btn { margin-top: auto; }

/* ---------- FAQ ---------- */
.faq { max-width: var(--maxw-narrow); margin-inline: auto; }
.faq__item { border-bottom: 1px solid var(--border); }
.faq__item summary {
  cursor: pointer; list-style: none;
  padding: 1.3rem 0; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  font-family: var(--font-display); font-weight: 500; font-size: var(--text-lg); color: var(--text);
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary .plus { flex: none; width: 24px; height: 24px; position: relative; transition: transform .2s ease; color: var(--accent); }
.faq__item summary .plus::before, .faq__item summary .plus::after {
  content: ""; position: absolute; background: currentColor; border-radius: 2px;
}
.faq__item summary .plus::before { top: 11px; left: 3px; width: 18px; height: 2px; }
.faq__item summary .plus::after { top: 3px; left: 11px; width: 2px; height: 18px; transition: transform .2s ease; }
.faq__item[open] summary .plus::after { transform: rotate(90deg); }
.faq__answer { padding: 0 0 1.4rem; color: var(--text-muted); font-size: var(--text-base); max-width: 62ch; }

/* ---------- Final CTA ---------- */
.finalcta { text-align: center; }
.finalcta .method { }
.finalcta h2 { color: #FBF7F1; font-size: var(--text-3xl); margin-bottom: 1rem; }

/* ---------- Guarantee inline note ---------- */
.guarantee-note {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--teal-soft); color: var(--teal-hover);
  border-radius: 999px; padding: 0.4rem 0.9rem; font-size: var(--text-sm); font-weight: 600;
}

/* ---------- About page ---------- */
.about-hero__grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(2rem,5vw,3.5rem); align-items: start; }
@media (max-width: 860px){ .about-hero__grid { grid-template-columns: 1fr; } }
.creds { display: grid; gap: 1rem; }
.cred { display: flex; gap: 1rem; align-items: flex-start; padding: 1.1rem 1.3rem; background: var(--surface-2); border:1px solid var(--border); border-radius: var(--radius); }
.cred .yr { font-family: var(--font-display); font-weight: 600; color: var(--accent); font-size: var(--text-base); flex: none; min-width: 64px; }
.cred p { color: var(--text-muted); font-size: var(--text-sm); }
.cred b { color: var(--text); font-family: var(--font-body); font-size: var(--text-base); }
.prose p { margin-bottom: 1.2rem; max-width: 66ch; color: var(--text); }
.prose p.lead { color: var(--text-muted); }

/* ---------- Who is / isn't for ---------- */
.forwho { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
@media (max-width: 780px){ .forwho { grid-template-columns: 1fr; } }
.forwho ul li { padding-left: 1.9rem; position: relative; margin-bottom: 0.8rem; font-size: var(--text-base); color: var(--text); }
.forwho .is li::before { content:""; position:absolute; left:0; top:0.4em; width:14px; height:8px; border-left:2px solid var(--teal); border-bottom:2px solid var(--teal); transform:rotate(-45deg); }
.forwho .isnt li::before { content:"—"; position:absolute; left:0; color: var(--text-faint); font-weight:700; }

/* ---------- Footer ---------- */
.site-footer { background: var(--text); color: #C9C3B7; padding-block: 3rem 2.2rem; }
.site-footer a { color: #E3C9B4; }
.site-footer a:hover { color: #fff; }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; margin-bottom: 2rem; }
@media (max-width: 720px){ .footer__grid { grid-template-columns: 1fr; gap: 1.5rem; } }
.footer__grid h4 { color: #F3EFE8; font-family: var(--font-body); font-weight: 700; font-size: var(--text-sm); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 0.9rem; }
.footer__grid p, .footer__grid li { font-size: var(--text-sm); margin-bottom: 0.5rem; }
.footer__brand { display:flex; align-items:center; gap:0.6rem; font-family: var(--font-display); font-weight:600; font-size:1.2rem; color:#F3EFE8; margin-bottom:0.8rem; }
.footer__bottom { border-top: 1px solid rgba(255,255,255,.12); padding-top: 1.4rem; font-size: var(--text-xs); color: #8f897d; display:flex; flex-wrap:wrap; gap:0.5rem 1.5rem; justify-content: space-between; }

/* ---------- Scroll fade-in ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .3s ease-out, transform .3s ease-out; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Misc ---------- */
.tag-row { display:flex; flex-wrap:wrap; gap:0.5rem; margin-top:1rem; }
.tag { background: var(--surface); border:1px solid var(--border); border-radius:999px; padding:0.35rem 0.85rem; font-size: var(--text-xs); color: var(--text-muted); }
.divider-note { font-size: var(--text-xs); color: var(--text-faint); text-align:center; margin-top:1rem; }
.skip-link { position:absolute; left:-999px; top:0; background:var(--accent); color:#fff; padding:0.6rem 1rem; border-radius:0 0 8px 0; z-index:100; }
.skip-link:focus { left:0; }
