/* ==========================================================================
   RepTap public site — Home, Pricing, Enquiry. Three pages, nothing more.
   ========================================================================== */

/* ------------------------------------------------------------- nav */
/* Transparent at rest so the glow reads straight through it. Once the page
   scrolls, content passes underneath, so it picks up a blur and a hairline to
   keep the nav legible. */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background var(--dur-slow) var(--ease),
              backdrop-filter var(--dur-slow) var(--ease),
              border-color var(--dur) var(--ease);
}
.site-header.is-scrolled {
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--border-soft);
}
@supports not (backdrop-filter: blur(1px)) {
  .site-header.is-scrolled { background: var(--bg); }
}

.nav { display: flex; align-items: center; gap: var(--s-6); height: 64px; }
.logo {
  display: inline-flex; align-items: center; gap: var(--s-2);
  min-height: 36px; padding-right: var(--s-2);
  font-weight: 650; font-size: var(--t-md); letter-spacing: -0.02em;
}
.logo svg { flex: none; }

.nav-links { display: flex; align-items: center; gap: var(--s-1); margin-left: auto; }
.nav-link {
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-sm);
  font-size: var(--t-base); font-weight: 500;
  color: var(--text-muted);
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.nav-link:hover { color: var(--text); background: var(--surface); }
.nav-link[aria-current="page"] { color: var(--text); }

/* --------------------------------------------------------------- hero */
.hero { padding: var(--s-20) 0 var(--s-16); position: relative; }

/* Ambient glow that tracks the scroll position. --glow-y is written by
   site.js from a rAF loop; --glow-drift gives it a slow idle sway so it is
   not dead still when the page is stationary. */
/* A fixed clipping frame. The gradient inside is deliberately wider than the
   viewport, and without this wrapper it widened the document on narrow
   screens and produced a horizontal scrollbar. */
.page-glow {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.page-glow::before {
  content: "";
  position: absolute;
  top: 0; left: 50%;
  width: min(1100px, 140vw);
  height: 620px;
  transform: translate(-50%, calc(var(--glow-y, 0px) - 46%));
  background: radial-gradient(closest-side, rgba(140,255,90,.13), transparent 70%);
  will-change: transform;
  animation: glow-drift 14s ease-in-out infinite alternate;
}
@keyframes glow-drift {
  from { margin-left: -40px; }
  to   { margin-left: 40px; }
}
/* Content sits above the glow; the header is transparent so the glow shows
   through it rather than being covered. */
main, .site-footer { position: relative; z-index: 1; }

@media (prefers-reduced-motion: reduce) {
  .page-glow::before {
    animation: none;
    transform: translate(-50%, -46%);   /* parked, no scroll tracking */
  }
}
.hero-grid {
  position: relative;
  display: grid; gap: var(--s-16);
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
}
.hero-grid > * { min-width: 0; }
.hero h1 {
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  letter-spacing: -0.038em;
  max-width: 15ch;
}
.hero-lede {
  margin-top: var(--s-5);
  font-size: var(--t-lg);
  color: var(--text-muted);
  max-width: 46ch;
  line-height: 1.55;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-8); }

.tap-chip {
  display: inline-flex; align-items: center; gap: var(--s-2);
  padding: 5px 12px 5px 8px;
  border-radius: var(--r-full);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  font-size: var(--t-sm); font-weight: 600;
  margin-bottom: var(--s-5);
}

/* ------------------------------------------------------- phone frame */
/* min-width:0 stops the 340px mockup forcing the grid track wider than the
   viewport - grid items refuse to shrink below min-content without it. */
.phone-stage { display: flex; justify-content: center; position: relative; min-width: 0; }
.phone {
  width: min(340px, 100%);
  border-radius: 42px;
  padding: 10px;
  background: linear-gradient(160deg, #2A2D34, #131519 45%, #0D0F12);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,.06) inset;
}
.phone-screen {
  position: relative;
  height: 660px;
  border-radius: 33px;
  overflow: hidden;
  background: var(--carbon);
  display: flex; flex-direction: column;
}
.phone-screen .member-root {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  /* Hide the scrollbar inside the mockup: a real phone does not show a
     persistent bar, and it reads as clutter on top of the device frame.
     Scrolling itself is untouched - touch, wheel and keyboard all still work. */
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;       /* legacy Edge */
}
.phone-screen .member-root::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;                  /* WebKit and Blink */
}
.phone-notch {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 112px; height: 24px;
  background: #0D0F12;
  border-radius: 0 0 14px 14px;
  z-index: 30;
}
.demo-caption {
  text-align: center; margin-top: var(--s-4);
  font-size: var(--t-sm); color: var(--text-faint);
}
.demo-reset {
  background: none; border: 0; color: var(--text-muted);
  font-size: var(--t-sm); cursor: pointer; text-decoration: underline;
  text-underline-offset: 2px;
  min-height: 32px; padding: var(--s-2); border-radius: var(--r-sm);
}
.demo-reset:hover { color: var(--text); }

