:root {
  --yellow: #ffd60a;
  --green: #0b7d3c;
  --ink: #1b1d1b;
  --case: #2b2b2b;
  --led: #3dff6e;
  --red: #d8232a;
  --paper: #ffffff;
  --mist: #eef1ec;
  --muted: #565d57;
  --line: #d3d9d1;
  --display: "Chakra Petch", "Anuphan", system-ui, sans-serif;
  --body: "Anuphan", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

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

body {
  margin: 0;
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
}

:lang(th) body {
  line-height: 1.8;
}

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

a {
  color: inherit;
  text-underline-offset: 0.2em;
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  border-radius: 4px;
}

h1,
h2,
h3 {
  font-family: var(--display);
  line-height: 1.1;
  margin: 0;
  text-wrap: balance;
}

:lang(th) h1,
:lang(th) h2,
:lang(th) h3 {
  line-height: 1.35;
}

h1 {
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.6rem, 3.4vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.2rem;
  font-weight: 600;
}

p {
  margin: 0;
}

.wrap {
  max-width: 68rem;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.lead {
  font-size: 1.2rem;
  max-width: 34rem;
}

.measure {
  max-width: 40rem;
}

.muted {
  color: var(--muted);
}

/* Navigation */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.2rem;
  text-decoration: none;
}

.brand img {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.55rem;
  box-shadow: 0 0 0 2px var(--ink);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-weight: 500;
  font-size: 1rem;
}

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

.nav-links a:hover {
  text-decoration: underline;
}

.nav-links .lang {
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 0.1rem 0.8rem;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--ink);
  color: #fff;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.1rem;
  text-decoration: none;
  padding: 0.85rem 1.5rem;
  border-radius: 0.6rem;
}

.btn:hover {
  background: #000;
}

.btn svg {
  width: 1.2rem;
  height: 1.2rem;
  flex: none;
}

/* Hero */

.hero {
  background: var(--yellow);
  position: relative;
  isolation: isolate;
}

.hero-grid {
  display: grid;
  gap: 2.5rem;
  padding-top: 1.5rem;
}

.hero-copy {
  display: grid;
  gap: 1.25rem;
  justify-items: start;
  align-content: start;
}

.hero-meter {
  margin-inline: -1.25rem;
  padding: 0 1.25rem 2.5rem;
  background: linear-gradient(var(--yellow) 0 9rem, var(--green) 9rem);
}

.hero-note {
  color: #fff;
  font-size: 0.95rem;
  max-width: 24rem;
  margin: 1.25rem auto 0;
}

@media (min-width: 54rem) {
  .hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 17rem;
    background: var(--green);
    z-index: -1;
  }

  .hero-grid {
    grid-template-columns: 1fr 24rem;
    gap: 3.5rem;
    padding-top: 2.5rem;
  }

  .hero-meter {
    margin: 0;
    padding: 0 0 3rem;
    background: none;
  }
}

/* Page header for inner pages */

.page-head {
  background: var(--yellow);
  border-bottom: 1.25rem solid var(--green);
}

.page-head-copy {
  display: grid;
  gap: 1rem;
  padding-block: 2rem 3rem;
}

/* Meter device */

.meter {
  max-width: 24rem;
  margin-inline: auto;
}

.meter-case {
  background: var(--case);
  color: #fff;
  border-radius: 1.25rem;
  padding: 1.1rem 1.25rem 1.4rem;
  box-shadow:
    inset 0 0 0 3px #3d3d3d,
    0 1.25rem 2rem -1rem rgba(0, 0, 0, 0.55);
  position: relative;
  z-index: 1;
}

.meter-case :focus-visible {
  outline-color: var(--yellow);
}

.meter-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.meter-plate {
  background: var(--red);
  color: #fff;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.6rem;
  border-radius: 0.3rem;
}

.taxi-type {
  border: 0;
  margin: 0;
  padding: 0.2rem;
  display: flex;
  background: #1a1a1a;
  border-radius: 0.5rem;
  font-size: 0.9rem;
}

.taxi-type label {
  position: relative;
  cursor: pointer;
}

.taxi-type input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  margin: 0;
}

.taxi-type span {
  display: block;
  padding: 0.2rem 0.7rem;
  border-radius: 0.35rem;
  color: #c9cdc9;
}

.taxi-type input:checked + span {
  background: var(--yellow);
  color: var(--ink);
  font-weight: 600;
}

.taxi-type input:focus-visible + span {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
}

.led {
  background: #0c110d;
  border-radius: 0.6rem;
  box-shadow: inset 0 0 0 2px #000, inset 0 0.4rem 0.8rem rgba(0, 0, 0, 0.6);
  padding: 1rem 1.1rem;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 0.6rem;
  color: var(--led);
  font-family: var(--display);
  font-weight: 700;
  font-size: 2.6rem;
  line-height: 1;
  min-height: 5.6rem;
}

.led-baht {
  font-size: 1.4rem;
  opacity: 0.85;
  padding-bottom: 0.15rem;
}

.led-digits {
  display: flex;
  align-items: flex-end;
  gap: 0.3rem;
  filter: drop-shadow(0 0 0.35rem rgba(61, 255, 110, 0.55));
}

.led-digits svg {
  height: 3.6rem;
  width: auto;
  transform: skewX(-5deg);
}

.led-digits polygon {
  fill: rgba(61, 255, 110, 0.07);
}

.led-digits polygon.on {
  fill: var(--led);
}

.led-dot {
  width: 0.42rem;
  height: 0.42rem;
  background: var(--led);
  margin-bottom: 0.1rem;
}

.dial {
  display: grid;
  gap: 0.2rem;
  margin-top: 1.1rem;
}

