/* ==========================================================================
   css/components.css
   Reusable UI components shared across two or more pages.
   Depends on: variables.css, base.css, layout.css
   ========================================================================== */


/* --------------------------------------------------------------------------
   Navigation — site-nav
   The home page uses position:fixed with a translateX(-50%) centred pill.
   The signup and thankyou pages use position:sticky with a simpler wrapper.
   Both share the nav-inner, brand, and nav-link styles below.
   -------------------------------------------------------------------------- */

.site-nav {
  position: sticky;
  top: 14px;
  z-index: 100;
  padding-top: 14px;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(4, 4, 4, 0.92);
  backdrop-filter: blur(26px);
  -webkit-backdrop-filter: blur(26px);
  box-shadow: var(--shadow-md);
}

/* --------------------------------------------------------------------------
   Brand mark / logo
   -------------------------------------------------------------------------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  flex-shrink: 0;
}

/* Subtle ambient glow halo behind the logo */
.brand-mark::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 14px;
  background: radial-gradient(
    circle at center,
    rgba(134, 244, 209, 0.10) 0%,
    rgba(29, 198, 147, 0.05) 50%,
    transparent 78%
  );
  filter: blur(6px);
  opacity: 0.6;
  animation: logoBreath 5s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

.brand-mark svg {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  /* Subtle glow tracing the logo shape */
  filter:
    drop-shadow(0 0 3px rgba(134, 244, 209, 0.2))
    drop-shadow(0 0 8px rgba(29, 198, 147, 0.1));
  transition: filter 300ms ease;
}

.brand:hover .brand-mark svg {
  filter:
    drop-shadow(0 0 4px rgba(134, 244, 209, 0.35))
    drop-shadow(0 0 12px rgba(29, 198, 147, 0.15));
}

/* Gentle breathing pulse for the glow halo */
@keyframes logoBreath {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50%      { opacity: 0.7; transform: scale(1.04); }
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-name {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-tag {
  color: var(--muted-soft);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Nav links — used only on home page (multi-link) but styled here for reuse
   -------------------------------------------------------------------------- */
.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-links a {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  transition:
    color 180ms ease,
    background 180ms ease;
}

.nav-links a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.nav-cta .button {
  min-height: 46px;
  padding: 0 20px;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
}

/* --------------------------------------------------------------------------
   nav-link — single CTA link used in signup and thankyou navbars
   -------------------------------------------------------------------------- */
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition:
    background 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.nav-link svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition:
    transform 220ms ease,
    box-shadow 220ms ease,
    border-color 220ms ease,
    background 220ms ease,
    opacity 220ms ease;
  cursor: pointer;
}

.button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.button.primary {
  color: #04110c;
  background: linear-gradient(135deg, var(--accent-2) 0%, var(--accent) 100%);
  box-shadow: 0 10px 32px rgba(29, 198, 147, 0.24);
}

.button.secondary {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line);
  color: var(--text);
}

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

.button.primary:hover {
  box-shadow: 0 18px 42px rgba(29, 198, 147, 0.28);
}

.button.secondary:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.07);
}

/* Disabled state (signup form) */
.button[disabled] {
  opacity: 0.72;
  cursor: wait;
  transform: none;
}

/* Hidden state (signup back button on step 1) */
.button.is-hidden {
  visibility: hidden;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Eyebrow — labelled pill badge above headings
   -------------------------------------------------------------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 7px 14px;
  border: 1px solid rgba(29, 198, 147, 0.2);
  border-radius: 999px;
  background: rgba(29, 198, 147, 0.08);
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 6px rgba(134, 244, 209, 0.08);
}

/* --------------------------------------------------------------------------
   Panel — glassmorphic card wrapper used on signup and thankyou
   -------------------------------------------------------------------------- */
.panel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.03)),
    rgba(5, 11, 9, 0.92);
  box-shadow: var(--shadow-lg);
}

/* Top-edge glow line */
.panel::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(134, 244, 209, 0.52), transparent);
  opacity: 0.9;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Screen frames — shared by hero visual, journey, sidebar, etc.
   -------------------------------------------------------------------------- */
