/* RideMeter website — design system shared by all three pages.
 *
 * Tokens mirror the app exactly; see design/design_handoff_web/README.md.
 * Written as a stylesheet rather than the inline styles the prototype uses:
 * three pages share this chrome, and inline styles would mean editing a
 * colour in three files and finding out later that one of them was missed.
 */

:root {
  --bg: #07080A;
  --surface: rgba(255, 255, 255, 0.042);
  --surface-hi: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.06);
  --divider: rgba(255, 255, 255, 0.05);
  --accent: #22D3EE;
  --accent-ink: #062126;
  --amber: #F5A524;
  --green: #4ADE80;
  --red: #FF6B60;
  --t-1: #fff;
  --t-2: rgba(255, 255, 255, 0.55);
  --t-3: rgba(255, 255, 255, 0.45);
  --t-4: rgba(255, 255, 255, 0.32);
  --t-5: rgba(255, 255, 255, 0.26);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
}

body {
  font-family: 'Inter Tight', -apple-system, BlinkMacSystemFont, Helvetica, sans-serif;
  color: var(--t-1);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #67E8F9; }
::selection { background: rgba(34, 211, 238, 0.3); }

.num { font-family: 'Barlow Condensed', 'Inter Tight', sans-serif; font-weight: 600; }

.material-symbols-rounded {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  line-height: 1;
}

/* --- Layout ------------------------------------------------------------ */

/* Side padding only — never the shorthand. Every section carries this class,
 * and `padding: 0 32px` would zero out the vertical rhythm `section` sets,
 * silently: a class selector outranks a bare element one. That is exactly
 * what flattened the page's spacing before. */
.wrap { max-width: 1180px; margin: 0 auto; padding-left: 32px; padding-right: 32px; }
.wrap-support { max-width: 1100px; margin: 0 auto; padding-left: 32px; padding-right: 32px; }
.wrap-body { max-width: 860px; }

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

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(7, 8, 10, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  height: 68px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand img { width: 32px; height: 32px; display: block; }
.brand span { color: var(--t-1); font-size: 18px; font-weight: 700; letter-spacing: -0.3px; }

.nav-links { display: flex; align-items: center; gap: 26px; flex: 1; }
.nav-links a {
  color: var(--t-2);
  font-size: 14.5px;
  font-weight: 500;
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--t-1); }
/* The page you are on, so a reader arriving from a search result can see
 * where they landed. */
.nav-links a.current { color: var(--t-1); font-weight: 600; }

.lang-toggle {
  display: flex;
  flex: none;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 17px;
  overflow: hidden;
  background: var(--surface);
}
.lang-toggle button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--t-4);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 7px 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.lang-toggle button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

.nav-cta { display: flex; align-items: center; gap: 8px; flex: none; }

/* --- Buttons ----------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 13px;
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 15px;
  transition: transform 0.15s, background 0.15s;
}
.btn:hover { transform: translateY(-2px); }
.btn-ghost { background: var(--surface); border: 1px solid var(--border); color: var(--t-1); }
.btn-ghost:hover { background: var(--surface-hi); color: var(--t-1); }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { color: var(--accent-ink); }

/* Store badges — 60 tall, two lines of type like the real thing. */
.store {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  height: 60px;
  padding: 0 22px;
  border-radius: 15px;
  transition: transform 0.15s;
}
.store:hover { transform: translateY(-2px); }
.store .material-symbols-rounded { font-size: 26px; }
/* The real marks, so the App Store button is not wearing a share icon.
 * currentColor lets each badge variant tint its own. */
