/* === Container === */
.container {
  max-width: 1240px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--s-space-gutter);
  padding-right: var(--s-space-gutter);
  width: 100%;
}
.container--narrow { max-width: 760px; }
.container--wide   { max-width: 1440px; }

@media (max-width: 640px) {
  .container {
    padding-left: var(--s-space-md);
    padding-right: var(--s-space-md);
  }
}

/* === Section === */
.section {
  padding-block: var(--s-space-section-y);
  background: var(--s-surface-base);
  color: var(--s-text-primary);
}
.section--sunken  { background: var(--s-surface-sunken); }
.section--depth   { background: var(--s-surface-depth); }
.section--inverse {
  background: var(--s-surface-inverse);
  color: var(--s-text-inverse);
}
.section--compact {
  padding-block: var(--s-space-3xl);
}

/* The section header pattern (eyebrow + headline + sub) */
.section__header {
  max-width: 720px;
  margin-bottom: var(--s-space-2xl);
}
.section__eyebrow {
  font-size: var(--p-text-13);
  font-weight: var(--p-weight-semibold);
  letter-spacing: var(--p-ls-wider);
  text-transform: uppercase;
  color: var(--s-text-brand);
  margin-bottom: var(--s-space-sm);
}
.section__sub {
  font-size: var(--p-text-18);
  color: var(--s-text-muted);
  line-height: var(--p-lh-body);
  max-width: 600px;
  margin-top: var(--s-space-sm);
}

/* === Nav === */
.nav {
  position: sticky;
  top: 0;
  z-index: var(--p-z-sticky);
  background: rgba(249, 246, 243, 0.85);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--s-border-subtle);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.nav__brand {
  font-family: var(--p-font-display);
  font-size: var(--p-text-22);
  font-weight: var(--p-weight-medium);
  letter-spacing: var(--p-ls-snug);
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--s-text-primary);
}

.nav__brand-mark {
  width: 32px;
  height: 32px;
  border-radius: var(--s-radius-control);
  background: var(--s-action-primary-bg);
  color: var(--s-text-inverse);
  display: grid;
  place-items: center;
  font-family: var(--p-font-display);
  font-weight: var(--p-weight-semibold);
  font-size: var(--p-text-15);
}

.nav__links {
  display: flex;
  gap: var(--s-space-xl);
  align-items: center;
}
.nav__links a {
  font-size: var(--p-text-15);
  font-weight: var(--p-weight-medium);
  color: var(--s-text-muted);
  transition: color var(--s-motion-hover);
  text-decoration: none;
}
.nav__links a:hover,
.nav__links a[aria-current="page"] {
  color: var(--s-text-primary);
}
.nav__links a:focus-visible {
  outline: 2px solid var(--s-action-primary-bg);
  outline-offset: 4px;
  border-radius: 2px;
}

@media (max-width: 900px) {
  .nav__links { display: none; }
  /* TODO: mobile menu — drawer + hamburger button. Spec when first needed. */
}

/* === Footer === */
.footer {
  background: var(--s-surface-sunken);
  padding-block: var(--s-space-3xl) var(--s-space-xl);
  border-top: 1px solid var(--s-border-subtle);
}

.footer__top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: var(--s-space-xl);
  padding-bottom: var(--s-space-2xl);
  border-bottom: 1px solid var(--s-border-muted);
}

.footer__bio {
  font-family: var(--p-font-display);
  font-size: var(--p-text-22);
  font-weight: var(--p-weight-regular);
  line-height: 1.25;
  letter-spacing: var(--p-ls-snug);
  max-width: 380px;
  color: var(--s-text-primary);
}

.footer__col-title {
  font-size: var(--p-text-12);
  letter-spacing: var(--p-ls-wider);
  text-transform: uppercase;
  color: var(--s-text-muted);
  margin: 8px 0 18px;
  font-weight: var(--p-weight-semibold);
}

.footer__col a {
  display: block;
  font-size: var(--p-text-15);
  color: var(--s-text-primary);
  padding: 6px 0;
  transition: color var(--s-motion-hover);
  text-decoration: none;
}
.footer__col a:hover { color: var(--s-text-brand); }
.footer__col a:focus-visible {
  outline: 2px solid var(--s-action-primary-bg);
  outline-offset: 2px;
  border-radius: 2px;
}

