/* ============================================================
   Hermes Agent landing — design system
   ============================================================ */
:root {
  --bg: #07070d;
  --bg-soft: #0c0c15;
  --surface: #10101c;
  --surface-2: #151523;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #ececf4;
  --muted: #9a9ab2;
  --faint: #6b6b85;
  --violet: #8b5cf6;
  --cyan: #22d3ee;
  --green: #4ade80;
  --amber: #fbbf24;
  --red: #f87171;
  --grad: linear-gradient(92deg, #a78bfa 0%, #8b5cf6 38%, #22d3ee 100%);
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --radius: 16px;
  --maxw: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: rgba(139, 92, 246, 0.4); color: #fff; }

a { color: inherit; text-decoration: none; }
img, svg { display: block; }
button { font-family: inherit; cursor: pointer; }

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- scroll progress ---------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px;
  background: transparent; z-index: 200; pointer-events: none;
}
.scroll-progress span {
  display: block; height: 100%; width: 0%;
  background: var(--grad);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.7);
}

/* ---------- nav ---------- */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), backdrop-filter 0.3s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-nav.scrolled {
  background: rgba(7, 7, 13, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 24px;
  height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: -0.02em; }
.brand-mark { width: 26px; height: 26px; fill: none; stroke: url(#gradient-def); stroke: var(--violet); stroke-width: 1.8; }
.brand-accent { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-links { display: flex; gap: 28px; font-size: 14.5px; color: var(--muted); }
.nav-links a { position: relative; transition: color 0.2s; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 2px; width: 0;
  background: var(--grad); transition: width 0.25s var(--ease); border-radius: 2px;
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }
.nav-cta { flex-shrink: 0; }
.nav-burger { display: none; background: none; border: 1px solid var(--border); border-radius: 10px; padding: 10px; }
.nav-burger span { display: block; width: 18px; height: 2px; background: var(--text); margin: 3px 0; border-radius: 2px; transition: transform 0.25s var(--ease), opacity 0.2s; }
.nav-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.nav-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }
.nav-mobile[hidden] { display: none; }
.nav-mobile {
  display: flex; flex-direction: column; gap: 4px; padding: 12px 24px 20px;
  background: rgba(7, 7, 13, 0.96); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border);
}
.nav-mobile a { padding: 12px 4px; font-size: 16px; color: var(--muted); border-bottom: 1px solid var(--border); }
.nav-mobile a:hover { color: var(--text); }
.nav-mobile .btn { margin-top: 12px; text-align: center; border-bottom: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-display); font-weight: 600; font-size: 15px;
  padding: 12px 22px; border-radius: 12px; border: 1px solid transparent;
  transition: transform 0.2s var(--ease), box-shadow 0.25s var(--ease), background 0.25s, border-color 0.25s;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary {
  background: var(--grad); color: #0b0b14; box-shadow: 0 8px 28px rgba(139, 92, 246, 0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(139, 92, 246, 0.5); }
.btn-ghost { border-color: var(--border-strong); color: var(--text); background: rgba(255, 255, 255, 0.02); }
.btn-ghost:hover { border-color: rgba(139, 92, 246, 0.6); background: rgba(139, 92, 246, 0.08); transform: translateY(-2px); }

/* ---------- hero ---------- */
.hero { position: relative; padding: 122px 24px 80px; overflow: hidden; }
.hero-inner { max-width: var(--maxw); margin: 0 auto; position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; text-align: center; }
.grid-overlay {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 30%, transparent 75%);
}
.glow { position: absolute; border-radius: 50%; filter: blur(90px); z-index: 0; pointer-events: none; will-change: transform; }
.glow-a { width: 560px; height: 560px; background: rgba(139, 92, 246, 0.22); top: -180px; left: -120px; }
.glow-b { width: 480px; height: 480px; background: rgba(34, 211, 238, 0.14); top: 80px; right: -140px; }

.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13.5px; color: var(--muted);
  border: 1px solid var(--border); background: rgba(255,255,255,0.03);
  padding: 7px 16px; border-radius: 999px; margin-bottom: 20px;
}
.hero-badge svg { width: 14px; height: 14px; stroke: var(--amber); fill: none; stroke-width: 1.8; }
.hero-badge strong { color: var(--text); font-weight: 600; }

.hero-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(44px, 7vw, 84px); line-height: 1.02; letter-spacing: -0.035em;
  margin-bottom: 20px;
}
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { max-width: 640px; font-size: 17.5px; color: var(--muted); margin-bottom: 26px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-bottom: 16px; }
.hero-hint { font-size: 13px; color: var(--faint); font-family: var(--font-mono); margin-bottom: 42px; }

