/* =========================================================
   Леонид Айзикович — лендинг
   Брейкпоинты: 900px (планшет → мобильный), 600px (узкий мобильный)
   ========================================================= */

:root {
  /* Palette tuned to the portrait: cool studio grey, shirt blue, navy ink */
  --paper: #ECECEA;       /* cool off-white, picked from the lighter grey of the studio backdrop */
  --paper-inv: #FFFFFF;
  --ink: #1C2333;         /* deep navy charcoal — matches the collar accent */
  --sub: #5C6473;
  --line: #D5D8DD;
  --card: #DEE0E4;        /* slightly cooler card surface */
  --accent: #3D5C8C;      /* royal/steel blue lifted from the shirt */
  --accent-soft: #8AA2C9; /* lighter shirt blue for subtle accents */
  --muted-on-dark: #8E96A4;

  --pad-x: 48px;
  --max: 1280px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--paper); color: var(--ink);
  font-family: Geist, system-ui, -apple-system, sans-serif;
  font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden; /* страховка от случайного горизонтального скролла */
}
::selection { background: var(--accent); color: var(--paper-inv); }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
img { max-width: 100%; display: block; height: auto; }

/* фокус для клавиатуры */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* доступность — анимации */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* плавный скролл по якорям */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* ── layout shell ── */
.divider-ink { border-top: 2px solid var(--ink); }
.divider-line { border-top: 1px solid var(--line); }

/* ── typography utilities ── */
.serif { font-family: "Fraunces", Georgia, serif; font-weight: 400; letter-spacing: -0.02em; }
.italic-accent { font-style: italic; color: var(--accent); }
.mono {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent);
}
.mono--sub { color: var(--sub); }
.mono--light { color: var(--muted-on-dark); }

/* ── top strip ── */
.topstrip {
  padding: 16px var(--pad-x);
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--line);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--sub);
  gap: 24px; flex-wrap: wrap;
}

/* ── nav ── */
.nav {
  padding: 24px var(--pad-x);
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 2px solid var(--ink);
  gap: 24px; flex-wrap: wrap;
}
.nav__logo { font-family: "Fraunces", serif; font-size: 26px; letter-spacing: -0.015em; }
.nav__menu { display: flex; gap: 28px; font-size: 14px; }
.nav__menu a { text-decoration: none; padding: 4px 0; }
.nav__menu a:hover { color: var(--accent); }

/* ── CTA buttons ── */
.cta {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-radius: 999px; border: 0;
  font: 500 15px Geist, system-ui, sans-serif;
  cursor: pointer; text-decoration: none;
  transition: transform .15s;
  min-height: 44px; /* touch target */
}
.cta:hover { transform: translateY(-1px); }
.cta--primary { background: var(--accent); color: var(--paper-inv); }
.cta--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }

/* ── hero ── */
.hero {
  padding: 48px var(--pad-x) 72px;
  display: grid; grid-template-columns: 1fr 380px;
  gap: 56px; align-items: start;
  max-width: var(--max); margin: 0 auto;
}
.hero__title {
  font-family: "Fraunces", serif;
  font-size: clamp(40px, 7vw, 96px);
  line-height: 0.98;
  letter-spacing: -0.035em; font-weight: 400;
  margin-top: 24px; text-wrap: balance;
}
.hero__lead {
  margin-top: 36px;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 24px; max-width: 760px;
}
.hero__lead p { font-size: 16px; line-height: 1.55; }
.hero__lead p:last-child { color: var(--sub); }
.hero__actions { display: flex; gap: 12px; margin-top: 36px; flex-wrap: wrap; }

