/* TripMeter — structured landing: layers, hero, card grid, slabs, dark CTA */

:root {
  --bg: #fbfbfd;
  --bg-elevated: #ffffff;
  --slab: #f0f2f6;
  --text: #0f1114;
  --text-secondary: #5c6370;
  --separator: rgba(15, 17, 20, 0.08);
  --link: #0b5fff;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.12);
  --accent-ring: rgba(37, 99, 235, 0.35);
  --header-bg: rgba(244, 245, 247, 0.78);
  --radius-card: 20px;
  --radius-icon: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 17, 20, 0.06);
  --shadow-md: 0 12px 40px rgba(15, 17, 20, 0.08);
  --shadow-lg: 0 24px 64px rgba(15, 17, 20, 0.12);
  --max: 640px;
  --max-content: 920px;
  --max-wide: 1080px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .feature-card,
  .btn-appstore {
    transition: none !important;
  }
}

body.page {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  position: relative;
  min-height: 100vh;
  text-align: center;
}

/* Layered page background */
.page-gradient {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(900px 480px at 50% -15%, rgba(99, 102, 241, 0.08), transparent 60%),
    radial-gradient(700px 400px at 50% 0%, rgba(37, 99, 235, 0.06), transparent 55%),
    var(--bg);
}

.page-noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.18;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.wrap {
  width: min(var(--max-wide), calc(100% - 40px));
  margin-inline: auto;
}

