/* ==========================================================================
   PedalPanel — base design system
   Shared across all three pages: tokens, reset, type, layout, nav, buttons,
   cards, footer, and the site-wide scroll-reveal utility.
   ========================================================================== */

:root {
  /* Brand */
  --pink: #ff2c68;
  --pink-deep: #e01259;
  --pink-tint: #ffe4ee;
  --pink-tint-2: #fff0f5;

  /* Ink */
  --ink: #14141a;
  --ink-soft: #4a4a56;
  --ink-faint: #8b8b98;

  /* Surfaces */
  --paper: #ffffff;
  --paper-alt: #faf9fb;
  --paper-line: #ebe9ef;
  --dark: #121218;
  --dark-line: #2a2a34;

  /* Type */
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Menlo, monospace;

  /* Scale */
  --container: 1160px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

img,
svg {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0;
}

p {
  margin: 0;
}

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

@media (min-width: 700px) {
  .container {
    padding-inline: 40px;
  }
}

section {
  padding-block: clamp(56px, 9vw, 108px);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pink-deep);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pink);
  flex-shrink: 0;
}

/* ---------- Nav ---------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--paper-line);
}

.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
}

.mark {
  display: inline-block;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--ink);
  position: relative;
  flex-shrink: 0;
  overflow: hidden;
}

/* Logo mark: stays a plain pink square at rest, then on a slow loop
   squints (scales down vertically, like an eye narrowing) and glances
   left and right while squinted, before reopening back to a full square.
   One transform (scaleY + translateX together) per keyframe step, so the
   "look around" motion only happens while narrowed — it reads as a
   square that blinks and peeks, not a shape that's constantly moving. */
.mark::before {
  content: "";
  position: absolute;
  inset: 6px 6px 6px 6px;
  background: var(--pink);
  border-radius: 2px;
  animation: markSquint 8s ease-in-out infinite;
}

/* Keyframe percentages scaled from the previous 5.6s version so the
   blink+glance motion itself still takes ~3.25s in absolute time — only
   the resting/held-square gap between blinks got longer (now ~4.75s
   instead of ~2.35s). */
@keyframes markSquint {
  0% { transform: scaleY(1) translateX(0); border-radius: 2px; }
  6% { transform: scaleY(0.32) translateX(0); border-radius: 3px; }
  14% { transform: scaleY(0.32) translateX(-3px); border-radius: 3px; }
  24% { transform: scaleY(0.32) translateX(3px); border-radius: 3px; }
  34% { transform: scaleY(0.32) translateX(0); border-radius: 3px; }
  41%, 100% { transform: scaleY(1) translateX(0); border-radius: 2px; }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.92rem;
}

.nav-links a:not(.btn) {
  text-decoration: none;
  color: var(--ink-soft);
  transition: color 0.2s var(--ease);
}

.nav-links a:not(.btn):hover {
  color: var(--ink);
}

.nav-audience {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 5px 10px;
  border: 1px solid var(--paper-line);
  border-radius: 100px;
}

/* Below ~640px, keep only the wordmark + primary CTA — the audience pill
   and cross-link text don't have room and aren't essential on mobile. */
@media (max-width: 640px) {
  .nav-audience,
  .nav-links li:nth-child(2) {
    display: none;
  }

  .nav-links {
    gap: 12px;
  }

  .site-nav .btn {
    padding: 10px 18px;
    font-size: 0.88rem;
  }
}

/* ---------- Buttons ----------
   Hover treatment adapted from Codrops' magnetic-button family
   (tympanus.net/codrops/2020/08/05/magnetic-buttons/) and the fill-sweep
   idea from "Ideas for CSS Button Hover Animations" — reimplemented here
   in plain JS (subtle pointer-follow translate, ±10px clamp) + a
   radial-gradient sweep that expands from the cursor position, no library.
   ------------------------------------------------------------------ */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  padding: 14px 26px;
  border-radius: 100px;
  border: 1px solid transparent;
  cursor: pointer;
  isolation: isolate;
  overflow: hidden;
  transition: transform 0.35s var(--ease), border-color 0.3s var(--ease), color 0.3s var(--ease);
  will-change: transform;
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), var(--pink-deep) 0%, var(--pink) 60%);
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.35s var(--ease), transform 0.45s var(--ease);
}

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