/* ── portrait ── */
.portrait {
  width: 380px; height: 460px; position: relative; margin: 0;
  background: repeating-linear-gradient(135deg, var(--card) 0 14px, #C9CED7 14px 15px);
  border: 1px solid var(--line); overflow: hidden;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait__label {
  position: absolute; top: 12px; left: 12px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent);
  pointer-events: none;
}
.portrait__dot {
  position: absolute; bottom: 12px; right: 12px;
  width: 8px; height: 8px; border-radius: 999px; background: var(--accent);
}
.dossier {
  margin-top: 16px; padding: 18px;
  background: var(--card); border: 1px solid var(--line);
  font-size: 13px; line-height: 1.6;
}
.dossier__rows { margin-top: 10px; display: grid; gap: 8px; }

/* ── ticker (horizontal scroll on small screens) ── */
.ticker {
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: var(--card);
  padding: 18px var(--pad-x);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px; letter-spacing: 0.05em;
  color: var(--sub);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.ticker::-webkit-scrollbar { display: none; }
.ticker__track {
  display: flex; gap: 40px;
  white-space: nowrap;
  width: max-content;
  min-width: 100%;
}
.ticker__dot { color: var(--accent); }

/* ── about ── */
.about { padding: 80px var(--pad-x); max-width: var(--max); margin: 0 auto; }
.about__grid { display: grid; grid-template-columns: 1fr 2fr; gap: 56px; }
.about__title {
  font-family: "Fraunces", serif;
  font-size: clamp(32px, 4.5vw, 56px); line-height: 1;
  letter-spacing: -0.025em; font-weight: 400;
  margin-top: 16px; text-wrap: balance;
}
.about__lead {
  font-family: "Fraunces", serif;
  font-size: clamp(20px, 2vw, 26px);
  line-height: 1.35; font-weight: 400;
}
.about__role {
  margin-top: 32px; display: grid; grid-template-columns: 1fr 1fr;
}
.about__role-item {
  padding: 20px 24px;
  border-top: 1px solid var(--line);
  display: flex; gap: 14px; align-items: baseline;
  font-size: 15px; line-height: 1.5;
}
.about__role-item:nth-child(odd) { border-right: 1px solid var(--line); }
.about__role-num {
  font-family: "Fraunces", serif; font-size: 24px;
  color: var(--accent); font-style: italic; min-width: 28px;
}

/* ── use cases (dark section) ── */
.cases { background: var(--ink); color: var(--paper); padding: 80px var(--pad-x); }
.cases__inner { max-width: var(--max); margin: 0 auto; }
.cases__head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 48px; gap: 24px; flex-wrap: wrap;
}
.cases__title {
  font-family: "Fraunces", serif;
  font-size: clamp(36px, 5vw, 64px); line-height: 1;
  letter-spacing: -0.025em; font-weight: 400; text-wrap: balance;
}
.cases__grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.case {
  padding: 28px;
  border-left: 1px solid rgba(255, 255, 255, .15);
}
.case:first-child { border-left: none; }
.case:nth-child(4), .case:nth-child(5) { border-top: 1px solid rgba(255, 255, 255, .15); }
.case:nth-child(4) { border-left: none; }
.case__title {
  font-family: "Fraunces", serif; font-size: 26px;
  line-height: 1.15; letter-spacing: -0.015em;
  margin: 12px 0; text-wrap: balance;
}
.case__body { font-size: 14px; line-height: 1.55; color: var(--muted-on-dark); }

/* ── projects ── */
.projects { padding: 100px var(--pad-x); max-width: var(--max); margin: 0 auto; }
.projects__head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 48px; gap: 24px; flex-wrap: wrap;
}
.projects__title {
  font-family: "Fraunces", serif;
  font-size: clamp(44px, 6vw, 80px); line-height: 1;
  letter-spacing: -0.03em; font-weight: 400;
}
.project {
  display: grid; grid-template-columns: 1fr 2fr 1fr;
  gap: 48px; padding: 48px 0;
  border-top: 2px solid var(--ink); align-items: start;
}
.project__num {
  font-family: "Fraunces", serif; font-size: 64px; line-height: 0.9;
  color: var(--accent); font-style: italic; letter-spacing: -0.03em;
}
.project__name {
  font-family: "Fraunces", serif; font-size: 32px;
  margin-top: 16px; letter-spacing: -0.015em;
}
.project__url {
  margin-top: 6px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px; letter-spacing: 0.04em;
  color: var(--sub);
  text-decoration: none;
  display: inline-block;
}
.project__url:hover { color: var(--accent); }
.project__outcome {
  margin-top: 18px;
  max-width: 620px;
}
.project__outcome-text {
  margin-top: 6px;
  font-family: "Fraunces", serif;
  font-style: italic;
  font-size: 18px;
  line-height: 1.5;
  color: var(--ink);
  text-wrap: pretty;
}
.project__desc {
  font-size: 16px; line-height: 1.6;
  margin-top: 16px; max-width: 620px;
}
.project__role {
  background: var(--card); padding: 20px; border: 1px solid var(--line);
  font-size: 13px; line-height: 1.5; color: var(--sub);
}
.project__role-name {
  margin-top: 8px; font-family: "Fraunces", serif;
  font-size: 18px; color: var(--ink); line-height: 1.3;
}

