/* ============================================================
   MS SMART EXPERTISE — dark identity
   Deep-night navy, luminous gold, data-stream blue.
   Used by: index (new), design-system.html, brandbook.html
   ============================================================ */

:root {
  /* surfaces */
  --night-0: #050A14;
  --night-1: #081120;
  --night-2: #0C1830;
  --panel: rgba(13, 26, 50, .52);
  --panel-2: rgba(18, 34, 64, .45);

  /* brand */
  --gold: #E9B95C;
  --gold-2: #F5D48A;
  --gold-deep: #C08F2F;
  --blue: #5CA8E8;
  --blue-2: #8CC6F5;

  /* text */
  --ink: #F2EFE6;
  --ink-2: #B9C2D2;
  --ink-3: #7E8AA0;

  /* lines */
  --line: rgba(233, 185, 92, .16);
  --line-soft: rgba(140, 170, 220, .12);
  --line-blue: rgba(92, 168, 232, .18);

  /* effects */
  --grad-gold: linear-gradient(115deg, #C08F2F 0%, #E9B95C 55%, #F5D48A 100%);
  --grad-flow: linear-gradient(90deg, #5CA8E8 0%, #E9B95C 100%);
  --glow-gold: 0 0 34px rgba(233, 185, 92, .28);
  --glow-blue: 0 0 30px rgba(92, 168, 232, .22);
  --shadow-card: 0 24px 60px rgba(2, 6, 14, .55);

  /* shape & type */
  --r-lg: 22px;
  --r-md: 14px;
  --r-sm: 9px;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Consolas, monospace;
  --wrap: 1200px;
  --ease: cubic-bezier(.22, .61, .21, 1);
}

/* ---------------- base ---------------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--night-0);
  color: var(--ink);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
::selection { background: rgba(233, 185, 92, .35); color: #fff; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(20px, 4vw, 48px); }
.sec { position: relative; padding-block: clamp(72px, 9vw, 130px); }
.sec--line { border-top: 1px solid var(--line-soft); }

/* background canvas (js/field.js) */
#field { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -2; }
.vignette { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1100px 520px at 78% 12%, rgba(233,185,92,.07), transparent 62%),
    radial-gradient(900px 480px at 12% 20%, rgba(92,168,232,.07), transparent 60%),
    linear-gradient(180deg, rgba(5,10,20,0) 55%, rgba(4,8,16,.72) 100%);
}

/* ---------------- typography ---------------- */
.display {
  font-size: clamp(2.5rem, 5.6vw, 4.4rem);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.02em;
}
.h1 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); font-weight: 800; line-height: 1.12; letter-spacing: -0.015em; }
.h2 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); font-weight: 700; line-height: 1.2; }
.h3 { font-size: 1.14rem; font-weight: 700; }
.lead { font-size: clamp(1.02rem, 1.5vw, 1.2rem); color: var(--ink-2); max-width: 60ch; }
.muted { color: var(--ink-3); }
.gold { background: var(--grad-gold); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: .74rem; font-weight: 500;
  letter-spacing: .22em; text-transform: uppercase; color: var(--gold);
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: var(--grad-gold); }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 26px; border-radius: 999px;
  font-family: var(--font); font-weight: 700; font-size: .95rem;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .3s var(--ease), box-shadow .3s, border-color .3s, background .3s;
}
.btn svg { width: 17px; height: 17px; }
.btn--gold { background: var(--grad-gold); color: #1A1204; box-shadow: 0 10px 30px rgba(233,185,92,.25); }
.btn--gold:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(233,185,92,.38); }
.btn--ghost { border-color: var(--line); color: var(--gold-2); background: rgba(233,185,92,.05); }
.btn--ghost:hover { border-color: var(--gold); background: rgba(233,185,92,.1); }
.btn--lg { padding: 17px 32px; font-size: 1rem; }

/* ---------------- cards & chips ---------------- */
.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: 30px 28px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-card);
  transition: transform .4s var(--ease), border-color .4s, box-shadow .4s;
}
.card:hover { transform: translateY(-4px); border-color: var(--line); box-shadow: var(--shadow-card), var(--glow-gold); }
.card__num { font-family: var(--mono); font-size: .72rem; letter-spacing: .18em; color: var(--gold); }

