/* ==========================================================================
   Magnigent — site stylesheet
   Light enterprise system. Single source of truth for tokens + components.
   ========================================================================== */

:root {
  /* Ink */
  --ink:        #0A1020;
  --ink-2:      #27324A;
  --muted:      #5C6880;
  --muted-2:    #8A94A8;

  /* Brand */
  --brand:      #2447E8;
  --brand-700:  #1A34AE;
  --brand-900:  #0C1749;
  --brand-deep: #101C5E;
  --brand-050:  #EEF2FE;
  --brand-100:  #DCE3FD;

  /* Accent */
  --accent:     #00A88F;
  --accent-050: #E6F7F4;

  /* Ground */
  --bg:         #FFFFFF;
  --surface:    #F5F7FC;
  --surface-2:  #EDF1F9;
  --line:       #E1E7F2;
  --line-2:     #CDD6E6;

  /* Type */
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Metrics */
  --maxw: 1180px;
  --gutter: 24px;
  --r-sm: 8px;
  --r:    14px;
  --r-lg: 22px;

  --shadow-sm: 0 1px 2px rgba(10,16,32,.05), 0 1px 3px rgba(10,16,32,.04);
  --shadow:    0 4px 14px rgba(10,16,32,.06), 0 1px 3px rgba(10,16,32,.04);
  --shadow-lg: 0 18px 48px rgba(10,16,32,.10), 0 4px 12px rgba(10,16,32,.05);
}
/* --------------------------------------------------------------------------
   Reset
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-700); }
h1, h2, h3, h4 { color: var(--ink); margin: 0 0 .5em; font-weight: 640; letter-spacing: -0.021em; line-height: 1.15; }
h1 { font-size: clamp(2.4rem, 1.6rem + 2.6vw, 3.7rem); letter-spacing: -0.033em; line-height: 1.06; }
h2 { font-size: clamp(1.75rem, 1.3rem + 1.5vw, 2.5rem); letter-spacing: -0.028em; }
h3 { font-size: 1.2rem; letter-spacing: -0.016em; }
h4 { font-size: 1.02rem; letter-spacing: -0.012em; }
p  { margin: 0 0 1.1em; }
ul, ol { margin: 0 0 1.1em; padding-left: 1.15em; }
li { margin-bottom: .4em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 3rem 0; }
::selection { background: var(--brand-100); color: var(--brand-900); }

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.wrap-narrow { max-width: 800px; margin-inline: auto; padding-inline: var(--gutter); }
section { padding: 84px 0; }
section.tight { padding: 56px 0; }
.surface { background: var(--surface); }
.deep { background: var(--brand-deep); color: #C6D0F0; }
.deep h1, .deep h2, .deep h3, .deep h4 { color: #fff; }
.deep a { color: #fff; }

.grid { display: grid; gap: 22px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
@media (max-width: 900px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 620px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }

.split { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.split.start { align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; gap: 34px; } }

/* --------------------------------------------------------------------------
   Type helpers
   -------------------------------------------------------------------------- */
