/* MEI Capital — Design Tokens
   Quiet & precise. Swiss grid. Deep navy + cream + brass. */

:root {
  /* ── Color ──────────────────────────────────────────── */
  --ink-900: #0B1A2B;        /* deep navy — primary brand */
  --ink-800: #122742;
  --ink-700: #1E3556;
  --ink-500: #4B5E78;        /* secondary text */
  --ink-400: #7A8AA1;        /* tertiary text */
  --ink-300: #B7C0CD;        /* dividers on cream */

  --cream-50:  #FBF8F1;      /* page background */
  --cream-100: #F5F0E4;      /* alt section */
  --cream-200: #ECE4D2;      /* borders, soft fills */
  --cream-300: #D9CDB1;

  --brass-600: #8C6A2B;      /* accent — restrained */
  --brass-500: #A4823F;
  --brass-400: #BFA063;
  --brass-300: #DCC28E;

  --white: #FFFFFF;
  --black: #000000;

  /* Semantic */
  --bg:           var(--cream-50);
  --bg-alt:       var(--cream-100);
  --surface:      var(--white);
  --text:         var(--ink-900);
  --text-muted:   var(--ink-500);
  --text-subtle:  var(--ink-400);
  --rule:         var(--ink-900);
  --rule-soft:    var(--cream-200);
  --accent:       var(--brass-600);

  /* On dark navy sections */
  --on-navy:        #EFE6D2;
  --on-navy-muted:  #B7AC8E;
  --on-navy-rule:   rgba(239, 230, 210, 0.18);

  /* ── Type ───────────────────────────────────────────── */
  /* Display: GT Sectra-style high-contrast serif (using a free near-equivalent stack)
     Body: Inter is overused — use Söhne-style Neue Haas Grotesk substitute via "Söhne"/Inter Display fallback,
     but commit: we use "Fraktur"-no. Use "Editorial New" alt: GT Sectra Fine via free fallback "Cormorant Garamond" + Inter Tight as fallback sans.
     For shipping-grade neutrality without overused fonts:
       - Display serif: "EB Garamond" (libre, classical, contrasted) + system serif fallback
       - Sans: "Söhne" via free Sohne fallback "Suisse Int'l" → use "Söhne" name with system stack fallback
     Practically, ship with Google Fonts: Newsreader (display serif, modern editorial) and Geist (neutral sans).
  */
  --font-serif: "Newsreader", "Cormorant Garamond", "EB Garamond", Georgia, "Times New Roman", serif;
  --font-sans:  "Geist", "Söhne", "Suisse Int'l", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-mono:  "Geist Mono", "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Type scale — fluid, anchored to a 1.25 minor-third */
  --t-mega:  clamp(56px, 9vw, 132px);
  --t-h1:    clamp(40px, 5.6vw, 84px);
  --t-h2:    clamp(32px, 3.6vw, 52px);
  --t-h3:    clamp(24px, 2.2vw, 32px);
  --t-h4:    20px;
  --t-body:  17px;
  --t-small: 14px;
  --t-eyebrow: 12px;

  --lh-tight: 1.04;
  --lh-snug:  1.18;
  --lh-body:  1.55;

  /* ── Spacing — 8px base ────────────────────────────── */
  --s-1:  4px;
  --s-2:  8px;
  --s-3:  12px;
  --s-4:  16px;
  --s-5:  24px;
  --s-6:  32px;
  --s-7:  48px;
  --s-8:  64px;
  --s-9:  96px;
  --s-10: 128px;
  --s-11: 160px;

  /* Layout */
  --max-w: 1280px;
  --gutter: clamp(20px, 4vw, 48px);

  /* Radius — quiet, almost square */
  --r-0: 0;
  --r-1: 2px;
  --r-2: 4px;

  /* Motion */
  --ease: cubic-bezier(.2,.6,.2,1);
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  font-feature-settings: "ss01", "cv11";
  text-rendering: optimizeLegibility;
}

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

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }

/* ── Type utilities ────────────────────────────────────── */
.serif { font-family: var(--font-serif); font-weight: 400; letter-spacing: -0.01em; }
.sans  { font-family: var(--font-sans); }
.mono  { font-family: var(--font-mono); }

.eyebrow {
  font-family: var(--font-sans);
  font-size: var(--t-eyebrow);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
}

.mega   { font-family: var(--font-serif); font-size: var(--t-mega); line-height: var(--lh-tight); letter-spacing: -0.02em; font-weight: 300; }
.h1     { font-family: var(--font-serif); font-size: var(--t-h1);   line-height: var(--lh-tight); letter-spacing: -0.015em; font-weight: 300; }
.h2     { font-family: var(--font-serif); font-size: var(--t-h2);   line-height: var(--lh-snug);  letter-spacing: -0.01em;  font-weight: 400; }
.h3     { font-family: var(--font-serif); font-size: var(--t-h3);   line-height: var(--lh-snug);  letter-spacing: -0.005em; font-weight: 400; }
.lead   { font-size: 20px; line-height: 1.5; color: var(--text); max-width: 60ch; }
.small  { font-size: var(--t-small); color: var(--text-muted); }

