/* durangoadvisors-site marketing design system
   See DESIGN.md and STYLE.md at repo root for rationale.
   RMCF client area uses its own inline system; do not import this there. */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }
input, textarea, select, button { font: inherit; color: inherit; }
a { color: inherit; }

/* ---------- Tokens ---------- */
:root {
  /* Color (OKLCH source, hex output for stability) */
  --ink:          #23201a;   /* primary text on light */
  --charcoal:     #3d3830;   /* headings on light */
  --ash:          #8a8478;   /* secondary / meta */
  --mist:         #ece7dc;   /* page background */
  --cream:        #f6f1e6;   /* raised surfaces */
  --paper:        #fbf7ee;   /* card surface lighter than cream */
  --rule:         #d9d2c2;   /* hairline divider */
  --gold:         #c9a24a;   /* single accent */
  --gold-deep:    #a8842f;   /* accent on light bg for contrast */
  --gold-tint:    #f0e3c4;   /* accent wash */
  --danger:       #a8401a;   /* form error, sparingly */
  --photo-tint:   rgba(35, 32, 26, 0.42);

  /* Type */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-sans:    'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --text-display: clamp(2.6rem, 5.2vw, 4rem);
  --text-h1:      clamp(1.9rem, 3.4vw, 2.6rem);
  --text-h2:      clamp(1.35rem, 2vw, 1.55rem);
  --text-h3:      1.15rem;
  --text-lead:    clamp(1.1rem, 1.5vw, 1.25rem);
  --text-body:    1.0625rem;
  --text-meta:    0.875rem;
  --text-micro:   0.75rem;

  /* Space (rem) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Layout */
  --container:    64rem;
  --container-narrow: 44rem;

  /* Motion - emil-design-eng curves */
  --ease-out:     cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out:  cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer:  cubic-bezier(0.32, 0.72, 0, 1);
  --dur-fast:     120ms;
  --dur-base:     200ms;
  --dur-slow:     320ms;
}

/* ---------- Base ---------- */
html, body {
  min-height: 100%;
  background: var(--mist);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: 1.65;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--gold-tint);
  color: var(--ink);
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  font-optical-sizing: auto;
  font-variation-settings: "SOFT" 30, "WONK" 0;
  color: var(--charcoal);
  line-height: 1.15;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h1.display {
  font-size: var(--text-display);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.02;
}

h1 { font-size: var(--text-h1); }
h2 { font-size: var(--text-h2); letter-spacing: -0.01em; }
h3 { font-size: var(--text-h3); letter-spacing: 0; font-weight: 600; }

p {
  max-width: 68ch;
  text-wrap: pretty;
}

p + p, p + ul, ul + p, p + h2, ul + h2 { margin-top: var(--space-4); }
h2 + p, h2 + ul, h3 + p { margin-top: var(--space-3); }

.lead {
  font-size: var(--text-lead);
  line-height: 1.5;
  color: var(--charcoal);
  font-weight: 400;
  max-width: 56ch;
}

.eyebrow {
  font-family: var(--font-sans);
  font-size: var(--text-micro);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ash);
}

.meta {
  font-size: var(--text-meta);
  color: var(--ash);
}

strong { font-weight: 600; color: var(--charcoal); }
em { font-style: italic; }

/* ---------- Links ---------- */
a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--gold);
  padding-bottom: 1px;
  transition: color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}
a:hover { color: var(--gold-deep); border-bottom-color: var(--gold-deep); }
a:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 3px;
  border-bottom-color: transparent;
  border-radius: 2px;
}

/* ---------- Layout primitives ---------- */
.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

.container.narrow { max-width: var(--container-narrow); }

.section { padding-block: var(--space-16); }
.section-tight { padding-block: var(--space-10); }
.section-loose { padding-block: var(--space-24); }

.rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 0;
}

/* ---------- Nav ---------- */
.site-nav {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-6);
  padding-block: var(--space-6);
}

.site-nav .brand {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--charcoal);
  border: 0;
  padding: 0;
}
.site-nav .brand:hover { color: var(--ink); }

.site-nav .nav-links {
  display: flex;
  gap: var(--space-6);
  align-items: baseline;
}

.site-nav .nav-links a {
  font-size: var(--text-meta);
  color: var(--ash);
  border: 0;
  padding: 0;
  letter-spacing: 0.01em;
}
.site-nav .nav-links a:hover { color: var(--ink); }
.site-nav .nav-links a[aria-current="page"] {
  color: var(--charcoal);
  font-weight: 500;
}
.site-nav .nav-links a[aria-current="page"]::after {
  content: "";
  display: block;
  height: 2px;
  margin-top: 4px;
  background: var(--gold);
  border-radius: 2px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.005em;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 4px;
  text-decoration: none;
  padding-bottom: calc(var(--space-3) - 1px);
  transition: transform 160ms var(--ease-out),
              background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}
.btn:hover { background: var(--paper); border-color: var(--charcoal); color: var(--ink); }
.btn:active { transform: scale(0.97); }
.btn:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 3px;
  border-bottom-color: var(--rule);
}

.btn-primary {
  background: var(--ink);
  color: var(--mist);
  border-color: var(--ink);
}
.btn-primary:hover {
  background: var(--charcoal);
  border-color: var(--charcoal);
  color: var(--mist);
}

.btn-gold {
  background: var(--gold);
  color: var(--ink);
  border-color: var(--gold);
  font-weight: 600;
}
.btn-gold:hover {
  background: var(--gold-deep);
  border-color: var(--gold-deep);
  color: var(--mist);
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: auto;
  padding-block: var(--space-10);
  border-top: 1px solid var(--rule);
}
.site-footer .row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4) var(--space-6);
}
.site-footer .meta-line {
  font-size: var(--text-meta);
  color: var(--ash);
}
.site-footer .meta-line a {
  color: var(--charcoal);
  border-bottom: 1px solid var(--rule);
}
.site-footer .meta-line a:hover { color: var(--ink); border-bottom-color: var(--gold-deep); }

.crafted {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-sans);
  font-size: var(--text-micro);
  color: var(--charcoal);
  background: var(--paper);
  padding: 5px 12px;
  border-radius: 999px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.co-flag { width: 14px; height: auto; display: inline-block; border-radius: 1px; }

/* ---------- Motion: entrance ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.rise {
  opacity: 0;
  transform: translateY(8px);
  animation: rise 480ms var(--ease-out) forwards;
}
.rise.d1 { animation-delay: 80ms; }
.rise.d2 { animation-delay: 160ms; }
.rise.d3 { animation-delay: 240ms; }
.rise.d4 { animation-delay: 320ms; }

@supports (animation-timeline: view()) {
  .reveal {
    animation: rise 600ms var(--ease-out) both;
    animation-timeline: view();
    animation-range: entry 0% entry 60%;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .rise, .reveal { opacity: 1; transform: none; }
}

/* ---------- Small screens ---------- */
@media (max-width: 640px) {
  .site-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
    padding-block: var(--space-4);
  }
  .site-nav .nav-links { gap: var(--space-5); flex-wrap: wrap; }
  .section { padding-block: var(--space-12); }
  .section-loose { padding-block: var(--space-16); }
  .site-footer .row { flex-direction: column; align-items: flex-start; }
}
