/* ================================================================
   ShadowsClaw AI — design tokens aligned with shadowsagent.net
   ================================================================ */
:root {
  --bg: #0c0c0c;
  --bg-alt: #121316;
  --bg-panel: #181a1d;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.15);
  --red: #e63a46;
  --red-hi: #ff6760;
  --red-lo: #b50c05;
  --gold: #f4d092;
  --green: #31c98d;
  --text: #e6e8ec;
  --muted: #a3a3a3;
  --font: "HarmonyOS Sans", "PingFang SC", "Microsoft Yahei", "Heiti SC",
    "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --nav-h: 72px;
  --radius: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.01em; }
[dir="rtl"] body { letter-spacing: 0; }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease,
    border-color 0.18s ease;
  white-space: nowrap;
}
.btn--primary {
  background: linear-gradient(180deg, var(--red-hi) 0%, var(--red-lo) 100%);
  color: #fff;
  box-shadow: 0 4px 24px rgba(230, 58, 70, 0.35);
}
.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(230, 58, 70, 0.5);
}
.btn--ghost {
  border-color: var(--line-strong);
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}
.btn--ghost:hover { border-color: var(--red); color: var(--red-hi); }
.btn--lg { padding: 14px 32px; font-size: 16px; border-radius: 12px; }

/* ---------------- typography helpers ---------------- */
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--red);
  text-transform: uppercase;
  margin-bottom: 16px;
}
.grad {
  background: linear-gradient(92deg, var(--red-hi) 0%, var(--red) 45%, var(--gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ================= NAV ================= */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  transition: background 0.25s ease, border-color 0.25s ease, backdrop-filter 0.25s ease;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(12, 12, 12, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}
.nav__inner {
  max-width: 1200px;
  margin: 0 auto;
  height: var(--nav-h);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav__logo { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; }
.nav__logo em { color: var(--red); font-style: normal; font-weight: 800; }
.nav__logo b { color: var(--red-hi); }
.nav__claw { width: 24px; height: 24px; color: var(--red); flex: none; }
.nav__links { display: flex; gap: 28px; font-size: 14.5px; color: var(--muted); }
.nav__links a { transition: color 0.15s ease; }
.nav__links a:hover { color: var(--text); }
.nav__actions { display: flex; align-items: center; gap: 14px; }
.nav__cta { padding: 8px 18px; font-size: 14px; }

/* language dropdown */
.lang { position: relative; }
.lang__btn {
  display: flex; align-items: center; gap: 6px;
  background: none; border: 1px solid var(--line-strong);
  color: var(--text); font-family: var(--mono); font-size: 12.5px;
  padding: 7px 12px; border-radius: 8px; cursor: pointer;
  transition: border-color 0.15s ease;
}
.lang__btn:hover { border-color: var(--red); }
.lang__btn svg { width: 10px; height: 6px; }
.lang__list {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 148px; max-height: 320px; overflow-y: auto;
  background: var(--bg-panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 6px;
  display: none; z-index: 110;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}
[dir="rtl"] .lang__list { right: auto; left: 0; }
.lang.is-open .lang__list { display: block; }
.lang__list li {
  padding: 8px 12px; border-radius: 7px; font-size: 13.5px;
  color: var(--muted); cursor: pointer; display: flex; justify-content: space-between; gap: 12px;
}
.lang__list li:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.lang__list li.is-active { color: var(--red-hi); }
.lang__list li code { font-family: var(--mono); font-size: 11px; opacity: 0.6; }

/* burger + mobile menu */
.nav__burger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 6px; }
.nav__burger span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: transform 0.2s ease, opacity 0.2s ease; }
.nav__burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__burger.is-open span:nth-child(2) { opacity: 0; }
.nav__burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.nav__mobile {
  display: none; flex-direction: column; gap: 4px;
  background: rgba(12, 12, 12, 0.97); border-bottom: 1px solid var(--line);
  padding: 12px 24px 24px;
}
.nav__mobile.is-open { display: flex; }
.nav__mobile > a { padding: 12px 4px; border-bottom: 1px solid var(--line); font-size: 16px; }
.nav__mobile > .btn { margin-top: 16px; border-bottom: none; }
.nav__mobile-langs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.nav__mobile-langs button {
  background: none; border: 1px solid var(--line-strong); color: var(--muted);
  font-family: var(--mono); font-size: 12px; padding: 6px 12px; border-radius: 7px; cursor: pointer;
}
.nav__mobile-langs button.is-active { border-color: var(--red); color: var(--red-hi); }

/* ================= HERO ================= */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: calc(var(--nav-h) + 48px) 24px 80px;
  overflow: hidden;
}
.hero__bg { position: absolute; inset: 0; pointer-events: none; }
.hero__paths { position: absolute; inset: 0; width: 100%; height: 100%; }
.hpath {
  fill: none;
  stroke: rgba(230, 58, 70, 0.4);
  stroke-width: 1.5;
  stroke-dasharray: 6 10;
}
.hpath--gold { stroke: rgba(244, 208, 146, 0.25); }
.hero__glow {
  position: absolute;
  width: 720px; height: 720px;
  right: -200px; top: -180px;
  background: radial-gradient(circle, rgba(230, 58, 70, 0.16) 0%, rgba(230, 58, 70, 0) 65%);
}
.hero__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 40%, transparent 100%);
}
.hero__inner { position: relative; max-width: 1200px; margin: 0 auto; width: 100%; }
.hero__title { font-size: clamp(42px, 7vw, 84px); font-weight: 800; margin-bottom: 24px; }
.hero__sub { max-width: 620px; font-size: 18px; color: var(--muted); margin-bottom: 36px; }
.hero__ctas { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 48px; }
.hero__stats { display: flex; gap: 28px; flex-wrap: wrap; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.hero__stats li { display: flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot--red { background: var(--red); box-shadow: 0 0 10px var(--red); }
.dot--gold { background: var(--gold); box-shadow: 0 0 10px var(--gold); }
.dot--green { background: var(--green); box-shadow: 0 0 10px var(--green); }

/* ================= VISUAL FRAMES (imagery) ================= */
.visual-frame {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(230, 58, 70, 0.35);
  background: var(--bg-panel);
  box-shadow: 0 24px 80px rgba(230, 58, 70, 0.18), 0 8px 30px rgba(0, 0, 0, 0.6);
}
.visual-frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.visual-frame::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(200deg, rgba(230, 58, 70, 0.16) 0%, rgba(12, 12, 12, 0) 45%, rgba(12, 12, 12, 0.55) 100%);
  pointer-events: none;
}
.visual-frame--tint img { filter: grayscale(0.9) contrast(1.05) brightness(0.7); }
.visual-frame--tint::after {
  background: linear-gradient(200deg, rgba(230, 58, 70, 0.38) 0%, rgba(181, 12, 5, 0.22) 50%, rgba(12, 12, 12, 0.6) 100%);
  mix-blend-mode: multiply;
}
.visual-frame__scan {
  position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 4px);
}
.visual-frame__badge {
  position: absolute; left: 14px; bottom: 14px;
  display: flex; align-items: center; gap: 8px;
  background: rgba(12, 12, 12, 0.72);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 6px 14px;
  z-index: 2;
}
[dir="rtl"] .visual-frame__badge { left: auto; right: 14px; }
.visual-frame__mono { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.08em; color: var(--text); }

