/* ============================================================
   Terminal Workbench Cursor — landing page, styled with the
   Terminal Workbench system. Surfaces from the graphite ramp,
   green as the only loud signal, mono manifest labels, hairline
   borders, tight radii.
   ============================================================ */

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--twb-font-ui);
  background: var(--twb-bg-0);
  color: var(--twb-text-normal);
  line-height: var(--twb-line-height);
  font-size: 15px;
  overflow-x: hidden;
}

a { color: var(--twb-accent-alt); text-decoration: none; transition: color var(--twb-transition); }
a:hover { color: var(--twb-text-normal); }

::selection { background: var(--twb-selection); }

code {
  font-family: var(--twb-font-mono);
  font-size: 0.86em;
  padding: 0.12em 0.4em;
  border-radius: var(--twb-radius-s);
  background: var(--twb-bg-2);
  border: 1px solid var(--twb-border);
  color: var(--twb-text-soft);
}

/* Manifest label idiom: mono, uppercase, letter-spaced */
.manifest {
  font-family: var(--twb-font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--twb-text-muted);
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ---------- Reveal ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
[data-reveal].revealed { opacity: 1; transform: none; }
.feature-grid [data-reveal]:nth-child(2) { transition-delay: 0.05s; }
.feature-grid [data-reveal]:nth-child(3) { transition-delay: 0.10s; }
.feature-grid [data-reveal]:nth-child(4) { transition-delay: 0.15s; }
.feature-grid [data-reveal]:nth-child(5) { transition-delay: 0.20s; }
.feature-grid [data-reveal]:nth-child(6) { transition-delay: 0.25s; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  border-bottom: 1px solid transparent;
  transition: background var(--twb-transition), border-color var(--twb-transition);
}
.nav--scrolled {
  background: color-mix(in srgb, var(--twb-bg-1) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--twb-border);
}
.nav-inner {
  max-width: 1080px; margin: 0 auto; padding: 0 24px;
  height: 58px; display: flex; align-items: center; justify-content: space-between;
}
.nav-logo { display: flex; align-items: center; gap: 10px; font-weight: 500; color: var(--twb-text-normal); }
.nav-logo img { display: block; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a.manifest { font-size: 11px; color: var(--twb-text-muted); }
.nav-links a.manifest:hover { color: var(--twb-accent); }
.nav-github { display: flex; color: var(--twb-text-muted); }
.nav-github:hover { color: var(--twb-text-normal); }
.nav-github svg { width: 20px; height: 20px; }

/* ---------- Section shell ---------- */
section { position: relative; }
.section-head { max-width: 640px; margin: 0 auto 56px; text-align: center; }
.kicker { display: inline-flex; align-items: center; gap: 8px; color: var(--twb-accent); margin-bottom: 16px; }
.kicker::before { content: ""; width: 7px; height: 7px; border-radius: var(--twb-radius-s); background: var(--twb-accent); }
.section-title { font-size: clamp(1.6rem, 3.6vw, 2.2rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; }
.section-desc { margin-top: 14px; color: var(--twb-text-muted); font-size: 1.02rem; }
.section-desc code { font-size: 0.82em; }

/* ---------- Hero ---------- */
.hero { padding: 148px 24px 80px; display: flex; flex-direction: column; align-items: center; overflow: hidden; }
.hero-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--twb-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--twb-border) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: 0.28;
  mask-image: radial-gradient(ellipse 65% 45% at 50% 36%, #000 10%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 65% 45% at 50% 36%, #000 10%, transparent 78%);
}
.hero-content { position: relative; z-index: 1; text-align: center; max-width: 760px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px; border: 1px solid var(--twb-border); border-radius: var(--twb-radius-m);
  background: var(--twb-bg-1); color: var(--twb-text-muted); margin-bottom: 24px;
}
.hero-badge .dot { width: 7px; height: 7px; border-radius: var(--twb-radius-pill); background: var(--twb-accent); }
.hero-title { font-size: clamp(2.1rem, 5.2vw, 3.3rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.12; }
.hero-title em { font-style: normal; color: var(--twb-accent); }
.hero-subtitle { margin: 20px auto 34px; max-width: 600px; color: var(--twb-text-muted); font-size: 1.1rem; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px; font-size: 0.9rem; font-weight: 500;
  border-radius: var(--twb-radius-m); cursor: pointer;
  border: 1px solid transparent; transition: all var(--twb-transition);
}
.btn svg { width: 17px; height: 17px; }
.btn--primary { background: var(--twb-accent); color: var(--twb-text-on-accent); }
.btn--primary:hover { color: var(--twb-text-on-accent); box-shadow: var(--twb-glow); transform: translateY(-1px); }
.btn--ghost { background: var(--twb-bg-1); border-color: var(--twb-border); color: var(--twb-text-soft); }
.btn--ghost:hover { border-color: var(--twb-border-strong); color: var(--twb-text-normal); }

/* ---------- Mock workbench window ---------- */
.hero-visual { position: relative; z-index: 1; margin-top: 60px; width: 100%; max-width: 760px; }
.mock {
  border: 1px solid var(--twb-border); border-radius: var(--twb-radius-l);
  background: var(--twb-bg-1); overflow: hidden; box-shadow: var(--twb-shadow-pane);
}
.mock-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--twb-bg-2); border-bottom: 1px solid var(--twb-border); }
.mock-prompt { color: var(--twb-accent); font-family: var(--twb-font-mono); font-weight: 700; }
.mock-bar .manifest { font-size: 10.5px; }
.mock-body { display: flex; min-height: 250px; }
.mock-side { width: 250px; padding: 12px; border-right: 1px solid var(--twb-border); display: flex; flex-direction: column; gap: 3px; }
.mock-side .manifest { font-size: 10px; color: var(--twb-text-faint); padding: 6px 8px 4px; }
.mock-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 8px; border-radius: var(--twb-radius-s); font-size: 0.82rem; color: var(--twb-text-muted); }
.mock-item svg { width: 13px; height: 13px; margin-right: 7px; flex-shrink: 0; }
.mock-item .lhs { display: flex; align-items: center; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mock-item .count { font-size: 9px; color: var(--twb-text-faint); flex-shrink: 0; }
.mock-item--active { background: var(--twb-tag-bg); color: var(--twb-accent); border: 1px solid var(--twb-tag-border); }
.mock-item--active .count { color: var(--twb-accent); }
.mock-item--child { padding-left: 26px; color: var(--twb-text-soft); }
.mock-item--ghost { opacity: 0.32; }
.mock-item--ghost .lhs { text-decoration: line-through; text-decoration-color: var(--twb-text-faint); }
.mock-main { flex: 1; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.mock-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--twb-bg-2); border: 1px solid var(--twb-border); border-radius: var(--twb-radius-m);
  padding: 8px 12px; font-family: var(--twb-font-mono); font-size: 11.5px; color: var(--twb-text-soft);
  white-space: nowrap; overflow: hidden;
}
.mock-search svg { width: 13px; height: 13px; color: var(--twb-text-faint); flex-shrink: 0; }
.mock-token {
  color: var(--twb-accent); background: var(--twb-tag-bg); border: 1px solid var(--twb-tag-border);
  border-radius: var(--twb-radius-s); padding: 1px 7px; flex-shrink: 0;
}
.mock-result { background: var(--twb-bg-2); border: 1px solid var(--twb-border); border-radius: var(--twb-radius-m); padding: 11px 13px; }
.mock-result-title { font-weight: 500; color: var(--twb-text-normal); font-size: 0.88rem; }
.mock-result-sub { color: var(--twb-text-muted); font-size: 0.79rem; margin-top: 3px; line-height: 1.5; }
.mock-result-sub b { color: var(--twb-accent); font-weight: 600; }
.mock-foot { border-top: 1px solid var(--twb-border); padding: 6px 14px; background: var(--twb-bg-2); }
.mock-foot .manifest { font-size: 10px; color: var(--twb-text-faint); }
.mock-foot b { color: var(--twb-accent); }

