/* ---------- Font ---------- */
@font-face {
  font-family: "Roboto Slab";
  src: url("../fonts/RobotoSlab-VariableFont_wght.ttf") format("truetype-variations"),
       url("../fonts/RobotoSlab-VariableFont_wght.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Design tokens (dark, ported from badgip-website) ---------- */
:root {
  --color-bg: #0a0a0c;
  --color-text: #f5f5f5;
  --color-accent: #3effa3;
  --color-border: #2a2a30;

  --color-bg-elevated: color-mix(in srgb, var(--color-bg) 92%, white);
  --color-bg-elevated-2: color-mix(in srgb, var(--color-bg) 86%, white);
  --color-border-strong: color-mix(in srgb, var(--color-border) 65%, var(--color-text) 35%);
  --color-text-dim: color-mix(in srgb, var(--color-text) 70%, var(--color-bg) 30%);
  --color-text-faint: color-mix(in srgb, var(--color-text) 60%, var(--color-bg) 40%);
  --color-accent-dim: color-mix(in srgb, var(--color-accent) 70%, black);
  --color-accent-glow: color-mix(in srgb, var(--color-accent-dim) 25%, transparent);
  --color-surface-glass: rgba(20, 20, 24, 0.85);

  --font-display: "Roboto Slab", Georgia, "Times New Roman", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --radius-pill: 999px;
  --radius-lg: 28px;
  --radius-xl: 32px;
  --radius-md: 16px;

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6rem;

  --max-width: 1200px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-base: 0.4s;
  --duration-slow: 0.8s;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  padding: clamp(0.75rem, 3vw, 2rem);
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, color-mix(in srgb, var(--color-accent) 7%, transparent), transparent),
    radial-gradient(ellipse 60% 40% at 100% 20%, color-mix(in srgb, var(--color-accent) 4%, transparent), transparent),
    var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden; /* allows intentional visual bleed (e.g. .hero-phone) without a page scrollbar */
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; }
svg { display: block; }

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
::selection { background: var(--color-accent); color: #04140c; }

/* ---------- Scrollbar ---------- */
html { scrollbar-color: var(--color-border-strong) transparent; scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--color-border-strong);
  border-radius: var(--radius-pill);
  border: 2px solid var(--color-bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--color-accent-dim); }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-3);
}

/* ---------- Page card (nested composition) ---------- */
.page-card {
  position: relative;
  max-width: 1440px;
  margin: 0 auto;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

/* ---------- Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--color-surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-border);
}
/* .page-card's own border-radius + overflow:hidden clips this to match
   the rounded top corners automatically — no extra rounding needed here. */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* padding-top/bottom only (not the shorthand) — .nav is combined with
     .container directly on the same element for the sticky header, and a
     `padding` shorthand here would silently overwrite .container's
     horizontal padding since both rules have equal specificity. */
  padding-top: var(--space-3);
  padding-bottom: var(--space-3);
}
.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}
.nav-brand-icon {
  width: 22px;
  height: 22px;
  color: var(--color-accent);
  flex-shrink: 0;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.nav-links a:not(.btn-primary) {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.95rem;
  color: var(--color-text-dim);
  transition: color 0.2s var(--ease-out);
}
.nav-links a:not(.btn-primary):hover { color: var(--color-text); }
.nav-links .icon-sm { width: 16px; height: 16px; }

/* Below 768px, hide secondary nav links, keep brand + CTA only (no JS needed) */
@media (max-width: 767px) {
  .nav-links a:not(.btn-primary) { display: none; }
  .nav-links { gap: var(--space-2); }
}

/* ---------- Buttons ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(180deg, color-mix(in srgb, var(--color-accent) 80%, white), var(--color-accent));
  color: #04140c;
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--color-accent-dim);
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 4px 14px -4px var(--color-accent-glow);
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 8px 20px -4px var(--color-accent-glow);
}
.btn-primary:active { transform: translateY(-1px) scale(0.97); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: color-mix(in srgb, var(--color-text) 4%, transparent);
  color: var(--color-text);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border-strong);
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  transition: border-color 0.2s var(--ease-out), color 0.2s var(--ease-out), transform 0.2s var(--ease-out);
}
.btn-secondary:hover {
  border-color: var(--color-accent-dim);
  color: var(--color-accent-dim);
  transform: translateY(-2px);
}
.btn-secondary:active { transform: translateY(-1px) scale(0.97); }

/* ---------- Store icon buttons (circular, replaces wide badges) ---------- */
.store-badges {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.store-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--color-border-strong);
  background: color-mix(in srgb, var(--color-text) 4%, transparent);
  color: var(--color-text);
  transition: border-color 0.2s var(--ease-out), color 0.2s var(--ease-out), transform 0.2s var(--ease-out);
}
.store-icon:hover {
  border-color: var(--color-accent-dim);
  color: var(--color-accent);
  transform: translateY(-2px);
}
.store-icon svg { width: 20px; height: 20px; }
.store-note {
  font-size: 0.85rem;
  color: var(--color-text-faint);
}

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: var(--space-5);
  align-items: center;
  padding: var(--space-5) 0 var(--space-6);
}
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: var(--space-4); padding: var(--space-4) 0; }
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-2);
}
.hero-eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 10px 2px var(--color-accent-glow);
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-3);
}
.hero-title em {
  font-style: italic;
  font-weight: 400;
  color: var(--color-text-dim);
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--color-text-dim);
  max-width: 46ch;
  margin-bottom: var(--space-4);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--space-3);
}

