/* ============================
   Enterprise Page
   Builds on home.css (container, section heads, logo grid, trust cards) and feature-page.css (section heads, cards)
   ============================ */

body {
  text-wrap: pretty;
}

/* ---- Hero: centered copy, same type scale as the security and pricing heroes ---- */
.ent-hero {
  padding-top: calc(var(--hp-nav-height) + clamp(48px, 5.5vw, 104px));
  text-align: center;
}
.ent-headline {
  max-width: 17em;
  margin: 0 auto;
  text-wrap: balance;
  font-size: clamp(44px, 5.4vw, 80px);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}
.ent-subhead {
  max-width: 34em;
  margin: clamp(24px, 2.4vw, 40px) auto 0;
  text-wrap: balance;
  font-size: 20px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--hp-text-muted);
}
.ent-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: clamp(32px, 3.2vw, 48px);
}
.ent-headline,
.ent-subhead,
.ent-actions {
  opacity: 0;
  animation: heroBlurIn 0.6s ease forwards;
}
.ent-subhead { animation-delay: 0.1s; }
.ent-actions { animation-delay: 0.2s; }

/* ---- Logos: plain marks like the customers page, one row of six on desktop, two rows of three on mobile ---- */
.ent-logos {
  padding-top: clamp(64px, 6.5vw, 104px);
  opacity: 0;
  animation: heroFadeIn 0.8s ease 0.3s forwards;
}
.ent-logo-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  column-gap: clamp(16px, 2vw, 28px);
  row-gap: 44px;
  align-items: center;
}
.ent-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  container-type: inline-size;
}
/* Six columns are wider than the customers page's seven, so the unit is scaled by 6/7 to keep the marks the same size */
.ent-logo img {
  height: calc(var(--h, 23) * var(--hp-logo-unit, 0.4815cqi));
  width: auto;
  max-width: 86%;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

/* ---- Sections: product page rhythm ---- */
.ent-section { padding-top: clamp(120px, 13vw, 220px); }
.ent-section--first { padding-top: clamp(96px, 11vw, 200px); }
.ent-section--end { padding-bottom: clamp(80px, 9vw, 160px); }
.ent-section .hp-customers-desc { text-wrap: pretty; }

/* ---- Why enterprise: the feature page diagram (feature-page.css, .fpd) with two Deck stages in a row.
   The arrows are the vault diagram's, so they cross the borders the same way. ---- */
.fpd--ent {
  --fpd-h: 220px;
  --fpd-pad: 32px;
  --fpd-gap: 40px;
  --fpd-link: 32px;
  --fpd-cell: 16px;
  font-size: 14px;
}
.ent-d-box {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 16px;
  /* Sized to the longest item, "Managed proxies", so the stages match. The side padding is
     --fpd-pad because the in and out arrows are measured to end that far inside the box */
  width: calc(16ch + 2 * var(--fpd-pad) + 2px);
  padding: 0 var(--fpd-pad);
  transition: border-color 0.3s ease;
}
.ent-d-box.is-on { border-color: rgba(255, 255, 255, 0.3); }
.ent-d-list li,
.ent-d-sources [data-source] { transition: color 0.3s ease; }
.ent-d-box.is-on li,
.ent-d-sources .is-on { color: var(--fpd-strong); }
.ent-d-box.is-on li:nth-child(2) { transition-delay: 120ms; }
.ent-d-box.is-on li:nth-child(3) { transition-delay: 240ms; }
.ent-d-box.is-on li:nth-child(4) { transition-delay: 360ms; }
.ent-d-box.is-on li:nth-child(5) { transition-delay: 480ms; }
/* The pool is a picture, not a list, so it and its caption sit centered in the box */
.ent-d-box--agents { align-items: center; gap: 20px; }
.ent-d-box--agents .ent-d-list { text-align: center; }
/* At this size the machine's title bar reads as noise, so each agent is a square with its progress line */
.ent-d-pool { grid-template-columns: repeat(6, var(--fpd-cell)); grid-auto-rows: var(--fpd-cell); gap: 6px; }
.ent-d-pool i::before { display: none; }
.ent-d-pool i::after { left: 3px; right: 3px; bottom: 3px; }
/* ---- Premium support: a product page feature row (home.css .hp-feature) with the shared Slack channel
   in its glass. Not a link, so it skips the row's hover tint. ---- */
@media (hover: hover) {
  .ent-feature:hover { background-color: rgba(255, 255, 255, 0.03); }
}
/* The rows' glass sizes to its blocks and sits centered on the landscape */
.hp-feature-glass.ent-glass {
  display: block;
  inset: 50% 12% auto;
  transform: translateY(-50%);
  border-radius: 18px;
}
.ent-feature-note { font-size: 15px; color: rgba(255, 255, 255, 0.5); }
/* Shared Slack channel: an illustration, so it stays in English and keeps its own type scale */
.ent-slack-feed { display: flex; flex-direction: column; gap: 7px; text-align: start; }
.ent-slack-channel,
.ent-msg {
  background: #0D100F;
  border-radius: 11px;
}
.ent-slack-channel {
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  color: #F6F6F6;
}
.ent-slack-channel b { font-weight: 400; color: rgba(246, 246, 246, 0.5); }
.ent-msg {
  display: flex;
  gap: 12px;
  padding: 16px;
}
.ent-avatar {
  display: grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  overflow: hidden;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}
.ent-avatar--acme { background: #6C4A99; }
.ent-avatar--deck { background: #286650; }
.ent-avatar--deck img { display: block; width: 72%; height: auto; }
.ent-msg-body {
  min-width: 0;
  font-size: 15px;
  line-height: 1.5;
  color: rgba(246, 246, 246, 0.85);
}
.ent-msg-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
}
.ent-msg-meta b { font-weight: 700; color: #F6F6F6; }
.ent-msg-meta time { font-size: 12px; color: rgba(246, 246, 246, 0.5); }
.ent-reaction {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  padding: 0 8px;
  background: rgba(40, 102, 80, 0.3);
  border: 1px solid #286650;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 22px;
  color: #F6F6F6;
}

/* Messages arrive one by one once the channel scrolls into view; the script only arms this when it runs */
.ent-slack.is-armed .ent-msg {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.ent-slack.is-armed.is-visible .ent-msg { opacity: 1; transform: none; }
.ent-slack.is-armed.is-visible .ent-msg:nth-child(3) { transition-delay: 0.6s; }
.ent-slack.is-armed.is-visible .ent-msg:nth-child(4) { transition-delay: 1.2s; }

/* ---- Workflows: the homepage use case cards (home.css), which read their colors from these ---- */
.ent-uses {
  --fg: #F7F8F8;
  --fg-2: #8A8F98;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}
/* Migrations: two-line rows like the Pay portal, on the Swap row's one-by-one hover sequence */
.ent-use-migrate li { height: 68px; }
.ent-use-migrate img { width: 32px; height: 32px; border-radius: 7px; }
.ent-use-migrate li > span { flex-direction: column; gap: 1px; }

/* ---- Limits: the value leads, with a fixed gap so the labels line up across cards ---- */
.ent-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: clamp(56px, 6.5vw, 104px);
}
.ent-stat {
  padding: 20px 20px 28px;
  background: rgba(255, 255, 255, 0.03);
}
.ent-stat-value {
  margin-bottom: clamp(48px, 6vw, 112px);
  font-size: clamp(44px, 4.4vw, 68px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

/* ---- Controls: four panels, each a short intro and a check list ---- */
.ent-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: clamp(56px, 6.5vw, 104px);
}
.ent-panel {
  display: flex;
  flex-direction: column;
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
}
.ent-panel-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: clamp(4px, 1.2vw, 20px);
}
.ent-panel-title {
  font-size: clamp(26px, 2.4vw, 36px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
.ent-panel-desc {
  margin-top: 16px;
  font-size: 18px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.72);
}
.ent-panel-link { margin: auto 0 0; padding-top: 28px; }
@media (hover: hover) {
  .ent-panel-link:hover { color: #9CC5B5; }
  .ent-panel-link:hover svg { transform: translateX(4px); }
}

/* Egress demo (enterprise.js): the auth demos' parts, with a fixed source, checks and recent requests */
.ent-egress { grid-template-rows: auto auto minmax(0, 1fr); }
.ent-egress .fp-stealth-session { flex: none; }
.ent-egress .hp-auth-logo { width: 24px; height: 24px; border-radius: 5px; font-size: 11px; }

/* Check list: same marker as the security page */
.ent-checks {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 28px 0 0;
  padding: 28px 0 0;
  list-style: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.ent-checks li {
  position: relative;
  padding-inline-start: 28px;
  font-size: 16px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.82);
}
.ent-checks li::before {
  content: '';
  position: absolute;
  top: 2px;
  inset-inline-start: 0;
  width: 17px;
  height: 17px;
  background: #77AB97;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5l3 3 6-7'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5l3 3 6-7'/%3E%3C/svg%3E") center / contain no-repeat;
}

@media (prefers-reduced-motion: reduce) {
  .ent-slack.is-armed .ent-msg { transition: none; }
  .ent-d-box, .ent-d-list li { transition: none; }
}

/* ============================
   Responsive
   ============================ */
/* Small laptops: the diagram a size down, matching the other feature page diagrams at this tier */
@media (min-width: 1001px) and (max-width: 1280px) {
  .fpd--ent { --fpd-h: 200px; --fpd-pad: 24px; --fpd-gap: 32px; --fpd-link: 24px; --fpd-cell: 14px; font-size: 12px; }
}
@media (min-width: 901px) and (max-width: 1280px) {
  .hp-feature-glass.ent-glass { left: 6%; right: 6%; }
  .ent-msg { padding: 14px; }
  .ent-msg-body { font-size: 13px; }
}
/* Narrow two column rows wrap the messages onto more lines, so the row grows to keep the photo around them */
@media (min-width: 901px) and (max-width: 1100px) {
  .ent-feature--slack { --feature-h: 540px; }
}

/* Stacked with the other diagrams (feature-page.css), the stages run full width and center their lists */
@media (max-width: 1000px) {
  .fpd--ent .fpd-deck { align-self: stretch; }
  .ent-d-box { align-self: stretch; align-items: center; width: auto; padding: 40px 32px 32px; }
  .ent-d-list { text-align: center; }
}

@media (max-width: 900px) {
  .ent-logo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ent-logo img { --hp-logo-unit: 0.5cqi; max-width: 80%; }
  .ent-stats { grid-template-columns: minmax(0, 1fr); }
  .ent-panels { grid-template-columns: minmax(0, 1fr); }
  .ent-panel-desc { font-size: 17px; }
  /* Stacked, the landscape grows with its blocks instead of holding a fixed ratio */
  .ent-feature--slack .hp-feature-visual--demo { aspect-ratio: auto; padding: 48px 14px; }
  .hp-feature-glass.ent-glass { position: relative; inset: auto; transform: none; }
}

@media (max-width: 768px) {
  .ent-hero { padding-top: calc(var(--hp-nav-height) + 40px); }
  .ent-subhead { font-size: 18px; }
}

@media (max-width: 600px) {
  .ent-msg { gap: 10px; padding: 14px; }
  .ent-msg-body { font-size: 14px; }
  .ent-panel { padding: 14px; }
}

@media (max-width: 440px) {
  .ent-actions { flex-direction: column; }
  .ent-actions .hp-btn { width: 100%; }
}