.footer__markets {
  padding-block: var(--s-space-xl);
  border-bottom: 1px solid var(--s-border-muted);
}
.footer__markets-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.footer__legal {
  padding-top: var(--s-space-lg);
  display: flex;
  justify-content: space-between;
  font-size: var(--p-text-13);
  color: var(--s-text-soft);
}
.footer__legal a {
  color: var(--s-text-soft);
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (max-width: 900px) {
  .footer__top { grid-template-columns: 1fr 1fr; }
  .footer__legal {
    flex-direction: column;
    gap: var(--s-space-sm);
  }
}

/* === Button === */
.btn {
  /* layout */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-space-xs);

  /* shape (pill — ADR-0004) */
  border-radius: var(--s-radius-control);
  border: 0;

  /* sizing — defaults to md */
  padding: var(--s-space-sm) var(--s-space-lg);
  min-height: 44px; /* tap target */

  /* type */
  font-family: var(--p-font-body);
  font-weight: var(--p-weight-semibold);
  font-size: var(--p-text-15);
  line-height: 1;
  white-space: nowrap;

  /* motion */
  transition: background-color var(--s-motion-hover),
              color var(--s-motion-hover),
              border-color var(--s-motion-hover),
              box-shadow var(--s-motion-hover),
              transform var(--s-motion-press);
  cursor: pointer;

  text-decoration: none; /* when used as <a> */
}

.btn:focus-visible {
  outline: 2px solid var(--s-action-primary-bg);
  outline-offset: 3px;
}

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

/* variant · primary */
.btn--primary {
  background: var(--s-action-primary-bg);
  color: var(--s-action-primary-fg);
  box-shadow: var(--s-shadow-sm);
}
.btn--primary:hover {
  background: var(--s-action-primary-bg-hover);
  box-shadow: var(--s-shadow-md);
  transform: translateY(-1px);
}
.btn--primary:active {
  transform: translateY(0);
  box-shadow: var(--s-shadow-sm);
}

/* variant · ghost */
.btn--ghost {
  background: var(--s-action-ghost-bg);
  color: var(--s-action-ghost-fg);
  border: 1.5px solid var(--s-action-ghost-border);
}
.btn--ghost:hover {
  background: var(--s-action-ghost-bg-hover);
  border-color: var(--s-action-ghost-border-hover);
}

/* size · sm */
.btn--sm {
  padding: var(--s-space-xs) var(--s-space-md);
  font-size: var(--p-text-13);
  min-height: 36px;
}

/* size · lg */
.btn--lg {
  padding: var(--s-space-md) var(--s-space-xl);
  font-size: var(--p-text-17);
  min-height: 52px;
}

/* icon */
.btn__icon {
  flex-shrink: 0;
}

/* respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .btn { transition: background-color 0ms, color 0ms; }
  .btn--primary:hover { transform: none; }
}

/* === Chip === */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s-space-xs);

  padding: var(--p-size-1) var(--s-space-md);
  border-radius: var(--s-radius-control);

  font-family: var(--p-font-body);
  font-weight: var(--p-weight-semibold);
  font-size: var(--p-text-13);
  line-height: 1.4;

  background: var(--s-surface-sunken);
  color: var(--s-text-muted);
  border: 1px solid transparent;

  transition: background-color var(--s-motion-hover),
              color var(--s-motion-hover),
              border-color var(--s-motion-hover);

  text-decoration: none;
  white-space: nowrap;
}

/* variant · eyebrow (default, slightly bigger pad) */
.chip--eyebrow {
  padding: 6px 14px;
  background: var(--s-surface-sunken);
}

.chip__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--s-accent-strong);
  box-shadow: 0 0 0 4px rgba(197, 58, 31, 0.15);
}

/* variant · market (clickable) */
.chip--market {
  background: var(--s-surface-raised);
  color: var(--s-text-muted);
  border-color: var(--s-border-subtle);
  cursor: pointer;
  padding: 6px 14px;
}
.chip--market:hover {
  background: var(--s-action-primary-bg);
  color: var(--s-text-inverse);
  border-color: var(--s-action-primary-bg);
}
.chip--market:focus-visible {
  outline: 2px solid var(--s-action-primary-bg);
  outline-offset: 2px;
}

/* variant · tag (static, smaller) */
.chip--tag {
  font-size: var(--p-text-12);
  letter-spacing: var(--p-ls-wider);
  text-transform: uppercase;
  padding: 4px 10px;
  background: transparent;
  border-color: var(--s-border-muted);
  color: var(--s-text-muted);
}

/* size · sm */
.chip--sm {
  font-size: var(--p-text-12);
  padding: 3px 10px;
}

/* === Input === */
/* base input — drops borders, lets the wrapper handle shape */
.input {
  font-family: var(--p-font-body);
  font-size: var(--p-text-16);
  line-height: var(--p-lh-body);
  color: var(--s-text-primary);
  background: transparent;
  border: 0;
  outline: 0;
  padding: var(--s-space-md) var(--s-space-lg);
  width: 100%;
  min-width: 0; /* allow flex shrink */
}
.input::placeholder { color: var(--s-text-soft); }
.input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* field — wraps a bare input with a label */
.field { display: flex; flex-direction: column; gap: var(--s-space-xs); }
.field__label {
  font-size: var(--p-text-13);
  font-weight: var(--p-weight-semibold);
  letter-spacing: var(--p-ls-wider);
  text-transform: uppercase;
  color: var(--s-text-muted);
}
.field .input {
  background: var(--s-surface-raised);
  border: 1px solid var(--s-border-subtle);
  border-radius: var(--s-radius-subtle);
  padding: var(--s-space-md);
}
.field .input:focus {
  border-color: var(--s-action-primary-bg);
  box-shadow: 0 0 0 3px rgba(63, 74, 40, 0.15);
}

