@import url('https://fonts.googleapis.com/css2?family=Onest:wght@400;500;600;700;800&family=Spectral:ital,wght@0,500;0,600;0,700;1,500&display=swap');

/* ============================================================
   PORTFOLIO DESIGN SYSTEM — styles.css
   Single source of truth for all pages.
   Palette, typography, spacing, components.
   Add new project pages by reusing the classes defined here.
   ============================================================ */

/* ── 1. DESIGN TOKENS ──────────────────────────────────────── */
:root {
  /* Palette — warm paper, single refined accent (no green) */
  --bg:          #FAF8F4;
  --surface:     #FFFFFF;
  --ink:         #1C1B18;
  --muted:       #635E56;
  --border:      #E9E4DA;
  --accent:      #3B3D87;
  --accent-bg:   #EDEBF5;
  --teal:        #3B3D87;   /* legacy alias → folded into accent */

  /* Shadows — soft, warm-tinted */
  --shadow-card:  0 1px 2px rgba(28, 27, 24, 0.04), 0 8px 24px -10px rgba(28, 27, 24, 0.12);
  --shadow-hover: 0 2px 6px rgba(28, 27, 24, 0.06), 0 18px 44px -14px rgba(59, 61, 135, 0.26);

  /* Radii */
  --radius-card: 16px;
  --radius-btn:  10px;
  --radius-chip: 6px;

  /* Spacing scale */
  --sp-xs: 6px;
  --sp-sm: 12px;
  --sp-md: 20px;
  --sp-lg: 40px;
  --sp-xl: 64px;

  /* Typography */
  --font:         'Onest', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: 'Spectral', Georgia, "Times New Roman", serif;
  --text-xs:   12px;
  --text-sm:   14px;
  --text-base: 16px;
  --text-lg:   18px;
  --text-xl:   22px;
  --text-2xl:  28px;
  --text-3xl:  34px;
}

/* ── 2. RESET & BASE ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--ink);
  background:
    radial-gradient(1000px 560px at 88% -12%, rgba(59, 61, 135, 0.07), transparent 62%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

ul { padding-left: 20px; }
ul li { margin-bottom: 6px; }
ol { padding-left: 22px; }
ol li { margin-bottom: 8px; padding-left: 4px; }

/* ── 3. LAYOUT HELPERS ─────────────────────────────────────── */
.wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 var(--sp-md);
}

.wrap--wide {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--sp-md);
}

/* ── 4. NAVIGATION ─────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 248, 244, 0.82);
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  padding: 0 var(--sp-md);
}

.nav__inner {
  max-width: 900px;
  margin: 0 auto;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__brand {
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--ink);
  white-space: nowrap;
}

.nav__links {
  display: flex;
  gap: var(--sp-md);
  list-style: none;
  padding: 0;
}

.nav__links a {
  font-size: var(--text-sm);
  color: var(--muted);
  font-weight: 500;
  transition: color 0.2s;
}

.nav__links a:hover { color: var(--accent); text-decoration: none; }

/* ── 5. HERO ────────────────────────────────────────────────── */
.hero {
  padding: var(--sp-xl) 0 var(--sp-lg);
}

.hero__label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: var(--sp-sm);
}

.hero__name {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: var(--sp-sm);
}

.hero__role {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--accent);
  margin-bottom: var(--sp-md);
}

.hero__lead {
  font-size: var(--text-lg);
  color: var(--muted);
  max-width: 620px;
  line-height: 1.7;
}

.hero__pain {
  font-size: var(--text-base);
  color: var(--ink);
  max-width: 620px;
  line-height: 1.7;
  margin-top: var(--sp-sm);
  padding-left: var(--sp-sm);
  border-left: 3px solid var(--accent);
}

/* ── 6. SECTION ─────────────────────────────────────────────── */
.section {
  padding: var(--sp-lg) 0;
  scroll-margin-top: 72px;
}

.section + .section {
  border-top: 1px solid var(--border);
}

.section__label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: var(--sp-sm);
}

.section__title {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: var(--sp-md);
}

.section__subtitle {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--ink);
  margin-bottom: var(--sp-sm);
}

/* ── 7. BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: var(--radius-btn);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  text-decoration: none !important;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
  border: none;
}

.btn--primary:hover {
  background: #2E3070;
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.btn--outline {
  background: var(--surface);
  color: var(--ink);
  border: 1.5px solid var(--border);
}

.btn--outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-sm);
  margin-top: var(--sp-md);
}

/* ── 8. CHIPS / TAGS ────────────────────────────────────────── */
.chip {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-chip);
  font-size: var(--text-xs);
  font-weight: 600;
}

