/* =========================================================================
   Leal Systems — design system
   Engineering/infrastructure studio. Dark, editorial, Swiss grotesk type,
   soft-lime accent. Restraint in the chrome, complexity in the work shown.
   ========================================================================= */

:root {
  /* --- surfaces (near-black, faintly cool) --- */
  --bg:          #08090a;
  --bg-1:        #0c0d0f;
  --bg-2:        #121316;
  --panel:       #0f1013;
  --panel-2:     #15161a;
  --line:        rgba(255,255,255,0.085);
  --line-strong: rgba(255,255,255,0.16);

  /* --- ink --- */
  --fg:        #ECEDEE;
  --fg-dim:    #9CA0A6;
  --fg-faint:  #686C72;

  /* --- accent: soft lime (yellow-green, light) --- */
  --acc:        #CFE85A;
  --acc-deep:   #B4D239;
  --acc-ink:    #11160a;            /* text that sits on lime */
  --acc-soft:   rgba(207,232,90,0.14);
  --acc-line:   rgba(207,232,90,0.42);
  --acc-glow:   rgba(207,232,90,0.20);

  /* --- type --- */
  --f-display: "Space Grotesk", "Hanken Grotesk", system-ui, sans-serif;
  --f-body:    "Hanken Grotesk", system-ui, -apple-system, sans-serif;
  --f-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* --- rhythm --- */
  --maxw: 1200px;
  --pad: clamp(20px, 5vw, 64px);
  --r: 14px;
  --r-sm: 9px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: var(--f-body);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.55;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }
input { font: inherit; }
::selection { background: var(--acc); color: var(--acc-ink); }

/* ---------------------------------------------------------------- layout */
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad); }
.section { padding-block: clamp(72px, 11vw, 150px); position: relative; }
.section--tight { padding-block: clamp(56px, 8vw, 104px); }

/* a faint blueprint grid used behind some sections */
.gridlines {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 40%, #000 0%, transparent 80%);
          mask-image: radial-gradient(ellipse 70% 70% at 50% 40%, #000 0%, transparent 80%);
  opacity: 0.5;
}
.section > .wrap { position: relative; z-index: 1; }

/* --------------------------------------------------------------- type */
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 500; line-height: 1.04; letter-spacing: -0.02em; }
.display {
  font-size: clamp(2.5rem, 6.2vw, 5.1rem);
  line-height: 0.99; letter-spacing: -0.035em; font-weight: 500;
}
.h-sec { font-size: clamp(1.9rem, 3.6vw, 3rem); letter-spacing: -0.03em; }
.lead { font-size: clamp(1.05rem, 1.5vw, 1.32rem); color: var(--fg-dim); line-height: 1.5; }
.balance { text-wrap: balance; }
.pretty { text-wrap: pretty; }

/* mono kicker / labels */
.kicker {
  font-family: var(--f-mono); font-size: 0.72rem; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--acc);
  display: inline-flex; align-items: center; gap: 0.6em;
}
.kicker::before {
  content: ""; width: 7px; height: 7px; border-radius: 2px;
  background: var(--acc); box-shadow: 0 0 10px var(--acc-glow); flex: none;
}
.kicker--muted { color: var(--fg-faint); }
.kicker--muted::before { background: var(--fg-faint); box-shadow: none; }
.mono { font-family: var(--f-mono); }

.sec-head { max-width: 760px; margin-bottom: clamp(36px, 5vw, 64px); }
.sec-head .h-sec { margin-top: 18px; }
.sec-head .lead { margin-top: 20px; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.55em;
  padding: 13px 22px; border-radius: 999px; font-weight: 600;
  font-size: 0.95rem; letter-spacing: -0.01em;
  border: 1px solid transparent; transition: transform .25s var(--ease), background .25s, box-shadow .35s, border-color .25s;
  will-change: transform;
}
.btn .arr { transition: transform .3s var(--ease); }
.btn:hover .arr { transform: translateX(3px); }
.btn--primary { background: var(--acc); color: var(--acc-ink); box-shadow: 0 0 0 rgba(207,232,90,0); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 10px 34px -10px var(--acc-glow), 0 0 0 1px var(--acc-deep); }
.btn--ghost { border-color: var(--line-strong); color: var(--fg); background: rgba(255,255,255,0.015); }
.btn--ghost:hover { border-color: var(--acc-line); transform: translateY(-2px); background: var(--acc-soft); }
.btn--lg { padding: 16px 28px; font-size: 1.02rem; }
.btn:focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; }

