/* scales.css — the static scales that never vary per site: space, radius,
   type ramp, and the class vocabulary styleKeys.ts maps onto. Per-site values
   (colors, fonts) arrive as CSS custom properties from theme.ts.

   Design defaults live here too: hero/nav/footer treatments keyed off
   data-region-role, the background-image overlay, card elevation. The spec
   says WHAT (roles, scales); this file owns HOW it looks. */

:root {
  --space-none: 0;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.75rem;
  --space-lg: 3.25rem;
  --space-xl: 6rem;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgb(15 23 42 / 0.06), 0 4px 12px rgb(15 23 42 / 0.05);
  --shadow-md: 0 2px 4px rgb(15 23 42 / 0.06), 0 12px 32px rgb(15 23 42 / 0.1);
}

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  color: var(--color-on-surface);
  background: var(--color-surface);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* generated copy is untrusted: a long unbroken token must wrap, not overflow */
  overflow-wrap: break-word;
}

.container {
  width: 100%;
  max-width: 74rem;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

a:focus-visible,
.cta:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ── color roles ── */
.bg-primary {
  background: var(--color-primary);
}
.bg-secondary {
  background: var(--color-secondary);
}
.bg-accent {
  background: var(--color-accent);
}
.bg-surface {
  background: var(--color-surface);
}
.bg-muted {
  background: var(--color-muted);
}
.fg-primary {
  color: var(--color-primary);
}
.fg-secondary {
  color: var(--color-secondary);
}
.fg-accent {
  color: var(--color-accent);
}
.fg-muted {
  color: var(--color-muted);
}
.fg-on-primary {
  color: var(--color-on-primary);
}
.fg-on-surface {
  color: var(--color-on-surface);
}

/* ── type ramp ── */
.heading,
.text {
  margin: 0;
}
.heading {
  font-family: var(--font-heading);
}
.type-display {
  font-size: clamp(2.5rem, 4.5vw + 1rem, 4rem);
  line-height: 1.06;
  font-weight: 800;
  letter-spacing: -0.025em;
}
.type-title {
  font-size: clamp(1.75rem, 2.5vw + 0.5rem, 2.5rem);
  line-height: 1.15;
  font-weight: 750;
  letter-spacing: -0.015em;
}
.type-subtitle {
  font-size: 1.3125rem;
  line-height: 1.35;
  font-weight: 700;
}
.type-body {
  font-size: 1.0625rem;
  max-width: 42rem;
}
.type-caption {
  font-size: 0.875rem;
  opacity: 0.75;
}
.type-eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

/* ── layout primitives ── */
.section {
  position: relative;
}
.section .container {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}
.pad-none {
  padding-block: 0;
}
.pad-xs {
  padding-block: var(--space-xs);
}
.pad-sm {
  padding-block: var(--space-sm);
}
.pad-md {
  padding-block: var(--space-md);
}
.pad-lg {
  padding-block: var(--space-lg);
}
.pad-xl {
  padding-block: var(--space-xl);
}

/* full-bleed background image + renderer-owned overlay for legibility */
.has-bg {
  background-size: cover;
  background-position: center;
}
.has-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgb(8 12 24 / 0.55),
    rgb(8 12 24 / 0.75)
  );
}
.has-bg .container {
  position: relative;
}

.stack {
  display: flex;
  min-width: 0;
}
/* children stretch (flex default) — the page root is a stack of sections and
   they must span the viewport; fit-content pieces (badges) opt out themselves */
