/* ============================================================
   v2 — Company detail page
   ============================================================ */

/* Header — large logo + name */
.company-header {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 36px;
  align-items: center;
  margin-bottom: 40px;
  padding-top: 8px;
}
.company-logo-frame {
  width: 180px;
  height: 180px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid var(--rule-soft);
  padding: 18px;
  overflow: hidden;
}
.company-logo-frame img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}
.company-logo-fallback {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 36px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #fff;
  background: var(--navy);
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.company-header-info { min-width: 0; }
.company-name {
  font-family: "Source Serif 4", Georgia, serif;
  font-weight: 400;
  font-size: clamp(48px, 6vw, 88px);
  line-height: 0.98;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 4px 0 12px;
  text-wrap: balance;
}
.company-tagline {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 17px;
  line-height: 1.45;
  font-style: italic;
  color: var(--ink-3);
  max-width: 70ch;
}

/* .btn/.btn-ghost (styles.css) are built for the dark hero background --
   near-white text/border, invisible on this page's light background. Same
   fix already used on 404.html/preview.html for a light-bg ghost button,
   just as a scoped rule instead of inline styles. */
.company-header-info .btn-ghost {
  color: var(--ink);
  border-color: var(--ink);
}
.company-header-info .btn-ghost:hover {
  background: var(--ink);
  color: #fff;
}

/* ============== Partner header — colored band, same visual language as the
   BigTech 100 hero (styles.css .hero/.eyebrow/.dot), scaled down to a card
   header. Non-partner companies keep the plain white .company-header.
   .company-header-band bleeds edge-to-edge (same 100vw trick as .hero, which
   gets it for free by sitting outside any max-width container); the nested
   .company-header--partner keeps the page's normal max-width/gutter so its
   content lines up with the rest of the card. ============== */
.company-header-band {
  position: relative;
  width: 100vw;
  left: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  overflow: hidden;
  background: linear-gradient(180deg, var(--navy-deep) 0%, var(--navy) 60%, var(--navy-2) 100%);
  border-bottom: 1px solid var(--navy-deep);
}
.company-header-band::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
}
.company-header-band::after {
  content: "";
  position: absolute;
  right: -160px; top: -160px;
  width: 480px; height: 480px;
  background: radial-gradient(circle, rgba(59,130,246,0.32) 0%, rgba(59,130,246,0) 60%);
  pointer-events: none;
}
.company-header--partner {
  position: relative;
  z-index: 1;
  color: #EAF0FB;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 40px var(--gutter) 36px;
}
.company-header--partner .section-eyebrow { color: rgba(220,231,250,0.85); flex-wrap: wrap; row-gap: 8px; }
.company-header--partner .section-eyebrow .dot {
  background: var(--blue-bright);
  box-shadow: 0 0 0 4px rgba(59,130,246,0.22), 0 0 14px rgba(59,130,246,0.6);
}
.company-header--partner .company-name { color: #fff; }
.company-header--partner .company-tagline { color: rgba(234,240,251,0.78); }
.company-header--partner .company-logo-frame { border-color: rgba(255,255,255,0.25); }
.company-header--partner .company-header-info .btn-ghost {
  color: #EAF0FB;
  border-color: rgba(255,255,255,0.4);
}
.company-header--partner .company-header-info .btn-ghost:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
  border-color: #fff;
}
.partner-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #EAF0FB;
  background: rgba(59, 130, 246, 0.22);
  border: 1px solid rgba(91, 141, 239, 0.55);
}

/* ============== Rank badges — position in a ranking, dynamics, staff count ==============
   Deliberately not the shared .section-stats/.section-stat grid (sections.css) — that
   component is a wide left-aligned KPI row reused verbatim on other pages (research shop,
   market hub). These are small square tiles built for scanability plus click-to-scroll
   (badge.url, wired in ranking/badge_config.py + ranking/services.py) into the source
   ranking table. No bottom border on the wrapper — the next .sub-section already draws its
   own top border, so a single rule separates the two blocks instead of two close together. */