/* hero split layout */
.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  align-items: center;
  gap: 56px;
}
.hero__visual { position: relative; }
.visual-frame--hero { aspect-ratio: 10 / 11; max-width: 520px; margin-inline: auto; }
.visual-frame--hero img { filter: contrast(1.06) brightness(0.92) saturate(0.85); }
.hero__visual::before {
  content: "";
  position: absolute; inset: 8% -6% -8% 6%;
  border: 1px dashed rgba(230, 58, 70, 0.35);
  border-radius: 22px;
  pointer-events: none;
}
[dir="rtl"] .hero__visual::before { inset: 8% 6% -8% -6%; }

/* agents split layout */
.agents-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.35fr);
  gap: 32px;
  align-items: stretch;
}
.agents-layout__visual .visual-frame { height: 100%; min-height: 420px; }
.agents-layout__cards { align-content: stretch; }

/* infrastructure banner */
.infra-banner {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  margin-bottom: 24px;
  max-height: 300px;
}
.infra-banner img {
  display: block; width: 100%; height: 300px; object-fit: cover;
  filter: brightness(0.85) saturate(0.9);
}
.infra-banner__overlay {
  position: absolute; inset: 0;
  display: flex; align-items: flex-end;
  padding: 20px;
  background: linear-gradient(180deg, rgba(12, 12, 12, 0.15) 0%, rgba(12, 12, 12, 0.82) 100%);
}

/* float animation */
.float { animation: floaty 6s ease-in-out infinite; }
.float--slow { animation-duration: 8.5s; }
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
@media (prefers-reduced-motion: reduce) { .float { animation: none; } }

/* ================= SECTIONS ================= */
.section { padding: 110px 24px; }
.section--alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section__inner { max-width: 1200px; margin: 0 auto; }
.section__title { font-size: clamp(30px, 4.4vw, 48px); font-weight: 800; margin-bottom: 14px; }
.section__sub { color: var(--muted); font-size: 17px; max-width: 560px; margin-bottom: 52px; }

/* grids & cards */
.grid { display: grid; gap: 20px; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 28px;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
  backdrop-filter: blur(6px);
}
.card:hover {
  border-color: rgba(230, 58, 70, 0.45);
  background: rgba(230, 58, 70, 0.04);
  transform: translateY(-4px);
}
.card h3 { font-size: 19px; margin-bottom: 10px; }
.card p { color: var(--muted); font-size: 15px; }
.card__icon {
  width: 46px; height: 46px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
}
.card__icon svg { width: 24px; height: 24px; }
.card__icon--red { background: rgba(230, 58, 70, 0.12); color: var(--red-hi); }
.card__icon--gold { background: rgba(244, 208, 146, 0.1); color: var(--gold); }
.card__icon--green { background: rgba(49, 201, 141, 0.1); color: var(--green); }
.card--row { display: flex; gap: 20px; align-items: flex-start; }
.card__num { font-family: var(--mono); font-size: 13px; color: var(--red); border: 1px solid rgba(230, 58, 70, 0.3); border-radius: 8px; padding: 4px 9px; flex: none; }
.card--tall { min-height: 200px; }
.card__mono { font-family: var(--mono); font-size: 12.5px; color: var(--gold); margin-bottom: 16px; }

