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

html {
  text-size-adjust: 100%;
}

/* The reset zeroes padding globally, which would hide markers on prose lists. */
ul,
ol {
  padding-left: var(--space-5);
}

body {
  background: var(--surface-page);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--size-body);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
.h1,
.h2,
.h3 {
  color: var(--text-strong);
  font-weight: 800;
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
}

h1,
.h1 {
  font-size: var(--size-h1);
}

h2,
.h2 {
  font-size: var(--size-h2);
}

h3,
.h3 {
  font-size: var(--size-h3);
  letter-spacing: var(--tracking-snug);
}

a {
  color: var(--brand);
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .btn:hover {
    transform: none;
  }

  /* The wait this reports can run to minutes, so the indicator has to stay
   * legibly alive without spinning. */
  .spinner {
    animation: pulse 2.4s ease-in-out infinite;
    border-top-color: var(--border);
    background: var(--brand);
    border-radius: 50%;
  }
}

.skip-link {
  background: var(--surface-raised);
  border: 1px solid var(--border-control);
  border-radius: var(--radius-sm);
  color: var(--text-strong);
  font-weight: 700;
  left: var(--space-3);
  padding: var(--space-3) var(--space-4);
  position: fixed;
  text-decoration: none;
  top: var(--space-3);
  transform: translateY(-200%);
  z-index: 100;
}

.skip-link:focus {
  transform: translateY(0);
}

/* The region always renders so Turbo-injected flashes have an aria-live target
 * to land in; the spacing therefore has to belong to the message, not the box. */
.flashes {
  display: grid;
  gap: var(--space-3);
  margin: 0 auto;
  max-width: var(--container);
  padding: 0 var(--gutter);
}

.flashes .notice:first-child {
  margin-top: var(--space-4);
}

/* ---- Layout -------------------------------------------------------------- */

.wrap {
  margin: 0 auto;
  max-width: var(--container);
  padding: 0 var(--gutter);
}

.section {
  padding: var(--space-8) 0;
}

@media (width >= 820px) {
  .section {
    padding: var(--space-9) 0;
  }
}

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

.section-head {
  margin: 0 auto var(--space-7);
  max-width: 60ch;
  text-align: center;
}

.section-head p {
  margin-top: var(--space-3);
}

.grid-3 {
  display: grid;
  gap: var(--space-4);
}

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

/* ---- Typography ---------------------------------------------------------- */

.display {
  color: var(--text-strong);
  font-size: var(--size-display);
  font-weight: 800;
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
}

.lead {
  font-size: var(--size-lead);
  max-width: 52ch;
}

.micro {
  color: var(--text-muted);
  font-size: var(--size-sm);
}

