/* ==========================================================================
   Components — wordmark, buttons, chips, badges, states, selector,
   accordion, dialog, toast
   ========================================================================== */

/* --------------------------------------------------------------- Wordmark
   "wp" chip + Maintora, with a lime status light as the dot on the i. */
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1.3125rem;
  letter-spacing: -0.04em;
  line-height: 1;
  white-space: nowrap;
  color: var(--text-1);
}

.wordmark__wp {
  display: inline-grid;
  place-items: center;
  height: 1.55em;
  padding: 0 0.32em 0.06em;
  border-radius: 0.38em;
  background: var(--lime);
  color: var(--on-lime);
  font-size: 0.8em;
  letter-spacing: -0.03em;
}

.wordmark__i {
  position: relative;
  display: inline-block;
}

.wordmark__i::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0.02em;
  width: 0.2em;
  height: 0.2em;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0.45em rgb(199 255 94 / 0.8);
  transform: translateX(-50%);
}

.wordmark--inline { font-size: 1rem; margin-right: 0.5rem; vertical-align: -0.1em; }

/* ---------------------------------------------------------------- Buttons */
.btn {
  --bg: var(--surface-2);
  --fg: var(--text-1);
  --bd: var(--line-strong);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 3rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--bd);
  background: var(--bg);
  color: var(--fg);
  font-weight: 500;
  font-size: 0.9375rem;
  line-height: 1.1;
  white-space: nowrap;
  isolation: isolate;
  overflow: hidden;
  transition: transform 300ms var(--ease), background-color 200ms linear, border-color 200ms linear, color 200ms linear, box-shadow 300ms var(--ease);
}

.btn .icon { width: 1.125rem; height: 1.125rem; transition: transform 400ms var(--ease); }
.btn:hover .icon { transform: translateX(3px); }
.btn:active { transform: translateY(1px) scale(0.99); }

/* sheen sweep on hover */
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgb(255 255 255 / 0.22) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 700ms var(--ease);
}
.btn:hover::after { transform: translateX(120%); }

.btn--lime {
  --bg: var(--lime);
  --fg: var(--on-lime);
  --bd: var(--lime);
  font-weight: 600;
  box-shadow: 0 0 0 0 rgb(199 255 94 / 0), 0 10px 30px -10px rgb(199 255 94 / 0.45);
}
.btn--lime:hover {
  --bg: var(--lime-hover);
  box-shadow: 0 0 0 4px rgb(199 255 94 / 0.14), 0 14px 36px -10px rgb(199 255 94 / 0.55);
}

.btn--ghost {
  --bg: rgb(247 249 245 / 0.03);
  --bd: var(--line-strong);
}
.btn--ghost:hover { --bg: rgb(247 249 245 / 0.08); --bd: rgb(247 249 245 / 0.28); }

.btn--ink {
  --bg: var(--ink);
  --fg: var(--light-0);
  --bd: var(--ink);
}
.btn--ink:hover { --bg: #1d2622; }

.btn--sm { min-height: 2.5rem; padding: 0.5rem 0.95rem; font-size: var(--fs-small); }
.btn--lg { min-height: 3.5rem; padding: 0.9rem 1.5rem; font-size: 1rem; }
.btn--xl { min-height: 3.75rem; padding: 0.5rem 1.75rem; font-size: 1.0625rem; border-radius: 14px; }

/* Primary CTA with an inset arrow "orb" that slides on hover */
.btn__orb {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-right: -1.1rem;
  border-radius: 10px;
  background: var(--on-lime);
  color: var(--lime);
  transition: transform var(--dur-comp) var(--ease), background-color var(--dur-micro) linear;
}
.btn__orb .icon { width: 1.125rem; height: 1.125rem; }
.btn:hover .btn__orb { transform: translateX(3px); }
.btn:hover .btn__orb .icon { transform: none; }
.btn--block { width: 100%; }

/* ------------------------------------------------------- Chips & badges */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.85rem 0.4rem 0.6rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  background: rgb(247 249 245 / 0.03);
  font-family: var(--f-mono);
  font-size: var(--fs-label);
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  color: var(--text-2);
}

.chip__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 3px rgb(199 255 94 / 0.16);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--r-pill);
  font-family: var(--f-mono);
  font-size: var(--fs-micro);
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  line-height: 1.4;
  white-space: nowrap;
}

.badge--sample {
  border: 1px dashed rgb(255 181 71 / 0.6);
  color: var(--amber);
  background: rgb(255 181 71 / 0.06);
}

.on-light .badge--sample {
  border-color: #b9781a;
  color: #8a5608;
  background: rgb(255 181 71 / 0.12);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: var(--s-5);
  font-family: var(--f-mono);
  font-size: var(--fs-label);
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  color: var(--text-2);
}

.eyebrow__num {
  display: inline-grid;
  place-items: center;
  min-width: 2rem;
  height: 1.5rem;
  padding-inline: 0.4rem;
  border-radius: 6px;
  background: var(--lime-soft);
  color: var(--lime);
}

.eyebrow--ink { color: var(--ink-2); }
.eyebrow--ink .eyebrow__num { background: var(--ink); color: var(--lime); }

.dot {
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--text-3);
  flex: none;
}
.dot--ok, .dot--live { background: var(--lime); box-shadow: 0 0 8px rgb(199 255 94 / 0.7); }

