/* ============================================================================
   MALYX — shared stylesheet
   Dark "frontier-lab" identity + Anvil-style diagnosis-first structure
   ============================================================================ */

/* ─────────────────────────────  TOKENS  ───────────────────────────── */
:root {
  --ink:        #07080E;
  --ink-2:      #0B0D15;
  --surface:    #0F1119;
  --line:       rgba(255,255,255,0.08);
  --line-soft:  rgba(255,255,255,0.05);

  --text:       #F4F5FA;
  --text-mid:   #A2A7B6;
  --text-dim:   #6C7283;

  --v1: #9B7BFF;          /* violet */
  --v2: #5B8DEF;          /* azure  */
  --v3: #38D6E0;          /* teal   */
  --accent:      #7E8BFF;
  --accent-soft: rgba(126,139,255,0.14);
  --signal:      #38D6E0; /* "resolved" status color */

  --grad:      linear-gradient(120deg, var(--v1) 0%, var(--v2) 52%, var(--v3) 100%);
  --grad-text: linear-gradient(110deg, #C9BBFF 0%, #9FBEFF 45%, #8FE9EF 100%);

  --maxw: 1180px;
  --radius: 18px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--ink);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 450;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(680px 480px at 80% -10%, rgba(123,97,255,0.14), transparent 60%),
    radial-gradient(620px 520px at 4% 6%, rgba(56,150,255,0.09), transparent 58%),
    radial-gradient(900px 700px at 50% 122%, rgba(56,214,224,0.06), transparent 60%);
}

::selection { background: rgba(126,139,255,0.32); color: #fff; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 28px; position: relative; z-index: 1; }

/* ─────────────────────────────  SHARED BITS  ───────────────────────────── */
.eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px; font-weight: 500; letter-spacing: 2.5px;
  text-transform: uppercase; color: var(--accent);
  display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: ""; width: 22px; height: 1px; background: var(--accent); opacity: .7; }
.eyebrow.center { justify-content: center; }

.grad-text {
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

.btn {
  font-family: 'Inter', sans-serif; font-weight: 600; font-size: 14.5px;
  border-radius: 12px; padding: 11px 20px; cursor: pointer; border: 1px solid transparent;
  transition: transform .2s var(--ease), box-shadow .3s var(--ease), background .3s var(--ease);
  display: inline-flex; align-items: center; gap: 9px; white-space: nowrap;
}
.btn-primary { color: #0A0B12; background: var(--grad); box-shadow: 0 6px 22px -8px rgba(123,97,255,0.6); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 30px -8px rgba(123,97,255,0.7); }
.btn-ghost { color: var(--text); background: rgba(255,255,255,0.04); border-color: var(--line); }
.btn-ghost:hover { background: rgba(255,255,255,0.08); transform: translateY(-2px); }
.btn .arr { transition: transform .25s var(--ease); }
.btn:hover .arr { transform: translateX(3px); }
.btn:focus-visible, a:focus-visible, .link:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px;
}

/* ─────────────────────────────  NAV  ───────────────────────────── */
header.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  background: rgba(7,8,14,0.62);
  border-bottom: 1px solid transparent;
  transition: border-color .4s var(--ease), background .4s var(--ease);
}
header.nav.scrolled { border-bottom-color: var(--line); background: rgba(7,8,14,0.82); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 70px; }

.brand { display: flex; align-items: center; gap: 12px; }
.brand .tile {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(145deg,#171A26,#0C0E16);
  border: 1px solid #2A2F40; display: grid; place-items: center; flex: none;
}
.brand .tile svg { width: 22px; height: 22px; }
.brand .word { font-family: 'Sora', sans-serif; font-weight: 700; font-size: 20px; letter-spacing: 2px; }

.nav-links { display: flex; align-items: center; gap: 34px; }
.nav-links a.link { font-size: 14.5px; color: var(--text-mid); font-weight: 500; transition: color .25s var(--ease); position: relative; }
.nav-links a.link:hover { color: var(--text); }
.nav-links a.link.active { color: var(--text); }
.nav-links a.link.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -8px; height: 1.5px;
  background: var(--grad); border-radius: 2px;
}

.nav-cta { display: flex; align-items: center; gap: 14px; }
.menu-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 10px; width: 42px; height: 40px; cursor: pointer; }
.menu-toggle span { display: block; width: 18px; height: 1.6px; background: var(--text); margin: 4px auto; transition: .3s var(--ease); }