/* ---------- terminal mock ---------- */
.terminal {
  width: 100%; max-width: 720px; text-align: left;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(20,20,34,0.9), rgba(12,12,21,0.95));
  box-shadow: 0 30px 80px rgba(0,0,0,0.55), 0 0 0 1px rgba(139,92,246,0.06), 0 0 60px rgba(139,92,246,0.08);
  overflow: hidden;
}
.terminal-bar, .code-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}
.dot { width: 11px; height: 11px; border-radius: 50%; }
.dot-r { background: var(--red); } .dot-y { background: var(--amber); } .dot-g { background: var(--green); }
.terminal-title, .code-title { margin-left: 8px; font-family: var(--font-mono); font-size: 12.5px; color: var(--faint); }
.terminal-body { padding: 20px 22px; font-family: var(--font-mono); font-size: 14px; line-height: 1.9; }
.t-line { color: var(--text); }
.t-line.t-dim { color: var(--faint); font-size: 12.5px; margin-bottom: 8px; }
.t-line.t-out { color: var(--muted); font-size: 13.5px; }
.t-prompt { color: var(--green); margin-right: 8px; user-select: none; }
.t-ok { color: var(--green); margin-right: 6px; }
.t-cursor { display: flex; align-items: center; }
.cursor-block {
  width: 9px; height: 18px; background: var(--green);
  animation: blink 1.1s steps(2, start) infinite;
  margin-left: 8px;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- marquee ---------- */
.marquee-section { padding: 26px 0 70px; }
.marquee-label { text-align: center; font-size: 12.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); margin-bottom: 22px; }
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, black 12%, black 88%, transparent); mask-image: linear-gradient(90deg, transparent, black 12%, black 88%, transparent); }
.marquee-track { display: flex; width: max-content; animation: marquee 32s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-group { display: flex; align-items: center; flex-shrink: 0; min-width: 100vw; }
.marquee-group span {
  font-family: var(--font-display); font-weight: 600; font-size: 22px; color: var(--muted);
  padding: 0 26px; white-space: nowrap; position: relative;
}
.marquee-group span::after {
  content: "◆"; position: absolute; right: -4px; top: 50%; transform: translateY(-50%);
  font-size: 9px; color: var(--violet); opacity: 0.7;
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- sections ---------- */
.section { max-width: var(--maxw); margin: 0 auto; padding: 90px 24px; }
.section-head { margin-bottom: 52px; }
.section-head.split { display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; }
.section-head.split .section-sub { margin: 0; max-width: 460px; }
.kicker {
  font-family: var(--font-mono); font-size: 13px; color: var(--violet);
  letter-spacing: 0.16em; text-transform: uppercase; margin-bottom: 14px;
}
.section-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(32px, 4.6vw, 52px); line-height: 1.08; letter-spacing: -0.03em; margin-bottom: 18px; }
.section-sub { font-size: 16.5px; color: var(--muted); max-width: 560px; }

/* ---------- feature cards ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  background: linear-gradient(180deg, var(--surface), var(--bg-soft));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 30px 28px; position: relative; overflow: hidden;
  transition: transform 0.3s var(--ease), border-color 0.3s, box-shadow 0.3s var(--ease);
}
.card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--grad); opacity: 0; transition: opacity 0.3s;
}
.card:hover { transform: translateY(-6px); border-color: var(--border-strong); box-shadow: 0 22px 50px rgba(0,0,0,0.45); }
.card:hover::before { opacity: 1; }
.card-icon {
  width: 48px; height: 48px; border-radius: 12px; margin-bottom: 20px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(139, 92, 246, 0.12); border: 1px solid rgba(139, 92, 246, 0.25);
}
.card-icon svg { width: 24px; height: 24px; stroke: var(--violet); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.card h3 { font-family: var(--font-display); font-size: 19px; margin-bottom: 10px; letter-spacing: -0.01em; }
.card p { font-size: 14.5px; color: var(--muted); }

/* ---------- terminal section ---------- */
.terminal-section { position: relative; }
.code-window {
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: #0a0a12; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}
.code-body { padding: 22px 26px; font-family: var(--font-mono); font-size: 14px; line-height: 2; overflow-x: auto; color: var(--muted); white-space: pre; }
.c-cmd { color: var(--green); }
.c-fn { color: var(--cyan); }
.c-str { color: var(--amber); }
.c-dim { color: var(--faint); }

/* ---------- surfaces ---------- */
.surface-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.surface-card {
  background: linear-gradient(180deg, var(--surface), var(--bg-soft));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 22px; text-align: center;
  transition: transform 0.3s var(--ease), border-color 0.3s, box-shadow 0.3s var(--ease);
  will-change: transform;
}
.surface-card:hover { border-color: rgba(34, 211, 238, 0.45); box-shadow: 0 18px 44px rgba(0,0,0,0.45), 0 0 30px rgba(34,211,238,0.07); }
.surface-icon { width: 44px; height: 44px; margin: 0 auto 16px; border-radius: 11px; display: flex; align-items: center; justify-content: center; background: rgba(34, 211, 238, 0.1); border: 1px solid rgba(34, 211, 238, 0.25); }
.surface-icon svg { width: 22px; height: 22px; stroke: var(--cyan); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.surface-card h3 { font-family: var(--font-display); font-size: 16.5px; margin-bottom: 8px; }
.surface-card p { font-size: 13px; color: var(--muted); }

/* ---------- open source ---------- */
.open-card {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center;
  background: linear-gradient(135deg, rgba(139,92,246,0.08), rgba(34,211,238,0.05)), var(--bg-soft);
  border: 1px solid var(--border); border-radius: 22px; padding: 56px 52px;
  position: relative; overflow: hidden;
}
.open-card::after {
  content: ""; position: absolute; right: -140px; top: -140px; width: 380px; height: 380px;
  background: radial-gradient(circle, rgba(139,92,246,0.16), transparent 65%); pointer-events: none;
}
.open-copy p { color: var(--muted); font-size: 15.5px; margin-bottom: 28px; max-width: 460px; }
.open-copy .section-title { margin-bottom: 16px; }
.open-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.stat { background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 14px; padding: 22px 20px; }
.stat dt { font-family: var(--font-display); font-weight: 700; font-size: 38px; letter-spacing: -0.02em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat dd { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ---------- CTA ---------- */
.cta { text-align: center; padding-bottom: 110px; }
.cta-inner { display: flex; flex-direction: column; align-items: center; }
.cta-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(34px, 5vw, 58px); line-height: 1.06; letter-spacing: -0.03em; margin-bottom: 14px; }
.cta-sub { color: var(--muted); font-size: 17px; margin-bottom: 32px; }
.cta-command {
  display: flex; align-items: center; gap: 14px;
  background: #0a0a12; border: 1px solid var(--border-strong); border-radius: 14px;
  padding: 16px 20px; max-width: 640px; width: 100%;
}
.cta-command code { font-family: var(--font-mono); font-size: 13.5px; color: var(--text); overflow-x: auto; white-space: nowrap; flex: 1; }
.copy-btn {
  flex-shrink: 0; width: 36px; height: 36px; border-radius: 9px;
  background: rgba(139, 92, 246, 0.15); border: 1px solid rgba(139, 92, 246, 0.35);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.2s var(--ease);
}
.copy-btn svg { width: 17px; height: 17px; stroke: var(--violet); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.copy-btn:hover { background: rgba(139, 92, 246, 0.28); transform: scale(1.06); }
.copy-btn.copied { background: rgba(74, 222, 128, 0.18); border-color: rgba(74, 222, 128, 0.4); }
.copy-btn.copied svg { stroke: var(--green); }
.cta-hint { margin-top: 18px; font-size: 13.5px; color: var(--faint); }
.cta-hint code { font-family: var(--font-mono); color: var(--muted); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-soft); }
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 60px 24px 40px; display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; }
.footer-brand p { margin-top: 16px; }
.footer-desc { font-size: 14px; color: var(--muted); max-width: 300px; }
.footer-social { display: flex; gap: 10px; margin-top: 20px; }
.footer-social a {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; color: var(--muted);
  transition: color 0.2s, border-color 0.2s, transform 0.2s var(--ease);
}
.footer-social a:hover { color: var(--text); border-color: var(--border-strong); transform: translateY(-2px); }
.footer-social svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.footer-col h4 { font-family: var(--font-display); font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text); margin-bottom: 16px; }
.footer-col a { display: block; font-size: 14px; color: var(--muted); padding: 5px 0; transition: color 0.2s; }
.footer-col a:hover { color: var(--text); }
.footer-col .btn { display: inline-flex; margin-bottom: 12px; }
.footer-note { font-size: 12.5px; color: var(--faint); font-family: var(--font-mono); }
.footer-bottom {
  max-width: var(--maxw); margin: 0 auto; padding: 22px 24px 30px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 13px; color: var(--faint);
}
.footer-bottom a { color: var(--muted); }
.footer-bottom a:hover { color: var(--text); }
.footer-legal { display: flex; gap: 18px; }

/* ---------- scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); transition-delay: var(--d, 0s); will-change: opacity, transform; }
.reveal.in { opacity: 1; transform: translateY(0); }
.feature-grid .reveal:nth-child(2) { --d: 0.08s; }
.feature-grid .reveal:nth-child(3) { --d: 0.16s; }
.feature-grid .reveal:nth-child(4) { --d: 0.08s; }
.feature-grid .reveal:nth-child(5) { --d: 0.16s; }
.feature-grid .reveal:nth-child(6) { --d: 0.24s; }
.surface-grid .reveal:nth-child(2) { --d: 0.08s; }
.surface-grid .reveal:nth-child(3) { --d: 0.16s; }
.surface-grid .reveal:nth-child(4) { --d: 0.24s; }
.surface-grid .reveal:nth-child(5) { --d: 0.32s; }
.stats .reveal:nth-child(2) { --d: 0.1s; }
.stats .reveal:nth-child(3) { --d: 0.2s; }
.stats .reveal:nth-child(4) { --d: 0.3s; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .surface-grid { grid-template-columns: repeat(3, 1fr); }
  .open-card { grid-template-columns: 1fr; padding: 40px 30px; }
  .section-head.split { flex-direction: column; align-items: flex-start; gap: 16px; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .nav-links, .nav-cta { display: none; }
  .nav-burger { display: block; }
  .hero { padding: 130px 20px 70px; }
  .feature-grid { grid-template-columns: 1fr; }
  .surface-grid { grid-template-columns: 1fr 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 30px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .cta-command { padding: 14px; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .marquee-track { animation: none; }
  .cursor-block { animation: none; opacity: 1; }
}
