/* Google Sans Flex — weight 300 only */
@import url("https://fonts.googleapis.com/css2?family=Google+Sans+Flex:wght@300&display=swap");

/*
  Global stylesheet — single source of truth for the site.

  Structure:
    1) Reset and base
    2) Design tokens (:root) — palette and typography are owned by the
       `brand-guidelines` skill. Spacing, radii, shadows, motion, and layout
       tokens are owned here.
    3) Layout primitives
    4) Components (site-wide reusable primitives only — page-specific
       styles live with their page builds, not here)
    5) Utilities
*/

/* ===== 1) Reset and base ===== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===== 2) Design tokens ===== */
/* Palette and typography are written by the `brand-guidelines` skill from
   `build-assets/0-the-brand/tokens.json`. Spacing, radii, shadows, and
   transitions are owned here.

   Naming convention:
   - --color-*   implementation names (used by all component classes below)
   - --ah-*      brand-spec aliases (map to the same values; use in page CSS
                 when you want explicit brand semantics)
   - --sp-*      brand spacing scale (px values from the design spec)
*/
:root {
  /* ── Palette ── */
  --color-bg:           #120914;  /* Page Background — deep aubergine black */
  --color-surface:      #16121B;  /* Section / content area */
  --color-surface-soft: #1F1927;  /* Cards, panels */
  --color-elevated:     #2C2338;  /* Elevated cards, modals */
  --color-border:       #3D3150;  /* Dividers, outlines */
  --color-hover:        #554468;  /* Interactive hover states */
  --color-primary:      #D9927B;  /* Rose Gold — primary CTA, key highlights */
  --color-accent:       #E8C9A5;  /* Champagne — secondary highlights */
  --color-text:         #F8EFE8;  /* Cream — body text, headings on dark */
  --color-text-soft:    #AFA0B4;  /* Muted — secondary text, labels */
  --color-focus:        #D9927B;  /* Focus ring (matches primary) */

  /* --ah-* aliases — same values, explicit brand semantics */
  --ah-bg:           var(--color-bg);
  --ah-surface:      var(--color-surface);
  --ah-card:         var(--color-surface-soft);
  --ah-elevated:     var(--color-elevated);
  --ah-border:       var(--color-border);
  --ah-hover:        var(--color-hover);
  --ah-rose:         var(--color-primary);
  --ah-champagne:    var(--color-accent);
  --ah-cream:        var(--color-text);
  --ah-muted:        var(--color-text-soft);

  /* ── Typography ── */
  --font-heading: "Google Sans Flex", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-body:    "Google Sans Flex", "Segoe UI", "Helvetica Neue", Arial, sans-serif;

  /* Type scale (px — from brand spec) */
  --text-display: 96px;
  --text-h1:      72px;
  --text-h2:      64px;
  --text-h3:      48px;
  --text-h4:      40px;
  --text-xl:      32px;
  --text-l:       24px;
  --text-m:       20px;
  --text-s:       16px;
  --text-xs:      14px;

  /* ── Brand spacing scale (--sp-*) ── */
  --sp-xs:  16px;
  --sp-s:   24px;
  --sp-m:   32px;
  --sp-l:   64px;
  --sp-xl:  128px;
  --sp-xxl: 256px;

  /* ── Legacy spacing aliases (rem — for component classes below) ── */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;      /* = --sp-xs */
  --space-5:  1.25rem;
  --space-6:  1.5rem;    /* = --sp-s */
  --space-8:  2rem;      /* = --sp-m */
  --space-10: 2.5rem;
  --space-12: 3rem;

  /* ── Radii ── */
  --radius-sm:   0.5rem;
  --radius-md:   0.875rem;
  --radius-lg:   1.25rem;
  --radius-pill: 999px;

  /* ── Shadows (dark-mode aware — light glow, not dark drop) ── */
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.6);

  /* ── Motion ── */
  --transition-fast: 180ms ease;
  --transition-base: 260ms ease;

  /* ── Layout ── */
  --container-max: 72rem;
}

/* ===== 3) Layout primitives ===== */
.container {
  width: min(100% - 2rem, var(--container-max));
  margin-inline: auto;
}

.section {
  padding: var(--space-10) 0;
}

