/* ============================================================
   KAROS — Autonomous Runtime Network
   Shared design system : Dark + Gold / tech-cyber
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700;800&display=swap');

:root {
  /* ---- color ---- */
  --black:      #000000;
  --bg:         #050506;
  --panel:      #0a0a0c;
  --panel-2:    #0e0e11;
  --panel-3:    #131318;
  --line:       rgba(245,180,0,.14);
  --line-soft:  rgba(255,255,255,.07);

  --gold-hi:    #ffe9a8;
  --gold:       #f5b400;
  --gold-deep:  #c98a00;
  --gold-glow:  rgba(245,180,0,.55);
  --gold-faint: rgba(245,180,0,.08);

  --metal: linear-gradient(150deg, #fff2c4 0%, #ffd75e 22%, #f5b400 52%, #c98a00 78%, #8f6200 100%);
  --metal-soft: linear-gradient(150deg, #ffe9a8, #f5b400 60%, #c98a00);

  --white:   #ffffff;
  --txt:     #e9e9ee;
  --muted:   #9a9aa6;
  --dim:     #5e5e6b;

  /* ---- type ---- */
  --f-display: 'Chakra Petch', sans-serif;
  --f-mono:    'JetBrains Mono', monospace;

  /* ---- layout ---- */
  --maxw: 1280px;
  --nav-h: 72px;
  --radius: 4px;

  --ease: cubic-bezier(.22,.61,.36,1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--txt);
  font-family: var(--f-mono);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

/* page-wide subtle starfield / circuit grain */
body::before {
  content: "";
  position: fixed; inset: 0;
  background-image:
    radial-gradient(circle at 20% 15%, rgba(245,180,0,.05), transparent 30%),
    radial-gradient(circle at 85% 80%, rgba(245,180,0,.04), transparent 35%);
  pointer-events: none;
  z-index: 0;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; }

/* ---------- typography ---------- */
h1,h2,h3,h4 { font-family: var(--f-display); font-weight: 700; line-height: 1.04; letter-spacing: -.01em; color: var(--white); }
.display {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 7vw, 6rem);
  line-height: .98;
  letter-spacing: -.02em;
  text-transform: uppercase;
}
.h-section {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(2rem, 4.4vw, 3.6rem);
  text-transform: uppercase;
  letter-spacing: -.01em;
}
.gold-text {
  background: var(--metal);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.eyebrow {
  font-family: var(--f-mono);
  font-size: .72rem; font-weight: 600;
  letter-spacing: .42em; text-transform: uppercase;
  color: var(--gold);
  display: inline-flex; align-items: center; gap: .7em;
}
.eyebrow::before {
  content: ""; width: 26px; height: 1px; background: var(--gold); opacity: .7;
}
.lead { color: var(--muted); font-size: 1.05rem; line-height: 1.7; }
.mono-label { font-family: var(--f-mono); font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--dim); }

/* ---------- layout helpers ---------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 32px; position: relative; z-index: 2; }
.section { padding: clamp(80px, 11vw, 160px) 0; position: relative; }
.section-tight { padding: clamp(56px, 7vw, 96px) 0; }
.center { text-align: center; }
.divider { height: 1px; background: var(--line); width: 100%; }

/* ---------- backgrounds: circuit / grid ---------- */
.grid-bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 35%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 35%, transparent 80%);
}
.glow-orb {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle, var(--gold-glow), transparent 65%);
  filter: blur(40px); opacity: .35; pointer-events: none; z-index: 0;
}

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; height: var(--nav-h);
  display: flex; align-items: center; z-index: 100;
  transition: background .3s var(--ease), border-color .3s var(--ease), backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(5,5,6,.78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav .container { display: flex; align-items: center; justify-content: space-between; }
.nav-logo { display: flex; align-items: center; gap: 12px; }
.nav-logo img { height: 34px; width: auto; filter: drop-shadow(0 0 8px rgba(245,180,0,.4)); }
.nav-logo .wm { font-family: var(--f-display); font-weight: 700; font-size: 1.35rem; letter-spacing: .12em; color: #fff; }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a {
  font-family: var(--f-mono); font-size: .78rem; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  position: relative; padding: 6px 0; transition: color .25s;
}
.nav-links a:hover, .nav-links a.active { color: var(--white); }
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 0;
  background: var(--gold); transition: width .3s var(--ease);
}
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.nav-cta { display: flex; align-items: center; gap: 14px; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); width: 42px; height: 38px; border-radius: var(--radius); color: var(--gold); font-size: 1.1rem; }

/* ---------- buttons ---------- */
.btn {
  font-family: var(--f-mono); font-size: .8rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase;
  padding: 13px 26px; border-radius: var(--radius);
  display: inline-flex; align-items: center; gap: 10px;
  border: 1px solid transparent; position: relative; overflow: hidden;
  transition: transform .2s var(--ease), box-shadow .3s, background .3s, color .3s;
  white-space: nowrap;
}
.btn-gold { background: var(--metal); color: #1a1200; box-shadow: 0 0 0 rgba(245,180,0,0); }
.btn-gold:hover { box-shadow: 0 8px 30px -6px var(--gold-glow); }
.btn-ghost { background: transparent; color: var(--white); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); background: var(--gold-faint); }
.btn-sm { padding: 9px 18px; font-size: .72rem; }
.btn svg { width: 15px; height: 15px; }
.btn .arrow { transition: transform .25s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

/* ---------- cards ---------- */
.card {
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px; position: relative; overflow: hidden;
  transition: border-color .3s var(--ease), transform .3s var(--ease), box-shadow .3s;
}
.card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0; transition: opacity .35s;
}
.card:hover { border-color: rgba(245,180,0,.4); transform: translateY(-4px); box-shadow: 0 20px 50px -24px rgba(245,180,0,.3); }
.card:hover::before { opacity: 1; }
.card-icon {
  width: 48px; height: 48px; border-radius: var(--radius);
  display: grid; place-items: center; margin-bottom: 20px;
  background: var(--gold-faint); border: 1px solid var(--line); color: var(--gold);
}
.card-icon svg { width: 24px; height: 24px; }
.card h3 { font-size: 1.15rem; margin-bottom: 10px; letter-spacing: 0; }
.card p { color: var(--muted); font-size: .9rem; line-height: 1.65; }

