/* ============ BASE ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

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

.wrap { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.mono { font-family: var(--font-mono); }
.mono-inline, .mono-cmd {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-overlay);
  padding: 1px 6px;
  border-radius: var(--r-sm);
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }

::selection { background: var(--accent); color: #fff; }

/* ============ HEADER ============ */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(10, 10, 12, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav {
  max-width: 1140px; margin: 0 auto; padding: 0 24px;
  height: 64px;
  display: flex; align-items: center; gap: 32px;
}

.nav-logo {
  font-family: var(--font-display);
  font-weight: 700; font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.nav-logo:hover { color: var(--text-accent); }

.nav-links {
  display: flex; gap: 26px; margin-left: auto;
}
.nav-links a {
  font-size: 0.9rem; color: var(--text-2);
  transition: color var(--t) var(--ease);
}
.nav-links a:hover { color: var(--text-1); }

.btn-nav {
  font-size: 0.85rem; font-weight: 500;
  background: var(--accent); color: #fff;
  padding: 8px 18px; border-radius: var(--r-md);
  transition: background var(--t) var(--ease), transform var(--t) var(--ease);
}
.btn-nav:hover { background: var(--accent-dark); transform: translateY(-1px); }

.nav-hamburger {
  display: none;
  flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 8px;
}
.nav-hamburger span {
  width: 22px; height: 2px; background: var(--text-1);
  border-radius: 2px; transition: all var(--t) var(--ease);
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============ HERO ============ */
.hero {
  position: relative;
  padding: 150px 0 90px;
  overflow: hidden;
}

.hero-glow {
  position: absolute; top: -220px; left: 50%;
  transform: translateX(-50%);
  width: 900px; height: 560px;
  background: radial-gradient(ellipse at center, rgba(88,101,242,0.14) 0%, transparent 65%);
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
  position: relative;
}

.badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.8rem; color: var(--text-2);
  background: var(--bg-surface);
  border: 1px solid var(--border-med);
  padding: 6px 14px; border-radius: 99px;
  margin-bottom: 26px;
}
.badge .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  animation: pulse 2.4s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 22px;
}
.hero h1 .accent {
  background: linear-gradient(100deg, var(--accent) 0%, #8b9af8 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lead {
  font-size: 1.07rem; font-weight: 300;
  color: var(--text-2);
  max-width: 480px;
  margin-bottom: 32px;
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 44px; }

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 0.95rem; font-weight: 500;
  padding: 13px 26px; border-radius: var(--r-md);
  transition: all var(--t) var(--ease);
}
.btn svg { width: 18px; height: 18px; }

.btn-primary {
  background: var(--accent); color: #fff;
  box-shadow: 0 4px 24px var(--accent-glow);
}
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-2px); }

.btn-secondary {
  background: var(--bg-surface); color: var(--text-1);
  border: 1px solid var(--border-med);
}
.btn-secondary:hover { border-color: var(--border-hover); transform: translateY(-2px); }

.hero-stats {
  display: flex; gap: 36px; flex-wrap: wrap;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .v {
  font-family: var(--font-display);
  font-weight: 700; font-size: 1.25rem;
  color: var(--text-1);
}
.stat .l { font-size: 0.78rem; color: var(--text-3); }

/* ============ CHAT MOCKUP ============ */
.chat {
  background: var(--bg-surface);
  border: 1px solid var(--border-med);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg), var(--shadow-accent);
  overflow: hidden;
  transform: rotate(0.6deg);
}