.dial-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.98rem;
  color: #d5d9d5;
}

.dial-head b {
  font-family: var(--display);
  font-size: 1.1rem;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.dial input[type="range"] {
  width: 100%;
  height: 1.75rem;
  margin: 0;
  accent-color: var(--yellow);
  cursor: pointer;
}

/* Receipt */

.receipt {
  background: var(--paper);
  margin: -0.75rem 1.25rem 0;
  padding: 1.75rem 1.1rem 1.6rem;
  font-size: 0.98rem;
  font-variant-numeric: tabular-nums;
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 14px 100%;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 14px 100%;
}

.receipt dl {
  margin: 0;
  display: grid;
  gap: 0.45rem;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
}

.receipt dt small {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.3;
}

.receipt dd {
  margin: 0;
  font-weight: 500;
  white-space: nowrap;
}

.receipt-total {
  border-top: 2px dashed var(--line);
  margin-top: 0.4rem;
  padding-top: 0.7rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.25rem;
}

.receipt-total dd {
  font-weight: 700;
}

/* Sections */

.section {
  padding-block: 4.5rem;
}

.section-mist {
  background: var(--mist);
}

.section-head {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.section-head:last-child {
  margin-bottom: 0;
}

.parts {
  display: grid;
  gap: 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.parts li {
  border-top: 3px solid var(--ink);
  padding-top: 1rem;
  display: grid;
  gap: 0.4rem;
  align-content: start;
}

.parts .figure {
  font-family: var(--display);
  font-weight: 700;
  font-size: 2rem;
  line-height: 1.1;
  color: var(--green);
}

.parts .figure small {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}

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

/* Rate tables */

.rates {
  width: 100%;
  max-width: 34rem;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.rates th,
.rates td {
  text-align: left;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
  font-weight: 400;
}

.rates thead th {
  font-weight: 600;
  border-bottom: 2px solid var(--ink);
}

.rates td:last-child,
.rates th:last-child {
  text-align: right;
  white-space: nowrap;
  padding-left: 1rem;
}

.rates tfoot td {
  border-bottom: 0;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: left;
}

.rates-layout {
  display: grid;
  gap: 2rem;
  align-items: start;
}

.rates-notes {
  display: grid;
  gap: 0.9rem;
  max-width: 34rem;
}

@media (min-width: 54rem) {
  .rates-layout {
    grid-template-columns: minmax(0, 34rem) minmax(0, 1fr);
    gap: 4rem;
  }

  .rates-notes {
    padding-top: 2.9rem;
  }
}

/* App section */

.app-grid {
  display: grid;
  gap: 3rem;
  align-items: center;
}

.phones {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 1rem;
}

.phone {
  width: min(46%, 15rem);
  border: 6px solid var(--ink);
  border-radius: 1.75rem;
  overflow: hidden;
  background: var(--ink);
}

.phone:nth-child(2) {
  margin-top: 2.5rem;
}

.app-copy {
  display: grid;
  gap: 1.5rem;
  justify-items: start;
}

.features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
  max-width: 34rem;
}

.features li {
  padding-left: 1.1rem;
  border-left: 4px solid var(--yellow);
}

.features b {
  display: block;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.1rem;
}

@media (min-width: 54rem) {
  .app-grid {
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
  }
}

/* FAQ */

.faq {
  max-width: 44rem;
  border-top: 2px solid var(--ink);
}

.faq details {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  cursor: pointer;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.15rem;
  padding: 1rem 2rem 1rem 0;
  list-style: none;
  position: relative;
}

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

.faq summary::after {
  content: "+";
  position: absolute;
  right: 0.25rem;
  top: 50%;
  translate: 0 -50%;
  font-size: 1.5rem;
  font-weight: 500;
}

.faq details[open] summary::after {
  content: "\2212";
}

.faq details p {
  padding-bottom: 1.25rem;
  max-width: 38rem;
}

.faq details {
  interpolate-size: allow-keywords;
}

.faq details::details-content {
  height: 0;
  overflow: clip;
  transition:
    height 0.28s ease,
    content-visibility 0.28s allow-discrete;
}

.faq details[open]::details-content {
  height: auto;
}

/* Closing band */

.closing {
  background: var(--green);
  color: #fff;
}

.closing-inner {
  display: grid;
  gap: 1.5rem;
  justify-items: start;
  padding-block: 4rem;
}

.closing .btn {
  background: var(--yellow);
  color: var(--ink);
}

.closing .btn:hover {
  background: #ffe24d;
}

.closing :focus-visible {
  outline-color: #fff;
}

/* Footer */

.footer {
  background: var(--case);
  color: #c9cdc9;
  font-size: 0.95rem;
}

.footer-inner {
  display: grid;
  gap: 1.25rem;
  padding-block: 2.5rem;
}

.footer p {
  max-width: 46rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  color: #fff;
  font-weight: 500;
}

.footer :focus-visible {
  outline-color: var(--yellow);
}

/* Long-form text (privacy policy) */

.prose {
  max-width: 42rem;
  display: grid;
  gap: 2.25rem;
}

.prose section {
  display: grid;
  gap: 0.75rem;
}

.prose h2 {
  font-size: 1.4rem;
}

.prose h3 {
  font-size: 1.1rem;
  margin-top: 0.5rem;
}

.prose ul {
  margin: 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 0.3rem;
}

.prose a {
  color: var(--green);
  font-weight: 500;
  overflow-wrap: anywhere;
}

.callout {
  border-left: 4px solid var(--green);
  background: var(--mist);
  padding: 1rem 1.1rem;
  display: grid;
  gap: 0.5rem;
}

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

  .faq details::details-content {
    transition: none;
  }
}
