/* ============================================
   Privatum — light design system, built around
   the rotating geodesic 3D sphere
   ============================================ */

:root {
  --bg: #f5f6f8;
  --bg-alt: #eceef2;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #ffffff;
  --ink: #2b2f38;
  --ink-soft: #6b7280;
  --accent: #4b5160;
  --accent-soft: rgba(75, 81, 96, 0.6);
  --line: rgba(43, 47, 56, 0.12);
  --line-soft: rgba(43, 47, 56, 0.07);
  --shadow: 0 20px 50px rgba(90, 96, 112, 0.14);
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --maxw: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body.nav-open { overflow: hidden; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.15;
  margin: 0 0 0.5em;
  color: var(--ink);
}

h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 500; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); }
h3 { font-size: 1.35rem; }

p { margin: 0 0 1em; }

a { color: inherit; text-decoration: none; }

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

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
}

.wrap-narrow { max-width: 760px; }

/* ---------- language toggle ---------- */
html[data-lang="ru"] .lang-en { display: none !important; }
html[data-lang="en"] .lang-ru { display: none !important; }

.lang-switch { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; letter-spacing: 0.05em; }
.lang-btn {
  background: none; border: none; cursor: pointer;
  font-family: var(--sans); font-size: 0.8rem; color: var(--ink-soft);
  padding: 4px 2px;
}
.lang-btn.is-active { color: var(--ink); font-weight: 600; }
.lang-sep { color: var(--line); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(245, 246, 248, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 78px;
  gap: 24px;
}
.logo {
  font-family: var(--serif);
  font-size: 1.3rem;
  letter-spacing: 0.12em;
  font-weight: 600;
  color: var(--ink);
}
.main-nav { display: flex; gap: 36px; }
.main-nav a {
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  transition: color 0.2s;
}
.main-nav a:hover { color: var(--ink); }

.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; margin-left: 4px; }
.nav-toggle span {
  display: block; width: 22px; height: 1px; background: var(--ink); margin: 5px 0;
  transition: transform 0.25s, opacity 0.25s;
}
.nav-toggle.is-active span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.is-active span:nth-child(2) { opacity: 0; }
.nav-toggle.is-active span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  padding: 14px 32px;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  border-radius: 3px;
  transition: all 0.25s;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 10px 24px rgba(43, 47, 56, 0.18);
}
.btn-primary:hover { background: var(--accent); }
.btn-outline {
  border-color: var(--ink);
  color: var(--ink);
  margin-top: 8px;
  background: transparent;
}
.btn-outline:hover { background: var(--ink); color: #fff; }

/* ---------- hero (3D sphere) ---------- */
.hero {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  text-align: center;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%);
}
.hero-sphere {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}
.hero-sphere:active { cursor: grabbing; }
.hero .wrap {
  position: relative;
  z-index: 2;
  pointer-events: none;
}
.hero .btn { pointer-events: auto; }
.eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.35em;
  color: var(--accent);
  margin-bottom: 28px;
  text-transform: uppercase;
}
.hero h1 { max-width: 820px; margin-left: auto; margin-right: auto; }
.hero-sub {
  max-width: 560px;
  margin: 28px auto 40px;
  color: var(--ink-soft);
  font-size: 1.05rem;
}
.hero-hint {
  margin-top: 22px;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  opacity: 0.75;
}

/* Reduce Motion (iOS/macOS "Уменьшение движения", Windows "Показывать
   анимацию" off, Android and other equivalents all map to this same
   media feature): sphere stays put and reads as a quiet, pale texture
   rather than a thing to operate — so the "покрутите сферу" hint,
   which no longer applies, is hidden too. */
@media (prefers-reduced-motion: reduce) {
  .hero-hint { display: none; }
}
/* Note: the paler look for reduced-motion is drawn directly into the
   sphere's own canvas alpha (see Sphere3D._draw in script.js) rather
   than as a CSS opacity here — a plain opacity rule on .sphere-accent
   this early in the cascade was getting overridden by its normal,
   higher-specificity-by-source-order `opacity: 0.9` rule further down. */

