/* ==========================================================================
   Components — reusable, intentionally related UI pieces
   ========================================================================== */

/* --------------------------------------------------------------- buttons */

.btn {
  --btn-bg: var(--brand-700);
  --btn-fg: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 48px;
  padding: 0.75rem 1.4rem;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid transparent;
  border-radius: var(--r-full);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.005em;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}

.btn--primary:hover {
  background: var(--brand-800);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: var(--sh-sm);
}

.btn--secondary {
  --btn-bg: var(--white);
  --btn-fg: var(--brand-800);
  border-color: var(--line-300);
  box-shadow: var(--sh-xs);
}

.btn--secondary:hover {
  background: var(--brand-050);
  border-color: var(--brand-300);
  color: var(--brand-900);
  transform: translateY(-1px);
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--ink-700);
}

.btn--ghost:hover {
  background: var(--brand-050);
  color: var(--brand-800);
}

.btn--inverse {
  --btn-bg: var(--white);
  --btn-fg: var(--brand-900);
}

.btn--inverse:hover {
  background: var(--brand-100);
  color: var(--brand-900);
  transform: translateY(-1px);
}

.btn--sm {
  min-height: 40px;
  padding: 0.5rem 1.1rem;
  font-size: var(--fs-xs);
}

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

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

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* ------------------------------------------------------------------ icon */

.icon {
  flex: none;
}

.icon--lg {
  width: 26px;
  height: 26px;
}

/* ------------------------------------------------------------------ pill */

.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0.3rem 0.7rem;
  border-radius: var(--r-full);
  background: var(--brand-100);
  color: var(--brand-800);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.pill--accent {
  background: var(--accent-100);
  color: var(--accent-700);
}

.pill--quiet {
  background: var(--sand-100);
  color: var(--ink-600);
}

.pill--live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: var(--r-full);
  background: var(--brand-500);
}

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

.card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-5);
  background: var(--white);
  border: 1px solid var(--line-200);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-xs);
}

.card__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: var(--sp-1);
  border-radius: var(--r-sm);
  background: var(--brand-050);
  color: var(--brand-600);
}

.card__title {
  color: var(--ink-900);
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  letter-spacing: -0.01em;
}

.card__body {
  color: var(--ink-500);
  font-size: var(--fs-sm);
  line-height: 1.62;
}

/* ---------------------------------------------------------------- header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(252, 250, 247, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}

.site-header[data-scrolled="true"] {
  border-bottom-color: var(--line-200);
  box-shadow: 0 8px 24px -22px rgba(15, 34, 38, 0.5);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--brand-800);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand:hover {
  color: var(--brand-900);
}

.brand__mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  background: var(--brand-700);
  color: var(--brand-100);
}

.brand--footer {
  color: var(--white);
  font-size: var(--fs-md);
}

.brand--footer .brand__mark {
  background: rgba(255, 255, 255, 0.14);
  color: var(--brand-100);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
}

.site-nav__list {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
}

.site-nav__list a {
  position: relative;
  display: inline-block;
  padding-block: 0.35rem;
  color: var(--ink-600);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  text-decoration: none;
}

.site-nav__list a::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 2px;
  border-radius: var(--r-full);
  background: var(--brand-600);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur) var(--ease);
}

.site-nav__list a:hover,
.site-nav__list a[aria-current="true"] {
  color: var(--brand-800);
}

.site-nav__list a:hover::after,
.site-nav__list a[aria-current="true"]::after {
  transform: scaleX(1);
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: var(--sp-3);
  min-height: 44px;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--line-300);
  border-radius: var(--r-full);
  background: var(--white);
  color: var(--ink-700);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
}

.nav-toggle__bars {
  display: grid;
  gap: 4px;
  width: 18px;
}

.nav-toggle__bars span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--ink-700);
  transition: transform var(--dur) var(--ease);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:first-child {
  transform: translateY(3px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:last-child {
  transform: translateY(-3px) rotate(-45deg);
}

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

.site-footer {
  background: var(--brand-900);
  color: var(--brand-200);
  padding-top: clamp(2.75rem, 6vw, 4rem);
}

.site-footer__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
  gap: var(--sp-7) var(--sp-6);
  padding-bottom: var(--sp-7);
}

.site-footer__tagline {
  margin-top: var(--sp-4);
  max-width: 28rem;
  color: var(--brand-200);
  font-size: var(--fs-sm);
  line-height: 1.6;
}

.site-footer__head {
  margin-bottom: var(--sp-4);
  color: var(--white);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.site-footer__col ul {
  display: grid;
  gap: var(--sp-3);
}

.site-footer__col a {
  color: var(--brand-200);
  font-size: var(--fs-sm);
  text-decoration: none;
}

.site-footer__col a:hover {
  color: var(--white);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.site-footer__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding-block: var(--sp-5);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--brand-300);
  font-size: var(--fs-xs);
}

.site-footer__note {
  max-width: 34rem;
}

/* ----------------------------------------------------------------- forms */

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

.field__label {
  color: var(--ink-800);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
}

.field__optional {
  color: var(--ink-400);
  font-weight: var(--fw-regular);
}