.rank-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 40px 0 0;
  padding-top: 32px;
  border-top: 2px solid var(--ink);
}
.rank-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100px;
  aspect-ratio: 1;
  padding: 14px 8px 8px;
  text-align: center;
  background: #fff;
  border: 1px solid var(--rule-soft);
  color: inherit;
  text-decoration: none;
}
.rank-badge-num {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 26px;
  line-height: 1;
  color: var(--ink);
  font-feature-settings: "lnum";
}
.rank-badge-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  line-height: 1.35;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-3);
}
a.rank-badge {
  cursor: pointer;
  transition: border-color .18s ease, background-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
a.rank-badge:hover {
  border-color: var(--blue);
  background: var(--blue-pale);
  transform: translateY(-3px);
  box-shadow: 0 8px 18px rgba(10, 31, 68, 0.1);
}
a.rank-badge:hover .rank-badge-num { color: var(--blue); }
a.rank-badge:active {
  transform: translateY(-1px);
  background: var(--blue-pale);
  border-color: var(--blue-2);
  box-shadow: none;
}
a.rank-badge:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  a.rank-badge { transition: none; }
}

/* ============== Revenue chart (SVG line + area) ============== */
.rev-chart {
  position: relative;
  margin-top: 24px;
  padding: 56px 24px 48px;
  background: var(--paper-2);
  border: 1px solid var(--rule-soft);
  height: 320px;
  box-sizing: border-box;
}
.rev-chart-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.rev-pt {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 2;
}
.rev-pt-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--blue);
  box-shadow: 0 4px 14px rgba(37,99,235,0.35);
}
.rev-pt-value {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.012em;
  color: var(--ink);
  white-space: nowrap;
  font-feature-settings: "lnum";
  background: rgba(247,248,251,0.95);
  padding: 2px 8px;
}
.rev-axis {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  height: 24px;
  pointer-events: none;
}
.rev-axis-tick {
  position: absolute;
  transform: translateX(-50%);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
}

.revenue-growth-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--rule-soft);
}
.revenue-growth-label {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
}
.revenue-growth-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
  background: #fff;
  border: 1px solid var(--rule-soft);
}
.revenue-growth-pill.up { color: var(--up); border-color: var(--up); }
.revenue-growth-pill.down { color: var(--down); border-color: var(--down); }

[x-cloak] { display: none !important; }

/* Год/Квартал + Выручка/GMV toggles above the chart -- same visual language
   as .sort-tab on the market ranking table (v2/ranking/ranking_detail.html). */
.rev-chart-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 16px;
}
.rev-toggle-group {
  display: inline-flex;
  gap: 8px;
}
.rev-toggle-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--ink-3);
  background: none;
  border: 1px solid var(--rule-soft);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  /* Mobile Chrome/Safari paint their own blue tap-highlight overlay on
     <button> taps, covering the label until the tap sequence ends -- kill it
     and let our own .active/:hover styles be the only feedback. */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.rev-toggle-btn:hover:not(:disabled) {
  color: var(--ink);
  border-color: var(--ink);
}
.rev-toggle-btn.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.rev-toggle-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ============== About block — accent card ==============
   Same visual move as .company-ceo just below it on the card (tinted
   background + blue left rule) so the two blocks read as one language
   instead of a plain label sitting over bare text. */
.company-about-card {
  display: flex;
  gap: 20px;
  background: var(--paper-2);
  border-left: 3px solid var(--blue);
  padding: 22px 26px;
  margin-top: 16px;
  max-width: 720px;
}
.company-about-mark {
  font-family: "Source Serif 4", Georgia, serif;
  font-style: italic;
  font-size: 40px;
  line-height: 1;
  color: var(--blue);
  flex-shrink: 0;
  user-select: none;
}
.company-about-card .cms-prose.company-about-prose {
  margin: 0;
}
.company-about-card .cms-prose.company-about-prose p:last-child {
  margin-bottom: 0;
}

/* ============== CEO block ============== */
.company-ceo {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 24px 28px;
  background: var(--paper-2);
  border-left: 3px solid var(--blue);
  margin-top: 16px;
  max-width: 720px;
}
.company-ceo-photo {
  width: 96px;
  height: 96px;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid var(--rule-soft);
  overflow: hidden;
  display: grid;
  place-items: center;
}
.company-ceo-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.company-ceo-fallback {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #fff;
  background: var(--navy);
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}
.company-ceo-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.company-ceo-role {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
  font-weight: 500;
}
.company-ceo-name {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 28px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.012em;
  color: var(--ink);
}

