/* ==========================================================
   yandex-direct-metrica-mcp — Redesigned landing page styles
   ========================================================== */

/* --- Variables --- */
:root {
  color-scheme: light;

  --bg: #fafafa;
  --bg-subtle: #f5f5f5;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-hover: #ffffff;
  --surface-raised: rgba(255, 255, 255, 0.98);
  --text: #1a1a1a;
  --text-secondary: #6b6b6b;
  --border: #e5e5e5;
  --border-hover: rgba(15, 23, 42, 0.18);

  --accent: #ff6b35;
  --accent-solid: #ff6b35;
  --accent-hover: #f05c27;
  --accent-subtle: rgba(255, 107, 53, 0.09);
  --accent2: #10b981;
  --accent2-subtle: rgba(16, 185, 129, 0.08);
  --warm: #f59e0b;
  --warm-subtle: rgba(245, 158, 11, 0.08);
  --danger: #ef4444;
  --ink: #0f172a;

  --shadow-sm: 0 8px 20px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 16px 36px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.12);
  --shadow-accent: 0 16px 28px rgba(255, 107, 53, 0.22);

  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  --maxw: 1180px;
  --font-display: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'DM Sans', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
}

/* --- Reset & base --- */
*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 107, 53, 0.09), transparent 24rem),
    linear-gradient(180deg, #fcfcfc 0%, var(--bg) 100%);
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(232, 232, 232, 0.28) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232, 232, 232, 0.28) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.32), transparent 82%);
}

body::after {
  content: none;
}

/* Top accent bar */
.accent-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #ff6b35 0%, #ff8c42 45%, #ffc857 100%);
  z-index: 40;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

