@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:ital,wght@0,300;0,400;0,500;0,600;1,300&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:      #ffffff;
  --ink:     #0f172a;
  --muted:   #475569;
  --faint:   #94a3b8;
  --rule:    #e2e8f0;
  --accent:  #2563eb;
  --surface: #f8fafc;
  --max-w:   720px;
  --mono:    'IBM Plex Mono', monospace;
  --sans:    'IBM Plex Sans', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 1.05rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 2.5rem);
}

/* ─── Header ─────────────────────────────────────────────── */
header {
  padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(2rem, 4vw, 3rem);
  border-bottom: 2px solid var(--rule);
}

.header-inner {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 2rem;
  row-gap: 1.5rem;
}

.header-photo {
  grid-column: 1;
  grid-row: 1 / 3;
  align-self: start;
  width: clamp(100px, 16vw, 148px);
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--rule);
  flex-shrink: 0;
}

.header-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 12%;
  display: block;
}

.header-text { grid-column: 2; grid-row: 1; }
.header-meta { grid-column: 2; grid-row: 2; align-self: start; }

.name {
  font-size: clamp(1.35rem, 3.5vw, 1.75rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 0.6rem;
}

.role {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 0.75rem;
}

.about {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.7;
}

/* ─── Contacts ───────────────────────────────────────────── */
.contacts-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 0.35rem;
}

.contacts {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-style: normal;
}

.contacts a {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}
.contacts a:hover { color: var(--accent); }

/* ─── Section heading (## Кейсы) ─────────────────────────── */
.section-heading {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  padding: clamp(2rem, 5vw, 3rem) 0 1rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 0;
}

/* ─── Case (### level) ───────────────────────────────────── */
.case {
  padding: clamp(2rem, 5vw, 3rem) 0;
  border-bottom: 1px solid var(--rule);
}

.case-title {
  font-size: clamp(1.1rem, 2.8vw, 1.3rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--ink);
  margin-bottom: 1.5rem;
}

/* ─── Case section (#### level) ─────────────────────────── */
.case-section {
  margin-bottom: 0;
  padding: 1.25rem 0;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.case-section.result {
  background: var(--surface);
  margin: 0 -1.5rem;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--rule);
  border-radius: 0 0 6px 6px;
}

/* #### heading */
.h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}

/* ##### heading */
.h5 {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  margin-top: 0.5rem;
}

/* ─── Body text in cases ─────────────────────────────────── */
.case-section p {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.75;
}

.case-section.result p {
  color: var(--ink);
}

/* ─── Lists ──────────────────────────────────────────────── */
.case-section ul,
.case-section ol {
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.case-section ul { list-style: none; }
.case-section ol { list-style: none; counter-reset: item; }

.case-section ul > li {
  display: grid;
  grid-template-columns: 1.2rem 1fr;
  gap: 0 0.3rem;
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.7;
}

.case-section ul > li::before {
  content: '—';
  color: var(--faint);
  font-family: var(--mono);
}

/* Numbered list (ol) */
.case-section ol > li {
  counter-increment: item;
  display: grid;
  grid-template-columns: 1.6rem 1fr;
  gap: 0 0.4rem;
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.7;
  margin-top: 0.25rem;
}

.case-section ol > li::before {
  content: counter(item) ')';
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--faint);
  padding-top: 0.1em;
}

/* nested ol inside ul li */
.case-section ul > li ol {
  margin-top: 0.4rem;
  grid-column: 1 / -1;
}

/* ─── Inline links ───────────────────────────────────────── */
.inline-link {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}
.inline-link:hover { border-bottom-color: var(--accent); }

/* ─── Footer ─────────────────────────────────────────────── */
footer {
  background: var(--surface);
  border-top: 1px solid var(--rule);
  padding: 1.5rem 0;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--faint);
}
footer a { color: inherit; text-decoration: none; }
footer a:hover { color: var(--accent); }

/* ─── Mobile ─────────────────────────────────────────────── */
@media (max-width: 520px) {
  .header-inner {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }
  .header-photo {
    grid-column: 1; grid-row: 1;
    width: 90px; border-radius: 10px;
    margin-bottom: 0.25rem;
  }
  .header-text { grid-column: 1; grid-row: 2; }
  .header-meta { grid-column: 1; grid-row: 3; }

  .case-section.result {
    margin: 0;
    padding: 1.25rem 0;
  }
}