/* ============== Markets list (replaces .rank-industries quirky grid) ============== */
.company-markets {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}
.company-markets > * {
  flex: 1 1 240px;
  max-width: 320px;
  min-width: 0;
}
.company-market-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px 20px;
  background: #fff;
  border: 1px solid var(--rule-soft);
  text-decoration: none;
  color: inherit;
  transition: background .15s, border-color .15s, transform .15s;
}
.company-market-card:hover {
  background: var(--blue-pale);
  border-color: var(--blue);
  transform: translateY(-2px);
}
.company-market-code {
  align-self: flex-start;
  background: var(--ink);
  color: #fff;
  padding: 4px 8px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
}
.company-market-name {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.012em;
  line-height: 1.2;
  color: var(--ink);
}
.company-market-cta {
  margin-top: auto;
  padding-top: 8px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--blue);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.company-market-cta span { transition: transform .15s; display: inline-block; }
.company-market-card:hover .company-market-cta span { transform: translateX(3px); }

/* ============== Partner research (cross-link to researchShop) ============== */
.company-research-grid {
  display: grid;
  /* auto-fit (not auto-fill): collapses empty tracks so a lone card doesn't
     get squeezed into a narrow column while invisible empty tracks eat the
     rest of the row. Capped at 380px (not 1fr) so with just 1-2 cards it
     stays a card-sized block instead of stretching full page width. */
  grid-template-columns: repeat(auto-fit, minmax(280px, 380px));
  gap: 20px;
  margin-top: 16px;
}
.company-research-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--rule-soft);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.company-research-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px -16px rgba(10, 31, 68, 0.2);
}
.company-research-cover {
  position: relative;
  aspect-ratio: 3 / 2;
  background: linear-gradient(135deg, var(--navy-deep), var(--blue-2));
  overflow: hidden;
}
.company-research-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left center;
  display: block;
}
.company-research-cover-pattern {
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(45deg, transparent 0 14px, rgba(255, 255, 255, 0.06) 14px 15px),
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.18), transparent 60%);
}
.company-research-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--blue-bright);
  color: #fff;
  padding: 5px 8px;
}
.company-research-tag {
  position: absolute;
  bottom: 16px;
  right: 16px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(0, 0, 0, 0.25);
  padding: 5px 8px;
  backdrop-filter: blur(4px);
}
.company-research-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.company-research-title {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: var(--ink);
}
.company-research-sub {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-3);
  flex: 1;
}
.company-research-cta {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--rule-soft);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--blue);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.company-research-cta span { transition: transform .15s; display: inline-block; }
.company-research-card:hover .company-research-cta span { transform: translateX(3px); }

@media (max-width: 720px) {
  .company-header {
    grid-template-columns: 1fr;
    gap: 20px;
    text-align: center;
  }
  .company-logo-frame {
    width: 140px;
    height: 140px;
    margin: 0 auto;
    padding: 14px;
  }
  .company-name { font-size: clamp(36px, 9vw, 56px); }
  .company-tagline { margin: 0 auto; }
  .rank-badges { justify-content: center; padding-top: 24px; }
  .rank-badge { width: 84px; }
  .rank-badge-num { font-size: 22px; }
  .rev-chart { padding: 40px 12px 40px; height: 260px; }
  .rev-pt-value { font-size: 14px; padding: 1px 5px; bottom: 18px; }
  .rev-pt-dot { width: 10px; height: 10px; border-width: 2px; }
  .rev-axis-tick { font-size: 10px; letter-spacing: 0.1em; }
  .rev-chart-toggles { gap: 12px; }
  .rev-toggle-btn { padding: 6px 12px; }
  .company-ceo { flex-direction: column; gap: 16px; padding: 20px; text-align: center; }
  .company-ceo-photo { width: 80px; height: 80px; }
  .company-ceo-name { font-size: 22px; }
  .company-markets { grid-template-columns: 1fr; }
}
