/* ============================================================
   Дизайн-система — диплом «Слияние ИТ-архитектур двух банков»
   Палитра инспирирована брендбуком ВШЭ (первичный синий #0F2D69)
   ============================================================ */

:root {
  /* Brand */
  --hse-blue: #0F2D69;
  --hse-blue-2: #234B9B;
  --hse-blue-soft: #CDDCF0;
  --hse-cyan: #0FA0D7;
  --hse-violet: #7D50B9;
  --hse-red: #E61E3C;
  --hse-yellow: #FAB900;
  --hse-green: #009B64;
  --hse-orange: #EB691E;

  /* Tweakable accent (changes via Tweaks panel) */
  --accent: var(--hse-blue);
  --accent-2: var(--hse-blue-2);
  --accent-soft: var(--hse-blue-soft);
  --accent-ink: #ffffff;

  /* Surfaces */
  --bg: #F6F7FA;
  --bg-card: #FFFFFF;
  --bg-deep: #EEF1F7;
  --bg-ink: #0A1430;

  /* Text */
  --ink: #0A1430;
  --ink-2: #2A3556;
  --ink-3: #5F6B8A;
  --ink-faint: #9CA3BD;
  --ink-on-dark: #F6F7FA;

  /* Lines */
  --line: rgba(10, 20, 48, 0.10);
  --line-2: rgba(10, 20, 48, 0.18);
  --line-strong: rgba(10, 20, 48, 0.32);

  /* Radii */
  --r-xs: 4px;
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-xl: 32px;

  /* Type */
  --font-sans: 'Onest', 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', monospace;

  /* Motion */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* Layout */
  --container: 1320px;
  --gutter: clamp(20px, 4vw, 64px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'ss01', 'cv11';
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

/* ===========================
   Container
   =========================== */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ===========================
   Typography helpers
   =========================== */
.mono {
  font-family: var(--font-mono);
  font-feature-settings: 'tnum';
  letter-spacing: -0.02em;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: '';
  width: 22px;
  height: 1px;
  background: var(--accent);
}
.eyebrow.dot::before {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
}

h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.02em; margin: 0; color: var(--ink); }
.display {
  font-size: clamp(48px, 7.5vw, 112px);
  font-weight: 500;
  line-height: 0.96;
  letter-spacing: -0.04em;
}
.h1 { font-size: clamp(36px, 4.8vw, 64px); line-height: 1.04; letter-spacing: -0.03em; font-weight: 500; }
.h2 { font-size: clamp(28px, 3.2vw, 44px); line-height: 1.08; letter-spacing: -0.025em; font-weight: 500; }
.h3 { font-size: clamp(20px, 1.8vw, 26px); line-height: 1.2; letter-spacing: -0.015em; font-weight: 500; }

.lead {
  font-size: clamp(18px, 1.4vw, 22px);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 60ch;
  letter-spacing: -0.005em;
}
.muted { color: var(--ink-3); }

/* ===========================
   Navigation (transparent)
   =========================== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 22px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
  transition: padding .35s var(--ease);
}
.nav > * { pointer-events: auto; }
.nav.scrolled { padding-top: 14px; padding-bottom: 14px; }

.nav-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.nav-mark .nav-mark-glyph {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.04em;
  position: relative;
  overflow: hidden;
}
.nav-mark .nav-mark-glyph::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 50%, rgba(255,255,255,0.18) 50%);
}
.nav-mark .nav-mark-glyph span { position: relative; z-index: 1; }
.nav-mark .nav-mark-text { display: flex; flex-direction: column; line-height: 1.1; white-space: nowrap; }
.nav-mark .nav-mark-text small { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; color: var(--ink-3); text-transform: uppercase; margin-bottom: 2px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,0.0);
  border-radius: 100px;
  padding: 4px;
}
.nav-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink-2);
  border-radius: 100px;
  position: relative;
  transition: color .25s var(--ease), background .25s var(--ease);
}
.nav-links a .num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
}
.nav-links a:hover {
  color: var(--ink);
  background: rgba(10,20,48,0.05);
}
.nav-links a.active {
  background: var(--ink);
  color: var(--ink-on-dark);
}
.nav-links a.active .num { color: rgba(255,255,255,0.55); }

@media (max-width: 820px) {
  .nav-links a .num { display: none; }
  .nav-links a { padding: 8px 12px; font-size: 13px; }
}
@media (max-width: 560px) {
  .nav-mark .nav-mark-text { display: none; }
  .nav { padding: 14px 18px; }
}

/* ===========================
   Buttons
   =========================== */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px;
  border-radius: 100px;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  transition: transform .2s var(--ease), background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
  cursor: pointer;
  text-decoration: none;
}
.btn .arrow { display: inline-block; transition: transform .25s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }
.btn-primary { background: var(--ink); color: var(--ink-on-dark); }
.btn-primary:hover { background: var(--accent); }
.btn-ghost { border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--ink-on-dark); border-color: var(--ink); }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { filter: brightness(1.1); }

