/* ===== Fonts ===== */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/static/fonts/manrope-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/static/fonts/manrope-cyrillic-400-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* Метрически совместимый фолбэк — текст не сдвигает вёрстку до загрузки шрифта */
@font-face {
  font-family: "Manrope Fallback";
  src: local("Arial");
  size-adjust: 104%;
  ascent-override: 92%;
  descent-override: 24%;
  line-gap-override: 0%;
}

/* ===== Tokens ===== */
:root {
  --bg-page: #1d201b;
  --bg-card: #282c25;
  --bg-card-soft: #242822;
  --accent: #d9a05b;
  --accent-hover: #e5b477;
  --brand: #a8c3a0;
  --text-primary: #f4f1ea;
  --text-muted: #b6bcb0;
  --line: rgba(244, 241, 234, 0.12);
  --font-body: "Manrope", "Manrope Fallback", system-ui, sans-serif;
  --font-heading: "Manrope", "Manrope Fallback", system-ui, sans-serif;
  --radius: 14px;
  --container: 72rem;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, a { font: inherit; }

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

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--bg-page);
  padding: 0.75rem 1rem;
  border-radius: 0 0 8px 0;
  z-index: 100;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { left: 0; }

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-page);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}
.brand__mark {
  width: 1.6rem;
  height: 1.6rem;
  color: var(--accent);
}
.brand__mark svg { width: 100%; height: 100%; }
.brand__name {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.btn--large {
  background: var(--accent);
  color: #211b12;
  padding: 1rem 1.75rem;
  font-size: 1.1rem;
  flex-direction: column;
  line-height: 1.4;
  gap: 0.15rem;
}
.btn--large:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn__hint {
  font-size: 0.8rem;
  font-weight: 500;
  opacity: 0.85;
}
.btn--small {
  background: var(--accent);
  color: #211b12;
  padding: 0.55rem 1.25rem;
  font-size: 0.95rem;
}
.btn--small:hover { background: var(--accent-hover); }
.btn--ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--line);
  padding: 0.9rem 1.5rem;
  font-size: 1rem;
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: min(92vh, 56rem);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  padding-block: 6rem 4rem;
}
.hero__bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #2a2c24 0%, #1d201b 60%, #191b16 100%);
}
.hero__bg picture, .hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero__overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(29, 32, 27, 0.55) 0%, rgba(29, 32, 27, 0.35) 40%, rgba(29, 32, 27, 0.92) 82%, var(--bg-page) 100%),
    linear-gradient(90deg, rgba(29, 32, 27, 0.7) 0%, rgba(29, 32, 27, 0.2) 100%);
}
.hero__content {
  position: relative;
  z-index: 2;
  max-width: 44rem;
}
.hero__hours {
  display: inline-block;
  font-size: 0.9rem;
  color: var(--brand);
  letter-spacing: 0.02em;
  margin-bottom: 1.25rem;
}
.hero__title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: clamp(2rem, 6vw, 3.5rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin-bottom: 1.25rem;
}
.hero__subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 36rem;
  margin-bottom: 2rem;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

/* ===== Sections ===== */
.section { padding-block: 4.5rem; }
.section-head { margin-bottom: 2.5rem; max-width: 40rem; }
.section-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
}
.section-lead { color: var(--text-muted); font-size: 1.05rem; }

