/* ============================================================
   Bitubi — Base design system (shared across all 3 versions)
   Tokens extracted from brand spec (02-design-tokens.md)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Host+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600&family=Geist+Mono:wght@400;500;600&display=swap');

:root {
  /* Brand */
  --primary: #553EF9;
  --primary-700: #3F2BD4;
  --primary-600: #4A35E6;
  --primary-300: #9485FB;
  --primary-tint: #F1F0FF;
  --primary-tint-2: #E7E4FF;
  --accent: #DD4710;
  --accent-soft: #FBE7DE;

  /* Neutrals */
  --bg: #FFFFFF;
  --fg: #0A0A0A;
  --fg-2: #1C1B22;
  --muted: #6A6A75;
  --muted-2: #9A9AA4;
  --line: #ECECF1;
  --line-2: #E2E1EA;

  /* Type */
  --font-head: 'Host Grotesk', 'Plus Jakarta Sans', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, monospace;

  /* Radii */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 32px;
  --r-pill: 999px;

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(16,15,40,.04), 0 1px 3px rgba(16,15,40,.06);
  --shadow-md: 0 4px 16px rgba(16,15,40,.06), 0 12px 32px rgba(16,15,40,.05);
  --shadow-lg: 0 12px 40px rgba(50,40,120,.12), 0 32px 80px rgba(50,40,120,.10);
  --shadow-primary: 0 12px 30px rgba(85,62,249,.28);

  /* Layout */
  --container: 1200px;
  --container-wide: 1280px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--fg);
  background: var(--bg);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }

/* ---- Layout primitives ---- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 22px;
}

.section { padding-block: clamp(64px, 9vw, 120px); }
.section-sm { padding-block: clamp(48px, 6vw, 80px); }

/* ---- Eyebrow / kicker ---- */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-tint);
  padding: 8px 16px;
  border-radius: var(--r-pill);
}
.kicker svg { width: 16px; height: 16px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 16px;
  line-height: 1;
  padding: 15px 26px;
  min-height: 50px;
  border-radius: var(--r-pill);
  border: 1.5px solid transparent;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease, color .2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--primary-300); outline-offset: 2px; }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--primary-300); outline-offset: 3px; border-radius: 6px; }
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-primary);
}
.btn-primary:hover { background: var(--primary-600); box-shadow: 0 16px 38px rgba(85,62,249,.36); transform: translateY(-1px); }
.btn-outline {
  background: #fff;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover { background: var(--primary-tint); }
.btn-ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--line-2);
}
.btn-ghost:hover { border-color: var(--fg); }
.btn-lg { padding: 18px 34px; min-height: 58px; font-size: 17px; }
.btn-block { width: 100%; }

/* ---- Generic card ---- */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