.state {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.18rem 0.5rem;
  border-radius: var(--r-pill);
  font-family: var(--f-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.02em;
  white-space: nowrap;
  background: rgb(247 249 245 / 0.06);
  color: var(--text-2);
}
.state::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.state--ok { background: rgb(199 255 94 / 0.12); color: var(--lime); }
.state--next { background: rgb(255 181 71 / 0.1); color: var(--amber); }
.on-light .state--ok { background: #e7f7cf; color: #3d6b00; }
.on-light .state--next { background: #fff1db; color: #8a5608; }

/* --------------------------------------------------- Segmented selector */
.seg { border: 0; padding: 0; margin: 0; min-width: 0; }

.seg__legend {
  margin-bottom: 0.75rem;
  font-family: var(--f-mono);
  font-size: var(--fs-label);
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  color: var(--text-2);
}

.seg__track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 0.3125rem;
  border-radius: var(--r-pill);
  background: var(--surface-1);
  border: 1px solid var(--line-strong);
  box-shadow: inset 0 2px 8px rgb(0 0 0 / 0.4);
}

.seg__thumb {
  position: absolute;
  top: 0.3125rem;
  bottom: 0.3125rem;
  left: 0.3125rem;
  width: calc((100% - 0.625rem) / 3);
  border-radius: var(--r-pill);
  background: var(--lime);
  box-shadow: 0 8px 24px -8px rgb(199 255 94 / 0.6);
  transition: transform 520ms var(--ease);
}

.seg__opt {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 0.1rem;
  padding: 0.7rem 0.5rem;
  border-radius: var(--r-pill);
  cursor: pointer;
  text-align: center;
  color: var(--text-2);
  transition: color 300ms linear;
}

.seg__opt input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.seg__name { font-weight: 600; font-size: 1rem; line-height: 1.2; }
.seg__sites { font-family: var(--f-mono); font-size: var(--fs-micro); opacity: 0.85; }
.seg__dots { display: inline-flex; gap: 3px; height: 0.5rem; margin-bottom: 0.2rem; }
.seg__dots i { width: 0.5rem; height: 0.5rem; border-radius: 2px; border: 1.5px solid currentColor; opacity: 0.7; }
.seg__opt:hover { color: var(--text-1); }
.seg__opt:has(input:checked) { color: var(--on-lime); }
.seg__opt:has(input:focus-visible) { outline: 2px solid var(--text-1); outline-offset: 2px; }

/* no-JS / no :has fallback: show checked option with underline */
.no-js .seg__thumb { display: none; }
.no-js .seg__opt:has(input:checked) { background: var(--lime); }

/* --------------------------------------------------------------- Accordion */
.accordion { display: grid; gap: 0.625rem; }

.acc {
  border-radius: var(--r-md);
  background: var(--surface-1);
  border: 1px solid var(--line);
  transition: border-color 300ms linear, background-color 300ms linear;
}

.acc:hover { border-color: var(--line-strong); }
.acc.is-open { background: var(--surface-2); border-color: rgb(199 255 94 / 0.22); }

.acc__h { font: inherit; letter-spacing: normal; text-wrap: pretty; }

.acc__btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 1.25rem 1.25rem 1.25rem 1.5rem;
  text-align: left;
  font-family: var(--f-display);
  font-weight: 500;
  font-size: var(--fs-h4);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.acc__icon {
  position: relative;
  flex: none;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  transition: transform 500ms var(--ease), background-color 300ms linear, border-color 300ms linear;
}

.acc__icon::before,
.acc__icon::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 0.75rem; height: 1.5px;
  border-radius: 2px;
  background: currentColor;
  transform: translate(-50%, -50%);
}
.acc__icon::after { transform: translate(-50%, -50%) rotate(90deg); }

.acc.is-open .acc__icon {
  transform: rotate(45deg);
  background: var(--lime);
  border-color: var(--lime);
  color: var(--on-lime);
}

.acc__panel {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 500ms var(--ease);
}

.js .acc__panel { grid-template-rows: 0fr; }
.js .acc.is-open .acc__panel { grid-template-rows: 1fr; }

.acc__inner { overflow: hidden; }

.acc__inner p {
  padding: 0 1.5rem 1.5rem;
  max-width: 40rem;
  color: var(--text-2);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 400ms linear, transform 500ms var(--ease);
}

.no-js .acc__inner p,
.acc.is-open .acc__inner p { opacity: 1; transform: none; }

/* ------------------------------------------------------------------ Dialog */
.dialog {
  width: min(30rem, calc(100% - 2rem));
  max-height: calc(100% - 2rem);
  margin: auto;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  background: var(--surface-1);
  color: var(--text-1);
  box-shadow: var(--shadow-2);
}

.dialog::backdrop {
  background: rgb(4 6 5 / 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.dialog__inner { padding: clamp(1.25rem, 1rem + 2vw, 2rem); }
.dialog__title { margin: 1rem 0 1.25rem; font-size: var(--fs-h3); }

.dialog__summary { margin-bottom: 1.25rem; border-top: 1px solid var(--line); }
.dialog__summary > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.7rem;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-small);
}
.dialog__summary dt { color: var(--text-2); }
.dialog__summary dd { margin: 0; text-align: right; }
.dialog__total dd { font-family: var(--f-display); font-size: 1.5rem; font-weight: 600; color: var(--lime); }

.dialog__note { margin-bottom: 1.25rem; font-size: var(--fs-small); color: var(--text-2); }
.dialog__note strong { display: block; margin-top: 0.5rem; color: var(--text-1); font-weight: 500; }

/* ------------------------------------------------------------------- Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  z-index: var(--z-toast);
  max-width: calc(100% - 2rem);
  padding: 0.75rem 1rem;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-2);
  font-size: var(--fs-small);
  transform: translateX(-50%);
}
