/*
 * Reusable site components: cards, feature blocks, the phone mockup and its
 * in-screen UI pieces, floating tiles, the dark block, pricing and FAQ.
 *
 * The `m-` prefixed classes render a simplified copy of the app's own screens.
 * Their labels and numbers must match what the app actually shows — see
 * components/BestDepartureCard.tsx, OverviewStats.tsx and
 * PeriodComparisonCard.tsx. Replace these with real device screenshots once a
 * build can be captured.
 */

/* ── Section header ──────────────────────────────────────────── */
.block-head {
  display: flex;
  flex-direction: column;
  gap: var(--gap-1);
  max-width: 34ch;
}

.block-head--center {
  max-width: 44ch;
  margin-inline: auto;
  text-align: center;
}

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  padding: var(--p-5);
  border-radius: var(--r-1);
  background: var(--card);
  box-shadow: var(--shadow-1);
}

.grid {
  display: grid;
  gap: var(--gap-2);
}

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

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

  .grid--4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 640px) and (max-width: 1023px) {
  .grid--3,
  .grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.feature-card {
  display: flex;
  flex-direction: column;
  gap: var(--gap-1);
}

.feature-card__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-block-end: var(--gap-1);
  border-radius: var(--r-2);
  background: var(--accent-soft);
  color: var(--accent);
}

.feature-card__icon--amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.feature-card__icon svg {
  width: 22px;
  height: 22px;
}

/* ── Two-column feature block ────────────────────────────────── */
.feature {
  display: grid;
  gap: var(--block-y);
  align-items: center;
}

@media (min-width: 1024px) {
  .feature {
    grid-template-columns: 1fr 1fr;
    gap: clamp(2rem, 5vw, 5rem);
  }

  .feature--flip .feature__art {
    order: -1;
  }
}

.feature__copy {
  display: flex;
  flex-direction: column;
  gap: var(--gap-2);
}

.feature__art {
  display: grid;
  place-items: center;
}

.feature__list {
  display: flex;
  flex-direction: column;
  gap: var(--gap-1);
}

.feature__list li {
  display: flex;
  align-items: flex-start;
  gap: var(--p-2);
  font-weight: var(--weight-strong);
  color: var(--text-2);
}

.feature__list li::before {
  content: '';
  flex: none;
  width: 8px;
  height: 8px;
  margin-block-start: 0.55em;
  border-radius: var(--r-pill);
  background: var(--accent-mid);
  box-shadow: inset 0 0 0 2px var(--accent);
}

/* ── Phone mockup ────────────────────────────────────────────── */
.phone {
  width: 300px;
  max-width: 100%;
  padding: 10px;
  border-radius: 46px;
  background: linear-gradient(
    160deg,
    var(--gradient-finish),
    var(--gradient-start)
  );
  box-shadow: var(--shadow-2);
}

.phone__screen {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 9px;
  height: 500px;
  padding: 18px 11px 11px;
  border-radius: 36px;
  background: var(--bg);
  /* The screen is its own light context: it must not inherit the text colour
   * of a dark section it happens to sit in. */
  color: var(--text);
}

.phone__notch {
  position: absolute;
  inset-block-start: 7px;
  inset-inline-start: 50%;
  translate: -50% 0;
  width: 74px;
  height: 18px;
  border-radius: var(--r-pill);
  background: var(--gradient-start);
}

/* ── Mockup UI: shared ───────────────────────────────────────── */
.m-title {
  font-size: 19px;
  font-weight: var(--weight-display);
  letter-spacing: -0.01em;
  padding-inline-start: 4px;
}

.m-label {
  font-size: 9px;
  font-weight: var(--weight-strong);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--text-2);
}

.m-card {
  padding: 11px;
  border-radius: var(--r-2);
  background: var(--card);
  box-shadow: var(--shadow-1);
}

/* Direction segmented control (components/DirectionToggle.tsx). */
.m-seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 3px;
  border-radius: var(--r-pill);
  background: var(--card-2);
}

.m-seg span {
  padding-block: 6px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: var(--weight-strong);
  text-align: center;
  color: var(--text-2);
}

.m-seg span[data-active] {
  background: var(--accent);
  color: var(--card);
}

