/* ==========================================================================
   Arthur Labs — base + components (ART-298)
   Requires css/tokens.css. Class prefix `al-` keeps these from colliding
   with the current landing.css while the redesign migrates page by page.
   ========================================================================== */

/* ---- Base --------------------------------------------------------------- */
.al-base,
.al-base *,
.al-base *::before,
.al-base *::after {
  box-sizing: border-box;
}

.al-base {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.al-base :focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.al-container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---- Type helpers ------------------------------------------------------- */
.al-display { font-size: var(--text-4xl); line-height: var(--leading-tight); letter-spacing: var(--tracking-tight); font-weight: var(--weight-semibold); margin: 0; text-wrap: balance; }
.al-h1      { font-size: var(--text-3xl); line-height: var(--leading-tight); letter-spacing: var(--tracking-tight); font-weight: var(--weight-semibold); margin: 0; text-wrap: balance; }
.al-h2      { font-size: var(--text-2xl); line-height: var(--leading-snug);  letter-spacing: var(--tracking-tight); font-weight: var(--weight-semibold); margin: 0; }
.al-h3      { font-size: var(--text-xl);  line-height: var(--leading-snug);  font-weight: var(--weight-semibold); margin: 0; }
.al-lead    { font-size: var(--text-lg);  color: var(--color-text-muted); max-width: 62ch; margin: 0; }
.al-body    { font-size: var(--text-base); margin: 0; }
.al-small   { font-size: var(--text-sm);  color: var(--color-text-muted); }
.al-eyebrow {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-accent);
  margin: 0;
}

/* ---- Brand (wordmark lockup) ------------------------------------------- */
.al-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text);
  text-decoration: none;
  font-weight: var(--weight-semibold);
  font-size: var(--text-base);
  letter-spacing: -0.01em;
}
.al-brand__mark { width: 28px; height: 28px; flex: none; color: var(--color-text); }
.al-brand__mark .al-mark-dot { fill: var(--color-accent); }
.al-brand__name span { color: var(--color-text-muted); font-weight: var(--weight-medium); }

/* ---- Button ------------------------------------------------------------- */
.al-btn {
  --_bg: transparent;
  --_fg: var(--color-text);
  --_bd: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;                  /* touch target */
  padding: 0 var(--space-5);
  border: 1px solid var(--_bd);
  border-radius: var(--radius-md);
  background: var(--_bg);
  color: var(--_fg);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out);
}
.al-btn:active { transform: translateY(1px); }
.al-btn[disabled], .al-btn[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }

.al-btn--primary   { --_bg: var(--color-accent); --_fg: var(--color-on-accent); }
.al-btn--primary:hover { --_bg: var(--color-accent-hover); }

.al-btn--secondary { --_bg: var(--color-surface); --_bd: var(--color-border-strong); }
.al-btn--secondary:hover { --_bd: var(--color-text-subtle); --_bg: var(--color-surface-sunken); }

.al-btn--sm { min-height: 36px; padding: 0 var(--space-3); }

/* ---- Badge -------------------------------------------------------------- */
.al-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-surface-sunken);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  line-height: 1.6;
  white-space: nowrap;
}
.al-badge--accent {
  border-color: transparent;
  background: var(--color-accent-soft);
  color: var(--color-accent);
}
.al-badge__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---- Card --------------------------------------------------------------- */
.al-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out);
}
.al-card--interactive:hover,
.al-card--interactive:focus-within {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-md);
}
.al-card__title { font-size: var(--text-xl); font-weight: var(--weight-semibold); line-height: var(--leading-snug); margin: 0; }
.al-card__body  { color: var(--color-text-muted); margin: 0; flex: 1; }
.al-card__footer { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-2); }

/* ---- Section header ----------------------------------------------------- */
.al-section-header {
  display: grid;
  gap: var(--space-3);
  max-width: 640px;
  margin-bottom: var(--space-10);
}
.al-section-header--center { margin-inline: auto; text-align: center; justify-items: center; }
.al-section-header p:last-child { color: var(--color-text-muted); font-size: var(--text-lg); margin: 0; }

/* ---- Nav ---------------------------------------------------------------- */
.al-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--color-bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--color-border);
}
.al-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 64px;
}
.al-nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  list-style: none;
  margin: 0;
  padding: 0;
}
.al-nav__link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  text-decoration: none;
  transition: color var(--duration-fast), background-color var(--duration-fast);
}
.al-nav__link:hover,
.al-nav__link[aria-current="page"] { color: var(--color-text); background: var(--color-surface-sunken); }
.al-nav__toggle { display: none; }

@media (max-width: 640px) {
  .al-nav__toggle { display: inline-flex; }
  .al-nav__links {
    display: none;
    position: absolute;
    inset: 64px 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-2) var(--gutter) var(--space-4);
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
  }
  .al-nav[data-open="true"] .al-nav__links { display: flex; }
  .al-nav__link { min-height: 44px; }
}