.btn-primary::before {
  opacity: 1;
  transform: scale(1);
}

.btn-primary:hover {
  transform: translate(var(--tx, 0), var(--ty, 0));
}

.btn-primary:hover::before {
  transform: scale(1.15);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--paper-line);
}

.btn-ghost::before {
  background: var(--ink);
}

.btn-ghost:hover {
  color: #fff;
  border-color: var(--ink);
  transform: translate(var(--tx, 0), var(--ty, 0));
}

.btn-ghost:hover::before {
  opacity: 1;
  transform: scale(1.15);
}

.btn-lg {
  padding: 17px 32px;
  font-size: 1rem;
}

/* ---------- Reveal-on-scroll ----------
   IntersectionObserver fade/slide utility, adapted from Codrops' scroll
   tag family (e.g. tympanus.net/codrops/tag/scroll/) — a single restrained
   reveal reused everywhere rather than a bespoke animation per section.
   See js/reveal.js.
   ------------------------------------------------------------------ */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-stagger > * {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.reveal-stagger.is-visible > * {
  opacity: 1;
  transform: translateY(0);
}

.reveal-stagger.is-visible > *:nth-child(1) { transition-delay: 0.03s; }
.reveal-stagger.is-visible > *:nth-child(2) { transition-delay: 0.09s; }
.reveal-stagger.is-visible > *:nth-child(3) { transition-delay: 0.15s; }
.reveal-stagger.is-visible > *:nth-child(4) { transition-delay: 0.21s; }
.reveal-stagger.is-visible > *:nth-child(5) { transition-delay: 0.27s; }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--dark);
  border-top: 1px solid var(--dark-line);
  padding-block: 40px;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.88rem;
  color: #9a9aa6;
}

.site-footer a {
  color: #d7d7de;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--pink);
}

/* ---------- Shared misc ---------- */

.mono {
  font-family: var(--font-mono);
}

.text-pink {
  color: var(--pink-deep);
}

.section-head {
  max-width: 640px;
  margin-bottom: 40px;
}

.section-head.center {
  margin-inline: auto;
  text-align: center;
}

.lede {
  font-size: 1.08rem;
  color: var(--ink-soft);
  margin-top: 14px;
  line-height: 1.6;
}

/* ---------- Anchor sections ----------
   Shared pattern for sections that used to be flat two-column paragraph
   text with no visual anchor (v2 feedback): a narrower text column with a
   bold scannable "statement" line, next to a small supporting diagram
   card, sitting over a subtle dot-grid + soft radial-glow background so
   the section has its own identity before anyone reads a word. Background
   glow technique is plain CSS radial-gradient + blur (see Codrops' CSS
   reference for radial-gradient/blur — no demo needed for something this
   simple, per the brief's fallback). Reused on both the advertiser and
   shop pages, with per-page content in the .swap-card.
   ------------------------------------------------------------------ */

.anchor-section {
  position: relative;
  overflow: hidden;
}

.anchor-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(var(--paper-line) 1.2px, transparent 1.2px);
  background-size: 26px 26px;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 18%, #000 82%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 18%, #000 82%, transparent);
}

.anchor-bg::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -140px;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  transform: translateY(-50%);
  background: radial-gradient(circle, rgba(255, 44, 104, 0.16), rgba(255, 44, 104, 0) 70%);
  filter: blur(6px);
}

.anchor-grid-reverse .anchor-bg::after {
  right: auto;
  left: -140px;
}

.anchor-bg.no-glow::after {
  display: none;
}

.anchor-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: center;
}

@media (min-width: 900px) {
  .anchor-grid {
    grid-template-columns: 1.15fr 0.85fr;
    gap: 56px;
  }

  .anchor-grid-reverse .anchor-text {
    order: 2;
  }

  .anchor-grid-reverse .swap-card {
    order: 1;
  }
}

.anchor-text {
  max-width: 46ch;
}

.anchor-text p {
  color: var(--ink-soft);
  font-size: 1.02rem;
  line-height: 1.65;
}

.anchor-text p + p {
  margin-top: 16px;
}

.statement {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.15rem, 2.1vw, 1.4rem);
  line-height: 1.4;
  color: var(--ink);
  border-left: 3px solid var(--pink);
  padding-left: 16px;
  margin: 18px 0 22px;
  max-width: 34ch;
}

