/* ============================================================
   THEOLOTREE MARKETING — site styles
   Global page setup, the button component (reconstructed from the
   design system), header behaviour hooks, responsive layout, focus
   states, and reduced-motion handling.
   ============================================================ */

html { scroll-behavior: smooth; }
a:hover { color: var(--accent-strong); }
img, svg { max-width: 100%; }
input[type="range"] { accent-color: var(--accent); }

@keyframes tt-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}

/* --- Skip link ------------------------------------------------ */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--pine-900);
  color: var(--bone-50);
  padding: 10px 16px;
  border-radius: 0 0 var(--radius-md) 0;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { left: 0; }

/* --- Header --------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
  border-bottom: 1px solid transparent;
  background: transparent;
  transition: background .28s var(--ease-standard),
              box-shadow .28s var(--ease-standard),
              border-color .28s var(--ease-standard);
}
.site-header__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 13px clamp(20px, 5vw, 56px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 21px;
  letter-spacing: -.5px;
}
/* Default colours match the transparent-over-hero state; the header
   script swaps them to dark once the page scrolls onto parchment. */
#wm-a { color: var(--bone-50); }
#wm-b { color: var(--amber-300); }

.site-nav { display: flex; gap: 26px; align-items: center; }
.site-header__cta { display: flex; align-items: center; gap: 14px; }
.nav-link {
  font-size: 14.5px;
  font-weight: 500;
  color: rgba(250, 247, 240, .86);
  text-decoration: none;
}
.nav-link--interest { font-weight: 600; }
.nav-link:hover { color: var(--amber-300); }

/* --- Button (reconstructed design-system component) ----------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-family: var(--font-body);
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s var(--ease-standard),
              color .2s var(--ease-standard),
              border-color .2s var(--ease-standard),
              box-shadow .2s var(--ease-standard),
              transform .2s var(--ease-standard);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn__icon { display: inline-flex; flex: 0 0 auto; }
.btn__icon svg { display: block; }

.btn--sm { height: 38px; padding: 0 16px; font-size: 14px; }
.btn--lg { height: 50px; padding: 0 22px; font-size: 15.5px; }

.btn--accent { background: var(--accent); color: var(--accent-contrast); }
.btn--accent:hover { background: var(--accent-strong); color: var(--accent-contrast); }

.btn--ghost { background: transparent; color: var(--text-strong); border-color: var(--border-default); }
.btn--ghost:hover { background: var(--surface-sunken); color: var(--text-strong); }

.btn--secondary { background: var(--surface-card); color: var(--text-strong); border-color: var(--border-default); }
.btn--secondary:hover { background: var(--surface-sunken); color: var(--text-strong); border-color: var(--border-strong); }

/* On dark (pine) sections, ghost buttons carry light text + a
   translucent border, matching the design's darkGhost treatment. */
.btn--on-dark.btn--ghost { color: var(--bone-50); border-color: rgba(250, 247, 240, .32); }
.btn--on-dark.btn--ghost:hover { color: var(--bone-50); background: rgba(250, 247, 240, .08); }

/* --- Focus visibility (keyboard) ----------------------------- */
a:focus-visible,
.btn:focus-visible,
input[type="range"]:focus-visible,
[tabindex]:focus-visible {
  outline: none;
  box-shadow: var(--shadow-ring);
  border-radius: var(--radius-sm);
}
.btn:focus-visible { border-radius: var(--radius-md); }

/* --- Responsive two-column layouts --------------------------- */
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: clamp(30px, 5vw, 60px);
  align-items: center;
}
.why-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: clamp(36px, 5vw, 64px);
  align-items: center;
}
.leaders-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(36px, 5vw, 64px);
  align-items: center;
}

.hero-phone {
  position: relative;
  width: 300px;
  max-width: 82vw;
  animation: tt-float 6.5s var(--ease-standard) infinite;
}

/* Halo behind the device. The bezel and the spotlight header are both
   pine-950, the same colour as the section behind them, so without this the
   top of the phone dissolves into the page. Painted first, and the frame is
   a later sibling, so it layers correctly without a z-index. */
.hero-phone__glow {
  position: absolute;
  left: 50%;
  top: 44%;
  width: 190%;
  height: 132%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  background:
    radial-gradient(closest-side, rgba(212, 145, 42, .34), rgba(212, 145, 42, .13) 46%, rgba(212, 145, 42, 0) 72%),
    radial-gradient(closest-side, rgba(126, 163, 141, .18), rgba(126, 163, 141, 0) 66%);
  filter: blur(6px);
}

@media (max-width: 900px) {
  .hero-grid,
  .why-grid,
  .leaders-grid { grid-template-columns: 1fr; }
}

/* Collapse the centre nav on small screens; keep the brand + the
   primary "Get the app" action reachable. */
@media (max-width: 760px) {
  .site-nav,
  .nav-link--interest { display: none; }
}

/* --- Reduced motion ------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-phone { animation: none !important; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- Founding-spot counter -------------------------------------------------
   Shared by the /founding hero card and the home page band. Kept here rather
   than in a page <style> so both render the taken state identically, and so
   no pip carries an inline background that a class could never override. */
.fnd-pips { display: flex; gap: 7px; flex-wrap: wrap; }
.fnd-pip {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--amber-400);
  box-shadow: 0 0 0 1px rgba(212, 145, 42, .55);
}
.fnd-pip.is-taken {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px rgba(250, 247, 240, .28);
}