/* --- Layout --- */
.wrap {
  position: relative;
  z-index: 1;
  width: min(var(--maxw), calc(100vw - 32px));
  margin: 0 auto;
  padding: 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

.col-12 { grid-column: span 12; }
.col-8  { grid-column: span 8; }
.col-6  { grid-column: span 6; }
.col-4  { grid-column: span 4; }
.col-3  { grid-column: span 3; }

/* --- Navigation --- */
.nav {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(250, 250, 250, 0.84);
  border-bottom: 1px solid rgba(229, 229, 229, 0.9);
}

.nav-inner {
  width: min(var(--maxw), calc(100vw - 32px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--text);
  min-width: 0;
}
.brand:hover { text-decoration: none; }

.logo {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 14px;
  position: relative;
  background:
    linear-gradient(135deg, rgba(255, 107, 53, 0.2), rgba(255, 107, 53, 0.04)),
    linear-gradient(135deg, #ff6b35 0%, #ff8c42 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 14px 28px rgba(255, 107, 53, 0.22);
}
.logo::before,
.logo::after {
  content: "";
  position: absolute;
  background: white;
  border-radius: 999px;
}
.logo::before { inset: 10px 18px 10px 8px; }
.logo::after { inset: 10px 8px 10px 22px; opacity: 0.38; }

.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 1rem; letter-spacing: -0.02em; }
.brand-sub { font-size: 0.76rem; color: var(--text-secondary); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}
.nav-links a {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 8px 4px;
  border-radius: var(--radius-sm);
  transition: color 0.18s ease;
}
.nav-links a:hover {
  color: var(--text);
  text-decoration: none;
}

.nav-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  cursor: pointer;
}
.hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  border-radius: 999px;
  margin: 0 auto;
  transition: transform 0.25s, opacity 0.25s;
}
.hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Mobile menu */
.mobile-menu {
  width: min(var(--maxw), calc(100vw - 32px));
  margin: 0 auto 18px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.mobile-menu[hidden] { display: none; }
.mobile-menu a {
  display: block;
  padding: 0;
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 600;
  transition: color 0.18s ease;
}
.mobile-menu a:hover {
  color: var(--text);
  text-decoration: none;
}
.mobile-menu-footer {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* --- Hero --- */
.hero {
  padding: 76px 0 40px;
  text-align: center;
}

.hero-title {
  margin: 0 auto;
  font-family: var(--font-display);
  font-size: clamp(3rem, 6vw, 5.4rem);
  font-weight: 800;
  line-height: 0.96;
  letter-spacing: -0.04em;
  text-wrap: balance;
  animation: fadeUp 0.7s ease-out 0.05s both;
  max-width: 12ch;
}
/* Latin glyphs render thinner than Cyrillic in DM Sans — compensate */
html[lang="en"] .hero-title { font-weight: 900; }
html[lang="en"] .hero-title-dim { font-weight: 800; }

/* Dimmed part of the title */
.hero-title-dim {
  color: #7b7b7b;
  font-weight: 700;
}

/* Tagline — accent bridge between title and subtitle */
.hero-tagline {
  margin: 12px 0 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.01em;
  animation: fadeUp 0.7s ease-out 0.12s both;
}

.hero-subtitle {
  margin: 22px auto 0;
  font-size: 1.08rem;
  line-height: 1.75;
  color: var(--text-secondary);
  max-width: 62ch;
  text-wrap: pretty;
  animation: fadeUp 0.7s ease-out 0.18s both;
}
.hero-subtitle b { color: var(--text); font-weight: 700; }

/* Public / PRO tier badges */
.hero-tiers {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
  animation: fadeUp 0.7s ease-out 0.22s both;
}
.tier {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.tier b { font-weight: 700; }
.tier--public b { color: var(--accent2); }
.tier--pro b { color: var(--warm); }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
  animation: fadeUp 0.7s ease-out 0.22s both;
}

.pillrow {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  animation: fadeUp 0.7s ease-out 0.30s both;
}

.pill {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(255, 107, 53, 0.16);
  background: #fff4f0;
  color: #8e3b18;
  padding: 10px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.92rem;
  font-weight: 600;
  transition: border-color 0.2s;
}
.pill:hover { border-color: rgba(255, 107, 53, 0.28); }
.pill b { color: var(--text); font-weight: 600; }

.disclaimer {
  margin: 22px auto 0;
  font-size: 11.5px;
  color: var(--text-secondary);
  opacity: 0.7;
  max-width: 640px;
  animation: fadeUp 0.7s ease-out 0.45s both;
}

/* --- Sections --- */
.section {
  padding: 34px 0 0;
}

.section-header {
  margin-bottom: 18px;
  text-align: left;
}

.section-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 3vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.lead {
  margin: 12px 0 0;
  color: var(--text-secondary);
  font-size: 1.02rem;
  line-height: 1.75;
  max-width: 70ch;
  text-wrap: pretty;
}

/* --- Cards --- */
.card {
  position: relative;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
}

/* Accent stripe on top of feature cards */
.card[data-accent]::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20px;
  right: 20px;
  height: 3px;
  border-radius: 0 0 3px 3px;
}
.card[data-accent="blue"]::before { background: var(--accent); }
.card[data-accent="green"]::before { background: var(--accent2); }
.card[data-accent="warm"]::before { background: var(--warm); }

.card.soft {
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.card.soft:hover {
  box-shadow: var(--shadow-md);
}

.card h3 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.card .muted {
  color: var(--text-secondary);
  font-size: 0.98rem;
  line-height: 1.65;
  margin: 0;
}
.card .tier-note {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--warm);
  margin: 0 0 8px;
}

.list {
  margin: 0;
  padding-left: 18px;
  list-style: disc;
  color: var(--text-secondary);
  font-size: 0.98rem;
  line-height: 1.6;
  display: grid;
  gap: 10px;
}

.list li { margin: 0; }
.list li::marker { color: var(--accent); }
.list a { font-size: inherit; color: var(--accent); }

/* --- Ecosystem --- */
.ecosystem-kicker {
  margin-bottom: 12px;
}

.ecosystem-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.ecosystem-flow span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: #f3f3f3;
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-family: var(--font-mono);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  white-space: nowrap;
}
.btn:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #ff6b35 0%, #ff8c42 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--shadow-accent);
}
.btn-primary:hover {
  color: #fff;
}

.btn-outline {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.72);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink);
}

.btn-sm {
  height: 40px;
  padding: 0 14px;
  font-size: 0.9rem;
  border-radius: 999px;
}

.btn .gh-icon { width: 16px; height: 16px; }

