:root {
  --bg: #fff;
  --text: #111;
  --muted: #8a8a8a;
  --line: #e2e2e2;
  --accent: #ff3b1f;
  --gutter: 32px;
  --font: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}
h3 { font-weight: 500; line-height: 1.05; letter-spacing: -.02em; margin: 0; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
::selection { background: var(--accent); color: #fff; }
.eyebrow { color: var(--muted); font-size: 14px; }

.btn {
  display: inline-flex; align-items: center; padding: 14px 24px; border: 0;
  background: var(--text); color: var(--bg); font-weight: 500; transition: background .2s;
}
.btn:hover { background: var(--accent); }
.btn:disabled { opacity: .5; cursor: wait; }

/* Header */
.header {
  position: sticky; top: 0; z-index: 20; background: var(--bg);
  display: flex; align-items: center; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap;
  padding: 20px var(--gutter);
}
.logo img { display: block; height: 22px; width: auto; }
.filters { display: flex; gap: 24px; flex-wrap: wrap; }
.filter { background: none; border: 0; padding: 0; color: var(--muted); transition: color .2s; }
.filter:hover { color: var(--text); }
.filter.is-active { color: var(--text); text-decoration: underline; text-underline-offset: .25em; }
.filter sup { font-size: 11px; margin-left: 2px; }
.filters { margin-left: auto; }
.menu { display: flex; gap: 24px; margin-left: auto; }
.filters + .menu { margin-left: 0; padding-left: 24px; border-left: 1px solid var(--line); }
.menu a { color: var(--muted); transition: color .2s; }
.menu a:hover { color: var(--text); }
.menu [aria-current] { color: var(--text); text-decoration: underline; text-underline-offset: .25em; }
.lang { display: flex; gap: 12px; font-size: 14px; }
.lang a { color: var(--muted); transition: color .2s; }
.lang a:hover, .lang [aria-current] { color: var(--text); }

/* Works */
.works {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  padding: 12px var(--gutter) 120px;
}
.work { position: relative; display: block; cursor: pointer; background: none; border: 0; padding: 0; text-align: left; animation: fadeIn .5s both; }
.work[hidden] { display: none; }
.work__cover { position: relative; aspect-ratio: 4 / 3; overflow: hidden; display: flex; align-items: flex-end; padding: 24px; }
.work__cover > img, .modal__cover > img, .work__cover > video, .modal__cover > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.work__cover > span { font-size: clamp(28px, 3vw, 44px); font-weight: 500; letter-spacing: -.04em; line-height: 1; }
.work__label {
  position: absolute; left: 0; bottom: 0; background: var(--bg); padding: 10px 14px 0 0;
  font-size: 15px; opacity: 0; transition: opacity .25s;
}
.work__label b { font-weight: 600; }
.work__label span { color: var(--muted); margin-left: 8px; }
.work:hover .work__label, .work:focus-visible .work__label { opacity: 1; }
.works__empty { grid-column: 1 / -1; color: var(--muted); }
@keyframes fadeIn { from { opacity: 0; } }

/* Feedback widget */
.feedback { position: fixed; right: 24px; bottom: 24px; z-index: 30; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.feedback__toggle {
  border: 0; background: var(--text); color: var(--bg); padding: 16px 22px; font-weight: 500;
  display: flex; align-items: center; gap: 10px; transition: background .2s;
}
.feedback__toggle::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.feedback__toggle:hover { background: var(--accent); }
.feedback__toggle:hover::before { background: var(--bg); }
.feedback__toggle[aria-expanded="true"]::before { display: none; }
.feedback__panel {
  width: min(360px, 100vw - 48px); background: var(--bg); padding: 24px;
  box-shadow: 0 0 0 1px var(--line), 0 24px 48px rgb(0 0 0 / .08);
  display: grid; gap: 20px; animation: fadeIn .25s;
}
.feedback__panel[hidden] { display: none; }
.feedback__title { font-size: 22px; font-weight: 500; letter-spacing: -.02em; }
.feedback label { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
.feedback input, .feedback textarea {
  width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  padding: 6px 0; color: var(--text); font: inherit; font-size: 17px; resize: vertical; transition: border-color .2s;
}
.feedback input:focus, .feedback textarea:focus { outline: none; border-color: var(--text); }
.feedback .is-invalid { border-color: var(--accent); }
.feedback .btn { justify-self: start; }
.feedback__trap { position: absolute; left: -9999px; }
.feedback__status { font-size: 14px; min-height: 1.45em; margin-top: -8px; }
.feedback__status.is-error { color: var(--accent); }

/* Modal */
.modal {
  width: min(1200px, 100% - 32px); max-height: 90vh; padding: 0; border: 0;
  background: var(--bg); color: var(--text); overflow: auto;
}
.modal::backdrop { background: rgb(255 255 255 / .92); }
.modal[open] { animation: fadeIn .3s; box-shadow: 0 0 0 1px var(--line); }
.modal__close {
  position: absolute; top: 12px; right: 12px; z-index: 1; width: 44px; height: 44px;
  border: 0; background: var(--bg); font-size: 28px; line-height: 1;
}
.modal__cover {
  position: relative; aspect-ratio: 16 / 8; display: flex; align-items: flex-end; padding: 32px;
  font-size: clamp(36px, 7vw, 80px); font-weight: 500; letter-spacing: -.05em; line-height: 1;
}
.modal__body { padding: 32px; display: grid; gap: 16px; }
.modal__body h3 { font-size: 32px; }
.modal__body > p:not(.eyebrow) { color: var(--muted); font-size: 18px; max-width: 40em; }
.modal__meta { list-style: none; padding: 0; margin: 16px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.modal__meta:empty { display: none; }
.modal__meta li { border-top: 1px solid var(--text); padding-top: 12px; font-size: 14px; color: var(--muted); }
.modal__meta b { display: block; color: var(--text); font-size: 28px; font-weight: 500; letter-spacing: -.03em; }
.modal__gallery { display: grid; gap: 8px; padding: 0 32px 32px; }
.modal__gallery:empty { display: none; }
.modal__gallery img, .modal__gallery video { width: 100%; display: block; }

/* Blog («Читать») */
mark { background: none; color: var(--accent); }
.blog { padding: 12px var(--gutter) 120px; }
.blog__title { font-size: clamp(44px, 7vw, 96px); font-weight: 500; letter-spacing: -.05em; line-height: 1; margin: 24px 0 48px; }
.posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 56px 16px; }
.post-card { display: grid; gap: 10px; align-content: start; animation: fadeIn .5s both; }
.post-card__cover { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #f2f2f2; margin-bottom: 6px; }
.post-card__cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s; }
.post-card:hover .post-card__cover img { transform: scale(1.03); }
.post-card h2 { font-size: 26px; font-weight: 500; letter-spacing: -.025em; line-height: 1.1; margin: 0; transition: color .2s; }
.post-card:hover h2 { color: var(--accent); }
.post-card p { color: var(--muted); }

.post { width: min(760px, 100% - 2 * var(--gutter)); margin: 0 auto; padding: 32px 0 120px; }
.post__back { display: inline-block; color: var(--muted); font-size: 14px; margin-bottom: 40px; transition: color .2s; }
.post__back:hover { color: var(--text); }
.post h1 { font-size: clamp(36px, 5vw, 64px); font-weight: 500; letter-spacing: -.045em; line-height: 1.02; margin: 12px 0 24px; }
.post__lead { font-size: 21px; line-height: 1.4; color: var(--muted); }
.post__cover { display: block; width: 100%; margin: 48px 0 0; }
.post__body { margin-top: 48px; font-size: 18px; line-height: 1.65; }
.post__body > * + * { margin-top: 1.1em; }
.post__body h2, .post__body h3 { font-weight: 500; letter-spacing: -.02em; line-height: 1.15; margin-top: 1.8em; }
.post__body h2 { font-size: 30px; }
.post__body h3 { font-size: 22px; }
.post__body strong { font-weight: 600; }
.post__body a { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: .2em; }
.post__body a:hover { color: var(--accent); }
.post__body ul, .post__body ol { padding-left: 1.3em; margin-bottom: 0; }
.post__body li + li { margin-top: .4em; }
.post__body blockquote { margin-inline: 0; padding-left: 24px; border-left: 2px solid var(--accent); font-size: 23px; line-height: 1.4; letter-spacing: -.01em; }
.post__body figure { margin: 2em 0; }
.post__body figure img, .post__body figure video { width: 100%; display: block; }
.post__body figcaption { margin-top: 10px; font-size: 14px; color: var(--muted); }

/* Responsive */
@media (min-width: 1800px) {
  .works { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 1080px) {
  .works, .posts { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  :root { --gutter: 16px; }
  .header { padding-block: 16px; }
  .filters { order: 3; margin-left: 0; flex-wrap: nowrap; overflow-x: auto; width: 100%; gap: 20px; scrollbar-width: none; }
  .filter { white-space: nowrap; }
  .works { grid-template-columns: 1fr; gap: 12px; }
  .filters + .menu { margin-left: auto; padding-left: 0; border-left: 0; }
  .posts { grid-template-columns: 1fr; gap: 40px; }
  .post__body { font-size: 17px; }
  .post__body blockquote { font-size: 20px; }
  .work__label { position: static; opacity: 1; padding: 8px 0 0; }
  .feedback { right: 16px; bottom: 16px; }
  .feedback__panel { width: calc(100vw - 32px); }
  .modal__meta { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
