/* =========================================================
   «Легенда» — автотехцентр. Направление: «Стенд с инструментами»
   ========================================================= */

:root {
  /* palette */
  --steel-950: #0e0f10;
  --steel-900: #17181a;
  --steel-800: #1c1d1f;
  --steel-700: #26282b;
  --steel-600: #34373b;
  --steel-500: #6b7280;
  --steel-300: #9aa1a6;
  --paper-100: #f3eee0;
  --paper-050: #f8f5ec;
  --yellow-500: #f5b301;
  --yellow-600: #d99700;
  --yellow-050: #fff4d6;
  --ink-900: #0e0f10;
  --line-soft: rgba(243, 238, 224, 0.14);
  --line-strong: rgba(243, 238, 224, 0.28);

  /* type */
  --font-display: "Oswald", "Arial Narrow", sans-serif;
  --font-body: "Manrope", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  /* scale */
  --step-0: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --step-1: clamp(1.125rem, 1.05rem + 0.4vw, 1.375rem);
  --step-2: clamp(1.375rem, 1.25rem + 0.6vw, 1.75rem);
  --step-3: clamp(1.75rem, 1.5rem + 1.2vw, 2.5rem);
  --step-4: clamp(2.25rem, 1.8rem + 2vw, 3.5rem);
  --step-5: clamp(2.75rem, 2rem + 3.2vw, 4.75rem);

  --space-1: 0.5rem;
  --space-2: 0.75rem;
  --space-3: 1.25rem;
  --space-4: 2rem;
  --space-5: 3.25rem;
  --space-6: 5rem;
  --space-7: 7.5rem;

  --radius-s: 6px;
  --radius-m: 12px;
  --container: 1200px;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--steel-800);
  color: var(--paper-100);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1.05;
}

p {
  margin: 0;
  max-width: 68ch;
}

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

button {
  font: inherit;
  color: inherit;
}

/* selection / caret / focus theming — browser surfaces belong to the world too */
::selection {
  background: var(--yellow-500);
  color: var(--ink-900);
}

:focus-visible {
  outline: 2px solid var(--yellow-500);
  outline-offset: 3px;
  border-radius: 3px;
}

.container {
  width: min(100% - 2.5rem, var(--container));
  margin-inline: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--yellow-500);
  color: var(--ink-900);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-s);
  font-weight: 700;
  z-index: 200;
  transition: top 0.2s var(--ease-out-expo);
}

.skip-link:focus {
  top: 1rem;
}

/* ---------- tag / label vocabulary (engraved plate) ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--steel-950);
  background: var(--paper-100);
  border-radius: 3px;
  padding: 0.3em 0.6em;
}

.tag--yellow {
  background: var(--yellow-500);
}

.tag--ghost {
  background: transparent;
  color: var(--paper-100);
  border: 1px solid var(--line-strong);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  padding: 0.9em 1.5em;
  border-radius: var(--radius-s);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s var(--ease-out-expo), box-shadow 0.2s var(--ease-out-expo), background-color 0.2s;
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--yellow-500);
  color: var(--ink-900);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.15), 0 10px 24px -12px rgba(245, 179, 1, 0.65);
}

.btn--primary:hover {
  background: var(--yellow-600);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.15), 0 14px 30px -12px rgba(245, 179, 1, 0.75);
}

.btn--ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--paper-100);
}

.btn--ghost:hover {
  border-color: var(--yellow-500);
  color: var(--yellow-500);
}

.btn--sm {
  padding: 0.6em 1.1em;
  font-size: 0.85rem;
}

.icon {
  width: 1.1em;
  height: 1.1em;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* =========================================================
   Header — isolated CTA strip (raise: dark-first console discipline)
   ========================================================= */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background: rgba(14, 15, 16, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}

main#main {
  padding-top: var(--header-h, 65px);
}

.site-header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-block: 0.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
}

.brand__mark {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.brand__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--paper-050);
}

.site-nav {
  display: none;
}

