/* ---------- Токены ---------- */
:root {
  --bg: #f4f3ef;
  --surface: #ebe9e3;
  --ink: #1d1c1a;
  --ink-2: #47443f;
  --muted: #66625b;
  --line: #d8d5cd;
  --accent: #2c5a4c;
  --accent-ink: #f4f3ef;
  --focus: #2c5a4c;

  --font: "Onest", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151513;
    --surface: #1e1e1b;
    --ink: #ebe9e3;
    --ink-2: #c4c1b9;
    --muted: #96928a;
    --line: #34332f;
    --accent: #8cbcab;
    --accent-ink: #151513;
    --focus: #8cbcab;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #151513;
  --surface: #1e1e1b;
  --ink: #ebe9e3;
  --ink-2: #c4c1b9;
  --muted: #96928a;
  --line: #34332f;
  --accent: #8cbcab;
  --accent-ink: #151513;
  --focus: #8cbcab;
  color-scheme: dark;
}

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; letter-spacing: -0.02em; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.label {
  margin: 0;
  font: 500 12px/1.4 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 30; background: var(--ink); color: var(--bg); padding: 8px 12px; }

/* ---------- Шапка ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 56px; }
.topbar__name { font-weight: 600; text-decoration: none; letter-spacing: -0.01em; }
.topbar__nav { display: flex; gap: clamp(12px, 2.4vw, 28px); font-size: 15px; }
.topbar__nav a { text-decoration: none; color: var(--ink-2); }
.topbar__nav a:hover { color: var(--ink); text-decoration: underline; }

/* ---------- Первый экран ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: end;
  padding-block: clamp(40px, 8vw, 96px) clamp(56px, 8vw, 104px);
}
.hero h1 {
  margin-top: 20px;
  font-size: clamp(2.5rem, 6vw, 4.25rem);
  line-height: 1;
  letter-spacing: -0.035em;
}
.hero__lead { margin: 24px 0 0; max-width: 34em; font-size: clamp(1.06rem, 1.6vw, 1.22rem); color: var(--ink-2); }

.contacts { margin: 36px 0 0; border-top: 1px solid var(--line); }
.contacts__row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.contacts dt { font: 400 13px/1.4 var(--mono); color: var(--muted); }
.contacts dd { margin: 0; }
.contacts dd a { text-decoration: none; }
.contacts dd a:hover { text-decoration: underline; }

.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.hero__photo { margin: 0; }
.hero__photo img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 18%;
  border-radius: 6px;
  background: var(--surface);
}

/* ---------- Кнопки ---------- */
.btn, .copy {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: 500 15px/1 var(--font);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.15s var(--ease);
}
.btn { min-height: 48px; padding: 0 22px; }
.btn:hover { background: var(--ink); color: var(--bg); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn:active, .copy:active { transform: scale(0.98); }

.copy { min-height: 40px; padding: 0 16px; border-color: var(--line); font-size: 14px; white-space: nowrap; }
.copy:hover { border-color: var(--ink); }
.copy--sm { min-height: 32px; padding: 0 12px; font-size: 13px; color: var(--muted); }
.copy.is-done { border-color: var(--accent); color: var(--accent); }

/* ---------- Секции ---------- */
.section { padding-block: clamp(56px, 8vw, 96px); border-top: 1px solid var(--line); }
.section__head {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  gap: 24px;
  align-items: start;
  margin-bottom: clamp(32px, 5vw, 56px);
}
.section__head h2 { font-size: clamp(1.75rem, 3.4vw, 2.5rem); line-height: 1.1; }
.section__note { margin: 12px 0 0; max-width: 40em; color: var(--muted); }

/* Чем занимаюсь */
.areas { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.area {
  display: grid;
  grid-template-columns: 120px minmax(0, 5fr) minmax(0, 4fr);
  grid-template-areas: ". title text" ". title fact";
  column-gap: 24px;
  row-gap: 12px;
  padding-block: 32px;
  border-bottom: 1px solid var(--line);
}
.area h3 { grid-area: title; font-size: clamp(1.3rem, 2.2vw, 1.6rem); line-height: 1.2; max-width: 16em; }
.area p { grid-area: text; margin: 0; color: var(--ink-2); max-width: 48ch; }
.area .area__fact { grid-area: fact; font-size: 15px; color: var(--accent); }

/* Кому проводил */
.audiences { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; max-width: none; }
.audiences__group { padding-top: 20px; border-top: 1px solid var(--ink); }
.audiences.prose { max-width: none; }
.audiences.prose h4 { margin-top: 0; margin-bottom: 14px; }

/* Справка: раскрывающиеся блоки */
.fold { border-top: 1px solid var(--line); }
.fold:last-of-type { border-bottom: 1px solid var(--line); }
.fold__head {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 24px;
  padding-block: 24px;
  cursor: pointer;
  list-style: none;
}
.fold__head::-webkit-details-marker { display: none; }
.fold__head::before { content: "+"; font: 400 20px/1 var(--mono); color: var(--muted); transition: transform 0.25s var(--ease); }
.fold[open] > .fold__head::before { transform: rotate(45deg); }
.fold__title { font-size: 1.25rem; font-weight: 500; letter-spacing: -0.01em; }
.fold__hint { font-size: 14px; color: var(--muted); }
.fold__head:hover .fold__title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.fold__body { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 24px; padding-bottom: 32px; }
.fold__body .prose { grid-column: 2; }
.fold__body .copy { grid-column: 3; align-self: start; }

.prose { max-width: 66ch; color: var(--ink-2); }
.prose p { margin: 0 0 1em; }
.prose p:last-child { margin-bottom: 0; }
.prose h4 { margin: 1.6em 0 0.5em; font-size: 1rem; font-weight: 600; color: var(--ink); letter-spacing: 0; }
.prose h4:first-child { margin-top: 0; }
.prose ul { margin: 0; padding: 0; list-style: none; }
.prose li { position: relative; padding-left: 20px; }
.prose li + li { margin-top: 6px; }
.prose li::before { content: ""; position: absolute; left: 2px; top: 0.78em; width: 8px; height: 1px; background: var(--muted); }

/* Проекты */
.projects { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.project { border-bottom: 1px solid var(--line); }
.project__link {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr) 200px;
  grid-template-areas: "name desc url" "meta desc url";
  column-gap: clamp(24px, 4vw, 56px);
  row-gap: 4px;
  padding-block: 28px;
  text-decoration: none;
  transition: background-color 0.25s var(--ease);
}
.project__name { grid-area: name; font-size: 1.5rem; font-weight: 500; letter-spacing: -0.02em; }
.project__meta { grid-area: meta; font: 400 13px/1.5 var(--mono); color: var(--muted); }
.project__desc { grid-area: desc; max-width: 52ch; color: var(--ink-2); }
.project__url { grid-area: url; justify-self: end; font: 400 14px/1.5 var(--mono); color: var(--muted); transition: color 0.2s var(--ease), transform 0.25s var(--ease); }
.project__link:hover .project__url { color: var(--accent); transform: translateX(-4px); }
.project__link:hover .project__name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }

/* Визитка с собой */
.take { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.take__contact {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 20px;
  padding: 24px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  text-decoration: none;
  transition: background-color 0.25s var(--ease);
}
.take__contact:hover { background: var(--surface); }
.take__contact img { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; }
.take__body { display: flex; flex-direction: column; gap: 8px; }
.take__title { font-size: 1.25rem; font-weight: 500; }
.take__text { color: var(--ink-2); font-size: 15px; line-height: 1.5; }
.take__meta { font: 400 13px/1 var(--mono); color: var(--muted); margin-top: 4px; }
.take__contact:hover .take__title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.take__slide { display: grid; gap: 20px; }
.slide__preview { display: block; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.slide__preview img { transition: transform 0.5s var(--ease); }
.slide__preview:hover img { transform: scale(1.015); }
.slide__files { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.file {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.file__type { font: 500 14px/1 var(--mono); color: var(--accent); }
.file__name { font-weight: 500; }
.file__size { font: 400 13px/1 var(--mono); color: var(--muted); }
.file:hover .file__name { text-decoration: underline; }

/* Подвал */
.footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer__inner { padding-block: clamp(56px, 8vw, 88px) 32px; }
.footer__cta { margin: 16px 0 24px; font-size: clamp(1.4rem, 3vw, 2rem); line-height: 1.2; letter-spacing: -0.02em; max-width: 22em; }
.footer__links { display: flex; flex-wrap: wrap; gap: 12px 32px; margin: 0; padding: 0; list-style: none; font-size: 1.05rem; }
.footer__small { margin: 56px 0 0; font: 400 13px/1.4 var(--mono); color: var(--muted); }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Уведомление о копировании */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 40;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  text-align: center;
  border-radius: 14px;
  background: var(--ink);
  color: var(--bg);
  font-size: 15px;
  opacity: 0;
  transform: translate(-50%, 8px);
  pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* Появление при загрузке */
.reveal { animation: reveal 0.8s var(--ease) both; }
.hero__photo.reveal { animation-delay: 0.12s; }
@keyframes reveal { from { opacity: 0; transform: translateY(12px); } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Адаптив ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero__photo { order: -1; max-width: 360px; }
  .section__head { grid-template-columns: 1fr; gap: 12px; }
  .section__head .copy { justify-self: start; }
  .area { grid-template-columns: 1fr; grid-template-areas: "title" "text" "fact"; row-gap: 8px; }
  .audiences { grid-template-columns: 1fr; gap: 28px; }
  .fold__head { grid-template-columns: 28px minmax(0, 1fr); row-gap: 4px; }
  .fold__hint { grid-column: 2; }
  .fold__body { grid-template-columns: 1fr; gap: 16px; }
  .fold__body .prose, .fold__body .copy { grid-column: 1; justify-self: start; }
  .project__link { grid-template-columns: 1fr; grid-template-areas: "name" "meta" "desc" "url"; row-gap: 8px; }
  .project__url { justify-self: start; }
  .take { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .topbar__nav { gap: 12px; font-size: 14px; }
  .topbar__nav a:nth-child(4) { display: none; }
  .contacts__row { grid-template-columns: 72px minmax(0, 1fr) auto; gap: 8px; }
  .hero__actions .btn { flex: 1 1 100%; }
  .hero__photo { max-width: none; }
  .hero__photo img { aspect-ratio: 1 / 1; object-position: 50% 15%; }
}
@media (max-width: 400px) {
  .take__contact { grid-template-columns: 56px minmax(0, 1fr); gap: 16px; padding: 20px; }
  .take__contact img { width: 56px; height: 56px; }
  .topbar__nav { gap: 10px; font-size: 13px; }
  .contacts__row { grid-template-columns: 64px minmax(0, 1fr); row-gap: 6px; }
  .contacts dd:last-child { grid-column: 2; }
}

@media print {
  .topbar, .copy, .hero__actions, .toast, #files { display: none !important; }
  body { background: #fff; color: #000; }
}