/* corner brackets accent */
.bracket { position: relative; }
.bracket::before, .bracket::after {
  content: ""; position: absolute; width: 14px; height: 14px; border: 1px solid var(--gold); opacity: .6;
}
.bracket::before { top: 10px; left: 10px; border-right: 0; border-bottom: 0; }
.bracket::after { bottom: 10px; right: 10px; border-left: 0; border-top: 0; }

/* ---------- stat ---------- */
.stat .num { font-family: var(--f-display); font-weight: 700; font-size: clamp(2.2rem,4vw,3.2rem); color: var(--white); line-height: 1; }
.stat .num .gold-text, .stat .num.gold-text { display: inline; }
.stat .lbl { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-top: 10px; }

/* ---------- chip / tag ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--f-mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold); border: 1px solid var(--line); border-radius: 100px;
  padding: 5px 12px; background: var(--gold-faint);
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.dot-pulse { animation: pulse 1.8s infinite; }
@keyframes pulse { 0%,100%{ opacity:1; box-shadow:0 0 8px var(--gold);} 50%{opacity:.35; box-shadow:0 0 2px var(--gold);} }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); background: var(--black); position: relative; z-index: 2; }
.footer-top { padding: 72px 0 56px; display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 40px; }
.footer-brand img { height: 40px; margin-bottom: 18px; filter: drop-shadow(0 0 8px rgba(245,180,0,.4)); }
.footer-brand p { color: var(--muted); font-size: .85rem; max-width: 280px; }
.footer-col h4 { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin-bottom: 18px; font-weight: 600; }
.footer-col a { display: block; color: var(--muted); font-size: .85rem; padding: 6px 0; transition: color .2s, padding-left .2s; }
.footer-col a:hover { color: var(--white); padding-left: 5px; }
.footer-bot { border-top: 1px solid var(--line); padding: 24px 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-bot p { font-family: var(--f-mono); font-size: .72rem; color: var(--dim); letter-spacing: .05em; }
.socials { display: flex; gap: 10px; }
.socials a { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: var(--radius); display: grid; place-items: center; color: var(--muted); transition: all .25s; }
.socials a:hover { color: var(--gold); border-color: var(--gold); background: var(--gold-faint); transform: translateY(-2px); }
.socials svg { width: 17px; height: 17px; }

/* ---------- scroll reveal ---------- */
[data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
[data-reveal].in { opacity: 1; transform: none; }
/* bulletproof floor: never leave content invisible (e.g. throttled tab) */
html.reveal-floor [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
[data-reveal-delay="1"] { transition-delay: .08s; }
[data-reveal-delay="2"] { transition-delay: .16s; }
[data-reveal-delay="3"] { transition-delay: .24s; }
[data-reveal-delay="4"] { transition-delay: .32s; }
[data-reveal-delay="5"] { transition-delay: .4s; }

/* ---------- page hero band ---------- */
.page-hero { padding: calc(var(--nav-h) + 90px) 0 60px; position: relative; overflow: hidden; }
.page-hero .container { position: relative; z-index: 2; }
.breadcrumb { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); margin-bottom: 22px; }
.breadcrumb a:hover { color: var(--gold); }
.breadcrumb span { color: var(--gold); }

/* ---------- marquee ---------- */
.marquee { overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--black); padding: 18px 0; }
.marquee-track { display: flex; gap: 48px; width: max-content; animation: marquee 32s linear infinite; }
.marquee-track span { font-family: var(--f-display); font-weight: 700; font-size: 1.1rem; text-transform: uppercase; letter-spacing: .05em; color: var(--dim); display: flex; align-items: center; gap: 48px; }
.marquee-track span::after { content: "◆"; color: var(--gold); font-size: .7rem; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* selection */
::selection { background: var(--gold); color: #000; }

/* scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--black); }
::-webkit-scrollbar-thumb { background: #2a2a30; border-radius: 10px; border: 2px solid var(--black); }
::-webkit-scrollbar-thumb:hover { background: var(--gold-deep); }

/* ---------- responsive ---------- */
@media (max-width: 1040px) {
  .nav-links { display: none; }
  .nav-toggle { display: grid; place-items: center; }
  .nav-links.open {
    display: flex; flex-direction: column; position: absolute; top: var(--nav-h); left: 0; right: 0;
    background: rgba(5,5,6,.97); border-bottom: 1px solid var(--line); padding: 24px 32px; gap: 18px; align-items: flex-start;
  }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .nav-cta .btn-ghost { display: none; }
}
@media (max-width: 560px) {
  .container { padding: 0 20px; }
  .footer-top { grid-template-columns: 1fr; }
}