/* ---------- Hero editor / ghost-trail demo ---------- */
/* accent bloom behind the visual, for depth (mirrors the cover banner) */
.hero-visual::before {
  content: ""; position: absolute; z-index: -1;
  left: 8%; right: 30%; top: 12%; bottom: 14%;
  background: radial-gradient(ellipse 60% 55% at 40% 50%, var(--twb-accent) 0%, transparent 70%);
  opacity: 0.1; pointer-events: none; filter: blur(4px);
}
.mock-editor {
  position: relative; padding: 20px 22px; min-height: 250px;
  font-family: var(--twb-font-mono); font-size: 13px; line-height: 2.15;
  overflow: hidden;
}
.mock-line { position: relative; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.mock-line--active {
  background: var(--twb-active-line, rgba(107, 220, 255, 0.08));
  box-shadow: inset 2px 0 0 var(--twb-accent);
  border-radius: 0 var(--twb-radius-s) var(--twb-radius-s) 0;
  margin: 0 -22px; padding: 0 22px;
}
.mock-gutter { width: 16px; text-align: right; color: var(--twb-text-faint); opacity: 0.55; user-select: none; font-size: 11px; }
.mock-line--active .mock-gutter { color: var(--twb-accent); opacity: 0.9; }
.mock-w { display: inline-block; height: 8px; border-radius: 4px; background: var(--twb-text-faint); opacity: 0.35; }
.mock-line--active .mock-w { background: var(--twb-text-soft); opacity: 0.9; }
.mock-caret {
  display: inline-block; width: 8px; height: 16px; margin-left: 2px;
  background: var(--twb-accent); border-radius: 1px; box-shadow: var(--twb-glow);
  animation: twc-blink 1.1s steps(1, end) infinite;
}
@keyframes twc-blink { 0%, 55% { opacity: 1; } 56%, 100% { opacity: 0.15; } }

.ghost-field { position: absolute; inset: 0; pointer-events: none; }
.ghost {
  position: absolute; width: 20px; height: 20px; opacity: 0;
  color: var(--twb-accent);
  filter: drop-shadow(0 0 4px currentColor);
  will-change: transform, opacity;
  animation: twc-rise 3.9s cubic-bezier(0.33, 0, 0.4, 1) infinite;
}
.ghost svg { width: 100%; height: 100%; display: block; }
.ghost .body { fill: currentColor; }
.ghost .eye { fill: var(--twb-bg-1); }
/* full accent ramp, staggered into a rising plume that fans as it climbs */
.ghost.g1 { color: var(--twb-accent);     animation-delay: 0s;   --dx: -20px; }
.ghost.g2 { color: var(--twb-accent-alt); animation-delay: 0.6s; --dx: -6px; }
.ghost.g3 { color: var(--twb-warm);       animation-delay: 1.2s; --dx: -30px; }
.ghost.g4 { color: var(--twb-violet);     animation-delay: 1.8s; --dx: -12px; }
.ghost.g5 { color: var(--twb-orange);     animation-delay: 2.4s; --dx: -26px; }
.ghost.g6 { color: var(--twb-red);        animation-delay: 3.0s; --dx: -16px; }
@keyframes twc-rise {
  0%   { opacity: 0; transform: translate(0, 0) scale(0.6); }
  12%  { opacity: 0.95; }
  70%  { opacity: 0.65; }
  100% { opacity: 0; transform: translate(var(--dx, -18px), -140px) scale(1.08); }
}
@media (prefers-reduced-motion: reduce) {
  .mock-caret { animation: none; }
  .ghost { animation: none; opacity: 0; }
}

/* ---------- Features ---------- */
.features { padding: 96px 0; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature-card {
  padding: 24px 22px; border: 1px solid var(--twb-border); border-radius: var(--twb-radius-l);
  background: var(--twb-bg-1); transition: border-color var(--twb-transition), transform var(--twb-transition);
}
.feature-card:hover { border-color: var(--twb-border-strong); transform: translateY(-3px); }
.feature-icon {
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--twb-radius-m); background: var(--twb-bg-2); border: 1px solid var(--twb-border);
  color: var(--twb-accent); margin-bottom: 16px;
}
.feature-icon svg { width: 19px; height: 19px; }
.feature-card h3 { font-size: 1rem; font-weight: 500; margin-bottom: 8px; }
.feature-card p { font-size: 0.9rem; color: var(--twb-text-muted); line-height: 1.6; }
.feature-card p code { font-size: 0.82em; }

/* ---------- How it works ---------- */
.how { padding: 88px 0; }
.steps { max-width: 560px; margin: 0 auto; }
.step { display: flex; gap: 22px; }
.step-marker { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; }
.step-num {
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--twb-radius-m); background: var(--twb-bg-2); border: 1px solid var(--twb-tag-border);
  color: var(--twb-accent); font-family: var(--twb-font-mono); font-weight: 700; font-size: 0.95rem;
}
.step-line { width: 1px; flex: 1; background: var(--twb-border); margin: 6px 0; min-height: 34px; }
.step-body { padding-bottom: 34px; }
.step-body h3 { font-size: 1.05rem; font-weight: 500; margin-bottom: 6px; }
.step-body p { color: var(--twb-text-muted); font-size: 0.92rem; line-height: 1.6; }