.store-mark { width: 24px; height: 24px; display: block; flex: none; fill: currentColor; }
.store-lines { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.store-lines small { font-size: 10.5px; font-weight: 600; letter-spacing: 0.6px; opacity: 0.62; }
.store-lines strong { font-size: 17px; font-weight: 700; letter-spacing: -0.3px; }
.store-ios { background: #fff; color: #0A0B0D; }
.store-ios:hover { color: #0A0B0D; }
.store-android {
  background: linear-gradient(135deg, var(--accent), #0EA5C4);
  color: var(--accent-ink);
}
.store-android:hover { color: var(--accent-ink); }

/* --- Hero -------------------------------------------------------------- */
/*
 * Every number from here down is measured off design_handoff_web/Website.dc.html
 * rather than eyeballed. An earlier pass guessed at them and came out 790px —
 * 21% — shorter than the comp, which is why the page felt cramped.
 *
 * The comp's rhythm is one-sided: each block carries 100px of padding on top
 * and none at the bottom. Doubling it up (76 top AND bottom) is what quietly
 * changes the whole page's proportions.
 */

.hero { position: relative; overflow: hidden; padding: 96px 0 0; }
.hero-glow {
  position: absolute;
  left: 50%;
  top: -340px;
  transform: translateX(-50%);
  width: 1500px;
  height: 900px;
  background: radial-gradient(45% 46% at 50% 50%, rgba(34, 211, 238, 0.24) 0%, rgba(34, 211, 238, 0.05) 52%, transparent 74%);
  pointer-events: none;
}
/* The warm counter-glow low on the right, which keeps the hero from reading
 * as one flat cyan wash. */
.hero::after {
  content: "";
  position: absolute;
  right: -260px;
  top: 420px;
  width: 900px;
  height: 700px;
  background: radial-gradient(50% 50% at 50% 50%, rgba(245, 165, 36, 0.13) 0%, transparent 70%);
  pointer-events: none;
}
.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 40px;
  align-items: center;
}
/* The left column is a flex stack with one rhythm, so the pieces inside carry
 * no margins of their own. */
.hero-grid > div:first-child {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 26px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 34px;
  padding: 0 15px;
  border-radius: 17px;
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.24);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.6px;
}
.badge .material-symbols-rounded { font-size: 17px; color: var(--accent); }

h1 {
  font-size: 66px;
  font-weight: 800;
  letter-spacing: -2.6px;
  line-height: 1.02;
  margin: 0;
}
h1 .accent { color: var(--accent); }

.hero-sub {
  color: var(--t-2);
  font-size: 18.5px;
  line-height: 1.55;
  margin: 0;
  max-width: 460px;
}

/* A grid, not a flex row: the two badges carry different labels — "Download
 * on the App Store" against "Get it on Google Play" — so sizing them by
 * content leaves one visibly wider than the other, which is glaring once they
 * stack on a phone. Equal columns make them one pair. */
.hero-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding-top: 4px;
  width: 100%;
  max-width: 404px;
}

.checks { display: flex; gap: 18px; margin: 0; padding-top: 2px; flex-wrap: wrap; }
.check { display: flex; align-items: center; gap: 7px; color: var(--t-3); font-size: 13.5px; font-weight: 500; }
.check .material-symbols-rounded { font-size: 17px; color: var(--green); }

/* Two phones, tilted against each other. They are positioned rather than
 * flowed: the column's 660px height is what gives the hero its height, and
 * both phones bleed past it. */
.phones { position: relative; height: 660px; }
.phone {
  position: absolute;
  display: block;
  object-fit: cover;
  background: #0B0C0E;
}
.phone-a {
  right: 96px;
  top: 34px;
  width: 298px;
  height: 646px;
  border-radius: 44px;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.7), 0 0 0 9px #16191D, 0 0 0 10px #2A2F35, 0 0 100px rgba(34, 211, 238, 0.16);
  transform: rotate(-4deg);
}
.phone-b {
  right: -6px;
  top: 150px;
  width: 250px;
  height: 542px;
  border-radius: 38px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7), 0 0 0 8px #16191D, 0 0 0 9px #2A2F35;
  transform: rotate(5deg);
}

/* --- Sections ---------------------------------------------------------- */

section { padding: 100px 0 0; }
section:first-of-type { padding-top: 64px; }

.eyebrow {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 1.6px;
  color: var(--accent);
  text-transform: uppercase;
}

h2 {
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -1.4px;
  line-height: 1.08;
  margin: 14px 0 0;
}

.section-head { max-width: 620px; margin-bottom: 0; }

/* The generic card — what the feature grids use. */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 30px;
  transition: transform 0.15s, background 0.15s;
}
.card:hover { transform: translateY(-2px); }

.tile {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(34, 211, 238, 0.1);
  color: var(--accent);
}
.tile .material-symbols-rounded { font-size: 23px; }

.card h3 { font-size: 21px; font-weight: 700; letter-spacing: -0.4px; margin: 12px 0 0; }
.card p { color: var(--t-3); font-size: 14.5px; line-height: 1.5; margin: 12px 0 0; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }

/* The three pillars sit above the fold's fold — smaller than a feature card
 * so they read as a summary rather than as content. */
.grid-3 .card { border-radius: 22px; padding: 24px 26px; }
.grid-3 .tile { width: 40px; height: 40px; border-radius: 13px; }
.grid-3 .tile .material-symbols-rounded { font-size: 21px; }
.grid-3 .card h3 { font-size: 17px; font-weight: 600; letter-spacing: -0.2px; margin-top: 10px; }
.grid-3 .card p { font-size: 14px; margin-top: 10px; }

