/* workspace-x.com — marketing one-pager
   Refined technical: mono headlines, clean sans body, dark terminal base,
   electric-blue accent. Tokens echo the product's own tui.css palette. */

:root {
  /* base */
  --bg:        #0a0d12;
  --bg-1:      #0e1116;   /* surface */
  --bg-2:      #131a23;   /* elevated */
  --bg-3:      #1a232f;   /* hover / inset */
  --rule:      #1e2733;
  --rule-soft: #18202b;

  /* text */
  --fg:        #e8edf4;
  --fg-dim:    #b3bdca;
  --fg-muted:  #76828f;
  --fg-faint:  #4a5562;

  /* accent — electric blue */
  --accent:      #5ab0ff;
  --accent-soft: #2f80d6;
  --accent-glow: rgba(90,176,255,0.18);

  /* status palette (shared with product) */
  --c-question: #e6b450;
  --c-stalled:  #e06a5a;
  --c-waiting:  #5ab0ff;
  --c-thinking: #b694f0;
  --c-complete: #5bc98a;
  --c-idle:     #76828f;

  /* type */
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --sans: "IBM Plex Sans", system-ui, -apple-system, sans-serif;

  --maxw: 1180px;
  --gutter: clamp(20px, 5vw, 64px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ambient background grid + glow */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 500px at 78% -8%, var(--accent-glow), transparent 70%),
    linear-gradient(var(--rule-soft) 1px, transparent 1px) 0 0 / 100% 64px,
    linear-gradient(90deg, var(--rule-soft) 1px, transparent 1px) 0 0 / 64px 100%;
  opacity: 0.5;
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 35%, transparent 80%);
  pointer-events: none;
  z-index: 0;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); position: relative; z-index: 1; }

a { color: inherit; text-decoration: none; }

.mono { font-family: var(--mono); }
.accent { color: var(--accent); }

/* ── nav ──────────────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.nav.scrolled { border-bottom-color: var(--rule); }
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 14px var(--gutter);
  display: flex; align-items: center; gap: 28px;
}
.brand {
  font-family: var(--mono); font-weight: 700; font-size: 16px;
  letter-spacing: -0.01em; display: inline-flex; align-items: center; gap: 9px;
}
.brand .blink {
  width: 9px; height: 16px; background: var(--accent);
  display: inline-block; border-radius: 1px;
  animation: blink 1.15s steps(1) infinite;
  box-shadow: 0 0 10px var(--accent-glow);
}
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .brand .blink { animation: none; } }
.brand b { color: var(--accent); }

.nav-links { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.nav-links a {
  font-size: 14px; color: var(--fg-muted); padding: 8px 12px; border-radius: 7px;
  transition: color .15s, background .15s; font-weight: 500;
}
.nav-links a:hover { color: var(--fg); background: var(--bg-2); }

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--sans); font-size: 14px; font-weight: 600;
  padding: 9px 15px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--rule); background: var(--bg-2); color: var(--fg);
  transition: border-color .15s, background .15s, transform .1s;
  white-space: nowrap;
}
.btn:hover { background: var(--bg-3); border-color: #2c3a4a; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; flex: 0 0 auto; }
.btn-primary {
  background: var(--accent); color: #05121f; border-color: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-glow);
}
.btn-primary:hover { background: #74bdff; border-color: #74bdff; box-shadow: 0 6px 24px var(--accent-glow); }
.btn .star { color: var(--c-question); }
.btn-ghost { background: transparent; }

/* ── hero ─────────────────────────────────────────────────────────────── */
.hero { padding: clamp(56px, 9vw, 110px) 0 clamp(40px, 6vw, 80px); }
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(32px, 5vw, 72px); align-items: center;
}
@media (max-width: 940px) { .hero-grid { grid-template-columns: 1fr; gap: 40px; } }