/* ---------- sections ---------- */
.section { padding: 96px 0; position: relative; }
.section-alt { background: var(--bg-alt); }
.kicker {
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.section > .wrap > .kicker,
.section > .wrap > h2 {
  text-align: center;
}
.prose p { color: var(--ink-soft); font-size: 1.02rem; }

/* decorative accent spheres tucked behind section headings */
.sphere-accent {
  position: absolute;
  width: 320px; height: 320px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.9;
}
.sphere-accent.pos-tr { top: -40px; right: -20px; }
.sphere-accent.pos-bl { bottom: -60px; left: -40px; }
.section .wrap { z-index: 1; }
@media (max-width: 860px) {
  .sphere-accent { display: none; }
}

/* ---------- services grid ---------- */
.service-grid {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
/* for grids with an even, small item count (e.g. 4 tiles) — keeps them
   a tidy 2×2 instead of wrapping unevenly as 3-then-1 */
.service-grid.cols-2 {
  grid-template-columns: repeat(2, 1fr);
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
}
@media (max-width: 700px) {
  .service-grid.cols-2 { grid-template-columns: 1fr; }
}
/* main services grid: with an odd count (7 cards), the last one would
   otherwise sit alone and off-centre in the final row — span it full
   width instead, which reads as an intentional closing banner rather
   than a layout glitch, at any column count auto-fit lands on. */
#services .service-grid > .service-card:last-child {
  grid-column: 1 / -1;
}
#services .service-grid > .service-card:last-child ul {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 28px;
}
#services .service-grid > .service-card:last-child li {
  padding-left: 16px;
}
.service-card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  border-radius: 14px;
  padding: 40px 32px;
  text-align: center;
}
.service-num {
  font-family: var(--serif);
  font-size: 0.95rem;
  color: var(--accent-soft);
  margin-bottom: 18px;
}
.service-desc { color: var(--ink-soft); font-size: 0.95rem; }
.service-card ul {
  margin-top: 18px;
  text-align: left;
  display: inline-block;
}
.service-card li {
  position: relative;
  padding-left: 16px;
  margin-bottom: 10px;
  font-size: 0.92rem;
  color: var(--ink-soft);
}
.service-card li::before {
  content: "";
  position: absolute; left: 0; top: 0.6em;
  width: 4px; height: 4px;
  background: var(--accent);
  border-radius: 50%;
}
.service-card h3 a { color: inherit; text-decoration: none; transition: color 0.2s; }
.service-card h3 a:hover { color: var(--accent); }
.card-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: var(--accent);
  transition: color 0.2s, gap 0.2s;
}
.card-more:hover { color: var(--ink); gap: 10px; }
/* a whole tile can itself be the link (e.g. product tiles that lead to
   a dedicated page) — reuses .service-card's look on an <a> instead */
a.service-card {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.25s, transform 0.25s;
}
a.service-card:hover {
  box-shadow: 0 26px 60px rgba(90, 96, 112, 0.2);
  transform: translateY(-2px);
}

/* ---------- sub-pages (breadcrumb, compact page intro, advantages) ---------- */
.breadcrumb {
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-bottom: 26px;
  letter-spacing: 0.02em;
}
.breadcrumb a { color: var(--ink-soft); transition: color 0.2s; }
.breadcrumb a:hover { color: var(--ink); }
.breadcrumb .sep { margin: 0 6px; opacity: 0.5; }
.page-hero { text-align: center; overflow: hidden; }
.page-hero .sphere-accent { opacity: 0.5; }

.advantages {
  margin-top: 32px;
  display: grid;
  gap: 18px;
  text-align: left;
}
.advantages li {
  position: relative;
  padding-left: 38px;
  color: var(--ink-soft);
  font-size: 1.02rem;
  line-height: 1.55;
}
.advantages li::before {
  content: "✓";
  position: absolute; left: 0; top: -1px;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  color: var(--accent);
  font-size: 0.72rem;
  box-shadow: 0 4px 10px rgba(90, 96, 112, 0.1);
}

/* ---------- contact form ---------- */
.contact-sub { color: var(--ink-soft); margin-bottom: 40px; }
.contact-form { display: flex; flex-direction: column; gap: 22px; max-width: 640px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.contact-form label {
  display: flex; flex-direction: column; gap: 8px;
  font-size: 0.82rem; letter-spacing: 0.02em; color: var(--ink-soft);
}
.contact-form label.full { grid-column: 1 / -1; }
.contact-form input[type="text"],
.contact-form textarea {
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 14px;
  resize: vertical;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.form-role {
  border: none; padding: 0; margin: 0;
  display: flex; flex-wrap: wrap; gap: 20px; align-items: center;
}
.form-role legend {
  width: 100%;
  font-size: 0.82rem; color: var(--ink-soft); margin-bottom: 10px; padding: 0;
}
.radio { flex-direction: row !important; align-items: center; gap: 8px !important; font-size: 0.9rem; }
.hp-field { position: absolute; left: -9999px; }
.form-note { font-size: 0.78rem; color: var(--ink-soft); opacity: 0.85; }
.form-status { font-size: 0.9rem; }
.form-status.ok { color: #3f8f52; }
.form-status.err { color: #b4453f; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 56px 0;
  text-align: center;
}
.footer-logo {
  font-family: var(--serif);
  letter-spacing: 0.15em;
  font-size: 1.05rem;
  margin-bottom: 10px;
}
.footer-tag { color: var(--ink-soft); font-size: 0.88rem; margin-bottom: 18px; }
.footer-copy { color: var(--ink-soft); font-size: 0.78rem; opacity: 0.75; margin: 0; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .main-nav {
    /* .site-header has backdrop-filter, which makes it the containing block
       for any position:fixed descendant — so height must come from an
       explicit viewport-unit calc() rather than top+bottom, which would
       otherwise resolve against the header's own (~78px) box. */
    display: none;
    position: fixed;
    top: 78px; right: 0; left: 0;
    height: calc(100vh - 78px);
    height: calc(100svh - 78px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
    background: rgba(245, 246, 248, 0.98);
    backdrop-filter: blur(14px);
    z-index: 40;
  }
  .main-nav.is-open { display: flex; }
  .main-nav a { font-size: 1.1rem; color: var(--ink); }
  .nav-toggle { display: block; }
  .form-row { grid-template-columns: 1fr; }
  .hero { min-height: 92vh; min-height: 92svh; padding: 120px 0 80px; }
  .section { padding: 72px 0; }
}
