/* TOYOTA VIRTUAL RUN — TRUST DRIVES US BEYOND
   Palette: Toyota red, near-black, white, Thai-flag blue as the cool accent. */

:root {
  --red: #eb0a1e;
  --red-dark: #b80718;
  --ink: #12161c;
  --ink-2: #39414d;
  --muted: #6b7482;
  --line: #e4e7ec;
  --bg: #ffffff;
  --bg-2: #f5f6f8;
  --blue: #2d2a70;
  --gold: #c08a15;
  --radius: 16px;
  --wrap: 1120px;
  --shadow: 0 2px 8px rgba(18, 22, 28, .06), 0 12px 32px rgba(18, 22, 28, .08);
  --display: 'Archivo', 'IBM Plex Sans Thai', system-ui, sans-serif;
  --body: 'IBM Plex Sans Thai', 'Archivo', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  font-family: var(--body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* height:auto is required: the <img> tags carry width/height attributes for
   layout stability, and without it max-width only shrinks the width while the
   height stays at the attribute value — the image comes out stretched. */
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

.wrap { width: min(100% - 40px, var(--wrap)); margin-inline: auto; }

.ico { width: 1.15em; height: 1.15em; vertical-align: -.18em; flex: none; }

/* ---------- nav ---------- */

.nav {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav__in { display: flex; align-items: center; gap: 24px; height: 64px; }
.nav__brand {
  font-family: var(--display); font-weight: 900; letter-spacing: .04em;
  font-size: 15px; text-decoration: none; line-height: 1.15;
}
.nav__brand span { color: var(--red); display: block; font-size: 11px; letter-spacing: .18em; }
.nav__links { display: flex; gap: 22px; margin-left: auto; list-style: none; padding: 0; }
.nav__links a {
  text-decoration: none; font-size: 14px; font-weight: 600; color: var(--ink-2);
  border-bottom: 2px solid transparent; padding-bottom: 2px;
}
.nav__links a:hover { color: var(--red); border-bottom-color: var(--red); }
.nav__cta { margin-left: 8px; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 26px; border-radius: 999px; border: 2px solid transparent;
  font-family: var(--body); font-weight: 700; font-size: 15px;
  text-decoration: none; cursor: pointer; transition: transform .12s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--red); color: #fff; }
.btn--primary:hover { background: var(--red-dark); }
.btn--ghost { border-color: rgba(255, 255, 255, .55); color: #fff; }
.btn--ghost:hover { background: rgba(255, 255, 255, .14); }
.btn--outline { border-color: var(--ink); color: var(--ink); background: #fff; }
.btn--outline:hover { border-color: var(--red); color: var(--red); }
.btn--sm { padding: 9px 18px; font-size: 14px; }
.btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }

/* ---------- hero ---------- */

.hero { position: relative; background: #0b0e13; color: #fff; overflow: hidden; }
.hero__kv { width: 100%; height: auto; display: block; }
.hero__bar {
  background: linear-gradient(90deg, var(--red) 0%, var(--red-dark) 100%);
  color: #fff;
}
.hero__bar .wrap {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px;
  padding: 16px 0;
}
.hero__badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 14px; letter-spacing: .02em;
}
.hero__cta { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }

.lede { background: var(--bg-2); border-bottom: 1px solid var(--line); }
.lede .wrap { padding: 48px 0 40px; display: grid; gap: 28px; grid-template-columns: 1.3fr 1fr; align-items: center; }
.lede h1 {
  font-family: var(--display); font-size: clamp(28px, 4.2vw, 44px); line-height: 1.15;
  font-weight: 900; margin: 0 0 14px; letter-spacing: -.01em;
}
.lede h1 em { font-style: normal; color: var(--red); }
.lede p { margin: 0 0 8px; color: var(--ink-2); font-size: 17px; }
.facts { display: grid; gap: 12px; }
.fact {
  display: flex; gap: 12px; align-items: flex-start;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
}
.fact svg { color: var(--red); margin-top: 4px; }
.fact b { display: block; font-size: 14px; }
.fact span { font-size: 14px; color: var(--muted); }

/* ---------- sections ---------- */

.sec { padding: 68px 0; }
.sec--alt { background: var(--bg-2); }
.sec--dark { background: var(--ink); color: #fff; }
.sec--dark .sec__kicker { color: #ff8a95; }
.sec--dark .sec__title { color: #fff; }
.sec--dark .sec__intro { color: #b9c0cb; }

.sec__kicker {
  font-family: var(--display); font-weight: 800; font-size: 12px;
  letter-spacing: .22em; text-transform: uppercase; color: var(--red); margin: 0 0 8px;
}
.sec__title {
  font-family: var(--display); font-weight: 900; font-size: clamp(24px, 3.2vw, 34px);
  margin: 0 0 12px; line-height: 1.2;
}
.sec__intro { margin: 0 0 32px; color: var(--ink-2); max-width: 62ch; font-size: 16px; }

/* ---------- dashboard ---------- */

.dash__grid {
  display: grid; gap: 16px; margin-bottom: 28px;
  grid-template-columns: repeat(4, 1fr);
}
.stat {
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--radius); padding: 22px 20px;
}
.stat__label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: #aab2bf; font-weight: 600; margin-bottom: 10px;
}
.stat__value {
  font-family: var(--display); font-weight: 900; font-size: clamp(30px, 4.4vw, 42px);
  line-height: 1.05; letter-spacing: -.02em;
}
.stat__value small { font-size: .42em; font-weight: 700; color: #aab2bf; margin-left: 6px; letter-spacing: 0; }
.stat__sub { font-size: 13px; color: #8d95a3; margin-top: 6px; }
.stat--hero { background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%); border-color: transparent; }
.stat--hero .stat__label, .stat--hero .stat__sub { color: rgba(255, 255, 255, .8); }
.stat--hero .stat__value small { color: rgba(255, 255, 255, .78); }

.mission {
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--radius); padding: 26px 24px;
}
.mission__head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline; margin-bottom: 18px; }
.mission__head h3 { font-family: var(--display); font-weight: 800; font-size: 19px; margin: 0; }
.mission__head span { color: #aab2bf; font-size: 14px; margin-left: auto; }
.track { position: relative; height: 12px; border-radius: 999px; background: rgba(255, 255, 255, .12); }
.track__fill {
  position: absolute; inset: 0 auto 0 0; width: 0;
  border-radius: 999px; background: linear-gradient(90deg, #ff4d5c, var(--red));
  transition: width .8s cubic-bezier(.2, .7, .3, 1);
}
.flags { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 18px; }
.flag {
  border: 1px solid rgba(255, 255, 255, .12); border-radius: 12px; padding: 12px 10px;
  text-align: center; font-size: 13px; color: #aab2bf;
}
.flag b { display: block; font-family: var(--display); font-weight: 800; color: #fff; font-size: 15px; }
.flag small { display: block; margin-top: 4px; font-size: 11.5px; }
.flag.is-on { border-color: var(--red); background: rgba(235, 10, 30, .14); color: #ffd7db; }
.flag.is-on b { color: #fff; }

.dash__foot {
  display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center;
  margin-top: 22px; font-size: 13px; color: #8d95a3;
}
.dash__foot .btn { margin-left: auto; }

/* leaderboard */
.board { margin-top: 28px; border: 1px solid rgba(255, 255, 255, .12); border-radius: var(--radius); overflow: hidden; }
.board__head {
  display: flex; align-items: center; gap: 10px; padding: 16px 20px;
  background: rgba(255, 255, 255, .05); font-family: var(--display); font-weight: 800; font-size: 16px;
}
.board__head span { margin-left: auto; font-family: var(--body); font-weight: 600; font-size: 13px; color: #8d95a3; }
.board ol { list-style: none; margin: 0; padding: 0; }
.board li {
  display: flex; align-items: center; gap: 14px; padding: 12px 20px;
  border-top: 1px solid rgba(255, 255, 255, .08); font-size: 15px;
}
.board li .pos {
  font-family: var(--display); font-weight: 800; width: 34px; flex: none;
  color: #8d95a3; font-size: 15px;
}
.board li.top5 .pos { color: var(--red); }
.board li.top5 { background: rgba(235, 10, 30, .07); }
.board li .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board li .km { font-family: var(--display); font-weight: 800; }
.board li .km small { color: #8d95a3; font-weight: 600; font-size: .7em; margin-left: 3px; }
.board__more { padding: 14px 20px; border-top: 1px solid rgba(255, 255, 255, .08); text-align: center; }
.board__more button {
  background: none; border: 0; color: #aab2bf; font-family: var(--body);
  font-weight: 600; font-size: 14px; cursor: pointer;
}
.board__more button:hover { color: #fff; }
.board__empty { padding: 28px 20px; text-align: center; color: #8d95a3; font-size: 14px; }

/* ---------- steps / cards ---------- */

.steps { display: grid; gap: 18px; grid-template-columns: repeat(4, 1fr); counter-reset: s; }
.step {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 20px; box-shadow: var(--shadow); position: relative;
}
.step::before {
  counter-increment: s; content: counter(s);
  font-family: var(--display); font-weight: 900; font-size: 13px;
  width: 28px; height: 28px; border-radius: 50%; background: var(--red); color: #fff;
  display: grid; place-items: center; margin-bottom: 12px;
}
.step h3 { margin: 0 0 6px; font-size: 16.5px; font-weight: 700; }
.step p { margin: 0; font-size: 14.5px; color: var(--ink-2); }
.step a { color: var(--red); font-weight: 600; }

.cards { display: grid; gap: 18px; grid-template-columns: repeat(3, 1fr); }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 22px; box-shadow: var(--shadow);
}
.card__tag {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--red); margin-bottom: 10px;
}
.card h3 { font-family: var(--display); font-weight: 900; font-size: 22px; margin: 0 0 8px; }
.card p { margin: 0; font-size: 14.5px; color: var(--ink-2); }
.card__foot { margin-top: 14px; font-size: 13px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 12px; }

/* ---------- timeline ---------- */

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
  content: ''; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--line);
}
.timeline li { position: relative; padding: 0 0 22px 36px; }
.timeline li::before {
  content: ''; position: absolute; left: 3px; top: 7px;
  width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--line);
}
.timeline li.is-now::before { border-color: var(--red); box-shadow: 0 0 0 4px rgba(235, 10, 30, .15); }
.timeline b { display: block; font-size: 15px; }
.timeline span { font-size: 14px; color: var(--muted); }

/* ---------- info table ---------- */

.spec { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.spec th, .spec td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 15px; vertical-align: top; }
.spec tr:last-child th, .spec tr:last-child td { border-bottom: 0; }
.spec th { width: 34%; font-weight: 700; color: var(--ink-2); background: var(--bg-2); }

/* ---------- faq ---------- */

.faq { display: grid; gap: 10px; }
.faq details {
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 4px 18px;
}
.faq summary {
  cursor: pointer; font-weight: 700; padding: 14px 0; font-size: 15.5px;
  list-style: none; display: flex; align-items: center; gap: 10px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; margin-left: auto; color: var(--red); font-size: 22px; font-weight: 700; line-height: 1; }
.faq details[open] summary::after { content: '\2013'; }
.faq p { margin: 0 0 16px; color: var(--ink-2); font-size: 15px; }

/* ---------- gallery ---------- */

.gallery { display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); }
/* grid items stretch by default — pin the square artwork to its own ratio so a
   taller neighbour can never pull it out of shape */
.gallery img {
  width: 100%; height: auto; align-self: start;
  border-radius: var(--radius); box-shadow: var(--shadow);
}

/* ---------- final cta ---------- */

.final { background: var(--red); color: #fff; text-align: center; padding: 64px 0; }
.final h2 { font-family: var(--display); font-weight: 900; font-size: clamp(26px, 3.6vw, 38px); margin: 0 0 10px; }
.final p { margin: 0 0 24px; font-size: 17px; color: rgba(255, 255, 255, .88); }
.final .btn--primary { background: #fff; color: var(--red); }
.final .btn--primary:hover { background: #f2f2f2; }

/* ---------- footer ---------- */

.foot { background: var(--ink); color: #98a0ad; padding: 36px 0; font-size: 14px; }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; }
.foot a { color: #cfd5de; }
.foot .foot__note { margin-left: auto; font-size: 13px; color: #6f7784; }

/* ---------- sticky mobile cta ---------- */

.mobile-cta { display: none; }

/* ---------- responsive ---------- */

@media (max-width: 960px) {
  .dash__grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .cards { grid-template-columns: 1fr; }
  .lede .wrap { grid-template-columns: 1fr; padding: 36px 0 32px; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .nav__links { display: none; }
}

@media (max-width: 768px) {
  .sec { padding: 48px 0; }
  .flags { grid-template-columns: repeat(2, 1fr); }
  .hero__cta { width: 100%; margin-left: 0; }
  .hero__cta .btn { flex: 1; }
  .spec th { width: 42%; }
  .gallery { grid-template-columns: 1fr; }
  .foot .foot__note { margin-left: 0; }

  /* the sticky bar at the bottom already carries both CTAs */
  .nav__cta { display: none; }
  .nav__brand { font-size: 13px; }
  .nav__brand span { font-size: 10px; letter-spacing: .14em; }

  body { padding-bottom: 76px; }
  .mobile-cta {
    display: flex; gap: 10px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 200;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
  }
  .mobile-cta .btn { flex: 1; padding: 12px 10px; font-size: 14.5px; }
  /* keep the Freshchat bubble above the bar if it is ever added */
  #fc_frame { bottom: 86px !important; z-index: 199 !important; }
}

@media (max-width: 480px) {
  .dash__grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
