:root {
  --bg: #d6d5d5;
  --surface: #f1f1f1;
  --surface-hover: rgba(8, 8, 8, .06);
  --surface-active: rgba(8, 8, 8, .1);
  --ink: #080808;
  --hairline: #4f4f4f;
  --accent: #f4a40f;
  --accent-bright: #ffb833;
  --warm-dark: #2d2619;
  --green: var(--accent);
  --green-bright: #35f097;
  --mint: var(--accent-bright);
  --deep-green: var(--warm-dark);
  --radius: 4px;
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='1' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.176 0 0 0 0 0.149 0 0 0 0 0.098 1 0 0 0 0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='2.6' intercept='-0.8'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.02'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--ink) var(--bg);
  scrollbar-width: thin;
}

html::-webkit-scrollbar {
  width: 4px;
}

html::-webkit-scrollbar-track {
  background: var(--bg);
}

html::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background: var(--ink);
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--bg);
  font: 400 14px/1.36 Inter, Arial, sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  position: fixed;
  content: "";
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .44;
  background-color: #d6d5d5;
  background-image:
    linear-gradient(to right, rgba(200, 200, 200, 0) 0, #c8c8c8 1px, rgba(200, 200, 200, 0) 2px),
    linear-gradient(to bottom, rgba(200, 200, 200, 0) 0, #c8c8c8 1px, rgba(200, 200, 200, 0) 2px);
  background-size: 41.16px 41.16px;
  box-shadow: inset 0 4px 120px 10px rgba(8, 8, 8, .12);
}

a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible { outline: 2px solid #7594f5; outline-offset: 2px; }

.page {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 144px 24px 32px;
}

.portfolio-grid {
  width: 1136px;
  height: 750px;
  display: grid;
  grid-template-columns: 56px 708px 348px;
  grid-template-rows: 301px 437px;
  gap: 12px;
}

.card {
  overflow: hidden;
  background-color: var(--surface);
  background-image: var(--noise);
  border: solid var(--ink);
  border-width: 1px 2px 4px 1px;
  border-radius: 4px;
  transition:
    transform 240ms ease-out,
    box-shadow 240ms ease-out;
  will-change: transform;
}

@media (hover: hover) and (pointer: fine) {
  .card:hover {
    box-shadow: 1px 1px 0 var(--ink);
    transform: translate(-1px, -1px);
  }
}

.rail {
  grid-column: 1;
  grid-row: 1 / -1;
  position: sticky;
  top: 32px;
  z-index: 19;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-self: start;
}

.menu {
  height: 301px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 12px;
}

.menu__brand {
  position: relative;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: grid;
  place-items: center;
}

.menu__brand img {
  display: block;
  width: 32px;
  height: 32px;
}

.menu__brand-animation {
  display: none;
  width: 28px;
  height: 28px;
  pointer-events: none;
}

.menu__brand-animation svg {
  display: block;
  width: 28px;
  height: 28px;
}

.menu__brand.is-lottie-ready .menu__brand-fallback { display: none; }
.menu__brand.is-lottie-ready .menu__brand-animation { display: block; }

.menu__links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

.icon-link {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  transition: background-color 100ms ease-in;
}

.icon-link img { display: block; width: 24px; height: 24px; }
.icon-link.is-active img { width: 32px; height: 32px; }
.icon-link:hover,
.menu__language:hover { background: var(--surface-hover); }

.icon-link:active,
.menu__language:active { background: var(--surface-active); }

.menu__language {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 4px;
  color: rgba(8, 8, 8, .42);
  background: transparent;
  font: 500 16px/1.2 Inter, sans-serif;
  cursor: pointer;
  margin-top: auto;
  transition: background-color 100ms ease-in, color 100ms ease-in;
}

.intro {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  padding: 24px 28px 32px;
}

.status {
  position: absolute;
  top: 23px;
  right: 27px;
  display: flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 6px 3px 10px;
  overflow: hidden;
  border-radius: 4px;
  color: #fff;
  background: var(--ink);
  font: 500 12px/1.2 Manrope, sans-serif;
  white-space: nowrap;
  isolation: isolate;
}

.status::before {
  position: absolute;
  content: "";
  left: 2px;
  top: 2px;
  width: 4px;
  height: 18px;
  z-index: 1;
  border-radius: 2px;
  background: var(--green-bright);
}

.intro__portrait {
  width: 82px;
  height: 82px;
  flex: 0 0 82px;
  overflow: hidden;
  border: 1px solid var(--ink);
  border-radius: 3px;
  background: rgba(255, 255, 255, .2);
}

.intro__portrait img {
  display: block;
  width: 92px;
  height: 92px;
  margin: -3px 0 0 -5px;
  object-fit: cover;
}

.intro__content {
  width: 100%;
  height: 143px;
  display: grid;
  grid-template-rows: 100px 27px;
  row-gap: 16px;
}

h1, h2, p { margin: 0; }

h1 {
  grid-row: 1;
  grid-column: 1;
  width: 100%;
  font: 400 44px/1.1 Manrope, sans-serif;
  letter-spacing: 0;
}

.intro p {
  grid-row: 1;
  grid-column: 1;
  align-self: start;
  margin-top: 60px;
  font-size: 14px;
  line-height: 1.36;
}

.button {
  display: inline-flex;
  width: max-content;
  min-height: 27px;
  align-items: center;
  gap: 6px;
  padding: 3px 8px 5px;
  border: 0;
  border-radius: 4px;
  color: #fff;
  background: var(--ink);
  font: 400 14px/1.36 Inter, sans-serif;
  text-decoration: none;
  transition:
    background-color 100ms ease-in,
    color 100ms ease-in;
}

.button > span {
  transition: transform 100ms ease-in;
}

.button .button__icon {
  width: 10px;
  height: 9.518px;
  flex: 0 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.button .button__icon img {
  display: block;
  width: 10.665px;
  height: 10.25px;
  max-width: none;
  transform: translateY(1px);
  transition:
    filter 100ms ease-in,
    opacity 100ms ease-in,
    transform 100ms ease-in;
}

.button[data-variant="blue"] {
  background: #344cf2;
}

.button[data-variant="blue"] .button__icon img,
.button[data-variant="outline"] .button__icon img {
  transform: translateY(1px) rotate(-45deg);
  transform-origin: center;
}

.button[data-variant="outline"] {
  border: .6px solid var(--hairline);
  color: var(--ink);
  background: #fff;
}

.button[data-variant="outline"] .button__icon img {
  filter: brightness(0);
}

.project.is-switching .project__cta {
  transition: none;
}

@media (hover: hover) and (pointer: fine) {
  .button:hover {
    background: rgba(8, 8, 8, .72);
  }

  .button:hover > span {
    transform: translateY(-1px);
  }

  .button[data-variant="blue"]:hover {
    background: rgba(52, 76, 242, .72);
  }

  .button[data-variant="outline"]:hover {
    color: #4d4d4d;
    background: #fff;
  }

  .button[data-variant="outline"]:hover .button__icon img {
    opacity: .72;
  }
}

.button:active {
  background: rgba(8, 8, 8, .64);
  transition-duration: 0s;
}

.button:active > span {
  transform: translateY(-1px);
}

.button[data-variant="blue"]:active {
  background: rgba(52, 76, 242, .64);
}

.button[data-variant="outline"]:active {
  color: #616161;
  background: rgba(255, 255, 255, .64);
}

.button[data-variant="outline"]:active .button__icon img {
  opacity: .62;
}

.skills {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px 28px 36px;
}

.skills h2 {
  font: 400 24px/1.2 Manrope, sans-serif;
}

.skills ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.skills li {
  padding-left: 0;
  font-size: 14px;
  line-height: 1.36;
}

.skills li::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  margin: 0 8px 3px 0;
  border-radius: 50%;
  background: var(--ink);
  color: var(--ink);
}

.rail-actions {
  width: 56px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.socials-slot {
  width: 56px;
  height: 193px;
}

.socials {
  width: 56px;
  height: 193px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 12px;
}

.socials :is(a, button) {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.socials :is(a, button) > span {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  transition: transform 180ms ease, filter 180ms ease;
  will-change: transform;
}

@media (hover: hover) and (pointer: fine) {
  .socials.card:hover {
    transform: none;
    box-shadow: none;
  }

  .socials-slot:hover .socials {
    box-shadow: 1px 1px 0 var(--ink);
    transform: translate(-1px, -1px);
  }

  .socials :is(a, button):hover > span {
    filter: brightness(1.08);
    transform: translateY(-2px);
  }

  .socials :is(a, button):nth-child(4):hover > span {
    background: var(--surface-hover);
    filter: none;
  }
}

.socials img { display: block; }
.socials :is(a, button):nth-child(1) img { width: 23px; height: 23px; }
.socials :is(a, button):nth-child(2) img { width: 16px; height: 16px; }
.socials :is(a, button):nth-child(3) img { width: 21px; height: 16px; }
.socials :is(a, button):nth-child(4) img { width: 20px; height: 17px; }

.socials :is(a, button):nth-child(1) > span { background: #010100; }
.socials :is(a, button):nth-child(2) > span { background: #0c64ba; }
.socials :is(a, button):nth-child(3) > span { background: #344cf3; }
.socials :is(a, button):nth-child(4) > span { background: rgba(210,210,209,.88); }

.socials :is(a, button):nth-child(4):active > span {
  background: var(--surface-active);
}

.sound-toggle-slot {
  width: 56px;
  height: 61px;
}

.sound-toggle {
  width: 56px;
  height: 61px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 12px;
  border: solid var(--ink);
  border-width: 1px 2px 4px 1px;
}

.sound-toggle__icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 4px;
  color: inherit;
  background: transparent;
  cursor: pointer;
  transition: background-color 100ms ease-in;
}

.sound-toggle img {
  width: 20px;
  height: 20px;
}

@media (hover: hover) and (pointer: fine) {
  .sound-toggle.card:hover {
    box-shadow: none;
    transform: none;
  }

  .sound-toggle-slot:hover .sound-toggle {
    box-shadow: 1px 1px 0 var(--ink);
    transform: translate(-1px, -1px);
  }

  .sound-toggle__icon:hover {
    background: var(--surface-hover);
  }
}

.sound-toggle__icon:active {
  background: var(--surface-active);
}

.snackbar {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 100;
  max-width: min(320px, calc(100vw - 32px));
  padding: 10px 12px 12px;
  color: var(--ink);
  background: var(--surface);
  border: solid var(--ink);
  border-width: 1px 2px 4px 1px;
  border-radius: 4px;
  box-shadow: 1px 1px 0 var(--ink);
  font: 400 14px/1.36 Inter, Arial, sans-serif;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 160ms ease-out,
    transform 160ms ease-out;
}

.snackbar[hidden] { display: none; }

.snackbar.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.project {
  grid-column: 2 / 4;
  grid-row: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 348px;
  gap: 24px;
  padding: 24px 28px 32px;
}

.project__visual {
  position: relative;
  width: 100%;
  height: 377px;
  overflow: hidden;
  padding: 24px 24px 28px;
  border: .6px solid var(--hairline);
  border-radius: 4px;
  background: var(--project-visual-bg, #d4d4d4);
}

.project__visual::before {
  position: absolute;
  content: "";
  right: -109px;
  bottom: -144px;
  width: 529px;
  height: 420px;
  border-radius: 50%;
  background: var(--project-ellipse, #04120f);
  filter: blur(72px);
  opacity: .02;
}

.project__shot-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  aspect-ratio: 596 / 330;
  margin: 0 auto;
}

.project__shot {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.project[data-visual-mode="full"] .project__visual {
  padding: 0;
}

.project[data-visual-mode="full"] .project__visual::before {
  display: none;
}

.project[data-visual-mode="full"] .project__shot-wrap,
.project[data-visual-mode="full"] .project__shot {
  width: 100%;
  height: 100%;
}

.metric {
  position: absolute;
  z-index: 2;
  right: 13px;
  bottom: 11px;
  width: var(--metric-width, auto);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 16px 16px 20px;
  overflow: hidden;
  border: 0;
  border-radius: 16px;
  color: var(--metric-color, var(--deep-green));
  background: var(--metric-bg, var(--mint));
  box-shadow: 0 2px 56px 1px rgba(45,38,25,.08);
}

.metric[hidden] {
  display: none;
}

.metric[data-side="left"] {
  right: auto;
  left: 14px;
}

.metric[data-variant="compact"] {
  min-width: 188px;
  min-height: 53px;
  align-items: flex-start;
  justify-content: center;
  padding: 16px;
  border-radius: 4px;
}

.metric strong {
  font: 600 44px/1.05 Inter, sans-serif;
  text-align: center;
  white-space: nowrap;
}

.metric[data-variant="compact"] strong {
  font: 500 14px/1.2 Inter, sans-serif;
}

.metric span {
  margin: 0;
  opacity: .8;
  font: 500 14px/1.2 Inter, sans-serif;
  text-align: center;
  white-space: normal;
}

.project__content {
  min-width: 0;
  height: 377px; /* = высота превью .project__visual */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: visible;
}

.project__content--measure {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: -1;
  height: auto !important;
  min-height: 0 !important;
  visibility: hidden;
  pointer-events: none;
}

.tags {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tags span {
  padding: 4px 8px 6px;
  border: .6px solid var(--hairline);
  border-radius: 4px;
  background: rgba(255, 255, 255, .4);
  font: 400 12px/1.2 Manrope, sans-serif;
  white-space: nowrap;
}

.project__copy { margin-top: 24px; }

.project h2 {
  width: 100%;
  font: 400 24px/1.2 Manrope, sans-serif;
  letter-spacing: 0;
}

.project__copy p {
  width: 100%;
  margin-top: 12px;
  font: 400 14px/1.36 Inter, sans-serif;
}

.project__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}

.project__cta-extra {
  color: #23221e;
  font: 400 14px/1.32 Inter, sans-serif;
  white-space: nowrap;
}

.project__controls {
  width: 100%;
  display: flex;
  align-items: flex-end;
  gap: 20px;
  margin-top: auto;
}

.progress {
  width: auto;
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
}

.progress span {
  position: relative;
  height: 12px;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
}

.progress span::after {
  position: absolute;
  content: "";
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(8, 8, 8, .16);
  transition: background-color 100ms ease-in;
}

.progress span.is-complete::after { background: var(--ink); }

.progress span.is-active {
  cursor: default;
}

@media (hover: hover) and (pointer: fine) {
  .progress span:not(.is-complete):not(.is-active):hover::after {
    background: var(--surface-hover);
  }

  .progress span.is-complete:not(.is-active):hover::after {
    background: rgba(8, 8, 8, .72);
  }
}

.progress span.is-active::before {
  position: absolute;
  content: "";
  left: 0;
  bottom: 0;
  height: 4px;
  /* width, а не scaleX: масштаб сплющивал скругление в начале роста.
     min-width 4px — стартовый кружок 4×4 совпадает со скруглением подложки */
  width: 0;
  min-width: 4px;
  z-index: 1;
  border-radius: 4px;
  background: var(--green);
  animation: project-progress 12s linear forwards;
}

@keyframes project-progress {
  /* линейный рост от кружка 4px до конца */
  from { width: 4px; }
  to { width: 100%; }
}

.arrows { display: flex; gap: 8px; }

.arrows button {
  width: 27px;
  height: 27px;
  padding: 0;
  border: .6px solid var(--hairline);
  border-radius: 4px;
  background: rgba(255, 255, 255, .6);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background-color 100ms ease-in;
}

.arrows button img {
  display: block;
  width: 10.665px;
  height: 10.25px;
  max-width: none;
  transition: opacity 100ms ease-in, transform 100ms ease-in;
}

@media (hover: hover) and (pointer: fine) {
  .arrows button:hover img {
    opacity: .72;
    transform: translateY(-1px);
  }
}

.arrows button:active {
  background: rgba(255, 255, 255, .4);
  transition-duration: 0s;
}

.arrows button:active img {
  opacity: .62;
  transform: translateY(-1px);
  transition-duration: 0s;
}

footer {
  flex: 0 0 auto;
  margin-top: auto;
  padding-top: 20px;
  color: rgba(8,8,8,.42);
  font: 400 12px/1.4 Inter, sans-serif;
  white-space: nowrap;
}

@media (min-width: 1200px) {
  .page {
    min-height: max(100vh, 851px);
    padding: clamp(32px, calc((100vh - 794px) / 2), 144px) 24px 32px;
  }

  .portfolio-grid { margin: 0 auto; }
}

@media (min-width: 1200px) and (max-height: 620px) {
  .rail {
    position: static;
    top: auto;
  }
}

@media (max-width: 1199px) {
  .page {
    padding: 32px 32px;
  }

  .portfolio-grid {
    position: relative;
    width: 776px;
    height: auto;
    display: grid;
    grid-template-columns: 56px 708px;
    grid-template-rows: auto auto auto;
    gap: 12px;
  }

  .rail {
    grid-column: 1;
    grid-row: 1 / 4;
    position: static;
    top: auto;
  }
  .intro {
    grid-column: 2;
    grid-row: 1;
    width: 708px;
    height: 301px; /* высотой с меню, как на десктопе */
  }
  .skills {
    grid-column: 2;
    grid-row: 2;
    width: 708px;
    height: auto;
    align-self: start;
  }

  .project {
    grid-column: 2;
    grid-row: 3;
    width: 708px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: auto;
  }

  .project__visual {
    width: 100%;
    height: auto;
    aspect-ratio: 644 / 380;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .project__shot-wrap {
    width: 100%;
    max-width: none;
    height: auto;
    aspect-ratio: 596 / 330;
  }

  .project__shot {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .project__content {
    width: 100%;
    height: auto;
    min-height: var(--project-content-min-height, auto);
  }

  .intro__content {
    height: auto;
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .intro h1 { padding-bottom: 6px; }
  .intro p { margin-top: 12px; }
  .intro .button { margin-top: 16px; }

  .tags { width: 100%; }
  .project__copy {
    margin-top: 16px;
    margin-bottom: 12px;
  }
  .project h2,
  .project__copy p { width: min(100%, 560px); }

  .project__controls { width: 100%; }
  .progress { width: auto; flex: 1; }

}

@media (max-width: 839px) {
  .page { padding: 16px 8px 32px; }

  .portfolio-grid {
    width: min(708px, calc(100vw - 16px));
    max-width: calc(100vw - 16px);
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .rail { display: contents; }

  .menu,
  .intro,
  .skills,
  .rail-actions,
  .socials-slot,
  .socials,
  .sound-toggle-slot,
  .sound-toggle,
  .project { width: 100%; }

  .menu {
    position: relative;
    top: auto;
    order: 1;
    min-height: 56px;
    height: 56px;
    flex-direction: row;
    justify-content: space-between;
    padding: 12px;
  }

  .menu__links {
    flex-direction: row;
    margin: 0;
  }

  .menu__language { margin: 0; }

  .rail-actions {
    position: relative;
    top: auto;
    order: 2;
    display: block;
  }

  .socials-slot {
    height: 56px;
    align-self: stretch;
  }

  .socials {
    height: 56px;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 12px;
  }

  .socials :is(a, button) {
    width: auto;
    flex: 1 1 0;
  }

  .socials :is(a, button) > span {
    width: 100%;
  }

  .sound-toggle-slot {
    display: none;
  }

  /* рейл стал горизонтальным — интро по контенту (hug), без пустоты снизу */
  .intro { order: 3; height: auto; }
  .skills {
    order: 4;
    height: auto;
  }
  .project { order: 5; }

  .snackbar {
    left: 50%;
    bottom: 16px;
    width: max-content;
    max-width: calc(100vw - 16px);
    text-align: center;
    transform: translate(-50%, 8px);
  }

  .snackbar.is-visible {
    transform: translate(-50%, 0);
  }
}

@media (max-width: 600px) {
  .page { padding: 16px 8px 32px; }
  .intro { height: auto; padding: 24px 20px 32px; }
  .status { top: 23px; right: 20px; }
  .intro h1 { padding-bottom: 1px; font-size: 36px; line-height: 48px; }
  .skills { padding: 24px 20px 36px; }
  .project { padding: 12px; }
  .project__visual { padding: 12px; }
  .project__shot-wrap { width: 100%; }
  .project__shot { width: 100%; height: 100%; }
  .metric { right: 12px; bottom: 12px; padding: 10px 12px 12px; border-radius: 10px; }
  .metric strong { font-size: 28px; }
  .metric span { font-size: 11px; }
  .project__content { min-height: var(--project-content-min-height, auto); padding: 0 4px 4px; }
  .tags { width: 100%; }
  /* на мобиле уменьшаем внутренний горизонтальный паддинг чипов;
     правый отступ блока к краю карточки задаёт паддинг .project — не трогаем */
  .tags span { padding: 4px 6px 6px; }
  .project h2, .project__copy p { width: 100%; }
  .project__controls { gap: 12px; }
  .progress { width: auto; flex: 1; }

  /* about-hero: на узком экране бейдж «Open to WORK» уводим в поток,
     чтобы он не налезал на имя, и уменьшаем заголовок */
  .about-hero { padding: 24px 20px 32px; }
  .about-hero .status { position: relative; top: auto; right: auto; align-self: flex-start; }
  .about-hero h1 { font-size: 36px; line-height: 1.1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
  .progress span.is-active::before { animation: none; width: 100%; }
}

/* ── Страница «Проекты»: сетка карточек кейсов ──────────
   Макет: 761:4107, 761:4134. Шум и рамка — из общего .card */

.portfolio-grid--cases {
  height: auto;
  grid-template-rows: auto;
}

.cases {
  grid-column: 2 / 4;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.case-card {
  display: flex;
  flex-direction: column;
}

.case-card__visual {
  position: relative;
  height: 208px;
  padding: 20px 20px 0;
  overflow: hidden;
  background: #d4d4d4;
}

.case-card__visual--dark {
  background: #23221e;
}

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

.case-card__visual--full {
  padding: 0;
}

.case-card__visual--full img {
  height: 100%;
  object-fit: cover;
}

.case-card__plate {
  position: absolute;
  z-index: 1;
  padding: 4px 6px;
  color: var(--accent-bright);
  background: var(--warm-dark);
  font: 500 14px/1.2 Inter, sans-serif;
  white-space: nowrap;
}

.case-card--amber .case-card__plate {
  color: var(--warm-dark);
  background: var(--accent-bright);
}

.case-card__metric {
  left: 14px;
  bottom: 0;
  padding: 4px 8px 4px 6px;
  border-radius: 4px 4px 0 0;
}

.case-card__year {
  top: 0;
  right: 14px;
  border-radius: 0 0 4px 4px;
}

.case-card__body {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 20px 20px 28px;
}

.case-card__body h2 {
  margin: 0;
  font: 500 16px/1.2 Inter, sans-serif;
}

.case-card__body p {
  margin: 12px 0 0;
  font: 400 14px/1.36 Inter, sans-serif;
}

.case-card__actions {
  margin-top: auto;
  padding-top: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.case-card__cta-extra {
  font: 400 14px/1.32 Inter, sans-serif;
}

.case-card__cta-extra b {
  font-weight: 600;
}

@media (max-width: 1199px) {
  .cases {
    grid-column: 2;
    grid-row: 1;
  }
}

@media (max-width: 839px) {
  .cases {
    order: 3;
    width: 100%;
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

/* ── Страница «Обо мне» ─────────────────────────────────
   Макет: my · v3 (787:3258). Карточки, кнопки, чипсы — общие */

.about {
  grid-column: 2 / 4;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.about-row {
  display: grid;
  grid-template-columns: 708px 348px;
  gap: 12px;
  align-items: start;
}

.about-hero {
  position: relative;
  height: 301px; /* = высота карточки меню в рейле */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  padding: 24px 28px 32px;
}

.about-portrait {
  width: 82px;
  height: 82px;
  flex: 0 0 82px;
  overflow: hidden;
  border: 1px solid var(--ink);
  border-radius: 3px;
  background: rgba(255, 255, 255, .2);
}

.about-portrait img {
  display: block;
  width: 92px;
  height: 92px;
  margin: -3px 0 0 -5px;
  object-fit: cover;
}

.about-hero__content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}

.about-hero__head {
  display: flex;
  align-items: center;
  gap: 20px;
}

.about-hero__names {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.about-hero__content .button {
  /* отступ до кнопки 16 при общем gap 20 */
  margin-top: -4px;
}

.about-hero__role {
  color: rgba(8, 8, 8, .8);
  font: 500 16px/1.2 Inter, sans-serif;
}

.about-hero__lead {
  font: 400 14px/1.36 Inter, sans-serif;
}

.about-toc {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px 28px 32px;
}

.about-toc h2 {
  font: 400 20px/1.2 Manrope, sans-serif;
}

.about-toc nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.about-toc nav a {
  width: max-content;
  color: rgba(8, 8, 8, .8);
  font: 400 14px/1.36 Inter, sans-serif;
  text-decoration: none;
  transition: color 100ms ease-in;
}

.about-toc nav a:hover,
.about-toc nav a.is-active {
  color: var(--ink);
}

.about-skills {
  /* тянем «Навыки» на высоту правой колонки (контакты + инструменты) */
  align-self: stretch;
}

.about-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.about-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px 28px 32px;
}

.about-card h2 {
  font: 400 20px/1.2 Manrope, sans-serif;
}

.about-contacts {
  display: flex;
  gap: 10px;
}

.about-contacts a,
.about-contacts button {
  width: 65px;
  height: 65px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transition: transform 150ms ease-out;
}

.about-contacts a:hover,
.about-contacts button:hover {
  transform: translateY(-2px);
}

.about-contacts img {
  display: block;
  width: 100%;
  height: 100%;
}

.about-tags {
  width: 100%;
}

.about-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px 28px 32px;
}

.about-section h2 {
  font: 400 24px/1.2 Manrope, sans-serif;
}

.about-entry {
  display: flex;
  gap: 32px;
}

.about-entry__side {
  flex: 0 0 260px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.about-entry__side h3 {
  margin: 0;
  font: 600 16px/1.4 Inter, sans-serif;
}

.about-entry__side span {
  color: #6b6b6b;
  font: 400 14px/1.36 Inter, sans-serif;
}

.about-entry__body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.about-entry__body p {
  font: 400 14px/1.36 Inter, sans-serif;
}

.about-entry__body strong {
  font-weight: 500;
}

.about-entry__label {
  font: 500 14px/1.2 Inter, sans-serif;
}

.about-entry ul,
.about-columns ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.about-entry li,
.about-columns li {
  font: 400 14px/1.36 Inter, sans-serif;
}

.about-entry ul:not(.about-links) li::before,
.about-columns li::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  margin: 0 8px 3px 0;
  border-radius: 50%;
  background: var(--ink);
}

.about-links a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 100ms ease-in;
}

.about-links a:hover {
  color: rgba(8, 8, 8, .72);
}

.about-divider {
  width: 100%;
  margin: 0;
  border: 0;
  border-top: .6px solid var(--hairline);
  opacity: .6;
}

.about-columns {
  display: flex;
  gap: 24px;
}

.about-columns ul {
  flex: 1 1 0;
}

.about-langs {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 24px;
  font: 400 14px/1.36 Inter, sans-serif;
}

.about-langs strong {
  font-weight: 600;
}

@media (max-width: 1199px) {
  .about {
    grid-column: 2;
  }

  /* всё в одну колонку на всю ширину — flex надёжнее грида при стекинге */
  .about-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  /* хиро остаётся высотой с меню (301), тянем только по ширине */
  .about-hero {
    width: 100%;
  }

  .about-toc,
  .about-skills,
  .about-side {
    width: 100%;
    height: auto;
    align-self: stretch;
  }
}

@media (max-width: 839px) {
  .about {
    order: 3;
    width: 100%;
  }

  /* рейл горизонтальный, всё стекается — хиро по контенту */
  .about-hero {
    height: auto;
  }

  .about-entry {
    flex-direction: column;
    gap: 12px;
  }

  .about-entry__side {
    flex: 0 0 auto;
  }
}

/* ── Страница 404 ───────────────────────────────────────
   Макет 842:3302. Сплит: утилитарный текст-блок + большая 404 */

.page--404 {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.error {
  display: flex;
  align-items: center;
  gap: 72px;
  transform: translateY(-44px); /* поднять весь блок на 44px */
}

.error__info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 32px; /* текст-группа ↔ кнопка: просторно (близость) */
}

.error__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px; /* внутри группы — тесно (близость) */
}

.error__label {
  color: var(--accent);
  font: 500 13px/1 Inter, sans-serif;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.error__title {
  width: auto;
  font: 500 40px/1.12 Manrope, sans-serif;
  letter-spacing: 0;
  color: var(--ink);
}

.error__body {
  max-width: 400px;
  color: rgba(8, 8, 8, .7);
  font: 400 16px/1.5 Inter, sans-serif;
}

.error__code {
  flex: 0 0 auto;
  font: 800 260px/.85 Manrope, sans-serif;
  letter-spacing: -.024em; /* −20% к интервалу (плотнее) */
  user-select: none;
  /* амбер-заливка с шумом (как на карточках) */
  color: transparent;
  background-image: var(--noise), linear-gradient(var(--accent), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  /* внешняя обводка #E89D10: paint-order рисует stroke под заливкой,
     4px по центру глифа → 2px остаётся снаружи */
  -webkit-text-stroke: 4px #e89d10;
  paint-order: stroke fill;
}

@media (max-width: 839px) {
  .error {
    flex-direction: column;
    align-items: flex-start;
    gap: 32px;
  }
  .error__code { font-size: 150px; }
}

@media (max-width: 600px) {
  .error__code { font-size: 104px; }
  .error__title { font-size: 32px; }
}