/* input-card — the standalone conversion pattern */
.input-card {
  background: var(--s-surface-raised);
  border: 1px solid rgba(27, 22, 36, 0.04);
  border-radius: var(--s-radius-card);
  box-shadow: var(--s-shadow-lg);
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 540px;
}
.input-card:focus-within {
  outline: 2px solid var(--s-action-primary-bg);
  outline-offset: 2px;
}
.input-card__icon {
  width: 22px;
  height: 22px;
  margin-left: 14px;
  color: var(--s-text-soft);
  flex-shrink: 0;
}
.input-card .btn { flex-shrink: 0; }

/* input-card · dark variant */
.input-card--dark {
  background: rgba(249, 246, 243, 0.07);
  border: 1px solid rgba(249, 246, 243, 0.12);
  border-radius: var(--s-radius-control); /* pill on dark */
  box-shadow: none;
  padding: 6px;
}
.input-card--dark .input { color: var(--s-text-inverse); padding: var(--s-space-sm) var(--s-space-lg); }
.input-card--dark .input::placeholder { color: rgba(249, 246, 243, 0.45); }
.input-card--dark .btn--primary {
  background: var(--s-text-inverse);
  color: var(--s-text-primary);
}
.input-card--dark .btn--primary:hover {
  background: var(--s-accent-warm);
}

/* === Card === */
.card {
  background: var(--s-surface-raised);
  border-radius: var(--s-radius-card);
  border: 1px solid var(--s-border-subtle);
  box-shadow: var(--s-shadow-sm);
  padding: var(--s-space-2xl) var(--s-space-xl);
  display: flex;
  flex-direction: column;
  transition: transform var(--s-motion-hover),
              box-shadow var(--s-motion-hover);
  text-decoration: none;
  color: inherit;
}

/* Layout: any p inside the card gets a flex spacer above the trailing link */
.card > p {
  color: var(--s-text-muted);
  font-size: var(--p-text-15);
  margin: 0 0 var(--s-space-lg);
  flex: 1;
}
.card > h3, .card > h2 { margin: 0 0 var(--s-space-sm); }

/* variant · hover (use when the entire card is clickable / a link) */
.card--hover {
  cursor: pointer;
}
.card--hover:hover {
  transform: translateY(-4px);
  box-shadow: var(--s-shadow-lg);
}
.card--hover:focus-visible {
  outline: 2px solid var(--s-action-primary-bg);
  outline-offset: 4px;
}

/* leading icon block (52px circle/square with tone) */
.card__icon {
  width: 52px;
  height: 52px;
  border-radius: var(--s-radius-panel);
  display: grid;
  place-items: center;
  margin-bottom: var(--s-space-lg);
  font-family: var(--p-font-display);
  font-weight: var(--p-weight-medium);
  font-size: var(--p-text-22);
}
.card__icon[data-tone="olive"] { background: var(--p-olive-100); color: var(--s-action-primary-bg); }
.card__icon[data-tone="coral"] { background: #fce8d4; color: var(--s-accent-strong); }
.card__icon[data-tone="yellow"] { background: #fdf0d0; color: #8a6a14; }

/* trailing link affordance (the "→" arrow that nudges on hover) */
.card__link {
  font-weight: var(--p-weight-semibold);
  font-size: var(--p-text-14);
  color: var(--s-text-brand);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  align-self: flex-start;
}
.card__link::after {
  content: "→";
  transition: transform var(--s-motion-hover);
}
.card--hover:hover .card__link::after { transform: translateX(4px); }

/* variant · dark (rare — when card must live on inverse surface) */
.card--dark {
  background: rgba(249, 246, 243, 0.08);
  border-color: rgba(249, 246, 243, 0.12);
  color: var(--s-text-inverse);
  box-shadow: none;
}

/* === EmphasisHighlight === */
/* italic emphasis (no decoration — just the italic axis) */
em, .emph--italic {
  font-style: italic;
  font-weight: inherit;
}

/* squiggle under an italicized word */
.emph--squiggle {
  position: relative;
  white-space: nowrap;
  font-style: italic;
}
.emph__squiggle {
  position: absolute;
  left: -4px;
  right: -4px;
  bottom: -10px;
  width: calc(100% + 8px);
  height: 14px;
  color: var(--s-accent-strong);
  pointer-events: none;
}

/* yellow highlight band behind text */
.emph--highlight {
  background: linear-gradient(
    transparent 65%,
    var(--s-accent-warm) 65%,
    var(--s-accent-warm) 92%,
    transparent 92%
  );
  padding: 0 4px;
}

