/* === Tokens: editorial dark, tight margins === */
:root {
  --scroll-progress: 0;
  --bg: #000000;
  --bg-soft: #020202;
  --bg-card: rgba(14, 14, 14, 0.72);
  --bg-card-hover: rgba(22, 22, 22, 0.92);
  --text: #f2f0ec;
  --text-muted: #8a8780;
  --accent: #c4b59d;
  --accent-faint: rgba(196, 181, 157, 0.12);
  --border: rgba(242, 240, 236, 0.08);
  --hairline: rgba(242, 240, 236, 0.06);
  --font-display: "Cormorant Garamond", "Times New Roman", serif;
  --font-sans: "Inter", system-ui, sans-serif;
  --gutter: clamp(0.625rem, 2vw, 1rem);
  --gutter-wide: clamp(0.75rem, 3vw, 1.25rem);
  --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-spring: cubic-bezier(0.34, 1.3, 0.64, 1);
  --header-h: 3.25rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: auto;
  scroll-padding-top: var(--header-h);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 0.9375rem;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  letter-spacing: 0.01em;
  overflow-x: hidden;
}

body.is-loading {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

/* === Фон: статичная бело-серая сетка; просветы сдвигаются со скроллом (--scroll-progress) === */
.bg-grid {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  --p: var(--scroll-progress);
  background-color: transparent;
  /* Первый слой — сетка (поверх просветов); ячейки прозрачные */
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 47px,
      rgba(200, 202, 208, 0.035) 47px,
      rgba(200, 202, 208, 0.035) 48px
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 47px,
      rgba(200, 202, 208, 0.035) 47px,
      rgba(200, 202, 208, 0.035) 48px
    ),
    radial-gradient(
      ellipse 75% 55% at calc(22% + var(--p) * 58%) calc(-5% + var(--p) * 95%),
      rgba(232, 234, 238, 0.04) 0%,
      transparent 52%
    ),
    radial-gradient(
      ellipse 65% 50% at calc(92% - var(--p) * 48%) calc(15% + var(--p) * 75%),
      rgba(210, 212, 218, 0.03) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse 90% 45% at calc(48% + var(--p) * 12%) calc(70% - var(--p) * 55%),
      rgba(240, 241, 244, 0.025) 0%,
      transparent 48%
    );
}

/* === Subtle grain only === */
.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  opacity: 0.022;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* === Header === */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding: 0 var(--gutter-wide);
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
  transition:
    background 0.45s var(--ease-out),
    box-shadow 0.45s var(--ease-out),
    border-color 0.35s var(--ease-out);
}

.header.is-scrolled {
  background: rgba(3, 3, 3, 0.95);
  box-shadow: 0 1px 0 rgba(196, 181, 157, 0.06);
  border-bottom-color: rgba(242, 240, 236, 0.05);
}

.logo {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.6875rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition:
    color 0.35s var(--ease-out),
    letter-spacing 0.5s var(--ease-spring);
}

.logo:hover {
  color: var(--text);
  letter-spacing: 0.26em;
}

.logo-dot {
  color: var(--accent);
}

.nav {
  display: flex;
  gap: clamp(1.25rem, 3vw, 2rem);
}

.nav a {
  position: relative;
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.3s var(--ease-out);
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.35rem;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s var(--ease-out);
}

.nav a:hover {
  color: var(--text);
}

.nav a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  transition: border-color 0.25s;
}

.menu-btn span {
  display: block;
  width: 20px;
  height: 1px;
  margin: 0 auto;
  background: var(--text);
  transition: transform 0.35s var(--ease-out);
}

.menu-btn[aria-expanded="true"] span:first-child {
  transform: translateY(3px) rotate(45deg);
}

.menu-btn[aria-expanded="true"] span:last-child {
  transform: translateY(-3px) rotate(-45deg);
}

.menu-btn:hover {
  border-color: var(--accent);
}

.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 0;
  padding: 0.5rem var(--gutter-wide) 1rem;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--hairline);
}

.mobile-nav a {
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--hairline);
  transition: color 0.25s, padding-left 0.35s var(--ease-out);
}

.mobile-nav a:hover {
  color: var(--text);
  padding-left: 0.25rem;
}

.mobile-nav:not([hidden]) {
  display: flex;
}

/* === Main: почти на всю ширину экрана === */
main {
  position: relative;
  z-index: 1;
  padding: clamp(2.5rem, 7vw, 4.5rem) var(--gutter-wide) clamp(3rem, 8vw, 5rem);
}

/* === Hero: крупная тонкая антиква === */
.hero {
  margin: 0 0 clamp(3.5rem, 10vw, 6rem);
}

.hero-label {
  font-size: 0.625rem;
  font-weight: 400;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 clamp(1.25rem, 3vw, 2rem);
  animation: label-breathe 5s ease-in-out infinite;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3.25rem, 14vw, 8.5rem);
  font-weight: 300;
  line-height: 0.98;
  letter-spacing: -0.02em;
  margin: 0 0 clamp(1.25rem, 3vw, 2rem);
}