/* ===========================
   Cards
   =========================== */
.card {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  padding: 28px;
  transition: transform .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease);
}
.card:hover { border-color: var(--line-2); }

/* ===========================
   Section frame
   =========================== */
section { padding: clamp(64px, 9vw, 140px) 0; position: relative; }
.section-head {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin-bottom: 56px;
  align-items: flex-start;
}
.section-head .section-meta { width: 100%; display: flex; flex-direction: row; align-items: baseline; gap: 14px; flex-wrap: wrap; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.section-head .section-meta > .mono.ink-3,
.section-head .section-meta > .mono.ink-3:last-child { margin-left: auto; text-align: right; }
.section-head .section-title { display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }
@media (max-width: 860px) {
  .section-head { gap: 18px; margin-bottom: 36px; }
}

/* ===========================
   Reveal animation
   =========================== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .9s var(--ease-out), transform .9s var(--ease-out);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .8s var(--ease-out), transform .8s var(--ease-out);
}
.reveal-stagger.in > * { opacity: 1; transform: translateY(0); }
.reveal-stagger.in > *:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger.in > *:nth-child(2) { transition-delay: 60ms; }
.reveal-stagger.in > *:nth-child(3) { transition-delay: 120ms; }
.reveal-stagger.in > *:nth-child(4) { transition-delay: 180ms; }
.reveal-stagger.in > *:nth-child(5) { transition-delay: 240ms; }
.reveal-stagger.in > *:nth-child(6) { transition-delay: 300ms; }
.reveal-stagger.in > *:nth-child(7) { transition-delay: 360ms; }
.reveal-stagger.in > *:nth-child(8) { transition-delay: 420ms; }
.reveal-stagger.in > *:nth-child(9) { transition-delay: 480ms; }
.reveal-stagger.in > *:nth-child(10) { transition-delay: 540ms; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-stagger > * { opacity: 1; transform: none; transition: none; }
}

/* ===========================
   Tag / chip
   =========================== */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 100px;
  border: 1px solid var(--line-2);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  background: transparent;
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.chip.solid { background: var(--ink); color: var(--ink-on-dark); border-color: var(--ink); }
.chip.accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* Clickable artifact chip — used in roadmap, hero, etc. to jump to artifact tile */
.chip.chip-link {
  cursor: pointer;
  text-decoration: none;
  background: var(--bg-card);
  border-color: var(--line);
  color: var(--ink);
  transition: border-color .2s var(--ease), background .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.chip.chip-link .chip-arrow {
  color: var(--ink-3);
  font-family: var(--font-mono);
  transition: transform .2s var(--ease), color .2s var(--ease);
}
.chip.chip-link:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.chip.chip-link:hover .chip-arrow {
  transform: translateX(3px);
  color: var(--accent);
}

/* ===========================
   Stripe placeholder (for missing images)
   =========================== */
.placeholder {
  position: relative;
  background:
    repeating-linear-gradient(
      135deg,
      rgba(15, 45, 105, 0.06) 0,
      rgba(15, 45, 105, 0.06) 1px,
      transparent 1px,
      transparent 14px
    ),
    var(--bg-card);
  border: 1px dashed var(--line-2);
  border-radius: var(--r-md);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 24px;
  color: var(--ink-3);
}
.placeholder .ph-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  background: var(--bg-card);
  padding: 4px 10px;
  border-radius: 100px;
  border: 1px solid var(--line);
  margin-bottom: 12px;
}
.placeholder .ph-title { font-size: 15px; color: var(--ink-2); font-weight: 500; max-width: 28ch; }
.placeholder .ph-meta { font-size: 12.5px; color: var(--ink-faint); margin-top: 6px; font-family: var(--font-mono); }

/* ===========================
   Grid utilities
   =========================== */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 860px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ===========================
   Footer
   =========================== */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 64px 0 32px;
  margin-top: 80px;
  color: var(--ink-3);
}
.site-footer .footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 64px;
}
.site-footer h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-faint); font-family: var(--font-mono); font-weight: 500; margin-bottom: 16px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.site-footer ul a { color: var(--ink-2); font-size: 15px; transition: color .2s; }
.site-footer ul a:hover { color: var(--accent); }
.site-footer .footer-bot {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  text-transform: uppercase;
}
@media (max-width: 860px) {
  .site-footer .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .site-footer .footer-bot { flex-direction: column; gap: 16px; align-items: flex-start; }
}

/* ===========================
   Misc utility
   =========================== */
.divider {
  height: 1px;
  background: var(--line);
  margin: 0;
  border: 0;
}
.kbd {
  display: inline-block;
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg-card);
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 6px;
  color: var(--ink-2);
}

/* Underline animation for inline links */
.link {
  position: relative;
  color: var(--ink);
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
  transition: color .2s var(--ease);
}
.link:hover { color: var(--accent); }
