/* ProceMX — dark operations-console aesthetic */

:root {
  --bg-0: oklch(0.14 0.012 250);
  --bg-1: oklch(0.17 0.012 250);
  --bg-2: oklch(0.20 0.012 250);
  --bg-3: oklch(0.24 0.014 250);
  --line: oklch(0.28 0.016 250);
  --line-2: oklch(0.34 0.018 250);

  --fg: oklch(0.96 0.005 90);
  --fg-2: oklch(0.84 0.008 90);
  --fg-mute: oklch(0.65 0.012 250);
  --fg-dim: oklch(0.48 0.012 250);

  --accent: oklch(0.81 0.09 232);        /* logo sky blue */
  --accent-soft: oklch(0.81 0.09 232 / 0.14);
  --accent-line: oklch(0.81 0.09 232 / 0.45);

  --amber: oklch(0.86 0.13 85);          /* AI / governance */
  --amber-soft: oklch(0.86 0.13 85 / 0.14);
  --cyan: oklch(0.80 0.10 195);          /* data / spatial — teal */
  --cyan-soft: oklch(0.80 0.10 195 / 0.14);
  --green: oklch(0.75 0.13 155);         /* status: ok */
  --coral: oklch(0.76 0.09 25);          /* logo coral */
  --red: oklch(0.70 0.18 25);            /* status: alert */

  --radius: 6px;
  --radius-lg: 10px;

  --gap-y: clamp(96px, 12vw, 168px);
  --pad-x: clamp(20px, 4vw, 56px);
  --maxw: 1320px;

  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

[data-theme="light"] {
  --bg-0: oklch(0.99 0.003 90);
  --bg-1: oklch(0.97 0.004 90);
  --bg-2: oklch(0.95 0.005 90);
  --bg-3: oklch(0.92 0.006 90);
  --line: oklch(0.86 0.007 90);
  --line-2: oklch(0.78 0.008 90);
  --fg: oklch(0.18 0.012 250);
  --fg-2: oklch(0.30 0.012 250);
  --fg-mute: oklch(0.45 0.012 250);
  --fg-dim: oklch(0.60 0.012 250);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-0);
  color: var(--fg);
  font-family: var(--font-sans);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: -0.005em;
  overflow-x: hidden;
}

[data-density="compact"] { --gap-y: clamp(72px, 9vw, 128px); }
[data-density="comfy"]   { --gap-y: clamp(120px, 14vw, 200px); }

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

::selection { background: var(--accent-soft); color: var(--fg); }

/* ────── Typography ────── */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-mute);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: "";
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
}

h1, h2, h3, h4 { margin: 0; font-weight: 500; letter-spacing: -0.022em; }
h1 { font-size: clamp(40px, 6.4vw, 84px); line-height: 1.02; font-weight: 450; letter-spacing: -0.03em; }
h2 { font-size: clamp(30px, 4vw, 52px); line-height: 1.06; letter-spacing: -0.025em; }
h3 { font-size: clamp(20px, 1.6vw, 24px); line-height: 1.25; }
h4 { font-size: 15px; line-height: 1.3; }

p { margin: 0; }
.lead { font-size: clamp(17px, 1.4vw, 21px); line-height: 1.5; color: var(--fg-2); max-width: 62ch; letter-spacing: -0.005em; }

.mono { font-family: var(--font-mono); }
.muted { color: var(--fg-mute); }
.dim { color: var(--fg-dim); }

/* ────── Layout primitives ────── */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad-x);
  position: relative;
}
section { position: relative; }
.section-pad { padding: var(--gap-y) 0; }
.divider { border-top: 1px solid var(--line); }

/* Hairline grid background that runs the whole page */
.hairlines {
  position: absolute; inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px);
  background-size: calc(100% / 12) 100%;
  opacity: 0.32;
  mask-image: linear-gradient(to bottom, transparent, #000 5%, #000 95%, transparent);
}

