/* =========================================================
   Виктор Дьяконов — personal site
   Manrope. Anthracite accent. Strict minimalism.
   ========================================================= */

:root {
  --paper: #fafaf7;
  --ink: #15161a;
  --muted: #71706c;
  --hair: #e2e0d9;
  --ph: #ebe9e2;
  --accent: #2a2d34;
}

html, body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  margin: 0;
  scroll-behavior: smooth;
}

* { box-sizing: border-box; }
a { color: inherit; text-decoration: none; }

.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 56px;
}

/* ---------- Nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
  border-bottom: 1px solid transparent;
  transition: border-color .25s;
}

.nav-inner {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  height: 72px;
}

.nav-link {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  padding: 8px 0;
  margin-left: 40px;
  transition: color .2s;
}

.nav-link:hover { color: var(--ink); }
.nav.scrolled { border-bottom-color: var(--hair); }

/* ---------- Type ---------- */

.label {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}

.h2 {
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: clamp(2.5rem, 4vw, 3.75rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
}

.lede {
  font-family: 'Manrope', sans-serif;
  font-weight: 400;
  font-size: 1.3125rem;
  line-height: 1.55;
  color: var(--ink);
  margin: 0;
  max-width: 32.5rem;
  letter-spacing: -0.005em;
}

/* ---------- Hero typography ---------- */

.hero-name {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: clamp(3.25rem, 5.5vw, 5rem);
  line-height: 1.0;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin: 0 0 20px;
}

.hero-role {
  font-family: 'Manrope', sans-serif;
  font-weight: 500;
  font-size: 1.5rem;
  line-height: 1.4;
  color: var(--ink);
  margin: 0 0 20px;
}

.hero-desc {
  font-family: 'Manrope', sans-serif;
  font-weight: 400;
  font-size: 1.25rem;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
  max-width: 28.75rem;
}

.body {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
}

.body-muted { color: var(--muted); }

.body p {
  margin: 0 0 1em;
  max-width: 40rem;
}

/* ---------- Sections ---------- */

section.s {
  padding-block: 120px;
  border-top: 1px solid var(--hair);
}

.s-head {
  display: grid;
  grid-template-columns: minmax(200px, max-content) 1fr;
  gap: 48px;
  align-items: baseline;
  margin-bottom: 96px;
}

.s-head-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.s-num {
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--accent);
}

/* ---------- Icon links ---------- */

.contacts {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--ink);
  transition: color .2s, background-color .2s;
}

.icon-link:hover {
  color: var(--accent);
  background: var(--ph);
}

.icon-link svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.75;
}

/* ---------- Hero ---------- */

.hero {
  padding-block: 80px 120px;
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 112px;
  align-items: center;
}

.hero-photo {
  width: 460px;
  height: 560px;
  background: var(--ph);
  position: relative;
  overflow: hidden;
}


.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------- About ---------- */

.about-body { max-width: 40rem; }
.about-body p + p { margin-top: 1.2em; }

/* ---------- Doing ---------- */

.doing-list { border-top: 1px solid var(--hair); }

.doing-row {
  display: grid;
  grid-template-columns: minmax(80px, max-content) minmax(240px, max-content) 1fr minmax(120px, max-content);
  gap: 32px;
  align-items: start;
  padding: 56px 0;
  border-bottom: 1px solid var(--hair);
  transition: padding-left .25s, color .2s;
  cursor: default;
}

.doing-row:hover { padding-left: 16px; }
.doing-row:hover .doing-arrow {
  color: var(--accent);
  transform: translateX(6px);
}

.doing-num {
  font-size: 0.875rem;
  color: var(--muted);
  font-weight: 500;
}

.doing-title {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.doing-desc {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.65;
  margin: 0;
}

.doing-arrow {
  text-align: right;
  color: var(--muted);
  font-size: 0.875rem;
  text-decoration: none;
  transition: color .2s, transform .25s;
}

/* ---------- Blog ---------- */

.blog-list { border-top: 1px solid var(--hair); }

.blog-row {
  display: grid;
  grid-template-columns: minmax(120px, max-content) 1fr auto;
  gap: 32px;
  align-items: baseline;
  padding: 32px 0;
  border-bottom: 1px solid var(--hair);
  transition: padding-left .25s;
  color: inherit;
  cursor: pointer;
}

.blog-row:hover { padding-left: 16px; }
.blog-row:hover .blog-title { color: var(--accent); }

.blog-date {
  font-size: 0.8125rem;
  color: var(--muted);
  font-weight: 500;
}

.blog-title {
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  transition: color .2s;
}

.blog-meta {
  font-size: 0.8125rem;
  color: var(--muted);
  text-align: right;
  font-weight: 500;
}

.blog-center {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.blog-annotation {
  font-size: 0.8125rem;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.45;
}

.blog-tag {
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
  transition: color .2s;
}

.blog-tag:hover {
  color: var(--accent);
  text-decoration: underline;
}

.blog-filter-info {
  display: flex;
  align-items: baseline;
  gap: 20px;
  margin-top: 16px;
}

.blog-filter-label {
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--muted);
}

.blog-filter-clear {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 1px solid var(--hair);
  padding-bottom: 4px;
  transition: color .2s, border-color .2s;
}

.blog-filter-clear:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.blog-more {
  margin-top: 48px;
  font-size: 0.875rem;
  font-weight: 500;
  display: inline-block;
  color: var(--muted);
  border-bottom: 1px solid var(--hair);
  padding-bottom: 4px;
  transition: color .2s, border-color .2s;
}

.blog-more:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ---------- Contacts section ---------- */

.contacts-section {
  padding-block: 120px 100px;
  border-top: 1px solid var(--hair);
}

.contacts-block {
  display: grid;
  grid-template-columns: minmax(200px, max-content) 1fr;
  gap: 48px;
  align-items: start;
}

/* ---------- Footer ---------- */

footer {
  border-top: 1px solid var(--hair);
  padding: 40px 0;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink);
}

