/* ==========================================================================
   pages.css — блоки страниц: главная, услуги, портфолио, блог, новости, контакты
   ========================================================================== */

/* --------------------------------------------------------------------------
   Главная: первый экран
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  padding-block: clamp(36px, 6vw, 84px) clamp(56px, 8vw, 104px);
  background-image: radial-gradient(circle, color-mix(in srgb, var(--ink) 16%, transparent) 1.2px, transparent 1.6px);
  background-size: 26px 26px;
  overflow: hidden;
}

.hero__grid {
  display: grid;
  gap: clamp(40px, 6vw, 64px);
  align-items: center;
}

@media (min-width: 960px) {
  .hero__grid {
    grid-template-columns: 1.12fr 0.88fr;
  }
  .hero__stage {
    margin-top: 0;
  }
}

.hero__status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  padding: 7px 16px 7px 12px;
  background: var(--surface);
  border: var(--bw) solid var(--line);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
}

.hero__status::before {
  content: "";
  width: 10px;
  height: 10px;
  background: #1fbf75;
  border-radius: 50%;
  box-shadow: 0 0 0 3px color-mix(in srgb, #1fbf75 30%, transparent);
}

.hero__title {
  margin-bottom: 22px;
  hyphens: manual;
}

.hero__lead {
  margin-bottom: 30px;
  font-size: var(--fs-lead);
  color: var(--muted);
  max-width: 54ch;
}

.ticks {
  display: grid;
  gap: 12px;
  margin: 34px 0 0;
  padding: 0;
  list-style: none;
}

.ticks li {
  position: relative;
  padding-left: 36px;
  font-weight: 500;
}

.ticks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.1em;
  width: 24px;
  height: 24px;
  background: var(--canary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2314172e' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 18px no-repeat;
  border: var(--bw) solid var(--line);
  border-radius: 50%;
}

.hero__stage {
  position: relative;
  margin-top: 60px;
  max-width: 460px;
  margin-inline: auto;
  width: 100%;
  padding: 10px 14px 40px 0;
}

.hero__stage::before {
  content: "";
  position: absolute;
  inset: -18px -18px 10px 26px;
  background: var(--canary);
  border: var(--bw) solid var(--line);
  border-radius: var(--r-l);
  transform: rotate(3.5deg);
}

.hero__stage .receipt {
  transform: rotate(-1.4deg);
}

.badge {
  position: absolute;
  z-index: 3;
  top: -86px;
  right: 10px;
  left: auto;
  width: 96px;
  height: 96px;
  width: 124px;
  height: 124px;
  color: var(--on-night);
}

.badge__spin {
  transform-origin: 62px 62px;
  animation: badge-spin 28s linear infinite;
}

@media (min-width: 960px) {
  .badge {
    top: -96px;
    right: auto;
    left: 24px;
    width: 124px;
    height: 124px;
  }
}

.badge__disc {
  fill: var(--cobalt);
  stroke: var(--line);
  stroke-width: 2;
}

.badge__ring {
  fill: #ffffff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: 0.06em;
}

.badge__core {
  fill: var(--canary);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 19px;
  text-anchor: middle;
}

@keyframes badge-spin {
  to {
    transform: rotate(360deg);
  }
}

/* --------------------------------------------------------------------------
   Главная: 18 лет в вебе
   -------------------------------------------------------------------------- */
.eras {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

.era {
  position: relative;
  padding: 0 0 34px 34px;
  border-left: 2px dashed #5b62a6;
}

.era::before {
  content: "";
  position: absolute;
  left: -9px;
  top: 6px;
  width: 16px;
  height: 16px;
  background: var(--canary);
  border: 2px solid var(--night);
  outline: 2px solid var(--canary);
  border-radius: 50%;
}

.era:last-child {
  padding-bottom: 0;
  border-left-color: transparent;
}

.era__year {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.4rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--canary);
}

.era__title {
  margin: 6px 0 8px;
  font-size: 1.05rem;
}

.era__text {
  color: #c4c8ee;
  font-size: 0.96rem;
  max-width: 34ch;
}

@media (min-width: 900px) {
  .eras {
    grid-template-columns: repeat(3, 1fr);
    gap: 44px 36px;
  }
  .era {
    padding: 28px 0 0;
    border-left: 0;
    border-top: 2px dashed #5b62a6;
  }
  .era::before {
    left: 0;
    top: -9px;
  }
  .era:last-child {
    border-top-color: #5b62a6;
  }
}

.section--night .btn {
  --shade: #3340ff;
}

