/* ============================================================
   pawetta — Никита Вихров · персональный сайт
   База: LLMSpy Design System (тёплая «бумажная» палитра)
   ============================================================ */

/* Шрифты подгружаются через <link> в HTML с preconnect — быстрее, чем @import */

:root {
  /* Brand */
  --terracotta:   #c96442;
  --terracotta-d: #b1543a;
  --coral:        #d97757;

  /* Surfaces */
  --parchment:    #f5f4ed;
  --ivory:        #faf9f5;
  --white:        #ffffff;
  --warm-sand:    #e8e6dc;
  --sand-deep:    #e0ddd1;

  /* Dark */
  --near-black:   #141413;
  --dark-surface: #30302e;
  --dark-warm:    #3d3d3a;

  /* Text */
  --charcoal:     #4d4c48;
  --olive:        #5e5d59;
  --stone:        #87867f;
  --warm-silver:  #b0aea5;

  /* Borders */
  --border-cream: #f0eee6;
  --border-warm:  #e8e6dc;
  --border-deep:  #ddd9cc;
  --border-dark:  #30302e;

  /* Rings */
  --ring-warm:    #d1cfc5;
  --ring-deep:    #c2c0b6;

  /* Semantic accents */
  --tint-terra:   #f4e7e0;
  --tint-sand:    #efece1;
  --tint-green:   #e7eee4;
  --green:        #3a6b4a;
  --error:        #b53333;
  --focus:        #3898ec;

  /* Fonts */
  --serif: 'DM Sans', system-ui, sans-serif;
  --sans:  'DM Sans', system-ui, sans-serif;
  --mono:  'JetBrains Mono', ui-monospace, monospace;

  /* Shadows */
  --shadow-ring:    0 0 0 1px var(--ring-warm);
  --shadow-whisper: 0 4px 24px rgba(20,20,19,0.05);
  --shadow-lift:    0 8px 40px rgba(20,20,19,0.09);

  /* Radius */
  --r-sm: 6px;  --r-md: 8px;  --r-lg: 12px;  --r-xl: 16px;  --r-2xl: 22px;  --r-3xl: 32px;

  /* Motion */
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --t: 0.18s ease;

  /* Layout */
  --maxw: 1080px;
  --nav-maxw: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
  --section-y: clamp(56px, 8vw, 92px);
  --section-y-tight: clamp(40px, 6vw, 64px);
  --grid-gap: clamp(16px, 2.5vw, 22px);
  --nav-h: 62px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: clip; }

body {
  font-family: var(--sans);
  font-size: clamp(16px, 1.05vw, 17px);
  line-height: 1.6;
  color: var(--near-black);
  background: var(--parchment);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  text-wrap: pretty;
  overflow-x: clip;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

::selection { background: var(--tint-terra); color: var(--near-black); }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--ring-warm); border-radius: 5px; border: 2px solid var(--parchment); }
::-webkit-scrollbar-thumb:hover { background: var(--ring-deep); }

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; height: auto; }
button { font-family: inherit; cursor: pointer; }

/* ── Typography ─────────────────────────────────────────── */
.serif { font-family: var(--serif); font-weight: 600; letter-spacing: -0.02em; }
.mono  { font-family: var(--mono); }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; color: var(--near-black); line-height: 1.14; letter-spacing: -0.022em; }

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stone);
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.eyebrow::before {
  content: "";
  width: 18px; height: 1px;
  background: var(--terracotta);
  display: inline-block;
}

.lead { font-size: clamp(18px, 2.2vw, 21px); line-height: 1.62; color: var(--olive); }
.muted { color: var(--stone); }

/* ── Layout ─────────────────────────────────────────────── */
.wrap { max-width: min(var(--maxw), 100%); margin: 0 auto; padding: 0 var(--gutter); width: 100%; }
.section { padding-block: var(--section-y); }
.section--tight { padding-block: var(--section-y-tight); }
.hairline { height: 1px; background: var(--border-deep); border: none; }

.sec-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: clamp(16px, 3vw, 24px);
  margin-bottom: clamp(28px, 4vw, 40px);
  flex-wrap: wrap;
}
.sec-head .ttl { display: flex; align-items: center; gap: 14px; flex: 1 1 auto; min-width: 0; }
.sec-head h2 { font-size: clamp(26px, 4vw, 34px); }
.sec-icon {
  width: 38px; height: 38px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: var(--r-md);
  background: var(--ivory);
  box-shadow: var(--shadow-ring);
  color: var(--terracotta);
}
.sec-icon svg { width: 20px; height: 20px; }

