/* RiderLog: site-wide styles.
   Dark asphalt theme with signal-amber accents. */

:root {
  --bg: #F1EDE4;
  --bg-raised: #E8E2D6;
  --bg-card: #FAF7F0;
  --line: #DDD6C8;
  --text: #1D1A15;
  --muted: #6B6457;
  --accent: #1E5BD8;
  --accent-2: #1848AE;
  --accent-ink: #FFFFFF;
  --star: #E0A23A;
  --danger: #B8431A;
  --radius: 8px;
  --text-soft: #3F3A31;
  --maxw: 1120px;
  --font-display: "Saira", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; letter-spacing: -0.012em; line-height: 1.14; }
article.guide p { text-wrap: pretty; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
  border-radius: 4px;
}

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

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(241, 237, 228, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }

.site-nav { margin-left: auto; display: flex; align-items: center; gap: 22px; }
.site-nav a { color: var(--muted); font-family: var(--font-mono); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; }
.site-nav a:hover { color: var(--text); text-decoration: none; }
.site-nav a.btn { font-family: var(--font-display); font-size: 0.9rem; letter-spacing: 0; text-transform: none; color: var(--text); }
@media (max-width: 720px) { .site-nav a:not(.btn) { display: none; } }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }

.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-2); }

.btn-small { padding: 8px 18px; font-size: 0.9rem; }

.badge-link { display: inline-block; }
.badge-link img { height: 54px; width: auto; }

.free-note { font-family: var(--font-mono); font-size: 0.78rem; line-height: 1.7; color: var(--muted); margin-top: 12px; max-width: 60ch; }

/* ---------- Hero ---------- */

.hero { padding: 72px 0 40px; overflow: hidden; }
.hero .wrap {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
}
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-visual { order: 2; margin: 0 auto; }
}

.rating-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 22px;
}
.rating-pill .stars { color: var(--star); letter-spacing: 2px; }

.hero h1 {
  font-size: clamp(2rem, 4.2vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}
.hero h1 .accent { color: var(--accent); }

.hero .lead {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 46ch;
  margin-bottom: 28px;
}

.hero-ctas { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; }

.hero-proof { margin-top: 34px; display: flex; flex-wrap: wrap; gap: 22px; }
.proof-item { font-size: 0.9rem; color: var(--muted); }
.proof-item strong { display: block; color: var(--text); font-size: 1.25rem; }

.hero-visual { position: relative; width: min(300px, 78vw); }
.phone { border-radius: 14px; overflow: hidden; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.16); }
.phone img { width: 100%; }

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

section { padding: 72px 0; }
section.tint { background: var(--bg-raised); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

h2.section-title {
  font-size: clamp(1.6rem, 3.4vw, 2.3rem);
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}

.section-intro { color: var(--muted); max-width: 62ch; margin-bottom: 40px; }

/* ---------- Screenshot gallery ---------- */

.gallery {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 220px;
  gap: 20px;
  overflow-x: auto;
  padding: 10px 4px 24px;
  scroll-snap-type: x mandatory;
  scrollbar-color: var(--line) transparent;
}
.gallery figure { scroll-snap-align: start; }
.gallery img {
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.12);
}
.gallery figcaption {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 10px;
  text-align: center;
}

/* ---------- Bangkok map (poster, then the live map) ---------- */

.map-intro { margin-bottom: 20px; }

.map-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }

.map-chip {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.map-chip:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.map-chip-primary {
  background: linear-gradient(135deg, rgba(255, 179, 64, 0.16), rgba(255, 107, 26, 0.16));
  border-color: rgba(255, 179, 64, 0.4);
  color: var(--accent);
}
.map-chip-primary:hover { border-color: var(--accent); }

.mapshell {
  position: relative;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #0a0806;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
}
@media (max-width: 720px) { .mapshell { aspect-ratio: 4 / 3; } }

/* Scoped past .maplibregl-map, which MapLibre puts on this same element and
   whose own stylesheet is injected after this one. */
.mapshell .map-live { position: absolute; inset: 0; }

.map-poster {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transition: opacity 0.4s ease;
  z-index: 2;
}
.map-poster img { width: 100%; height: 100%; object-fit: cover; }
.map-poster::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(6, 5, 4, 0.72), rgba(6, 5, 4, 0) 55%);
}