.eyebrow {
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.04em;
  color: var(--accent); margin: 0 0 20px;
  display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before {
  content: ""; width: 22px; height: 1px; background: var(--accent); display: inline-block;
}
h1 {
  font-family: var(--sans); font-weight: 500;
  font-size: clamp(36px, 5.6vw, 64px); line-height: 1.06;
  letter-spacing: -0.025em; margin: 0 0 22px; text-wrap: balance;
}
h1 .grad {
  font-weight: 600;
  background: linear-gradient(100deg, var(--accent), #b694f0 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede { font-size: clamp(17px, 2.1vw, 20px); color: var(--fg-dim); margin: 0 0 32px; max-width: 34ch; text-wrap: pretty; }

.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 30px; }

/* install command block */
.cmd {
  font-family: var(--mono); font-size: 13.5px; line-height: 1.9;
  background: var(--bg-1); border: 1px solid var(--rule); border-radius: 11px;
  padding: 16px 16px 16px 18px; position: relative; max-width: 520px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
}
.cmd-row { display: flex; align-items: baseline; gap: 10px; white-space: nowrap; overflow: hidden; }
.cmd-row .pfx { color: var(--accent); user-select: none; flex: 0 0 auto; }
.cmd-row .txt { color: var(--fg-dim); text-overflow: ellipsis; overflow: hidden; }
.cmd-row .cmt { color: var(--fg-faint); }
.copy-btn {
  position: absolute; top: 11px; right: 11px;
  width: 32px; height: 32px; display: grid; place-items: center;
  border: 1px solid var(--rule); border-radius: 8px; background: var(--bg-2);
  color: var(--fg-muted); cursor: pointer; transition: all .15s;
}
.copy-btn:hover { color: var(--fg); border-color: #2c3a4a; background: var(--bg-3); }
.copy-btn svg { width: 15px; height: 15px; }
.copy-btn.copied { color: var(--c-complete); border-color: color-mix(in srgb, var(--c-complete) 50%, var(--rule)); }

/* ── terminal window (hero demo + screencast frames) ────────────────────── */
.term {
  background: var(--bg-1);
  border: 1px solid var(--rule);
  border-radius: 13px;
  overflow: hidden;
  box-shadow: 0 30px 80px -30px rgba(0,0,0,0.8), 0 0 0 1px rgba(255,255,255,0.02), 0 0 60px -20px var(--accent-glow);
}
.term-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 14px; background: var(--bg-2); border-bottom: 1px solid var(--rule);
}
.term-bar .lights { display: flex; gap: 7px; }
.term-bar .lights i { width: 11px; height: 11px; border-radius: 50%; display: block; }
.term-bar .title {
  font-family: var(--mono); font-size: 12px; color: var(--fg-muted);
  margin: 0 auto; padding-right: 46px; letter-spacing: 0.02em;
}

/* embedded dashboard demo reuses .tui classes from tui.css */
.term .tui { height: 430px; }
.hero-term .demo-type { padding: 16px 18px; font-family: var(--mono); font-size: 13px; line-height: 1.85; min-height: 92px; border-bottom: 1px solid var(--rule-soft); }
.demo-type .ln { display: block; white-space: pre; overflow: hidden; }
.demo-type .pfx { color: var(--accent); }
.demo-type .out { color: var(--fg-muted); }
.demo-type .cursor { background: var(--accent); color: var(--accent); animation: blink 1.1s steps(1) infinite; }

/* ── section scaffolding ────────────────────────────────────────────────── */
section { padding: clamp(56px, 9vw, 104px) 0; position: relative; }
.sec-head { max-width: 640px; margin: 0 0 clamp(36px, 5vw, 60px); }
.kicker {
  font-family: var(--mono); font-size: 13px; color: var(--accent);
  letter-spacing: 0.06em; text-transform: uppercase; margin: 0 0 14px;
}
h2 {
  font-family: var(--mono); font-weight: 700; font-size: clamp(26px, 3.6vw, 40px);
  letter-spacing: -0.02em; margin: 0 0 16px; line-height: 1.1; text-wrap: balance;
}
.sec-head p { font-size: 18px; color: var(--fg-dim); margin: 0; text-wrap: pretty; }

.divider { height: 1px; background: var(--rule); border: 0; max-width: var(--maxw); margin: 0 auto; }

/* ── how it works ───────────────────────────────────────────────────────── */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: step; }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr; } }
.step {
  background: var(--bg-1); border: 1px solid var(--rule); border-radius: 14px;
  padding: 26px 24px; position: relative; overflow: hidden;
}
.step::before {
  counter-increment: step; content: "0" counter(step);
  font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--accent);
  letter-spacing: 0.1em;
}
.step h3 { font-family: var(--mono); font-size: 18px; font-weight: 600; margin: 14px 0 8px; letter-spacing: -0.01em; }
.step p { font-size: 15px; color: var(--fg-muted); margin: 0 0 16px; line-height: 1.55; }
.step .scmd {
  font-family: var(--mono); font-size: 12.5px; color: var(--fg-dim);
  background: var(--bg); border: 1px solid var(--rule-soft); border-radius: 8px;
  padding: 10px 12px; white-space: nowrap; overflow-x: auto; scrollbar-width: none;
}
.step .scmd::-webkit-scrollbar { display: none; }
.step .scmd .pfx { color: var(--accent); }
.step-line { position: absolute; right: -1px; top: 24px; bottom: 24px; width: 1px; background: linear-gradient(var(--accent), transparent); opacity: .4; }

/* ── features ───────────────────────────────────────────────────────────── */
.feat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 18px; }
@media (max-width: 920px) { .feat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .feat-grid { grid-template-columns: 1fr; } }