/* —— Header —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--separator);
}

.header-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 18px 0 20px;
  min-height: unset;
  text-align: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
  opacity: 0.88;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(145deg, #2e3138 0%, #12141a 100%);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  display: grid;
  place-items: center;
  box-shadow:
    var(--shadow-sm),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.header-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px 20px;
  flex-wrap: wrap;
}

.nav-text {
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 500;
}

.nav-text:hover {
  color: var(--text-secondary);
  text-decoration: none;
}

/* —— Buttons —— */
.btn-appstore {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: -0.01em;
  color: #fff;
  background: linear-gradient(180deg, #1a1d24 0%, #0a0b0e 100%);
  border-radius: 999px;
  padding: 10px 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.15s ease;
}

.btn-appstore:hover {
  text-decoration: none;
  box-shadow: var(--shadow-md);
  opacity: 0.96;
}

.btn-appstore:active {
  transform: scale(0.98);
}

.btn-appstore--sm {
  padding: 8px 14px;
  font-size: 0.75rem;
}

.btn-appstore--lg {
  padding: 14px 28px;
  font-size: 0.9375rem;
}

.btn-appstore--invert {
  background: #fff;
  color: #0a0b0e;
  border-color: rgba(0, 0, 0, 0.06);
}

.btn-appstore--invert:hover {
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
}

/* —— Hero —— */
.hero {
  position: relative;
  padding: clamp(32px, 6vw, 56px) 0 clamp(48px, 9vw, 88px);
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  left: 50%;
  top: 38%;
  transform: translate(-50%, -50%);
  width: min(640px, 130vw);
  height: min(440px, 110vw);
  background: radial-gradient(circle, rgba(37, 99, 235, 0.1) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  max-width: 42rem;
  margin-inline: auto;
}

.app-icon-lg {
  width: 92px;
  height: 92px;
  margin: 0 auto 26px;
  border-radius: 22px;
  background: linear-gradient(160deg, #3d4450 0%, #14161c 55%, #0a0b0e 100%);
  color: #fff;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  display: grid;
  place-items: center;
  box-shadow:
    var(--shadow-lg),
    0 0 0 1px rgba(255, 255, 255, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.hero-title {
  margin: 0 auto 20px;
  max-width: 20ch;
  font-size: clamp(2.25rem, 5.2vw, 3.125rem);
  font-weight: 700;
  letter-spacing: -0.038em;
  line-height: 1.06;
  color: var(--text);
}

.hero-lead {
  margin: 0 auto 36px;
  max-width: 38em;
  font-size: clamp(1.0625rem, 2.2vw, 1.1875rem);
  line-height: 1.62;
  color: var(--text-secondary);
}

.hero .btn-appstore--lg {
  margin-inline: auto;
}

/* —— Section primitives —— */
.section-head {
  max-width: 38rem;
  margin-inline: auto;
}

.features-intro {
  padding: clamp(8px, 2vw, 16px) 0 clamp(40px, 7vw, 72px);
}

.section-title {
  margin: 0 0 16px;
  font-size: clamp(1.5rem, 3vw, 1.875rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.18;
}

.section-deck {
  margin: 0;
  font-size: clamp(1.0625rem, 2vw, 1.125rem);
  color: var(--text-secondary);
  line-height: 1.6;
}

/* —— Features: card band only (FocusKit-style clean intro above) —— */
.section-slab {
  border-block: 1px solid var(--separator);
  background: linear-gradient(180deg, var(--slab) 0%, rgba(240, 242, 246, 0.5) 100%);
}

.features {
  padding: 0;
}

.feature-cards-band {
  padding: clamp(40px, 6vw, 64px) 0 clamp(56px, 8vw, 88px);
}

.feature-cards-inner {
  max-width: calc(var(--max-content) + 80px);
  margin-inline: auto;
}

.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 640px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }
}

@media (min-width: 960px) {
  .feature-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.feature-card {
  padding: 22px 22px 24px;
  border-radius: var(--radius-card);
  background: var(--bg-elevated);
  border: 1px solid var(--separator);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  text-align: center;
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(37, 99, 235, 0.22);
}

.feature-card__icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  border-radius: var(--radius-icon);
  display: grid;
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(37, 99, 235, 0.15);
}

.feature-card__icon svg {
  display: block;
}

.feature-card h3 {
  margin: 0 0 8px;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.feature-card p {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

/* —— Scan row —— */
.scan-section {
  padding: clamp(48px, 7vw, 80px) 0;
  background: var(--bg-elevated);
}

.scan-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  max-width: 28rem;
  margin-inline: auto;
}

.scan-title {
  margin: 0 0 10px;
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.scan-sub {
  margin: 0;
  font-size: 1rem;
  color: var(--text-secondary);
}

.scan-slot {
  width: 100%;
  max-width: 220px;
  min-height: 200px;
  margin-inline: auto;
  border-radius: var(--radius-card);
  border: 2px dashed rgba(15, 17, 20, 0.12);
  background: linear-gradient(180deg, rgba(244, 245, 247, 0.9) 0%, rgba(236, 238, 242, 0.5) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* —— Closing dark panel —— */
.closing-cta {
  padding: clamp(56px, 9vw, 96px) 0 clamp(64px, 10vw, 112px);
  background: linear-gradient(180deg, #0c0e12 0%, #060708 100%);
  color: #e8eaef;
}

.closing-panel {
  max-width: var(--max);
  margin-inline: auto;
  text-align: center;
  padding: clamp(32px, 5vw, 48px) clamp(24px, 4vw, 40px);
  border-radius: calc(var(--radius-card) + 6px);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.45);
}

.closing-title {
  margin: 0 0 12px;
  font-size: clamp(1.5rem, 3vw, 1.875rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: #fff;
}

.closing-deck {
  margin: 0 auto 28px;
  max-width: 32em;
  font-size: 1.0625rem;
  line-height: 1.55;
  color: rgba(232, 234, 239, 0.72);
}

.closing-panel .btn-appstore {
  margin-inline: auto;
}

/* —— Footer —— */
.site-footer {
  padding: 28px 0 40px;
  background: #060708;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-inner {
  text-align: center;
}

.footer-copy {
  margin: 0;
  font-size: 0.875rem;
  color: rgba(232, 234, 239, 0.55);
}

.footer-copy a {
  color: rgba(232, 234, 239, 0.75);
  font-weight: 500;
}

.footer-copy a:hover {
  color: #fff;
}

.footer-sep {
  margin: 0 0.35em;
  opacity: 0.45;
}

/* —— Guard —— */
#guard-notice {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(6, 7, 8, 0.55);
  backdrop-filter: blur(10px);
  place-items: center;
  padding: 24px;
}

#guard-notice.visible {
  display: grid;
}

.guard-dialog {
  max-width: 380px;
  padding: 28px;
  background: var(--bg-elevated);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-lg);
  text-align: center;
  border: 1px solid var(--separator);
}

.guard-dialog p {
  margin: 0 0 20px;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.guard-dialog button {
  font: inherit;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: 999px;
  border: none;
  background: #0a0b0e;
  color: #fff;
  cursor: pointer;
}

.guard-dialog button:hover {
  opacity: 0.92;
}
