/* ============================================================
   Cabral Djassi - Base, Layout, Nav, Hero, Buttons, Cursor
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: clip;
  overscroll-behavior-x: none;
}
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  transition: background var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
}

/* Custom cursor active: hide native on fine pointers */
@media (pointer: fine) {
  body.has-cursor, body.has-cursor * { cursor: none; }
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
ul { list-style: none; }
::selection { background: var(--brand-blue); color: #fff; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
}

.mono { font-family: var(--font-mono); }

/* ---- Backdrops ---- */
.bg-field {
  position: fixed;
  inset: 0;
  z-index: var(--z-bg);
  pointer-events: none;
}
.bg-field::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--hero-veil);
  transition: background var(--dur-slow) var(--ease-out);
}
.bg-dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 30%, transparent 80%);
}
.bg-noise {
  position: fixed;
  inset: 0;
  z-index: var(--z-bg);
  pointer-events: none;
  opacity: var(--noise-opacity);
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---- Layout ---- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section {
  position: relative;
  padding-block: clamp(56px, 9vw, 128px);
  z-index: var(--z-content);
}
.section--tight { padding-block: clamp(40px, 6vw, 80px); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-2);
}
.eyebrow .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--brand-mint);
  box-shadow: 0 0 0 4px rgba(0,229,160,0.15);
  animation: pulse 2.4s var(--ease-in-out) infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

.section-head {
  max-width: 720px;
  margin-bottom: clamp(36px, 5vw, 64px);
}
.section-head h2 {
  font-size: var(--fs-h2);
  margin-top: 18px;
}
.section-head p {
  margin-top: 18px;
  font-size: var(--fs-lead);
  color: var(--text-2);
  max-width: 60ch;
}
.grad-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.text-primary { color: var(--primary); }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: var(--z-nav);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px var(--gutter);
  transition: padding var(--dur-base) var(--ease-out), background var(--dur-base) var(--ease-out);
}
.nav::before {
  content: "";
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid transparent;
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
  z-index: -1;
}
.nav.scrolled { padding-block: 10px; }
.nav.scrolled::before { opacity: 1; border-bottom-color: var(--border); }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.12rem;
  letter-spacing: var(--tracking-snug);
  min-width: 0;
}
.brand > span:not(.mark) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brand .brand-logo {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: transparent;
  position: relative;
  display: grid;
  place-items: center;
  box-shadow: none;
  overflow: visible;
}
.brand .brand-logo img,
.brand .brand-logo svg { width: 100%; height: 100%; display: block; object-fit: contain; }
.brand .brand-logo::after { display: none; }
.brand b { font-weight: 600; }
.brand span.dim { color: var(--text-2); font-weight: 500; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-links .nav-icon {
  display: none;
}
.nav-links .nav-label--mobile {
  display: none;
}
.nav-links a {
  position: relative;
  padding: 9px 14px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-2);
  border-radius: var(--r-pill);
  transition: color var(--dur-fast) var(--ease-out);
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: 4px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-fast) var(--ease-out);
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { transform: scaleX(1); }

.nav-links a .nav-label { min-width: 0; }

.nav-right { display: flex; align-items: center; gap: 12px; }

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface-2);
}
.lang-switch button {
  min-width: 30px;
  height: 26px;
  padding: 0 8px;
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-2);
  transition: color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), transform var(--dur-fast);
}
.lang-switch button:hover { color: var(--text); }
.lang-switch button.active {
  color: #fff;
  background: var(--grad-brand);
}
.lang-switch--mobile {
  width: 100%;
  justify-content: center;
  margin-bottom: 4px;
}

.theme-toggle {
  width: 42px; height: 42px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  color: var(--text-2);
  background: var(--surface);
  transition: color var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast);
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-strong); }
.theme-toggle svg { width: 19px; height: 19px; }
.theme-toggle .sun { display: none; }
[data-theme="light"] .theme-toggle .sun { display: block; }
[data-theme="light"] .theme-toggle .moon { display: none; }

.nav-burger {
  display: none;
  width: 44px; height: 44px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.nav-burger span {
  width: 18px; height: 2px; border-radius: 2px;
  background: var(--text);
  transition: transform var(--dur-fast) var(--ease-out), opacity var(--dur-fast);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  --btn-bg: var(--surface);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 22px;
  min-height: 48px;
  border-radius: var(--r-pill);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.96rem;
  letter-spacing: -0.01em;
  background: var(--btn-bg);
  color: var(--text);
  border: 1px solid var(--border);
  transition: transform var(--dur-fast) var(--ease-spring),
              border-color var(--dur-fast), background var(--dur-fast), box-shadow var(--dur-fast);
  white-space: nowrap;
  overflow: hidden;
}
.btn svg { width: 18px; height: 18px; }
.btn:hover { border-color: var(--border-strong); }
.btn:active { transform: scale(0.97); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); }

