/* ============================================================
   C Rider — static site stylesheet
   Tokens mirror mobile/src/lib/theme.ts so app + site read as
   one product. Fully self-contained: no external fonts/assets.
   Light + dark via prefers-color-scheme.
   ============================================================ */

:root {
  /* light palette (mobile/src/lib/theme.ts lightColors) */
  --primary: #12b76a;
  --primary-press: #039855;
  --tint: #e7f8ef;
  --ink: #101828;
  --body: #344054;
  --muted: #667085;
  --placeholder: #98a2b3;
  --bg: #ffffff;
  --surface: #f2f4f7;
  --border: #e4e7ec;
  --border2: #d0d5dd;
  --danger: #f04438;
  --warn: #b54708;
  --warn-tint: #fef0c7;
  --on-primary: #ffffff;

  /* derived */
  --hero-grad-a: #eafcf3;
  --hero-grad-b: #ffffff;
  --card-shadow: 0 2px 8px rgba(16, 24, 40, 0.08);
  --card-shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.12);
  --header-bg: rgba(255, 255, 255, 0.85);

  /* shape (theme.ts radii) */
  --r-card: 16px;
  --r-button: 14px;
  --r-chip: 20px;
  --r-sm: 10px;

  /* type — Sarabun if installed, otherwise Thai-capable system stack.
     No CDN: the site must load fully offline / behind strict CSP. */
  --font: "Sarabun", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Noto Sans Thai", "Noto Sans Thai UI", "Thonburi", "Leelawadee UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* dark palette (mobile/src/lib/theme.ts darkColors) */
    --tint: #0d2e1c;
    --ink: #f2f4f7;
    --body: #d0d5dd;
    --muted: #98a2b3;
    --placeholder: #667085;
    --bg: #0c0d0f;
    --surface: #1a1d23;
    --border: #2c313d;
    --border2: #3a3f4d;
    --warn: #dc6803;
    --warn-tint: #2d1e07;

    --hero-grad-a: #10231a;
    --hero-grad-b: #0c0d0f;
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    --card-shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.55);
    --header-bg: rgba(12, 13, 15, 0.85);
  }
}

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

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  color: var(--body);
  background: var(--bg);
}

img,
svg {
  max-width: 100%;
  display: block;
}

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

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3,
h4 {
  color: var(--ink);
  line-height: 1.35;
  margin: 0 0 0.5em;
  font-weight: 700;
  text-wrap: balance;
}

p {
  margin: 0 0 1em;
}

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

.narrow {
  max-width: 760px;
}

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

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

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding-top: 8px;
  padding-bottom: 8px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 19px;
  color: var(--ink);
  letter-spacing: -0.01em;
}

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

.brand .logo {
  width: 34px;
  height: 34px;
  flex: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.site-nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  padding: 7px 12px;
  border-radius: var(--r-chip);
  transition: color 0.15s ease, background 0.15s ease;
}

.site-nav a:hover {
  color: var(--ink);
  background: var(--surface);
  text-decoration: none;
}

.site-nav a[aria-current="page"] {
  color: var(--primary-press);
  background: var(--tint);
  font-weight: 600;
}

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

.hero {
  background: linear-gradient(180deg, var(--hero-grad-a) 0%, var(--hero-grad-b) 90%);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.hero .container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  padding-top: 56px;
  padding-bottom: 56px;
  align-items: center;
}

@media (min-width: 880px) {
  .hero .container {
    grid-template-columns: 1.1fr 0.9fr;
    padding-top: 88px;
    padding-bottom: 88px;
  }
}

.hero-copy {
  animation: rise 0.7s ease both;
}

.hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--primary-press);
  background: var(--tint);
  border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent);
  padding: 6px 14px;
  border-radius: var(--r-chip);
  margin-bottom: 20px;
}

.hero .eyebrow .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  flex: none;
}

