@import url('/fonts.css');

/* Палитра взята из логотипа: тёмно-синий «асфальт» и золото короны.
   Светлый холодный фон — бетонный пол мастерской. */
:root {
  --ink: #1B2430;
  --ink-2: #26323F;
  --ink-3: #3A4858;
  --gold: #D4A62A;
  --gold-deep: #8A6708;
  --paper: #ECEEF0;
  --surface: #FFFFFF;
  --steel: #556270;
  --line: #C9CFD6;
  --stop: #B5362A;
  --stop-on-dark: #FF9C8F;

  --display: 'Sofia Sans Extra Condensed', 'Arial Narrow', 'Roboto Condensed', sans-serif;
  --body: 'Golos Text', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --gutter: clamp(16px, 4vw, 48px);
  --section: clamp(64px, 9vw, 128px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 16px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--body); font-size: 1.0625rem; line-height: 1.55;
}
h1, h2, h3, p, ul, ol, dl, dd, fieldset { margin: 0; padding: 0; }
ul, ol { list-style: none; }
fieldset { border: 0; min-width: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg, iframe { display: block; max-width: 100%; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.booking :focus-visible, .foot :focus-visible, .next:focus-visible { outline-color: #fff; }

.wrap { max-width: 1280px; margin-inline: auto; padding-inline: var(--gutter); }

.skip { position: absolute; left: 12px; top: -80px; background: var(--ink); color: #fff; padding: 10px 16px; z-index: 10; }
.skip:focus { top: 12px; }

h2 {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(2.5rem, 5.4vw, 4.25rem); line-height: .95; letter-spacing: -.005em;
  text-wrap: balance;
}
h3 { font-family: var(--display); font-weight: 600; font-size: 1.75rem; line-height: 1.05; }

/* ───────── кнопки ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 56px; padding: 0 28px; border: 2px solid transparent; border-radius: 4px;
  font-family: var(--display); font-weight: 800; font-size: 1.5rem; letter-spacing: .01em;
  text-decoration: none; cursor: pointer; transition: transform .12s ease, background-color .15s ease;
}
.btn:active { transform: translateY(2px); }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-gold:hover { background: #E4B940; }
.btn-line { background: transparent; border-color: currentColor; }
.btn-line:hover { background: rgba(255, 255, 255, .08); }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: var(--ink-3); }
.btn-wide { width: 100%; }
.btn[disabled] { opacity: .55; cursor: progress; }

.link { font-weight: 600; text-underline-offset: 4px; text-decoration-thickness: 2px; text-decoration-color: var(--gold); }
.link:hover { text-decoration-color: currentColor; }

/* ───────── шапка ───────── */
.top-row { display: flex; align-items: center; gap: 32px; padding-block: 18px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-family: var(--display); font-weight: 600; font-size: 1.125rem; line-height: 1; }
.brand svg { width: 104px; height: auto; }
.nav { display: flex; gap: 28px; margin-left: auto; }
.nav a { text-decoration: none; font-weight: 500; padding-block: 6px; border-bottom: 2px solid transparent; }
.nav a:hover { border-bottom-color: var(--gold); }
.top-side { display: flex; align-items: center; gap: 20px; }
.lang { display: flex; border: 2px solid var(--ink); border-radius: 4px; overflow: hidden; }
.lang button { border: 0; background: transparent; padding: 6px 12px; font-weight: 600; font-size: .9375rem; cursor: pointer; }
.lang button[aria-pressed='true'] { background: var(--ink); color: var(--paper); }
.top-phone { font-family: var(--display); font-weight: 800; font-size: 1.625rem; text-decoration: none; white-space: nowrap; }
.top-phone:hover { color: var(--gold-deep); }

/* ───────── первый экран ───────── */
.hero { overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: center; gap: clamp(24px, 4vw, 64px); padding-block: clamp(40px, 6vw, 88px) clamp(48px, 7vw, 104px); }
h1 {
  font-family: var(--display); font-weight: 800; text-transform: uppercase;
  font-size: clamp(3.5rem, 8.6vw, 8rem); line-height: .86; letter-spacing: -.01em;
  text-wrap: balance;
}
.lede { margin-top: 28px; max-width: 46ch; font-size: 1.1875rem; color: var(--steel); }
.hero-actions { margin-top: 36px; display: flex; flex-wrap: wrap; align-items: center; gap: 20px 28px; }
.msgr { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.msgr a { font-weight: 600; text-underline-offset: 4px; text-decoration-thickness: 2px; text-decoration-color: var(--gold); }
.msgr a:hover { text-decoration-color: currentColor; }

.hero-mark { margin-right: calc(var(--gutter) * -1.5); }
.trace { width: 100%; height: auto; overflow: visible; }
.trace-fill { fill: var(--ink); }
.trace-line { fill: none; stroke: var(--ink); stroke-width: 5; stroke-linejoin: miter; }
.trace-crown { fill: var(--gold); transform-box: fill-box; transform-origin: 50% 100%; }

/* Единственная «самостоятельная» анимация на странице: контур логотипа прорисовывается,
   как кривая на осциллографе диагноста, затем заливается, и сверху садится корона. */
@media (prefers-reduced-motion: no-preference) {
  .trace-line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: trace 1.7s cubic-bezier(.6, .05, .25, 1) .15s forwards; }
  .trace-fill { opacity: 0; animation: fill-in .5s ease-out 1.65s forwards; }
  .trace-crown { opacity: 0; animation: crown 0.7s cubic-bezier(.3, 1.5, .5, 1) 2s forwards; }
  @keyframes trace { to { stroke-dashoffset: 0; } }
  @keyframes fill-in { to { opacity: 1; } }
  @keyframes crown { from { opacity: 0; transform: translateY(-70px) rotate(-7deg); } 35% { opacity: 1; } to { opacity: 1; transform: none; } }
}

/* Разметка пола мастерской */
.hazard { height: 12px; background: repeating-linear-gradient(-45deg, var(--gold) 0 16px, var(--ink) 16px 32px); }

.next { display: block; background: var(--ink); color: var(--paper); text-decoration: none; }
.next-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 24px; padding-block: 22px; }
.next-label { color: #B9C2CC; }
.next-value { font-family: var(--display); font-weight: 800; font-size: clamp(1.75rem, 3.4vw, 2.5rem); line-height: 1; color: var(--gold); }
.next-go { margin-left: auto; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; text-decoration-color: var(--gold); }
.next:hover .next-go { text-decoration-color: currentColor; }

/* ───────── услуги: доска работ ───────── */
.services { padding-block: var(--section); }
.services-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(24px, 5vw, 80px); align-items: start; }
.services-head { position: sticky; top: 24px; }
.services-head p { margin-top: 20px; color: var(--steel); max-width: 34ch; }
.board { border-top: 3px solid var(--ink); }
.board button {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: baseline; gap: 16px;
  width: 100%; padding: 18px 12px 18px 0; border: 0; border-bottom: 1px solid var(--line);
  background: transparent; text-align: left; cursor: pointer; position: relative;
  transition: padding-left .18s ease, background-color .18s ease;
}
.board button::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--gold); transform: scaleY(0); transition: transform .18s ease; }
.board button:hover, .board button:focus-visible { padding-left: 22px; background: var(--surface); }
.board button:hover::before, .board button:focus-visible::before { transform: scaleY(1); }
.board-name { font-size: 1.1875rem; font-weight: 500; }
.board-time { font-family: var(--display); font-weight: 800; font-size: 1.75rem; line-height: 1; white-space: nowrap; }
.board-go { font-weight: 600; font-size: .9375rem; color: var(--steel); min-width: 9ch; text-align: right; }
.board button:hover .board-go { color: var(--ink); }

/* ───────── запись: «приборная панель» ───────── */
.booking { background: var(--ink); color: var(--paper); padding-block: var(--section); }
.booking-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(300px, 4fr); gap: clamp(32px, 5vw, 80px); align-items: start; }
.booking h2 { margin-bottom: 40px; }
.steps { counter-reset: step; display: grid; gap: 48px; }
.step { counter-increment: step; position: relative; display: grid; gap: 18px; padding-left: 76px; }
.step::before { content: counter(step); position: absolute; left: 0; top: 0; font-family: var(--display); font-weight: 800; font-size: 4.5rem; line-height: .8; color: var(--gold); }
.step h3 { margin-bottom: 2px; }

