/* ==========================================================================
   Meridian Equity Capital — Brand stylesheet
   Fonts: Fidelity Sans (body/UI) + Fidelity Slab (display) — served locally.
   ========================================================================== */

/* ---------- Fonts ---------- */
@font-face {
  font-family: "Fidelity Sans";
  font-weight: 200;
  font-style: normal;
  font-display: swap;
  src: url("/fonts/FidelitySans-UltraLight.woff") format("woff");
}
@font-face {
  font-family: "Fidelity Sans";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("/fonts/FidelitySans-Regular.woff2") format("woff2"),
       url("/fonts/FidelitySans-Regular.woff") format("woff");
}
@font-face {
  font-family: "Fidelity Sans";
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url("/fonts/FidelitySans-Demibold.woff2") format("woff2");
}
@font-face {
  font-family: "Fidelity Sans";
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url("/fonts/FidelitySans-Bold.woff2") format("woff2"),
       url("/fonts/FidelitySans-Bold.woff") format("woff");
}
/* Fidelity Slab — variable upright + italic, used for display/headlines */
@font-face {
  font-family: "Fidelity Slab";
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
  src: url("/fonts/FidelitySlabVAR-UprightVF-e1619e.woff2") format("woff2-variations"),
       url("/fonts/FidelitySlabVAR-UprightVF-c62987.woff") format("woff");
}
@font-face {
  font-family: "Fidelity Slab";
  font-weight: 300 800;
  font-style: italic;
  font-display: swap;
  src: url("/fonts/FidelitySlabVAR-ItalicVF-f93226.woff2") format("woff2-variations"),
       url("/fonts/FidelitySlabVAR-ItalicVF-0a69f4.woff") format("woff");
}