.link-arrow { display: inline-flex; align-items: center; gap: 0.5em; color: var(--fg); font-weight: 600; }
.link-arrow .arr { transition: transform .3s var(--ease); color: var(--acc); }
.link-arrow:hover .arr { transform: translateX(4px); }

/* ============================================================ NAV / HEADER */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background .4s, border-color .4s, backdrop-filter .4s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(8,9,10,0.72);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom-color: var(--line);
}
.nav .wrap { display: flex; align-items: center; gap: 28px; height: 68px; }

/* wordmark + node glyph */
.brand { display: inline-flex; align-items: center; gap: 11px; flex: none; }
.brand__glyph { width: 26px; height: 26px; flex: none; }
.brand__glyph .nd { fill: var(--acc); }
.brand__glyph .ed { stroke: var(--acc); stroke-width: 1.6; fill: none; opacity: 0.7; }
.brand__name {
  font-family: var(--f-display); font-weight: 600; font-size: 1.16rem;
  letter-spacing: -0.025em; color: var(--fg);
}
.brand__name .dim { color: var(--fg-faint); font-weight: 500; }
.brand:hover .brand__glyph { animation: glyphPulse 1.4s var(--ease); }
@keyframes glyphPulse { 0%,100%{ transform: none } 40%{ transform: scale(1.08) } }

.nav__spacer { flex: 1; }
.nav__links { display: flex; align-items: center; gap: 4px; }
.nav__link {
  padding: 8px 13px; border-radius: 8px; color: var(--fg-dim); font-size: 0.93rem;
  font-weight: 500; transition: color .2s, background .2s; position: relative;
}
.nav__link:hover { color: var(--fg); background: rgba(255,255,255,0.04); }
.nav__link.active { color: var(--fg); }

/* language toggle */
.langtog {
  display: inline-flex; align-items: center; border: 1px solid var(--line-strong);
  border-radius: 999px; overflow: hidden; font-family: var(--f-mono);
  font-size: 0.72rem; font-weight: 500; height: 34px;
}
.langtog button { padding: 0 12px; height: 100%; color: var(--fg-faint); transition: color .2s, background .25s; letter-spacing: 0.04em; }
.langtog button.on { background: var(--acc); color: var(--acc-ink); }
.langtog button:not(.on):hover { color: var(--fg); }

/* mobile menu button */
.nav__burger { display: none; width: 40px; height: 40px; border-radius: 9px; border: 1px solid var(--line-strong); align-items: center; justify-content: center; flex-direction: column; gap: 4px; }
.nav__burger span { width: 17px; height: 1.6px; background: var(--fg); transition: transform .3s var(--ease), opacity .2s; }
.nav.open .nav__burger span:nth-child(1) { transform: translateY(5.6px) rotate(45deg); }
.nav.open .nav__burger span:nth-child(2) { opacity: 0; }
.nav.open .nav__burger span:nth-child(3) { transform: translateY(-5.6px) rotate(-45deg); }

@media (max-width: 880px) {
  .nav__burger { display: flex; }
  .nav__links {
    position: fixed; inset: 68px 0 auto 0; flex-direction: column; align-items: stretch;
    background: rgba(8,9,10,0.97); backdrop-filter: blur(16px);
    padding: 16px var(--pad) 28px; gap: 2px; border-bottom: 1px solid var(--line);
    transform: translateY(-12px); opacity: 0; pointer-events: none; transition: transform .3s var(--ease), opacity .3s;
  }
  .nav.open .nav__links { transform: none; opacity: 1; pointer-events: auto; }
  .nav__link { padding: 14px 8px; font-size: 1.05rem; border-bottom: 1px solid var(--line); border-radius: 0; }
  .nav__cta-wrap { padding-top: 14px; }
  .nav__cta-wrap .btn { width: 100%; justify-content: center; }
}