.chip--accent {
  background: var(--accent-bg);
  color: var(--accent);
}

.chip--teal {
  background: var(--accent-bg);
  color: var(--accent);
}

.chip--muted {
  background: var(--border);
  color: var(--muted);
}

/* ── 9. PROJECT CARDS (index grid — compact, clickable) ─────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: var(--sp-sm);
  margin-top: var(--sp-sm);
}

.proj-group {
  margin-top: var(--sp-lg);
}

.proj-group:first-of-type {
  margin-top: var(--sp-md);
}

.proj-group__title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--ink);
}

.proj-group__sub {
  font-size: var(--text-sm);
  color: var(--muted);
  margin-top: 2px;
}

/* Whole card is a link */
.proj-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-xs);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--sp-md);
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.25s, transform 0.25s, border-color 0.25s;
  color: inherit;
  text-decoration: none;
}

.proj-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
  border-color: var(--accent);
  text-decoration: none;
}

.proj-card__tag {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.proj-card__title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--ink);
}

.proj-card__line {
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: 1.55;
  flex: 1;
}

.proj-card__status {
  font-size: var(--text-xs);
  font-style: italic;
  color: var(--muted);
  line-height: 1.4;
}

.proj-card__go {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--accent);
  margin-top: var(--sp-xs);
}

/* ── 9b. NEED CARDS (index — «чем полезна бизнесу») ─────────── */
.needs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--sp-md);
  margin-top: var(--sp-md);
}

.need-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--sp-md);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}

.need-card__need {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: var(--sp-xs);
}

.need-card__title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--ink);
  margin-bottom: var(--sp-xs);
}

.need-card__desc {
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: 1.6;
  flex: 1;
}

.need-card__proof {
  margin-top: var(--sp-sm);
  padding-top: var(--sp-sm);
  border-top: 1px solid var(--border);
  font-size: var(--text-xs);
  color: var(--muted);
  line-height: 1.6;
}

.need-card__proof strong { color: var(--accent); font-weight: 700; }

.need-card__details {
  margin-top: var(--sp-sm);
}

.need-card__details summary {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.need-card__details summary::-webkit-details-marker { display: none; }

.need-card__details summary::before {
  content: "▸";
  display: inline-block;
  font-size: 11px;
  line-height: 1;
  transition: transform 0.2s;
}

.need-card__details[open] summary::before {
  transform: rotate(90deg);
}

.need-card__incl {
  margin: var(--sp-sm) 0 0;
  padding-left: 18px;
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: 1.7;
}

.need-card__incl li { margin-bottom: 2px; }

/* ── 9c. CHECK LIST (index — простые чек-листы без карточек) ─── */
.check-list {
  list-style: none;
  margin: var(--sp-md) 0 0;
  padding: 0;
  max-width: 720px;
}

.check-list li {
  position: relative;
  padding-left: var(--sp-md);
  margin-bottom: var(--sp-sm);
  font-size: var(--text-base);
  color: var(--muted);
  line-height: 1.6;
}

.check-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

/* ── 10. STATS ROW ──────────────────────────────────────────── */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-sm);
  margin: var(--sp-md) 0;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--sp-md);
}

.stat__number {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--accent);
  display: block;
  line-height: 1.2;
}

.stat__label {
  font-size: var(--text-xs);
  color: var(--muted);
  margin-top: 4px;
}

/* ── 11. SCREENSHOTS GALLERY ────────────────────────────────── */
.shots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-md);
  margin-top: var(--sp-md);
}

.shot {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.shot img {
  width: 100%;
  display: block;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  object-position: top;
  cursor: zoom-in;
}

.shot__caption {
  padding: var(--sp-sm) var(--sp-sm);
  font-size: var(--text-xs);
  color: var(--muted);
  line-height: 1.5;
}

/* Wide screenshot (landscape, e.g. landing/kb page) */
.shots--wide {
  grid-template-columns: repeat(2, 1fr);
}

.shots--wide .shot img {
  aspect-ratio: 16 / 9;
}

/* Галерея со свободными пропорциями (смешанная ориентация скринов —
   горизонтальные/квадратные/длинные). Показывает каждый скрин ЦЕЛИКОМ,
   без обрезки. Masonry-раскладка колонками аккуратно укладывает разную высоту. */
.shots--free {
  display: block;
  column-count: 2;
  column-gap: var(--sp-md);
  margin-top: var(--sp-md);
}

.shots--free .shot {
  break-inside: avoid;
  margin-bottom: var(--sp-md);
}

.shots--free .shot img {
  aspect-ratio: auto;
  height: auto;
  object-fit: contain;
}

/* ── 11b. LIGHTBOX (клик-зум скринов, см. lightbox.js) ──────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--sp-lg);
  background: rgba(20, 23, 42, 0.88);
  cursor: zoom-out;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.lightbox.is-open { display: flex; }

.lightbox__img {
  max-width: 92vw;
  max-height: 92vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-card);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  cursor: default;
}

.lightbox__close {
  position: absolute;
  top: var(--sp-md);
  right: var(--sp-md);
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s;
}

.lightbox__close:hover { background: rgba(255, 255, 255, 0.28); }

/* ── 12. NOTE / CALLOUT ─────────────────────────────────────── */
.note {
  background: var(--accent-bg);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-btn) var(--radius-btn) 0;
  padding: var(--sp-sm) var(--sp-md);
  font-size: var(--text-sm);
  color: var(--muted);
  margin: var(--sp-md) 0;
}