/* ---------- Design tokens ---------- */
:root {
  --navy: #13233b;          /* deep navy — nav, footer, dark sections */
  --navy-700: #1b2f4d;
  --navy-900: #0d1a2d;
  --copper: #a35a1e;        /* primary accent / CTA */
  --copper-600: #8a4a18;    /* hover */
  --copper-100: #f3e7da;
  --bg: #f5f4f2;            /* warm light-gray page sections */
  --surface: #ffffff;
  --ink: #1a1a1a;
  --ink-soft: #52525b;
  --ink-muted: #71717a;
  --line: #e5e2dd;
  --line-strong: #c9c4bc;
  --focus: #2f6df6;
  --radius-pill: 999px;
  --radius-card: 20px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(19, 35, 59, 0.06), 0 1px 3px rgba(19, 35, 59, 0.08);
  --shadow-md: 0 8px 24px rgba(19, 35, 59, 0.10);
  --shadow-lg: 0 24px 60px rgba(19, 35, 59, 0.16);
  --max: 1200px;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Fidelity Sans", system-ui, -apple-system, Segoe UI, sans-serif;
  color: var(--ink);
  background: var(--surface);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* :where() keeps this at zero specificity so Tailwind text-color/weight
   utilities (e.g. text-white on dark sections) always win. */
:where(h1, h2, h3, h4, .font-slab) {
  font-family: "Fidelity Slab", Georgia, "Times New Roman", serif;
  color: var(--navy);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

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

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

.font-sans { font-family: "Fidelity Sans", system-ui, sans-serif; }
.font-slab { font-family: "Fidelity Slab", Georgia, serif; }

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: 20px;
}
.section { padding-block: 72px; }
@media (min-width: 768px) { .section { padding-block: 96px; } }

.eyebrow {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--copper);
}

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--copper);
  --btn-fg: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  font-family: "Fidelity Sans", sans-serif;
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  padding: 14px 26px;
  border-radius: var(--radius-pill);
  border: 1.5px solid transparent;
  background: var(--btn-bg);
  color: var(--btn-fg);
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(.34,1.56,.64,1),
              background-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
  will-change: transform;
}
.btn:hover { background: var(--copper-600); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.btn--navy { --btn-bg: var(--navy); }
.btn--navy:hover { background: var(--navy-700); }

.btn--outline {
  --btn-bg: transparent;
  --btn-fg: var(--navy);
  border-color: var(--navy);
}
.btn--outline:hover { background: var(--navy); color: #fff; }

.btn--outline-light {
  --btn-bg: transparent;
  --btn-fg: #fff;
  border-color: rgba(255,255,255,0.7);
}
.btn--outline-light:hover { background: #fff; color: var(--navy); }

.btn--block { width: 100%; }
.btn--lg { padding: 16px 32px; font-size: 16px; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card--hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

/* link with arrow */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  color: var(--copper);
  font-weight: 700;
  font-size: 15px;
}
.link-arrow svg { transition: transform 0.2s ease; }
.link-arrow:hover svg { transform: translateX(4px); }
.link-arrow:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Forms ---------- */
.field-label {
  display: block;
  font-weight: 700;
  font-size: 14px;
  color: var(--navy);
  margin-bottom: 8px;
}
.field-input {
  width: 100%;
  padding: 13px 14px;
  font-size: 16px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.field-input::placeholder { color: var(--ink-muted); }
.field-input:focus {
  outline: none;
  border-color: var(--copper);
  box-shadow: 0 0 0 3px var(--copper-100);
}

/* ---------- Utilities ---------- */
.bg-navy { background: var(--navy); color: #fff; }
.bg-soft { background: var(--bg); }
.text-copper { color: var(--copper); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------- Reveal-on-scroll ---------- */
/* Hidden state only applies when JS is active, so no-JS users still see content. */
html.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(.22,.61,.36,1),
              transform 0.7s cubic-bezier(.22,.61,.36,1);
}
html.js .reveal.is-visible { opacity: 1; transform: none; }

/* Directional / scaled reveal variants.
   Directional variants translate vertically (not horizontally) so an
   un-revealed element below the fold can never cause horizontal page scroll. */
html.js .reveal-left  { opacity: 0; transform: translateY(28px); transition: opacity .75s cubic-bezier(.22,.61,.36,1), transform .75s cubic-bezier(.22,.61,.36,1); }
html.js .reveal-right { opacity: 0; transform: translateY(28px); transition: opacity .75s cubic-bezier(.22,.61,.36,1), transform .75s cubic-bezier(.22,.61,.36,1); }
html.js .reveal-scale { opacity: 0; transform: scale(.94);        transition: opacity .7s ease, transform .7s cubic-bezier(.22,.61,.36,1); }
html.js .reveal-left.is-visible,
html.js .reveal-right.is-visible,
html.js .reveal-scale.is-visible { opacity: 1; transform: none; }

/* Hero entrance (plays once on load) */
@keyframes heroRise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
.hero-anim > * { opacity: 0; animation: heroRise .8s cubic-bezier(.22,.61,.36,1) forwards; }
.hero-anim > *:nth-child(1) { animation-delay: .05s; }
.hero-anim > *:nth-child(2) { animation-delay: .18s; }
.hero-anim > *:nth-child(3) { animation-delay: .32s; }

/* Gentle parallax target (JS sets --py) */
.parallax { will-change: transform; transform: translate3d(0, var(--py, 0), 0); }

/* Soft image zoom used on editorial images */
.img-zoom { overflow: hidden; }
.img-zoom img { transition: transform .9s cubic-bezier(.22,.61,.36,1); }
.img-zoom:hover img { transform: scale(1.04); }

/* ====================================================================
   HERO SLIDER
   Mobile: card on top (edge-to-edge, square), image below, visible.
   Desktop: full-bleed image with the card overlaid on the left; slides crossfade.
   ==================================================================== */
.hero { position: relative; background: var(--navy); overflow: hidden; }
.hero-slide { display: none; }
.hero-slide.is-active { display: block; }

.hero-card {
  background: var(--bg);
  padding: 32px 22px 36px;
  border-radius: 0;            /* mobile: square, edge-to-edge */
}
.hero-img { display: block; width: 100%; height: 230px; object-fit: cover; object-position: center; }

.hero-dots { position: absolute; z-index: 20; bottom: 14px; left: 0; right: 0; display: flex; gap: 8px; justify-content: center; }
.hero-dots button { width: 9px; height: 9px; border-radius: 999px; background: rgba(255,255,255,.45); border: 0; cursor: pointer; transition: background .25s, width .25s; }
.hero-dots button.is-active { background: #fff; width: 26px; }

@media (min-width: 640px) {
  .hero-img { height: 300px; }
}
@media (min-width: 1024px) {
  .hero { min-height: 560px; }
  .hero-slide { display: block; position: absolute; inset: 0; opacity: 0; transition: opacity .9s ease; pointer-events: none; }
  .hero-slide.is-active { opacity: 1; pointer-events: auto; }
  .hero-img { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
  .hero-card-wrap { position: absolute; inset: 0; z-index: 10; max-width: var(--max); margin-inline: auto; padding-inline: 20px; display: flex; align-items: center; }
  .hero-card { max-width: 500px; border-radius: 22px; box-shadow: var(--shadow-lg); padding: 44px 44px 48px; }
  .hero-dots { bottom: 26px; justify-content: flex-start; max-width: var(--max); margin-inline: auto; padding-inline: 44px; }
}

/* Chart.js canvases must never exceed their container (prevents mobile overflow) */
#stockChart, #allocChart { max-width: 100% !important; }

/* Brokerage scroll-switcher */
.switch-panel { opacity: 0; pointer-events: none; transition: opacity .5s ease, transform .5s ease; transform: translateY(8px); }
.switch-panel.is-active { opacity: 1; pointer-events: auto; transform: none; }
.switch-tab { border-color: transparent; color: var(--ink-soft); }
.switch-tab:hover { color: var(--navy); }
.switch-tab.is-on { border-color: var(--navy); color: var(--navy); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  html.js .reveal,
  html.js .reveal-left,
  html.js .reveal-right,
  html.js .reveal-scale { opacity: 1; transform: none; }
  .hero-anim > * { opacity: 1; animation: none; }
  .parallax { transform: none !important; }
}
