/*
 * TripBell — the one-page site.
 *
 * The tokens mirror docs/DESIGN_SYSTEM.md; change a value there first, then
 * here. The two phone screens mirror docs/design/Main.dc.html and
 * Alarm.dc.html — minus the canvas's snooze button, because the app has none
 * and never will.
 *
 * Nothing here reaches a third party. The fonts are the app's own files,
 * served from this folder, so opening the page tells nobody but the host.
 */

@font-face {
  font-family: "Space Grotesk";
  src: url("fonts/SpaceGrotesk-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Space Grotesk";
  src: url("fonts/SpaceGrotesk-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Space Grotesk";
  src: url("fonts/SpaceGrotesk-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- tokens ---------- */

:root {
  color-scheme: light dark;

  --bg-a: #f1f0fb;
  --bg-b: #f8f7fc;
  --bg-c: #fbf9f8;
  --surface: #ffffff;
  --surface-subtle: #f1f0fb;
  --line: rgba(30, 27, 51, 0.08);
  --text: #1e1b33;
  --text-2: #6b6785;
  --brand: #6c5ce7;
  /* Buttons keep the light brand in both modes: white on #8B7CF0 is 3.4:1 and
     fails AA, white on #6C5CE7 is 4.9:1. */
  --brand-fill: #6c5ce7;
  --brand-soft: rgba(108, 92, 231, 0.1);
  --armed: #0f9b7a;
  --header-bg: rgba(248, 247, 252, 0.84);

  --shadow-card: 0 6px 16px -12px rgba(30, 27, 51, 0.26);
  --shadow-raised: 0 8px 22px -14px rgba(30, 27, 51, 0.3);
  --shadow-brand: 0 12px 26px -12px rgba(108, 92, 231, 0.62);

  --radius-card: 20px;
  --radius-tile: 12px;
  --maxw: 1120px;
  --gutter: 22px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-a: #0a0d16;
    --bg-b: #0a0d16;
    --bg-c: #0a0d16;
    --surface: #141a26;
    --surface-subtle: rgba(255, 255, 255, 0.05);
    --line: rgba(255, 255, 255, 0.06);
    --text: #f0f3f8;
    --text-2: #8fa0b8;
    --brand: #8b7cf0;
    --brand-soft: rgba(139, 124, 240, 0.12);
    --armed: #4adec0;
    --header-bg: rgba(10, 13, 22, 0.82);

    /* Dark mode uses glow, not shadow — design system §4. */
    --shadow-card: none;
    --shadow-raised: none;
    --shadow-brand: 0 12px 30px -14px rgba(139, 124, 240, 0.5);
  }
}

@media (max-width: 400px) {
  :root {
    --gutter: 16px;
  }
}

/* ---------- base ---------- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg-b);
  background-image: linear-gradient(178deg, var(--bg-a) 0%, var(--bg-b) 45%, var(--bg-c) 100%);
  color: var(--text);
  font: 400 16px/1.5 "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.12;
  font-weight: 700;
}

p {
  margin: 0;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 8px;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.icon {
  width: 22px;
  height: 22px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* The only uppercase style, and never for a sentence. */
.cap {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 16px;
  top: 12px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--surface);
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-decoration: none;
}

.brand .icon {
  width: 20px;
  height: 20px;
  color: var(--brand);
}

.nav-links {
  display: flex;
  gap: 26px;
  margin-left: auto;
  color: var(--text-2);
  font-size: 15px;
}

.nav-links a {
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--text);
}

.nav .btn {
  height: 40px;
  padding: 0 18px;
  font-size: 15px;
}

@media (max-width: 800px) {
  .nav-links {
    display: none;
  }

  .nav .btn {
    margin-left: auto;
  }
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 54px;
  padding: 0 26px;
  border-radius: 999px;
  font-size: 16px;
  text-decoration: none;
  transition: transform 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn .icon {
  width: 19px;
  height: 19px;
}

.btn-primary {
  background: var(--brand-fill);
  color: #ffffff;
  font-weight: 700;
  box-shadow: var(--shadow-brand);
}

.btn-ghost {
  border: 1px solid var(--line);
  /* The surface, not surfaceSubtle: the page itself is tinted, and a subtle
     fill on a tinted page is a button nobody can see. */
  background: var(--surface);
  color: var(--text);
  font-weight: 500;
  box-shadow: var(--shadow-card);
}

/* ---------- hero ---------- */

.hero {
  padding: 60px 0 96px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
}

.soon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 13px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
}

.soon::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}