/* ─────────────────────────────  PAGE HERO (inner pages)  ──────────── */
.page-hero { padding: 76px 0 26px; }
.page-hero h1 {
  font-family: 'Sora', sans-serif; font-weight: 700;
  font-size: clamp(36px, 5vw, 60px); line-height: 1.04; letter-spacing: -0.025em; margin: 22px 0 18px;
}
.page-hero p.lede { font-size: clamp(16.5px, 1.6vw, 19px); color: var(--text-mid); max-width: 620px; }

/* ─────────────────────────────  HOME HERO  ───────────────────────── */
.hero { position: relative; padding: 80px 0 64px; }
.hero-grid { display: grid; grid-template-columns: 1.02fr 0.98fr; gap: 48px; align-items: center; }
.hero h1 {
  font-family: 'Sora', sans-serif; font-weight: 700;
  font-size: clamp(40px, 5.6vw, 70px); line-height: 1.03; letter-spacing: -0.025em; margin: 24px 0 22px;
}
.hero p.lede { font-size: clamp(16.5px, 1.6vw, 19px); color: var(--text-mid); max-width: 520px; margin-bottom: 32px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-actions .btn { padding: 14px 26px; font-size: 15px; }

/* ───────────────────────  DIAGNOSTIC CONSOLE (signature)  ─────────── */
.diagnostic {
  background: linear-gradient(180deg, #0E111B, #0A0C14);
  border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  box-shadow: 0 30px 70px -40px rgba(0,0,0,0.9);
  position: relative;
}
.diagnostic::before {
  content: ""; position: absolute; inset: 0; border-radius: 16px; padding: 1px;
  background: linear-gradient(160deg, rgba(123,97,255,0.5), rgba(56,214,224,0.18), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
.diag-head {
  display: flex; align-items: center; gap: 8px;
  padding: 13px 18px; border-bottom: 1px solid var(--line-soft);
  background: rgba(255,255,255,0.015);
}
.diag-dot { width: 9px; height: 9px; border-radius: 50%; background: #2A2F40; }
.diag-dot:nth-child(2) { background: #353B4E; }
.diag-dot:nth-child(3) { background: #404761; }
.diag-label {
  font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 1.5px;
  color: var(--text-dim); margin-left: 8px;
}
.diag-status {
  margin-left: auto; font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; letter-spacing: 1.5px;
  color: var(--signal); padding: 4px 10px; border: 1px solid rgba(56,214,224,0.3);
  border-radius: 100px; background: rgba(56,214,224,0.08); display: inline-flex; align-items: center; gap: 6px;
}
.diag-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 8px var(--signal); }
.diag-body { padding: 26px 22px 28px; }
.diag-row { padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.diag-row:last-child { border-bottom: none; }
.diag-k {
  font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; letter-spacing: 2px;
  color: var(--text-dim); text-transform: uppercase; display: block; margin-bottom: 8px;
}
.diag-row.deployed .diag-k { color: var(--accent); }
.diag-v { font-size: 16.5px; color: var(--text); line-height: 1.45; transition: opacity .4s var(--ease); }
.diag-row.deployed .diag-v { font-family: 'Sora', sans-serif; font-weight: 600; }
.diag-v.swap { opacity: 0; }
.diag-foot {
  font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: 1px;
  color: var(--text-dim); text-align: center; padding: 11px; border-top: 1px solid var(--line-soft);
}
.diag-progress { display: flex; gap: 5px; justify-content: center; margin-top: 4px; }
.diag-progress span { width: 18px; height: 2px; border-radius: 2px; background: #2A2F40; transition: background .3s var(--ease); }
.diag-progress span.on { background: var(--grad); }

/* ───────────────────────────  TRUST STRIP  ─────────────────────── */
.trust { border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); padding: 30px 0; }
.trust .lbl {
  font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; letter-spacing: 2px;
  text-transform: uppercase; color: var(--text-dim); text-align: center; margin-bottom: 20px;
}
.logos { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 16px 44px; }
.logos .logo {
  font-family: 'Sora', sans-serif; font-weight: 600; font-size: clamp(15px, 1.7vw, 19px);
  color: var(--text-mid); letter-spacing: .3px; opacity: .82; transition: opacity .3s var(--ease), color .3s var(--ease);
}
.logos .logo:hover { opacity: 1; color: var(--text); }

/* ─────────────────────────────  SECTIONS  ───────────────────────── */
section { position: relative; z-index: 1; }
.section-pad { padding: 96px 0; }
.section-head { max-width: 680px; margin-bottom: 52px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2 {
  font-family: 'Sora', sans-serif; font-weight: 700;
  font-size: clamp(30px, 3.6vw, 46px); letter-spacing: -0.02em; line-height: 1.08; margin: 18px 0 16px;
}
.section-head p { color: var(--text-mid); font-size: 17px; }

/* problem → fix cards (Solutions) */
.problems { display: grid; gap: 18px; }
.problem {
  display: grid; grid-template-columns: 1.1fr auto 1.2fr; gap: 28px; align-items: center;
  background: linear-gradient(180deg, rgba(255,255,255,0.022), rgba(255,255,255,0));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 30px;
  transition: border-color .35s var(--ease), transform .35s var(--ease);
}
.problem:hover { border-color: rgba(126,139,255,0.3); transform: translateY(-3px); }
.problem .tag { font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 1.5px; color: var(--text-dim); margin-bottom: 12px; }
.problem .sym { font-family: 'Sora', sans-serif; font-weight: 600; font-size: 19px; line-height: 1.3; color: var(--text); }
.problem .arrowcol { color: var(--accent); display: grid; place-items: center; }
.problem .fix .fix-k { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; letter-spacing: 2px; color: var(--accent); text-transform: uppercase; display: block; margin-bottom: 8px; }
.problem .fix p { color: var(--text-mid); font-size: 15px; line-height: 1.55; }
.problem .fix strong { color: var(--text); font-weight: 600; }

/* pillars */
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.pillar {
  background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px 28px 32px; position: relative; overflow: hidden;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.pillar::after {
  content: ""; position: absolute; inset: 0; border-radius: var(--radius); padding: 1px;
  background: var(--grad); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity .35s var(--ease); pointer-events: none;
}
.pillar:hover { transform: translateY(-5px); box-shadow: 0 24px 50px -28px rgba(0,0,0,0.8); }
.pillar:hover::after { opacity: .6; }
.pillar .p-tag { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--accent); letter-spacing: 1px; margin-bottom: 18px; }
.pillar h3 { font-family: 'Sora', sans-serif; font-weight: 600; font-size: 22px; letter-spacing: -0.01em; margin-bottom: 8px; }
.pillar .p-sub { color: var(--text-mid); font-size: 14.5px; margin-bottom: 22px; }
.pillar ul { list-style: none; display: flex; flex-direction: column; gap: 11px; }
.pillar li { font-size: 15px; color: var(--text); display: flex; gap: 11px; align-items: flex-start; }
.pillar li::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); margin-top: 9px; flex: none; }

/* approach steps */
.approach { background: var(--ink-2); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.step { padding: 6px 26px 6px 0; }
.step + .step { padding-left: 30px; border-left: 1px solid var(--line); }
.step .s-idx {
  font-family: 'Sora', sans-serif; font-weight: 800; font-size: 14px;
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(126,139,255,0.25); margin-bottom: 20px;
}
.step h4 { font-family: 'Sora', sans-serif; font-weight: 600; font-size: 19px; margin-bottom: 10px; }
.step p { color: var(--text-mid); font-size: 14.5px; }

/* why / principles */
.why-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.why-list { display: grid; gap: 4px; }
.why-item { padding: 22px 0; border-bottom: 1px solid var(--line-soft); display: flex; gap: 18px; align-items: flex-start; }
.why-item:last-child { border-bottom: none; }
.why-item .ic { width: 38px; height: 38px; border-radius: 10px; flex: none; display: grid; place-items: center; background: rgba(255,255,255,0.04); border: 1px solid var(--line); }
.why-item h5 { font-family: 'Sora', sans-serif; font-weight: 600; font-size: 17px; margin-bottom: 4px; }
.why-item p { color: var(--text-mid); font-size: 14.5px; }
.why-statement h2 { font-family: 'Sora', sans-serif; font-weight: 700; font-size: clamp(28px, 3.4vw, 42px); line-height: 1.12; letter-spacing: -0.02em; margin: 18px 0 18px; }
.why-statement p { color: var(--text-mid); font-size: 16.5px; }

/* about: principles grid */
.principles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.principle { border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0)); }
.principle .num { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--accent); letter-spacing: 1px; margin-bottom: 14px; }
.principle h4 { font-family: 'Sora', sans-serif; font-weight: 600; font-size: 19px; margin-bottom: 8px; }
.principle p { color: var(--text-mid); font-size: 15px; }

/* CTA */
.cta-band { text-align: center; }
.cta-card {
  border: 1px solid var(--line); border-radius: 26px; padding: 70px 40px;
  background: radial-gradient(600px 300px at 50% -20%, rgba(123,97,255,0.18), transparent 70%), linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0));
  position: relative; overflow: hidden;
}
.cta-card h2 { font-family: 'Sora', sans-serif; font-weight: 700; font-size: clamp(30px, 4vw, 52px); letter-spacing: -0.025em; line-height: 1.05; margin-bottom: 18px; }
.cta-card p { color: var(--text-mid); font-size: 18px; max-width: 520px; margin: 0 auto 34px; }
.cta-card .hero-actions { justify-content: center; }

/* ─────────────────────────────  CONTACT FORM  ───────────────────── */
.contact-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 56px; align-items: start; }
.contact-side h3 { font-family: 'Sora', sans-serif; font-weight: 600; font-size: 22px; margin-bottom: 14px; }
.contact-side p { color: var(--text-mid); font-size: 15.5px; margin-bottom: 26px; }
.contact-meta { display: grid; gap: 16px; }
.contact-meta a, .contact-meta span { display: flex; align-items: center; gap: 12px; color: var(--text-mid); font-size: 15px; transition: color .25s var(--ease); }
.contact-meta a:hover { color: var(--text); }
.contact-meta .ic { width: 34px; height: 34px; border-radius: 9px; background: rgba(255,255,255,0.04); border: 1px solid var(--line); display: grid; place-items: center; flex: none; }

.form-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; background: linear-gradient(180deg, rgba(255,255,255,0.022), rgba(255,255,255,0)); }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 500; color: var(--text-mid); margin-bottom: 8px; }
.field label .req { color: var(--accent); }
.field input, .field textarea, .field select {
  width: 100%; background: rgba(255,255,255,0.03); border: 1px solid var(--line); border-radius: 11px;
  padding: 13px 15px; color: var(--text); font-family: 'Inter', sans-serif; font-size: 15px; transition: border-color .25s var(--ease), background .25s var(--ease);
}
.field input::placeholder, .field textarea::placeholder { color: var(--text-dim); }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); background: rgba(255,255,255,0.05); }
.field textarea { resize: vertical; min-height: 130px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-submit { width: 100%; justify-content: center; padding: 15px; font-size: 15.5px; margin-top: 6px; }
.form-note { font-size: 12.5px; color: var(--text-dim); margin-top: 14px; text-align: center; }
.form-status { font-size: 14.5px; padding: 13px 16px; border-radius: 11px; margin-bottom: 18px; display: none; }
.form-status.show { display: block; }
.form-status.ok { background: rgba(56,214,224,0.1); border: 1px solid rgba(56,214,224,0.3); color: #9af0f5; }
.form-status.err { background: rgba(255,107,107,0.1); border: 1px solid rgba(255,107,107,0.3); color: #ffb3b3; }

/* ─────────────────────────────  FOOTER  ─────────────────────────── */
footer.foot { border-top: 1px solid var(--line); padding: 56px 0 40px; margin-top: 20px; }
.foot-top { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; margin-bottom: 44px; }
.foot-brand { max-width: 320px; }
.foot-brand .brand { margin-bottom: 16px; }
.foot-brand p { color: var(--text-dim); font-size: 14px; }
.foot-cols { display: flex; gap: 70px; flex-wrap: wrap; }
.foot-col h6 { font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-dim); margin-bottom: 16px; font-weight: 500; }
.foot-col a { display: block; color: var(--text-mid); font-size: 14.5px; margin-bottom: 11px; transition: color .25s var(--ease); }
.foot-col a:hover { color: var(--text); }
.foot-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 26px; border-top: 1px solid var(--line-soft); color: var(--text-dim); font-size: 13px; font-family: 'IBM Plex Mono', monospace; letter-spacing: .5px; }

/* ─────────────────────────────  REVEAL  ─────────────────────────── */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ─────────────────────────────  RESPONSIVE  ─────────────────────── */
@media (max-width: 920px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .pillars { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .step + .step { border-left: none; }
  .step:nth-child(n+1) { padding: 6px 16px 6px 0; }
  .why-grid, .contact-grid { grid-template-columns: 1fr; gap: 36px; }
  .principles { grid-template-columns: 1fr; }
  .problem { grid-template-columns: 1fr; gap: 16px; text-align: left; }
  .problem .arrowcol { justify-self: start; transform: rotate(90deg); }
  .nav-links { display: none; }
  .nav-cta .btn-ghost { display: none; }
  .menu-toggle { display: block; }
  .mobile-open .nav-links {
    display: flex; flex-direction: column; gap: 4px; position: absolute; top: 70px; left: 0; right: 0;
    background: rgba(9,10,18,0.97); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line);
    padding: 18px 28px 26px; align-items: stretch;
  }
  .mobile-open .nav-links a.link { padding: 12px 0; font-size: 16px; border-bottom: 1px solid var(--line-soft); }
  .mobile-open .nav-links a.link.active::after { display: none; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 20px; }
  .section-pad { padding: 68px 0; }
  .hero { padding: 48px 0 44px; }
  .steps { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .cta-card { padding: 50px 24px; }
  .form-card { padding: 24px; }
  .foot-cols { gap: 40px; }
}