/* --------------------------------------------------------- sections */
.section { padding: var(--s-20) 0; }
.section-head { max-width: 60ch; margin-bottom: var(--s-12); }
.section-head h2 { font-size: clamp(1.75rem, 3.4vw, 2.25rem); }
.section-head p { margin-top: var(--s-4); color: var(--text-muted); font-size: var(--t-lg); }

.steps { display: grid; gap: var(--s-6); grid-template-columns: 1fr; }
.step {
  padding: var(--s-6);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--surface), rgba(20,22,26,.4));
}
.step-num {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; margin-bottom: var(--s-4);
  border-radius: var(--r-sm);
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid var(--accent-line);
  font-size: var(--t-sm); font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.step h3 { margin-bottom: var(--s-2); }
.step p { color: var(--text-muted); font-size: var(--t-base); }

.feature-grid { display: grid; gap: var(--s-4); grid-template-columns: 1fr; }
.feature {
  display: flex; gap: var(--s-4); align-items: flex-start;
  padding: var(--s-5);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  background: var(--surface);
}
.feature-icon {
  flex: none; display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--accent);
  border: 1px solid var(--border-soft);
}
.feature h3 { font-size: var(--t-base); margin-bottom: 2px; }
.feature p { font-size: var(--t-sm); color: var(--text-muted); }

/* --------------------------------------------------------- outcomes
   A short benefit-led band for the gym owner. Deliberately compact: the
   feature detail lives further down, this is the reason to care. */
.outcomes {
  padding: var(--s-16) 0;
  border-top: 1px solid var(--border-soft);
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(140,255,90,.04), transparent 60%);
}
.outcomes h2 {
  font-size: clamp(1.5rem, 3vw, 1.875rem);
  margin-bottom: var(--s-8);
  max-width: 24ch;
}
.outcome-grid { display: grid; gap: var(--s-6); grid-template-columns: 1fr; }
.outcome { padding-top: var(--s-4); border-top: 2px solid var(--accent-line); }
.outcome-stat {
  display: block;
  font-size: var(--t-xs); font-weight: 700; letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  margin-bottom: var(--s-3);
}
.outcome h3 {
  font-size: var(--t-md); line-height: 1.35;
  margin-bottom: var(--s-2); max-width: 22ch;
}
.outcome p { font-size: var(--t-base); color: var(--text-muted); }

@media (min-width: 720px) {
  .outcome-grid { grid-template-columns: repeat(3, 1fr); gap: var(--s-8); }
}

/* ---------------------------------------------------------- pricing */
.price-grid { display: grid; gap: var(--s-5); grid-template-columns: 1fr; align-items: stretch; }
.price-card {
  position: relative;
  padding: var(--s-8);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-xl);
  background: var(--surface);
  display: flex; flex-direction: column;
}
.price-card.is-featured { border-color: var(--accent-line); background: linear-gradient(180deg, rgba(140,255,90,.05), var(--surface) 55%); }
.price-name { font-size: var(--t-xl); font-weight: 620; letter-spacing: -0.02em; }
.price-for { margin-top: var(--s-2); color: var(--text-muted); font-size: var(--t-base); }
.price-value {
  margin: var(--s-6) 0;
  font-size: var(--t-2xl); font-weight: 620; letter-spacing: -0.025em;
}
.price-value small { display: block; font-size: var(--t-sm); font-weight: 400; color: var(--text-muted); margin-top: var(--s-1); letter-spacing: 0; }
.price-list { list-style: none; margin: 0 0 var(--s-8); padding: 0; display: grid; gap: var(--s-3); }
.price-list li { display: flex; gap: var(--s-3); align-items: flex-start; font-size: var(--t-base); color: var(--text-muted); }
.price-list svg { flex: none; margin-top: 4px; color: var(--accent); }
.price-card .btn { margin-top: auto; }

/* ---------------------------------------------------------- enquiry */
.form-grid { display: grid; gap: var(--s-4); grid-template-columns: 1fr; }
.form-grid .full { grid-column: 1 / -1; }
/* The grid gap owns the spacing here. Without this the core `.field + .field`
   rule offsets every field except the first, so row one sits crooked. */
.form-grid .field + .field { margin-top: 0; }