/* ────── Buttons ────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, color .15s ease;
  cursor: default;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: oklch(0.16 0.012 250);
  border-color: var(--accent);
}
.btn-primary:hover { background: oklch(0.86 0.09 232); border-color: oklch(0.86 0.09 232); }
.btn-ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--line-2);
}
.btn-ghost:hover { background: var(--bg-2); border-color: var(--fg-mute); }
.btn-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--fg);
  font-size: 14px;
  font-weight: 500;
}
.btn-arrow .arr {
  display: inline-block;
  transition: transform .2s ease;
}
.btn-arrow:hover .arr { transform: translateX(3px); }
.btn-arrow.accent { color: var(--accent); }

/* ────── Cards ────── */
.card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}
.card-hover { transition: border-color .2s ease, background .2s ease, transform .2s ease; }
.card-hover:hover { border-color: var(--line-2); background: var(--bg-2); }

/* ────── Tags / chips ────── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-mute);
  background: var(--bg-1);
}
.tag-accent { color: var(--accent); border-color: var(--accent-line); }
.tag-amber  { color: var(--amber);  border-color: oklch(0.86 0.13 85 / 0.45); }
.tag-cyan   { color: var(--cyan);   border-color: oklch(0.80 0.10 195 / 0.45); }
.tag-green  { color: var(--green);  border-color: oklch(0.75 0.13 155 / 0.45); }
.tag-coral  { color: var(--coral);  border-color: oklch(0.76 0.09 25 / 0.45); }

/* ────── Placeholder image slot (striped) ────── */
.imgslot {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--bg-1);
  background-image: repeating-linear-gradient(
    135deg,
    transparent 0,
    transparent 10px,
    oklch(0.24 0.014 250) 10px,
    oklch(0.24 0.014 250) 11px
  );
  color: var(--fg-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  min-height: 120px;
}
.imgslot::after {
  content: "";
  position: absolute;
  top: 8px; right: 8px;
  width: 6px; height: 6px;
  border: 1px solid var(--fg-dim);
  border-radius: 50%;
}

/* ────── Section header ────── */
.s-head {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 48px;
  align-items: end;
  margin-bottom: 56px;
}
@media (max-width: 860px) {
  .s-head { grid-template-columns: 1fr; gap: 16px; }
}
.s-head .lead { margin-top: 0; }

/* ────── Nav ────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in oklch, var(--bg-0) 78%, transparent);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav-links { display: flex; gap: 4px; }
.nav-link { padding: 6px 12px; font-size: 13.5px; color: var(--fg-2); border-radius: 4px; }
.nav-link:hover { background: var(--bg-2); color: var(--fg); }
.nav-link.is-active { color: var(--fg); background: var(--bg-2); }

/* Logo image */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.logo img {
  height: 43px;
  width: auto;
  display: block;
}

/* ────── Status dot ────── */
.dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px oklch(0.75 0.13 155 / 0.18);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px oklch(0.75 0.13 155 / 0.18); }
  50% { box-shadow: 0 0 0 5px oklch(0.75 0.13 155 / 0.08); }
}

/* ────── Marquee animation ────── */
@keyframes marq { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ────── Number ticks ────── */
.num-tick {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--fg-dim);
  letter-spacing: 0.04em;
}

/* ────── Inline code-ish ────── */
.kbd {
  font-family: var(--font-mono);
  font-size: 11.5px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: 1px 6px;
  border-radius: 3px;
  color: var(--fg-2);
}

/* ────── Glow line ────── */
.glow-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.6;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE / MOBILE
   ═══════════════════════════════════════════════════════════ */

