/* ===== Design tokens ===== */
:root {
  --primary: #1E3A8A;
  --primary-deep: #16296B;
  --secondary: #1E40AF;
  --accent: #B45309;
  --accent-deep: #92400E;
  --bg: #F8FAFC;
  --bg-alt: #FFFFFF;
  --bg-dark: #0F172A;
  --fg: #0F172A;
  --fg-muted: #475569;
  --fg-on-dark: #E2E8F0;
  --card: #FFFFFF;
  --border: #CBD5E1;
  --ring: #1E3A8A;

  --font-heading: "EB Garamond", Georgia, "Times New Roman", serif;
  --font-body: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 6px 16px -6px rgba(15, 23, 42, 0.14);
  --shadow-lg: 0 20px 40px -18px rgba(15, 23, 42, 0.28);

  --container: 1180px;
  --space: 1rem;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.4rem, 5vw, 4rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
h3 { font-size: 1.25rem; font-weight: 600; }

p { margin: 0 0 1em; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }

/* ===== Selection & caret ===== */
::selection { background: var(--accent); color: #fff; }
:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ===== Skip link ===== */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--primary);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 6px 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* ===== Layout ===== */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }

.section-head { max-width: 640px; margin-bottom: 2.5rem; }
.section-sub { color: var(--fg-muted); font-size: 1.05rem; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.6rem;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 1rem;
  font-family: var(--font-body);
  cursor: pointer;
  border: 2px solid transparent;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
  min-height: 48px;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-deep);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}
.btn-ghost:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--primary);
}
.brand-mark { color: var(--accent); }
.brand-text { white-space: nowrap; }

.main-nav {
  display: flex;
  gap: 1.6rem;
  margin-left: auto;
  font-weight: 700;
  font-size: 0.95rem;
}
.main-nav a {
  color: var(--fg-muted);
  padding: 0.4rem 0;
  transition: color 150ms ease;
  position: relative;
}
.main-nav a:hover { color: var(--primary); }
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}
.main-nav a:hover::after { transform: scaleX(1); }

.header-cta { margin-left: 0.5rem; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 48px;
  height: 48px;
  background: none;
  border: none;
  cursor: pointer;
  margin-left: auto;
}
.nav-toggle span {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--primary);
  transition: transform 200ms ease, opacity 200ms ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 1.5rem 1.5rem;
  background: #fff;
  border-top: 1px solid var(--border);
}
.mobile-nav a {
  padding: 0.8rem 0.5rem;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  color: var(--fg);
}
.mobile-nav .btn { margin-top: 1rem; }

/* ===== Hero ===== */
.hero {
  background:
    radial-gradient(1100px 500px at 80% -10%, rgba(30, 64, 175, 0.55), transparent 60%),
    linear-gradient(160deg, var(--bg-dark) 0%, #1a2745 60%, var(--primary-deep) 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3rem;
  align-items: center;
  min-height: 560px;
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.hero-copy { position: relative; z-index: 1; }
.hero-copy h1 { margin-bottom: 0.4em; }
.hero-lead {
  font-size: 1.2rem;
  font-weight: 300;
  color: #D6DFF0;
  max-width: 32em;
  margin-bottom: 1.75rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.hero-proof {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
}
.hero-proof li { display: flex; flex-direction: column; }
.hero-proof strong {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 600;
  color: #F0B429;
  line-height: 1.1;
}
.hero-proof span { font-size: 0.9rem; color: #C7D4EC; }
.hero-art {
  position: relative;
  z-index: 0;
  display: flex;
  justify-content: center;
}
.hero-scales {
  width: 100%;
  max-width: 440px;
  height: auto;
  filter: drop-shadow(0 12px 32px rgba(0, 0, 0, 0.4));
}

/* ===== Services ===== */
.services { background: var(--bg-alt); }
.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.service-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}
.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}
.service-icon {
  width: 40px;
  height: 40px;
  color: var(--accent);
  margin-bottom: 1rem;
}
.service-card h3 { font-size: 1.2rem; margin-bottom: 0.5em; }
.service-card p { color: var(--fg-muted); font-size: 0.95rem; margin: 0; }

/* ===== About ===== */
.about { background: var(--bg); }
.about-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: center;
}
.about-copy h2 { margin-bottom: 0.6em; }
.about-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 2rem;
}
.about-list li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: 0.7rem;
  color: var(--fg-muted);
}
.about-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.45em;
  width: 12px; height: 12px;
  background: var(--accent);
  border-radius: 3px;
}

