/* =========================================================================
   Fairmont Trust & Annuity, Design Tokens
   Slate-navy + warm cream + gold whisper. Source Serif 4 + Inter.
   ========================================================================= */

:root {
  /* Navy depths, default: slightly-softer slate-navy */
  --navy-midnight: 9 20 40;        /* near-black */
  --navy-true:     14 31 60;       /* classic */
  --navy-slate:    26 42 68;       /* warmer, softer, DEFAULT */
  --navy: var(--navy-slate);

  --navy-700: 38 56 84;
  --navy-500: 72 92 120;
  --navy-300: 140 158 182;

  /* Warm cream / paper system */
  --cream:   247 243 236;          /* page background */
  --paper:   238 231 219;          /* card / alt section */
  --paper-2: 228 219 204;          /* deeper paper */
  --rule:    210 199 180;          /* hairline */

  /* Ink */
  --ink:     24 32 48;
  --ink-soft:60 72 92;
  --ink-mute:110 120 140;

  /* Gold, whisper by default */
  --gold:    185 146 76;           /* oklch(0.72 0.09 75) approx */
  --gold-soft: 202 170 112;
  --gold-intensity: 0.55;          /* 0..1 multiplier, controlled by Tweaks */

  /* Type */
  --font-serif: "Source Serif 4", "Source Serif Pro", Georgia, serif;
  --font-sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono:  "JetBrains Mono", ui-monospace, Menlo, monospace;

  /* Scale, generous */
  --fs-body:      18px;
  --fs-body-lg:   20px;
  --fs-small:     15px;
  --fs-eyebrow:   12px;

  --lh-body: 1.6;
  --lh-tight: 1.12;

  /* Spacing */
  --gutter: clamp(20px, 4vw, 48px);
  --section-y: clamp(80px, 11vw, 160px);
  --max: 1240px;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-slow: 1100ms;
  --dur-med: 800ms;
  --dur-base: 600ms;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html {
  background: rgb(var(--cream));
  color: rgb(var(--ink));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-body-lg);
  line-height: var(--lh-body);
  font-weight: 400;
  letter-spacing: -0.005em;
  overflow-x: hidden;
}

/* Typography primitives */
.serif     { font-family: var(--font-serif); font-weight: 400; letter-spacing: -0.015em; }
.sans      { font-family: var(--font-sans); }
.mono      { font-family: var(--font-mono); font-size: var(--fs-small); letter-spacing: 0.02em; }

.eyebrow {
  font-family: var(--font-sans);
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgb(var(--ink-mute));
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
  color: rgb(var(--ink));
  margin: 0;
  text-wrap: balance;
}

h1 { font-size: clamp(44px, 6.4vw, 88px); }
h2 { font-size: clamp(34px, 4.2vw, 58px); }
h3 { font-size: clamp(22px, 2vw, 28px); }

p { margin: 0; max-width: 62ch; text-wrap: pretty; }

a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible {
  outline: 2px solid rgb(var(--gold));
  outline-offset: 3px;
  border-radius: 2px;
}

/* Layout helpers */
.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section { padding: var(--section-y) 0; position: relative; }

/* Hairline, the gold whisper lives here */
.hairline {
  display: block;
  height: 1px;
  width: 48px;
  background: rgb(var(--gold));
  opacity: calc(0.6 + var(--gold-intensity) * 0.4);
}
.hairline--long { width: 100%; background: rgb(var(--rule)); opacity: 1; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 18px 28px;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1;
  cursor: pointer;
  border: 1px solid transparent;
  background: rgb(var(--navy));
  color: rgb(var(--cream));
  transition: transform var(--dur-base) var(--ease-out),
              background var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
  will-change: transform;
}
.btn:hover { background: rgb(var(--navy-700)); transform: translateY(-1px); box-shadow: 0 12px 32px -16px rgb(var(--navy) / 0.45); }
.btn__arrow { transition: transform var(--dur-base) var(--ease-out); }
.btn:hover .btn__arrow { transform: translateX(4px); }

.btn--ghost {
  background: transparent;
  color: rgb(var(--navy));
  border-color: rgb(var(--navy) / 0.3);
}
.btn--ghost:hover { background: rgb(var(--navy)); color: rgb(var(--cream)); }

.btn--onNavy {
  background: rgb(var(--cream));
  color: rgb(var(--navy));
}
.btn--onNavy:hover { background: #fff; }

.btn--onNavy-ghost {
  background: transparent;
  color: rgb(var(--cream));
  border-color: rgb(var(--cream) / 0.35);
}
.btn--onNavy-ghost:hover { border-color: rgb(var(--cream)); }

/* Pulse on hover, very restrained */
.btn--pulse { position: relative; }
.btn--pulse::after {
  content: "";
  position: absolute; inset: -2px;
  border: 1px solid rgb(var(--gold) / 0.5);
  opacity: 0;
  transition: opacity var(--dur-med) var(--ease-out);
  pointer-events: none;
}
.btn--pulse:hover::after { opacity: 1; animation: pulse 2.2s var(--ease-out) infinite; }
@keyframes pulse {
  0%   { transform: scale(1);    opacity: 0.9; }
  100% { transform: scale(1.06); opacity: 0; }
}

/* Reveal-on-scroll primitives */
.reveal { opacity: 0; transform: translateY(16px); }
.reveal.is-in { opacity: 1; transform: none; transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out); }