.chip {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(233,185,92,.06);
  font-family: var(--mono); font-size: .74rem; letter-spacing: .08em; color: var(--ink-2);
}
.chip__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--grad-gold); box-shadow: 0 0 10px var(--gold); }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1020px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px)  { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

/* ---------------- nav ---------------- */
.nav {
  position: fixed; inset-inline: 0; top: 0; z-index: 95;
  transition: background .35s, border-color .35s, backdrop-filter .35s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(5, 10, 20, .72);
  border-bottom-color: var(--line-soft);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; padding-block: 16px; }

/* logo lockup */
.brand { display: inline-flex; align-items: center; gap: 13px; }
.brand__ms {
  font-weight: 800; font-size: 1.7rem; letter-spacing: .01em; line-height: 1;
  background: var(--grad-gold); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand__bar { width: 1px; height: 34px; background: var(--grad-gold); opacity: .8; }
.brand__text { display: grid; line-height: 1.16; }
.brand__text b { font-size: .86rem; font-weight: 700; letter-spacing: .2em; color: var(--ink); }
.brand__text small { font-family: var(--mono); font-size: .5rem; letter-spacing: .18em; color: var(--gold); margin-top: 3px; }

/* burger + overlay menu */
.mburger { position: relative; z-index: 96; width: 46px; height: 46px; border: 1px solid var(--line-soft); border-radius: 12px; background: rgba(13,26,50,.5); cursor: pointer; padding: 0; }
.mburger span { position: absolute; left: 50%; top: 50%; width: 20px; height: 2px; margin: -1px 0 0 -10px; background: var(--gold-2); border-radius: 2px; transition: transform .35s var(--ease), opacity .25s; }
.mburger span:nth-child(1) { transform: translateY(-6px); }
.mburger span:nth-child(3) { transform: translateY(6px); }
body.menu-open .mburger span:nth-child(1) { transform: rotate(45deg); }
body.menu-open .mburger span:nth-child(2) { opacity: 0; }
body.menu-open .mburger span:nth-child(3) { transform: rotate(-45deg); }
body.menu-open .mburger { border-color: var(--line); background: rgba(233,185,92,.08); }

.mmenu {
  position: fixed; inset: 0; z-index: 94;
  background: rgba(5, 10, 20, .82);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  opacity: 0; visibility: hidden;
  transition: opacity .4s var(--ease), visibility .4s;
  display: grid; align-content: center;
}
body.menu-open .mmenu { opacity: 1; visibility: visible; }
.mmenu__inner { display: grid; gap: 10px; max-width: 640px; margin-inline: auto; width: 100%; padding-inline: 24px; }
.mmenu__link {
  display: flex; align-items: center; gap: 18px;
  padding: 16px 22px; border-radius: var(--r-md);
  border: 1px solid transparent;
  font-size: 1.3rem; font-weight: 700; color: var(--ink);
  opacity: 0; transform: translateY(18px);
}
body.menu-open .mmenu__link { animation: menuIn .5s var(--ease) forwards; }
body.menu-open .mmenu__link:nth-child(1) { animation-delay: .05s; }
body.menu-open .mmenu__link:nth-child(2) { animation-delay: .1s; }
body.menu-open .mmenu__link:nth-child(3) { animation-delay: .15s; }
body.menu-open .mmenu__link:nth-child(4) { animation-delay: .2s; }
body.menu-open .mmenu__link:nth-child(5) { animation-delay: .25s; }
body.menu-open .mmenu__link:nth-child(6) { animation-delay: .3s; }
@keyframes menuIn { to { opacity: 1; transform: none; } }
.mmenu__link:hover { border-color: var(--line); background: rgba(233,185,92,.06); }
.mmenu__n { font-family: var(--mono); font-size: .72rem; color: var(--gold); }

/* ---------------- reveal ---------------- */
.rv { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.rv.in { opacity: 1; transform: none; }
.rv[data-d="1"] { transition-delay: .1s; } .rv[data-d="2"] { transition-delay: .2s; }
.rv[data-d="3"] { transition-delay: .3s; } .rv[data-d="4"] { transition-delay: .4s; }

/* ---------------- preloader & toast ---------------- */
.ploader { position: fixed; inset: 0; z-index: 999; display: grid; place-items: center; background: var(--night-0); opacity: 0; visibility: hidden; transition: opacity .55s ease, visibility .55s; }
.ploader.on { opacity: 1; visibility: visible; transition-duration: .3s; }
.ploader b { font-size: 2.2rem; font-weight: 800; background: var(--grad-gold); -webkit-background-clip: text; background-clip: text; color: transparent; animation: plPulse 1.8s cubic-bezier(.45,0,.55,1) infinite; }
@keyframes plPulse { 0%,100% { opacity: .55; transform: scale(1); } 50% { opacity: 1; transform: scale(1.07); } }

.toast { position: fixed; inset: 0; z-index: 998; display: grid; place-items: center; background: rgba(3,6,12,.6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); opacity: 0; visibility: hidden; transition: opacity .35s ease, visibility .35s; }
.toast.on { opacity: 1; visibility: visible; }
.toast__card { display: grid; justify-items: center; gap: 8px; text-align: center; max-width: 420px; margin: 20px; padding: 38px 34px 30px; background: var(--night-2); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow-card), var(--glow-gold); transform: translateY(14px) scale(.97); transition: transform .35s var(--ease); }
.toast.on .toast__card { transform: none; }
.toast__ic { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 1.5rem; font-weight: 800; color: #1A1204; background: var(--grad-gold); box-shadow: var(--glow-gold); margin-bottom: 6px; }
.toast__card b { font-size: 1.25rem; }
.toast__card p { color: var(--ink-2); font-size: .95rem; }
.toast__close { margin-top: 12px; }

/* ---------------- forms ---------------- */
.field { display: grid; gap: 7px; }
.field label { font-family: var(--mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.input, .textarea {
  width: 100%; padding: 14px 16px;
  background: rgba(6, 12, 24, .6);
  border: 1px solid var(--line-soft); border-radius: var(--r-md);
  color: var(--ink); font-family: var(--font); font-size: .96rem;
  transition: border-color .3s, box-shadow .3s;
}
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.input:focus, .textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(233,185,92,.14); }
.textarea { min-height: 120px; resize: vertical; }

/* ---------------- footer ---------------- */
.footer { position: relative; overflow: hidden; border-top: 1px solid var(--line-soft); background: rgba(4, 8, 16, .6); backdrop-filter: blur(10px); padding-block: 56px 0; margin-top: clamp(60px, 8vw, 110px); }
.footer__ocean { position: relative; height: clamp(230px, 30vw, 380px); margin-top: 40px; }
.footer__ocean canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.footer__grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 40px; }
@media (max-width: 900px) { .footer__grid { grid-template-columns: 1fr; } }
.footer__col h4 { font-family: var(--mono); font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; }
.footer__col a, .footer__col span { display: block; color: var(--ink-2); font-size: .92rem; margin-bottom: 9px; }
.footer__col a:hover { color: var(--gold-2); }
.footer__bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 44px; font-family: var(--mono); font-size: .7rem; letter-spacing: .06em; color: var(--ink-3); }

/* ---------------- misc ---------------- */
.pillars { display: flex; flex-wrap: wrap; gap: 14px 34px; align-items: center; font-family: var(--mono); font-size: .78rem; letter-spacing: .3em; color: var(--ink-2); }
.pillars i { width: 5px; height: 5px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px var(--gold); }

.flowline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-family: var(--mono); letter-spacing: .14em; font-size: .8rem; }
.flowline span { padding: 10px 18px; border: 1px solid var(--line); border-radius: 999px; color: var(--gold-2); background: rgba(233,185,92,.05); transition: box-shadow .4s, border-color .4s; }
.flowline i { color: var(--ink-3); font-style: normal; }
.flowline span.active { border-color: var(--gold); box-shadow: var(--glow-gold); color: var(--gold-2); }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
  .rv { opacity: 1; transform: none; }
}