/* ================================================================= HERO */
.hero { position: relative; min-height: 100svh; display: flex; align-items: center; overflow: hidden; }
#hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.hero__scrim {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(120% 80% at 22% 60%, rgba(8,9,10,0.92) 0%, rgba(8,9,10,0.55) 38%, rgba(8,9,10,0) 70%),
    linear-gradient(0deg, rgba(8,9,10,0.9) 0%, rgba(8,9,10,0) 32%),
    linear-gradient(180deg, rgba(8,9,10,0.85) 0%, rgba(8,9,10,0) 22%);
}
.hero .wrap { position: relative; z-index: 2; width: 100%; padding-top: 96px; padding-bottom: 64px; }
.hero__inner { max-width: 720px; }
.hero__badge {
  display: inline-flex; align-items: center; gap: 9px; padding: 7px 14px 7px 11px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: rgba(255,255,255,0.025);
  font-size: 0.8rem; color: var(--fg-dim); margin-bottom: 26px; backdrop-filter: blur(6px);
}
.hero__badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--acc); box-shadow: 0 0 0 0 var(--acc-glow); animation: liveDot 2.4s infinite; }
@keyframes liveDot { 0%{ box-shadow: 0 0 0 0 var(--acc-glow);} 70%{ box-shadow: 0 0 0 7px rgba(207,232,90,0);} 100%{ box-shadow: 0 0 0 0 rgba(207,232,90,0);} }
.hero h1 { margin-bottom: 26px; }
.hero h1 .accent { color: var(--acc); }
.hero__sub { font-size: clamp(1.05rem, 1.7vw, 1.35rem); color: var(--fg-dim); max-width: 560px; margin-bottom: 36px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.hero__stats { display: flex; gap: 34px; margin-top: 52px; flex-wrap: wrap; }
.hero__stat .n { font-family: var(--f-display); font-size: 1.7rem; font-weight: 600; letter-spacing: -0.02em; }
.hero__stat .n .accent { color: var(--acc); }
.hero__stat .l { font-size: 0.84rem; color: var(--fg-faint); margin-top: 2px; }
.hero__scroll { position: absolute; left: var(--pad); bottom: 26px; z-index: 2; font-family: var(--f-mono); font-size: 0.68rem; letter-spacing: 0.18em; color: var(--fg-faint); text-transform: uppercase; display: flex; align-items: center; gap: 10px; }
.hero__scroll .bar { width: 34px; height: 1px; background: var(--fg-faint); position: relative; overflow: hidden; }
.hero__scroll .bar::after { content:""; position:absolute; inset:0; background: var(--acc); transform: translateX(-100%); animation: scrollBar 2.6s var(--ease) infinite; }
@keyframes scrollBar { 0%{transform:translateX(-100%)} 60%,100%{transform:translateX(100%)} }

/* ============================================================ REVEALS */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-d="1"] { transition-delay: .08s; }
.reveal[data-d="2"] { transition-delay: .16s; }
.reveal[data-d="3"] { transition-delay: .24s; }
.reveal[data-d="4"] { transition-delay: .32s; }
.reveal[data-d="5"] { transition-delay: .40s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}
/* motion-off (prefers-reduced-motion OR ?nofx): show final state, no transition dependency */
.reduce-motion .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }

/* ============================================================ WHAT WE DO */
.contrast { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 12px; }
.contrast__col {
  border: 1px solid var(--line); border-radius: var(--r); padding: 30px;
  position: relative; background: linear-gradient(180deg, rgba(255,255,255,0.018), transparent);
}
.contrast__col h4 { font-size: 1.18rem; margin-bottom: 6px; }
.contrast__col .tag { font-family: var(--f-mono); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-faint); }
.contrast__col.is-us { border-color: var(--acc-line); background: linear-gradient(180deg, var(--acc-soft), transparent 60%); }
.contrast__col.is-us .tag { color: var(--acc); }
.contrast__list { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-direction: column; gap: 12px; }
.contrast__list li { display: flex; gap: 11px; font-size: 0.97rem; color: var(--fg-dim); line-height: 1.4; }
.contrast__list li .mk { flex: none; margin-top: 2px; color: var(--fg-faint); font-family: var(--f-mono); }
.is-us .contrast__list li { color: var(--fg); }
.is-us .contrast__list li .mk { color: var(--acc); }
@media (max-width: 720px) { .contrast { grid-template-columns: 1fr; } }