/* ---------- Install ---------- */
.install { padding: 88px 0 104px; }
.install-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.install-card { padding: 24px; border: 1px solid var(--twb-border); border-radius: var(--twb-radius-l); background: var(--twb-bg-1); }
.install-card--rec { border-color: var(--twb-tag-border); }
.install-card-tag {
  display: inline-block; font-family: var(--twb-font-mono); font-size: 0.66rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--twb-accent);
  background: var(--twb-tag-bg); border: 1px solid var(--twb-tag-border);
  padding: 2px 8px; border-radius: var(--twb-radius-s); margin-bottom: 12px;
}
.install-card h3 { font-size: 1.1rem; font-weight: 500; margin-bottom: 16px; }
.install-card ol { list-style: none; counter-reset: s; display: flex; flex-direction: column; gap: 11px; }
.install-card ol li {
  counter-increment: s; position: relative; padding-left: 26px;
  font-size: 0.86rem; color: var(--twb-text-muted); line-height: 1.55;
}
.install-card ol li::before {
  content: counter(s); position: absolute; left: 0; top: 0;
  width: 18px; height: 18px; display: flex; align-items: center; justify-content: center;
  font-family: var(--twb-font-mono); font-size: 0.66rem; font-weight: 700; color: var(--twb-accent);
  background: var(--twb-bg-2); border: 1px solid var(--twb-border); border-radius: var(--twb-radius-s);
}
.install-card code { font-size: 0.8em; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--twb-border); padding: 32px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; }
.footer-left { display: flex; align-items: center; gap: 9px; color: var(--twb-text-soft); font-weight: 500; }
.footer-left img { display: block; }
.footer-meta { font-family: var(--twb-font-mono); font-size: 0.76rem; color: var(--twb-text-faint); letter-spacing: 0.03em; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .install-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav-links a.manifest { display: none; }
  .hero { padding: 112px 20px 56px; }
  .feature-grid { grid-template-columns: 1fr; }
  .mock-side { width: 170px; }
  .footer-inner { flex-direction: column; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .btn:hover { transform: none; }
  .feature-card:hover { transform: none; }
}