.btn--primary {
  background: var(--grad-brand);
  background-size: 160% 160%;
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 30px -12px var(--glow);
}
.btn--primary:hover { box-shadow: 0 16px 44px -12px var(--glow); border-color: transparent; }
.btn--primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.35) 50%, transparent 70%);
  transform: translateX(-130%);
  transition: transform 0.7s var(--ease-out);
}
.btn--primary:hover::after { transform: translateX(130%); }

.btn--ghost { background: transparent; }
.btn--lg { padding: 16px 30px; min-height: 56px; font-size: 1.05rem; }
.btn--block { width: 100%; }

.btn .arrow { transition: transform var(--dur-fast) var(--ease-out); }
.btn:hover .arrow { transform: translateX(3px); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text);
}
.link-arrow svg { width: 16px; height: 16px; transition: transform var(--dur-fast) var(--ease-out); }
.link-arrow:hover svg { transform: translate(3px,-3px); }

/* ---- Pill / chips ---- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: var(--fs-small);
  color: var(--text-2);
}

/* ============================================================
   CUSTOM CURSOR
   ============================================================ */
.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: var(--z-cursor);
  border-radius: 50%;
  will-change: transform;
  mix-blend-mode: difference;
}
.cursor-dot {
  width: 7px; height: 7px;
  background: #fff;
  transform: translate(-50%, -50%);
}
.cursor-ring {
  width: 38px; height: 38px;
  border: 1.5px solid #fff;
  transform: translate(-50%, -50%);
  transition: width var(--dur-fast) var(--ease-out), height var(--dur-fast) var(--ease-out),
              background var(--dur-fast), opacity var(--dur-fast);
}
body.cursor-hover .cursor-ring { width: 64px; height: 64px; background: rgba(255,255,255,0.08); }
body.cursor-view .cursor-ring {
  width: 86px; height: 86px;
  background: var(--brand-blue);
  border-color: transparent;
  mix-blend-mode: normal;
}
.cursor-ring .cursor-label {
  position: absolute;
  inset: 0;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: #fff;
  opacity: 0;
  transition: opacity var(--dur-fast);
}
body.cursor-view .cursor-ring .cursor-label { opacity: 1; }
@media (pointer: coarse) { .cursor-dot, .cursor-ring { display: none !important; } }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-top: 120px;
  padding-bottom: 60px;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: clamp(24px, 5vw, 64px);
  width: 100%;
}
.hero-copy { position: relative; z-index: 2; }
.hero h1 {
  font-size: var(--fs-display);
  margin: 22px 0 0;
  letter-spacing: -0.035em;
  line-height: 1.1;
}
.hero h1 .line { display: block; overflow: clip; overflow-clip-margin: 0.4em; padding-bottom: 0.14em; }
.hero h1 .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(110%);
  transition: opacity 0.8s var(--ease-out), transform 0.85s var(--ease-out);
}
.hero h1 .word.in { opacity: 1; transform: none; }
.hero .gsap-fade {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.hero .gsap-fade.in { opacity: 1; transform: none; }
.hero p.lead {
  margin-top: 26px;
  font-size: var(--fs-lead);
  color: var(--text-2);
  max-width: 46ch;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 36px;
}
.hero-links,
.about-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}
.hero-links { margin-top: 20px; }
.about-links { margin-top: 24px; }
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.hero-meta .stat .num {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 1rem + 1.6vw, 2.1rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.hero-meta .stat .lbl {
  font-size: var(--fs-small);
  color: var(--text-muted);
  margin-top: 2px;
}

/* 3D stage */
.hero-stage {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  max-width: 560px;
  margin-inline: auto;
}
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-stage .ring-deco {
  position: absolute;
  inset: 4%;
  border-radius: 50%;
  border: 1px dashed var(--border-strong);
  animation: spin 60s linear infinite;
  pointer-events: none;
}
.hero-stage .ring-deco.r2 { inset: 16%; animation-duration: 42s; animation-direction: reverse; }
@keyframes spin { to { transform: rotate(360deg); } }

/* floating glass chips around the 3D object */
.float-chip {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: var(--fs-small);
  font-weight: 500;
  box-shadow: var(--shadow-md);
  white-space: nowrap;
  z-index: 3;
}
.float-chip svg { width: 16px; height: 16px; }
.float-chip .gdot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-mint); }

/* marquee trust strip */
.marquee {
  position: relative;
  margin-top: 8px;
  border-block: 1px solid var(--border);
  padding-block: 18px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track {
  display: flex;
  gap: 56px;
  width: max-content;
  animation: marquee 32s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--text-2);
  letter-spacing: -0.01em;
}
.marquee-item svg { width: 22px; height: 22px; opacity: 0.8; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* reveal helpers (driven by IntersectionObserver; CSS resolves to final state) */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal, .hero h1 .word, .hero .gsap-fade {
    opacity: 1 !important; transform: none !important; transition: none !important;
  }
  .marquee-track, .ring-deco, .eyebrow .dot { animation: none !important; }
}