.field { display: grid; gap: 8px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field label, .choice legend { font-size: .9375rem; color: #B9C2CC; }
.booking input[type='text'], .booking input[type='tel'], .booking select, .booking textarea {
  width: 100%; min-height: 52px; padding: 12px 14px; border-radius: 4px;
  background: var(--ink-2); border: 1px solid var(--ink-3); color: #fff;
}
.booking textarea { resize: vertical; min-height: 0; }
.booking select { appearance: none; padding-right: 44px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%23D4A62A' stroke-width='2.2'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; }
.booking select option { background: var(--ink-2); color: #fff; }
.booking ::placeholder { color: #8493A3; }
.booking input:focus, .booking select:focus, .booking textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold); }
.booking [aria-invalid='true'] { border-color: var(--stop-on-dark); }
.err, .form-error { color: var(--stop-on-dark); font-size: .9375rem; }
.hint { color: #B9C2CC; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.choice { display: flex; flex-wrap: wrap; gap: 8px; }
.choice legend { margin-bottom: 8px; }
.choice label { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; }
.choice span { display: block; padding: 11px 18px; border: 1px solid var(--ink-3); border-radius: 4px; background: var(--ink-2); font-weight: 500; }
.choice input:checked + span { background: var(--gold); border-color: var(--gold); color: var(--ink); font-weight: 600; }
.choice input:focus-visible + span { outline: 3px solid #fff; outline-offset: 2px; }

.days { display: flex; gap: 8px; overflow-x: auto; padding: 4px 4px 12px; margin: -4px; scrollbar-color: var(--ink-3) transparent; }
.day {
  flex: 0 0 68px; display: grid; justify-items: center; gap: 2px; padding: 10px 0 9px;
  border: 1px solid var(--ink-3); border-radius: 4px; background: var(--ink-2); cursor: pointer;
}
.day small { font-size: .8125rem; color: #B9C2CC; }
.day b { font-family: var(--display); font-weight: 800; font-size: 2rem; line-height: 1; }
.day[disabled] { opacity: .32; cursor: not-allowed; }
.day[aria-pressed='true'] { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.day[aria-pressed='true'] small { color: var(--ink); }

.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.slot {
  min-height: 48px; border: 1px solid var(--ink-3); border-radius: 4px; background: var(--ink-2); cursor: pointer;
  font-family: var(--display); font-weight: 600; font-size: 1.5rem; line-height: 1;
}
.slot:hover, .day:not([disabled]):hover { border-color: var(--gold); }
.slot[aria-pressed='true'] { background: var(--gold); border-color: var(--gold); color: var(--ink); font-weight: 800; }
@media (prefers-reduced-motion: no-preference) {
  .slot { animation: slot-in .22s ease-out backwards; animation-delay: calc(var(--i) * 18ms); }
  @keyframes slot-in { from { opacity: 0; transform: translateY(6px); } }
}

.ticket { position: sticky; top: 24px; display: grid; gap: 20px; padding: 28px; background: var(--ink-2); border-radius: 6px; border-top: 6px solid var(--gold); }
.gauge svg { width: 100%; max-width: 280px; margin-inline: auto; overflow: visible; }
.gauge .tick { stroke: #8493A3; stroke-width: 2; }
.gauge .tick-major { stroke: var(--paper); stroke-width: 3; }
.gauge text { fill: #B9C2CC; font-family: var(--display); font-weight: 600; font-size: 15px; text-anchor: middle; }
.needle { fill: var(--gold); transition: transform .9s cubic-bezier(.3, 1.45, .45, 1); }
@media (prefers-reduced-motion: reduce) { .needle { transition: none; } }
.ticket-rows { display: grid; gap: 14px; }
.ticket-rows div { display: grid; gap: 2px; padding-bottom: 14px; border-bottom: 1px solid var(--ink-3); }
.ticket-rows dt { font-size: .875rem; color: #B9C2CC; }
.ticket-rows dd { font-weight: 500; }
#tDuration { font-family: var(--display); font-weight: 800; font-size: 2.5rem; line-height: 1; color: var(--gold); }
.fine { font-size: .875rem; color: #B9C2CC; }

.done { grid-column: 1 / -1; max-width: 720px; }
.done h2 { margin: 20px 0 16px; }
.done-text { font-size: 1.25rem; max-width: 52ch; }
.done-actions { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 16px; }
.done-mark { width: 72px; height: 72px; fill: none; stroke: var(--gold); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
@media (prefers-reduced-motion: no-preference) {
  .done-mark circle { stroke-dasharray: 183; stroke-dashoffset: 183; animation: draw .6s ease-out forwards; }
  .done-mark path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .35s ease-out .5s forwards; }
  @keyframes draw { to { stroke-dashoffset: 0; } }
}

/* ───────── прайс-лист: рейка групп слева, цены справа ───────── */
.prices { background: var(--surface); padding-block: var(--section); }
.prices-head { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 16px clamp(24px, 5vw, 80px); align-items: end; margin-bottom: 40px; }
.prices-note { color: var(--steel); max-width: 60ch; }
.prices-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 24px clamp(24px, 5vw, 80px); align-items: start; }
.cats { position: sticky; top: 24px; display: grid; border-top: 3px solid var(--ink); }
.cat {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 14px 12px 14px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent;
  text-align: left; cursor: pointer; position: relative; transition: padding-left .18s ease;
}
.cat::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--gold); transform: scaleY(0); transition: transform .18s ease; }
.cat-name { font-weight: 500; }
.cat small { font-size: .875rem; color: var(--steel); white-space: nowrap; }
.cat:hover { padding-left: 14px; }
.cat[aria-pressed='true'] { padding-left: 22px; }
.cat[aria-pressed='true'] .cat-name { font-weight: 600; }
.cat[aria-pressed='true']::before, .cat:hover::before { transform: scaleY(1); }
.pricelist h3 { font-size: clamp(1.75rem, 3vw, 2.25rem); padding-bottom: 14px; border-bottom: 3px solid var(--ink); }
.price-row { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.price-name { display: grid; gap: 2px; font-size: 1.0625rem; font-weight: 500; }
.price-name small { font-size: .875rem; font-weight: 400; color: var(--steel); }
.price-value { font-family: var(--display); font-weight: 800; font-size: 1.75rem; line-height: 1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.price-value .pfx { font-weight: 600; font-size: 1.25rem; color: var(--steel); }
@media (prefers-reduced-motion: no-preference) {
  .price-row { animation: slot-in .24s ease-out backwards; animation-delay: calc(var(--i) * 22ms); }
}
.prices-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 32px; margin-top: 40px; }

/* ───────── отзывы ───────── */
.reviews { padding-block: var(--section); }
.reviews-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px 40px; margin-bottom: 48px; }
.rating { font-size: 1.125rem; color: var(--steel); }
.rating b { font-family: var(--display); font-weight: 800; font-size: 2.5rem; line-height: 1; color: var(--ink); margin-right: 6px; }
.review-list { columns: 3 300px; column-gap: 48px; margin-bottom: 40px; }
.review { break-inside: avoid; padding: 22px 0 34px; border-top: 3px solid var(--ink); }
.stars { display: flex; gap: 3px; margin-bottom: 14px; }
.stars svg { width: 20px; height: 20px; fill: var(--gold); }
.stars svg.off { fill: var(--line); }
.review blockquote { margin: 0 0 16px; font-size: 1.1875rem; line-height: 1.5; white-space: pre-line; }
.review footer { font-size: .9375rem; color: var(--steel); }
.review footer b { color: var(--ink); font-weight: 600; display: block; }

/* ───────── контакты ───────── */
.contact { padding-bottom: var(--section); }
.contact-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(24px, 5vw, 72px); align-items: stretch; }
.map { min-height: 460px; background: var(--line); border-radius: 6px; overflow: hidden; }
.map iframe { width: 100%; height: 100%; min-height: 460px; border: 0; }
.contact-info h2 { margin-bottom: 24px; }
.contact-info h3 { margin: 32px 0 10px; }
address { font-style: normal; font-size: 1.1875rem; max-width: 30ch; margin-bottom: 12px; }
.hours { display: grid; grid-template-columns: auto 1fr; gap: 4px 20px; }
.hours dt { color: var(--steel); }
.hours dd { font-weight: 500; font-variant-numeric: tabular-nums; }
.big-phone { display: inline-block; font-family: var(--display); font-weight: 800; font-size: clamp(2.5rem, 5vw, 3.5rem); line-height: 1; text-decoration: none; margin-bottom: 14px; }
.big-phone:hover { color: var(--gold-deep); }

/* ───────── подвал ───────── */
.foot { background: var(--ink); color: #B9C2CC; padding-block: 40px; font-size: .9375rem; }
.foot-row { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 40px; }
.foot-mark { width: 120px; height: auto; }
.foot-right { margin-left: auto; text-align: right; }

/* ───────── узкие экраны ───────── */
@media (max-width: 980px) {
  .nav { display: none; }
  .top-side { margin-left: auto; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-mark { order: -1; margin-right: 0; max-width: 520px; }
  .services-grid, .booking-grid, .contact-grid, .prices-grid, .prices-head { grid-template-columns: 1fr; }
  .services-head, .ticket, .cats { position: static; }
  .cats { display: flex; flex-wrap: wrap; gap: 8px; border-top: 0; }
  .cat { padding: 9px 14px !important; border: 1px solid var(--line); border-radius: 4px; gap: 8px; }
  .cat small { font-size: .8125rem; }
  .cat::before { display: none; }
  .cat[aria-pressed='true'] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
  .cat[aria-pressed='true'] small { color: #B9C2CC; }
  .map, .map iframe { min-height: 340px; }
}
@media (max-width: 560px) {
  body { font-size: 1rem; }
  .brand span { display: none; }
  .brand svg { width: 88px; }
  .top-row { gap: 12px; }
  .top-phone { font-size: 1.375rem; }
  .step { padding-left: 0; }
  .step::before { position: static; font-size: 3rem; margin-bottom: -6px; }
  .field-row { grid-template-columns: 1fr; }
  .board button { grid-template-columns: minmax(0, 1fr) auto; }
  .board-go { display: none; }
  .next-go { margin-left: 0; }
  .foot-right { margin-left: 0; text-align: left; }
  .btn { width: 100%; }
}