/* Typical departure window card (components/BestDepartureCard.tsx). */
.m-hero-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.m-hero-card__value {
  font-size: 27px;
  font-weight: var(--weight-display);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.m-hero-card__sub {
  font-size: 10px;
  font-weight: var(--weight-body);
  line-height: 1.35;
  color: var(--text-2);
}

/* Overview stat cards (components/StatCard.tsx, OverviewStats.tsx). */
.m-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.m-stat {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 9px;
  border-radius: var(--r-2);
  background: var(--card);
  box-shadow: var(--shadow-1);
}

.m-stat b {
  font-size: 15px;
  font-weight: var(--weight-display);
  letter-spacing: -0.01em;
}

.m-stat b small {
  font-size: 9px;
  font-weight: var(--weight-strong);
  color: var(--text-2);
}

/* Trip rows (components/HomeTripHistory.tsx). */
.m-rows {
  display: flex;
  flex-direction: column;
  padding-inline: 11px;
  border-radius: var(--r-2);
  background: var(--card);
  box-shadow: var(--shadow-1);
}

.m-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-block: 8px;
  border-block-start: 1px solid var(--card-2);
}

.m-row:first-child {
  border-block-start: 0;
}

.m-row__main {
  display: flex;
  flex-direction: column;
}

.m-row b {
  font-size: 13px;
  font-weight: var(--weight-display);
  letter-spacing: -0.01em;
}

.m-row time {
  font-size: 9px;
  font-weight: var(--weight-strong);
  color: var(--text-2);
}

.m-badge {
  padding: 3px 7px;
  border-radius: var(--r-pill);
  font-size: 9px;
  font-weight: var(--weight-strong);
  background: var(--accent-soft);
  color: var(--text);
}

.m-badge--work {
  background: var(--amber-soft);
  color: var(--text);
}

/* Day-of-week bars (components/WeekdayTracker.tsx). */
.m-days {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-block-start: 7px;
}

.m-day {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  font-weight: var(--weight-strong);
}

.m-day span:first-child {
  width: 22px;
  color: var(--text-2);
}

.m-day i {
  height: 7px;
  border-radius: var(--r-pill);
  background: var(--accent);
}

.m-day span:last-child {
  margin-inline-start: auto;
  color: var(--text-2);
}

/* Quick-log numpad sheet (app/quick-log.tsx, components/NumPad.tsx). */
.m-sheet {
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin: -18px -11px -11px;
  margin-block-start: auto;
  padding: 16px 14px 20px;
  border-radius: 28px 28px 36px 36px;
  background: linear-gradient(
    180deg,
    var(--gradient-start),
    var(--gradient-finish)
  );
  color: var(--on-dark);
}

.m-sheet__value {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  font-weight: var(--weight-display);
  letter-spacing: -0.03em;
}

.m-sheet__value b {
  font-size: 54px;
  line-height: 1;
}

.m-sheet__value span {
  font-size: 16px;
  color: var(--on-dark-2);
}

.m-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.m-pad span {
  display: grid;
  place-items: center;
  height: 38px;
  border-radius: var(--r-pill);
  background: var(--on-dark-card);
  font-size: 17px;
  font-weight: var(--weight-display);
}

.m-pad span[data-empty] {
  background: none;
}