/* ===== Schedule table (desktop) ===== */
.schedule-table-wrap {
  display: none;
  overflow-x: auto;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.schedule-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.schedule-table thead th {
  text-align: left;
  padding: 0.9rem 1.25rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.schedule-table tbody th {
  text-align: left;
  padding: 1rem 1.25rem;
  vertical-align: top;
  font-weight: 600;
  border-bottom: 1px solid var(--line);
}
.schedule-table td {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.schedule-table tbody tr:last-child th,
.schedule-table tbody tr:last-child td { border-bottom: none; }
.day-name { display: inline; font-weight: 700; }
.day-full { display: none; color: var(--text-muted); font-weight: 500; }
.class-time { font-weight: 600; color: var(--accent); white-space: nowrap; }
.class-name { font-weight: 600; }
.class-teacher { color: var(--text-muted); white-space: nowrap; }
.class-dur { color: var(--text-muted); white-space: nowrap; }
.class-row.morning .class-time { color: var(--accent); }
.class-row.evening .class-time { color: var(--brand); }

/* Дыхание: текущий день — пульсирующая линия */
.class-row.is-today {
  background: linear-gradient(90deg, rgba(217, 160, 91, 0.10), transparent 70%);
  position: relative;
}
.class-row.is-today td:first-of-type,
.class-row.is-today th[scope="row"] { box-shadow: inset 3px 0 0 var(--accent); }

/* День-выходной */
.day-off { color: var(--text-muted); }
.day-off__note { font-style: italic; color: var(--text-muted); }

.breath { width: 40px; height: 6px; color: var(--accent); flex-shrink: 0; }
.breath--short path { }
.breath--long { width: 52px; }
.class-dur { display: inline-flex; align-items: center; gap: 0.5rem; }

/* ===== Schedule cards (mobile) ===== */
.schedule-cards { display: flex; flex-direction: column; gap: 1.5rem; }
.day-card { display: block; }
.day-card__head {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}
.day-card__head .day-name { font-size: 1.1rem; }
.day-card__head .day-full { color: var(--text-muted); font-size: 0.95rem; }
.today-tag {
  margin-left: auto;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  padding: 0.15rem 0.6rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
}
.day-card--off .day-card__head { margin-bottom: 0; }

.mat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 1.1rem 1.25rem;
  margin-bottom: 0.75rem;
  position: relative;
  /* простроченный край коврика */
  box-shadow: inset 0 0 0 1px rgba(244, 241, 234, 0.02);
}
.mat-card::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px dashed rgba(244, 241, 234, 0.14);
  border-radius: 9px;
  pointer-events: none;
}
.mat-card.morning {
  background: linear-gradient(150deg, #2c2a1f 0%, var(--bg-card) 55%);
}
.mat-card.evening {
  background: linear-gradient(150deg, #232a26 0%, var(--bg-card) 55%);
}
.mat-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.mat-card__name { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.25rem; }

.day-card.is-today .day-card__head .day-name { color: var(--accent); }

/* ===== Pricing ===== */
.price-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
.price-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.price-card--highlight {
  background: linear-gradient(150deg, rgba(217, 160, 91, 0.18), var(--bg-card) 60%);
  border-color: var(--accent);
}
.price-card__badge {
  align-self: flex-start;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #211b12;
  background: var(--accent);
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-weight: 600;
}
.price-card__name { font-size: 1rem; font-weight: 600; color: var(--text-muted); }
.price-card__value {
  font-family: var(--font-heading);
  font-size: 2.4rem;
  font-weight: 600;
  line-height: 1.4;
}
.price-card__note { color: var(--text-muted); font-size: 0.95rem; }

.payment-note {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.5rem;
  color: var(--text-primary);
  font-weight: 600;
}
.payment-note .ico { width: 1.3rem; height: 1.3rem; color: var(--brand); flex-shrink: 0; }

/* ===== Team ===== */
.team-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
.teacher-card { text-align: left; }
.teacher-card__photo {
  aspect-ratio: 3 / 4;
  border-radius: 999px 999px var(--radius) var(--radius);
  overflow: hidden;
  background: linear-gradient(160deg, #2c2f28, #22251f);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  transition: transform 0.3s ease;
}
.teacher-card__photo img { width: 100%; height: 100%; object-fit: cover; }
.teacher-card__initials {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 600;
  color: var(--accent);
}
.teacher-card__name { font-family: var(--font-heading); font-size: 1.35rem; font-weight: 600; }
.teacher-card__specialty { color: var(--brand); font-weight: 600; font-size: 0.95rem; margin: 0.25rem 0 0.5rem; }
.teacher-card__bio { color: var(--text-muted); font-size: 0.95rem; }

/* ===== Contact ===== */
.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.contact-card__row {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.contact-card__row .ico { width: 1.5rem; height: 1.5rem; color: var(--accent); flex-shrink: 0; margin-top: 0.15rem; }
.contact-card__label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}
.contact-card__value { font-weight: 600; }
.contact-card__phone {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
}
.contact-card__phone:hover { color: var(--accent); }

.contact-cta { margin-top: 2rem; text-align: center; }
.contact-cta .btn { min-width: 16rem; }

/* ===== Lead form ===== */
.lead-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  max-width: 34rem;
}
.lead-form { position: relative; display: flex; flex-direction: column; gap: 1.1rem; }
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field label { font-size: 0.9rem; font-weight: 600; color: var(--text-primary); }
.field input,
.field textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--bg-page);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text-primary);
  font: inherit;
  font-size: 1rem;
  line-height: 1.5;
  transition: border-color 0.2s ease;
}
.field textarea { resize: vertical; min-height: 6rem; }
.field input::placeholder,
.field textarea::placeholder { color: var(--text-muted); opacity: 0.7; }
.field input:focus,
.field textarea:focus { outline: none; border-color: var(--accent); }
.field__error { font-size: 0.85rem; line-height: 1.4; color: #f2a48c; min-height: 1.1em; }
.field--hidden {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.lead-status {
  border-radius: 10px;
  padding: 0.9rem 1rem;
  font-size: 0.95rem;
  line-height: 1.5;
  font-weight: 600;
}
.lead-status--ok { background: rgba(168, 195, 160, 0.16); color: var(--brand); border: 1px solid rgba(168, 195, 160, 0.4); }
.lead-status--err { background: rgba(242, 164, 140, 0.12); color: #f2a48c; border: 1px solid rgba(242, 164, 140, 0.4); }
.btn--submit { align-self: flex-start; }
.lead-form__note { color: var(--text-muted); font-size: 0.85rem; line-height: 1.5; }

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 2.5rem;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: center;
}
.brand--footer .brand__name { font-size: 1.5rem; }
.footer__copy, .footer__hours { color: var(--text-muted); font-size: 0.9rem; }

/* ===== Media queries ===== */
@media (min-width: 40rem) {
  .container { padding-inline: 2rem; }
  .section { padding-block: 5.5rem; }
  .price-grid { grid-template-columns: repeat(2, 1fr); }
  .team-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-inner { flex-direction: row; align-items: center; justify-content: space-between; text-align: left; }
}

@media (min-width: 48rem) {
  .schedule-table-wrap { display: block; }
  .schedule-cards { display: none; }
  .day-full { display: inline; margin-left: 0.5rem; }
}

@media (min-width: 60rem) {
  .price-grid { grid-template-columns: repeat(4, 1fr); }
  .price-card { padding: 2rem 1.5rem; }
}

/* ===== Motion ===== */
@keyframes breathe {
  0%, 100% { opacity: 0.5; transform: scaleX(1); }
  50% { opacity: 1; transform: scaleX(1.15); }
}
.class-row.is-today .breath,
.day-card.is-today .day-card__head { animation: breathe 3s ease-in-out infinite; }
.day-card.is-today .day-card__head { transform-origin: left; }

@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;
  }
  .class-row.is-today .breath,
  .day-card.is-today .day-card__head { animation: none; }
  .teacher-card__photo:hover { transform: none; }
}

@media (hover: hover) {
  .teacher-card__photo:hover { transform: scale(1.03); }
}