/* Reduced motion, disable everything, just fade */
@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;
  }
  .reveal { opacity: 1; transform: none; }
}

/* Utilities */
.stack-sm > * + * { margin-top: 12px; }
.stack    > * + * { margin-top: 24px; }
.stack-lg > * + * { margin-top: 40px; }

.bg-navy  { background: rgb(var(--navy)); color: rgb(var(--cream)); }
.bg-paper { background: rgb(var(--paper)); }
.bg-cream { background: rgb(var(--cream)); }

.on-navy p, .on-navy li { color: rgb(var(--cream) / 0.82); }
.on-navy h1, .on-navy h2, .on-navy h3 { color: rgb(var(--cream)); }
.on-navy .eyebrow { color: rgb(var(--cream) / 0.6); }
.on-navy .hairline { background: rgb(var(--gold)); opacity: calc(0.55 + var(--gold-intensity) * 0.45); }

/* Nav */
.nav {
  position: fixed; inset: 0 0 auto 0;
  z-index: 50;
  padding: 20px var(--gutter);
  display: flex; align-items: center; justify-content: space-between;
  background: rgb(var(--cream) / 0);
  transition: background var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgb(var(--cream) / 0.92);
  backdrop-filter: saturate(1.2) blur(10px);
  border-bottom-color: rgb(var(--rule) / 0.6);
}
.nav__logo {
  display: inline-flex; align-items: center;
  height: 28px;
  flex-shrink: 0;
  line-height: 0;
}
.nav__logo img {
  height: 28px !important;
  width: auto !important;
  max-width: 180px;
  display: block;
  transition: filter var(--dur-base) var(--ease-out);
}
/* On cream (nav scrolled, non-dark heroes), invert the white wordmark to navy */
.nav.is-scrolled .nav__logo img,
body[data-hero="split"] .nav:not(.is-scrolled) .nav__logo img {
  filter: brightness(0) saturate(100%) invert(14%) sepia(22%) saturate(1200%) hue-rotate(188deg) brightness(96%) contrast(92%);
}
.nav__links { display: none; gap: 36px; font-size: 15px; color: rgb(var(--ink-soft)); }
.nav__links a { position: relative; padding: 6px 0; }
.nav__links a:hover { color: rgb(var(--navy)); }
.nav__cta { display: none; }
@media (min-width: 900px) {
  .nav__links { display: flex; }
  .nav__cta { display: inline-flex; }
}

/* Hamburger (visible only below 900px) */
.nav__burger {
  display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
  width: 44px; height: 44px;
  background: transparent; border: 0; padding: 0 10px;
  cursor: pointer; margin-left: auto;
}
.nav__burger span {
  display: block; height: 2px; width: 100%;
  background: rgb(var(--cream));
  transition: transform var(--dur-base) var(--ease-out), opacity var(--dur-base) var(--ease-out);
}
.nav.is-scrolled .nav__burger span,
body[data-hero="split"] .nav:not(.is-scrolled) .nav__burger span { background: rgb(var(--navy)); }
.nav__burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__burger.is-open span:nth-child(2) { opacity: 0; }
.nav__burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
@media (min-width: 900px) {
  .nav__burger { display: none; }
}

/* Mobile drawer */
.mobile-menu {
  position: fixed; inset: 0;
  background: rgb(var(--navy));
  z-index: 49;
  padding: 96px 28px 40px;
  opacity: 0; visibility: hidden;
  transition: opacity var(--dur-base) var(--ease-out), visibility var(--dur-base) var(--ease-out);
}
.mobile-menu.is-open { opacity: 1; visibility: visible; }
.mobile-menu__links {
  display: flex; flex-direction: column; gap: 4px;
}
.mobile-menu__links a {
  font-family: var(--font-serif);
  font-size: 32px; font-weight: 400;
  color: rgb(var(--cream));
  padding: 18px 0;
  border-bottom: 1px solid rgb(var(--cream) / 0.1);
}
.mobile-menu__cta {
  margin-top: 24px;
  font-size: 18px !important;
  font-family: var(--font-body) !important;
  letter-spacing: 0.04em;
  border-bottom: none !important;
  color: rgb(var(--cream) / 0.85) !important;
}
@media (min-width: 900px) {
  .mobile-menu { display: none; }
}

/* Placeholder imagery block (labeled) */
.ph {
  position: relative;
  background:
    repeating-linear-gradient(135deg,
      rgb(var(--paper-2)) 0 12px,
      rgb(var(--paper)) 12px 24px);
  border: 1px solid rgb(var(--rule));
  overflow: hidden;
}
.ph__label {
  position: absolute; left: 16px; bottom: 14px;
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: rgb(var(--ink-soft));
  background: rgb(var(--cream) / 0.85);
  padding: 4px 8px;
}

/* Footer */
footer { background: rgb(var(--navy)); color: rgb(var(--cream) / 0.75); padding: 96px 0 48px; }
footer a:hover { color: rgb(var(--cream)); }
footer .fine { font-size: 13px; line-height: 1.7; color: rgb(var(--cream) / 0.55); max-width: 82ch; }