.eyebrow {
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--brand);
  font-weight: 500;
  margin: 0 0 14px;
}
.deep .eyebrow { color: #8FA6F5; }
.lede { font-size: 1.16rem; color: var(--muted); line-height: 1.62; }
.deep .lede { color: #B6C2E8; }
.small { font-size: .9rem; color: var(--muted); }
.section-head { max-width: 720px; margin-bottom: 44px; }
.section-head.center { margin-inline: auto; text-align: center; }
.muted { color: var(--muted); }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: .55em;
  font-size: .95rem; font-weight: 550; letter-spacing: -0.005em;
  padding: 12px 22px; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer;
  transition: background .16s ease, color .16s ease, border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 2px 10px rgba(36,71,232,.24); }
.btn-primary:hover { background: var(--brand-700); color: #fff; box-shadow: 0 6px 18px rgba(36,71,232,.28); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--surface); color: var(--ink); border-color: var(--muted-2); }
.btn-light { background: #fff; color: var(--brand-900); }
.btn-light:hover { background: #EEF2FE; color: var(--brand-900); }
.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.btn-outline-light:hover { background: rgba(255,255,255,.1); color: #fff; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.link-arrow { font-weight: 550; font-size: .93rem; display: inline-flex; align-items: center; gap: .4em; }
.link-arrow::after { content: "→"; transition: transform .16s ease; }
.link-arrow:hover::after { transform: translateX(3px); }

/* --------------------------------------------------------------------------
   Header / nav
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255,255,255,.86);
  backdrop-filter: saturate(150%) blur(12px);
  -webkit-backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 34px; height: 68px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 640; font-size: 1.16rem; color: var(--ink); letter-spacing: -0.03em; }
.brand:hover { color: var(--ink); }
.brand .mark { width: 26px; height: 26px; flex: none; }

.nav-links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-links > li { list-style: none; position: relative; margin: 0; }
.nav-links ul { list-style: none; }
.nav-item {
  display: inline-flex; align-items: center; gap: .35em;
  padding: 9px 14px; border-radius: 8px;
  font-size: .94rem; font-weight: 500; color: var(--ink-2);
  background: none; border: 0; font-family: inherit; cursor: pointer;
}
.nav-item:hover { color: var(--ink); background: var(--surface); }
.nav-item.active { color: var(--brand); }
.nav-item .caret { width: 9px; height: 9px; opacity: .5; transition: transform .18s ease; }
.has-menu[data-open="true"] .caret { transform: rotate(180deg); }

.nav-menu {
  position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(-6px);
  min-width: 460px; padding: 12px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
}
.has-menu[data-open="true"] .nav-menu { opacity: 1; visibility: visible; pointer-events: auto; transform: translateX(-50%) translateY(0); }
/* Hover bridge. The menu sits 8px below the nav item; without this, crossing that
   gap fires mouseleave on .has-menu and the menu closes before you reach it.
   The pseudo-element is a child of .nav-menu, so the pointer never leaves. */
.nav-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }
.nav-menu a { display: block; padding: 9px 12px; border-radius: 9px; color: var(--ink-2); font-size: .91rem; font-weight: 500; line-height: 1.35; }
.nav-menu a span { display: block; font-size: .78rem; color: var(--muted-2); font-weight: 400; margin-top: 1px; }
.nav-menu a:hover { background: var(--brand-050); color: var(--brand-900); }
.nav-menu .menu-all { grid-column: 1 / -1; margin-top: 6px; border-top: 1px solid var(--line); padding-top: 10px; }
.nav-menu .menu-all a { color: var(--brand); font-weight: 550; }

.nav-cta { margin-left: 10px; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line-2); border-radius: 9px; width: 40px; height: 38px; margin-left: auto; cursor: pointer; align-items: center; justify-content: center; }
.nav-toggle span { display: block; width: 17px; height: 1.6px; background: var(--ink); position: relative; }
.nav-toggle span::before, .nav-toggle span::after { content: ""; position: absolute; left: 0; width: 17px; height: 1.6px; background: var(--ink); }
.nav-toggle span::before { top: -5.5px; } .nav-toggle span::after { top: 5.5px; }

@media (max-width: 980px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: fixed; inset: 68px 0 auto 0; margin: 0; padding: 14px var(--gutter) 26px;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: #fff; border-bottom: 1px solid var(--line);
    max-height: calc(100vh - 68px); overflow-y: auto;
    box-shadow: var(--shadow-lg);
    display: none;
  }
  .site-header[data-nav="open"] .nav-links { display: flex; }
  .nav-item { width: 100%; justify-content: space-between; padding: 12px 6px; font-size: 1rem; }
  .nav-menu {
    position: static; transform: none; min-width: 0; opacity: 1; visibility: visible; pointer-events: auto;
    box-shadow: none; border: 0; border-left: 2px solid var(--line); border-radius: 0;
    margin: 0 0 8px 8px; padding: 2px 0 2px 8px; grid-template-columns: 1fr; display: none;
  }
  .has-menu[data-open="true"] .nav-menu { display: grid; transform: none; }
  .nav-menu::before { content: none; }
  .nav-cta { margin: 14px 0 0; justify-content: center; align-self: stretch; }
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero { padding: 92px 0 76px; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(900px 420px at 12% -12%, rgba(36,71,232,.10), transparent 62%),
    radial-gradient(760px 380px at 92% 4%, rgba(0,168,143,.10), transparent 60%);
}
.hero h1 { max-width: 15ch; }
.hero .lede { max-width: 60ch; font-size: 1.24rem; }
.hero-sub { padding: 62px 0 44px; border-bottom: 1px solid var(--line); }
.hero-sub h1 { max-width: 20ch; }
.hero-sub .lede { max-width: 62ch; }

.breadcrumb { font-size: .84rem; color: var(--muted-2); margin-bottom: 16px; font-family: var(--mono); letter-spacing: .02em; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb span { margin: 0 .45em; opacity: .5; }

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  padding: 26px; box-shadow: var(--shadow-sm);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
  display: flex; flex-direction: column;
}
a.card { color: inherit; }
a.card:hover { border-color: var(--brand-100); box-shadow: var(--shadow); transform: translateY(-2px); color: inherit; }
.card h3 { margin-bottom: .4em; }
.card p { color: var(--muted); font-size: .95rem; margin-bottom: 0; }
.card p + .link-arrow { margin-top: 16px; }
.card .link-arrow { margin-top: auto; padding-top: 16px; }
.card-icon {
  width: 40px; height: 40px; border-radius: 11px; margin-bottom: 18px;
  background: var(--brand-050); color: var(--brand);
  display: flex; align-items: center; justify-content: center; flex: none;
}
.card-icon svg { width: 20px; height: 20px; }

.card-num {
  font-family: var(--mono); font-size: .78rem; color: var(--brand);
  letter-spacing: .1em; margin-bottom: 14px; display: block;
}

/* Use-case list card */
.uc { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 24px 26px; box-shadow: var(--shadow-sm); }
.uc h3 { font-size: 1.05rem; display: flex; align-items: flex-start; gap: 10px; }
.uc h3 .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-top: 9px; flex: none; }
.uc p { font-size: .94rem; color: var(--muted); margin-bottom: 0; }
.uc .tags { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px; }

.tag {
  font-family: var(--mono); font-size: .7rem; letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--line);
}
.tag.brand { background: var(--brand-050); color: var(--brand-700); border-color: var(--brand-100); }
.tag.accent { background: var(--accent-050); color: #077A69; border-color: #C7EBE4; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.stats div { background: #fff; padding: 26px 22px; }
.stats .n { font-size: 2.05rem; font-weight: 640; color: var(--brand); letter-spacing: -0.03em; line-height: 1.1; }
.stats .l { font-size: .88rem; color: var(--muted); margin-top: 4px; }
@media (max-width: 820px) { .stats { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 460px) { .stats { grid-template-columns: 1fr; } }

/* Steps */
.steps { counter-reset: s; display: grid; gap: 2px; }
.step { display: grid; grid-template-columns: 46px 1fr; gap: 18px; padding: 22px 0; border-top: 1px solid var(--line); }
.step:last-child { border-bottom: 1px solid var(--line); }
.step::before {
  counter-increment: s; content: counter(s, decimal-leading-zero);
  font-family: var(--mono); font-size: .8rem; color: var(--brand); letter-spacing: .06em; padding-top: 4px;
}
.step h4 { margin-bottom: .25em; }
.step p { color: var(--muted); font-size: .95rem; margin: 0; }

/* Layer block (platform page) */
.layer { border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; padding: 40px; box-shadow: var(--shadow-sm); }
.layer + .layer { margin-top: 26px; }
.layer-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
.layer-head .idx { font-family: var(--mono); font-size: .78rem; color: var(--brand); letter-spacing: .12em; }
.layer .feature-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px 34px; margin-top: 30px; padding: 0; list-style: none; }
.layer .feature-list li { margin: 0; padding-left: 20px; position: relative; font-size: .95rem; color: var(--muted); }
.layer .feature-list li::before { content: ""; position: absolute; left: 0; top: .62em; width: 7px; height: 7px; border-radius: 2px; background: var(--brand); opacity: .55; }
.layer .feature-list strong { color: var(--ink); font-weight: 600; display: block; font-size: .97rem; }
@media (max-width: 700px) { .layer { padding: 28px 22px; } .layer .feature-list { grid-template-columns: 1fr; } }

/* Case study */
.case { border: 1px solid var(--line); border-radius: var(--r); background: #fff; overflow: hidden; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; }
.case .case-top { padding: 26px 26px 0; }
.case .ph {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
  color: #9A6B00; background: #FFF6E0; border: 1px solid #F6E2AE; padding: 4px 9px; border-radius: 999px; margin-bottom: 16px;
}
.case h3 { font-size: 1.14rem; }
.case p { font-size: .95rem; color: var(--muted); }
.case dl { margin: 0; padding: 20px 26px; border-top: 1px solid var(--line); background: var(--surface); display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-top: auto; }
.case dl > div { display: flex; flex-direction: column; justify-content: flex-end; }
.case dt { font-size: .71rem; line-height: 1.35; color: var(--muted-2); font-family: var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.case dd { margin: 5px 0 0; font-size: 1.24rem; font-weight: 640; color: var(--ink); letter-spacing: -0.02em; line-height: 1.2; }
@media (max-width: 520px) { .case dl { grid-template-columns: 1fr 1fr; } }

.notice {
  border-left: 3px solid #F0C24B; background: #FFFBF0;
  padding: 16px 20px; border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: .9rem; color: #7A5A10;
}
.notice strong { color: #5E4508; }

/* Logo / pill strip */
.pillrow { display: flex; flex-wrap: wrap; gap: 10px; }
.pill {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 8px 16px; font-size: .89rem; font-weight: 500; color: var(--ink-2);
}
a.pill:hover { border-color: var(--brand); color: var(--brand); }

/* Diagram */
.diagram { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 30px; box-shadow: var(--shadow); }

/* CTA band */
.cta-band { background: var(--brand-deep); color: #C6D0F0; border-radius: var(--r-lg); padding: 56px; text-align: center; position: relative; overflow: hidden; }
.cta-band::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(600px 300px at 20% 0%, rgba(36,71,232,.55), transparent 60%),
              radial-gradient(500px 260px at 85% 100%, rgba(0,168,143,.35), transparent 60%);
}
.cta-band > * { position: relative; }
.cta-band h2 { color: #fff; max-width: 20ch; margin-inline: auto; }
.cta-band p { color: #BAC6EC; max-width: 58ch; margin-inline: auto; }
.cta-band .btn-row { justify-content: center; }
@media (max-width: 600px) { .cta-band { padding: 38px 22px; } }

/* Contact */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 620px) { .form-grid { grid-template-columns: 1fr; } }
label { display: block; font-size: .87rem; font-weight: 550; color: var(--ink); margin-bottom: 6px; }
input, select, textarea {
  width: 100%; font: inherit; font-size: .96rem; color: var(--ink);
  padding: 11px 14px; border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: #fff; transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-050); }
textarea { min-height: 130px; resize: vertical; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer { background: var(--ink); color: #97A2BA; padding: 62px 0 30px; font-size: .92rem; }
.site-footer h4 { color: #fff; font-size: .8rem; font-family: var(--mono); letter-spacing: .12em; text-transform: uppercase; font-weight: 500; margin-bottom: 14px; }
.site-footer a { color: #97A2BA; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 9px; }
.footer-brand { display: flex; align-items: center; gap: 9px; font-weight: 640; font-size: 1.14rem; color: #fff; letter-spacing: -0.03em; margin-bottom: 14px; }
.footer-brand:hover { color: #fff; }
.footer-bottom { margin-top: 46px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.1); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: .85rem; color: #6F7B93; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 30px; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

/* Reveal */
.rv { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .rv { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
  .btn:hover, a.card:hover { transform: none; }
}