.screen-frame {
  overflow: hidden;
  background: linear-gradient(180deg, rgba(18, 29, 26, 0.96), rgba(9, 17, 14, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow-lg);
}

/* Browser chrome */
.browser-frame {
  border-radius: 30px;
}

.browser-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.04);
}

.browser-dots {
  display: inline-flex;
  gap: 6px;
}

.browser-dots span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.browser-address {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 34px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted-soft);
  font-size: 12px;
}

.browser-address svg {
  width: 14px;
  height: 14px;
}

.browser-screen {
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}

.browser-screen img {
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: top center;
}

/* Phone chrome */
.phone-frame {
  position: relative;
  width: min(100%, 326px);
  padding: 16px 12px 12px;
  border-radius: 48px;
  background: linear-gradient(145deg, rgba(31, 39, 37, 0.98), rgba(7, 10, 10, 0.98) 52%, rgba(22, 28, 27, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 32px 84px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(255, 255, 255, 0.04);
}

/* Dynamic island notch */
.phone-frame::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 50%;
  width: 104px;
  height: 28px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(4, 6, 6, 0.98), rgba(16, 20, 20, 0.96));
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.05),
    0 1px 0 rgba(255, 255, 255, 0.04);
  z-index: 2;
}

/* Inner rim */
.phone-frame::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 43px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.phone-screen {
  position: relative;
  z-index: 1;
  overflow: hidden;
  border-radius: 36px;
  background: #050808;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.phone-screen img {
  width: 100%;
  aspect-ratio: 1080 / 2400;
  object-fit: cover;
}

/* --------------------------------------------------------------------------
   Section head — label + title + copy block
   -------------------------------------------------------------------------- */
.section-head {
  max-width: 720px;
  margin-bottom: 44px;
}

.headline {
  margin: 0 0 18px;
  font-family: var(--display);
  font-size: clamp(42px, 7vw, 88px);
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.headline .accent {
  display: block;
  color: var(--accent-2);
}

.section-title {
  margin: 0 0 16px;
  font-family: var(--display);
  font-size: clamp(32px, 4vw, 58px);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.lede,
.section-copy {
  margin: 0;
  color: var(--muted);
  font-size: clamp(16px, 1.6vw, 19px);
  line-height: 1.75;
}

.section-copy {
  max-width: 640px;
}

/* --------------------------------------------------------------------------
   Reveal animation — scroll-triggered fade+slide-up
   JS adds .in when element enters the viewport.
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 700ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

.delay-1 {
  transition-delay: 80ms;
}

.delay-2 {
  transition-delay: 160ms;
}

.delay-3 {
  transition-delay: 240ms;
}

/* --------------------------------------------------------------------------
   Image fade — used when swapping images in hero / desktop carousel
   -------------------------------------------------------------------------- */
.image-fade {
  transition:
    opacity 320ms ease,
    transform 320ms ease;
  transform: translateY(0);
  opacity: 1;
}

.image-fade.is-swapping {
  opacity: 0;
  transform: translateY(12px);
}

/* --------------------------------------------------------------------------
   Responsive overrides — shared across all pages
   -------------------------------------------------------------------------- */

/* 900px — Signup/thankyou nav pill adapts to narrower viewport */
@media (max-width: 900px) {
  .nav-inner {
    padding: 12px 16px;
    border-radius: 28px;
    gap: 14px;
  }

  .nav-link span {
    display: none;
  }
}

/* 720px — Mobile shared adjustments */
@media (max-width: 720px) {
  .brand-tag {
    display: none;
  }

  .nav-inner {
    padding: 10px 14px;
    border-radius: 22px;
    gap: 10px;
  }

  .button {
    min-height: 50px;
    padding: 0 20px;
    font-size: 14px;
  }

  .button-row {
    gap: 10px;
  }

  .section-title {
    font-size: clamp(26px, 6vw, 44px);
  }

  .lede,
  .section-copy {
    font-size: clamp(15px, 4vw, 17px);
  }

  .eyebrow {
    font-size: 11px;
    padding: 6px 12px;
    margin-bottom: 14px;
  }
}

/* 480px — Small mobile */
@media (max-width: 480px) {
  .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 11px;
  }

  .brand-name {
    font-size: 15px;
  }

  .nav-inner {
    padding: 8px 12px;
  }

  .button {
    min-height: 46px;
    padding: 0 16px;
  }
}