@media (min-width: 960px) {
  .site-nav {
    display: flex;
    gap: 1.6rem;
  }

  .site-nav a {
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--steel-300);
    transition: color 0.2s;
  }

  .site-nav a:hover {
    color: var(--yellow-500);
  }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.header-actions .btn--ghost {
  display: none;
}

@media (min-width: 720px) {
  .header-actions .btn--ghost {
    display: inline-flex;
  }
}

/* =========================================================
   Hero — the shadow board
   ========================================================= */
.hero {
  position: relative;
  padding-block: var(--space-6) var(--space-5);
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 55% at 50% -6%, rgba(245, 179, 1, 0.16), transparent 60%),
    var(--steel-800);
}

.hero::before {
  /* pegboard perforation texture */
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(243, 238, 224, 0.09) 1.4px, transparent 1.6px);
  background-size: 28px 28px;
  background-position: 14px 14px;
  opacity: 0.5;
  pointer-events: none;
}

.hero__lamp {
  position: absolute;
  top: -18%;
  left: 50%;
  transform: translateX(-50%);
  width: min(900px, 120vw);
  height: 480px;
  background: radial-gradient(ellipse 50% 50% at 50% 0%, rgba(255, 209, 110, 0.22), transparent 70%);
  pointer-events: none;
}

.hero__inner {
  position: relative;
  display: grid;
  gap: var(--space-5);
}

.hero__intro {
  max-width: 100%;
}

.hero__title {
  font-size: var(--step-5);
  line-height: 1.2;
  color: var(--paper-050);
}

.hero__title em {
  font-style: normal;
  color: var(--yellow-500);
}

.hero__place {
  margin-top: var(--space-3);
}

.hero__lede {
  margin-top: var(--space-3);
  font-size: var(--step-1);
  color: var(--steel-300);
  max-width: 42ch;
}

.hero__actions {
  margin-top: var(--space-4);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero__meta {
  margin-top: var(--space-4);
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--steel-300);
}

.hero__meta strong {
  color: var(--yellow-500);
  font-weight: 600;
}

/* the board itself */
.board {
  position: relative;
  border-radius: var(--radius-m);
  background:
    linear-gradient(180deg, var(--steel-700), var(--steel-800) 60%);
  border: 1px solid var(--line-soft);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  padding: var(--space-4);
}

.board::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image: radial-gradient(circle, rgba(243, 238, 224, 0.10) 1.5px, transparent 1.7px);
  background-size: 34px 34px;
  background-position: 17px 17px;
  pointer-events: none;
}

.board__head {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px dashed var(--line-soft);
}

.board__head h2,
.board__head h3 {
  min-width: 0;
  color: var(--paper-050);
  font-size: var(--step-2);
}

.board__grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

@media (min-width: 620px) {
  .board__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .board__grid--wide {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* tool slot: the shadow outline that "fills" on interaction */
.slot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.55rem;
  padding: 1.1rem 0.75rem 0.9rem;
  border-radius: var(--radius-s);
  border: 1.5px dashed var(--line-strong);
  background: rgba(14, 15, 16, 0.25);
  cursor: default;
  transition: border-color 0.35s var(--ease-out-expo), background-color 0.35s var(--ease-out-expo), transform 0.35s var(--ease-out-expo);
}

.slot__peg {
  position: absolute;
  top: 0.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--steel-500);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.slot__icon {
  width: 2.4rem;
  height: 2.4rem;
  stroke: var(--steel-300);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.35s var(--ease-out-expo), transform 0.35s var(--ease-out-expo), filter 0.35s var(--ease-out-expo);
}

.slot__label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  color: var(--paper-100);
}

.slot:hover {
  border-color: var(--yellow-500);
  border-style: solid;
  background: rgba(245, 179, 1, 0.08);
  transform: translateY(-2px);
}

.slot:hover .slot__icon {
  stroke: var(--yellow-500);
  transform: scale(1.08);
  filter: drop-shadow(0 4px 10px rgba(245, 179, 1, 0.35));
}

.slot__btn {
  all: unset;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
}