/* ============================================================ SOLUTIONS */
.pillar { margin-bottom: 44px; }
.pillar__head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.pillar__idx { font-family: var(--f-mono); font-size: 0.78rem; color: var(--acc); }
.pillar__name { font-family: var(--f-display); font-size: 1.05rem; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; }
.pillar__leak { font-size: 0.88rem; color: var(--fg-faint); margin-left: auto; text-align: right; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.scard {
  position: relative; border: 1px solid var(--line); border-radius: var(--r);
  padding: 24px; background: var(--panel); overflow: hidden; cursor: pointer;
  transition: transform .4s var(--ease), border-color .4s, background .4s;
  display: flex; flex-direction: column; min-height: 168px;
}
.scard::before {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .5s;
  background: radial-gradient(420px 200px at var(--mx,50%) var(--my,0%), var(--acc-soft), transparent 70%);
  pointer-events: none;
}
.scard:hover { transform: translateY(-4px); border-color: var(--acc-line); }
.scard:hover::before { opacity: 1; }
.scard__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.scard__node { width: 34px; height: 34px; }
.scard__flag { font-family: var(--f-mono); font-size: 0.64rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--acc-ink); background: var(--acc); padding: 3px 8px; border-radius: 5px; font-weight: 600; }
.scard h3 { font-size: 1.22rem; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 8px; line-height: 1.1; }
.scard p { font-size: 0.94rem; color: var(--fg-dim); line-height: 1.42; }
.scard__foot { margin-top: auto; padding-top: 18px; display: flex; align-items: center; gap: 8px; font-family: var(--f-mono); font-size: 0.74rem; color: var(--fg-faint); transition: color .3s; }
.scard:hover .scard__foot { color: var(--acc); }
.scard__foot .arr { transition: transform .3s var(--ease); }
.scard:hover .scard__foot .arr { transform: translateX(4px); }

.solutions-more { margin-top: 40px; display: flex; justify-content: center; }

.custom-note { margin-top: 40px; padding: clamp(28px, 4vw, 44px); border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--panel); max-width: 760px; }
.custom-note .kicker { margin-bottom: 14px; }
.custom-note h3 { font-family: var(--f-display); font-size: clamp(1.25rem, 2.2vw, 1.6rem); font-weight: 500; letter-spacing: -0.02em; line-height: 1.2; }
.custom-note p { color: var(--fg-dim); margin-top: 14px; max-width: 60ch; }
.custom-note__cta { margin-top: 24px; }

/* ============================================================ HOW IT WORKS */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: step; }
.step {
  border: 1px solid var(--line); border-radius: var(--r); padding: 30px 26px;
  background: var(--panel); position: relative; transition: border-color .4s, transform .4s var(--ease);
}
.step:hover { border-color: var(--acc-line); transform: translateY(-3px); }
.step__n { font-family: var(--f-mono); font-size: 0.78rem; color: var(--acc); margin-bottom: 22px; display: block; }
.step h3 { font-size: 1.3rem; font-weight: 600; margin-bottom: 10px; }
.step p { color: var(--fg-dim); font-size: 0.96rem; }
.step__pill { display: inline-block; margin-top: 18px; font-family: var(--f-mono); font-size: 0.72rem; padding: 5px 11px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--fg-dim); }
.step--risk .step__pill { color: var(--acc); border-color: var(--acc-line); background: var(--acc-soft); }
@media (max-width: 800px) { .steps { grid-template-columns: 1fr; } }

