/* ==========================================================================
   Shark Ecom — home.css
   Секції головної: hero, stats, services, infra, manifesto, recruitment
   Потребує base.css
   ========================================================================== */

/* HERO */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(var(--nav-h) + 48px) var(--pad-x) 80px;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 64px;
  align-items: center;
  min-height: calc(100vh - 200px);
}

.hero-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero::before {
  content: '';
  position: absolute;
  top: -200px; right: -200px;
  width: 700px; height: 700px;
  background: radial-gradient(ellipse, rgba(30,143,255,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 36px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.hero-eyebrow::before {
  content: '';
  width: 28px;
  height: 1px;
  background: var(--accent);
}

.hero-stack {
  position: relative;
  height: 100%;
  min-height: 540px;
}

.stack-label {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  z-index: 3;
}

.stack-label::after {
  content: '';
  width: 44px;
  height: 1px;
  background: var(--accent);
}

.logos-scatter {
  position: absolute;
  inset: 0;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Позиція і рух живуть на .bub, а не на .bubble.
   Якщо перенести анімацію всередину, поїде тільки кружечок, а підпис
   лишиться на місці й з часом опиниться під чужим логотипом.
   translate і transform — різні властивості, тому центрування через
   transform і дрейф через translate не конфліктують. */
.bub {
  position: absolute;
  transform: translate(-50%, -50%);
  animation: drift var(--dur) ease-in-out var(--delay) infinite alternate;
}

.bubble {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: #f2f5fb;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.28s ease;
  box-shadow:
    0 18px 40px -12px rgba(0,0,0,0.7),
    0 0 0 1px rgba(255,255,255,0.08),
    inset 0 -8px 18px -8px rgba(10,14,25,0.22);
}

/* Акцентний ореол під диском */
.bubble::before {
  content: '';
  position: absolute;
  inset: -22%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(30,143,255,0.22), transparent 68%);
  z-index: -1;
}

.bubble img {
  width: 58%;
  height: 58%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.bub:hover .bubble {
  transform: scale(1.09);
  box-shadow:
    0 26px 60px -14px rgba(0,0,0,0.8),
    0 0 0 1px rgba(30,143,255,0.5),
    0 0 34px -4px rgba(30,143,255,0.35);
}

@keyframes drift {
  from { translate: 0 0; }
  to   { translate: var(--dx) var(--dy); }
}

.bub-name {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.22s ease;
  pointer-events: none;
}

.bub:hover .bub-name { opacity: 1; }

/* STATS */
.stats {
  padding: 0 var(--pad-x) 100px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.stat {
  background: var(--surface);
  padding: 36px 32px;
  position: relative;
}

.stat-num {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 42px;
  color: #fff;
  line-height: 1;
  margin-bottom: 8px;
  letter-spacing: -1px;
}

.stat-num span { color: var(--accent); }

.stat-label {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.4;
}

/* SERVICES */
/* Services Timeline */
.services-timeline {
  position: relative;
  margin-top: 40px;
}

.services-timeline::before {
  content: '';
  position: absolute;
  top: 60px;
  bottom: 60px;
  left: 120px;
  width: 1px;
  background: linear-gradient(
    to bottom,
    transparent,
    var(--accent-dim) 6%,
    var(--accent-dim) 94%,
    transparent
  );
}

.timeline-item {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 60px;
  padding: 36px 0;
  align-items: center;
  position: relative;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 120px;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--accent);
  z-index: 1;
  transition: background 0.3s, box-shadow 0.3s, transform 0.3s;
}

.timeline-item:hover::before {
  background: var(--accent);
  box-shadow: 0 0 14px rgba(30,143,255,0.6);
  transform: translate(-50%, -50%) scale(1.25);
}

.timeline-item:hover .timeline-num {
  color: var(--accent);
}

.timeline-num {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 56px;
  line-height: 1;
  color: var(--muted);
  letter-spacing: -2px;
  transition: color 0.3s;
  text-align: right;
}

.timeline-content {
  padding-left: 40px;
}

.timeline-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 22px;
  color: #fff;
  margin-bottom: 10px;
  letter-spacing: -0.5px;
}

.timeline-desc {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.65;
  max-width: 600px;
}

/* INFRA */
.infra {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.infra-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.infra-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 40px;
}

.infra-item {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 15px;
  color: var(--text);
  font-weight: 400;
}

.infra-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* Operations map */
.ops-map {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 520px;
  margin-left: auto;
}

.ops-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.ops-line {
  fill: none;
  stroke: rgba(30, 143, 255, 0.28);
  stroke-width: 1;
  stroke-dasharray: 3 5;
  animation: ops-flow 8s linear infinite;
  vector-effect: non-scaling-stroke;
}

@keyframes ops-flow {
  to { stroke-dashoffset: -64; }
}

.ops-node {
  position: absolute;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2;
  width: 33%;
  min-width: 140px;
  transition: border-color 0.3s, background 0.3s;
}

.ops-node:hover {
  border-color: var(--accent-border);
  background: var(--surface2);
}

.ops-node.tl { top: 0; left: 0; }
.ops-node.tr { top: 0; right: 0; }
.ops-node.bl { bottom: 0; left: 0; }
.ops-node.br { bottom: 0; right: 0; }

.ops-icon {
  width: 22px;
  height: 22px;
  color: var(--accent);
  margin-bottom: 2px;
}

.ops-icon svg {
  width: 100%;
  height: 100%;
}

.ops-label {
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  letter-spacing: -0.01em;
}

.ops-meta {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}

.ops-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 33%;
  aspect-ratio: 1 / 1;
  background: var(--surface2);
  border: 1px solid var(--accent-border);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  z-index: 3;
  text-align: center;
  padding: 16px;
}

.ops-center::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 18px;
  border: 1px solid var(--accent);
  opacity: 0;
  animation: ops-pulse 3.5s ease-out infinite;
  pointer-events: none;
}

@keyframes ops-pulse {
  0% { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(1.22); opacity: 0; }
}

.ops-center-name {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 14px;
  color: #fff;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.1;
}

.ops-center-status {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ops-center-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  animation: ops-blink 2s ease-in-out infinite;
}

@keyframes ops-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* RECRUITMENT */
.recruitment {
  padding: 120px var(--pad-x);
}

.recruitment-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}