/* A one-time entrance on load (not scroll-triggered — the hero is already
   above the fold), copy first then media, so the page feels like it's
   settling into place rather than appearing all at once. */
@media (prefers-reduced-motion: no-preference) {
  .hero-copy { animation: heroFadeUp var(--duration-slow) var(--ease-out) both; }
  .hero-media { animation: heroFadeUp var(--duration-slow) var(--ease-out) 0.15s both; }
}
@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-media {
  position: relative;
}
.hero-media::before {
  content: "";
  position: absolute;
  inset: -6% -10%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--color-accent) 22%, transparent), transparent 75%);
  border-radius: 40% 60% 55% 45% / 45% 40% 60% 55%;
  z-index: 0;
  filter: blur(10px);
}
/* A slow, gentle drift on the glow blob — the one animation that's always
   running rather than triggered by scroll/hover, so it reads as ambient
   life behind the hero rather than a one-shot effect. */
@media (prefers-reduced-motion: no-preference) {
  .hero-media::before {
    animation: heroGlowFloat 12s var(--ease-out) infinite;
  }
}
@keyframes heroGlowFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-3%, 4%) scale(1.06); }
}

.hero-media-frame {
  position: relative;
  z-index: 1;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.6);
  background: var(--color-bg-elevated-2);
  border: 1px solid var(--color-border);
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}
.hero-media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Homepage-only: a slight static tilt gives the abstract preview graphic
   some of the same tactile, "photographed object" feel the app-page phone
   mockup has, without pretending it's a real screenshot. Straightens
   slightly on hover as a small interactive touch. */
.hero-media-frame--tilt {
  transform: rotate(-2deg);
}
.hero-media-frame--tilt:hover {
  transform: rotate(-1deg) translateY(-4px);
  box-shadow: 0 32px 70px -20px rgba(0, 0, 0, 0.65);
}
@media (prefers-reduced-motion: reduce) {
  .hero-media-frame--tilt,
  .hero-media-frame--tilt:hover { transform: rotate(-2deg); }
}

/* Tall/rotated phone-photo variant of the hero glow, used on app pages with a vertical mockup */
.hero-media--phone::before {
  inset: -8% 0% -8% 18%;
  border-radius: 45% 55% 60% 40% / 55% 45% 55% 45%;
}
@media (max-width: 900px) {
  .hero-media--phone::before { inset: -6% 8%; }
}

.hero-phone {
  position: relative;
  z-index: 1;
  max-width: 320px;
  margin: 0 auto;
}
.hero-phone img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px -16px rgba(0, 0, 0, 0.7), 0 0 40px -18px var(--color-accent-glow);
  transform: rotate(-6deg);
}
@media (min-width: 901px) {
  .hero-phone {
    max-width: 360px;
    margin-inline-start: auto;
    margin-inline-end: -1rem;
  }
}
@media (max-width: 480px) {
  .hero-phone { max-width: 240px; }
  .hero-phone img { transform: rotate(-3deg); }
}

/* Decorative hand-drawn squiggle accent */
.squiggle {
  position: absolute;
  color: var(--color-text-faint);
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}