.chat-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}
.chat-bar i {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--bg-overlay);
}
.chat-bar i:nth-child(1) { background: #3d3d4a; }
.chat-bar .t {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem; color: var(--text-2);
}

.chat-body { padding: 18px 16px 14px; display: flex; flex-direction: column; gap: 16px; }

.msg { display: flex; gap: 11px; opacity: 0; animation: msgIn 500ms var(--ease) forwards; }
.m1 { animation-delay: 300ms; }
.m2 { animation-delay: 900ms; }
.m3 { animation-delay: 1500ms; }
.m4 { animation-delay: 2100ms; }
.m5 { animation-delay: 2800ms; }

@keyframes msgIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.avatar {
  flex-shrink: 0;
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 0.9rem;
  color: #fff;
}
.av-fh { background: var(--c-forgehook); }
.av-af { background: var(--c-archiveforge); }
.av-bt { background: var(--c-bot); }
.av-rs { background: var(--c-rssdi); }

.msg-content { min-width: 0; flex: 1; }
.msg-head { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; }
.name { font-size: 0.86rem; font-weight: 500; }
.n-fh { color: var(--c-forgehook); }
.n-af { color: var(--c-archiveforge); }
.n-bt { color: var(--c-bot); }
.n-rs { color: var(--c-rssdi); }

.tag-bot {
  font-size: 0.6rem; font-weight: 500; letter-spacing: 0.04em;
  background: var(--accent); color: #fff;
  padding: 1px 5px; border-radius: 4px;
}
.time { font-size: 0.68rem; color: var(--text-3); }

.msg-text { font-size: 0.84rem; color: var(--text-2); }

.embed {
  border-left: 3px solid;
  background: var(--bg-elevated);
  border-radius: 4px;
  padding: 9px 12px;
  max-width: 340px;
}
.e-fh { border-color: var(--c-forgehook); }
.e-rs { border-color: var(--c-rssdi); }
.embed-title { font-size: 0.82rem; font-weight: 500; margin-bottom: 3px; }
.embed-desc { font-size: 0.78rem; color: var(--text-2); }

.typing {
  display: flex; align-items: center;
  font-size: 0.75rem; color: var(--text-3);
  padding-left: 4px;
  opacity: 0; animation: msgIn 500ms var(--ease) forwards;
}
.typing span {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--text-3);
  margin-right: 3px;
  animation: bounce 1.2s infinite;
}
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce { 0%,60%,100% { transform: translateY(0); } 30% { transform: translateY(-4px); } }

/* ============ SECTIONS ============ */
section { padding: 90px 0; }

.section-header { text-align: center; max-width: 620px; margin: 0 auto 56px; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.76rem; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-accent);
  margin-bottom: 14px;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.2vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-bottom: 14px;
}
.section-header p { color: var(--text-2); font-weight: 300; }
.section-header em { color: var(--text-1); font-style: normal; }

/* ============ TOOLS ============ */
.tools { display: flex; flex-direction: column; gap: 28px; }

.tool {
  --tool: var(--accent);
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 40px 44px;
  overflow: hidden;
  transition: border-color var(--t-lg) var(--ease), transform var(--t-lg) var(--ease), box-shadow var(--t-lg) var(--ease);
}
.tool::before {
  content: "";
  position: absolute; top: 0; left: 0; bottom: 0;
  width: 3px;
  background: var(--tool);
  opacity: 0.85;
}
.tool::after {
  content: "";
  position: absolute; top: -120px; right: -120px;
  width: 340px; height: 340px;
  background: radial-gradient(circle, color-mix(in srgb, var(--tool) 9%, transparent) 0%, transparent 70%);
  pointer-events: none;
}
.tool:hover {
  border-color: color-mix(in srgb, var(--tool) 35%, transparent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.tool-fh { --tool: var(--c-forgehook); }
.tool-af { --tool: var(--c-archiveforge); }
.tool-bt { --tool: var(--c-bot); }
.tool-rs { --tool: var(--c-rssdi); }

.tool-head { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }

.t-icon {
  flex-shrink: 0;
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--tool) 12%, transparent);
  color: var(--tool);
}
.t-icon svg { width: 26px; height: 26px; }

.tool h3 {
  font-family: var(--font-display);
  font-size: 1.45rem; font-weight: 700;
  letter-spacing: -0.01em;
}
.t-sub { font-size: 0.86rem; color: var(--text-2); }