.hero h1 {
  font-size: clamp(2.1rem, 4.5vw + 0.8rem, 3.4rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 18px;
}

.hero h1 .accent {
  color: var(--primary);
}

.hero .lede {
  font-size: clamp(1.02rem, 0.6vw + 0.9rem, 1.18rem);
  color: var(--body);
  max-width: 34em;
  margin-bottom: 28px;
}

.hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 700;
  padding: 13px 26px;
  border-radius: var(--r-button);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

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

.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 4px 14px rgba(18, 183, 106, 0.35);
}

.btn-primary:hover {
  background: var(--primary-press);
  box-shadow: 0 6px 20px rgba(18, 183, 106, 0.45);
}

.btn-ghost {
  background: var(--bg);
  color: var(--ink);
  border-color: var(--border2);
}

.btn-ghost:hover {
  background: var(--surface);
}

/* store badges (coming soon) */
.store-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  border: 1px dashed var(--border2);
  border-radius: var(--r-button);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
  background: color-mix(in srgb, var(--surface) 55%, transparent);
}

.store-badge strong {
  display: block;
  font-size: 14.5px;
  color: var(--ink);
}

.store-badge svg {
  width: 22px;
  height: 22px;
  flex: none;
  color: var(--muted);
}

/* ---------- phone mockup ---------- */

.hero-visual {
  display: flex;
  justify-content: center;
  animation: rise 0.7s ease 0.15s both;
}

.phone {
  width: min(320px, 88vw);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 38px;
  padding: 14px;
  box-shadow: var(--card-shadow-lg);
}

.phone-screen {
  background: var(--surface);
  border-radius: 26px;
  padding: 16px 14px 18px;
  overflow: hidden;
}

.phone-notch {
  width: 86px;
  height: 5px;
  border-radius: 3px;
  background: var(--border2);
  margin: 0 auto 14px;
}

.route-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 13px 14px;
  box-shadow: var(--card-shadow);
  margin-bottom: 12px;
}

.route-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--ink);
  font-weight: 500;
}

.route-row + .route-row {
  margin-top: 4px;
}

.route-pin {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
}

.route-pin.from {
  background: var(--primary);
}

.route-pin.to {
  background: var(--danger);
  border-radius: 2px;
  transform: rotate(45deg);
}

.route-connector {
  width: 2px;
  height: 12px;
  background: var(--border2);
  margin-left: 4px;
}

.bids-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 2px 2px 8px;
}

.bid-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 10px 12px;
  margin-bottom: 8px;
}

.bid-row.picked {
  border-color: var(--primary);
  background: var(--tint);
}

.bid-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--tint);
  color: var(--primary-press);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex: none;
}

.bid-row.picked .bid-avatar {
  background: var(--primary);
  color: var(--on-primary);
}

.bid-meta {
  flex: 1;
  min-width: 0;
}

.bid-name,
.bid-sub {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bid-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}

.bid-sub {
  font-size: 11.5px;
  color: var(--muted);
}

.bid-price {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  flex: none;
}

.bid-row.picked .bid-price {
  color: var(--primary-press);
}

.bid-pick {
  font-size: 11px;
  font-weight: 700;
  color: var(--on-primary);
  background: var(--primary);
  border-radius: var(--r-chip);
  padding: 4px 10px;
  flex: none;
}

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

.section {
  padding: 72px 0;
}

.section.alt {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-head {
  max-width: 640px;
  margin: 0 auto 44px;
  text-align: center;
}

.section-head .kicker {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary-press);
  margin-bottom: 10px;
}

.section-head h2 {
  font-size: clamp(1.55rem, 2.4vw + 0.8rem, 2.15rem);
  letter-spacing: -0.015em;
}

.section-head p {
  color: var(--muted);
  margin: 10px 0 0;
}

/* card grids */
.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

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

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 26px 24px;
  box-shadow: var(--card-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--card-shadow-lg);
}