/* ── Grids ──────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--grid-gap); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--grid-gap); }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--sans); font-size: 15.5px; font-weight: 500;
  border: none; border-radius: var(--r-lg);
  padding: 11px 18px; transition: all var(--t);
  white-space: nowrap; text-align: center;
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn--brand { background: var(--terracotta); color: var(--ivory); }
.btn--brand:hover { background: var(--terracotta-d); }
.btn--sand { background: var(--warm-sand); color: var(--charcoal); box-shadow: var(--shadow-ring); }
.btn--sand:hover { background: var(--sand-deep); box-shadow: 0 0 0 1px var(--ring-deep); }
.btn--ghost { background: transparent; color: var(--charcoal); }
.btn--ghost:hover { background: var(--warm-sand); }
.btn--dark { background: var(--near-black); color: var(--ivory); }
.btn--dark:hover { background: var(--dark-warm); }
.btn .arrow { transition: transform var(--t); }
.btn:hover .arrow { transform: translateX(3px); }

.tlink {
  color: var(--terracotta); font-weight: 500; position: relative;
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap; flex-shrink: 0;
}
.tlink::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 1px; width: 100%;
  background: var(--terracotta); transform: scaleX(0); transform-origin: left;
  transition: transform 0.25s var(--ease);
}
.tlink:hover::after { transform: scaleX(1); }
.tlink .arrow { transition: transform var(--t); }
.tlink:hover .arrow { transform: translateX(3px); }

/* ── Chips / badges ─────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  font-size: 13px; font-weight: 500; color: var(--charcoal);
  background: var(--ivory); border-radius: 999px;
  padding: 5px 12px; box-shadow: var(--shadow-ring);
}
.chip--dot::before { content:""; width:6px; height:6px; border-radius:50%; background: var(--terracotta); }
.badge {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--terracotta); background: var(--tint-terra);
  padding: 3px 9px; border-radius: var(--r-sm);
}
.badge--green { color: var(--green); background: var(--tint-green); }
.badge--sand { color: var(--charcoal); background: var(--warm-sand); }

/* ── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--ivory); border-radius: var(--r-xl);
  box-shadow: var(--shadow-ring); padding: clamp(20px, 3vw, 28px);
  transition: box-shadow var(--t), transform var(--t);
}
.card--link { cursor: pointer; }
.card--link:hover { box-shadow: var(--shadow-lift), 0 0 0 1px var(--ring-deep); transform: translateY(-3px); }

/* ── Callout ────────────────────────────────────────────── */
.callout {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--tint-sand); border-radius: var(--r-lg);
  padding: clamp(16px, 2.5vw, 18px) clamp(18px, 2.5vw, 20px);
  box-shadow: inset 0 0 0 1px rgba(20,20,19,0.04);
}
.callout--terra { background: var(--tint-terra); }
.callout--green { background: var(--tint-green); }
.callout .ico { flex-shrink: 0; width: 24px; height: 24px; color: var(--terracotta); margin-top: 1px; }
.callout--green .ico { color: var(--green); }
.callout p { color: var(--charcoal); font-size: 16px; }

/* ── Toggle ─────────────────────────────────────────────── */
.toggle { border-bottom: 1px solid var(--border-deep); }
.toggle > summary {
  list-style: none; cursor: pointer; padding: 20px 4px;
  display: flex; align-items: center; gap: 14px;
  font-family: var(--serif); font-size: clamp(17px, 2.5vw, 20px); font-weight: 500; color: var(--near-black);
}
.toggle > summary::-webkit-details-marker { display: none; }
.toggle .caret { width: 16px; height: 16px; color: var(--stone); transition: transform 0.2s var(--ease); flex-shrink: 0; }
.toggle[open] .caret { transform: rotate(90deg); }
.toggle .body { padding: 0 4px 22px 34px; color: var(--olive); font-size: 16px; line-height: 1.65; }
.toggle .body p + p { margin-top: 10px; }

/* ── Metric ─────────────────────────────────────────────── */
.metric .num { font-family: var(--serif); font-size: clamp(32px, 5vw, 46px); font-weight: 500; line-height: 1; color: var(--near-black); letter-spacing: -0.02em; }
.metric .num .unit { color: var(--terracotta); }
.metric .lbl { font-size: 14px; color: var(--stone); margin-top: 8px; }

kbd { font-family: var(--mono); font-size: 12px; background: var(--ivory); padding: 2px 7px; border-radius: var(--r-sm); box-shadow: var(--shadow-ring); color: var(--charcoal); }
.inline-code { font-family: var(--mono); font-size: 0.92em; background: var(--warm-sand); padding: 1px 6px; border-radius: 5px; color: var(--terracotta-d); }