.hero-title span {
  display: block;
}

.hero-title-line {
  margin-top: -0.02em;
}

.hero-title-line em {
  font-style: italic;
  font-weight: 300;
  color: var(--accent);
}

.hero-desc {
  max-width: 22rem;
  font-size: clamp(0.875rem, 1.8vw, 1rem);
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0;
}

/* === Hero stats strip === */
.hero-stats {
  display: flex;
  gap: clamp(1.5rem, 5vw, 3rem);
  margin-top: clamp(2rem, 5vw, 3rem);
  padding-top: clamp(1.25rem, 3vw, 1.75rem);
  border-top: 1px solid var(--hairline);
}

.hero-stat {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.hero-stat__num {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  color: var(--accent);
  line-height: 1;
}

.hero-stat__label {
  font-size: 0.5625rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

@media (max-width: 480px) {
  .hero-stats {
    gap: 1.25rem;
    flex-wrap: wrap;
  }

  .hero-stat__num {
    font-size: clamp(1.25rem, 6vw, 1.65rem);
  }
}


  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

/* === Sections === */
.section {
  margin: 0 0 clamp(3.5rem, 9vw, 5.5rem);
}

.section-head {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: end;
  gap: clamp(0.75rem, 2vw, 1.25rem);
  margin-bottom: clamp(1.75rem, 4vw, 2.75rem);
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--hairline);
}

.section-head::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 1px;
  width: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 1s var(--ease-out);
  opacity: 0.55;
  pointer-events: none;
}

.section-head.reveal.is-visible::after {
  transform: scaleX(1);
}

.section-num {
  font-family: var(--font-sans);
  font-size: 0.625rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  padding-bottom: 0.15rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 8vw, 4.25rem);
  font-weight: 300;
  letter-spacing: -0.015em;
  line-height: 1.05;
  margin: 0;
}

/* === About: полный профиль === */
.about-shell {
  display: flex;
  flex-direction: column;
  gap: clamp(2.5rem, 5vw, 3.5rem);
}

.about-top {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.15fr);
  gap: clamp(1.5rem, 4vw, 2.75rem);
  align-items: start;
}

.about-identity {
  padding-bottom: clamp(1rem, 3vw, 1.5rem);
  border-bottom: 1px solid var(--hairline);
}

.about-name {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin: 0 0 0.5rem;
  transition: color 0.4s var(--ease-out);
}

.about-identity:hover .about-name {
  color: var(--accent);
}

.about-role {
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 1.5rem;
}

.about-cta {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.about-cta li {
  border-top: 1px solid var(--hairline);
}

.text-link {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.85rem 0;
  transition:
    padding-left 0.35s var(--ease-out),
    background-color 0.35s var(--ease-out);
}

.text-link:hover {
  padding-left: 0.35rem;
  background-color: rgba(255, 255, 255, 0.02);
}

.text-link-label {
  font-size: 0.5625rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.text-link-value {
  font-size: 0.8125rem;
  font-weight: 300;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: color 0.3s var(--ease-out), transform 0.35s var(--ease-spring);
}

.text-link:hover .text-link-value {
  color: var(--accent);
  transform: translateX(3px);
}

.about-summary-wrap {
  padding-top: 0.25rem;
}

.about-summary {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.4vw, 1.4rem);
  font-weight: 300;
  line-height: 1.55;
  margin: 0;
  color: var(--text);
}

.about-h {
  font-family: var(--font-sans);
  font-size: 0.5625rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.25rem;
}

.about-block {
  padding-top: 0.5rem;
}

.about-block--narrow {
  max-width: 42rem;
}

.exp-card {
  margin-bottom: clamp(1.5rem, 3vw, 2rem);
  padding-bottom: clamp(1.5rem, 3vw, 2rem);
  border-bottom: 1px solid var(--hairline);
  transition: border-color 0.4s var(--ease-out);
}

.exp-card:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.exp-card:hover {
  border-bottom-color: rgba(196, 181, 157, 0.15);
}

.exp-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
}

.exp-company {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.2vw, 1.45rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  transition: letter-spacing 0.45s var(--ease-out);
}

.exp-card:hover .exp-company {
  letter-spacing: 0.02em;
}

.exp-title {
  font-size: 0.75rem;
  font-weight: 300;
  color: var(--text-muted);
}

.exp-sub {
  font-size: 0.6875rem;
  font-weight: 300;
  color: var(--text-muted);
  font-style: italic;
}

.exp-dates {
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-left: auto;
}

.exp-list {
  margin: 0;
  padding: 0 0 0 1.1rem;
  list-style: none;
}

.exp-list li {
  position: relative;
  font-size: 0.8125rem;
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.55;
  padding-left: 0.65rem;
  margin-bottom: 0.65rem;
  opacity: 0;
  transform: translateX(-10px);
  transition:
    opacity 0.5s var(--ease-out),
    transform 0.5s var(--ease-out),
    color 0.3s var(--ease-out);
}