.recruitment-left h2 {
  margin-bottom: 24px;
}

.recruitment-left .section-intro {
  margin-bottom: 36px;
  max-width: 460px;
}

.principles {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 40px;
}

.principle {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  font-size: 15px;
  color: var(--text);
  line-height: 1.5;
}

.principle-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--accent);
}

.principle-icon svg { width: 100%; height: 100%; }

.recruitment-right {
  border-left: 1px solid var(--border);
  padding-left: 60px;
}

.roles-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 28px;
}

.roles-list {
  list-style: none;
  margin-bottom: 32px;
}

.role-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  transition: padding-left 0.25s, color 0.25s;
  cursor: default;
}

.role-item:last-child { border-bottom: none; }

.role-item:hover {
  padding-left: 8px;
}

.role-item:hover .role-name {
  color: #fff;
}

.role-item:hover .role-arrow {
  color: var(--accent);
  transform: translateX(4px);
}

.role-name {
  font-size: 15px;
  font-weight: 400;
  color: var(--text);
  transition: color 0.25s;
}

.role-arrow {
  font-size: 18px;
  color: var(--muted);
  transition: color 0.25s, transform 0.25s;
}

.recruitment-note {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.recruitment-note a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-border);
  transition: border-color 0.2s;
}

.recruitment-note a:hover {
  border-bottom-color: var(--accent);
}

/* MANIFESTO */
.manifesto {
  padding: 120px var(--pad-x);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.manifesto::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 600px; height: 600px;
  background: radial-gradient(ellipse, rgba(30,143,255,0.05) 0%, transparent 70%);
  pointer-events: none;
}

.manifesto-inner {
  max-width: 820px;
  margin: 0 auto;
  position: relative;
}

.manifesto-line {
  width: 40px;
  height: 1px;
  background: var(--accent);
  margin: 0 auto 48px;
}