/* ── format ── */
.format {
  background: var(--card);
  padding: 80px var(--pad-x);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.format__inner { max-width: 900px; margin: 0 auto; }
.format__title {
  font-family: "Fraunces", serif;
  font-size: clamp(28px, 3.6vw, 48px); line-height: 1.1;
  letter-spacing: -0.025em; font-weight: 400;
  margin: 16px 0 28px; text-wrap: balance;
}
.format__body { font-size: 18px; line-height: 1.6; }
.format__list {
  margin: 0; padding: 0;
  list-style: none;
  counter-reset: format;
}
.format__item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  align-items: baseline;
}
.format__item:last-child { border-bottom: 1px solid var(--line); }
.format__item::before {
  counter-increment: format;
  content: counter(format, decimal-leading-zero);
  font-family: "Fraunces", serif;
  font-size: 28px;
  font-style: italic;
  color: var(--accent);
  letter-spacing: -0.02em;
  line-height: 1;
}
.format__text {
  margin: 0;
  font-size: 18px;
  line-height: 1.55;
  text-wrap: pretty;
}
.format__note {
  margin-top: 32px; padding: 20px;
  background: var(--paper); border-left: 3px solid var(--accent);
  font-size: 15px; line-height: 1.6;
}

/* ── contacts ── */
.contacts {
  background: var(--ink); color: var(--paper);
  padding: 64px var(--pad-x) 40px;
}
.contacts__inner {
  max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: 1fr auto;
  gap: 48px; align-items: center;
}
.contacts__title {
  font-family: "Fraunces", serif;
  font-size: clamp(26px, 3vw, 40px); line-height: 1.15;
  letter-spacing: -0.02em; font-weight: 400;
  margin-top: 14px; text-wrap: balance; max-width: 720px;
}
.contacts__actions { display: flex; gap: 14px; flex-wrap: wrap; }
.contact-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 16px 22px; border-radius: 999px;
  font: 500 15px Geist, system-ui, sans-serif;
  text-decoration: none; color: var(--paper);
  min-height: 48px;
}
.contact-btn--primary { background: var(--accent); }
.contact-btn--ghost { box-shadow: inset 0 0 0 1px rgba(246, 242, 236, .25); }
.contact-btn__mono {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px; opacity: 0.85;
}
.contacts__footer {
  max-width: var(--max); margin: 48px auto 0;
  padding-top: 20px; border-top: 1px solid rgba(246, 242, 236, .14);
  display: flex; justify-content: space-between;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted-on-dark); gap: 16px; flex-wrap: wrap;
}

/* =========================================================
   Tablet & mobile (≤900px)
   ========================================================= */
@media (max-width: 900px) {
  :root { --pad-x: 24px; }

  .nav__menu { display: none; } /* меню убрано на мобильном */

  .hero { grid-template-columns: 1fr; gap: 32px; padding-top: 32px; padding-bottom: 48px; }
  .hero__lead { grid-template-columns: 1fr; gap: 16px; }
  .hero__aside { max-width: 480px; }
  .portrait { width: 100%; height: clamp(280px, 60vw, 460px); }

  .about { padding-top: 56px; padding-bottom: 56px; }
  .about__grid { grid-template-columns: 1fr; gap: 24px; }
  .about__role { grid-template-columns: 1fr; }
  .about__role-item:nth-child(odd) { border-right: none; }

  .cases { padding-top: 56px; padding-bottom: 56px; }
  .cases__grid { grid-template-columns: 1fr; }
  .case { border-left: none; border-top: 1px solid rgba(255,255,255,.15); padding: 24px 0; }
  .case:first-child { border-top: none; padding-top: 0; }

  .projects { padding-top: 64px; padding-bottom: 64px; }
  .project { grid-template-columns: 1fr; gap: 20px; padding: 32px 0; }

  .format { padding: 56px 24px; }

  .contacts { padding-top: 48px; }
  .contacts__inner { grid-template-columns: 1fr; gap: 32px; }
  .contact-btn { width: 100%; justify-content: center; }
  .contacts__footer { margin-top: 32px; }
}

/* =========================================================
   Narrow mobile (≤600px) — type tightens further
   ========================================================= */
@media (max-width: 600px) {
  :root { --pad-x: 18px; }

  .topstrip { font-size: 10px; gap: 8px 16px; padding: 12px var(--pad-x); }
  .topstrip span:nth-child(2) { display: none; } /* средний пункт скрываем */

  .nav { padding: 16px var(--pad-x); gap: 12px; }
  .nav__logo { font-size: 22px; }

  .hero { padding-top: 28px; padding-bottom: 40px; gap: 28px; }
  .hero__title { margin-top: 16px; }
  .hero__actions .cta { flex: 1 1 auto; justify-content: center; }

  .ticker { padding: 14px var(--pad-x); }
  .ticker__track { gap: 28px; }

  .project__num { font-size: 48px; }
  .project__name { font-size: 26px; }
  .project__desc { font-size: 15px; }

  .format__note { padding: 16px; }

  .contact-btn { padding: 14px 18px; font-size: 14px; }
}

/* =========================================================
   Print
   ========================================================= */
@media print {
  .ticker, .nav .cta, .contacts__actions { display: none; }
  body { background: white; color: black; }
  .cases, .contacts { background: white; color: black; }
  .case__body, .contacts__footer { color: #444; }
}