.exp-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.45;
  transform: scale(0);
  transition: transform 0.35s var(--ease-spring);
}

.about-block.reveal.is-visible .exp-list li {
  opacity: 1;
  transform: translateX(0);
}

.about-block.reveal.is-visible .exp-list li::before {
  transform: scale(1);
}

.about-block.reveal.is-visible .exp-list li:nth-child(1) {
  transition-delay: 0.05s;
}
.about-block.reveal.is-visible .exp-list li:nth-child(2) {
  transition-delay: 0.1s;
}
.about-block.reveal.is-visible .exp-list li:nth-child(3) {
  transition-delay: 0.15s;
}
.about-block.reveal.is-visible .exp-list li:nth-child(4) {
  transition-delay: 0.2s;
}
.about-block.reveal.is-visible .exp-list li:nth-child(5) {
  transition-delay: 0.25s;
}

.exp-list li:hover {
  color: var(--text);
}

.exp-text {
  font-size: 0.8125rem;
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
  max-width: 50rem;
}

.chips--skills-row {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(196, 181, 157, 0.35) transparent;
  -webkit-overflow-scrolling: touch;
}

.chips--skills-row li {
  flex: 0 0 auto;
  white-space: nowrap;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.chips li {
  font-size: 0.625rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--hairline);
  color: var(--text-muted);
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.45s var(--ease-out),
    transform 0.45s var(--ease-spring),
    color 0.3s var(--ease-out),
    border-color 0.3s var(--ease-out),
    background-color 0.35s var(--ease-out);
}

.about-block.reveal.is-visible .chips li {
  opacity: 1;
  transform: translateY(0);
}

.about-block.reveal.is-visible .chips li:nth-child(1) {
  transition-delay: 0.03s;
}
.about-block.reveal.is-visible .chips li:nth-child(2) {
  transition-delay: 0.06s;
}
.about-block.reveal.is-visible .chips li:nth-child(3) {
  transition-delay: 0.09s;
}
.about-block.reveal.is-visible .chips li:nth-child(4) {
  transition-delay: 0.12s;
}
.about-block.reveal.is-visible .chips li:nth-child(5) {
  transition-delay: 0.15s;
}
.about-block.reveal.is-visible .chips li:nth-child(6) {
  transition-delay: 0.18s;
}
.about-block.reveal.is-visible .chips li:nth-child(7) {
  transition-delay: 0.21s;
}
.about-block.reveal.is-visible .chips li:nth-child(8) {
  transition-delay: 0.24s;
}
.about-block.reveal.is-visible .chips li:nth-child(9) {
  transition-delay: 0.27s;
}
.about-block.reveal.is-visible .chips li:nth-child(10) {
  transition-delay: 0.3s;
}
.about-block.reveal.is-visible .chips li:nth-child(11) {
  transition-delay: 0.33s;
}
.about-block.reveal.is-visible .chips li:nth-child(12) {
  transition-delay: 0.36s;
}

.chips li:hover {
  color: var(--text);
  border-color: rgba(196, 181, 157, 0.35);
  background-color: rgba(196, 181, 157, 0.06);
  transform: translateY(-2px);
}

.edu-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.edu-list li {
  font-size: 0.8125rem;
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.55;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--hairline);
  transition:
    color 0.3s var(--ease-out),
    padding-left 0.4s var(--ease-out);
}

.edu-list li:hover {
  color: var(--text);
  padding-left: 0.35rem;
}

.edu-list li:last-child {
  border-bottom: none;
}

.edu-place {
  color: var(--text);
  font-weight: 400;
}

/* === Cards: линии, без «неона» === */
.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--hairline);
  border-left: 1px solid var(--hairline);
}

.card {
  perspective: none;
  display: flex;
  flex-direction: column;
  contain: layout style;
}

.card-inner {
  height: 100%;
  padding: clamp(1.25rem, 3vw, 1.75rem);
  border-right: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  background: var(--bg-card);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition:
    background 0.45s var(--ease-out),
    box-shadow 0.45s var(--ease-out);
}

.card:hover .card-inner {
  background: var(--bg-card-hover);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.card-visual {
  height: clamp(100px, 22vw, 132px);
  margin-bottom: 1.25rem;
  background: linear-gradient(
    160deg,
    color-mix(in srgb, var(--accent) 18%, transparent) 0%,
    rgba(255, 255, 255, 0.03) 45%,
    transparent 100%
  );
  border: 1px solid var(--hairline);
  overflow: hidden;
  transition: border-color 0.35s var(--ease-out);
}

.card:hover .card-visual,
.card:hover .card-preview .card-visual {
  border-color: rgba(196, 181, 157, 0.2);
}

/* === Cards: улучшенный hover overlay === */
.card-preview {
  flex-shrink: 0;
  margin-bottom: 1.25rem;
  position: relative;
  overflow: hidden;
}

.card-preview::after {
  content: "Открыть кейс →";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text);
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.35s var(--ease-out);
  pointer-events: none;
  z-index: 1;
}

.card:hover .card-preview::after {
  opacity: 1;
}