/* ---- Nav (shared shell) ---- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 70px;
  max-width: var(--container-wide);
  margin-inline: auto;
  padding-inline: 22px;
}
.brand { display: inline-flex; align-items: center; gap: 11px; font-family: var(--font-head); font-weight: 600; font-size: 23px; letter-spacing: -0.02em; }
.brand .mark { width: 30px; height: 30px; flex: none; }
.brand .logo { height: 30px; width: auto; display: block; }
.nav-links { display: none; gap: 28px; margin-inline: auto; }
.nav-links a { font-size: 15.5px; color: var(--fg-2); font-weight: 500; transition: color .15s; }
.nav-links a:hover { color: var(--primary); }
.nav-cta { display: none; gap: 12px; align-items: center; }
.nav-burger {
  margin-left: auto;
  display: inline-flex;
  width: 46px; height: 46px;
  align-items: center; justify-content: center;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: #fff;
  color: var(--primary);
}
.nav-burger svg { width: 22px; height: 22px; }

@media (min-width: 940px) {
  .nav-links { display: flex; }
  .nav-cta { display: flex; }
  .nav-burger { display: none; }
}

/* ---- Mobile sheet ---- */
.m-sheet {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(10,10,15,.4);
  backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.m-sheet.open { opacity: 1; pointer-events: auto; }
.m-sheet-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(86vw, 360px);
  background: #fff;
  padding: 22px;
  display: flex; flex-direction: column; gap: 6px;
  transform: translateX(100%);
  transition: transform .25s cubic-bezier(.4,0,.2,1);
}
.m-sheet.open .m-sheet-panel { transform: none; }
.m-sheet-panel a { padding: 14px 12px; border-radius: 12px; font-size: 17px; font-weight: 500; }
.m-sheet-panel a:hover { background: var(--primary-tint); }
.m-sheet-close { align-self: flex-end; width: 44px; height: 44px; border: 1px solid var(--line-2); border-radius: 12px; background:#fff; display:inline-flex; align-items:center; justify-content:center; }

/* ---- Footer (shared) ---- */
.footer { background: #fff; border-top: 1px solid var(--line); }
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  padding-block: 64px 40px;
}
.footer-brandcol { max-width: 320px; }
.footer-brandcol p { color: var(--muted); margin-top: 16px; font-size: 16px; }
.footer-cols { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px 24px; }
.footer-col h4 { font-family: var(--font-mono); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--primary); font-weight: 500; margin-bottom: 14px; }
.footer-col a, .footer-col span { display: block; color: var(--fg-2); font-size: 16px; margin-bottom: 9px; }
.footer-col a:hover { color: var(--primary); }
.footer-bottom { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between; padding-block: 26px; border-top: 1px solid var(--line); color: var(--muted-2); font-size: 14.5px; }
.footer-social { display: flex; gap: 12px; }
.footer-social a { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-2); display: inline-flex; align-items: center; justify-content: center; color: var(--fg); }
.footer-social a:hover { background: var(--primary); color:#fff; border-color: var(--primary); }
.footer-social svg { width: 18px; height: 18px; }

@media (min-width: 860px) {
  .footer-grid { grid-template-columns: 1.3fr 2fr; gap: 60px; }
  .footer-cols { grid-template-columns: repeat(4, 1fr); }
}

/* ---- Reveal on scroll ---- */
.reveal { opacity: 1; transform: none; }
html.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s cubic-bezier(.2,.6,.2,1), transform .7s cubic-bezier(.2,.6,.2,1); }
html.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html.js .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---- Auto in-section stagger (subtle) ---- */
.r-auto { opacity: 1; transform: none; }
html.js .r-auto { opacity: 0; transform: translateY(13px); transition: opacity .6s cubic-bezier(.2,.65,.25,1), transform .6s cubic-bezier(.2,.65,.25,1); will-change: opacity, transform; }
html.js .r-auto.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html.js .r-auto { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* ---- Section heading block ---- */
.s-head { text-align: center; max-width: 720px; margin-inline: auto; margin-bottom: clamp(40px, 5vw, 64px); }
.s-head h2 { font-size: clamp(30px, 5vw, 46px); margin-top: 20px; }
.s-head p { color: var(--muted); font-size: clamp(17px, 2.2vw, 20px); margin-top: 18px; }

/* utility */
.text-primary { color: var(--primary); }
.text-accent { color: var(--accent); }
.mono { font-family: var(--font-mono); }

/* ============================================================
   Integrations hub — shared animated component
   ============================================================ */
.ihub { position: relative; max-width: 940px; margin-inline: auto; }
.ihub-stage { position: relative; aspect-ratio: 1000 / 600; }
.ihub-wires { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.ihub-wires .wire { fill: none; stroke: url(#wireGrad); stroke-width: 2; stroke-linecap: round; opacity: .55; }
.ihub-wires .packet { filter: url(#wireGlow); }

.inode { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 9px; z-index: 2; }
.itile { width: clamp(60px, 9vw, 84px); height: clamp(60px, 9vw, 84px); border-radius: 22px; background: #fff; border: 1px solid var(--line); box-shadow: 0 10px 26px rgba(30,20,80,.10); display: inline-flex; align-items: center; justify-content: center; transition: transform .25s cubic-bezier(.2,.7,.3,1), box-shadow .25s; }
.itile svg, .itile img { width: 56%; height: 56%; display: block; }
.itile.app { padding: 0; background: #fff; border: none; overflow: hidden; box-shadow: 0 12px 28px rgba(30,20,80,.18); }
.itile.app img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.inode:hover .itile { transform: translateY(-5px) scale(1.05); box-shadow: 0 18px 40px rgba(85,62,249,.22); }
.inode .icap { font-family: var(--font-mono); font-size: 11px; letter-spacing: .02em; color: var(--muted); white-space: nowrap; }
.inode .icap b { color: var(--primary); font-weight: 600; }
@media (prefers-reduced-motion: no-preference) {
  .inode { animation: ifloat 6s ease-in-out infinite; }
  .iring .inode:nth-child(2) { animation-delay: -1.2s; }
  .iring .inode:nth-child(3) { animation-delay: -2.4s; }
  .iring .inode:nth-child(4) { animation-delay: -3.6s; }
  .iring .inode:nth-child(5) { animation-delay: -4.8s; }
}
@keyframes ifloat { 0%,100% { transform: translate(-50%,-50%); } 50% { transform: translate(-50%, calc(-50% - 9px)); } }

.inode.center { z-index: 3; animation: none; }
.inode.center .itile { width: clamp(108px, 17vw, 168px); height: clamp(108px, 17vw, 168px); border-radius: 30px; background: linear-gradient(155deg, #6E57FF, var(--primary) 55%, var(--primary-700)); border: none; box-shadow: 0 22px 50px rgba(85,62,249,.40); position: relative; }
.inode.center .itile::after { content: ''; position: absolute; inset: 0; border-radius: 30px; box-shadow: 0 0 0 0 rgba(85,62,249,.45); }
@media (prefers-reduced-motion: no-preference) { .inode.center .itile::after { animation: corePulse 2.8s ease-out infinite; } }
@keyframes corePulse { 0% { box-shadow: 0 0 0 0 rgba(85,62,249,.45); } 70%,100% { box-shadow: 0 0 0 26px rgba(85,62,249,0); } }
.inode.center .itile img { width: 60%; height: 60%; }
.inode.center .icap { font-family: var(--font-head); font-size: 15px; color: var(--fg); font-weight: 600; }

.ihub-foot { text-align: center; margin-top: clamp(20px, 3vw, 34px); }
.ihub-foot .lbl { font-family: var(--font-mono); font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--primary); font-weight: 500; }
.ihub-foot p { color: var(--muted); margin-top: 12px; font-size: 17px; max-width: 560px; margin-inline: auto; }

@media (max-width: 720px) {
  .ihub-stage { aspect-ratio: auto; display: flex; flex-direction: column; align-items: center; gap: 26px; padding: 8px 0; }
  .ihub-wires { display: none; }
  .inode { position: static; transform: none; animation: none; }
  .inode.center { order: -1; }
  .iring { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px 22px; max-width: 360px; }
  .iring .inode .itile { width: 64px; height: 64px; }
}
@media (min-width: 721px) { .iring { display: contents; } }

/* Brand tiles inner backgrounds */
.ic-wa  { background: #25D366; border-radius: 16px; }
.ic-ig  { background: radial-gradient(120% 120% at 30% 110%, #FEDA75 5%, #FA7E1E 25%, #D62976 50%, #962FBF 75%, #4F5BD5 100%); border-radius: 16px; }
.ic-fb  { background: #1877F2; border-radius: 16px; }
.ic-ml  { background: #FFE600; border-radius: 16px; }
.ic-sheet { background: #0F9D58; border-radius: 16px; }
.itile .ibrand { width: 100%; height: 100%; padding: 18%; }
.itile .ibrand svg { width: 100%; height: 100%; }

/* Meta cluster badge */
.meta-tag { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: 10px; color: #0866FF; }
.meta-tag svg { width: 12px; height: 12px; }

/* ---- Motion utilities ---- */
@media (prefers-reduced-motion: no-preference) {
  html.js [data-stagger] > * { opacity: 0; transform: translateY(20px); }
  html.js [data-stagger].in > * { opacity: 1; transform: none; transition: opacity .6s cubic-bezier(.2,.6,.2,1), transform .6s cubic-bezier(.2,.6,.2,1); }
  html.js [data-stagger].in > *:nth-child(1){ transition-delay: .04s; }
  html.js [data-stagger].in > *:nth-child(2){ transition-delay: .12s; }
  html.js [data-stagger].in > *:nth-child(3){ transition-delay: .20s; }
  html.js [data-stagger].in > *:nth-child(4){ transition-delay: .28s; }
  html.js [data-stagger].in > *:nth-child(5){ transition-delay: .36s; }
  html.js [data-stagger].in > *:nth-child(6){ transition-delay: .44s; }
}