.hero h1 {
  margin-top: 22px;
  font-size: clamp(38px, 5.6vw, 62px);
  letter-spacing: -0.035em;
}

.lede {
  margin-top: 20px;
  max-width: 31em;
  color: var(--text-2);
  font-size: clamp(17px, 1.9vw, 19px);
  line-height: 1.55;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.reassure {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 20px;
  color: var(--text-2);
  font-size: 15px;
}

.reassure .icon {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  color: var(--armed);
}

@media (max-width: 900px) {
  .hero {
    padding: 36px 0 72px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 56px;
  }
}

/* ---------- the two phones ---------- */

/* Each screen is drawn at the design canvas's own 393 x 852 and scaled by --s,
   so every size inside it is the canvas's number, not a re-derived one. */
.devices {
  --s: 0.6;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  margin: 0;
}

.device {
  flex: none;
  padding: calc(18px * var(--s));
  border-radius: calc(64px * var(--s));
  background: linear-gradient(160deg, #2c3140, #0b0e16);
  box-shadow:
    0 40px 80px -40px rgba(30, 27, 51, 0.55),
    inset 0 0 0 1px rgba(255, 255, 255, 0.07);
}

.device + .device {
  margin-top: calc(130px * var(--s));
  margin-left: calc(-70px * var(--s));
}

.viewport {
  position: relative;
  width: calc(393px * var(--s));
  height: calc(852px * var(--s));
  overflow: hidden;
  border-radius: calc(48px * var(--s));
  isolation: isolate;
  /* Safari will not clip a transformed child to a rounded parent without it. */
  -webkit-mask-image: -webkit-radial-gradient(white, black);
}

.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 393px;
  height: 852px;
  display: flex;
  flex-direction: column;
  padding: 56px 22px 30px;
  overflow: hidden;
  font-family: "Space Grotesk", -apple-system, sans-serif;
  transform: scale(var(--s));
  transform-origin: top left;
}

.screen svg {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.s-cap {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}

.s-muted {
  color: #8fa0b8;
}

.s-num {
  font-variant-numeric: tabular-nums;
}

.s-spacer {
  flex-grow: 1;
}

@media (max-width: 1080px) {
  .devices {
    --s: 0.52;
  }
}

@media (max-width: 900px) {
  .devices {
    --s: 0.5;
  }
}

@media (max-width: 560px) {
  .devices {
    --s: 0.4;
  }
}

@media (max-width: 400px) {
  .devices {
    --s: 0.36;
  }
}

@media (max-width: 340px) {
  .devices {
    --s: 0.32;
  }
}

/* Active trip, armed — Main.dc.html */

.screen-armed {
  background: #0a0d16;
  color: #f0f3f8;
}

.s-glow {
  position: absolute;
  top: 88px;
  left: -46px;
  width: 486px;
  height: 486px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(74, 222, 192, 0.11) 0%, rgba(74, 222, 192, 0) 66%);
}

.s-top {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.s-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.s-brand svg {
  width: 17px;
  height: 17px;
  stroke: #8b7cf0;
}

.s-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(74, 222, 192, 0.1);
  color: #4adec0;
}

.s-pill i {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #4adec0;
  box-shadow: 0 0 8px 2px rgba(74, 222, 192, 0.55);
}

.s-ring {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 254px;
  height: 254px;
  margin: 58px auto 0;
  border: 1px solid rgba(74, 222, 192, 0.2);
  border-radius: 999px;
  background: radial-gradient(circle at 50% 45%, rgba(74, 222, 192, 0.07) 0%, rgba(10, 13, 22, 0) 72%);
}

.s-ring::before,
.s-ring::after {
  content: "";
  position: absolute;
  border-radius: 999px;
}

.s-ring::before {
  width: 202px;
  height: 202px;
  border: 1px solid rgba(74, 222, 192, 0.11);
}

.s-ring::after {
  width: 150px;
  height: 150px;
  border: 1px solid rgba(74, 222, 192, 0.06);
}

.s-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
}