.card .icon {
  width: 48px;
  height: 48px;
  border-radius: var(--r-sm);
  background: var(--tint);
  color: var(--primary-press);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.card .icon svg {
  width: 26px;
  height: 26px;
}

.card h3 {
  font-size: 17.5px;
  margin-bottom: 6px;
}

.card p {
  font-size: 14.5px;
  color: var(--muted);
  margin: 0;
}

/* numbered steps */
.step-num {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 19px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  box-shadow: 0 4px 12px rgba(18, 183, 106, 0.35);
}

/* honesty strip */
.honesty {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
  margin-top: 8px;
}

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

.honesty-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 20px;
}

.honesty-item .tick {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--tint);
  color: var(--primary-press);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.honesty-item .tick svg {
  width: 15px;
  height: 15px;
}

.honesty-item h4 {
  font-size: 15.5px;
  margin-bottom: 2px;
}

.honesty-item p {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}

/* CTA band */
.cta-band {
  background: var(--primary);
  color: #eafcf3;
  text-align: center;
  padding: 64px 0;
}

.cta-band h2 {
  color: #ffffff;
  font-size: clamp(1.5rem, 2.5vw + 0.8rem, 2.1rem);
  margin-bottom: 10px;
}

.cta-band p {
  color: #d3f5e4;
  max-width: 38em;
  margin: 0 auto 26px;
}

.cta-band .btn-ghost {
  background: #ffffff;
  color: var(--primary-press);
  border-color: transparent;
}

.cta-band .btn-ghost:hover {
  background: #eafcf3;
}

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

.page-hero {
  background: linear-gradient(180deg, var(--hero-grad-a) 0%, var(--hero-grad-b) 100%);
  border-bottom: 1px solid var(--border);
  padding: 52px 0 40px;
}

.page-hero h1 {
  font-size: clamp(1.7rem, 3vw + 0.7rem, 2.4rem);
  letter-spacing: -0.015em;
  margin-bottom: 6px;
}

.page-hero .meta {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}

.prose {
  padding: 44px 0 72px;
}

.prose h2 {
  font-size: 1.35rem;
  margin: 2.2em 0 0.6em;
  padding-top: 1.1em;
  border-top: 1px solid var(--border);
}

.prose h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.prose h3 {
  font-size: 1.08rem;
  margin: 1.6em 0 0.4em;
}

.prose p,
.prose li {
  font-size: 15.5px;
}

.prose ul,
.prose ol {
  padding-left: 1.4em;
  margin: 0 0 1em;
}

.prose li {
  margin-bottom: 0.45em;
}

.prose li::marker {
  color: var(--primary);
  font-weight: 700;
}

.prose strong {
  color: var(--ink);
}

.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
}

/* draft notice */
.draft-note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--warn-tint);
  border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent);
  color: var(--warn);
  border-radius: var(--r-card);
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 32px;
}

.draft-note svg {
  flex: none;
  width: 19px;
  height: 19px;
  margin-top: 2px;
}

/* placeholder marker for unknown legal details */
.placeholder {
  background: var(--warn-tint);
  color: var(--warn);
  border-radius: 5px;
  padding: 0 6px;
  font-weight: 600;
  white-space: nowrap;
}

/* summary chips on legal pages */
.fact-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.fact-chip {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--primary-press);
  background: var(--tint);
  border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent);
  border-radius: var(--r-chip);
  padding: 5px 12px;
}

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

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 44px 0 36px;
  font-size: 14px;
  color: var(--muted);
}

.footer-grid {
  display: grid;
  gap: 28px;
  grid-template-columns: 1fr;
  margin-bottom: 30px;
}

@media (min-width: 700px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

.footer-brand .brand {
  margin-bottom: 10px;
}

.footer-brand p {
  max-width: 30em;
  margin: 0;
}

.footer-col h4 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-col li {
  margin-bottom: 8px;
}

.footer-col a {
  color: var(--body);
}

.footer-col a:hover {
  color: var(--primary-press);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
}

.footer-draft {
  color: var(--warn);
  font-weight: 600;
}

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

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal {
  animation: rise 0.6s ease both;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