/* Hamburger toggle (hidden on desktop) */
.nav-toggle {
  display: none;
  width: 38px; height: 38px;
  align-items: center; justify-content: center;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  background: var(--bg-1);
  cursor: pointer;
  flex-shrink: 0;
}
.nav-toggle:hover { background: var(--bg-2); }
.nav-toggle .bars { position: relative; width: 16px; height: 12px; display: block; }
.nav-toggle .bars::before,
.nav-toggle .bars::after,
.nav-toggle .bars > span {
  content: "";
  position: absolute; left: 0; right: 0;
  height: 1.5px; background: var(--fg);
  transition: transform .2s ease, top .2s ease, opacity .15s;
}
.nav-toggle .bars::before { top: 0; }
.nav-toggle .bars > span  { top: 5px; display: block; }
.nav-toggle .bars::after  { top: 10px; }
.nav-toggle[aria-expanded="true"] .bars::before { top: 5px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bars::after  { top: 5px; transform: rotate(-45deg); }
.nav-toggle[aria-expanded="true"] .bars > span  { opacity: 0; }

/* Drawer (hidden until is-open and mobile) */
.nav-drawer { display: none; }

/* ── Tablet/large mobile ─────────────────────────────────── */
@media (max-width: 860px) {
  :root {
    --pad-x: clamp(16px, 5vw, 24px);
    --gap-y: clamp(64px, 12vw, 96px);
  }

  /* Defensive: keep visuals from blowing out cards */
  .card svg,
  .card img,
  section > .wrap svg {
    max-width: 100%;
    height: auto;
  }

  /* Nav switches to hamburger */
  .nav-links,
  .nav-cta { display: none !important; }
  .nav-toggle { display: inline-flex; }
  .nav-inner { height: 56px; }
  .logo img { height: 34px; }

  .nav-drawer {
    display: block;
    position: fixed;
    top: 56px; left: 0; right: 0;
    max-height: calc(100vh - 56px);
    overflow-y: auto;
    padding: 8px var(--pad-x) 32px;
    background: var(--bg-0);
    border-bottom: 1px solid var(--line);
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: transform .2s ease, opacity .2s ease;
    z-index: 99;
  }
  .nav-drawer.is-open {
    transform: translateY(0) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }
  .nav-drawer nav { display: flex; flex-direction: column; }
  .nav-drawer .nav-link {
    display: block;
    padding: 16px 4px;
    font-size: 17px;
    color: var(--fg);
    border-bottom: 1px solid var(--line);
    border-radius: 0;
  }
  .nav-drawer .nav-link.is-active { background: transparent; color: var(--accent); }
  .nav-drawer .btn {
    width: 100%;
    height: 48px;
    margin-top: 20px;
    justify-content: center;
    font-size: 14.5px;
  }
}

/* ── Stack 2-col grids ───────────────────────────────────── */
@media (max-width: 760px) {
  .hero-grid,
  .console-main,
  .mxmobile-grid,
  .ai-grid,
  .pagehero-grid,
  .footer-outer,
  .spatial-grid,
  .finance-ledger-grid,
  .rules-grid,
  .settings-grid {
    grid-template-columns: 1fr !important;
    gap: 36px !important;
  }
  .mxmobile-features {
    grid-template-columns: 1fr 1fr !important;
    gap: 18px !important;
  }
  .console-kpis {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .console-kpis > div:nth-child(2) { border-right: none !important; }
  .console-kpis > div:nth-child(1),
  .console-kpis > div:nth-child(2) { border-bottom: 1px solid var(--line); }

  .finance-kpis {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .finance-kpis > div { border-right: 1px solid var(--line) !important; border-bottom: 1px solid var(--line); }
  .finance-kpis > div:nth-child(2n) { border-right: none !important; }
  /* The projection chart cell is last — let it span full width */
  .finance-kpis > div:last-child {
    grid-column: 1 / -1;
    border-right: none !important;
    border-bottom: none;
  }

  .footer-cols {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 28px !important;
  }

  /* Section padding tightens */
  section.section-pad { padding: 64px 0; }
  .s-head { margin-bottom: 32px; gap: 12px; }

  /* Buttons: ghost stack neatly */
  .hero .btn,
  section .btn {
    /* don't force full-width on every button; just keep them sane */
    white-space: normal;
  }

  /* Wide horizontal-scroll regions */
  .scroll-x {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .scroll-x::-webkit-scrollbar { height: 6px; }
  .scroll-x::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }

  /* Make the ledger table scroll horizontally inside its card column */
  .finance-ledger-grid > div:first-child {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .finance-ledger-grid > div:first-child > div {
    min-width: 600px;
  }
  /* Audit drawer goes below ledger, kill its left border so it doesn't look detached */
  .finance-ledger-grid > div:nth-child(2) {
    border-top: 1px solid var(--line);
  }

  /* Rules grid stacked: sidebar becomes top strip */
  .rules-grid > div:first-child {
    border-right: none !important;
    border-bottom: 1px solid var(--line);
  }

  /* Spatial map: side panel goes below */
  .spatial-grid > div:nth-child(2) {
    border-left: none !important;
    border-top: 1px solid var(--line);
    min-height: auto;
  }

  /* PhoneMockup centers and shrinks */
  .phone-mockup {
    max-width: 280px !important;
  }

  /* Wide marquee-ish chip rows — wrap cleanly */
  .tag {
    white-space: nowrap;
  }
}

/* ── Phone (≤480) ───────────────────────────────────────── */
@media (max-width: 480px) {
  :root {
    --pad-x: 16px;
    --gap-y: 56px;
  }
  body { font-size: 15px; line-height: 1.5; }
  h1 { font-size: clamp(34px, 10vw, 44px); line-height: 1.04; }
  h2 { font-size: clamp(26px, 7.5vw, 34px); line-height: 1.1; }
  .lead { font-size: 15.5px; }

  .footer-cols { grid-template-columns: 1fr !important; }
  .console-kpis,
  .finance-kpis { grid-template-columns: 1fr !important; }
  .console-kpis > div,
  .finance-kpis > div {
    border-right: none !important;
    border-bottom: 1px solid var(--line);
  }
  .console-kpis > div:last-child,
  .finance-kpis > div:last-child { border-bottom: none; }

  .mxmobile-features {
    grid-template-columns: 1fr !important;
  }

  /* The hero CTAs and other button rows: full-width on smallest screens */
  .hero .btn,
  section .btn-primary,
  section .btn-ghost {
    flex: 1 1 100%;
  }

  /* Tighter card padding */
  .card { border-radius: 8px; }
  section.section-pad { padding: 48px 0; }
}

/* Avoid horizontal page scroll regardless */
html { overflow-x: hidden; }

/* ────── Scroll hint ────── */
#scroll-hint {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 16px;
  background: color-mix(in oklch, var(--bg-1) 86%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--fg-2);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: 0 12px 32px -12px oklch(0 0 0 / 0.5);
  transition: opacity .35s ease;
  pointer-events: none;
  user-select: none;
  opacity: 0;
}
#scroll-hint .sh-chev {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px; height: 16px;
  color: var(--accent);
  font-size: 13px;
  animation: sh-bounce 1.7s ease-in-out infinite;
  line-height: 1;
}
@keyframes sh-bounce {
  0%, 100% { transform: translateY(-2px); opacity: 0.85; }
  50%      { transform: translateY(2px);  opacity: 1; }
}
@media (max-width: 480px) {
  #scroll-hint { bottom: 14px; padding: 7px 12px 7px 14px; font-size: 9.5px; gap: 8px; }
  #scroll-hint .sh-chev { width: 14px; height: 14px; font-size: 12px; }
}
@media print { #scroll-hint { display: none; } }
@media (prefers-reduced-motion: reduce) {
  #scroll-hint .sh-chev { animation: none; }
}

/* ────── SEO / crawler fallback content (hidden once React mounts) ────── */
.seo-fallback {
  position: absolute;
  left: -99999px;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
noscript .ns-shell {
  display: block;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 48px var(--pad-x);
  color: var(--fg);
}
noscript .ns-shell h1 { margin: 0 0 16px; font-size: clamp(32px, 5vw, 56px); }
noscript .ns-shell p { color: var(--fg-2); font-size: 17px; line-height: 1.5; }
noscript .ns-shell nav { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; }
noscript .ns-shell nav a { color: var(--accent); }