.stack-v {
  flex-direction: column;
}
.stack-h {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.align-center {
  align-items: center;
  text-align: center;
}
.align-center .type-body {
  margin-inline: auto;
}
.gap-none {
  gap: var(--space-none);
}
.gap-xs {
  gap: var(--space-xs);
}
.gap-sm {
  gap: var(--space-sm);
}
.gap-md {
  gap: var(--space-md);
}
.gap-lg {
  gap: var(--space-lg);
}
.gap-xl {
  gap: var(--space-xl);
}

.grid,
.repeater {
  display: grid;
  align-items: start;
}
.cols-1 {
  grid-template-columns: 1fr;
}
.cols-2 {
  grid-template-columns: repeat(2, 1fr);
}
.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}
.cols-4 {
  grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 720px) {
  .grid,
  .repeater {
    grid-template-columns: 1fr;
  }
  .cols-m-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── cards ── */
.card {
  --card-pad: var(--space-md);
  border-radius: var(--radius);
  /* derived from the theme's text color so dark themes get a light border */
  border: 1px solid color-mix(in srgb, var(--color-on-surface) 10%, transparent);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: var(--card-pad);
  transition:
    box-shadow 0.2s ease,
    transform 0.2s ease;
}
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.card.pad-none {
  --card-pad: 0;
}
.card.pad-xs {
  --card-pad: var(--space-xs);
}
.card.pad-sm {
  --card-pad: var(--space-sm);
}
.card.pad-lg {
  --card-pad: var(--space-lg);
}
.card.pad-xl {
  --card-pad: var(--space-xl);
}
/* a leading image bleeds to the card edges */
.card > .image:first-child {
  width: calc(100% + 2 * var(--card-pad));
  margin: calc(-1 * var(--card-pad));
  margin-bottom: var(--space-xs);
  border-radius: 0;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

/* ── small pieces ── */
.badge {
  display: inline-block;
  width: fit-content;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.badge.bg-primary,
.badge.bg-secondary,
.badge.bg-accent {
  color: var(--color-on-primary);
}
.badge.bg-surface,
.badge.bg-muted {
  color: var(--color-on-surface);
}

.divider {
  border: 0;
  border-top: 1px solid color-mix(in srgb, currentColor 18%, transparent);
  width: 100%;
}
.sp-none {
  margin-block: 0;
}
.sp-xs {
  margin-block: var(--space-xs);
}
.sp-sm {
  margin-block: var(--space-sm);
}
.sp-md {
  margin-block: var(--space-md);
}
.sp-lg {
  margin-block: var(--space-lg);
}
.sp-xl {
  margin-block: var(--space-xl);
}

.image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  object-fit: cover;
}

.link {
  color: inherit;
  font-weight: 600;
  text-decoration: none;
}
.link:hover {
  color: var(--color-accent);
}

/* ── CTAs ── */
.cta-group {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}
.cta {
  display: inline-block;
  padding: 0.8rem 1.7rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  border: 2px solid transparent;
  transition:
    transform 0.15s ease,
    filter 0.15s ease,
    box-shadow 0.15s ease;
}
.cta:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}
.cta-primary {
  background: var(--color-accent);
  color: var(--color-on-primary);
  box-shadow: 0 6px 18px
    color-mix(in srgb, var(--color-accent) 35%, transparent);
}
.cta-secondary {
  background: transparent;
  color: inherit;
  border-color: color-mix(in srgb, currentColor 50%, transparent);
}
.cta-secondary:hover {
  border-color: currentColor;
}

/* ── region-role design defaults ── */
/* Hero: tall, vertically centered, copy constrained for measure. */
.section[data-region-role="hero"] {
  min-height: min(42rem, 78vh);
  display: flex;
  align-items: center;
}
.section[data-region-role="hero"] .container {
  width: 100%;
}
.section[data-region-role="hero"] .stack {
  max-width: 42rem;
}
.section[data-region-role="hero"] .type-body {
  font-size: 1.1875rem;
}

/* Nav: sticky, elevated, compact uppercase links. */
.section[data-region-role="nav"] {
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow:
    0 1px 0 rgb(15 23 42 / 0.07),
    0 4px 16px rgb(15 23 42 / 0.04);
}
.section[data-region-role="nav"] .link {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}
.section[data-region-role="nav"] .type-title {
  font-size: 1.375rem;
}
.section[data-region-role="nav"] .cta {
  padding: 0.55rem 1.25rem;
  font-size: 0.85rem;
}

/* CTA band: generous and centered reads as intentional. */
.section[data-region-role="cta"] .type-title {
  font-size: clamp(2rem, 3vw + 0.5rem, 3rem);
}

/* Footer: quieter type. */
.section[data-region-role="footer"] {
  font-size: 0.9375rem;
}
.section[data-region-role="footer"] .link:hover {
  color: inherit;
  text-decoration: underline;
}