.field__control {
  width: 100%;
  min-height: 50px;
  padding: 0.7rem 1rem;
  background: var(--white);
  color: var(--ink-900);
  border: 1px solid var(--line-300);
  border-radius: var(--r-sm);
  font-size: var(--fs-md);
  transition: border-color var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease);
}

.field__control::placeholder {
  color: var(--ink-400);
}

.field__control:hover {
  border-color: var(--ink-300);
}

.field__control:focus-visible {
  border-color: var(--brand-600);
  box-shadow: 0 0 0 3px var(--brand-100);
}

.field__control[aria-invalid="true"] {
  border-color: var(--danger-line);
  background: var(--danger-100);
}

.field__hint {
  color: var(--ink-500);
  font-size: var(--fs-xs);
}

.field__error {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  color: var(--danger-800);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
}

select.field__control {
  appearance: none;
  padding-right: 2.75rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-500) 50%),
    linear-gradient(135deg, var(--ink-500) 50%, transparent 50%);
  background-position: calc(100% - 20px) 23px, calc(100% - 14px) 23px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.checkbox {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--sp-3);
  align-items: start;
}

.checkbox input {
  width: 22px;
  height: 22px;
  margin-top: 0.15rem;
  accent-color: var(--brand-700);
}

.checkbox label {
  color: var(--ink-600);
  font-size: var(--fs-sm);
}

.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* --------------------------------------------------------------- alerts */

.alert {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border: 1px solid;
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
}

.alert__title {
  color: inherit;
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
}

.alert__body {
  margin-top: var(--sp-1);
  line-height: 1.55;
}

.alert--error {
  background: var(--danger-100);
  border-color: var(--danger-line);
  color: var(--danger-800);
}

.alert--success {
  background: var(--success-100);
  border-color: var(--success-line);
  color: var(--success-800);
}

.alert--info {
  background: var(--brand-050);
  border-color: var(--brand-200);
  color: var(--brand-800);
}

.alert--warn {
  background: var(--warn-100);
  border-color: var(--warn-line);
  color: var(--warn-800);
}

/* ------------------------------------------------------------ accordion */

.faq {
  display: grid;
  gap: var(--sp-3);
  max-width: 52rem;
}

.faq__item {
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--line-200);
  border-radius: var(--r-md);
  transition: border-color var(--dur-fast) var(--ease);
}

.faq__item[open] {
  border-color: var(--brand-200);
}

.faq__q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-5);
  color: var(--ink-900);
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  list-style: none;
}

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

.faq__q::after {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--brand-600);
  border-bottom: 2px solid var(--brand-600);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform var(--dur) var(--ease);
}

.faq__item[open] .faq__q::after {
  transform: rotate(225deg) translate(-2px, -2px);
}

.faq__q:focus-visible {
  box-shadow: inset var(--focus-ring);
}

.faq__a {
  max-width: 62ch;
  padding: 0 var(--sp-5) var(--sp-5);
  color: var(--ink-500);
  font-size: var(--fs-sm);
  line-height: 1.65;
}

.faq__a > * + * {
  margin-top: var(--sp-3);
}

/* -------------------------------------------------------------- avatars */

.avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--r-full);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: 0.02em;
}

.avatar--a {
  background: var(--brand-100);
  color: var(--brand-800);
}

.avatar--b {
  background: var(--accent-100);
  color: var(--accent-700);
}

.avatar--c {
  background: var(--sand-200);
  color: var(--ink-700);
}

.avatar--d {
  background: var(--brand-700);
  color: var(--white);
}

/* --------------------------------------------------------- prose blocks */

.prose {
  max-width: 68ch;
}

.prose > * + * {
  margin-top: var(--sp-4);
}

.prose h2 {
  margin-top: var(--sp-8);
  font-size: var(--fs-xl);
}

.prose > h2:first-child {
  margin-top: 0;
}

.prose h3 {
  margin-top: var(--sp-6);
  font-size: var(--fs-md);
}

.prose p,
.prose li {
  color: var(--ink-600);
  font-size: var(--fs-sm);
  line-height: 1.68;
}

.prose ul {
  display: grid;
  gap: var(--sp-3);
}

.prose ul > li {
  position: relative;
  padding-left: var(--sp-6);
}

.prose ul > li::before {
  content: "";
  position: absolute;
  left: 0.25rem;
  top: 0.62rem;
  width: 7px;
  height: 7px;
  border-radius: var(--r-full);
  background: var(--brand-500);
}

.prose strong {
  color: var(--ink-800);
  font-weight: var(--fw-semibold);
}

/* -------------------------------------------------------- consent banner */

.consent {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 140;
  padding: var(--sp-4) var(--gutter);
  background: var(--brand-900);
  color: var(--brand-100);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.consent__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  max-width: var(--wrap);
  margin-inline: auto;
}

.consent__text {
  max-width: 62ch;
  color: var(--brand-200);
  font-size: var(--fs-sm);
  line-height: 1.55;
}

.consent__text a {
  color: var(--white);
}

.consent__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
}

/* Keep the footer clear of the fixed banner while it is showing. */
.consent ~ .site-footer {
  padding-bottom: 7rem;
}