@media (hover: none) {
  .card-preview::after {
    display: none;
  }
}

.card-preview .card-visual {
  margin-bottom: 0;
  width: 100%;
}



.card-title {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.8vw, 1.65rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  margin: 0 0 0.5rem;
  transition: color 0.35s var(--ease-out);
}

.card:hover .card-title {
  color: var(--accent);
}

.card-desc {
  font-size: 0.8125rem;
  font-weight: 300;
  color: var(--text-muted);
  margin: 0 0 1.1rem;
  line-height: 1.55;
  max-width: 36em;
  flex-grow: 1;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.65rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.tags li {
  font-size: 0.5625rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition:
    color 0.3s var(--ease-out),
    transform 0.35s var(--ease-spring),
    letter-spacing 0.4s var(--ease-out);
}

.tags li:hover {
  color: var(--accent);
  transform: translateY(-2px);
  letter-spacing: 0.18em;
}

/* === Contacts === */
.section-contacts .contacts-block {
  max-width: none;
}

.contacts-row + .contacts-row {
  margin-top: 0.35rem;
}

.contact-link {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 5.5vw, 3rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.15em;
  transition:
    color 0.35s var(--ease-out),
    border-color 0.35s var(--ease-out),
    letter-spacing 0.45s var(--ease-out);
}

.contact-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  letter-spacing: 0.01em;
}

.contact-link__meta {
  font-family: var(--font-sans);
  font-size: 0.42em;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  vertical-align: baseline;
}

.contacts-note {
  margin: 1rem 0 0;
  font-weight: 300;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* === Прелоадер === */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 30000;
  display: grid;
  place-items: center;
  background: var(--bg);
  transition:
    opacity 0.55s var(--ease-out),
    visibility 0.55s var(--ease-out);
}

.preloader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.35rem;
  width: min(18rem, 72vw);
}

.preloader__logo {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 8vw, 3.25rem);
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--text);
}

.preloader__line {
  width: 100%;
  height: 1px;
  background: var(--hairline);
  overflow: hidden;
}

.preloader__line span {
  display: block;
  width: 35%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: preloader-sweep 1.15s var(--ease-out) infinite;
}

@keyframes preloader-sweep {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(340%);
  }
}

/* === Custom cursor === */
@media (hover: hover) and (pointer: fine) {
  body.has-custom-cursor {
    cursor: none;
  }

  body.has-custom-cursor a,
  body.has-custom-cursor button,
  body.has-custom-cursor .card-case-trigger,
  body.has-custom-cursor .case-gallery__dot,
  body.has-custom-cursor label,
  body.has-custom-cursor input,
  body.has-custom-cursor textarea,
  body.has-custom-cursor select {
    cursor: none;
  }

  body.is-modal-open,
  body.is-modal-open * {
    cursor: auto !important;
  }

  body.is-modal-open .cursor {
    opacity: 0 !important;
  }

  .cursor {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 2147483646;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.22s var(--ease-out);
  }

  .cursor.is-visible {
    opacity: 1;
  }

  .cursor__dot,
  .cursor__ring {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    will-change: transform;
  }

  .cursor__dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 12px rgba(196, 181, 157, 0.45);
    transition: opacity 0.2s var(--ease-out);
  }

  .cursor__ring {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid rgba(196, 181, 157, 0.45);
    background: rgba(196, 181, 157, 0.04);
    transition:
      width 0.3s var(--ease-out),
      height 0.3s var(--ease-out),
      border-color 0.3s var(--ease-out),
      background 0.3s var(--ease-out),
      opacity 0.2s var(--ease-out);
  }

  .cursor.cursor--link .cursor__ring {
    width: 42px;
    height: 42px;
    border-color: rgba(196, 181, 157, 0.75);
    background: rgba(196, 181, 157, 0.08);
  }

  .cursor.cursor--down .cursor__dot {
    opacity: 0.7;
  }

  .cursor.cursor--down .cursor__ring {
    opacity: 0.85;
  }
}

