/* ==========================================================================
   Nordwave Studio — стили
   ========================================================================== */

:root {
  --bg: #ffffff;
  --bg-alt: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #101828;
  --text-muted: #5a6478;
  --border: #e4e8f0;
  --brand: #2f6df6;
  --brand-2: #6b4ee6;
  --brand-soft: rgba(47, 109, 246, 0.1);
  --ok: #0f9d78;
  --danger: #d92d20;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
  --shadow-md: 0 8px 24px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 24px 60px rgba(16, 24, 40, 0.14);
  --radius: 14px;
  --radius-lg: 22px;
  --header-h: 68px;
  --maxw: 1140px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  --bg: #0e1526;
  --bg-alt: #0b1120;
  --surface: #141d33;
  --surface-2: #182241;
  --text: #e8ecf6;
  --text-muted: #9aa6c0;
  --border: #26304b;
  --brand: #6d9bff;
  --brand-2: #a08cff;
  --brand-soft: rgba(109, 155, 255, 0.14);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.5);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}

img, svg { max-width: 100%; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4.2vw, 3.1rem); font-weight: 750; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); font-weight: 700; }
h3 { font-size: 1.12rem; font-weight: 650; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.center { text-align: center; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 20px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 750; letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(140deg, var(--brand), var(--brand-2)); color: #fff;
}
.brand-text { font-size: 1.06rem; }
.brand-accent { color: var(--brand); margin-left: 4px; font-weight: 500; }

.nav { margin-left: auto; display: flex; align-items: center; gap: 22px; }
.nav a { color: var(--text-muted); font-size: .95rem; font-weight: 500; }
.nav a:hover { color: var(--text); text-decoration: none; }
.nav-cta {
  color: #fff !important; background: var(--brand);
  padding: 9px 16px; border-radius: 10px; font-weight: 600;
}
.nav-cta:hover { background: var(--brand-2); }

.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); cursor: pointer;
}
.icon-btn:hover { border-color: var(--brand); color: var(--brand); }
[data-theme="dark"] .i-sun, :root:not([data-theme="dark"]) .i-moon { display: none; }
[data-theme="dark"] .i-moon, :root:not([data-theme="dark"]) .i-sun { display: block; }

.nav-burger { display: none; flex-direction: column; gap: 4px; }
.nav-burger span { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }
.nav-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 11px; font-weight: 600; font-size: .97rem;
  border: 1px solid transparent; cursor: pointer; transition: transform .15s ease, background .2s ease, box-shadow .2s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:disabled { opacity: .6; cursor: progress; transform: none; }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }

/* ---------- hero ---------- */
.hero { padding: clamp(48px, 7vw, 92px) 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1.25fr .85fr; gap: 44px; align-items: center; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .74rem; font-weight: 700; color: var(--brand); margin: 0 0 14px; }
.lead { font-size: 1.09rem; color: var(--text-muted); max-width: 46ch; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 26px 0 30px; }
.hero-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 0; padding-top: 22px; border-top: 1px solid var(--border); }
.hero-facts dt { font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); margin-bottom: 4px; }
.hero-facts dd { margin: 0; font-weight: 600; font-size: .95rem; }

.hero-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.panel-head { display: flex; align-items: center; gap: 7px; padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot-red { background: #ff5f57; } .dot-amber { background: #febc2e; } .dot-green { background: #28c840; }
.panel-title { margin-left: 10px; font-family: var(--mono); font-size: .78rem; color: var(--text-muted); }
.panel-list { list-style: none; margin: 0; padding: 8px 16px 4px; }
.panel-list li { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--border); font-size: .92rem; color: var(--text-muted); }
.panel-list li:last-child { border-bottom: none; }
.panel-list b { color: var(--text); font-family: var(--mono); font-weight: 600; }
.panel-foot { padding: 12px 16px; font-size: .78rem; color: var(--text-muted); background: var(--surface-2); }

/* ---------- stats ---------- */
.stats-band { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; padding: 34px 20px; }
.stat { text-align: center; }
.stat .stat-value { font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 750; letter-spacing: -0.03em; }
.stat .stat-label { font-size: .88rem; color: var(--text-muted); }

/* ---------- sections ---------- */
.section { padding: clamp(52px, 7vw, 88px) 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 620px; margin-bottom: 38px; }
.section-sub { color: var(--text-muted); margin: 0; }

/* ---------- cards / services ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 24px; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); }
.card-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); margin-bottom: 16px; }
.card p { color: var(--text-muted); font-size: .95rem; margin-bottom: 16px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.tags li { font-size: .76rem; font-weight: 600; color: var(--text-muted); background: var(--surface-2); border: 1px solid var(--border); padding: 3px 10px; border-radius: 999px; }

/* ---------- cases ---------- */
.cases { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.case { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; padding: 24px 24px 22px; }
.case::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--case-accent, var(--brand)); }
.case-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.case-client { font-weight: 700; }
.case-year { font-family: var(--mono); font-size: .8rem; color: var(--text-muted); }
.case h3 { margin-bottom: 8px; }
.case p { color: var(--text-muted); font-size: .95rem; }
.case-result { display: inline-block; font-size: .86rem; font-weight: 600; color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); padding: 6px 12px; border-radius: 8px; margin: 4px 0 14px; }