.map-poster-cue {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  padding: 10px 20px;
  border-radius: 999px;
  background: rgba(12, 10, 8, 0.82);
  border: 1px solid rgba(255, 179, 64, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.map-poster-cue::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(255, 179, 64, 0.22);
}
.map-poster:hover .map-poster-cue { border-color: var(--accent); transform: translateX(-50%) translateY(-2px); }

.mapshell.is-loading .map-poster { cursor: progress; }
.mapshell.is-live .map-poster { opacity: 0; pointer-events: none; }
.mapshell.is-failed .map-poster-cue { border-color: var(--line); }

/* MapLibre ships light chrome; put it back on the asphalt. Same treatment the
   /bangkok/ pages give it, minus the light-scheme half this page never needs. */
.mapshell .maplibregl-map { font-family: inherit; }
.mapshell .maplibregl-ctrl-attrib,
.mapshell .maplibregl-ctrl-attrib.maplibregl-compact {
  background: rgba(10, 8, 6, 0.62);
  color: var(--muted);
  font-size: 0.7rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.mapshell .maplibregl-ctrl-attrib a { color: var(--muted); }
.mapshell .maplibregl-ctrl-attrib-button { background-color: rgba(10, 8, 6, 0.62); }
.mapshell .maplibregl-ctrl-group {
  background: rgba(10, 8, 6, 0.62);
  border: 1px solid rgba(255, 179, 64, 0.42);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.mapshell .maplibregl-ctrl-group button { background: transparent; }
.mapshell .maplibregl-ctrl-group button + button { border-top-color: rgba(255, 179, 64, 0.42); }
.mapshell .maplibregl-ctrl-group button:hover { background: rgba(255, 179, 64, 0.16); }
.mapshell .maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(1) brightness(1.25); }
.mapshell .maplibregl-cooperative-gesture-screen { border-radius: var(--radius); font-family: inherit; }
.mapshell .maplibregl-canvas { outline: none; }

/* ---------- How it works ---------- */

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr; } }

.step {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 1rem;
  margin-bottom: 16px;
}
.step h3 { font-size: 1.15rem; margin-bottom: 8px; }
.step p { color: var(--muted); font-size: 0.95rem; }

.feature-list {
  margin-top: 44px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px 28px;
  list-style: none;
}
@media (max-width: 820px) { .feature-list { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .feature-list { grid-template-columns: 1fr; } }
.feature-list li { color: var(--muted); font-size: 0.95rem; padding-left: 28px; position: relative; }
.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(30, 91, 216, 0.18);
  border: 1.5px solid var(--accent);
}

/* ---------- Testimonials ---------- */

.quotes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 820px) { .quotes { grid-template-columns: 1fr; } }
.quote {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.quote .stars { color: var(--star); letter-spacing: 2px; font-size: 0.95rem; }
.quote blockquote { font-size: 0.98rem; color: var(--text); }
.quote cite { color: var(--muted); font-size: 0.85rem; font-style: normal; }

/* ---------- Guide cards ---------- */

.guide-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
@media (max-width: 720px) { .guide-grid { grid-template-columns: 1fr; } }

.guide-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
  color: var(--text);
  display: block;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.guide-card:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.guide-card .tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 10px;
}
.guide-card h3 { font-size: 1.12rem; margin-bottom: 8px; }
.guide-card p { color: var(--muted); font-size: 0.92rem; }
.guide-card .more { display: inline-block; margin-top: 14px; font-weight: 600; color: var(--accent); font-size: 0.9rem; }

/* ---------- FAQ ---------- */

.faq-list { display: grid; gap: 14px; max-width: 820px; }

.faq-list details {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 22px;
}
.faq-list details[open] { border-color: var(--accent); }

.faq-list summary {
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  font-size: 1.02rem;
  padding: 18px 34px 18px 0;
  position: relative;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+";
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--accent);
}
.faq-list details[open] summary::after { content: "\2212"; }

.faq-list .answer { padding: 0 0 20px; color: var(--muted); font-size: 0.96rem; }
.faq-list .answer a { font-weight: 600; }

/* ---------- CTA band ---------- */