/* ================= FLOW (convergence) ================= */
.flow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  counter-reset: step;
  position: relative;
}
.flow__step {
  position: relative;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
}
.flow__step::after {
  content: "→";
  position: absolute;
  top: 30px; right: -19px;
  color: var(--red);
  font-size: 18px;
  z-index: 2;
}
[dir="rtl"] .flow__step::after { content: "←"; right: auto; left: -19px; }
.flow__step:last-child::after { display: none; }
.flow__node {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%;
  font-family: var(--mono); font-size: 14px;
  background: rgba(230, 58, 70, 0.14); color: var(--red-hi);
  border: 1px solid rgba(230, 58, 70, 0.4);
  margin-bottom: 18px;
}
.flow__node--loop { background: rgba(49, 201, 141, 0.12); color: var(--green); border-color: rgba(49, 201, 141, 0.4); }
.flow__step h3 { font-size: 17px; margin-bottom: 8px; }
.flow__step p { color: var(--muted); font-size: 14px; }

/* ================= THREADS ================= */
#threads {
  position: relative;
  background:
    linear-gradient(180deg, rgba(12, 12, 12, 0.94) 0%, rgba(12, 12, 12, 0.86) 50%, rgba(12, 12, 12, 0.96) 100%),
    url("../assets/images/threads-code.jpg") center / cover no-repeat;
}
.threads { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.thread {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  font-size: 14.5px;
}
.thread header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 10px; }
.thread__id { font-family: var(--mono); font-size: 13px; color: var(--gold); }
.thread p { color: var(--muted); }
.tag {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em;
  padding: 3px 9px; border-radius: 999px;
}
.tag--green { color: var(--green); background: rgba(49, 201, 141, 0.1); border: 1px solid rgba(49, 201, 141, 0.35); }
.tag--red { color: var(--red-hi); background: rgba(230, 58, 70, 0.1); border: 1px solid rgba(230, 58, 70, 0.4); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.55; } }

/* ================= CTA ================= */
.cta {
  padding: 130px 24px;
  position: relative;
  overflow: hidden;
  text-align: center;
  background: url("../assets/images/cta-circuit.jpg") center / cover no-repeat fixed;
}
.cta::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 50% 100%, rgba(230, 58, 70, 0.22) 0%, transparent 70%),
    linear-gradient(180deg, rgba(12, 12, 12, 0.93) 0%, rgba(12, 12, 12, 0.82) 100%);
  pointer-events: none;
}
.cta__inner { position: relative; max-width: 760px; margin: 0 auto; }
.cta__title { font-size: clamp(28px, 4.5vw, 46px); font-weight: 800; margin-bottom: 16px; }
.cta__sub { color: var(--muted); font-size: 17px; margin-bottom: 36px; }

/* ================= FOOTER ================= */
.footer { border-top: 1px solid var(--line); padding: 48px 24px; background: var(--bg); }
.footer__inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.footer__brand { display: flex; align-items: center; gap: 12px; }
.footer__brand .nav__claw { width: 28px; height: 28px; }
.footer__name { font-weight: 700; }
.footer__name em { color: var(--red); font-style: normal; }
.footer__name b { color: var(--red-hi); }
.footer__tag { font-size: 12.5px; color: var(--muted); font-family: var(--mono); }
.footer__links { display: flex; gap: 24px; font-size: 14px; color: var(--muted); }
.footer__links a:hover { color: var(--text); }
.footer__rights { font-size: 12.5px; color: var(--muted); }

/* ================= reveal animation base ================= */
.reveal { opacity: 0; transform: translateY(22px); }
.reveal.is-visible { opacity: 1; transform: none; transition: opacity 0.7s ease, transform 0.7s ease; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ================= responsive ================= */
@media (max-width: 1080px) {
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .flow { grid-template-columns: repeat(2, 1fr); }
  .flow__step:nth-child(2)::after { display: none; }
  .threads { grid-template-columns: 1fr; }
  .hero__inner { grid-template-columns: 1fr; gap: 40px; }
  .visual-frame--hero { max-width: 440px; aspect-ratio: 16 / 12; }
  .agents-layout { grid-template-columns: 1fr; }
  .agents-layout__visual .visual-frame { min-height: 260px; max-height: 320px; }
  .cta { background-attachment: scroll; }
}
@media (max-width: 820px) {
  .nav__links, .nav__cta, .lang { display: none; }
  .nav__burger { display: flex; }
  .grid--2, .grid--3 { grid-template-columns: 1fr; }
  .flow { grid-template-columns: 1fr; }
  .flow__step::after { display: none; }
  .section { padding: 80px 20px; }
  .hero__stats { flex-direction: column; gap: 12px; }
  .footer__inner { flex-direction: column; align-items: flex-start; }
}