/* ---------- Section media (standalone 16:9 showcase) ---------- */
.section-media {
  padding: var(--space-4) 0 var(--space-6);
}

/* ---------- Section ---------- */
.section {
  padding: var(--space-6) 0;
}
.section-heading {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  margin-bottom: var(--space-4);
}

/* ---------- App cards / feature cards ---------- */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-3);
}
.app-card {
  display: block;
  background: var(--color-bg-elevated-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}
.app-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-accent-dim);
  box-shadow: 0 20px 45px -24px rgba(0, 0, 0, 0.6), 0 0 30px -16px var(--color-accent-glow);
}
.app-card-icon,
.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-accent) 14%, transparent);
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-accent);
}
/* Card icons are now uploaded images, not a fixed icon set — sized to fit
   within the existing 48px box (object-fit:contain = "aspect fit") rather
   than stretching or cropping whatever aspect ratio gets uploaded. */
.feature-icon img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}
.app-card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  margin-bottom: var(--space-1);
}
.app-card-desc {
  font-size: 0.95rem;
  color: var(--color-text-dim);
}
.app-grid-error {
  color: var(--color-text-faint);
  font-size: 0.95rem;
}

/* ---------- Loading skeleton ---------- */
.skeleton-card {
  height: 180px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: linear-gradient(
    90deg,
    var(--color-bg-elevated-2) 25%,
    var(--color-bg-elevated) 37%,
    var(--color-bg-elevated-2) 63%
  );
  background-size: 400% 100%;
}
@media (prefers-reduced-motion: no-preference) {
  .skeleton-card { animation: skeletonShimmer 1.6s ease infinite; }
}
@keyframes skeletonShimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* Feature cards share .app-card's look but aren't links — the hover
   lift/glow otherwise implies clickability where nothing happens on click. */
.feature-card:hover {
  transform: none;
  border-color: var(--color-border);
  box-shadow: none;
}

/* ---------- Content page (terms/privacy) ---------- */
.content-page {
  padding: var(--space-5) 0 var(--space-6);
  max-width: 720px;
  margin: 0 auto;
}
.content-page h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 4vw, 2.75rem);
  margin-bottom: var(--space-1);
}
.content-page .updated {
  color: var(--color-text-faint);
  font-size: 0.9rem;
  margin-bottom: var(--space-4);
}
.content-page h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  margin-top: var(--space-4);
  margin-bottom: var(--space-2);
}
.content-page p {
  margin-bottom: var(--space-2);
  color: var(--color-text-dim);
}
.placeholder-note {
  background: color-mix(in srgb, var(--color-accent) 12%, transparent);
  border: 1px solid var(--color-accent-dim);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  font-size: 0.9rem;
  color: var(--color-text);
  margin-bottom: var(--space-4);
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--color-border);
  padding: var(--space-4) 0;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}
.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--color-text-dim);
  transition: color 0.2s var(--ease-out);
}
.footer-links a:hover { color: var(--color-text); }
.footer-links .icon-sm { width: 15px; height: 15px; }
.footer-copy {
  font-size: 0.85rem;
  color: var(--color-text-faint);
}

/* ---------- Shared small icon utility ---------- */
.icon-sm { width: 18px; height: 18px; flex-shrink: 0; }

/* ---------- Scroll-reveal ---------- */
/* Elements start fully visible — this is purely additive progressive
   enhancement. assets/js/animations.js adds "reveal-pending" itself right
   before it starts observing, so if JS never runs (blocked, fails, or the
   browser lacks IntersectionObserver) content simply stays visible instead
   of being silently hidden forever. */
.reveal {
  transition: opacity var(--duration-slow) var(--ease-out), transform var(--duration-slow) var(--ease-out);
}
.reveal.reveal-pending {
  opacity: 0;
  transform: translateY(24px);
}
@media (prefers-reduced-motion: reduce) {
  .reveal.reveal-pending { opacity: 1; transform: none; transition: none; }
}

/* ---------- 404 ---------- */
.error-page {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: var(--space-3);
}
.error-page h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.5rem, 6vw, 4rem);
}
@media (prefers-reduced-motion: no-preference) {
  .error-page {
    animation: errorPageIn var(--duration-slow) var(--ease-out) both;
  }
}
@keyframes errorPageIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