/* ── Layout ────────────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.section { padding-block: var(--s-10); }
.section-sm { padding-block: var(--s-9); }
.section-tight { padding-block: var(--s-8); }

.rule { height: 1px; background: var(--ink-900); border: 0; opacity: 1; }
.rule-soft { height: 1px; background: var(--rule-soft); border: 0; }

/* ── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  font-family: var(--font-sans);
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: var(--r-1);
  transition: all .25s var(--ease);
  white-space: nowrap;
}
.btn--primary {
  background: var(--ink-900);
  color: var(--cream-50);
}
.btn--primary:hover { background: var(--brass-600); color: var(--cream-50); }

.btn--ghost {
  background: transparent;
  color: var(--ink-900);
  border: 1px solid var(--ink-900);
}
.btn--ghost:hover { background: var(--ink-900); color: var(--cream-50); }

.btn--link {
  padding: 0;
  border-bottom: 1px solid currentColor;
  border-radius: 0;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
  padding-bottom: 4px;
}

.btn .arrow { transition: transform .3s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

/* ── Header / Footer (shared) ──────────────────────────── */
/* Hamburger toggle (mobile only) */
.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  align-items: center; justify-content: center;
  border: 1px solid var(--ink-900);
  background: var(--cream-50);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  z-index: 110;
  flex-shrink: 0;
  transition: background .2s var(--ease);
}
.nav-toggle__bars { width: 18px; height: 14px; position: relative; }
.nav-toggle__bar {
  position: absolute; left: 0; right: 0; height: 1.5px;
  background: var(--ink-900);
  transition: transform .3s var(--ease), opacity .2s var(--ease), top .3s var(--ease), background .2s var(--ease);
}
.nav-toggle__bar:nth-child(1) { top: 0; }
.nav-toggle__bar:nth-child(2) { top: 50%; transform: translateY(-50%); }
.nav-toggle__bar:nth-child(3) { top: 100%; transform: translateY(-100%); }
body.nav-open .nav-toggle__bar:nth-child(1) { top: 50%; transform: translateY(-50%) rotate(45deg); }
body.nav-open .nav-toggle__bar:nth-child(2) { opacity: 0; }
body.nav-open .nav-toggle__bar:nth-child(3) { top: 50%; transform: translateY(-50%) rotate(-45deg); }
body.nav-open .nav-toggle { background: var(--ink-900); }
body.nav-open .nav-toggle__bar { background: var(--cream-50); }

@media (max-width: 820px) {
  .site-header__inner { gap: var(--s-3); padding-block: 14px; flex-wrap: nowrap; }
  .brand__mark { font-size: 17px; letter-spacing: 0.05em; }
  .brand__sub { font-size: 9px; letter-spacing: 0.28em; }
  .nav-toggle { display: inline-flex; }
  .site-nav, .header-cta { display: none; }

  body.nav-open { overflow: hidden; }
  body.nav-open .site-nav {
    display: flex;
    position: fixed; inset: 0;
    background: var(--cream-50);
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 0;
    padding: 96px var(--gutter) var(--s-7);
    z-index: 100;
    border-top: 0;
    margin: 0;
    overflow-y: auto;
    animation: drawerIn .3s var(--ease);
  }
  body.nav-open .site-nav a {
    font-family: var(--font-serif);
    font-size: clamp(32px, 8vw, 44px);
    font-weight: 300;
    letter-spacing: -0.01em;
    color: var(--ink-900);
    padding: 16px 0;
    width: 100%;
    border-bottom: 1px solid var(--rule-soft);
    text-transform: none;
    line-height: 1.1;
  }
  body.nav-open .site-nav a:first-child { border-top: 1px solid var(--rule-soft); }
  body.nav-open .site-nav a:hover { color: var(--brass-600); border-bottom-color: var(--brass-600); }
  body.nav-open .header-cta {
    display: flex;
    position: fixed;
    left: var(--gutter); right: var(--gutter);
    bottom: var(--s-7);
    z-index: 101;
  }
  body.nav-open .header-cta .btn {
    flex: 1;
    justify-content: center;
    padding: 18px 22px;
    font-size: 13px;
    letter-spacing: 0.16em;
  }
}
@keyframes drawerIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 248, 241, 0.94);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--rule-soft);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
  padding-block: 16px;
  flex-wrap: wrap;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 28px);
  flex: 1 1 auto;
  justify-content: center;
}
.site-nav a {
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--ink-700);
  position: relative;
  padding: 6px 2px;
  white-space: nowrap;
  border-bottom: 1px solid transparent;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.site-nav a:hover, .site-nav a.is-active { color: var(--ink-900); border-bottom-color: var(--brass-600); }

.header-cta { display: inline-flex; }
.header-cta .btn { padding: 10px 18px; font-size: 12px; letter-spacing: 0.08em; }