/* --------------------------------------------------------------------------
   Услуги: сетка разных по размеру плиток
   -------------------------------------------------------------------------- */
.bento {
  display: grid;
  gap: clamp(18px, 3vw, 28px);
}

@media (min-width: 900px) {
  .bento {
    grid-template-columns: repeat(12, 1fr);
  }
  .bento > .span-7 { grid-column: span 7; }
  .bento > .span-5 { grid-column: span 5; }
  .bento > .span-6 { grid-column: span 6; }
}

.service__title {
  font-size: clamp(1.2rem, 1rem + 0.9vw, 1.65rem);
}

.service__text {
  max-width: 46ch;
}

.card--cobalt .tag,
.card--night .tag {
  border-color: rgba(255, 255, 255, 0.6);
}

.service-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.service-list li {
  position: relative;
  padding-left: 22px;
}

.service-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 10px;
  height: 10px;
  background: currentColor;
  border-radius: 2px;
  transform: rotate(45deg);
}

/* Подробные блоки услуг */
.service-detail {
  display: grid;
  gap: 22px 40px;
  padding-block: clamp(28px, 5vw, 48px);
  border-top: var(--bw) solid var(--line);
}

.service-detail:first-of-type {
  border-top: 0;
}

@media (min-width: 900px) {
  .service-detail {
    grid-template-columns: 0.9fr 1.1fr;
  }
}

.service-detail__aside {
  display: grid;
  gap: 16px;
  align-content: start;
}

.price-box {
  display: grid;
  gap: 4px;
  padding: 18px 20px;
  background: var(--canary);
  color: var(--on-color);
  border: var(--bw) solid var(--line);
  border-radius: var(--r-m);
  box-shadow: 5px 5px 0 var(--shade);
  font-variant-numeric: tabular-nums;
}

.price-box strong {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 1rem + 1vw, 1.7rem);
  line-height: 1.15;
}

.price-box span {
  font-size: 0.9rem;
}

.two-col {
  display: grid;
  gap: clamp(28px, 5vw, 56px);
  align-items: start;
}

@media (min-width: 900px) {
  .two-col {
    grid-template-columns: 1fr 1fr;
  }
}

.steps {
  display: grid;
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  min-height: 48px;
  padding-left: 66px;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  background: var(--canary);
  color: var(--on-color);
  border: var(--bw) solid var(--line);
  border-radius: 14px 14px 14px 4px;
  box-shadow: 3px 3px 0 var(--shade);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
}

.steps h3 {
  margin-bottom: 4px;
  font-size: 1.1rem;
}

.steps p {
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Портфолио
   -------------------------------------------------------------------------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-bottom: 32px;
}

.filter-bar__search {
  flex: 1 1 240px;
  max-width: 340px;
}

.grid-cards {
  display: grid;
  gap: clamp(22px, 3vw, 34px);
}

@media (min-width: 700px) {
  .grid-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1040px) {
  .grid-cards--3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.project {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 14px 14px 22px;
  background: var(--surface);
  border: var(--bw) solid var(--line);
  border-radius: var(--r-m);
  box-shadow: 6px 6px 0 var(--shade);
}

.project[hidden],
.post-card[hidden] {
  display: none;
}

.project__body {
  display: grid;
  gap: 12px;
  padding-inline: 8px;
}

.project__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 0.88rem;
  color: var(--muted);
}

.project__result {
  padding: 12px 14px;
  background: var(--mint);
  color: var(--on-color);
  border: var(--bw) solid var(--line);
  border-radius: var(--r-s);
  font-weight: 600;
  font-size: 0.95rem;
}

.project dl {
  display: grid;
  gap: 8px;
  font-size: 0.95rem;
}

.project dt {
  font-weight: 700;
}

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

.empty-state {
  padding: 28px;
  border: var(--bw) dashed var(--line);
  border-radius: var(--r-m);
  text-align: center;
}

.empty-state[hidden] {
  display: none;
}

/* --------------------------------------------------------------------------
   Блог
   -------------------------------------------------------------------------- */
.post-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 14px 14px 24px;
  background: var(--surface);
  border: var(--bw) solid var(--line);
  border-radius: var(--r-m);
  box-shadow: 6px 6px 0 var(--shade);
}

.post-card__body {
  display: grid;
  gap: 10px;
  padding-inline: 8px;
}

.post-card__title a {
  color: var(--ink);
  text-decoration: none;
}

.post-card__title a:hover {
  text-decoration: underline;
  text-decoration-thickness: 0.1em;
}

.post-card__title a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.post-card {
  position: relative;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 0.88rem;
  color: var(--muted);
}