/* ---------- process ---------- */
.process { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; counter-reset: step; }
.process li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.process .step { font-family: var(--mono); font-size: .82rem; font-weight: 700; color: var(--brand); }
.process p { color: var(--text-muted); font-size: .93rem; margin: 8px 0 0; }

/* ---------- team ---------- */
.team { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.member { text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px 18px; }
.avatar { width: 62px; height: 62px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; background: linear-gradient(140deg, var(--brand), var(--brand-2)); }
.member .role { color: var(--text-muted); font-size: .88rem; }

/* ---------- articles ---------- */
.articles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.article-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.article-card h3 { font-size: 1.02rem; }
.article-card h3 a { color: var(--text); }
.article-card h3 a:hover { color: var(--brand); text-decoration: none; }
.article-card p { color: var(--text-muted); font-size: .93rem; flex: 1; }
.article-meta { font-size: .8rem; color: var(--text-muted); font-family: var(--mono); }
.articles--full { grid-template-columns: repeat(2, 1fr); }

.blog-hero { padding-bottom: 0; }
.article-shell { max-width: 760px; }
.article-body { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(24px, 4vw, 44px); }
.article-body h1 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
.article-body h3 { margin-top: 1.4em; }
.article-body p, .article-body li { color: color-mix(in srgb, var(--text) 88%, var(--text-muted)); }
.article-body code { font-family: var(--mono); font-size: .88em; background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; }
.link-back { font-weight: 600; }

/* ---------- contact ---------- */
.section-contact { background: linear-gradient(180deg, var(--bg), var(--bg-alt)); }
.contact-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: 46px; align-items: start; }
.contact-details { list-style: none; margin: 24px 0 0; padding: 0; }
.contact-details li { padding: 12px 0; border-bottom: 1px solid var(--border); display: flex; gap: 14px; }
.contact-details .k { min-width: 96px; color: var(--text-muted); font-size: .86rem; }
.contact-details .v { font-weight: 500; }

.contact-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: clamp(22px, 3vw, 34px); box-shadow: var(--shadow-md); }
.field { margin-bottom: 16px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field label { display: block; font-size: .86rem; font-weight: 600; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 13px; font: inherit; font-size: .95rem;
  color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 10px; transition: border-color .15s ease, box-shadow .15s ease;
}
.field textarea { resize: vertical; min-height: 110px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--danger); }
.error { color: var(--danger); font-size: .82rem; margin: 5px 0 0; min-height: 1em; }
.field-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin: 14px 0 0; font-size: .92rem; font-weight: 600; }
.form-status.ok { color: var(--ok); }
.form-status.err { color: var(--danger); }
.form-note { font-size: .78rem; color: var(--text-muted); margin: 10px 0 0; }

/* ---------- footer ---------- */
.site-footer { background: var(--bg-alt); border-top: 1px solid var(--border); padding: 48px 0 24px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1.4fr; gap: 32px; }
.footer-note { color: var(--text-muted); font-size: .88rem; max-width: 40ch; margin-top: 12px; }
.footer-col h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); }
.footer-col a { display: block; color: var(--text); font-size: .92rem; padding: 3px 0; }
.footer-col a:hover { color: var(--brand); text-decoration: none; }
.footer-col div a { display: block; }
.footer-bottom { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: .84rem; }

/* ---------- reveal animation ---------- */
/* Скрываем только когда JS доступен — иначе контент остаётся видимым. */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .cards, .articles { grid-template-columns: repeat(2, 1fr); }
  .process, .team { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 8px 20px 16px; display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 0; border-bottom: 1px solid var(--border); }
  .nav-cta { margin-top: 12px; text-align: center; border-bottom: none; }
  .nav-burger { display: flex; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .cards, .cases, .articles, .articles--full, .process, .team, .field-row { grid-template-columns: 1fr; }
  .hero-facts { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}