.about-person {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2.5rem 2rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.person-photo {
  width: 100%;
  max-width: 300px;
  aspect-ratio: 3 / 4;
  background: var(--bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-md);
}
.person-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
.person-name { font-family: var(--font-heading); font-size: 1.4rem; font-weight: 600; margin: 0; }
.person-role { color: var(--fg-muted); margin: 0.25rem 0 0; }

/* ===== Stats ===== */
.stats { background: var(--bg-dark); color: #fff; padding: 3rem 0; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  text-align: center;
}
.stat strong {
  display: block;
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 600;
  color: #F0B429;
  line-height: 1;
}
.stat span { color: #B9C6DE; font-size: 0.95rem; }

/* ===== Advantages ===== */
.advantages { background: var(--bg-alt); }
.advantages-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}
.advantage {
  padding: 1.75rem;
  background: var(--bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
.advantage h3 { margin-bottom: 0.4em; }
.advantage p { color: var(--fg-muted); margin: 0; }

/* ===== Reviews ===== */
.reviews { background: var(--bg); }
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.review {
  margin: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
}
.review p {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-style: italic;
  margin: 0 0 1.25rem;
  flex: 1;
}
.review footer {
  color: var(--accent-deep);
  font-weight: 700;
  font-size: 0.9rem;
}

/* ===== Materials ===== */
.materials { background: var(--bg-alt); }
.materials-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 860px;
}
.material {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}
.material[open] {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}
.material summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.4rem 1.75rem;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--fg);
  transition: color 150ms ease, background-color 150ms ease;
}
.material summary::-webkit-details-marker { display: none; }
.material summary:hover { color: var(--primary); background: var(--bg); }
.material summary:focus-visible { outline: 3px solid var(--ring); outline-offset: -3px; }

.material-title { flex: 1; }

.material-chevron {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg);
  transition: transform 200ms ease;
  margin-top: -4px;
}
.material[open] .material-chevron { transform: rotate(-135deg); margin-top: 4px; }

.material-body {
  padding: 0 1.75rem 1.75rem;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}
.material-sub {
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
  margin: 1rem 0 0.5rem;
}
.material-sub:first-child { margin-top: 0; }

.checklist {
  margin: 0 0 1.25rem;
  padding-left: 1.4rem;
  color: var(--fg-muted);
}
.checklist li { margin-bottom: 0.5rem; }

.material-download {
  border-color: var(--primary);
  color: var(--primary);
  background: transparent;
}
.material-download:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ===== Consult ===== */
.consult {
  background:
    radial-gradient(900px 400px at 15% 0%, rgba(30, 64, 175, 0.5), transparent 60%),
    linear-gradient(160deg, var(--bg-dark) 0%, #1a2745 60%, var(--primary-deep) 100%);
  color: #fff;
}
.consult-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}
.consult-copy h2 { margin-bottom: 0.5em; }
.consult-copy > p { color: #C7D2E8; }

.consult-contacts {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
}
.consult-contacts li {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1rem;
  color: #E2E8F0;
}
.consult-contacts svg { width: 22px; height: 22px; color: #F0B429; flex-shrink: 0; }
.consult-contacts a { border-bottom: 1px solid rgba(255,255,255,0.3); }
.consult-contacts a:hover { border-color: #F0B429; }

/* ===== Social block ===== */
.social-block { margin-top: 2rem; }
.social-title {
  margin: 0 0 0.9rem;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94A3B8;
}
.social-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 1rem;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: #E2E8F0;
  font-weight: 700;
  font-size: 0.92rem;
  background: rgba(255, 255, 255, 0.04);
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}
.social-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: #F0B429;
}
.social-link:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #F0B429;
  color: #fff;
  transform: translateY(-1px);
}
.social-link:focus-visible {
  outline: 3px solid #F0B429;
  outline-offset: 2px;
}

.consult-form {
  background: #fff;
  color: var(--fg);
  padding: 2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.consult-form label { display: flex; flex-direction: column; gap: 0.4rem; }
.consult-form label span { font-weight: 700; font-size: 0.9rem; }
.consult-form input,
.consult-form textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  transition: border-color 150ms ease, box-shadow 150ms ease;
  resize: vertical;
}
.consult-form input:focus,
.consult-form textarea:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.15);
}
.form-note { font-size: 0.9rem; margin: 0; min-height: 1.2em; }
.form-note.success { color: #166534; }
.form-note.error { color: #B91C1C; }

/* ===== Footer ===== */
.site-footer {
  background: var(--bg-dark);
  color: #94A3B8;
  border-top: 1px solid #1E293B;
  padding: 2.5rem 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.footer-brand .brand-text {
  color: #fff;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 600;
}
.footer-brand p { margin: 0.25rem 0 0; font-size: 0.9rem; }
.footer-copy { margin: 0; font-size: 0.9rem; }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .services-grid { grid-template-columns: repeat(3, 1fr); }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-art { display: none; }
}

@media (max-width: 820px) {
  .main-nav, .header-cta { display: none; }
  .nav-toggle { display: flex; }
  .mobile-nav[hidden] { display: none; }
  .mobile-nav:not([hidden]) { display: flex; }

  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .reviews-grid { grid-template-columns: 1fr; }
  .consult-inner { grid-template-columns: 1fr; }
  .about-inner { grid-template-columns: 1fr; }
  .about-person { order: -1; }
  .stats-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .advantages-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .services-grid { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
  .hero-proof { gap: 1.5rem; }
  .container { padding: 0 1.1rem; }
}

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