/* СуперГрид — общий стиль для главной и страниц проектов. */

:root {
  --paper: #f5f3ec;
  --paper-2: #ebe8de;
  --card: #fffdf8;
  --ink: #1a1d21;
  --ink-2: #4a4f57;
  --ink-3: #7b8089;
  --line: #d9d5c8;
  --grid: rgba(40, 80, 140, 0.07);
  --accent: #e8531c;
  --accent-ink: #b83a0c;
  --blue: #1f5fa8;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 20, 20, .06), 0 8px 24px rgba(20, 20, 20, .06);
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14171b;
    --paper-2: #1b1f24;
    --card: #1d2227;
    --ink: #eceae4;
    --ink-2: #b9bcc2;
    --ink-3: #8a8f97;
    --line: #2f353c;
    --grid: rgba(120, 170, 255, 0.06);
    --accent: #ff6a33;
    --accent-ink: #ff8a5c;
    --blue: #6ea8ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font: 17px/1.6 var(--sans);
  color: var(--ink);
  background-color: var(--paper);
  /* миллиметровка — отсылка к «гриду» в названии */
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
}

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

a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: var(--accent-ink); }

.wrap {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding-inline: 20px;
}

/* ---------- шапка ---------- */

.top {
  padding-block: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -.01em;
}
.brand:hover { color: var(--ink); }
.brand svg { width: 30px; height: 30px; flex: none; }

.nav { display: flex; gap: 18px; }
.nav a {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink-2);
  text-decoration: none;
  padding-block: 4px;
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--accent-ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

/* ---------- главная ---------- */

.hero {
  padding-block: 48px 40px;
  max-width: 760px;
}

.kicker {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin: 0 0 12px;
}

h1 {
  font-size: clamp(34px, 6vw, 60px);
  line-height: 1.05;
  letter-spacing: -.025em;
  font-weight: 850;
  margin: 0 0 18px;
  text-wrap: balance;
}

.lead {
  font-size: clamp(18px, 2.2vw, 21px);
  color: var(--ink-2);
  margin: 0;
  max-width: 62ch;
}

.projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 28px;
  padding-block: 8px 64px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-3px); color: inherit; }
.card:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.card-img {
  aspect-ratio: 16 / 10;
  background: var(--paper-2);
  overflow: hidden;
}
.card-img img { width: 100%; height: 100%; object-fit: cover; }

.card-body { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-family: var(--mono);
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--paper-2);
  color: var(--ink-2);
}

.card h2 { font-size: 26px; line-height: 1.15; margin: 4px 0 0; letter-spacing: -.015em; }
.card p { margin: 0; color: var(--ink-2); }

.more {
  margin-top: auto;
  padding-top: 8px;
  font-weight: 650;
  color: var(--accent-ink);
}

/* ---------- страница проекта ---------- */

.project-head { padding-block: 32px 28px; max-width: 800px; }
.project-head .tags { margin-bottom: 16px; }

.cover {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: var(--paper-2);
}
.cover img { width: 100%; max-height: 620px; object-fit: cover; }

.section { padding-block: 40px 8px; }
.section > h2 {
  font-size: clamp(24px, 3.2vw, 32px);
  letter-spacing: -.015em;
  line-height: 1.15;
  margin: 0 0 16px;
}
.prose { max-width: 70ch; }
.prose p { margin: 0 0 14px; }
.prose ul { margin: 0 0 14px; padding-left: 1.2em; }
.prose li { margin-bottom: 6px; }

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
  align-items: center;
}
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }

.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; display: grid; gap: 14px; }
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  align-items: start;
}
.steps li::before {
  content: counter(step);
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  font: 700 16px/1 var(--mono);
  color: #fff;
  background: var(--accent);
}
.steps b { display: block; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 14px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.stat .v {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.1;
  color: var(--accent-ink);
  font-variant-numeric: tabular-nums;
}
.stat .k { font-weight: 650; margin-top: 6px; }
.stat .d { color: var(--ink-3); font-size: 14px; line-height: 1.45; margin-top: 2px; }

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 18px;
}
figure { margin: 0; }
.gallery a, .figure a {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--paper-2);
}
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
figcaption { font-size: 14px; color: var(--ink-3); margin-top: 8px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}
.btn:hover { color: #fff; filter: brightness(1.07); }

/* ---------- участники ---------- */

.avatar {
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  background: var(--paper-2);
  border: 3px solid var(--card);
  box-shadow: 0 0 0 1px var(--line);
}

/* маркер-квадратик — тот же, что в логотипе */
.crew-item li::before, .skill::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 2px;
  background: var(--accent);
  flex: none;
}

.members {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(400px, 100%), 1fr));
  gap: 28px;
  padding-block: 8px 24px;
}
.member {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  scroll-margin-top: 16px;
}
.member-head { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; min-height: 118px; }
.member-head .avatar { width: 104px; height: 104px; }
.member h2 { font-size: 30px; line-height: 1.1; margin: 0 0 6px; letter-spacing: -.02em; }
.member .role { color: var(--ink-2); font-size: 16px; line-height: 1.4; }
.badge {
  display: inline-block;
  margin-bottom: 8px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent);
}

.member h3 {
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 10px;
  font-weight: 700;
}

.skills {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.skills li:last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (max-width: 520px) {
  .skills { grid-template-columns: 1fr; }
  .member { padding: 22px; }
  .member-head { gap: 16px; min-height: 0; }
  .member-head .avatar { width: 84px; height: 84px; }
  .member h2 { font-size: 26px; }
}
.skill {
  display: grid;
  grid-template-columns: 8px 1fr;
  column-gap: 10px;
  align-items: baseline;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--paper-2);
}
.skill::before { transform: translateY(-1px); }
.skill b { display: block; font-size: 16px; line-height: 1.3; }
.skill span { grid-column: 2; font-size: 14px; line-height: 1.45; color: var(--ink-2); }

.member-foot {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  transition: border-color .15s ease, color .15s ease;
}
.chip:hover { border-color: var(--accent); color: var(--accent-ink); }
.mail {
  font-size: 15px;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
  white-space: nowrap;
}
.mail:hover { color: var(--accent-ink); text-decoration: underline; }

/* блок «Кто что делал» на страницах проектов и «Команда» на главной */
.crew { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 16px; }
.crew-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.crew-item .avatar { width: 60px; height: 60px; }
.crew-item b { display: block; font-size: 19px; line-height: 1.25; }
.crew-item b a { color: inherit; text-decoration: none; }
.crew-item b a:hover { color: var(--accent-ink); }
.crew-item .role { display: block; color: var(--ink-3); font-size: 14px; margin: 2px 0 10px; }
.crew-item ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.crew-item li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.45;
}
.crew-item li::before { transform: translateY(-1px); }

a.crew-link { color: inherit; text-decoration: none; align-items: center; transition: transform .15s ease, border-color .15s ease; }
a.crew-link:hover { color: inherit; transform: translateY(-2px); border-color: var(--accent); }
a.crew-link .role { margin-bottom: 0; }

/* ---------- подвал ---------- */

.foot {
  margin-top: 64px;
  padding-block: 28px;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 14px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}
.foot a { color: inherit; }