.grid {
  display: grid;
  gap: var(--space-4);
}

.grid-2 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(1, minmax(0, 1fr)); }

@media (min-width: 600px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ===== 4) Components ===== */

/* Site header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.site-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) 0;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 300;
  color: var(--color-text);
  letter-spacing: -0.03em;
}

.site-nav {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
}

.site-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

/* CMS-rendered menus — `{{menu.navigation}}` and `{{menu.footer}}` expand to
   <ul class="canvas-navigation-menu"> / <ul class="canvas-footer-menu"> with
   <li><a> children. Style the generated classes directly. */

.canvas-navigation-menu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

.canvas-navigation-menu > li {
  margin: 0;
}

.canvas-navigation-menu a {
  color: var(--color-text-soft);
  font-weight: 300;
  font-size: 0.95rem;
  letter-spacing: -0.03em;
  padding: var(--space-2) 0;
  border-bottom: 2px solid transparent;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.canvas-navigation-menu a:hover,
.canvas-navigation-menu a:focus-visible {
  color: var(--color-text);
  border-bottom-color: var(--color-primary);
}

.canvas-footer-menu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4) var(--space-6);
  margin: 0 0 var(--space-4);
  padding: 0;
  list-style: none;
}

.canvas-footer-menu > li {
  margin: 0;
}

.canvas-footer-menu a {
  color: var(--color-text-soft);
  font-size: 0.9rem;
  transition: color var(--transition-fast);
}

.canvas-footer-menu a:hover,
.canvas-footer-menu a:focus-visible {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) 0;
  color: var(--color-text-soft);
  font-size: 0.9rem;
}

.breadcrumb a {
  color: var(--color-primary);
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb-separator {
  color: var(--color-text-soft);
  opacity: 0.6;
}

.breadcrumb [aria-current="page"] {
  color: var(--color-text);
  font-weight: 300;
}

/* Buttons — pill-shaped, two variants: filled (primary) and ghost (secondary) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  text-decoration: none;
  white-space: nowrap;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: opacity var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast);
}

/* Sizes */
.btn-lg {
  font-size: 20px;
  padding: 16px 32px;
}

.btn,
.btn-md {
  font-size: 16px;
  padding: 12px 24px;
}

.btn-sm {
  font-size: 14px;
  padding: 8px 16px;
}

/* Filled — Rose Gold */
.btn-primary,
.btn-filled {
  background: var(--color-primary);
  color: var(--color-text);
}

.btn-primary:hover,
.btn-filled:hover {
  opacity: 0.88;
}

/* Ghost — transparent with border */
.btn-secondary,
.btn-ghost {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.btn-secondary:hover,
.btn-ghost:hover {
  border-color: var(--color-hover);
  background: rgba(255, 255, 255, 0.04);
}

.btn:focus-visible { outline-offset: 3px; }

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

.btn-block { width: 100%; }

/* Card */
.card {
  background: var(--color-surface-soft);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  padding: var(--space-5);
}

.card-title {
  margin: 0 0 var(--space-2);
  font-size: 1.08rem;
  letter-spacing: -0.03em;
}

.card-text {
  margin: 0;
  color: var(--color-text-soft);
}

/* Chip — pill-shaped tag */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-accent);
  font-size: 0.82rem;
  font-weight: 300;
  letter-spacing: -0.03em;
  border: 1px solid color-mix(in srgb, var(--color-accent) 30%, transparent);
}

.chip-row {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* Site footer */
.site-footer {
  padding: var(--space-10) 0;
  color: var(--color-text-soft);
  font-size: 0.9rem;
  border-top: 1px solid var(--color-border);
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.footer-legal a {
  color: var(--color-text-soft);
  font-size: 0.85rem;
  transition: color var(--transition-fast);
}

.footer-legal a:hover {
  color: var(--color-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ===== 5) Utilities ===== */
.text-center { text-align: center; }
.muted       { color: var(--color-text-soft); }

.mt-4  { margin-top: var(--space-4); }
.mt-6  { margin-top: var(--space-6); }
.mb-0  { margin-bottom: 0; }
.mb-4  { margin-bottom: var(--space-4); }
.mb-6  { margin-bottom: var(--space-6); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