.manifesto-text {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: clamp(24px, 3.5vw, 40px);
  line-height: 1.35;
  color: #fff;
  letter-spacing: -0.5px;
}

.manifesto-text em {
  font-style: normal;
  color: var(--accent);
}

.manifesto-sig {
  margin-top: 48px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Polaroid — founder photo mementos */
.polaroid {
  position: absolute;
  width: 200px;
  background: #f5f1e8;
  padding: 12px 12px 44px;
  border-radius: 2px;
  box-shadow:
    0 1px 2px rgba(0,0,0,0.4),
    0 16px 36px rgba(0,0,0,0.55),
    0 0 0 1px rgba(255,255,255,0.04);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 2;
}

.polaroid.right {
  top: 80px;
  right: 80px;
  transform: rotate(-5deg);
}

.polaroid.left {
  top: 100px;
  left: 80px;
  transform: rotate(6deg);
}

.polaroid.right:hover {
  transform: rotate(-2deg) scale(1.03);
}

.polaroid.left:hover {
  transform: rotate(3deg) scale(1.03);
}

.polaroid::before {
  /* tape strip */
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  width: 60px;
  height: 18px;
  background: rgba(220, 220, 200, 0.55);
  border-left: 1px dashed rgba(0,0,0,0.06);
  border-right: 1px dashed rgba(0,0,0,0.06);
  backdrop-filter: blur(2px);
}

.polaroid.right::before { transform: translateX(-50%) rotate(-3deg); }
.polaroid.left::before { transform: translateX(-50%) rotate(4deg); }

.polaroid img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
  filter: contrast(0.95) saturate(0.85) brightness(1.02);
}

.polaroid-caption {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: 'Caveat', cursive;
  font-weight: 500;
  font-size: 17px;
  color: #2c2820;
  letter-spacing: 0.5px;
  transform: rotate(-1deg);
}

/* RESPONSIVE */
@media (max-width: 1024px) {
  .polaroid { width: 170px; }
  .polaroid.right { top: 56px; right: 32px; }
  .polaroid.left { top: 70px; left: 32px; }
  .polaroid img { height: 180px; }
  .hero-grid { grid-template-columns: 1fr; gap: 48px; min-height: auto; }
  .hero-stack { min-height: auto; height: auto; padding-top: 24px; }
  .stack-label { position: relative; margin-bottom: 20px; }

  /* Вільне розкидування на вузькому екрані перетворюється на кашу,
     тому бульбашки стають сіткою. Три колонки, а не чотири: одинадцять
     логотипів по чотири лишали обрубаний останній ряд. */
  .logos-scatter {
    position: relative;
    inset: auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 26px 12px;
    place-items: center;
  }

  /* .bub ширший за бульбашку — його розтягує підпис. Без flex-центрування
     кружечок притискається до лівого краю комірки. */
  .bub {
    position: static;
    transform: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: bob var(--dur) ease-in-out var(--delay) infinite alternate;
  }

  .bubble { --size: clamp(64px, 20vw, 88px) !important; }

  @keyframes bob {
    from { translate: 0 0; }
    to   { translate: 0 -7px; }
  }

  .bub-name {
    position: static;
    transform: none;
    opacity: 1;
    white-space: normal;
    font-size: 11px;
    color: var(--muted);
    margin-top: 8px;
    text-align: center;
  }
}