/* ============================================================ FOUNDER */
.founder { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(30px, 6vw, 80px); align-items: center; }
.founder__visual {
  aspect-ratio: 4/5; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
  background: var(--panel); position: relative;
}
.founder__quote { font-family: var(--f-display); font-size: clamp(1.5rem, 2.6vw, 2.1rem); font-weight: 500; line-height: 1.18; letter-spacing: -0.02em; }
.founder__quote .accent { color: var(--acc); }
.founder__by { margin-top: 26px; display: flex; align-items: center; gap: 14px; }
.founder__by .nm { font-weight: 600; }
.founder__by .rl { color: var(--fg-faint); font-size: 0.9rem; font-family: var(--f-mono); }
.founder__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.chip { font-family: var(--f-mono); font-size: 0.74rem; padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--fg-dim); }
@media (max-width: 760px) { .founder { grid-template-columns: 1fr; } .founder__visual { max-width: 320px; } }

/* placeholder image slot */
.ph {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background-image: repeating-linear-gradient(135deg, rgba(255,255,255,0.03) 0 10px, transparent 10px 20px);
  color: var(--fg-faint); font-family: var(--f-mono); font-size: 0.74rem; letter-spacing: 0.1em; text-align: center; padding: 20px;
}
.ph span { border: 1px dashed var(--line-strong); padding: 8px 12px; border-radius: 6px; }

/* ============================================================ FOOTER CTA */
.cta-band { position: relative; overflow: hidden; border-top: 1px solid var(--line); }
.cta-band__inner { text-align: center; max-width: 720px; margin-inline: auto; position: relative; z-index: 2; }
.cta-band h2 { font-size: clamp(2.1rem, 4.6vw, 3.6rem); letter-spacing: -0.035em; margin-bottom: 22px; }
.cta-band .lead { margin-bottom: 34px; }
.cta-band__cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.cta-band #cta-canvas { position: absolute; inset: 0; z-index: 0; opacity: 0.5; -webkit-mask-image: radial-gradient(ellipse 60% 90% at 50% 50%, #000, transparent 75%); mask-image: radial-gradient(ellipse 60% 90% at 50% 50%, #000, transparent 75%); }

/* ============================================================ SITE FOOTER */
.foot { border-top: 1px solid var(--line); padding-block: 54px; background: var(--bg-1); }
.foot__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 40px; }
.foot__bio { color: var(--fg-dim); font-size: 0.95rem; max-width: 320px; margin-top: 16px; }
.foot__col h5 { font-family: var(--f-mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-faint); margin-bottom: 16px; font-weight: 500; }
.foot__col a { display: block; color: var(--fg-dim); font-size: 0.94rem; padding: 5px 0; transition: color .2s; }
.foot__col a:hover { color: var(--acc); }
.foot__bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 48px; padding-top: 26px; border-top: 1px solid var(--line); color: var(--fg-faint); font-size: 0.84rem; font-family: var(--f-mono); }
.foot__phone a { color: var(--fg-dim); text-underline-offset: 2px; transition: color .2s; }
.foot__phone a:hover { color: var(--acc); }
@media (max-width: 760px) { .foot__grid { grid-template-columns: 1fr 1fr; } .foot__col--bio { grid-column: 1 / -1; } }

/* ============================================================ TODO marker */
.todo {
  font-family: var(--f-mono); font-size: 0.68rem; letter-spacing: 0.04em; color: #f5c451;
  border: 1px dashed rgba(245,196,81,0.4); background: rgba(245,196,81,0.06);
  padding: 2px 7px; border-radius: 5px; display: inline-block;
}

/* page top spacing for routed (non-home) views */
.page { padding-top: 68px; min-height: 100vh; }
.page-hero { padding-block: clamp(54px, 9vw, 110px) clamp(30px, 5vw, 56px); border-bottom: 1px solid var(--line); position: relative; overflow: hidden; }
.crumb { font-family: var(--f-mono); font-size: 0.76rem; color: var(--fg-faint); display: flex; gap: 8px; align-items: center; margin-bottom: 22px; }
.crumb a:hover { color: var(--acc); }
.crumb .sep { opacity: 0.5; }