.post-card--featured {
  display: grid;
  gap: 24px;
}

@media (min-width: 900px) {
  .post-card--featured {
    grid-template-columns: 1.05fr 1fr;
    align-items: center;
    padding: 16px;
  }
  .post-card--featured .post-card__title {
    font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  }
}

.blog-layout {
  display: grid;
  gap: clamp(36px, 6vw, 64px);
}

@media (min-width: 1000px) {
  .blog-layout {
    grid-template-columns: minmax(0, 1fr) 340px;
    align-items: start;
  }
  .blog-aside {
    position: sticky;
    top: calc(var(--header-h) + 24px);
  }
}

.blog-aside {
  display: grid;
  gap: 28px;
}

.mini-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mini-list li {
  padding-block: 14px;
  border-bottom: 2px dashed var(--line);
}

.mini-list li:first-child {
  padding-top: 0;
}

.mini-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.mini-list time {
  display: block;
  margin-bottom: 2px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.mini-list a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.mini-list a:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Новости: строки с датой-штампом
   -------------------------------------------------------------------------- */
.news-list {
  display: grid;
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.news-item {
  position: relative;
  display: grid;
  gap: 14px 24px;
  padding: 20px;
  background: var(--surface);
  border: var(--bw) solid var(--line);
  border-radius: var(--r-m);
  box-shadow: 5px 5px 0 var(--shade);
}

@media (min-width: 640px) {
  .news-item {
    grid-template-columns: 96px 1fr;
    align-items: start;
  }
}

.stamp {
  display: grid;
  justify-items: center;
  align-content: center;
  width: 88px;
  padding: 10px 6px;
  background: var(--canary);
  color: var(--on-color);
  border: var(--bw) solid var(--line);
  border-radius: 14px 14px 14px 4px;
  font-family: var(--font-display);
  line-height: 1.1;
  text-align: center;
}

.stamp strong {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.stamp span {
  font-size: 0.78rem;
  font-weight: 600;
}

.news-item h2,
.news-item h3 {
  margin-bottom: 8px;
  font-size: clamp(1.1rem, 1rem + 0.5vw, 1.35rem);
}

.news-item h2 a,
.news-item h3 a {
  color: var(--ink);
  text-decoration: none;
}

.news-item h2 a::after,
.news-item h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.news-item h2 a:hover,
.news-item h3 a:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Статья (блог и новости)
   -------------------------------------------------------------------------- */
.article-head {
  display: grid;
  gap: 18px;
  padding-block: clamp(24px, 4vw, 48px) clamp(24px, 4vw, 36px);
}

.article-head .lead {
  max-width: 60ch;
}

.prose {
  font-size: clamp(1.02rem, 0.98rem + 0.2vw, 1.125rem);
  line-height: 1.75;
}

.prose > * + * {
  margin-top: 1.1em;
}

.prose h2 {
  margin-top: 2em;
  font-size: clamp(1.35rem, 1.1rem + 1vw, 1.85rem);
}

.prose h3 {
  margin-top: 1.6em;
}

.prose p {
  max-width: none;
}

.prose ul,
.prose ol {
  display: grid;
  gap: 0.5em;
  padding-left: 1.4em;
}

.prose blockquote,
.callout {
  padding: 18px 22px;
  background: var(--mint);
  color: var(--on-color);
  border: var(--bw) solid var(--line);
  border-radius: var(--r-m);
  box-shadow: 5px 5px 0 var(--shade);
  font-weight: 500;
}

.callout--canary {
  background: var(--canary);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  background: var(--surface);
  border: var(--bw) solid var(--line);
}

.prose th,
.prose td {
  padding: 11px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 25%, transparent);
}

.prose th {
  background: var(--canary);
  color: var(--on-color);
  font-size: 0.85rem;
}

.table-wrap {
  overflow-x: auto;
}

.prose code {
  padding: 2px 6px;
  background: var(--surface-2);
  border-radius: 6px;
  font-family: var(--font-code);
  font-size: 0.9em;
}

.author-box {
  display: grid;
  gap: 16px;
  padding: 22px;
  background: var(--surface);
  border: var(--bw) solid var(--line);
  border-radius: var(--r-m);
  box-shadow: 5px 5px 0 var(--shade);
}

@media (min-width: 640px) {
  .author-box {
    grid-template-columns: auto 1fr auto;
    align-items: center;
  }
}

.author-box p {
  color: var(--muted);
  font-size: 0.95rem;
}

.related {
  display: grid;
  gap: 20px;
}

/* --------------------------------------------------------------------------
   Призыв к действию
   -------------------------------------------------------------------------- */
.cta-band {
  position: relative;
  padding-block: clamp(48px, 8vw, 96px);
  background: var(--cobalt);
  color: var(--on-cobalt);
  overflow: hidden;
}

.cta-band::before {
  content: "";
  position: absolute;
  right: -90px;
  top: -90px;
  width: 280px;
  height: 280px;
  border: 28px solid var(--canary);
  border-radius: 50%;
  opacity: 0.9;
}

.cta-band__inner {
  position: relative;
  display: grid;
  gap: 28px;
  max-width: 860px;
}

.cta-band h2 {
  font-size: clamp(1.6rem, 1.1rem + 2.4vw, 3rem);
}

.cta-band p {
  font-size: var(--fs-lead);
  opacity: 0.92;
}

.cta-band .btn {
  --shade: #14172e;
  --line: #14172e;
}

.cta-band .btn--plain {
  color: #14172e;
  background: #fff;
}

/* --------------------------------------------------------------------------
   Контакты
   -------------------------------------------------------------------------- */
.contact-grid {
  display: grid;
  gap: clamp(32px, 5vw, 56px);
}

@media (min-width: 960px) {
  .contact-grid {
    grid-template-columns: 0.85fr 1.15fr;
    align-items: start;
  }
}

.contact-list {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  background: var(--surface);
  color: var(--ink);
  border: var(--bw) solid var(--line);
  border-radius: var(--r-m);
  box-shadow: 4px 4px 0 var(--shade);
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.contact-link:hover {
  transform: translate(-1px, -1px);
  box-shadow: 6px 6px 0 var(--shade);
}

.contact-link__icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: none;
  background: var(--canary);
  color: var(--on-color);
  border: var(--bw) solid var(--line);
  border-radius: 12px 12px 12px 4px;
}

.contact-link__icon svg {
  width: 22px;
  height: 22px;
}

.contact-link strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.contact-link span {
  font-size: 0.88rem;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   404 и юридические страницы
   -------------------------------------------------------------------------- */
.error-page {
  display: grid;
  gap: 36px;
  align-items: center;
  padding-block: clamp(48px, 8vw, 110px);
}

@media (min-width: 900px) {
  .error-page {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

.error-page__code {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(5rem, 3rem + 12vw, 11rem);
  line-height: 0.9;
  letter-spacing: -0.06em;
  color: var(--cobalt);
  -webkit-text-stroke: 0;
}

:root[data-theme="dark"] .error-page__code {
  color: var(--canary);
}

.legal h2 {
  margin-top: 1.6em;
  font-size: clamp(1.2rem, 1.05rem + 0.6vw, 1.5rem);
}

.legal p,
.legal ul {
  margin-top: 0.8em;
}

/* Тонкая страница-заголовок для внутренних разделов */
.page-hero {
  padding-block: clamp(28px, 5vw, 64px) clamp(32px, 5vw, 56px);
  background-image: radial-gradient(circle, color-mix(in srgb, var(--ink) 14%, transparent) 1.2px, transparent 1.6px);
  background-size: 26px 26px;
  border-bottom: var(--bw) solid var(--line);
}

.page-hero__inner {
  display: grid;
  gap: 18px;
}

.page-hero .lead {
  max-width: 62ch;
}

.stack {
  display: grid;
  gap: 18px;
}

.stack--lg {
  gap: 28px;
}

.tech-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.note-box {
  padding: 20px 22px;
  background: var(--surface);
  border: var(--bw) dashed var(--line);
  border-radius: var(--r-m);
}

.note-box h3 {
  margin-bottom: 8px;
}

/* Дополнения */
.title-m {
  font-size: var(--fs-h3);
  font-weight: 600;
  line-height: 1.2;
}

.section__more {
  margin-top: clamp(28px, 4vw, 44px);
}

.note-box__more {
  margin-top: 16px;
  font-size: 0.95rem;
}

.article-body {
  margin-top: clamp(24px, 4vw, 40px);
  margin-bottom: clamp(32px, 5vw, 56px);
}

.article-cover {
  aspect-ratio: 21 / 8;
}

.article-back {
  margin-bottom: clamp(32px, 5vw, 56px);
}

.error-page .hero__stage {
  max-width: 420px;
}

.error-page .hero__stage .receipt {
  transform: rotate(1.6deg);
}

.note-box > * + * {
  margin-top: 12px;
}

.prose td:nth-child(2),
.prose th:nth-child(2) {
  white-space: nowrap;
}
