/* midhey.ru — указатель сервисов */

:root {
  --paper: #f2eee6;
  --paper-2: #e9e4d9;
  --ink: #1a1916;
  --muted: #6c675d;
  --line: rgb(26 25 22 / 0.14);
  --accent: #2847d4;
  --shadow: 0 1px 0 rgb(26 25 22 / 0.08), 0 22px 44px -26px rgb(26 25 22 / 0.45);

  --serif: 'Literata', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14130f;
    --paper-2: #1d1c17;
    --ink: #ebe6db;
    --muted: #9b968b;
    --line: rgb(235 230 219 / 0.14);
    --accent: #93a7ff;
    --shadow: 0 1px 0 rgb(0 0 0 / 0.4), 0 22px 44px -24px rgb(0 0 0 / 0.8);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

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

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

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 48px);
}

/* Шапка */

.top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 28px 0;
  font: 500 14px/1 var(--mono);
}

.top__links {
  display: flex;
  gap: clamp(14px, 3vw, 28px);
}

.top a {
  color: var(--muted);
  transition: color 0.2s;
}

.top a:hover,
.top__home {
  color: var(--ink);
}

/* Вступление */

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 24rem);
  align-items: end;
  gap: 32px clamp(32px, 6vw, 80px);
  padding: clamp(48px, 10vw, 128px) 0 clamp(56px, 9vw, 112px);
}

.intro__name {
  margin: 0;
  font: 400 clamp(60px, 9.6vw, 136px) / 0.9 var(--serif);
  font-optical-sizing: auto;
  letter-spacing: -0.035em;
}

.intro__text {
  max-width: 30rem;
  padding-bottom: 0.6em;
}

.intro__lead {
  margin: 0 0 20px;
  font-size: clamp(19px, 1.8vw, 22px);
  line-height: 1.45;
}

.intro__note {
  margin: 0;
  color: var(--muted);
}

/* Указатель */

.index__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 14px 0;
  border-top: 1.5px solid var(--ink);
  font: 500 13px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.index__head h2 {
  margin: 0;
  font: inherit;
  color: var(--ink);
}

.list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.item {
  border-top: 1px solid var(--line);
  animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: calc(var(--i) * 90ms + 150ms);
}

.item__link {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) minmax(0, 0.95fr);
  gap: 24px 40px;
  align-items: start;
  padding: clamp(28px, 4vw, 48px) 0;
}

.item__num {
  padding-top: clamp(12px, 1.6vw, 20px);
  font: 500 14px/1 var(--mono);
  color: var(--muted);
}

.item__body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 30rem;
}

.item__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  font: 400 clamp(36px, 4.6vw, 56px) / 1 var(--serif);
  letter-spacing: -0.02em;
  transition: color 0.25s;
}

.item__text {
  color: var(--muted);
}

.item__url {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 500 14px/1 var(--mono);
}

.item__arrow {
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.badge {
  padding: 5px 10px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.02em;
  color: var(--muted);
}

/* Скриншоты */

.item__media {
  position: relative;
  display: block;
}

.shot {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-2);
  box-shadow: var(--shadow);
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

/* Портфолио: стопка из трёх скриншотов */
.item__media--deck {
  isolation: isolate;
}

.item__media--deck .shot--back1,
.item__media--deck .shot--back2 {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.item__media--deck .shot--back1 {
  transform: translate(-2%, -6%) rotate(-2.5deg) scale(0.96);
}

.item__media--deck .shot--back2 {
  z-index: -2;
  transform: translate(2%, -12%) rotate(2.5deg) scale(0.92);
}

/* Наведение */

@media (hover: hover) {
  .item__link:hover .item__title {
    color: var(--accent);
  }

  .item__link:hover .item__arrow {
    transform: translateX(6px);
  }

  .item__link:hover .shot {
    transform: translateY(-6px) rotate(-0.6deg);
  }

  .item__link:hover .item__media--deck .shot--back1 {
    transform: translate(-5%, -8%) rotate(-4deg) scale(0.96);
  }

  .item__link:hover .item__media--deck .shot--back2 {
    transform: translate(5%, -15%) rotate(4.5deg) scale(0.92);
  }
}

/* Подвал */

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 28px 0 40px;
  border-top: 1.5px solid var(--ink);
  font: 500 13px/1.4 var(--mono);
  color: var(--muted);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
}

/* Планшет и телефон */

@media (max-width: 900px) {
  .intro {
    grid-template-columns: 1fr;
  }

  .item__link {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .item__media {
    grid-column: 2;
    max-width: 560px;
  }
}

@media (max-width: 560px) {
  .top {
    flex-direction: column;
    gap: 14px;
  }

  .item__link {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .item__num {
    padding-top: 0;
  }

  .item__media {
    grid-column: 1;
  }

  .item__media--deck .shot--back1 {
    transform: translate(-1%, -5%) rotate(-2deg) scale(0.96);
  }

  .item__media--deck .shot--back2 {
    transform: translate(1%, -10%) rotate(2deg) scale(0.92);
  }
}

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

  .shot,
  .item__arrow,
  .item__title {
    transition: none;
  }
}