/* Bento: one tall card beside two stacked ones. */
.bento { display: grid; grid-template-columns: 1.25fr 1fr; gap: 16px; padding-top: 36px; }
.bento-side { display: grid; grid-template-rows: 1fr 1fr; gap: 16px; }

.bento > .card:first-child {
  background: linear-gradient(160deg, rgba(34, 211, 238, 0.1), rgba(255, 255, 255, 0.03));
  border-color: rgba(34, 211, 238, 0.16);
  padding: 34px 34px 0;
  overflow: hidden;
}
.bento > .card:first-child:hover { transform: none; }
.bento > .card:first-child h3 { font-size: 26px; letter-spacing: -0.7px; margin: 0; }
.bento > .card:first-child p { font-size: 15px; line-height: 1.55; max-width: 420px; margin-top: 11px; }

/* A phone that rises out of the bottom edge of its card. The frame is a fixed
 * window; the screenshot inside it is taller and simply gets cut. */
.bleed {
  width: 260px;
  height: 420px;
  margin: 22px auto 0;
  border-radius: 34px 34px 0 0;
  background: #0B0C0E;
  box-shadow: 0 -10px 60px rgba(0, 0, 0, 0.6), 0 0 0 8px #16191D;
  overflow: hidden;
}
.bleed img { width: 260px; height: 564px; display: block; border: 0; border-radius: 0; }

/* --- Tinted panels ----------------------------------------------------- */

.panel {
  border-radius: 32px;
  padding: 48px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.panel-accent {
  background:
    linear-gradient(150deg, rgba(34, 211, 238, 0.09), rgba(7, 8, 10, 0) 60%),
    rgba(255, 255, 255, 0.035);
}
.panel-grid { display: grid; grid-template-columns: 1fr 0.8fr; gap: 40px; align-items: center; }
.panel-grid > div:first-child { display: flex; flex-direction: column; gap: 20px; }
.panel h2 { font-size: 38px; letter-spacing: -1.2px; line-height: 1.1; margin: 0; }

/* No dividers between the device rows — the icons carry the separation. */
.device-rows { display: flex; flex-direction: column; gap: 12px; padding-top: 4px; }
.device-row { display: flex; gap: 13px; align-items: flex-start; }
.device-row .material-symbols-rounded {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: rgba(34, 211, 238, 0.1);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.device-row p { margin: 0; color: var(--t-2); font-size: 15px; line-height: 1.5; padding-top: 6px; }
.device-row strong { color: var(--t-1); font-weight: 600; }

/* The tracker phone bleeds below the panel's own padding. */
.device-phone {
  justify-self: center;
  width: 270px;
  height: 490px;
  margin-bottom: -48px;
  border-radius: 38px 38px 0 0;
  background: #0B0C0E;
  box-shadow: 0 -10px 60px rgba(0, 0, 0, 0.6), 0 0 0 9px #16191D, 0 0 90px rgba(34, 211, 238, 0.14);
  overflow: hidden;
}
.device-phone img { width: 270px; height: 586px; display: block; }

/* The two safety cards are the largest in the page — they carry the feature
 * the app is really about. */
#safety .card { padding: 36px; }
#safety .tile { width: 46px; height: 46px; border-radius: 15px; }
#safety .tile .material-symbols-rounded { font-size: 24px; }
#safety .card h3 { font-size: 25px; letter-spacing: -0.6px; margin-top: 14px; }
#safety .card p { font-size: 15px; line-height: 1.55; margin-top: 14px; }

.tint-red { background: linear-gradient(160deg, rgba(255, 107, 96, 0.1), rgba(255, 255, 255, 0.03)); border-color: rgba(255, 107, 96, 0.18); }
.tint-red .tile { background: rgba(255, 107, 96, 0.14); color: var(--red); }
.tint-green { background: linear-gradient(160deg, rgba(74, 222, 128, 0.09), rgba(255, 255, 255, 0.03)); border-color: rgba(74, 222, 128, 0.16); }
.tint-green .tile { background: rgba(74, 222, 128, 0.13); color: var(--green); }
.tint-amber { background: linear-gradient(150deg, rgba(245, 165, 36, 0.11), rgba(255, 255, 255, 0.03)); border-color: rgba(245, 165, 36, 0.18); }
.tint-amber .tile { background: rgba(245, 165, 36, 0.14); color: var(--amber); }

/* --- CTA + footer ------------------------------------------------------ */

.cta {
  position: relative;
  overflow: hidden;
  text-align: center;
  border-radius: 34px;
  padding: 60px 48px;
  background: linear-gradient(150deg, #0B1A20, #0A2B33 52%, #0B1216);
  border: 1px solid rgba(34, 211, 238, 0.18);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
}
.cta::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -160px;
  transform: translateX(-50%);
  width: 800px;
  height: 420px;
  background: radial-gradient(50% 50% at 50% 50%, rgba(34, 211, 238, 0.28) 0%, transparent 70%);
  pointer-events: none;
}
.cta > * { position: relative; }
.cta img { width: 60px; height: 60px; }
.cta h2 { font-size: 44px; font-weight: 800; letter-spacing: -1.6px; margin: 0; max-width: 460px; }
.cta-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 auto;
  width: 100%;
  max-width: 404px;
}
/* In the CTA the Android badge is the primary action, so it takes the accent
 * fill; in the hero it is the quieter of the two. */
.cta .store-android { box-shadow: 0 12px 30px rgba(34, 211, 238, 0.24); }
.hero .store-android { background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.13); color: var(--t-1); }
.hero .store-android:hover { color: var(--t-1); }