.cta-band { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 44px 40px; text-align: left; }
.cta-band h2 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); margin-bottom: 12px; }
.cta-band p { color: var(--muted); max-width: 52ch; margin: 0 0 26px; }
.cta-band .hero-ctas { justify-content: flex-start; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 48px 0 40px;
  font-size: 0.9rem;
  color: var(--muted);
}
.footer-cols {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}
@media (max-width: 720px) { .footer-cols { grid-template-columns: 1fr; } }
.site-footer h3 { font-family: var(--font-mono); font-size: 0.7rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.14em; color: var(--text); margin-bottom: 14px; }
.site-footer ul { list-style: none; display: grid; gap: 8px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }
.footer-note { border-top: 1px solid var(--line); padding-top: 24px; font-size: 0.8rem; }

/* ---------- Guide article pages ---------- */

.article-header { padding: 56px 0 8px; }
.breadcrumbs { font-size: 0.85rem; color: var(--muted); margin-bottom: 18px; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--accent); }

article.guide { max-width: 760px; margin: 0 auto; padding: 0 20px 72px; }
article.guide h1 { font-size: clamp(1.9rem, 4.4vw, 2.7rem); line-height: 1.15; letter-spacing: -0.02em; margin-bottom: 14px; }
article.guide .meta { color: var(--muted); font-size: 0.88rem; margin-bottom: 34px; }
article.guide h2 { font-size: 1.5rem; margin: 44px 0 14px; letter-spacing: -0.01em; }
article.guide h3 { font-size: 1.15rem; margin: 30px 0 10px; }
article.guide p { margin-bottom: 16px; color: var(--text-soft); }
article.guide ul, article.guide ol { margin: 0 0 18px 24px; color: var(--text-soft); }
article.guide li { margin-bottom: 8px; }
article.guide strong { color: var(--text); }

article.guide table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0 26px;
  font-size: 0.92rem;
}
article.guide th, article.guide td {
  border: 1px solid var(--line);
  padding: 10px 14px;
  text-align: left;
}
article.guide th { background: var(--bg-card); color: var(--text); }
article.guide td { color: var(--text-soft); }

.app-callout {
  background: var(--bg-card);
  border: 1px solid rgba(30, 91, 216, 0.45);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin: 28px 0;
}
.app-callout .callout-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 8px;
}
.app-callout p:last-child { margin-bottom: 0; }

.safety-callout {
  background: rgba(255, 157, 122, 0.08);
  border: 1px solid rgba(255, 157, 122, 0.45);
  border-radius: 12px;
  padding: 22px 24px;
  margin: 28px 0;
}
.safety-callout .callout-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--danger);
  margin-bottom: 8px;
}
.safety-callout p { color: #f3d9cd; }
.safety-callout p:last-child { margin-bottom: 0; }

.article-cta { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 34px 30px; text-align: left; margin: 44px 0; }
.article-cta h2 { margin-top: 0 !important; }
.article-cta p { color: var(--muted); }
.article-cta .hero-ctas { justify-content: flex-start; margin-top: 18px; }

.related { border-top: 1px solid var(--line); margin-top: 48px; padding-top: 32px; }
.related h2 { font-size: 1.2rem; margin: 0 0 18px; }
.related ul { list-style: none; margin: 0; display: grid; gap: 10px; }
.related a { font-weight: 600; }

.guide-screenshot {
  width: min(280px, 80%);
  margin: 28px auto;
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.12);
}

/* Maker's mark: shared across every SleepyBytes site */
.mark { border-top: 1px solid var(--line); }
.mark-inner { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: center; padding-top: 34px; padding-bottom: 34px; }
.mark-stamp { width: 52px; height: 52px; border-radius: 50%; background: var(--text); color: var(--bg); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 800; font-size: 0.95rem; }
.mark .label { display: block; margin-bottom: 6px; }
.mark-line { font-size: 1rem; color: var(--text); margin-bottom: 6px; }
.mark-line strong { font-family: var(--font-display); font-weight: 700; }
.mark-sib { font-family: var(--font-mono); font-size: 0.76rem; color: var(--muted); }
.mark-sib a { color: var(--muted); }
.mark-sib a:hover { color: var(--accent); text-decoration: none; }
.label { font-family: var(--font-mono); font-size: 0.7rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.btn-ghost { background: transparent; color: var(--text); border: 1.5px solid var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.site-nav a.btn { font-family: var(--font-display); font-size: 0.9rem; letter-spacing: 0; text-transform: none; color: var(--text); }
.fact-line { font-family: var(--font-mono); font-size: 0.78rem; line-height: 1.7; color: var(--muted); margin-top: 12px; max-width: 60ch; }