/* --- Code blocks / terminal --- */
.terminal {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #111318;
  color: #f5f5f5;
  box-shadow: 0 24px 54px rgba(15, 23, 42, 0.18);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.terminal-dot:nth-child(1) { background: #ff6b35; }
.terminal-dot:nth-child(2) { background: #ffc857; }
.terminal-dot:nth-child(3) { background: #10b981; }

.terminal-label {
  margin-left: 6px;
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.7);
  font-family: var(--font-mono);
}

.terminal pre {
  margin: 0;
  padding: 18px;
  border: none;
  border-radius: 0;
  background: transparent;
  overflow-x: auto;
}

code {
  font-family: var(--font-mono);
  font-size: 13px;
}

.copy-btn {
  position: absolute;
  top: auto;
  bottom: 10px;
  right: 10px;
}

.hint {
  margin: 0 0 10px;
  color: var(--text-secondary);
  font-size: 13px;
}
.fine {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--text-secondary);
  opacity: 0.85;
  line-height: 1.55;
}

/* --- KPI grid --- */
.kpi {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.kpi .item {
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff 0%, #fbfbfb 100%);
}
.kpi .label {
  color: var(--text-secondary);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.kpi .value {
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}

/* --- Tag (footer) --- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 12.5px;
}
.tag b { color: var(--text); }

/* --- Browser mockup --- */
.browser-mockup {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-top: 16px;
}

.browser-chrome {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.03);
  border-bottom: 1px solid var(--border);
}

.browser-dots {
  display: flex;
  gap: 5px;
}
.browser-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}
.browser-dots span:nth-child(1) { background: #ff5f57; }
.browser-dots span:nth-child(2) { background: #febc2e; }
.browser-dots span:nth-child(3) { background: #28c840; }

.browser-url {
  flex: 1;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  opacity: 0.7;
}

.browser-body {
  padding: 20px;
  background: rgba(0, 0, 0, 0.015);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mock-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.mock-block {
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--accent-subtle);
  border: 1px solid var(--border);
}
.mock-block:nth-child(2) { background: var(--accent2-subtle); }
.mock-block:nth-child(3) { background: var(--warm-subtle); }

.mock-chart {
  height: 72px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
  background: rgba(0, 0, 0, 0.04);
}
.mock-chart svg {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.mock-table {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mock-line {
  height: 10px;
  border-radius: 4px;
  background: var(--surface-hover);
}
.mock-line:nth-child(1) { width: 100%; }
.mock-line:nth-child(2) { width: 85%; }
.mock-line:nth-child(3) { width: 65%; }

/* --- Dashboard preview (real screenshot) --- */
.dashboard-preview {
  display: block;
  text-decoration: none;
  color: inherit;
  margin-top: 16px;
}
.dashboard-preview:hover { text-decoration: none; }

.dashboard-preview:hover .browser-mockup--live {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--accent);
}

.browser-mockup--live {
  transition: border-color 0.3s, box-shadow 0.3s;
}

.browser-body--img {
  padding: 0;
  background: #080c18;
  overflow: hidden;
}
.browser-body--img img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.4s ease;
}
.dashboard-preview:hover .browser-body--img img {
  transform: scale(1.015);
}

.browser-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #28c840;
  background: rgba(40, 200, 64, 0.12);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.preview-cta {
  display: block;
  margin-top: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  transition: color 0.2s;
}
.dashboard-preview:hover .preview-cta {
  color: var(--accent-hover);
}

/* --- Section actions (centered under a section) --- */
.section-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}

/* --- Footer --- */
.footer {
  margin-top: 80px;
  padding: 24px 0 48px;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12.5px;
  line-height: 1.6;
}

/* --- Animations --- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children within a reveal */
.reveal .grid > *:nth-child(1) { transition-delay: 0.04s; }
.reveal .grid > *:nth-child(2) { transition-delay: 0.08s; }
.reveal .grid > *:nth-child(3) { transition-delay: 0.12s; }
.reveal .grid > *:nth-child(4) { transition-delay: 0.16s; }
.reveal .grid > *:nth-child(5) { transition-delay: 0.20s; }

/* Card children inherit reveal when parent is not yet visible */
.reveal:not(.visible) .grid > * {
  opacity: 0;
  transform: translateY(12px);
}
.reveal.visible .grid > * {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

@media (prefers-reduced-motion: reduce) {
  .hero-title, .hero-subtitle, .hero-actions, .pillrow, .disclaimer {
    animation: none !important;
  }
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .reveal .grid > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }

  .col-8, .col-6, .col-4, .col-3 { grid-column: span 12; }

  .hero { padding: 56px 0 32px; }

  .section { padding-top: 52px; }

  .kpi { grid-template-columns: repeat(2, 1fr); }

  .mock-kpis { grid-template-columns: repeat(2, 1fr); }

  .hero-tiers { flex-direction: column; align-items: center; }

  .footer .col-8, .footer .col-4 { grid-column: span 12; }
  .footer .col-4 { text-align: left !important; }
}

@media (min-width: 901px) {
  .hamburger { display: none; }
  .mobile-menu { display: none !important; }
}

@media (max-width: 480px) {
  .wrap { width: min(var(--maxw), calc(100vw - 28px)); }
  .nav-inner { width: min(var(--maxw), calc(100vw - 28px)); }
  .brand-sub { display: none; }
  .hero { padding: 40px 0 24px; }
}