/* === Footer === */
.footer {
  border-top: 1px solid var(--hairline);
  padding: 1.15rem var(--gutter-wide);
  background: var(--bg-soft);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-copy {
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: clamp(1rem, 3vw, 1.75rem);
}

.footer-links a {
  font-size: 0.625rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition:
    color 0.3s var(--ease-out),
    letter-spacing 0.45s var(--ease-out);
}

.footer-links a:hover {
  color: var(--text);
  letter-spacing: 0.22em;
}

/* === Reveal === */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.85s var(--ease-out),
    transform 0.85s var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.hero-title .reveal:nth-child(1) {
  transition-delay: 0.04s;
}

.hero-title .reveal:nth-child(2) {
  transition-delay: 0.1s;
}

/* === Responsive === */
@media (max-width: 900px) {
  .about-top {
    grid-template-columns: 1fr;
  }

  .cards {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 769px) {
  .mobile-nav {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .nav {
    display: none;
  }

  .menu-btn {
    display: flex;
  }
}

@media (max-width: 480px) {
  :root {
    --header-h: 3rem;
  }

  .text-link {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .exp-dates {
    width: 100%;
    margin-left: 0;
  }

  .section-head {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .section-num {
    order: -1;
  }

  /* Hero */
  .hero-desc {
    max-width: 100%;
  }

  /* Карточки */
  .card-inner,
  .card .card-case-trigger.card-inner {
    padding: 1rem;
  }

  .card-title {
    font-size: clamp(1.15rem, 5.5vw, 1.4rem);
  }

  .card-desc {
    font-size: 0.75rem;
  }

  /* Модальное окно: sheet снизу */
  .case-modal {
    max-width: 100vw;
    width: 100%;
    max-height: 92vh;
    margin: auto 0 0;
    border-radius: 1rem 1rem 0 0;
    border-bottom: none;
  }

  .case-modal__panel {
    max-height: 92vh;
    border-radius: inherit;
  }

  .case-modal__scroller {
    padding: 1.25rem 1rem 2rem;
    padding-right: 1rem;
  }

  .case-modal__title {
    font-size: clamp(1.3rem, 5.5vw, 1.65rem);
    padding-right: 2.25rem;
  }

  .case-modal__close {
    top: 0.6rem;
    right: 0.6rem;
    width: 2.1rem;
    height: 2.1rem;
    font-size: 1.2rem;
  }

  /* Контакты */
  .contact-link {
    font-size: clamp(1.35rem, 7vw, 2rem);
  }

  /* About */
  .about-name {
    font-size: clamp(1.45rem, 6vw, 1.9rem);
  }
}

/* === Совсем маленькие экраны < 360px === */
@media (max-width: 360px) {
  main {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .hero-title {
    font-size: clamp(2.75rem, 16vw, 4rem);
  }

  .case-modal__title {
    font-size: 1.2rem;
  }

  .contact-link {
    font-size: clamp(1.1rem, 8vw, 1.55rem);
  }
}

/* === Тач: убираем hover-эффекты, которые залипают на мобиле === */
@media (hover: none) {
  .card:hover .card-inner {
    background: var(--bg-card);
  }

  .card:hover .card-title {
    color: inherit;
  }

  .nav a:hover::after {
    transform: scaleX(0);
  }

  .chips li:hover,
  .tags li:hover {
    transform: none;
  }

  .contact-link:hover {
    color: inherit;
    border-color: var(--border);
    letter-spacing: -0.02em;
  }

  .text-link:hover {
    padding-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: smooth;
  }

  .preloader__line span {
    animation: none;
    width: 100%;
    background: var(--accent);
  }

  .hero-label {
    animation: none;
  }

  .about-block.reveal .chips li,
  .about-block.reveal.is-visible .chips li {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .about-block.reveal .exp-list li,
  .about-block.reveal.is-visible .exp-list li {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .about-block.reveal .exp-list li::before,
  .about-block.reveal.is-visible .exp-list li::before {
    transform: scale(1);
    transition: none;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .section-head::after {
    transform: scaleX(1);
    transition: none;
  }

  .card-inner,
  .card-visual,
  .meta-block,
  .contact-link,
  .nav a::after,
  .chips li,
  .tags li {
    transition: none;
  }

  .case-modal,
  .case-modal::backdrop {
    transition: none !important;
  }

  .case-gallery__viewport {
    scroll-behavior: auto;
  }

  .case-gallery__dot {
    transition: none;
  }

}

.cards.cards--single {
  grid-template-columns: 1fr;
  max-width: 38rem;
}

.card .card-case-trigger.card-inner {
  font: inherit;
  color: inherit;
  text-align: left;
  width: 100%;
  appearance: none;
  cursor: pointer;
  background: transparent;
  display: flex;
  flex-direction: column;
  border: none;
  border-right: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  border-radius: 0;
}

#projects .card-preview .card-visual--img {
  padding: 0;
  height: auto;
  aspect-ratio: 16 / 9;
  background: #141210;
}

#projects .card-preview .card-visual--img img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
}

#projects .card:not(.card--site) .card-preview .card-visual--img img {
  object-fit: contain;
  object-position: center center;
}

/* Сайты: крупный кроп первого экрана (шапка + hero) */
#projects .card--site .card-preview .card-visual--img img {
  object-fit: cover;
  object-position: top center;
}

.card-client {
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 1rem;
  line-height: 1.45;
}

/* === Кейс: модальное окно (тёмная тема, широкий формат) === */
.case-modal {
  position: fixed;
  inset: 0;
  margin: auto;
  max-width: min(90rem, calc(100vw - 0.75rem));
  width: 100%;
  max-height: min(96vh, 72rem);
  padding: 0;
  border: 1px solid rgba(242, 240, 236, 0.1);
  border-radius: 1.25rem;
  background: #0a0a0a;
  color: var(--text);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.5),
    0 32px 80px rgba(0, 0, 0, 0.55);
  opacity: 0;
  transform: scale(0.975) translateY(0.35rem);
  transition:
    opacity 0.34s var(--ease-out),
    transform 0.34s var(--ease-out);
  /* Одна полоса прокрутки только у .case-modal__scroller, не у <dialog> */
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.case-modal[open] {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.case-modal::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.34s var(--ease-out);
}

.case-modal[open]::backdrop {
  opacity: 1;
}

.case-modal__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  max-height: min(96vh, 72rem);
  border-radius: inherit;
  overflow: hidden;
}

.case-modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(242, 240, 236, 0.12);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition:
    background 0.22s var(--ease-out),
    border-color 0.22s var(--ease-out),
    color 0.22s var(--ease-out);
}

.case-modal__close:hover {
  background: rgba(196, 181, 157, 0.12);
  border-color: rgba(196, 181, 157, 0.35);
  color: var(--accent);
}

.case-modal__scroller {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: clamp(1.5rem, 3.5vw, 2.15rem) clamp(1.35rem, 3.5vw, 2.25rem) clamp(1.5rem, 3.5vw, 2.15rem);
  padding-right: clamp(2.75rem, 5vw, 3.25rem);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.case-modal__scroller::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.case-modal__title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.8vw, 2.15rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.18;
  margin: 0 0 1.15rem;
  color: var(--text);
  padding-right: 2.5rem;
}

.case-modal__lead {
  margin: 0 0 1.65rem;
}

.case-modal__lead p {
  font-family: var(--font-sans);
  font-size: clamp(0.9375rem, 1.6vw, 1.015rem);
  font-weight: 300;
  line-height: 1.68;
  color: var(--text-muted);
  margin: 0 0 1rem;
}

.case-modal__lead p:last-child {
  margin-bottom: 0;
}

.case-modal__block {
  margin-bottom: 1.6rem;
}

.case-modal__h {
  font-family: var(--font-sans);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.7rem;
}

.case-modal__list {
  margin: 0;
  padding: 0 0 0 1.1rem;
  font-size: 0.90625rem;
  font-weight: 300;
  line-height: 1.62;
  color: rgba(242, 240, 236, 0.82);
}

.case-modal__list li {
  margin-bottom: 0.55rem;
}

.case-modal__list li:last-child {
  margin-bottom: 0;
}

.case-modal__list strong {
  font-weight: 500;
  color: var(--text);
}

.case-modal__list--promo {
  list-style: none;
  padding-left: 0;
}

.case-modal__list--promo > li {
  margin-bottom: 1.25rem;
}

.case-modal__list--promo > li:last-child {
  margin-bottom: 0;
}

.case-modal__sublist {
  list-style: disc;
  margin: 0.45rem 0 0.55rem;
  padding: 0 0 0 1.15rem;
  font-size: 0.875rem;
  font-weight: 300;
  line-height: 1.55;
  color: rgba(242, 240, 236, 0.78);
}

.case-modal__sublist li {
  margin-bottom: 0.25rem;
}

.case-modal__sublist li:last-child {
  margin-bottom: 0;
}

.case-modal__terms {
  margin: 0.35rem 0 0;
  font-size: 0.8125rem;
  font-weight: 300;
  line-height: 1.58;
  color: rgba(242, 240, 236, 0.68);
}

.case-modal__note {
  font-size: 0.84375rem;
  font-weight: 300;
  color: rgba(242, 240, 236, 0.72);
  line-height: 1.6;
  margin: 0.85rem 0 0;
}

.case-modal__note--solo {
  margin-top: 0;
}

/* === Галерея кейса: карусель (крупный просмотр + вертикальный скролл длинных скринов) === */
.case-gallery {
  position: relative;
  margin-left: calc(-1 * clamp(1.35rem, 3.5vw, 2.25rem));
  margin-right: calc(-1 * clamp(2.75rem, 5vw, 3.25rem));
  width: calc(
    100% + clamp(1.35rem, 3.5vw, 2.25rem) + clamp(2.75rem, 5vw, 3.25rem)
  );
  max-width: none;
  padding: 0 clamp(2.35rem, 4vw, 2.85rem);
}

.case-gallery__viewport {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  gap: 0;
  height: clamp(22rem, 62vh, 54rem);
  max-height: min(82vh, 56rem);
  border-radius: 0.65rem;
  border: 1px solid rgba(242, 240, 236, 0.1);
  background: #0d0d0d;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.case-gallery__viewport::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.case-gallery__viewport:focus-visible {
  outline: 2px solid rgba(196, 181, 157, 0.45);
  outline-offset: 2px;
}

.case-gallery__slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  margin: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  box-sizing: border-box;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(0.45rem, 1.2vw, 0.85rem) clamp(0.35rem, 1vw, 0.65rem);
  scrollbar-width: thin;
  scrollbar-color: rgba(196, 181, 157, 0.35) rgba(255, 255, 255, 0.04);
}

.case-gallery__slide img {
  display: block;
  width: min(100%, 1680px);
  max-width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  flex-shrink: 0;
  margin-block: auto;
  border-radius: 0.35rem;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.45);
}

/* Упаковка / «Русский камень»: высота области просмотра под активный кадр (JS подменяет inline) */
.case-gallery--adaptive .case-gallery__viewport {
  height: 22rem;
  min-height: 13rem;
  max-height: min(82vh, 920px);
  transition: height 0.26s var(--ease-out);
}

.case-gallery--adaptive .case-gallery__slide {
  height: 100%;
  align-self: stretch;
}

.case-gallery--adaptive .case-gallery__slide--infographic {
  overflow-y: hidden;
  justify-content: center;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

.case-gallery--adaptive .case-gallery__slide--infographic img {
  width: auto;
  max-width: min(100%, 340px);
  max-height: min(40vh, 260px);
  margin-inline: auto;
  margin-block: auto;
  box-shadow: 0 8px 36px rgba(0, 0, 0, 0.4);
}

@media (prefers-reduced-motion: reduce) {
  .case-gallery--adaptive .case-gallery__viewport {
    transition: none;
  }
}

.case-gallery__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 2.5rem;
  height: 2.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(242, 240, 236, 0.14);
  border-radius: 0.45rem;
  background: rgba(5, 5, 5, 0.55);
  color: var(--text);
  font-size: 1.65rem;
  line-height: 1;
  cursor: pointer;
  transition:
    background 0.2s var(--ease-out),
    border-color 0.2s var(--ease-out),
    color 0.2s var(--ease-out);
}

.case-gallery__arrow:hover {
  background: rgba(196, 181, 157, 0.14);
  border-color: rgba(196, 181, 157, 0.35);
  color: var(--accent);
}

.case-gallery__arrow--prev {
  left: 0.4rem;
}

.case-gallery__arrow--next {
  right: 0.4rem;
}

.case-gallery__dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.case-gallery__dot {
  width: 0.45rem;
  height: 0.45rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(242, 240, 236, 0.22);
  cursor: pointer;
  transition:
    transform 0.2s var(--ease-out),
    background 0.2s var(--ease-out);
}

.case-gallery__dot.is-active {
  background: var(--accent);
  transform: scale(1.25);
}

@media (max-width: 520px) {
  .case-gallery {
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    padding: 0;
  }

  .case-gallery__viewport {
    height: clamp(18rem, 56vh, 42rem);
    max-height: min(76vh, 50rem);
  }

  .case-gallery--adaptive .case-gallery__viewport {
    height: 18rem;
    max-height: min(82vh, 920px);
  }

  .case-gallery__arrow {
    width: 2rem;
    height: 2.25rem;
    font-size: 1.2rem;
  }

  .case-gallery__arrow--prev {
    left: 0.35rem;
  }

  .case-gallery__arrow--next {
    right: 0.35rem;
  }

  .case-gallery__slide {
    scrollbar-width: thin;
  }
}

.case-modal__quote {
  margin: 1.85rem 0 0;
  padding: 1.2rem 1.25rem 1.25rem;
  border-left: 3px solid var(--accent);
  background: rgba(196, 181, 157, 0.08);
  border-radius: 0 0.55rem 0.55rem 0;
}

.case-modal__quote p {
  font-family: var(--font-display);
  font-size: clamp(1.08rem, 2.4vw, 1.28rem);
  font-style: italic;
  font-weight: 400;
  line-height: 1.48;
  color: rgba(242, 240, 236, 0.95);
  margin: 0 0 0.55rem;
}

.case-modal__quote cite {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

/* Fallback if color-mix unsupported */
@supports not (color: color-mix(in srgb, white 50%, black)) {
  .card-visual {
    background: linear-gradient(
      160deg,
      rgba(196, 181, 157, 0.12) 0%,
      rgba(255, 255, 255, 0.03) 45%,
      transparent 100%
    );
  }
}

/* ============================================================
   УЛУЧШЕНИЯ v2: производительность, дизайн, мобиль
   ============================================================ */

/* === Производительность: GPU-слои для анимированных элементов === */
.card-inner,
.card-visual,
.case-modal,
.preloader {
  will-change: auto; /* сброс — не ставим will-change везде, только там где нужно */
}

.reveal {
  will-change: opacity, transform;
}

.reveal.is-visible {
  will-change: auto;
}

/* === Изображения: предотвращаем layout shift === */
img {
  display: block;
  max-width: 100%;
  height: auto;
}

.card-visual--img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* === Улучшенный скролл-индикатор прогресса вверху страницы === */
.scroll-bar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200;
  height: 2px;
  width: calc(var(--scroll-progress) * 100%);
  background: linear-gradient(90deg, var(--accent), rgba(196,181,157,0.4));
  pointer-events: none;
  transition: none;
}

/* === Улучшенный footer === */
.footer {
  border-top: 1px solid var(--hairline);
  padding: 1.35rem var(--gutter-wide);
  background: var(--bg-soft);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

/* === Улучшенный мобильный nav: плавное появление === */
.mobile-nav {
  animation: none;
}

.mobile-nav:not([hidden]) {
  display: flex;
  animation: slideDown 0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === Карточки: улучшенный акцентный бордер снизу при hover === */
.card .card-case-trigger.card-inner {
  position: relative;
}

.card .card-case-trigger.card-inner::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s var(--ease-out);
  opacity: 0.6;
}

.card:hover .card-case-trigger.card-inner::before {
  transform: scaleX(1);
}

@media (hover: none) {
  .card .card-case-trigger.card-inner::before {
    display: none;
  }
}

/* === Мобиль: улучшения < 768px === */
@media (max-width: 768px) {
  /* Секции — меньше отступ */
  .section {
    margin-bottom: clamp(2.5rem, 8vw, 4rem);
  }

  /* Hero на мобиле — ближе к верху */
  .hero {
    margin-bottom: clamp(2.5rem, 8vw, 4rem);
  }

  /* Контакты: email и телефон переносятся */
  .contact-link {
    word-break: break-all;
    font-size: clamp(1.1rem, 5.5vw, 1.75rem);
  }

  /* Секция skills — горизонтальный скролл */
  .chips--skills-row {
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
  }
}

/* === Мобиль: < 480px === */
@media (max-width: 480px) {
  :root {
    --header-h: 3rem;
  }

  /* Hero */
  .hero-desc {
    max-width: 100%;
  }

  /* Карточки */
  .card-inner,
  .card .card-case-trigger.card-inner {
    padding: 1rem;
  }

  .card-title {
    font-size: clamp(1.15rem, 5.5vw, 1.4rem);
  }

  .card-desc {
    font-size: 0.75rem;
  }

  /* Модальное окно: sheet снизу */
  .case-modal {
    max-width: 100vw;
    width: 100%;
    max-height: 94vh;
    margin: auto 0 0;
    border-radius: 1.15rem 1.15rem 0 0;
    border-bottom: none;
    border-left: none;
    border-right: none;
  }

  /* Ручка-индикатор снизу у модалки */
  .case-modal__panel::before {
    content: "";
    display: block;
    width: 2.5rem;
    height: 3px;
    background: rgba(242, 240, 236, 0.18);
    border-radius: 2px;
    margin: 0.65rem auto 0;
    flex-shrink: 0;
  }

  .case-modal__panel {
    max-height: 94vh;
    border-radius: inherit;
    display: flex;
    flex-direction: column;
  }

  .case-modal__scroller {
    padding: 1rem 1rem 2.5rem;
    padding-right: 1rem;
  }

  .case-modal__title {
    font-size: clamp(1.25rem, 5.5vw, 1.6rem);
    padding-right: 2.25rem;
  }

  .case-modal__close {
    top: 0.6rem;
    right: 0.6rem;
    width: 2.1rem;
    height: 2.1rem;
    font-size: 1.2rem;
  }

  /* About */
  .about-name {
    font-size: clamp(1.45rem, 6vw, 1.9rem);
  }

  /* Section title */
  .section-title {
    font-size: clamp(2rem, 9vw, 3.5rem);
  }

  /* Hero title */
  .hero-title {
    font-size: clamp(3rem, 14vw, 6rem);
  }
}

/* === Совсем маленькие: < 360px === */
@media (max-width: 360px) {
  main {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .hero-title {
    font-size: clamp(2.5rem, 15vw, 4rem);
  }

  .case-modal__title {
    font-size: 1.15rem;
  }

  .contact-link {
    font-size: clamp(1rem, 7vw, 1.35rem);
  }
}

/* === Тач: убираем hover-эффекты === */
@media (hover: none) {
  .card:hover .card-inner {
    background: var(--bg-card);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  }

  .card:hover .card-title {
    color: var(--text);
  }

  .card:hover .card-visual,
  .card:hover .card-preview .card-visual {
    border-color: var(--hairline);
  }

  .nav a:hover::after {
    transform: scaleX(0);
  }

  .chips li:hover,
  .tags li:hover {
    transform: none;
    color: var(--text-muted);
    border-color: var(--hairline);
    background-color: transparent;
  }

  .contact-link:hover {
    color: var(--text);
    border-color: var(--border);
    letter-spacing: -0.02em;
  }

  .text-link:hover {
    padding-left: 0;
    background: transparent;
  }

  .text-link:hover .text-link-value {
    color: var(--text);
    transform: none;
  }
}

/* === Safe area для iPhone с notch/Dynamic Island === */
@supports (padding: max(0px)) {
  .header {
    padding-left: max(var(--gutter-wide), env(safe-area-inset-left));
    padding-right: max(var(--gutter-wide), env(safe-area-inset-right));
  }

  main {
    padding-left: max(var(--gutter-wide), env(safe-area-inset-left));
    padding-right: max(var(--gutter-wide), env(safe-area-inset-right));
  }

  .footer {
    padding-bottom: max(1.35rem, env(safe-area-inset-bottom));
  }

  @media (max-width: 480px) {
    .case-modal {
      padding-bottom: env(safe-area-inset-bottom);
    }

    .case-modal__scroller {
      padding-bottom: calc(2.5rem + env(safe-area-inset-bottom));
    }
  }
}