/* Period comparison card (components/PeriodComparisonCard.tsx). */
.m-compare {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.m-compare__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.m-compare__periods {
  display: flex;
  gap: 4px;
}

.m-compare__periods span {
  padding: 3px 7px;
  border-radius: var(--r-1);
  background: var(--card-2);
  font-size: 9px;
  font-weight: var(--weight-strong);
  color: var(--text-2);
}

.m-compare__periods span[data-active] {
  background: var(--accent);
  color: var(--card);
}

.m-compare__title {
  font-size: 11px;
  font-weight: var(--weight-strong);
}

.m-compare__value {
  font-size: 26px;
  font-weight: var(--weight-display);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.m-compare__body {
  font-size: 10px;
  font-weight: var(--weight-body);
  line-height: 1.4;
  color: var(--text-2);
}

.m-compare__caption {
  font-size: 9px;
  font-weight: var(--weight-strong);
  line-height: 1.35;
  color: var(--text-2);
}

/* ── Floating tiles ──────────────────────────────────────────── */
.tile {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--p-2) var(--p-3);
  border-radius: var(--r-2);
  background: var(--card);
  box-shadow: var(--shadow-2);
}

.tile__label {
  font-size: var(--size-caption);
  font-weight: var(--weight-strong);
  color: var(--text-2);
}

.tile__value {
  font-size: 1.5rem;
  font-weight: var(--weight-display);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.tile__value small {
  font-size: 0.875rem;
  color: var(--text-2);
}

.tile--pill {
  flex-direction: row;
  align-items: center;
  gap: var(--gap-1);
  padding: var(--p-1) var(--p-3);
  border-radius: var(--r-pill);
  font-size: var(--size-caption);
  font-weight: var(--weight-strong);
}

.tile__dot {
  width: 8px;
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--accent);
}

.tile__dot--amber {
  background: var(--amber);
}

/* ── Dark block ──────────────────────────────────────────────── */
.dark {
  background: linear-gradient(
    150deg,
    var(--gradient-start),
    var(--gradient-finish)
  );
  color: var(--on-dark);
}

.dark .lead,
.dark .body {
  color: var(--on-dark-2);
}

.dark .eyebrow {
  color: var(--accent-mid-plain);
}

.dark .feature__list li {
  color: var(--on-dark-2);
}

.dark .feature__list li::before {
  background: rgba(240, 237, 232, 0.16);
  box-shadow: inset 0 0 0 2px var(--accent-mid-plain);
}

.dark .btn--inverted {
  background: var(--on-dark);
  color: var(--gradient-start);
  box-shadow: none;
}

.dark .btn[aria-disabled='true'] {
  background: var(--on-dark-card);
  color: var(--on-dark-3);
}

/* ── Pricing ─────────────────────────────────────────────────── */
.price {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-2);
}

.price__item {
  flex: 1 1 140px;
  padding: var(--p-3) var(--p-4);
  border: 1px solid var(--on-dark-border);
  border-radius: var(--r-2);
  background: var(--on-dark-card);
}

.price__amount {
  font-size: 1.5rem;
  font-weight: var(--weight-display);
  letter-spacing: -0.02em;
}

.price__period {
  font-size: var(--size-caption);
  font-weight: var(--weight-strong);
  color: var(--on-dark-2);
}

.price__note {
  font-size: var(--size-caption);
  font-weight: var(--weight-body);
  line-height: 1.5;
  color: var(--on-dark-2);
}

/* ── Privacy strip ───────────────────────────────────────────── */
.strip {
  display: flex;
  flex-direction: column;
  gap: var(--gap-1);
}

.strip__title {
  font-size: var(--size-body);
  font-weight: var(--weight-display);
  letter-spacing: -0.01em;
}

/* ── FAQ ─────────────────────────────────────────────────────── */
.faq {
  display: flex;
  flex-direction: column;
  gap: var(--gap-1);
  max-width: var(--container-narrow);
  margin-inline: auto;
}

.faq__item {
  padding: var(--p-3) var(--p-4);
  border-radius: var(--r-2);
  background: var(--card);
  box-shadow: var(--shadow-1);
}

.faq__q {
  display: flex;
  align-items: center;
  gap: var(--gap-2);
  font-size: var(--size-body);
  font-weight: var(--weight-display);
  letter-spacing: -0.01em;
  cursor: pointer;
  list-style: none;
}

.faq__q::-webkit-details-marker {
  display: none;
}

.faq__q::after {
  content: '';
  flex: none;
  width: 10px;
  height: 10px;
  margin-inline-start: auto;
  border-right: 2.5px solid var(--text-2);
  border-bottom: 2.5px solid var(--text-2);
  rotate: 45deg;
  translate: 0 -2px;
  transition: rotate var(--t-micro) var(--ease-standard);
}

.faq__item[open] .faq__q::after {
  rotate: -135deg;
  translate: 0 2px;
}

.faq__a {
  margin-block-start: var(--gap-1);
  color: var(--text-2);
  text-wrap: pretty;
}