/* ── Reveal ─────────────────────────────────────────────── */
.reveal { opacity: 1; transform: none; transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
html.js .reveal { opacity: 0; transform: translateY(18px); }
html.js .reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.06s; }
.reveal.d2 { transition-delay: 0.12s; }
.reveal.d3 { transition-delay: 0.18s; }
.reveal.d4 { transition-delay: 0.24s; }

/* ── Scroll progress ────────────────────────────────────── */
.scrollbar {
  position: fixed; left: 0; top: 0; height: 3px; width: 0;
  background: var(--terracotta); z-index: 100; transition: width 0.1s linear;
}

/* ── Nav ────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(245,244,237,0.82);
  backdrop-filter: saturate(1.2) blur(12px);
  -webkit-backdrop-filter: saturate(1.2) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t), background var(--t);
}
.nav.scrolled { border-bottom-color: var(--border-deep); }
.nav-inner {
  max-width: var(--nav-maxw); margin: 0 auto;
  padding: 12px var(--gutter);
  display: flex; align-items: center; gap: clamp(12px, 2vw, 28px);
  min-height: var(--nav-h);
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark { display: inline-flex; align-items: center; flex-shrink: 0; }
.logo-img { height: 36px; width: auto; display: block; }
.brand .mark {
  width: 34px; height: 34px; border-radius: 9px; background: var(--near-black);
  color: var(--ivory); display: grid; place-items: center;
  font-family: var(--serif); font-size: 17px; font-weight: 600;
}
.brand .name { font-family: var(--serif); font-size: clamp(16px, 2vw, 19px); font-weight: 500; letter-spacing: -0.01em; }
.brand .role { font-size: 11.5px; color: var(--stone); margin-top: -3px; }
.nav-links { display: flex; align-items: center; gap: 0; margin-left: 6px; flex: 1 1 auto; min-width: 0; justify-content: flex-start; }
.nav-links a {
  font-size: 14px; color: var(--olive); padding: 7px 10px; border-radius: var(--r-md);
  transition: background var(--t), color var(--t); white-space: nowrap;
}
.nav-links a:hover { background: var(--warm-sand); color: var(--near-black); }
.nav-links a.active { color: var(--near-black); font-weight: 500; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.nav-tg {
  display: inline-flex; align-items: center; gap: 7px; font-size: 14px; color: var(--olive);
  padding: 8px 10px; border-radius: var(--r-md); transition: var(--t); white-space: nowrap;
}
.nav-tg:hover { background: var(--warm-sand); color: var(--near-black); }
.nav-tg svg { width: 17px; height: 17px; }
.burger {
  display: none; background: none; border: none;
  padding: 8px; border-radius: var(--r-md); color: var(--near-black);
}
.burger:hover { background: var(--warm-sand); }

.mobile-menu {
  display: none; flex-direction: column; gap: 2px;
  background: var(--ivory);
  border-bottom: 1px solid var(--border-deep);
  padding: 12px var(--gutter) 16px;
}
.mobile-menu.is-open { display: flex; }
.mobile-menu a {
  font-size: 16px; color: var(--charcoal);
  padding: 12px 10px; border-radius: var(--r-md);
  transition: background var(--t), color var(--t);
}
.mobile-menu a:hover { background: var(--warm-sand); color: var(--near-black); }
.mobile-menu a.mob-cta {
  margin-top: 8px; background: var(--terracotta); color: var(--ivory);
  text-align: center; font-weight: 500; padding: 14px 16px;
}
.mobile-menu a.mob-cta:hover { background: var(--terracotta-d); color: var(--ivory); }

/* ── Footer ─────────────────────────────────────────────── */
.footer { background: var(--near-black); color: var(--warm-silver); padding: clamp(48px, 7vw, 72px) 0 clamp(32px, 5vw, 40px); margin-top: auto; }
.footer .brand .logo-img { background: var(--ivory); border-radius: 9px; padding: 4px; box-sizing: content-box; height: 32px; }
.footer h2, .footer h3, .footer .name { color: var(--ivory); }
.footer a { color: var(--warm-silver); transition: color var(--t); }
.footer a:hover { color: var(--coral); }
.footer .hairline { background: var(--dark-surface); }

.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: clamp(24px, 4vw, 40px); margin-bottom: clamp(32px, 5vw, 48px);
}
.footer-grid h4 {
  font-size: 13px; color: var(--warm-silver); text-transform: uppercase;
  letter-spacing: 0.1em; font-family: var(--mono); font-weight: 500; margin-bottom: 16px;
}
.footer-grid ul { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.footer-grid li a { font-size: 15px; }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 28px; font-size: 13px; color: var(--stone);
  flex-wrap: wrap; gap: 12px;
}
.footer-bottom-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-rating {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--stone); white-space: nowrap;
}
.footer-rating-stars {
  color: #d97706; letter-spacing: 1px; font-size: 13px; line-height: 1;
}
.footer-rating-val { font-weight: 600; color: var(--charcoal); }
.footer-rating-meta { color: var(--stone); }