@media (max-width: 820px) {
  .site-header__inner { gap: var(--s-3); padding-block: 12px; }
  .site-nav { order: 3; flex-basis: 100%; justify-content: flex-start; overflow-x: auto; gap: var(--s-5); padding-top: 6px; padding-bottom: 2px; margin: 0 calc(-1 * var(--gutter)); padding-inline: var(--gutter); border-top: 1px solid var(--rule-soft); scrollbar-width: none; }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { font-size: 13px; padding: 8px 0; }
  .brand__mark { font-size: 18px; }
  .brand__sub { font-size: 9px; letter-spacing: 0.28em; }
  .header-cta .btn { padding: 9px 14px; font-size: 11px; }
}
@media (max-width: 420px) {
  .header-cta .btn { padding: 8px 12px; font-size: 10.5px; letter-spacing: 0.06em; }
}

.brand {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  color: var(--ink-900);
  line-height: 1.1;
}
.brand__mark {
  font-family: var(--font-serif);
  font-size: 22px;
  letter-spacing: 0.04em;
  font-weight: 400;
  white-space: nowrap;
}
.brand__sub {
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.site-footer {
  background: var(--ink-900);
  color: var(--on-navy);
  padding-block: var(--s-8) var(--s-5);
}
.site-footer a:hover { color: var(--brass-300); }
.site-footer .rule { background: var(--on-navy-rule); }

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.4fr;
  gap: clamp(24px, 3vw, 48px);
  align-items: start;
}
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; row-gap: var(--s-7); }
  .footer-col--brand { grid-column: 1 / -1; }
}
@media (max-width: 540px) {
  .footer-grid { grid-template-columns: 1fr; row-gap: var(--s-6); }
  .footer-col--brand { grid-column: auto; }
}
.footer-col h5 {
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--brass-300); margin: 0 0 var(--s-4) 0; font-weight: 500;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; font-size: 14px; line-height: 1.5; }
.footer-col a { border-bottom: 1px solid transparent; padding-bottom: 1px; transition: color .2s var(--ease), border-color .2s var(--ease); }
.footer-col a:hover { color: var(--brass-300); border-bottom-color: var(--brass-300); }
.footer-col--brand .brand__mark { font-size: 24px; }
.footer-tagline { margin: 18px 0 0; max-width: 36ch; color: var(--on-navy-muted); font-size: 14px; line-height: 1.5; }
.footer-base { display: grid; grid-template-columns: auto 1fr; gap: var(--s-5); font-size: 12px; color: var(--on-navy-muted); letter-spacing: 0.04em; align-items: start; }
@media (max-width: 720px) { .footer-base { grid-template-columns: 1fr; gap: var(--s-3); } }
.footer-base__risk { color: var(--on-navy); font-weight: 600; line-height: 1.55; }

/* Dropdown nav (SEBI) */
.has-menu { position: relative; }
.has-menu__panel {
  position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(-4px);
  background: var(--cream-50);
  border: 1px solid var(--rule-soft);
  min-width: 280px;
  padding: 10px;
  opacity: 0; pointer-events: none;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.has-menu:hover .has-menu__panel,
.has-menu:focus-within .has-menu__panel {
  opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0);
}
.has-menu__panel a {
  display: block;
  padding: 10px 12px;
  font-size: 13px;
}
.has-menu__panel a:hover { background: var(--cream-100); }

/* ── Cards / Tiles ─────────────────────────────────────── */
.tile {
  border-top: 1px solid var(--ink-900);
  padding-top: var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}
.tile__no {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

/* ── Form ──────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 8px; }
.field label {
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-muted);
}
.field input, .field textarea, .field select {
  font: inherit;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ink-300);
  padding: 10px 0;
  color: var(--ink-900);
  outline: none;
  transition: border-color .2s var(--ease);
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--ink-900);
}
.field textarea { resize: vertical; min-height: 120px; }

/* ── Animations ────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp .9s var(--ease) both; }
.fade-up.delay-1 { animation-delay: .08s; }
.fade-up.delay-2 { animation-delay: .16s; }
.fade-up.delay-3 { animation-delay: .24s; }
.fade-up.delay-4 { animation-delay: .32s; }

/* ── Tables (SEBI) ─────────────────────────────────────── */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.table th, .table td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: top;
}
.table th {
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--cream-100);
}
.table tbody tr:hover { background: var(--cream-100); }

/* ── Misc ──────────────────────────────────────────────── */
.kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text-muted);
}
.kicker::before {
  content: ""; width: 24px; height: 1px; background: currentColor;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-7); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-6); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-6); }
.grid-12 { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--s-5); }

@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid-12 { grid-template-columns: repeat(6, 1fr); }
}

/* Aspect frames */
.frame { position: relative; overflow: hidden; background: var(--cream-200); }
.frame--3x4  { aspect-ratio: 3 / 4; }
.frame--4x3  { aspect-ratio: 4 / 3; }
.frame--1x1  { aspect-ratio: 1 / 1; }
.frame--16x9 { aspect-ratio: 16 / 9; }

/* Marquee number for sections */
.section-no {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.16em;
}