.swap-card {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--paper-line);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: 0 24px 48px -32px rgba(20, 20, 26, 0.25);
}

.swap-label {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 20px;
}

.swap-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.swap-bag {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.swap-bag svg {
  width: 46px;
  height: 46px;
  color: var(--ink-faint);
}

.swap-bag-after svg {
  color: var(--ink);
}

.swap-live-dot {
  fill: var(--pink);
  animation: swapBlink 1.8s var(--ease) infinite;
}

@keyframes swapBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

@media (prefers-reduced-motion: reduce) {
  .swap-live-dot { animation: none; }
}

.swap-caption {
  font-size: 0.76rem;
  color: var(--ink-faint);
  text-align: center;
}

.swap-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--pink);
  flex-shrink: 0;
  padding-bottom: 24px;
}

.swap-arrow svg {
  width: 22px;
  height: 22px;
}

.swap-arrow-label {
  font-size: 0.66rem;
  color: var(--ink-faint);
  white-space: nowrap;
}

.swap-stat {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px dashed var(--paper-line);
  text-align: left;
}

.swap-stat-num {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 2.1rem;
  color: var(--pink-deep);
  line-height: 1;
}

.swap-stat-label {
  font-size: 0.88rem;
  color: var(--ink-soft);
  max-width: 20ch;
  line-height: 1.4;
}

.swap-earning {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px dashed var(--paper-line);
}

.swap-earning-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pink);
  flex-shrink: 0;
  animation: swapBlink 1.8s var(--ease) infinite;
}

@media (prefers-reduced-motion: reduce) {
  .swap-earning-dot { animation: none; }
}

.swap-earning-label {
  font-size: 0.86rem;
  color: var(--ink-soft);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Lead-capture dialog ----------
   "Book a call" opens this instead of a mailto: link. Uses the native
   <dialog> element for the backdrop, Escape-to-close and focus handling
   for free, animated in with the modern @starting-style + transition
   pattern (platform CSS, not a library) — falls back to appearing
   instantly on browsers that don't support it. See js/lead-form.js. */

.lead-dialog {
  border: none;
  border-radius: var(--radius-lg);
  padding: 34px 30px;
  max-width: 440px;
  width: calc(100% - 48px);
  background: var(--paper);
  box-shadow: 0 40px 80px -30px rgba(20, 20, 26, 0.45);
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  transition: opacity 0.28s var(--ease), transform 0.28s var(--ease), overlay 0.28s allow-discrete, display 0.28s allow-discrete;
}

.lead-dialog[open] {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@starting-style {
  .lead-dialog[open] {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
}

.lead-dialog::backdrop {
  background: rgba(18, 18, 24, 0.55);
  opacity: 0;
  transition: opacity 0.28s var(--ease), overlay 0.28s allow-discrete, display 0.28s allow-discrete;
}

.lead-dialog[open]::backdrop {
  opacity: 1;
}

@starting-style {
  .lead-dialog[open]::backdrop {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lead-dialog,
  .lead-dialog::backdrop {
    transition: none;
  }
}

.lead-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--ink-faint);
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.lead-close:hover {
  background: var(--paper-alt);
  color: var(--ink);
}

.lead-close svg {
  width: 18px;
  height: 18px;
}

.lead-form h3,
.lead-success h3 {
  font-size: 1.35rem;
  margin-top: 6px;
}

.lead-form-sub {
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.5;
}

.lead-field {
  margin-top: 18px;
}

.lead-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}

.lead-optional {
  font-weight: 400;
  color: var(--ink-faint);
}

.lead-field input,
.lead-field textarea {
  width: 100%;
  font: inherit;
  font-size: 0.95rem;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--paper-line);
  background: var(--paper);
  color: var(--ink);
  resize: vertical;
}

.lead-field input:focus,
.lead-field textarea:focus {
  outline: none;
  border-color: var(--pink);
  box-shadow: 0 0 0 3px var(--pink-tint);
}

.lead-form-error {
  margin-top: 16px;
  font-size: 0.86rem;
  color: var(--pink-deep);
}

.lead-submit {
  width: 100%;
  margin-top: 22px;
}

.lead-success {
  text-align: center;
}

.lead-success p {
  margin-top: 12px;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.55;
}

.lead-success a {
  color: var(--pink-deep);
}

.lead-success .btn {
  margin-top: 22px;
}