.s-big {
  font-size: 78px;
  line-height: 76px;
  font-weight: 700;
  letter-spacing: -3.5px;
}

.s-dest {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  margin-top: 30px;
}

.s-dest-name {
  font-size: 23px;
  font-weight: 500;
}

.s-stats {
  position: relative;
  display: flex;
  gap: 11px;
  margin-top: 38px;
}

.s-stat {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 7px;
  padding: 17px 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  background: #141a26;
}

.s-stat-value {
  font-size: 19px;
  font-weight: 500;
}

.s-updated {
  position: relative;
  margin-top: 18px;
  font-size: 13px;
  text-align: center;
}

.s-ghost {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 58px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: #8fa0b8;
  font-size: 16px;
  font-weight: 500;
}

/* The alarm — Alarm.dc.html, with no snooze */

.screen-alarm {
  align-items: center;
  background: radial-gradient(ellipse 125% 58% at 50% 15%, #ff6b4a 0%, #c2472f 26%, #6b2018 52%, #0a0d16 100%);
  color: #ffffff;
}

.a-rings {
  position: absolute;
  top: 108px;
  left: 0;
  width: 393px;
  height: 393px;
}

.a-rings circle {
  stroke: #ffffff;
  stroke-width: 1.5;
}

.a-bell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin-top: 132px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.a-bell svg {
  width: 34px;
  height: 34px;
  stroke: #ffffff;
}

.a-text {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  margin-top: 34px;
  text-align: center;
}

.a-lead {
  color: rgba(255, 255, 255, 0.88);
}

.a-where {
  font-size: 32px;
  line-height: 38px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.a-distance {
  color: rgba(255, 255, 255, 0.9);
  font-size: 20px;
  line-height: 26px;
  font-weight: 500;
}

.a-slider {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 68px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.a-knob {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.22);
}

.a-knob svg {
  width: 22px;
  height: 22px;
  stroke: #ff6b4a;
}

.a-slide-label {
  flex-grow: 1;
  margin-left: -58px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 16px;
  font-weight: 500;
  text-align: center;
}

/* ---------- sections ---------- */

section {
  padding: 88px 0;
}

.section-tint {
  background: var(--surface-subtle);
}

.head {
  max-width: 36em;
}

.kicker {
  color: var(--brand);
}

h2 {
  margin-top: 12px;
  font-size: clamp(28px, 3.6vw, 40px);
  letter-spacing: -0.025em;
}

.head p {
  margin-top: 14px;
  color: var(--text-2);
  font-size: 17px;
}

.tile {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-tile);
  background: var(--brand-soft);
  color: var(--brand);
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.steps,
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 44px 0 0;
  padding: 0;
  list-style: none;
}

.step,
.card {
  padding: 24px;
}

.step-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.step-number {
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.step h3,
.card h3 {
  margin-top: 18px;
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.step p,
.card p {
  margin-top: 8px;
  color: var(--text-2);
  font-size: 15.5px;
  line-height: 1.55;
}

@media (max-width: 900px) {
  .steps {
    grid-template-columns: 1fr;
  }

  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 620px) {
  section {
    padding: 64px 0;
  }

  .cards {
    grid-template-columns: 1fr;
  }
}

/* ---------- plans ---------- */

.plans {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  max-width: 880px;
  margin-top: 44px;
}

.plan {
  padding: 28px;
}

.plan-premium {
  border-color: rgba(108, 92, 231, 0.4);
  box-shadow: var(--shadow-raised);
}

.plan h3 {
  font-size: 23px;
}

.plan-for {
  margin-top: 6px;
  color: var(--text-2);
}

.checks {
  display: grid;
  gap: 12px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.checks li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.checks .icon {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  color: var(--armed);
}

.fineprint {
  margin-top: 22px;
  color: var(--text-2);
  font-size: 14.5px;
}

@media (max-width: 700px) {
  .plans {
    grid-template-columns: 1fr;
  }
}

/* ---------- questions ---------- */

.faq {
  display: grid;
  gap: 12px;
  max-width: 780px;
  margin-top: 36px;
}

.faq details {
  border-radius: 16px;
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  font-size: 17px;
  font-weight: 500;
  list-style: none;
  cursor: pointer;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary .icon {
  width: 20px;
  height: 20px;
  color: var(--text-2);
  transition: transform 0.2s ease;
}

.faq details[open] summary .icon {
  transform: rotate(180deg);
}

.faq .answer {
  padding: 0 20px 18px;
  color: var(--text-2);
  font-size: 15.5px;
  line-height: 1.6;
}

/* ---------- contact ---------- */

/* It follows an untinted section, so its own top padding would double the gap. */
#contact {
  padding-top: 0;
}

.contact {
  padding: 52px 32px;
  border-radius: 28px;
  text-align: center;
  box-shadow: var(--shadow-raised);
}

.contact h2 {
  margin-top: 0;
}

.contact p {
  max-width: 30em;
  margin: 14px auto 0;
  color: var(--text-2);
  font-size: 17px;
}

.contact .actions {
  justify-content: center;
}

@media (max-width: 620px) {
  .contact {
    padding: 40px 22px;
  }
}

/* ---------- footer ---------- */

.site-footer {
  padding: 40px 0 56px;
  border-top: 1px solid var(--line);
}

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 28px;
}

.foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-left: auto;
  color: var(--text-2);
  font-size: 15px;
}

.foot nav a {
  text-decoration: none;
}

.foot nav a:hover {
  color: var(--text);
}

.copy {
  margin-top: 20px;
  color: var(--text-2);
  font-size: 14px;
}

@media (max-width: 620px) {
  .foot nav {
    margin-left: 0;
  }
}

/* ---------- legal pages ---------- */

.legal {
  padding: 72px 0 110px;
}

.legal .wrap {
  max-width: 780px;
}

.legal h1 {
  margin-top: 12px;
  font-size: clamp(34px, 5vw, 48px);
  letter-spacing: -0.03em;
}

.legal p {
  margin-top: 18px;
  color: var(--text-2);
  font-size: 17px;
  line-height: 1.6;
}

.legal h2 {
  margin-top: 44px;
  font-size: 24px;
  letter-spacing: -0.01em;
}

.legal h3 {
  margin-top: 28px;
  font-size: 18px;
}

.legal ul {
  margin-top: 14px;
  padding-left: 22px;
  color: var(--text-2);
  font-size: 17px;
  line-height: 1.6;
}

.legal li + li {
  margin-top: 8px;
}

.legal strong {
  color: var(--text);
}

.legal a:not(.back) {
  color: var(--brand);
}

.legal .updated {
  margin-top: 10px;
  font-size: 15px;
}

.legal .summary {
  margin-top: 32px;
  padding: 26px 28px;
  border-radius: 22px;
  background: var(--brand-soft);
}

.legal .summary h2 {
  margin-top: 0;
  font-size: 20px;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 30px;
  color: var(--brand);
  font-weight: 500;
  text-decoration: none;
}

.back .icon {
  width: 18px;
  height: 18px;
}

/* ---------- motion ---------- */

/* Above the fold only, and never gating the copy below it: a page that hides
   its own words behind an animation is one broken observer from being blank. */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .hero .soon {
    animation: rise 0.5s ease both;
  }

  .hero h1 {
    animation: rise 0.5s ease 0.06s both;
  }

  .hero .lede {
    animation: rise 0.5s ease 0.12s both;
  }

  .hero .actions,
  .hero .reassure {
    animation: rise 0.5s ease 0.18s both;
  }

  .devices {
    animation: rise 0.7s ease 0.1s both;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn,
  .faq summary .icon {
    transition: none;
  }

  .btn:hover {
    transform: none;
  }
}