/* ── 13. ABOUT SECTION ──────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-lg);
  margin-top: var(--sp-md);
}

.about-block__title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--ink);
  margin-bottom: var(--sp-xs);
}

/* ── 14. BACK LINK ──────────────────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  color: var(--muted);
  font-weight: 500;
  padding: var(--sp-md) 0;
}

.back-link:hover { color: var(--accent); text-decoration: none; }

/* ── 15. PROJECT HERO ───────────────────────────────────────── */
.project-hero {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: var(--sp-lg) 0;
}

.project-hero__label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: var(--sp-sm);
}

.project-hero__title {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
  line-height: 1.12;
  margin-bottom: var(--sp-sm);
}

.project-hero__tagline {
  font-size: var(--text-lg);
  color: var(--muted);
  max-width: 640px;
  line-height: 1.7;
  margin-bottom: var(--sp-md);
}

/* ── 16. CONTENT BLOCKS ─────────────────────────────────────── */
.block {
  margin: var(--sp-lg) 0;
}

.block__title {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: var(--sp-sm);
}

.block__body {
  color: var(--ink);
}

/* ── 16b. CTA BLOCK ─────────────────────────────────────────── */
.cta {
  scroll-margin-top: 72px;
  margin: var(--sp-lg) 0 var(--sp-xl);
}

.cta__inner {
  background:
    radial-gradient(620px 280px at 12% -30%, rgba(255, 255, 255, 0.14), transparent 70%),
    var(--accent);
  border-radius: var(--radius-card);
  padding: var(--sp-lg);
  text-align: center;
  box-shadow: var(--shadow-card);
}

.cta__title {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  margin-bottom: var(--sp-sm);
}

.cta__text {
  color: rgba(255, 255, 255, 0.88);
  max-width: 560px;
  margin: 0 auto var(--sp-md);
  line-height: 1.7;
}

.cta__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-sm);
  justify-content: center;
}

.cta__phone {
  margin-top: var(--sp-md);
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.78);
}
.cta__phone a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cta__phone a:hover { color: #F0EFFA; }

/* На синем фоне инвертируем кнопки */
.cta__inner .btn--primary {
  background: #fff;
  color: var(--accent);
}
.cta__inner .btn--primary:hover {
  background: #F0EFFA;
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}
.cta__inner .btn--outline {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
}
.cta__inner .btn--outline:hover {
  border-color: #fff;
  color: #fff;
}

/* ── 17. FOOTER ─────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: var(--sp-lg) 0;
  color: var(--muted);
  font-size: var(--text-sm);
}

.footer__inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 var(--sp-md);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-md);
}

.footer__contacts a {
  color: var(--muted);
  margin-right: var(--sp-md);
}

.footer__contacts a:hover { color: var(--accent); text-decoration: none; }

/* ── 18. RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 700px) {
  /* На телефоне меню-якоря не помещаются рядом с именем — прячем,
     одностраничник листается скроллом. Имя остаётся как бренд. */
  .nav__links  { display: none; }

  .hero__name  { font-size: 29px; }
  .hero__role  { font-size: var(--text-lg); }
  .section__title { font-size: 25px; }
  .cta__title { font-size: 24px; }
  .cta__inner { padding: var(--sp-md); }
  .project-hero__title { font-size: 29px; }

  .stats       { grid-template-columns: 1fr 1fr; }
  .shots       { grid-template-columns: 1fr 1fr; }
  .shots--wide { grid-template-columns: 1fr; }
  .shots--free { column-count: 1; }
  .about-grid  { grid-template-columns: 1fr; }

  .projects-grid { grid-template-columns: 1fr; }
}

@media (max-width: 400px) {
  .stats { grid-template-columns: 1fr; }
  .shots { grid-template-columns: 1fr; }
}
