/* ===== Design tokens ===== */
:root {
  --navy: #0f1f3d;
  --slate: #334155;
  --slate-light: #64748b;
  --ink: #0b1220;
  --white: #ffffff;
  --off-white: #f8f9fb;
  --muted: #f1f4f8;
  --border: #e5e8ee;
  --border-strong: #d7dce5;
  --accent: #1e3a8a;
  --accent-soft: #eef2fb;
  --radius: 14px;
  --radius-sm: 10px;
  --container: 1160px;
  --shadow-sm: 0 1px 2px rgba(15, 31, 61, 0.04);
  --shadow-md: 0 12px 30px rgba(15, 31, 61, 0.10);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ===== Reset / base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; line-height: 1.1; }
p { margin: 0; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.7rem 1.35rem;
  border-radius: 999px;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
  cursor: pointer;
  white-space: nowrap;
}
.btn--primary { background: var(--navy); color: var(--white); box-shadow: var(--shadow-sm); }
.btn--primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); background: #14264a; }
.btn--light { background: #f4d35e; color: var(--navy); padding: 0.85rem 1.9rem; font-size: 1rem; }
.btn--light:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(0,0,0,0.25); background: #f7dd7e; }
.btn--nav { background: #f4d35e; color: var(--navy); box-shadow: var(--shadow-sm); }
.btn--nav:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(0,0,0,0.28); background: #f7dd7e; }

/* ===== Navigation ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 18, 32, 0.7);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.nav.is-scrolled { border-bottom-color: rgba(255,255,255,0.10); background: rgba(11, 18, 32, 0.85); }
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.nav__logo { font-weight: 800; font-size: 1.3rem; color: var(--white); letter-spacing: -0.03em; }
.nav__links { display: flex; align-items: center; gap: 1.75rem; }
.nav__link { color: rgba(255,255,255,0.72); font-weight: 500; font-size: 0.95rem; transition: color 0.2s var(--ease); }
.nav__link:hover { color: var(--white); }

/* ===== Hero (dark, full-height) ===== */
.hero {
  background-color: #0f1f3d;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.08) 1px, transparent 1.6px),
    linear-gradient(160deg, #0b1426 0%, #0f1f3d 55%, #16294d 100%);
  background-size: 24px 24px, 100% 100%;
  background-position: 0 0, 0 0;
  color: var(--white);
  min-height: calc(100svh - 68px);
  display: flex;
  align-items: center;
  padding: clamp(2.5rem, 6vw, 4rem) 0;
}
.hero__grid {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
  width: 100%;
}
.hero__title {
  font-size: clamp(2.6rem, 6vw, 4.25rem);
  font-weight: 800;
  color: var(--white);
}
.hero__subtitle {
  margin-top: 1.4rem;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  color: rgba(255,255,255,0.78);
  font-weight: 400;
  max-width: 30ch;
}

/* Rotating words */
/* Fixed-width slot sized to the widest word; each word is centered within it
   so "teams" stays put and the active word sits centered between the two. */
.rotator {
  position: relative;
  display: inline-grid;
  justify-items: center;
  vertical-align: bottom;
  font-weight: 700;
  color: #ff6f61;
}
.rotator__word {
  grid-area: 1 / 1;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.rotator__word.is-active { opacity: 1; transform: translateY(0); }
/* Per-word colors: Labeling = pastel yellow, AdPromo = coral, RegIntel = green */
.rotator__word:nth-child(1) { color: #f4d35e; }
.rotator__word:nth-child(2) { color: #ff6f61; }
.rotator__word:nth-child(3) { color: #5fbf8f; }

.scroll-cue {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 2.4rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--slate-light);
  transition: color 0.2s var(--ease);
}
.scroll-cue { color: rgba(255,255,255,0.65); }
.scroll-cue:hover { color: var(--white); }
.scroll-cue__arrow {
  display: inline-flex;
  width: 30px; height: 30px;
  align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px;
  animation: bob 2.2s var(--ease) infinite;
}
@keyframes bob { 0%,100% { transform: translateY(0);} 50% { transform: translateY(4px);} }

/* Hero visual placeholder (dark) */
.hero__visual { display: flex; justify-content: center; }
.hero__image-placeholder { width: 100%; }
.ph-window {
  width: 100%;
  margin: 0;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0,0,0,0.45);
  overflow: hidden;
  position: relative;
}
.ph-window__bar {
  display: flex; gap: 7px;
  padding: 14px 18px;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.ph-window__bar span { width: 11px; height: 11px; border-radius: 50%; background: rgba(255,255,255,0.20); }
/* Fixed-size box so every screenshot occupies the exact same space,
   regardless of its native aspect ratio. */
.ph-shots {
  position: relative;
  overflow: hidden;
  height: clamp(360px, 50vh, 520px);
}
.ph-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 0% 50%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.6s var(--ease);
}
/* Active image fades in and slowly pans left-to-right before the next one */
.ph-img.is-active {
  opacity: 1;
  pointer-events: auto;
  animation: pan-lr 5s linear forwards;
}
@keyframes pan-lr {
  from { object-position: 0% 50%; }
  to { object-position: 100% 50%; }
}
/* Image that doesn't overflow horizontally: zoom in slightly and pan via transform */
.ph-img--zoom { transform: scale(1.18); }
.ph-img--zoom.is-active { animation: pan-zoom 5s linear forwards; }
@keyframes pan-zoom {
  from { transform: scale(1.18) translateX(4%); }
  to { transform: scale(1.18) translateX(-4%); }
}
/* Outgoing image: keep it at its pan END position while it fades out so it
   doesn't snap back to the start. */
.ph-img.is-prev { opacity: 0; object-position: 100% 50%; }
.ph-img--zoom.is-prev { transform: scale(1.18) translateX(-4%); }

/* ===== Why Precepi ===== */
.why { background: #e9edf4; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: clamp(3.5rem, 7vw, 6rem) 0; }
.section-title {
  font-size: clamp(2.2rem, 5vw, 3.25rem);
  font-weight: 700;
  color: var(--navy);
  text-align: center;
  margin-bottom: clamp(2.5rem, 5vw, 3.75rem);
}
.why__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}
.card {
  background: var(--white);
  border: 1.5px solid rgba(30, 58, 138, 0.35);
  border-radius: var(--radius);
  padding: 1.5rem 1.5rem;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: var(--accent); }
.card__icon {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 0.9rem;
}
.card__icon svg { width: 26px; height: 26px; }
.card__title { font-size: 1.18rem; font-weight: 600; color: var(--navy); margin-bottom: 0.4rem; line-height: 1.25; }
.card__desc { font-size: 1rem; color: var(--slate-light); line-height: 1.5; }

/* ===== Testimonials ===== */
.testimonials { padding: clamp(3.5rem, 7vw, 6rem) 0; overflow: hidden; }
.marquee {
  position: relative;
  margin-top: 0.5rem;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee__track {
  display: flex;
  gap: 1.25rem;
  width: max-content;
  padding: 0.5rem 24px;
  animation: scroll-x 38s linear infinite;
}
@keyframes scroll-x { from { transform: translateX(0);} to { transform: translateX(-50%);} }
.marquee__track { align-items: stretch; }
.quote {
  flex: 0 0 auto;
  width: min(620px, 84vw);
  margin: 0;
  background: #f2f4f9;
  border: 1.5px solid rgba(30, 58, 138, 0.35);
  border-radius: var(--radius);
  padding: 2.5rem 2.75rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.quote blockquote { margin: 0; flex: 1; font-size: 1.25rem; color: var(--slate); line-height: 1.6; }
.quote figcaption { font-size: 1rem; font-weight: 600; color: var(--navy); align-self: flex-end; text-align: right; }
/* Attribution colors matched to the rotating words */
.quote figcaption.by--labeling { color: #d4af1f; }
.quote figcaption.by--regulatory { color: #2f9e6b; }
.quote figcaption.by--adpromo { color: #ff6f61; }

/* ===== Closing CTA ===== */
.cta {
  background-color: #0f1f3d;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.08) 1px, transparent 1.6px),
    linear-gradient(135deg, #0f1f3d 0%, #1a2f57 60%, #1e3a8a 100%);
  background-size: 24px 24px, 100% 100%;
  background-position: 0 0, 0 0;
  color: var(--white);
  padding: clamp(3.5rem, 8vw, 6.5rem) 0;
  min-height: calc(100svh - 68px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.cta__inner { max-width: 860px; text-align: center; }
.cta__title { font-size: clamp(2.7rem, 6vw, 4.1rem); font-weight: 700; }
.cta__text { margin: 1.6rem auto 2.6rem; color: rgba(255,255,255,0.8); font-size: 1.35rem; max-width: 56ch; }

/* ===== Footer ===== */
.footer { background: var(--white); border-top: 1px solid var(--border); padding: 1.75rem 0; }
.footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.footer__copy { font-size: 0.88rem; color: var(--slate-light); }
.footer__links { display: flex; gap: 1.5rem; }
.footer__link { font-size: 0.88rem; color: var(--slate-light); transition: color 0.2s var(--ease); }
.footer__link:hover { color: var(--navy); }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .why__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__visual { order: 2; }
  .hero__subtitle { max-width: none; }
  .why__grid { grid-template-columns: 1fr; }

  /* Testimonials become a swipeable carousel */
  .marquee { -webkit-mask-image: none; mask-image: none; overflow-x: auto; -webkit-overflow-scrolling: touch; scroll-snap-type: x mandatory; }
  .marquee__track { animation: none; width: max-content; padding: 0.5rem 24px; }
  .quote { width: 82vw; max-width: 360px; scroll-snap-align: center; }

  .footer__inner { flex-direction: column; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee__track { animation: none; }
  .scroll-cue__arrow { animation: none; }
  .rotator__word { transition: none; }
  .ph-img { object-position: 50% 50%; }
  .ph-img.is-active { animation: none; }
}