.tool-main > p {
  color: var(--text-2); font-weight: 300;
  max-width: 720px;
  margin-bottom: 20px;
}

.t-feats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px 28px;
  margin-bottom: 24px;
  max-width: 820px;
}
.t-feats li {
  position: relative;
  padding-left: 22px;
  font-size: 0.89rem; color: var(--text-2);
}
.t-feats li::before {
  content: "◆";
  position: absolute; left: 0; top: 1px;
  font-size: 0.65rem;
  color: var(--tool);
}

.t-stack {
  font-size: 0.76rem; color: var(--text-3);
  letter-spacing: 0.02em;
  margin-bottom: 22px;
}

.t-actions { display: flex; align-items: center; gap: 16px; }

.btn-tool {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.9rem; font-weight: 500;
  color: var(--tool);
  background: color-mix(in srgb, var(--tool) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--tool) 30%, transparent);
  padding: 11px 22px; border-radius: var(--r-md);
  transition: all var(--t) var(--ease);
}
.btn-tool svg { width: 15px; height: 15px; }
.btn-tool:hover {
  background: color-mix(in srgb, var(--tool) 18%, transparent);
  transform: translateY(-2px);
}

.t-private {
  font-size: 0.85rem; color: var(--text-3);
  font-family: var(--font-mono);
  border: 1px dashed var(--border-med);
  padding: 10px 18px; border-radius: var(--r-md);
}

/* ============ STACK ============ */
#stack { padding-top: 30px; }

.stack-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.stack-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 30px 28px;
  transition: border-color var(--t-lg) var(--ease), transform var(--t-lg) var(--ease);
}
.stack-card:hover { border-color: var(--border-hover); transform: translateY(-3px); }

.s-icon {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-md);
  background: var(--accent-dim);
  color: var(--accent);
  margin-bottom: 18px;
}
.s-icon svg { width: 22px; height: 22px; }

.stack-card h3 {
  font-family: var(--font-display);
  font-size: 1.05rem; font-weight: 700;
  margin-bottom: 9px;
}
.stack-card p { font-size: 0.88rem; color: var(--text-2); font-weight: 300; }

/* ============ REVEAL ON SCROLL ============ */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 600ms var(--ease), transform 600ms var(--ease); }
.reveal.in { opacity: 1; transform: translateY(0); }

/* ============ FOOTER ============ */
.footer {
  border-top: 1px solid var(--border);
  padding: 56px 0 0;
  background: var(--bg-surface);
}

.footer-grid {
  display: flex; justify-content: space-between; gap: 40px;
  flex-wrap: wrap;
  padding-bottom: 40px;
}

.f-logo {
  font-family: var(--font-display);
  font-weight: 700; font-size: 1.1rem;
  margin-bottom: 10px;
}
.footer-grid p { font-size: 0.86rem; color: var(--text-2); max-width: 300px; }

.f-links { display: flex; flex-direction: column; gap: 10px; }
.f-links a {
  font-size: 0.88rem; color: var(--text-2);
  transition: color var(--t) var(--ease);
}
.f-links a:hover { color: var(--text-accent); }

.f-bottom {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 10px;
  padding-top: 22px; padding-bottom: 22px;
  border-top: 1px solid var(--border);
  font-size: 0.78rem; color: var(--text-3);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
  .chat { max-width: 560px; transform: none; }
  .t-feats { grid-template-columns: 1fr; }
  .stack-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav-links, .btn-nav { display: none; }
  .nav-hamburger { display: flex; margin-left: auto; }

  .nav-links.open {
    display: flex; flex-direction: column;
    position: absolute; top: 64px; left: 0; right: 0;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: 18px 24px; gap: 16px;
  }

  .hero { padding: 120px 0 64px; }
  section { padding: 64px 0; }
  .tool { padding: 28px 22px; }
  .hero-stats { gap: 24px; }
}