.card {
  background: var(--bg-1); border: 1px solid var(--rule); border-radius: 14px;
  padding: 24px 22px; transition: border-color .2s, transform .2s, background .2s;
}
.card:hover { border-color: #2a3744; transform: translateY(-2px); background: var(--bg-2); }
.card .glyph {
  font-family: var(--mono); font-size: 18px; font-weight: 700;
  width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center;
  margin-bottom: 16px; border: 1px solid var(--rule);
}
.card h3 { font-family: var(--mono); font-size: 16.5px; font-weight: 600; margin: 0 0 9px; letter-spacing: -0.01em; line-height: 1.3; }
.card p { font-size: 14.5px; color: var(--fg-muted); margin: 0; line-height: 1.55; }

/* span helpers for the bento layout */
.col-3 { grid-column: span 3; }
.col-2 { grid-column: span 2; }
.col-6 { grid-column: span 6; }
@media (max-width: 920px) { .col-3, .col-2, .col-6 { grid-column: span 1; } .col-6 { grid-column: span 2; } }
@media (max-width: 560px) { .col-6 { grid-column: span 1; } }

/* accent variants for glyph chips */
.g-blue    { color: var(--c-waiting);  border-color: color-mix(in srgb, var(--c-waiting) 40%, var(--rule)) !important; background: color-mix(in srgb, var(--c-waiting) 12%, transparent); }
.g-green   { color: var(--c-complete); border-color: color-mix(in srgb, var(--c-complete) 40%, var(--rule)) !important; background: color-mix(in srgb, var(--c-complete) 12%, transparent); }
.g-violet  { color: var(--c-thinking); border-color: color-mix(in srgb, var(--c-thinking) 40%, var(--rule)) !important; background: color-mix(in srgb, var(--c-thinking) 12%, transparent); }
.g-amber   { color: var(--c-question); border-color: color-mix(in srgb, var(--c-question) 40%, var(--rule)) !important; background: color-mix(in srgb, var(--c-question) 12%, transparent); }
.g-red     { color: var(--c-stalled);  border-color: color-mix(in srgb, var(--c-stalled) 40%, var(--rule)) !important; background: color-mix(in srgb, var(--c-stalled) 12%, transparent); }

/* ── screencast highlight ───────────────────────────────────────────────── */
.cast { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: center; }
.cast.flip .cast-copy { order: 2; }
@media (max-width: 880px) { .cast { grid-template-columns: 1fr; gap: 22px; } .cast.flip .cast-copy { order: 0; } }
.cast-copy .tag {
  font-family: var(--mono); font-size: 12px; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 12px;
}
.cast-copy h3 { font-family: var(--mono); font-size: clamp(20px, 2.6vw, 27px); font-weight: 700; letter-spacing: -0.02em; margin: 0 0 12px; line-height: 1.15; }
.cast-copy p { color: var(--fg-dim); font-size: 16px; margin: 0; }

.cast-media { position: relative; aspect-ratio: 16 / 10; background: var(--bg); }
.cast-media video { width: 100%; height: 100%; display: block; object-fit: cover; background: #05080c; }
.cast-ph {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; text-align: center;
  background:
    repeating-linear-gradient(45deg, transparent, transparent 11px, rgba(90,176,255,0.025) 11px, rgba(90,176,255,0.025) 22px),
    var(--bg-1);
  color: var(--fg-muted); font-family: var(--mono); font-size: 13px; padding: 24px;
}
.cast-ph .play {
  width: 56px; height: 56px; border-radius: 50%; border: 1px solid var(--rule);
  display: grid; place-items: center; background: var(--bg-2); color: var(--accent);
}
.cast-ph .play svg { width: 20px; height: 20px; margin-left: 3px; }
.cast-ph code { color: var(--fg-dim); background: var(--bg); padding: 2px 7px; border-radius: 5px; border: 1px solid var(--rule-soft); }

/* ── footer ─────────────────────────────────────────────────────────────── */
footer { border-top: 1px solid var(--rule); padding: 56px 0 64px; }
.foot-inner { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; justify-content: space-between; }
.foot-brand { max-width: 320px; }
.foot-brand p { color: var(--fg-muted); font-size: 14px; margin: 14px 0 0; line-height: 1.6; }
.foot-cols { display: flex; gap: 60px; flex-wrap: wrap; }
.foot-col h4 { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--fg-faint); margin: 0 0 14px; font-weight: 600; }
.foot-col a { display: block; color: var(--fg-muted); font-size: 14px; padding: 5px 0; transition: color .15s; }
.foot-col a:hover { color: var(--accent); }
.foot-bottom { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--rule-soft); display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; color: var(--fg-faint); font-size: 13px; font-family: var(--mono); }

/* ── scroll reveal ──────────────────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s cubic-bezier(.2,.7,.3,1), transform .7s cubic-bezier(.2,.7,.3,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-d="1"] { transition-delay: .07s; }
.reveal[data-d="2"] { transition-delay: .14s; }
.reveal[data-d="3"] { transition-delay: .21s; }
.reveal[data-d="4"] { transition-delay: .28s; }
.reveal[data-d="5"] { transition-delay: .35s; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* embedded dashboard sizing tweaks */
.hero-term .tui { font-size: 12px; }
.hero-term .tui .row { min-height: 0; }
