:root {
  --white: #fff;
  --blue: #012169;
  --red: #c8102e;
  --red-dark: #a50d28;
  --secondary: #3b4a7a;
  --line: #dce5f0;
  --wash: #f3f7fc;
  --pink: #fbecef;
  --radius: 12px;
  --shadow: 0 8px 24px #0121690c;
  --gutter: clamp(1rem, 4vw, 3rem);
  /* ЗАМЕНИТЬ: при необходимости подключите локальный WOFF2 через @font-face. */
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--blue);
  background: var(--white);
  line-height: 1.55;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 7rem; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
img, iframe { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { line-height: 1.1; overflow-wrap: anywhere; }
h1 { max-width: 15ch; font-size: clamp(2.1rem, 5.1vw, 4.1rem); letter-spacing: -.055em; }
h2 { font-size: clamp(1.75rem, 4vw, 2.7rem); letter-spacing: -.045em; }
h3 { font-size: 1.2rem; letter-spacing: -.02em; }
p { color: var(--secondary); overflow-wrap: anywhere; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 4px; }
.wrap { width: min(100% - var(--gutter) * 2, 75rem); margin-inline: auto; }
.icon { width: 1.25em; height: 1.25em; flex: none; }
.skip { position: absolute; z-index: 2; top: .75rem; left: .75rem; padding: .75rem; background: var(--white); transform: translateY(-200%); }
.skip:focus { transform: translateY(0); }
.underline { background: linear-gradient(currentColor, currentColor) left bottom / 0 1px no-repeat; transition: background-size .2s, color .2s; }
.underline:hover, .underline:focus-visible { color: var(--red); background-size: 100% 1px; }

.site-header { position: sticky; top: 0; z-index: 5; background: var(--white); border-bottom: 1px solid var(--line); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: .65rem; min-height: 4.75rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; font-size: .875rem; font-weight: 750; line-height: 1.2; overflow-wrap: anywhere; }
.brand-mark { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; flex: none; border-radius: 8px; color: var(--white); background: var(--blue); font-size: .8rem; }
.languages { display: flex; flex: none; align-items: center; gap: .2rem; padding: .22rem; border: 1px solid var(--line); border-radius: 2rem; background: var(--wash); }
.languages button { width: 2.45rem; min-height: 2.25rem; padding: 0; border: 0; border-radius: 2rem; color: var(--blue); background: transparent; font-size: .875rem; font-weight: 750; }
.languages button[aria-pressed="true"] { color: var(--red); background: var(--white); box-shadow: 0 1px 5px #01216919; }
.languages button:hover { color: var(--red); }

.hero { display: grid; align-items: center; gap: 2rem; padding-block: clamp(2.75rem, 7vw, 6rem); }
.location { display: flex; align-items: center; gap: .4rem; margin-bottom: 1rem; font-size: .875rem; font-weight: 700; }
.location .icon, address .icon { color: var(--red); }
.tutor-name { margin-top: .9rem; color: var(--blue); font-size: clamp(1.15rem, 2vw, 1.45rem); font-weight: 750; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: .5rem; min-height: 3rem; padding: .68rem 1.25rem; border: 1px solid transparent; border-radius: 9px; font-weight: 700; text-align: center; transition: background .2s, color .2s, border-color .2s, transform .2s, box-shadow .2s; }
.button:hover { transform: translateY(-2px); }
.primary { color: var(--white); background: var(--red); box-shadow: 0 6px 16px #c8102e28; }
.primary:hover { background: var(--red-dark); }
.outline { border-color: var(--line); color: var(--blue); background: var(--white); }
.outline:hover { border-color: var(--red); color: var(--red); }

.stage { position: relative; aspect-ratio: 540 / 330; }
.tower { display: block; width: 100%; height: 100%; }
.eye-rotor { transform-box: view-box; transform-origin: 0 0; animation: wheel-turn 72s linear infinite; }
.is-paused .eye-rotor { animation-play-state: paused; }
@keyframes wheel-turn { to { transform: rotate(1turn); } }
.bus-track { position: relative; height: 20px; border-bottom: 2px solid var(--line); }
.bus-track img { position: absolute; bottom: -1px; left: 0; width: 40px; transform: translateX(var(--bus-position, 0px)); }
.motion-toggle { position: absolute; right: .75rem; bottom: .65rem; display: grid; place-items: center; width: 2.6rem; height: 2.6rem; padding: 0; border: 1px solid var(--line); border-radius: 50%; color: var(--blue); background: var(--white); }
.motion-toggle:hover { color: var(--red); }
.play-symbol, .is-paused .pause-symbol { display: none; }
.is-paused .play-symbol { display: block; }

.section { padding-block: clamp(2.75rem, 6vw, 5rem); }
.section p, .map-section p { margin-top: .8rem; }
.hero-bio { max-width: 52ch; margin-block: .75rem 1.4rem; }
.hero-bio p + p { margin-top: .4rem; }
.lesson-section { background: var(--wash); }
.section-intro { max-width: 55ch; }
.lesson-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; margin-top: 1.65rem; }
.lesson { display: flex; flex-direction: column; align-items: flex-start; gap: .75rem; padding: clamp(1rem, 2vw, 1.5rem); border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; }
.lesson:hover { transform: translateY(-3px); box-shadow: 0 12px 28px #01216917; }
.lesson p { margin: 0; }
.lesson .duration { margin-top: auto; padding-top: .5rem; color: var(--red); font-size: .875rem; font-weight: 700; }
.lesson-icon { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 9px; color: var(--red); background: var(--pink); }

.contacts { display: grid; align-items: center; gap: 1.5rem; scroll-margin-top: .5rem; }
.contact-actions { display: grid; justify-items: center; justify-self: start; gap: .9rem; min-width: 0; }
.phone { display: inline-flex; align-items: center; gap: .5rem; color: var(--red); font-size: clamp(1.15rem, 3vw, 1.6rem); font-weight: 750; overflow-wrap: anywhere; }
.messengers { display: flex; flex-wrap: wrap; gap: .55rem; }
.map-section { padding-block: 1.5rem clamp(2.75rem, 6vw, 5rem); border-top: 1px solid var(--line); }
.map-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: .85rem; margin-bottom: 1rem; }
.map-header a { color: var(--red); font-weight: 700; }
address { display: flex; align-items: center; gap: .45rem; margin-top: .7rem; color: var(--secondary); font-style: normal; overflow-wrap: anywhere; }
.map-section iframe { width: 100%; height: clamp(18rem, 45vw, 26rem); border: 1px solid var(--line); border-radius: var(--radius); background: var(--wash); }
.site-footer { padding-block: 1.5rem; background: var(--wash); border-top: 1px solid var(--line); font-size: .875rem; }
.footer-inner, .site-footer nav { display: flex; flex-wrap: wrap; gap: .65rem 1.2rem; }
.footer-inner { justify-content: space-between; }
.site-footer a { display: inline-flex; align-items: center; gap: .35rem; }

.revealed { animation: reveal .45s ease-out both; }
@keyframes reveal {
  from { opacity: .55; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 480px) {
  .brand { font-size: .95rem; }
  .lesson-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 768px) {
  .hero { grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); }
  .contacts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact-actions { justify-self: end; }
}
@media (min-width: 1024px) {
  .hero { gap: 3rem; }
}
@media (min-width: 1280px) {
  .hero { gap: 4rem; }
  .lesson-grid { gap: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .button:hover, .lesson:hover { transform: none; }
}