@media (max-width: 900px) {
  .stats { padding-left: var(--pad-x); padding-right: var(--pad-x); }

  /* FIX #5, #8: cleaner h1 on mobile */
  h1 { letter-spacing: -0.5px; }
  h1 .br-desktop { display: inline; }

  /* FIX #7: center stack label on mobile */
  .stack-label { justify-content: center; }
  .stack-label::after { display: none; }
  .stack-label::before {
    content: '';
    width: 24px; height: 1px; background: var(--accent);
    margin-right: 4px;
  }

  /* FIX #11: full-width hero buttons */
  .hero-actions { flex-direction: column; gap: 10px; }
  .hero-actions .btn-primary,
  .hero-actions .btn-ghost { width: 100%; justify-content: center; text-align: center; }

  /* FIX #3: smaller stats numbers */
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat { padding: 28px 20px; }
  .stat-num { font-size: 32px; letter-spacing: -0.5px; }
  .stat-label { font-size: 13px; }

  /* FIX #12: tighter timeline numbers */
  .services-timeline::before { left: 56px; }
  .timeline-item { grid-template-columns: 46px 1fr; gap: 24px; padding: 22px 0; }
  .timeline-item::before { left: 56px; }
  .timeline-num { font-size: 32px; letter-spacing: -1px; }
  .timeline-content { padding-left: 24px; }
  .timeline-title { font-size: 18px; }
  .timeline-desc { font-size: 14px; }

  .infra-inner { grid-template-columns: 1fr; gap: 40px; }

  /* FIX #6: manifesto padding reduced */
  .manifesto { padding: 56px 24px 72px; }
  .manifesto-line { margin-bottom: 32px; }
  .manifesto-sig { margin-top: 32px; }

  .manifesto {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 0;
    justify-items: center;
    align-items: start;
  }
  .polaroid {
    position: relative;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    width: 145px;
    padding: 9px 9px 34px;
    margin-bottom: 32px;
  }
  .polaroid.left {
    grid-column: 1;
    grid-row: 1;
    transform: rotate(5deg);
    justify-self: end;
    margin-right: -8px;
  }
  .polaroid.right {
    grid-column: 2;
    grid-row: 1;
    transform: rotate(-4deg);
    justify-self: start;
    margin-left: -8px;
  }
  .manifesto-inner {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
  }
  .polaroid.right:hover { transform: rotate(-1deg) scale(1.02); }
  .polaroid.left:hover { transform: rotate(2deg) scale(1.02); }
  .polaroid img { height: 150px; }
  .polaroid-caption { font-size: 14px; bottom: 6px; }

  /* FIX #4: ops-map single column on mobile */
  .ops-map { aspect-ratio: auto; max-width: 100%; display: flex; flex-direction: column; gap: 10px; }
  .ops-lines { display: none; }
  .ops-node, .ops-center {
    position: relative;
    top: auto !important; left: auto !important;
    right: auto !important; bottom: auto !important;
    transform: none;
    width: 100%;
    min-width: 0;
    aspect-ratio: auto;
    flex-direction: row;
    align-items: center;
  }
  .ops-node { gap: 14px; }
  .ops-node .ops-icon {
    flex-shrink: 0;
    margin-top: 0;
  }
  .ops-node .ops-label { font-size: 14px; }
  .ops-node .ops-meta {
    font-size: 12px;
    flex-grow: 1;
    text-align: right;
  }
  .ops-center {
    aspect-ratio: auto;
    padding: 18px 22px;
    flex-direction: row;
    justify-content: space-between;
  }
  .ops-center::after { display: none; }
  .ops-center-name { font-size: 13px; }

  .recruitment-grid { grid-template-columns: 1fr; gap: 56px; }
  .recruitment-right { border-left: none; padding-left: 0; padding-top: 16px; border-top: 1px solid var(--border); }

  /* FIX #10: bigger tap area for role items */
  .role-item { padding: 22px 0; }
  .role-name { font-size: 16px; }

}

/* --------------------------------------------------------------------------
   Список напрямків на головній — тепер це справжні посилання, а не li[onclick]
   -------------------------------------------------------------------------- */

.roles-list li { border-bottom: 1px solid var(--border); }
.roles-list li:last-child { border-bottom: none; }

a.role-item {
  text-decoration: none;
  color: inherit;
  border-bottom: none;
  cursor: pointer;
  gap: 14px;
}

.role-badge {
  margin-left: auto;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent-border);
  background: var(--accent-dim);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}

.role-item .role-name { flex: 0 1 auto; }

.roles-all {
  padding: 12px 22px;
  font-size: 14px;
}

@media (max-width: 900px) {
  .roles-all { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .bub { animation: none !important; }
  .logos-scatter { transition: none; }
}
