:root {
  color-scheme: light;

  --paper: #f3f1ec;
  --ink: #191917;
  --muted: #69665f;
  --line: #d9d5cc;
  --soft: #e9e6df;
  --accent: #b9411b;

  --font: "Golos Text", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  --radius: 6px;
  --gutter: 24px;
  --max: 1240px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Шапка */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px var(--gutter);
  background: var(--paper);
}

.wordmark {
  font-weight: 600;
  text-decoration: none;
}

.topnav {
  display: flex;
  gap: 28px;
  font-size: 15px;
}

.topnav a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}

.topnav a:hover {
  color: var(--ink);
}

/* Первый экран */

.hero {
  padding-top: 112px;
  padding-bottom: 120px;
}

h1 {
  max-width: 15ch;
  margin: 0;
  font-size: clamp(44px, 7.4vw, 104px);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.035em;
}

.hero-text {
  max-width: 40ch;
  margin: 36px 0 0;
  font-size: clamp(19px, 1.6vw, 22px);
  line-height: 1.45;
  color: var(--muted);
}

.hero-text span {
  color: var(--ink);
}

/* Заголовки разделов */

.section-title {
  margin: 0 0 32px;
  padding-top: 16px;
  border-top: 1px solid var(--ink);
  font-size: 15px;
  font-weight: 500;
}

/* Избранное */

.works {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 80px 32px;
}

.work-wide {
  grid-column: 1 / -1;
}

.work-wide .shot {
  aspect-ratio: 16 / 8;
}

.shot {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--soft);
}

.shot-web {
  border: 1px solid var(--line);
}

.shot-web img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

/* Телефоны стоят сверху и уходят за нижний край подложки */
.shot-phones {
  display: flex;
  justify-content: center;
  gap: 4%;
  padding: 7% 8% 0;
}

.shot-phones img {
  width: 26%;
  border-radius: 12px;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.08);
}

.shot-phones img:nth-child(2) {
  margin-top: 5%;
}

.work-caption {
  margin-top: 20px;
}

.work-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

.work-title {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.work-text {
  max-width: 48ch;
  margin: 8px 0 0;
  color: var(--muted);
}

.work-wide .work-caption {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
}

.work-wide .work-head {
  flex-direction: column;
  justify-content: flex-start;
  gap: 6px;
}

.work-wide .work-text {
  margin-top: 4px;
}

.stack {
  margin: 12px 0 0;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}

/* Ссылка / «недоступен» */

.status {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  flex-shrink: 0;
  font-size: 15px;
}

.status-link {
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.status-link:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.arrow {
  margin-left: 4px;
  font-size: 0.85em;
}

.status-off {
  color: var(--muted);
  white-space: nowrap;
}

/* Все проекты */

#all {
  margin-top: 160px;
}

.all-head {
  display: flex;
  flex-direction: column;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.filters button {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.filters button:hover {
  border-color: var(--ink);
}

.filters button[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.filter-count {
  font-family: var(--mono);
  font-size: 12px;
  opacity: 0.6;
}

.list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.item {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) 220px;
  gap: 32px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
  animation: appear 0.2s ease-out;
}

.item-type {
  padding-top: 4px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}

.item-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
}

.item-text {
  max-width: 56ch;
  margin: 6px 0 0;
  color: var(--muted);
}

.item .stack {
  margin-top: 10px;
}

.item .status {
  justify-content: flex-end;
  padding-top: 2px;
}

/* Контакт */

.contact {
  padding-top: 200px;
  padding-bottom: 160px;
}

.contact h2 {
  margin: 0;
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.contact p {
  margin: 16px 0 0;
  font-size: 19px;
  color: var(--muted);
}

.contact-link {
  display: inline-block;
  margin-top: 32px;
  font-size: clamp(28px, 3.4vw, 44px);
  font-weight: 500;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 8px;
  transition: text-underline-offset 0.2s;
}

.contact-link:hover {
  text-underline-offset: 12px;
}

.footer {
  display: flex;
  justify-content: space-between;
  padding-top: 20px;
  padding-bottom: 32px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
}

.footer a {
  text-decoration: none;
}

.footer a:hover {
  color: var(--ink);
}

@keyframes appear {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .item { animation: none; }
}

/* Планшет */

@media (max-width: 960px) {
  .item {
    grid-template-columns: 120px minmax(0, 1fr);
  }

  .item .status {
    grid-column: 2;
    justify-content: flex-start;
    padding-top: 0;
  }
}

/* Телефон */

@media (max-width: 720px) {
  :root {
    --gutter: 16px;
  }

  body {
    font-size: 16px;
  }

  .topnav {
    gap: 18px;
  }

  .topnav a[href="#works"] {
    display: none;
  }

  .hero {
    padding-top: 56px;
    padding-bottom: 72px;
  }

  .works {
    grid-template-columns: minmax(0, 1fr);
    gap: 56px;
  }

  .work-head,
  .work-wide .work-caption {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .work-wide .work-caption {
    gap: 0;
  }

  .work-title {
    font-size: 21px;
  }

  .shot-phones img {
    border-radius: 8px;
  }

  #all {
    margin-top: 104px;
  }

  .item {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
    padding: 22px 0;
  }

  .item-type {
    order: -1;
    padding: 0;
    font-size: 12px;
  }

  .item .status {
    grid-column: auto;
    margin-top: 8px;
  }

  .contact {
    padding-top: 120px;
    padding-bottom: 96px;
  }
}