footer .container {
  display: flex;
  justify-content: space-between;
}

/* =========================================================
   Посты (posts/*.html)
   ========================================================= */

.post-wrap {
  max-width: 42.5rem;
  margin: 0 auto;
  padding: 64px 0 120px;
}

.post-back {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 1px solid var(--hair);
  padding-bottom: 4px;
  margin-bottom: 56px;
  transition: color .2s, border-color .2s;
}

.post-back:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.post-meta {
  font-size: 0.875rem;
  color: var(--muted);
  font-weight: 500;
  margin: 0 0 16px;
}

.post-h1 {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: clamp(1.625rem, 3.5vw, 2.625rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 64px;
}

.post-body {
  font-size: 1.125rem;
  line-height: 1.75;
  color: var(--ink);
}

.post-body p {
  margin: 0 0 1.5em;
}

.post-body p.post-signature {
  font-style: italic;
  color: var(--muted);
  margin: 2em 0 0;
}

.post-img {
  margin: 2.5em 0;
}

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

/* =========================================================
   Hamburger (скрыт на десктопе)
   ========================================================= */

.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-left: auto;
  z-index: 200;
}

.nav-burger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform .25s, opacity .2s;
}

.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =========================================================
   Font-size widget
   ========================================================= */

#font-size-widget {
  position: fixed;
  top: 88px;
  right: 56px;
  z-index: 11;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: 2px;
  transition: border-color .2s;
}

#font-size-widget:hover,
#font-size-widget:focus-within {
  border-color: var(--accent);
}

.font-size-icon {
  font-family: 'Manrope', sans-serif;
  font-weight: 600;
  color: var(--muted);
  line-height: 1;
  user-select: none;
}

.font-size-icon--sm { font-size: 0.75rem; }
.font-size-icon--lg { font-size: 1.125rem; }

#font-size-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 84px;
  height: 2px;
  background: var(--hair);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

#font-size-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ink);
  border: none;
  cursor: pointer;
  transition: background-color .2s;
}
#font-size-slider::-webkit-slider-thumb:hover { background: var(--accent); }

#font-size-slider::-moz-range-track {
  height: 2px;
  background: var(--hair);
  border-radius: 2px;
}
#font-size-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ink);
  border: none;
  cursor: pointer;
  transition: background-color .2s;
}
#font-size-slider::-moz-range-thumb:hover { background: var(--accent); }

#font-size-slider:focus-visible::-webkit-slider-thumb {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
#font-size-slider:focus-visible::-moz-range-thumb {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* =========================================================
   Desktop nav-links (живёт вне header, позиционируется fixed)
   ========================================================= */

@media (min-width: 641px) {
  .nav-links {
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    right: 56px;
    height: 72px;
    z-index: 11;
  }
}

/* =========================================================
   Mobile (≤ 640px)
   ========================================================= */

@media (max-width: 640px) {

  /* --- Контейнер --- */
  .container { padding: 0 20px; }

  /* --- Nav --- */
  .nav-burger { display: flex; }

  .nav-links {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--paper);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 36px;
    z-index: 100;
  }

  .nav-links.open { display: flex; }

  .nav-links .nav-link {
    font-size: 1.625rem;
    font-weight: 700;
    margin-left: 0;
    color: var(--ink);
  }

  /* --- Hero --- */
  .hero {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-block: 24px 64px;
  }

  .hero-photo {
    width: 100%;
    height: 240px;
  }

  .hero-name { font-size: 2.5rem; }
  .hero-role { font-size: 1.125rem; }
  .hero-desc { font-size: 1rem; }

  /* --- Секции --- */
  section.s { padding-block: 80px; }

  .h2 { font-size: 1.875rem; }
  .body { font-size: 0.9375rem; }

  .s-head {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 48px;
  }

  /* --- Doing --- */
  .doing-row {
    grid-template-columns: minmax(40px, max-content) 1fr;
    gap: 16px;
    padding: 32px 0;
  }

  .doing-title { grid-column: 2; font-size: 1.625rem; }
  .doing-desc  { grid-column: 2; }
  .doing-arrow { display: none; }

  /* --- Blog --- */
  .blog-row {
    grid-template-columns: 1fr auto;
    gap: 16px;
  }

  .blog-date { display: none; }
  .blog-title { font-size: 1.125rem; }

  /* --- Контакты --- */
  .contacts-section { padding-block: 80px 60px; }

  .contacts-block {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  /* --- Footer --- */
  footer .container {
    flex-direction: column;
    gap: 8px;
  }

  /* --- Посты --- */
  .post-wrap { padding: 40px 0 80px; }
  .post-h1 { font-size: 1.375rem; margin-bottom: 40px; }
  .post-body { font-size: 1rem; }

  /* --- Font-size widget --- */
  #font-size-widget {
    top: 18px;
    right: 72px;
    padding: 6px 12px;
    gap: 8px;
  }
  #font-size-slider { width: 60px; }

  #nav-links.open ~ #font-size-widget {
    visibility: hidden;
    pointer-events: none;
  }
}