.leader { flex: 1; border-bottom: 1px dotted var(--ring-deep); margin: 0 8px 5px; min-width: 12px; }

/* ── Shared inner-page ──────────────────────────────────── */
.crumb {
  display: flex; align-items: center; gap: 9px; font-size: 13.5px;
  color: var(--stone); flex-wrap: wrap;
}
.crumb a { color: var(--stone); transition: color var(--t); }
.crumb a:hover { color: var(--terracotta); }
.crumb .sep { opacity: 0.55; }
.crumb .here { color: var(--charcoal); }

.page-head { padding-block: clamp(28px, 5vw, 40px) 8px; }
.page-head h1 {
  font-size: clamp(30px, 5.5vw, 50px); line-height: 1.06;
  letter-spacing: -0.028em; margin: 22px 0 0;
}
.page-head .lead { margin-top: 18px; max-width: 40em; }

.cta-band {
  background: var(--near-black); border-radius: var(--r-3xl);
  padding: clamp(32px, 6vw, 60px) clamp(24px, 5vw, 56px);
  position: relative; overflow: hidden;
}
.cta-band h2 { color: var(--ivory); font-size: clamp(24px, 4.5vw, 40px); max-width: 16em; }
.cta-band p { color: var(--warm-silver); font-size: clamp(16px, 2vw, 18px); margin: 16px 0 28px; max-width: 34em; }
.cta-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.cta-band .btn--dark { background: var(--dark-warm); }
.cta-band .btn--dark:hover { background: #4a4a46; }

/* Filter chips (blog, keysy) */
.filters, .kfilters { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.fchip {
  font-size: 14px; color: var(--olive); background: var(--ivory);
  box-shadow: var(--shadow-ring); padding: 8px 15px; border-radius: 999px;
  cursor: pointer; transition: all var(--t); border: none; font-family: inherit;
}
.fchip:hover { color: var(--near-black); }
.fchip.active { background: var(--near-black); color: var(--ivory); box-shadow: none; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 30px;
  transform: translate(-50%, 20px);
  background: var(--near-black); color: var(--ivory);
  padding: 13px 22px; border-radius: 999px;
  font-size: 14.5px; font-weight: 500; box-shadow: var(--shadow-lift);
  display: flex; align-items: center; gap: 10px;
  opacity: 0; pointer-events: none;
  transition: all 0.35s var(--ease); z-index: 60;
}
.toast svg { width: 17px; height: 17px; color: var(--coral); flex-shrink: 0; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Focus */
a:focus-visible, button:focus-visible, .btn:focus-visible, summary:focus-visible {
  outline: 2px solid var(--terracotta); outline-offset: 3px; border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  html.js .reveal { opacity: 1 !important; transform: none !important; }
  html { scroll-behavior: auto; }
  .card--link:hover { transform: none; }
}

/* ══ Responsive ═══════════════════════════════════════════ */

/* Tablet landscape */
@media (max-width: 1100px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

/* Medium desktop — keep nav visible but tighten paddings */
@media (max-width: 1200px) {
  .nav-links a { padding: 7px 8px; font-size: 13.5px; }
  .brand .role { display: none; }
  .nav-inner { gap: 12px; }
}
@media (max-width: 1080px) {
  .nav-links a { padding: 6px 7px; font-size: 13px; }
  .brand .name { font-size: 16px; }
  .logo-img { height: 32px; }
}

/* Tablet — collapse to burger */
@media (max-width: 960px) {
  .nav-links, .nav-tg { display: none; }
  .burger { display: grid; place-items: center; }
  .nav-right .btn--brand { padding: 10px 14px; font-size: 14px; }
  .brand .role { display: block; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .sec-head { align-items: flex-start; }
  .sec-head .tlink { margin-top: 4px; }
}

/* Mobile landscape / small tablet */
@media (max-width: 640px) {
  :root { --gutter: clamp(18px, 5vw, 24px); }
  .brand .role { display: none; }
  .nav-right .btn--brand { display: none; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .toggle .body { padding-left: 20px; }
  .cta-band { border-radius: var(--r-2xl); }
}

/* Mobile portrait */
@media (max-width: 480px) {
  :root { --gutter: 20px; }
  .cta-actions { width: 100%; flex-direction: column; }
  .cta-actions .btn { width: 100%; min-width: 0; justify-content: center; padding: 13px 14px; }
  .cta-band { padding: 28px 22px; border-radius: var(--r-xl); }
}