footer { padding: 72px 0 48px; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding-top: 32px;
}
.footer-col h4 {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.3px;
  color: var(--t-4);
  text-transform: uppercase;
  margin: 0 0 14px;
}
.footer-col a { display: block; color: var(--t-2); font-size: 13.5px; margin-bottom: 9px; }
.footer-col a:hover { color: var(--t-1); }
.copyright { color: var(--t-4); font-size: 13px; margin: 10px 0 0; }

/* --- Chrome theo trạng thái cuộn ---------------------------------------- */
/* Không có class ẩn nào ở đây nữa.
 *
 * Ba class `.reveal / .armed / .in` của bản viết tay đã bỏ cùng `reveal.js`.
 * `motion.js` đặt trạng thái đầu bằng GSAP vào đúng lúc phần tử lọt vào tầm
 * nhìn, nên CSS không bao giờ cần giấu thứ gì — và đó là điều đáng giữ: một
 * quy tắc `opacity: 0` nằm trong stylesheet là thứ vẫn ẩn nội dung kể cả khi
 * JavaScript không chạy.
 *
 * `prefers-reduced-motion` cũng chuyển sang `motion.js`, ở đó nó thoát ngay
 * từ dòng đầu thay vì phải ghi đè lại bằng `!important`. */

.nav.is-scrolled {
  background: rgba(7, 8, 10, 0.94);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

/* --- Responsive -------------------------------------------------------- */

@media (max-width: 980px) {
  .wrap, .wrap-support { padding-left: 20px; padding-right: 20px; }
  .nav-links { display: none; }
  .hero { padding: 48px 0 0; }
  .hero-grid, .bento, .grid-3, .grid-2, .panel-grid { grid-template-columns: 1fr; }
  .hero-grid { gap: 8px; }
  .hero-actions, .cta-actions { grid-template-columns: 1fr; max-width: 320px; }
  /* Nothing but the brand, the language switch and the two buttons fit here,
   * and they must not be squeezed into each other. */
  .nav-inner { gap: 12px; }
  .nav-cta { flex: none; }
  .bento-side { grid-template-rows: auto auto; }
  h1 { font-size: 42px; letter-spacing: -1.6px; }
  h2, .panel h2 { font-size: 30px; letter-spacing: -1px; }
  .cta h2 { font-size: 32px; }
  section { padding: 64px 0 0; }
  section:first-of-type { padding-top: 44px; }
  .panel { padding: 28px; }
  .cta { padding: 42px 26px; border-radius: 28px; }
  /* The tilted pair does not survive a narrow column: one phone, upright.
   * height:auto matters — a fixed one shorter than the phone would clip it
   * against the hero's overflow:hidden. */
  .phones { height: auto; padding-top: 10px; }
  .phone-a { position: relative; right: auto; top: auto; width: 236px; height: 512px; margin: 0 auto; display: block; transform: none; }
  .phone-b { display: none; }
  .device-phone { margin-bottom: -28px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  h1 { font-size: 34px; }
  .bento > .card:first-child { padding: 26px 26px 0; }
  #safety .card, .card { padding: 24px; }
  .bleed { width: 220px; height: 340px; }
  .bleed img { width: 220px; height: 477px; }
  .device-phone { width: 230px; height: 400px; }
  .device-phone img { width: 230px; height: 499px; }
  .footer-grid { grid-template-columns: 1fr; }
}
