/* =========================================================================
   Kafka Offset Harbor — 3D experience site.
   Same design tokens as styles.css; independent stylesheet so the original
   site is untouched.
   ========================================================================= */

:root {
  --bg: #0a0a0a;
  --bg-2: #161616;
  --fg: #ededed;
  --muted: #a1a1a1;
  --line: rgba(255, 255, 255, 0.08);
  --accent: #0070f3;
  --accent-2: #00dfd8;
  --violet: #7c3aed;
  --card: rgba(18, 20, 26, 0.72);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, sans-serif;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

a {
  color: inherit;
}

/* ---- loader ------------------------------------------------------------ */
.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: var(--bg);
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader__mark {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.04em;
  background: linear-gradient(90deg, #0070f3, #00dfd8 45%, #7c3aed);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.loader__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.1s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(0.7);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
}

/* ---- fixed 3D world canvas -------------------------------------------- */
.world {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ---- top nav ----------------------------------------------------------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  background: linear-gradient(rgba(10, 10, 10, 0.85), rgba(10, 10, 10, 0));
}

.nav__brand {
  font-weight: 800;
  letter-spacing: -0.03em;
  text-decoration: none;
  background: linear-gradient(90deg, #0070f3, #00dfd8 55%, #7c3aed);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav__links {
  display: flex;
  gap: 22px;
  font-size: 14px;
}

.nav__links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav__links a:hover {
  color: var(--fg);
}

/* ---- content sits above the world ------------------------------------- */
main,
.screens,
.grid-section,
.cta,
.footer {
  position: relative;
  z-index: 1;
}

/* ---- hero -------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 90px 24px 40px;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero__title {
  margin: 0;
  font-size: clamp(52px, 10vw, 118px);
  line-height: 0.98;
  font-weight: 800;
  letter-spacing: -0.05em;
  background: linear-gradient(100deg, #3291ff 5%, #00dfd8 42%, #7c3aed 85%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__sub {
  max-width: 620px;
  margin: 22px 0 0;
  font-size: 19px;
  line-height: 1.55;
  color: var(--muted);
}

.hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 30px;
}

.chip {
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 13.5px;
  color: var(--fg);
  backdrop-filter: blur(6px);
}

.scroll-hint {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.scroll-hint__chev {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  animation: bob 1.6s ease-in-out infinite;
}

@keyframes bob {
  0%,
  100% {
    transform: rotate(45deg) translate(0, 0);
  }
  50% {
    transform: rotate(45deg) translate(4px, 4px);
  }
}

/* ---- scroll-scrub scene driver + captions ------------------------------ */
.scrub {
  height: 420vh;
}

.captions {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.caption {
  position: absolute;
  top: 50%;
  transform: translateY(0);
  max-width: 330px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  will-change: opacity, transform;
}

.caption--left {
  left: clamp(18px, 6vw, 90px);
  margin-top: -90px;
}

.caption--right {
  right: clamp(18px, 6vw, 90px);
  margin-top: -90px;
}

.caption .eyebrow {
  font-size: 11.5px;
  margin-bottom: 6px;
}

.caption h3 {
  margin: 0 0 8px;
  font-size: 21px;
  letter-spacing: -0.02em;
}

.caption p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--muted);
}

/* ---- screenshots on 3D panels ------------------------------------------ */
.screens {
  padding: 110px 24px 40px;
  background: linear-gradient(rgba(10, 10, 10, 0) 0, var(--bg) 140px);
}

.screens__inner {
  max-width: 1080px;
  margin: 0 auto;
}

.section-title {
  margin: 0 0 8px;
  font-size: clamp(30px, 4.5vw, 44px);
  font-weight: 800;
  letter-spacing: -0.03em;
  text-align: center;
}

.section-sub {
  margin: 0 auto 56px;
  max-width: 560px;
  text-align: center;
  color: var(--muted);
  line-height: 1.6;
}

.panel3d {
  --rx: 0deg;
  --ry: 0deg;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  margin-bottom: 90px;
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.panel3d.in {
  opacity: 1;
  transform: translateY(0);
}

.panel3d:nth-child(even) .panel3d__shot {
  order: 2;
}

.panel3d__shot {
  perspective: 1400px;
}

.panel3d__shot img {
  width: 100%;
  display: block;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55);
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 0.18s ease-out;
  will-change: transform;
}

.panel3d__copy h3 {
  margin: 0 0 10px;
  font-size: 26px;
  letter-spacing: -0.02em;
}

.panel3d__copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  font-size: 15.5px;
}

/* ---- feature grid ------------------------------------------------------ */
.grid-section {
  padding: 60px 24px 90px;
  background: var(--bg);
}

.grid-inner {
  max-width: 1080px;
  margin: 0 auto;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.tile {
  padding: 26px 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-2);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.tile:hover {
  transform: perspective(900px) rotateX(2.5deg) translateY(-4px);
  border-color: rgba(0, 112, 243, 0.45);
}

.tile__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  font-size: 18px;
  margin-bottom: 14px;
}

.tile h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.tile p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}

/* ---- CTA --------------------------------------------------------------- */
.cta {
  padding: 110px 24px;
  text-align: center;
  background: var(--bg);
}

.cta__actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-top: 30px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 13px 28px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}

.btn--primary:hover {
  background: #3291ff;
}

.btn--ghost {
  border: 1px solid var(--line);
  color: var(--fg);
}

.btn--ghost:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

/* ---- footer ------------------------------------------------------------ */
.footer {
  border-top: 1px solid var(--line);
  padding: 54px 28px 40px;
  background: var(--bg);
}

.footer__grid {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 30px;
}

.footer__brand {
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.footer__tag {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  max-width: 340px;
}

.footer nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
}

.footer nav h3 {
  margin: 0 0 4px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.footer nav a {
  color: var(--muted);
  text-decoration: none;
}

.footer nav a:hover {
  color: var(--fg);
}

.footer__legal {
  max-width: 1080px;
  margin: 40px auto 0;
  font-size: 13px;
  color: var(--muted);
}

/* ---- responsive -------------------------------------------------------- */
@media (max-width: 860px) {
  .panel3d {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .panel3d:nth-child(even) .panel3d__shot {
    order: 0;
  }

  .caption {
    max-width: min(330px, calc(100vw - 36px));
    top: auto;
    bottom: 26px;
    margin-top: 0 !important;
  }

  .caption--left,
  .caption--right {
    left: 18px;
    right: 18px;
  }

  .footer__grid {
    grid-template-columns: 1fr;
  }

  .nav__links {
    gap: 14px;
  }
}

/* ---- reduced motion ---------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .scroll-hint__chev,
  .loader__dot {
    animation: none;
  }

  .panel3d,
  .panel3d__shot img,
  .tile,
  .btn {
    transition: none;
  }
}