.form-status {
  display: flex; align-items: flex-start; gap: var(--s-3);
  padding: var(--s-4);
  border-radius: var(--r-md);
  font-size: var(--t-base);
}
.form-status-ok { background: var(--accent-soft); border: 1px solid var(--accent-line); }
.form-status-bad { background: var(--danger-soft); border: 1px solid rgba(255,107,90,.3); }

/* ----------------------------------------------------------- footer */
.site-footer {
  border-top: 1px solid var(--border-soft);
  padding: var(--s-12) 0;
  margin-top: var(--s-20);
}
.footer-row {
  display: flex; flex-wrap: wrap; gap: var(--s-6);
  align-items: center; justify-content: space-between;
  font-size: var(--t-sm); color: var(--text-faint);
}
.footer-links { display: flex; gap: var(--s-3); flex-wrap: wrap; margin: calc(var(--s-2) * -1); }
/* Padding brings these to a usable target size (WCAG 2.5.8 wants 24x24). */
.footer-links a {
  display: inline-flex; align-items: center;
  min-height: 32px; padding: var(--s-2);
  border-radius: var(--r-sm);
}
.footer-links a:hover { color: var(--text); }

/* ------------------------------------------------------ breakpoints */
@media (min-width: 720px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .price-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1000px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-20); }
  .hero { padding-top: var(--s-24); }
}
@media (max-width: 520px) {
  /* Reclaim horizontal room on small handsets. */
  .wrap { padding-inline: var(--s-4); }
  .price-card { padding: var(--s-5); }
  .card { padding: var(--s-5); }
}

@media (max-width: 719px) {
  .nav { gap: var(--s-3); }
  .nav-link { padding: var(--s-2); font-size: var(--t-sm); }
  .section { padding: var(--s-16) 0; }
  .hero { padding: var(--s-12) 0 var(--s-12); }
}


/* ==========================================================================
   Entrance and scroll-reveal animation
   Progressive enhancement: the hidden state only applies once JS has set
   `data-anim` on <html>, so with JS off or broken every element renders
   normally. Everything here is disabled under prefers-reduced-motion.
   ========================================================================== */

[data-anim] .reveal {
  opacity: 0;
  transform: translate3d(0, 16px, 0);
  will-change: opacity, transform;
}

[data-anim] .reveal.is-in {
  opacity: 1;
  transform: none;
  transition:
    opacity 520ms cubic-bezier(.22, .61, .36, 1) var(--reveal-delay, 0ms),
    transform 520ms cubic-bezier(.22, .61, .36, 1) var(--reveal-delay, 0ms);
}

/* Once revealed, drop the hint so the compositor can release the layer. */
[data-anim] .reveal.is-done { will-change: auto; }

/* The recovery path snaps rather than animates. It only runs when something
   has already gone wrong, and a frozen transition would leave content
   invisible - a backgrounded tab suspends transitions entirely. */
[data-anim] .reveal.is-instant {
  opacity: 1;
  transform: none;
  transition: none;
}

/* Hero rises from slightly further for a bit more presence. */
[data-anim] .reveal-hero { transform: translate3d(0, 24px, 0); }

/* The phone mockup settles in with a touch of scale. */
[data-anim] .reveal-phone {
  transform: translate3d(0, 28px, 0) scale(.985);
  transform-origin: 50% 60%;
}
[data-anim] .reveal-phone.is-in { transform: none; }

/* ------------------------------------------------------- micro-interaction */
.step, .feature, .price-card {
  transition: transform var(--dur-slow) var(--ease),
              border-color var(--dur-slow) var(--ease),
              background var(--dur-slow) var(--ease);
}
.step:hover, .feature:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
}
.price-card:hover { border-color: var(--border); }
.price-card.is-featured:hover { border-color: var(--accent-line); }

/* Nav links get an underline that grows from the left. */
.nav-link { position: relative; }
.nav-link::after {
  content: "";
  position: absolute;
  left: var(--s-3); right: var(--s-3); bottom: 4px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur) var(--ease);
}
.nav-link:hover::after,
.nav-link[aria-current="page"]::after { transform: scaleX(1); }

/* The logo mark gives a small acknowledgement on hover. */
.logo svg { transition: transform var(--dur-slow) var(--ease); }
.logo:hover svg { transform: rotate(-6deg) scale(1.06); }

@media (prefers-reduced-motion: reduce) {
  [data-anim] .reveal,
  [data-anim] .reveal-hero,
  [data-anim] .reveal-phone {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .step:hover, .feature:hover { transform: none; }
  .nav-link::after { transition: none; }
  .logo:hover svg { transform: none; }
}
