/*
 * Royalty Exchange design system: the single source of design tokens.
 *
 * Every brand token reads production's own Webflow variable first, with that
 * variable's current production value as the fallback:
 *
 *   --rex-purple: var(--core--colors--primary--primary-purple, #4e3bca);
 *
 * - In Webflow, site variables cross into code components' shadow roots, so a
 *   token edited in the Designer reaches the components with no code change.
 * - Anywhere else (local preview, mockups) the fallback applies.
 * - `npm run design:sync` pulls the live CSS and fails if any fallback no
 *   longer matches production. Run it after design changes in Webflow.
 *
 * Declared on both :root (pages, mockups) and :host (code-component shadow roots).
 *
 * House decisions that are deliberately NOT production variables:
 * - Corners are square everywhere (2026-10-06). Circles (radio dots) excepted.
 * - Spacing and motion are layout choices, kept as literal values.
 */

:host,
:host {
  /* ---- Fonts (prod loads Mona Sans 300–700 via Google Fonts) ---- */
  --rex-font: var(--globals--font--family--primary, "Mona Sans", sans-serif);

  /* ---- Brand ---- */
  --rex-purple: var(--core--colors--primary--primary-purple, #4e3bca);
  --rex-purple-deep: var(--core--colors--neutral--accent-10, #4227b8);
  --rex-purple-link: var(--core--colors--neutral--accent-11, #584dd1);
  /* Dark indigo for surfaces (tiles, dark cards). Not a heading color: prod
     headings are black (--rex-heading). */
  --rex-heading-ink: var(--core--colors--neutral--accent-12, #2a2667);
  --rex-blue: var(--core--color--blue, #4735ea);
  --rex-green: var(--core--color--green, #7af299);

  /* ---- Indigo-tinted neutrals ---- */
  --rex-bg: var(--core--colors--neutral--accent-1, #fdfdff);
  /* The page background itself (prod's body color), for full-screen
     sections that stand in for the page. Same value as --rex-bg today. */
  --rex-page-bg: var(--global--colors--background--background, #fdfdff);
  --rex-bg-2: var(--core--colors--neutral--accent-2, #f7f8ff);
  --rex-bg-interactive: var(--core--colors--neutral--accent-3, #eff1ff);
  --rex-bg-interactive-2: var(--core--colors--neutral--accent-4, #e4e7ff);
  --rex-border-tint: var(--core--colors--neutral--accent-6, #c8cdff);
  --rex-focus: var(--core--colors--neutral--accent-8, #999df9);

  /* ---- Gray ramp (Radix gray, as in prod) ---- */
  --rex-gray-1: var(--gray-1, #fcfcfd);
  --rex-gray-2: var(--gray-2, #f9f9fb);
  --rex-gray-3: var(--gray-3, #f0f0f3);
  --rex-gray-4: var(--gray-4, #e8e8ec);
  --rex-gray-6: var(--gray-6, #d9d9e0);
  --rex-gray-8: var(--gray-8, #b9bbc6);
  --rex-gray-9: var(--gray-9, #8b8d98);
  --rex-gray-10: var(--gray-10, #80838d);
  --rex-gray-11: var(--gray-11, #60646c);
  --rex-gray-12: var(--gray-12, #1c2024);
  --rex-text: var(--globals--colors--text--text-dark, black);
  /* Prod's h1–h6 set no color, so headings inherit body text: black. */
  --rex-heading: var(--globals--colors--text--text-dark, black);

  /* ---- Type scale (prod's h1/h2/h3/body/label rules) ---- */
  --rex-h1-size: 72px;
  --rex-h1-weight: 600;
  --rex-h1-tracking: -2px;
  --rex-h2-size: 48px;
  --rex-h2-weight: 600;
  --rex-h2-tracking: -1px;
  --rex-h3-size: 24px;
  --rex-h3-weight: 700;
  --rex-heading-line: 1.2;
  --rex-body-size: 16px;
  --rex-body-line: 1.4;
  --rex-lead-size: 18px;
  --rex-label-weight: 700;

  /* ---- Corners: square everywhere ---- */
  --rex-radius: 0;
  /* Kept so older names still resolve; all square. */
  --rex-radius-sm: var(--rex-radius);
  --rex-radius-md: var(--rex-radius);
  --rex-radius-lg: var(--rex-radius);
  --rex-radius-xl: var(--rex-radius);

  /* ---- Space scale (4 → 64) ---- */
  --rex-space-1: 4px;
  --rex-space-2: 8px;
  --rex-space-3: 12px;
  --rex-space-4: 16px;
  --rex-space-5: 24px;
  --rex-space-6: 32px;
  --rex-space-7: 40px;
  --rex-space-8: 48px;
  --rex-space-9: 64px;

  /* ---- Motion ---- */
  --rex-ease-snap: cubic-bezier(0.77, 0, 0.175, 1);
}

/*
 * Shared component styles, built only from design-system/tokens.css.
 * Used by pages (mockups) and inside code-component shadow roots alike.
 * Mirrors prod's `.button` / `.button.is-secondary`: square, 12px x 56px,
 * hard 3px offset shadow on hover, snappy easing.
 */

.rex-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: var(--rex-space-2);
  padding: 12px 56px;
  border: 2px solid transparent;
  border-radius: var(--rex-radius);
  background: var(--rex-purple);
  color: #fff;
  font-family: var(--rex-font);
  font-size: var(--rex-body-size);
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s var(--rex-ease-snap);
}

.rex-button:hover {
  box-shadow: 3px 3px 0 0 var(--rex-focus);
}

.rex-button.is-hero:hover {
  box-shadow: 3px 3px 0 0 var(--rex-green);
}

.rex-button.is-secondary {
  background: var(--rex-bg);
  border-color: var(--rex-purple);
  color: var(--rex-purple);
  font-weight: 600;
}

.rex-button.is-secondary:active {
  background: var(--rex-bg-interactive-2);
}

.rex-button.is-small {
  border: none;
  padding: 8px 12px;
  font-size: 14px;
  line-height: 1;
}

/*
 * Section wrapper, so a component carries its own page spacing and drops
 * onto a page with no Webflow section around it. Mirrors prod's
 * `.section-regular` (96px 5%, 72px at 767px) around `.container-large`
 * (80rem), and `.section-small` (24px 5%) with `.is-small`.
 *
 *   <div class="rex-section"><section class="rex-section-body …">…</section></div>
 *
 * The outer element is the container, so the 767px step follows the slot
 * width (like prod's viewport query). The body may itself be a container:
 * its own queries then measure the content width, as before.
 */

.rex-section {
  container: rex-section / inline-size;
  padding-inline: 5%;
}

.rex-section-body {
  max-width: 80rem;
  margin-inline: auto;
  padding-block: 96px;
}

.rex-section.is-small .rex-section-body {
  padding-block: 24px;
}

@container rex-section (max-width: 767px) {
  .rex-section:not(.is-small) .rex-section-body {
    padding-block: 72px;
  }
}

/*
 * Base styles for every code component's shadow root. Tokens and shared
 * component classes come from the central design system (../../design-system/),
 * loaded alongside this file by globals.webflow.ts.
 *
 * Shadow DOM: page classes don't reach in, so base element styles live here.
 * The font is set explicitly from the design system (prod's Mona Sans
 * variable) rather than inherited, so components render in Mona Sans even on
 * a page that doesn't set it on <body>.
 */

:host {
  display: block;
  font-family: var(--rex-font);
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4, p {
  margin: 0;
}

/* Site footer, matching the live footer-v1 (measured 2026-10-06). Live
   breakpoints (991 / 767 / 479px) are container queries on the root, so the
   footer follows the slot it's dropped in. Live sets the column headings in
   Open Sans; here they use the library font (Mona Sans). */

.sf-root {
  container: sf / inline-size;
}

.sf {
  padding: 64px 8px;
  background: #000;
  color: #fff;
  font-size: var(--rex-body-size);
  /* A length, not a ratio, so the 12px legal text inherits live's 22.4px
     line height (body: 16px / 140%). */
  line-height: calc(var(--rex-body-size) * var(--rex-body-line));
}

.sf a {
  color: #fff;
  text-decoration: none;
}

.sf-container {
  max-width: 80rem;
  margin: 0 auto;
}

.sf-grid {
  display: grid;
  grid-template-columns: 2.25fr 3.5fr;
  gap: var(--rex-space-4);
}

/* ---- Logo, tagline, social ---- */

.sf-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--rex-space-6);
}

.sf-logo {
  display: block;
  max-height: 60px;
}

.sf-logo img {
  display: block;
  width: 256px;
  height: auto;
}

.sf-social {
  display: flex;
  align-items: center;
}

.sf-social-link {
  display: block;
  margin: 0 var(--rex-space-2);
  padding: var(--rex-space-2);
  opacity: 0.8;
}

.sf-social-link:hover {
  opacity: 1;
}

.sf-social-link img {
  display: block;
  width: 32px;
  height: 32px;
}

/* ---- Link columns ---- */

.sf-columns {
  display: flex;
  margin-bottom: var(--rex-space-6);
  padding-left: 40px;
}

.sf-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 33.3333%;
  margin-bottom: var(--rex-space-4);
  padding: 0 10px;
}

.sf-heading {
  margin-bottom: 20px;
  color: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -1px;
}

.sf-link {
  display: block;
  margin-bottom: var(--rex-space-1);
  padding: var(--rex-space-2) var(--rex-space-2) var(--rex-space-2) 0;
  font-size: 16px;
  opacity: 0.8;
  transition: all 0.15s cubic-bezier(0.785, 0.135, 0.15, 0.86);
}

.sf-link:hover {
  opacity: 1;
  transform: translateX(4px);
}

/* ---- Legal rows ---- */

.sf-divider {
  height: 1px;
  background: var(--rex-gray-12);
}

.sf-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--rex-space-4) 0;
}

.sf-legal,
.sf-legal-links,
.sf-disclosure {
  font-size: 12px;
  text-align: left;
}

.sf-legal-links {
  color: var(--rex-gray-9);
}

/* Cookie Preferences opens Termly's panel, so it's a button styled like
   the links beside it. */
.sf-legal-button {
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  font: inherit;
  cursor: pointer;
}

.sf-legal-links a:hover,
.sf-legal-button:hover {
  text-decoration: underline;
}

.sf-legal-button:focus-visible {
  outline: 2px solid var(--rex-focus);
  outline-offset: 2px;
}

.sf-disclosure {
  color: var(--rex-gray-10);
}

@container sf (max-width: 991px) {
  .sf-grid {
    grid-template-columns: 1fr;
    gap: var(--rex-space-5);
  }

  .sf-brand {
    align-items: center;
  }

  .sf-columns {
    padding-left: 80px;
  }

  .sf-link {
    font-size: 14px;
  }

  .sf-legal,
  .sf-legal-links,
  .sf-disclosure {
    padding: 0 10px;
  }
}

@container sf (max-width: 767px) {
  .sf {
    padding-left: var(--rex-space-4);
    padding-right: var(--rex-space-4);
  }

  .sf-brand {
    align-items: flex-start;
  }

  /* Live's Webflow grid columns stack here. */
  .sf-columns {
    flex-direction: column;
    padding-left: 24px;
  }

  .sf-col {
    width: 100%;
  }

  .sf-row {
    flex-direction: column;
    gap: var(--rex-space-4);
  }
}

@container sf (max-width: 479px) {
  .sf {
    padding-left: var(--rex-space-2);
    padding-right: var(--rex-space-2);
  }

  .sf-logo {
    height: 60px;
  }

  .sf-columns {
    margin-bottom: 0;
    padding-left: 0;
  }

  .sf-heading {
    margin-top: 20px;
  }

  .sf-row {
    gap: var(--rex-space-5);
  }
}