.eyebrow {
  color: var(--text-muted);
  font-size: var(--size-micro);
  font-weight: 700;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.figure {
  color: var(--text-strong);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.figure--display {
  font-size: var(--size-amount);
  font-weight: 800;
  letter-spacing: var(--tracking-tighter);
}

/* "Sin costo" is prose sitting in the amount slot; monospace tabular digits
 * make it read as a rendering fault. */
.figure--words {
  font-family: var(--font-sans);
  letter-spacing: var(--tracking-tight);
}

.figure__unit {
  color: var(--text-muted);
  font-size: var(--size-sm);
  font-weight: 600;
}

/* Brand moment only — never panel chrome (ADR-0020).
 * Without the prefixed property, Chrome-Android below 120 drops the clip, keeps
 * `color: transparent`, and the accented words vanish from the headline. */
.gradient-text {
  background: var(--gradient-text);

  /* stylelint-disable-next-line property-no-vendor-prefix -- see above */
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-style: normal;
}

/* ---- Icons --------------------------------------------------------------- */

/* The svg sets fill:none, so each shape carries fill="currentColor" and
 * inherits the surrounding text color. */
.ic {
  display: inline-block;
  fill: none;
  flex: none;
  vertical-align: middle;
}

/* ---- Navigation ---------------------------------------------------------- */

.site-nav {
  backdrop-filter: blur(12px);
  background: var(--surface-page);
  background: color-mix(in srgb, var(--surface-page) 72%, transparent);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-nav .wrap {
  align-items: center;
  display: flex;
  height: 66px;
  justify-content: space-between;
}

.brand {
  align-items: center;
  color: var(--text-strong);
  display: flex;
  font-size: var(--size-brand);
  font-weight: 800;
  gap: var(--space-2);
  letter-spacing: var(--tracking-snug);
  text-decoration: none;
}

/* Decorative: the accessible name lives on the link that wraps it, so a screen
 * reader hears the brand once rather than twice. */
.brand-wordmark {
  background: var(--brand-wordmark) no-repeat center / contain;
  display: block;
  height: 30px;
  width: 119px;
}

.brand-lockup {
  background: var(--brand-lockup) no-repeat left center / contain;
  display: block;
  height: 59px;
  width: 150px;
}

/* ---- Thumb navigation ---------------------------------------------------- */

/* panel.css is what pins this to the bottom of the viewport; here it is an
 * ordinary bar, which is also how /styleguide can show it. */
.thumb-nav {
  backdrop-filter: blur(12px);
  background: var(--surface-page);
  background: color-mix(in srgb, var(--surface-page) 88%, transparent);
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  display: flex;
  gap: var(--space-2);
  justify-content: space-around;
  margin: 0 auto;
  max-width: 520px;
  padding: var(--space-2) var(--space-2) max(var(--space-2), env(safe-area-inset-bottom));
}

.thumb-nav__item {
  align-items: center;
  background: none;
  border: 0;
  border-radius: var(--radius);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  font: inherit;
  font-size: var(--size-micro);
  font-weight: 700;
  gap: var(--space-1);
  justify-content: center;
  min-height: 52px;
  min-width: 76px;
  padding: var(--space-2);
  text-align: center;
  text-decoration: none;
}

.thumb-nav__item[aria-current="page"] {
  background: var(--brand-soft);
  color: var(--brand);
}

/* button_to wraps its button in a form, which would otherwise become the flex
 * child and collapse the item beside its siblings. */
.thumb-nav__form {
  display: contents;
}

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

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: var(--size-sm);
  padding: var(--space-7) 0;
}

.site-footer .wrap {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: space-between;
}

.powered-by {
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-size: var(--size-micro);
  font-weight: 700;
  letter-spacing: var(--tracking-wide);
  padding: var(--space-1) var(--space-3);
  text-transform: uppercase;
}

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

.btn {
  align-items: center;
  background: var(--surface-raised);
  border: 1px solid var(--border-control);
  border-radius: var(--radius);
  color: var(--text-strong);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: var(--size-body);
  font-weight: 700;
  gap: var(--space-2);
  justify-content: center;
  padding: var(--space-3) var(--space-5);
  text-decoration: none;
  transition: background-color var(--transition), transform var(--transition);
}

.btn--primary {
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: var(--shadow-brand);
  color: var(--text-on-brand);
  font-size: var(--size-cta);
  padding: var(--space-4) var(--space-7);
}

.btn--primary:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
}

.btn--ghost {
  background: transparent;
}

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

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

.btn:disabled,
.btn[aria-disabled="true"] {
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

.btn--danger {
  background: var(--danger-soft);
  border-color: var(--danger);
  color: var(--danger);
}

.btn--block {
  width: 100%;
}

@media (width >= 520px) {
  .btn--block {
    width: auto;
  }
}

/* ---- Pills, tags, chips -------------------------------------------------- */

.pill {
  align-items: center;
  background: var(--brand-soft);
  border-radius: var(--radius-pill);
  color: var(--brand);
  display: inline-flex;
  font-size: var(--size-xs);
  font-weight: 700;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
}

/* Brand emphasis, not an action and not a status: --brand would read as
 * something to click, --warning as something wrong. */
.tag {
  background: var(--emphasis-soft);
  border: 1px solid var(--emphasis);
  border-radius: var(--radius-pill);
  color: var(--emphasis);
  font-size: var(--size-micro);
  font-weight: 800;
  letter-spacing: var(--tracking-wide);
  padding: var(--space-1) var(--space-3);
  text-transform: uppercase;
}

.chip-set {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: center;
}

.chip {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text);
  font-size: var(--size-sm);
  font-weight: 600;
  padding: var(--space-2) var(--space-4);
}

/* ---- Cards --------------------------------------------------------------- */

.card {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.card__icon {
  align-items: center;
  background: var(--brand-soft);
  border-radius: var(--radius-sm);
  color: var(--brand);
  display: flex;
  height: 42px;
  justify-content: center;
  margin-bottom: var(--space-4);
  width: 42px;
}

.card__title {
  margin-bottom: var(--space-2);
}

/* A whole card that is one tap target, so it has to look tappable next to the
 * cards that are not. */
.card--link {
  align-items: center;
  color: inherit;
  display: flex;
  gap: var(--space-4);
  text-decoration: none;
  transition: background-color var(--transition), border-color var(--transition);
}

.card--link:hover,
.card--link:active {
  background: var(--surface-sunken);
  border-color: var(--border-strong);
}

.card--link .card__icon {
  flex: none;
  margin-bottom: 0;
}

.card--link__text {
  display: grid;
  flex: 1;
  gap: var(--space-1);
}

.card__chevron {
  color: var(--text-muted);
  flex: none;
}

.card p {
  font-size: var(--size-sm);
}

/* ---- Stat strip ---------------------------------------------------------- */

.stat-strip {
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: grid;
  gap: 1px;
  grid-template-columns: 1fr;
  margin: 0 auto;
  max-width: 640px;
  overflow: hidden;
}

@media (width >= 420px) {
  .stat-strip {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* The gap shows the container through, so the separator needs no border that
 * could clip a figure at narrow widths. */
.stat {
  background: var(--surface-sunken);
  box-shadow: 0 0 0 1px var(--border);
  padding: var(--space-5) var(--space-3);
  text-align: center;
}

.stat__value {
  color: var(--text-strong);
  display: block;
  font-size: var(--size-stat);
  font-weight: 800;
  letter-spacing: var(--tracking-tight);
}

.stat__label {
  color: var(--text-muted);
  font-size: var(--size-xs);
  overflow-wrap: anywhere;
}

/* ---- Plans --------------------------------------------------------------- */

.plans {
  display: grid;
  gap: var(--space-5);
  margin: 0 auto;
  max-width: 900px;
}

@media (width >= 760px) {
  .plans {
    grid-template-columns: 1fr 1fr;
  }
}

.plan {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-7);
  position: relative;
}

.plan--featured {
  border-color: var(--brand);
  box-shadow: var(--shadow-brand);
}

.plan .tag {
  left: var(--space-7);
  position: absolute;
  top: -11px;
}

.plan > p {
  font-size: var(--size-sm);
  margin-bottom: var(--space-4);
}

.feature-list {
  list-style: none;
  margin-top: var(--space-5);
}

.feature-list li {
  align-items: flex-start;
  color: var(--text);
  display: flex;
  font-size: var(--size-sm);
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.feature-list .ic {
  color: var(--success);
  margin-top: var(--space-1);
}

/* ---- Forms --------------------------------------------------------------- */

.field {
  display: block;
  margin-bottom: var(--space-4);
}

.field__label {
  color: var(--text-strong);
  display: block;
  font-size: var(--size-xs);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.input,
.textarea,
.select {
  background: var(--surface-sunken);
  border: 1px solid var(--border-control);
  border-radius: var(--radius-sm);
  color: var(--text-strong);
  font: inherit;
  font-size: var(--size-input);
  padding: var(--space-3) var(--space-4);
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--text-muted);
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--focus-ring);
  outline: 0;
}

/* Chrome and Safari paint their own background on autofill, which breaks the
 * dark theme unless it is overpainted with an inset shadow. */
.input:-webkit-autofill,
.textarea:-webkit-autofill,
.select:-webkit-autofill {
  box-shadow: inset 0 0 0 100px var(--surface-sunken);
  -webkit-text-fill-color: var(--text-strong);
}

.textarea {
  min-height: 80px;
  resize: vertical;
}

.select-wrap {
  display: block;
  position: relative;
}

.select {
  appearance: none;
  padding-right: var(--space-8);
}

.select-wrap .ic {
  color: var(--text-muted);
  pointer-events: none;
  position: absolute;
  right: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
}

.field__hint {
  color: var(--text-muted);
  display: block;
  font-size: var(--size-xs);
  margin-top: var(--space-2);
}

.field__error {
  align-items: center;
  color: var(--danger);
  display: flex;
  font-size: var(--size-xs);
  font-weight: 600;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.field--invalid .input,
.field--invalid .textarea,
.field--invalid .select {
  border-color: var(--danger);
}

.checkbox-field {
  align-items: flex-start;
  color: var(--text);
  display: flex;
  font-size: var(--size-xs);
  gap: var(--space-3);
}

.checkbox-field input {
  accent-color: var(--brand);
  flex: none;
  height: 18px;
  margin-top: 2px;
  width: 18px;
}

/* ---- Notices ------------------------------------------------------------- */

.notice {
  align-items: flex-start;
  background: var(--info-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-strong);
  display: flex;
  font-size: var(--size-sm);
  gap: var(--space-3);
  padding: var(--space-4);
}

.notice .ic {
  color: var(--info);
  margin-top: 2px;
}

.notice--success {
  background: var(--success-soft);
}

.notice--success .ic {
  color: var(--success);
}

.notice--warning {
  background: var(--warning-soft);
}

.notice--warning .ic {
  color: var(--warning);
}

.notice--danger {
  background: var(--danger-soft);
}

.notice--danger .ic {
  color: var(--danger);
}

/* ---- Disclosure ---------------------------------------------------------- */

.faq-item {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: var(--space-3);
}

/* The padding lives on the control, not the card, so the whole row is the
 * tap target rather than a 26px strip. */
.faq-item summary {
  padding: var(--space-4) var(--space-5);
  align-items: center;
  color: var(--text-strong);
  cursor: pointer;
  display: flex;
  font-weight: 700;
  gap: var(--space-4);
  justify-content: space-between;
  letter-spacing: var(--tracking-slight);
  list-style: none;
}

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

.faq-item summary .ic {
  color: var(--brand);
  transition: transform var(--transition);
}

.faq-item[open] summary .ic {
  transform: rotate(180deg);
}

.faq-item p {
  font-size: var(--size-sm);
  padding: 0 var(--space-5) var(--space-4);
}

/* ---- Quotes -------------------------------------------------------------- */

.quote {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.quote p {
  margin-bottom: var(--space-4);
}

.quote__who {
  align-items: center;
  display: flex;
  gap: var(--space-3);
}

.quote__name {
  color: var(--text-strong);
  display: block;
  font-size: var(--size-sm);
  font-weight: 700;
}

.quote__role {
  color: var(--text-muted);
  font-size: var(--size-xs);
}

.avatar {
  align-items: center;
  background: var(--gradient-brand);
  border-radius: 50%;
  color: var(--text-on-brand);
  display: flex;
  flex: none;
  font-size: var(--size-xs);
  font-weight: 800;
  height: 38px;
  justify-content: center;
  width: 38px;
}

/* ---- Brand band ---------------------------------------------------------- */

.band {
  background: var(--gradient-brand);
  border-radius: var(--radius-2xl);
  color: var(--text-on-brand);
  margin: 0 auto;
  max-width: 900px;
  padding: var(--space-8) var(--space-6);
  text-align: center;
}

.band h2 {
  color: var(--text-on-brand);
}

.band p {
  margin: var(--space-3) auto var(--space-5);
  max-width: 46ch;
}

.band .btn {
  background: var(--surface-raised);
  border-color: var(--surface-raised);
  box-shadow: none;
  color: var(--brand);
}

/* The global ring is --brand, which is the gradient's own start colour: over
 * the band it measures 1.07:1 light and 1:1 dark, i.e. no focus indicator. */
.band .btn:focus-visible {
  outline-color: var(--text-on-brand);
}

/* ---- Tables -------------------------------------------------------------- */

/* A four-column breakdown on a 360px screen scrolls rather than truncating a
 * figure (.impeccable.md principle 2). */
.table-scroll {
  overflow-x: auto;
}

.data-table {
  border-collapse: collapse;
  font-size: var(--size-sm);
  width: 100%;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--border);
  padding: var(--space-3) var(--space-2);
  text-align: left;
}

.data-table th {
  color: var(--text-muted);
  font-size: var(--size-micro);
  font-weight: 700;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.data-table td {
  color: var(--text-strong);
}

/* ---- Empty and loading states -------------------------------------------- */

.empty-state {
  background: var(--surface-raised);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-8) var(--space-5);
  text-align: center;
}

.empty-state .ic {
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}

.empty-state p {
  margin: var(--space-2) auto var(--space-5);
  max-width: 44ch;
}

.spinner {
  animation: spin 700ms linear infinite;
  border: 2px solid var(--border);
  border-radius: 50%;
  border-top-color: var(--brand);
  display: inline-block;
  height: 20px;
  width: 20px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---- Status badge -------------------------------------------------------- */

.badge {
  background: var(--info-soft);
  border-radius: var(--radius-pill);
  color: var(--info);
  display: inline-block;
  font-size: var(--size-micro);
  font-weight: 700;
  letter-spacing: var(--tracking-wide);
  padding: var(--space-1) var(--space-3);
  text-transform: uppercase;
}

.badge--success {
  background: var(--success-soft);
  color: var(--success);
}

.badge--warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.badge--danger {
  background: var(--danger-soft);
  color: var(--danger);
}

/* ---- REF token ----------------------------------------------------------- */

/* Every unprompted message carries one, so the prospect can tie it back to
 * something they started (.impeccable.md principle 1). */
.ref {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: var(--size-xs);
  letter-spacing: var(--tracking-wide);
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.35;
  }
}