.slot__btn:focus-visible {
  outline: 2px solid var(--yellow-500);
  outline-offset: 3px;
  border-radius: var(--radius-s);
}

/* =========================================================
   Section rhythm
   ========================================================= */
.section {
  padding-block: var(--space-6);
}

.section--tight {
  padding-block: var(--space-5);
}

.section__head {
  max-width: 46rem;
  margin-bottom: var(--space-4);
}

.section__head h2 {
  font-size: var(--step-3);
  color: var(--paper-050);
}

.section__head p {
  margin-top: var(--space-2);
  color: var(--steel-300);
  font-size: var(--step-1);
}

/* =========================================================
   Trust band — committed yellow field
   ========================================================= */
.trust {
  position: relative;
  background: var(--yellow-500);
  color: var(--ink-900);
  overflow: hidden;
}

.trust::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(14, 15, 16, 0.08) 1.4px, transparent 1.6px);
  background-size: 26px 26px;
  background-position: 13px 13px;
  pointer-events: none;
}

.trust__inner {
  position: relative;
  display: grid;
  gap: var(--space-4);
  padding-block: var(--space-5);
}

@media (min-width: 860px) {
  .trust__inner {
    grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
    align-items: center;
  }
}

.plaque {
  background: var(--ink-900);
  color: var(--paper-050);
  border-radius: var(--radius-m);
  padding: var(--space-4);
  border: 1px solid rgba(243, 238, 224, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.plaque__rating {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.plaque__rating strong {
  font-family: var(--font-display);
  font-size: var(--step-5);
  color: var(--yellow-500);
  line-height: 1;
}

.plaque__rating span {
  font-family: var(--font-mono);
  color: var(--steel-300);
  font-size: 0.85rem;
}

.plaque__stars {
  margin-top: 0.6rem;
  display: flex;
  gap: 0.2rem;
  color: var(--yellow-500);
}

.plaque__stars .icon {
  width: 1.1rem;
  height: 1.1rem;
  fill: currentColor;
  stroke: none;
}

.plaque__foot {
  margin-top: 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--steel-300);
}

.plaque__foot a {
  color: var(--paper-100);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.trust-points {
  display: grid;
  gap: 0.9rem;
}

@media (min-width: 560px) {
  .trust-points {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.trust-points li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-weight: 600;
}

.trust-points .icon {
  margin-top: 0.15rem;
  width: 1.3rem;
  height: 1.3rem;
}

/* =========================================================
   Typical cases — maintenance log strip
   ========================================================= */
.cases {
  display: grid;
  gap: 0.9rem;
}

.case {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  padding: var(--space-3);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-s);
  background: var(--steel-700);
}

@media (min-width: 720px) {
  .case {
    grid-template-columns: 9rem minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 1rem;
  }
}

.case__num {
  font-family: var(--font-mono);
  color: var(--yellow-500);
  font-size: 0.85rem;
  grid-column: 1 / -1;
}

@media (min-width: 720px) {
  .case__num {
    grid-column: auto;
  }
}

.case__stage {
  font-size: 0.92rem;
}

.case__stage b {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--steel-300);
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.case__attr {
  margin-top: var(--space-3);
  font-size: 0.8rem;
  color: var(--steel-300);
  font-style: normal;
}

/* =========================================================
   Gallery — pinned photos
   ========================================================= */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: var(--space-3) var(--space-3);
}

@media (min-width: 640px) {
  .gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.pin-photo {
  position: relative;
  background: var(--paper-050);
  padding: 0.5rem 0.5rem 1.1rem;
  border-radius: 2px;
  box-shadow: 0 16px 30px -16px rgba(0, 0, 0, 0.55);
  transform: rotate(var(--tilt, 0deg));
}

.pin-photo:nth-child(1) { --tilt: -1.6deg; }
.pin-photo:nth-child(2) { --tilt: 1.2deg; }
.pin-photo:nth-child(3) { --tilt: -0.8deg; }
.pin-photo:nth-child(4) { --tilt: 1.6deg; }
.pin-photo:nth-child(5) { --tilt: -1.2deg; }
.pin-photo:nth-child(6) { --tilt: 0.9deg; }

.pin-photo__clip {
  position: absolute;
  top: -0.6rem;
  left: 50%;
  transform: translateX(-50%);
  width: 1.6rem;
  height: 1rem;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--steel-300), var(--steel-500));
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.pin-photo img {
  width: 100%;
  height: auto;
  border-radius: 1px;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.pin-photo figcaption {
  margin-top: 0.5rem;
  color: var(--steel-950);
  font-family: var(--font-body);
  font-size: 0.78rem;
  text-align: center;
}

/* =========================================================
   Reviews — pinned notes
   ========================================================= */
.reviews {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .reviews {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 980px) {
  .reviews {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.note {
  position: relative;
  background: var(--paper-100);
  color: var(--steel-950);
  padding: var(--space-3);
  border-radius: 2px;
  box-shadow: 0 14px 26px -18px rgba(0, 0, 0, 0.6);
  transform: rotate(var(--tilt, 0deg));
}

.note:nth-child(3n+1) { --tilt: -0.9deg; }
.note:nth-child(3n+2) { --tilt: 0.7deg; }
.note:nth-child(3n+3) { --tilt: -0.4deg; }

.note::before {
  content: "";
  position: absolute;
  top: -0.55rem;
  left: 1.3rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--yellow-500);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35), inset 0 -2px 3px rgba(0, 0, 0, 0.15);
}

.note p {
  font-size: 0.95rem;
  max-width: none;
}

.note footer {
  margin-top: var(--space-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.note cite {
  font-style: normal;
  font-weight: 700;
  font-size: 0.85rem;
}

.note__source {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--steel-500);
}

.reviews-foot {
  margin-top: var(--space-4);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

/* =========================================================
   Location
   ========================================================= */
.location {
  display: grid;
  gap: var(--space-4);
}

@media (min-width: 860px) {
  .location {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.location__card {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-m);
  padding: var(--space-4);
  background: var(--steel-700);
}

.landmarks {
  margin-top: var(--space-3);
  display: grid;
  gap: 0.75rem;
}

.landmarks li {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-size: 0.92rem;
  color: var(--steel-300);
}

.landmarks .icon {
  margin-top: 0.15rem;
  color: var(--yellow-500);
}

.address-line {
  font-family: var(--font-display);
  font-size: var(--step-1);
  color: var(--paper-050);
  margin-top: var(--space-2);
}

.hours-note {
  margin-top: var(--space-3);
  display: inline-flex;
}

.location__actions {
  margin-top: var(--space-4);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* =========================================================
   Final CTA
   ========================================================= */
.final-cta {
  text-align: center;
  padding-block: var(--space-6);
}

.final-cta h2 {
  font-size: var(--step-4);
  color: var(--paper-050);
  max-width: 20ch;
  margin-inline: auto;
}

.final-cta__actions {
  margin-top: var(--space-4);
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.85rem;
}

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  border-top: 1px solid var(--line-soft);
  padding-block: var(--space-4);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--steel-300);
}

.site-footer__links {
  display: flex;
  gap: 1.1rem;
  flex-wrap: wrap;
}

.site-footer__links a {
  text-decoration: none;
  color: var(--steel-300);
}

.site-footer__links a:hover {
  color: var(--yellow-500);
}

.site-footer__demo {
  margin-top: var(--space-3);
  font-size: 0.78rem;
  color: var(--steel-500);
  text-align: center;
}

/* =========================================================
   Reveal-on-scroll (single authored motion moment)
   ========================================================= */
.reveal {
  opacity: 1;
  transform: none;
}

/* Hidden-until-revealed state only applies once script has run (html.js,
   set synchronously at the top of body) — without JS, or while it is still
   loading, content stays visible rather than stuck invisible. */
@media (prefers-reduced-motion: no-preference) {
  html.js .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.7s var(--ease-out-expo), transform 0.7s var(--ease-out-expo);
  }
  html.js .reveal.is-visible {
    opacity: 1;
    transform: none;
  }
}
