/* machine — component styles */

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--s-5);
}

section {
  padding: var(--s-10) 0;
}
section + section { padding-top: 0; }

@media (max-width: 1024px) {
  section { padding: var(--s-9) 0; }
}
@media (max-width: 640px) {
  section { padding: var(--s-8) 0; }
}

.section-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--t-mono-s);
  color: var(--dim);
  text-transform: lowercase;
  letter-spacing: 0;
  margin-bottom: var(--s-4);
}

.section-title {
  font-size: var(--t-h2);
  font-weight: 600;
  letter-spacing: -0.025em;
  margin-bottom: var(--s-4);
  max-width: 18ch;
}

.section-intro {
  color: var(--muted);
  font-size: var(--t-body);
  max-width: 56ch;
  margin-bottom: var(--s-7);
}

/* ---------- Brand mark ---------- */
.mark {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  width: 24px;
  height: 24px;
}
.mark > span {
  display: block;
  border-radius: 2px;
  background: var(--fg);
}
.mark > span:nth-child(1) { background: var(--cyan); }
.mark > span:nth-child(2) { background: rgba(244,244,245,.22); }
.mark > span:nth-child(3) { background: rgba(244,244,245,.22); }
.mark > span:nth-child(4) { background: rgba(244,244,245,.22); }

.mark.lg { width: 36px; height: 36px; gap: 3px; }
.mark.lg > span { border-radius: 3px; }

.wordmark {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 10, 12, 0);
  backdrop-filter: none;
  transition: background var(--dur-med) var(--ease-out),
              border-color var(--dur-med) var(--ease-out);
  border-bottom: 1px solid transparent;
}
.nav.is-stuck {
  background: rgba(10, 10, 12, 0.78);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom-color: var(--border);
}
.nav-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--s-5);
  font-size: var(--t-small);
  color: var(--muted);
}
.nav-links a { color: var(--muted); }
.nav-links a:hover { color: var(--fg); }
.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 6px 12px;
  font-size: var(--t-small);
  color: var(--fg);
}
.nav-cta:hover { border-color: var(--border-hi); color: var(--fg); }
.nav-cta .star {
  font-family: var(--font-mono);
  color: var(--muted);
  font-size: var(--t-mono-s);
}
@media (max-width: 640px) {
  .nav-links a.docs-link { display: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border-radius: var(--r-md);
  font-size: var(--t-small);
  font-weight: 500;
  font-family: var(--font-sans);
  letter-spacing: -0.005em;
  transition: transform var(--dur-fast) var(--ease-out),
              background var(--dur-med) var(--ease-out),
              border-color var(--dur-med) var(--ease-out),
              color var(--dur-med) var(--ease-out);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--cyan);
  color: var(--cyan-on);
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35);
}
.btn-primary:hover { background: var(--cyan-hi); color: var(--cyan-on); }

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg);
}
.btn-secondary:hover { border-color: var(--border-hi); color: var(--fg); }

.btn .arrow { transition: transform var(--dur-med) var(--ease-out); }
.btn:hover .arrow { transform: translateX(2px); }

/* Copy-on-click pill style for one-liner */
.installer {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  height: 52px;
  font-family: var(--font-mono);
  font-size: var(--t-mono);
}
.installer .prompt {
  display: flex;
  align-items: center;
  padding: 0 var(--s-4);
  color: var(--dim);
  border-right: 1px solid var(--border);
}
.installer .cmd {
  display: flex;
  align-items: center;
  padding: 0 var(--s-4);
  flex: 1 1 auto;
  color: var(--fg);
  overflow-x: auto;
  white-space: nowrap;
}
.installer .copy-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 var(--s-4);
  border-left: 1px solid var(--border);
  color: var(--muted);
  background: transparent;
  font-family: var(--font-mono);
  font-size: var(--t-mono-s);
  transition: color var(--dur-med) var(--ease-out), background var(--dur-med) var(--ease-out);
}
.installer .copy-btn:hover { color: var(--cyan); background: rgba(227,122,180,.06); }
.installer .copy-btn.copied { color: var(--green); }

/* ---------- Terminal card ---------- */
.term {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  line-height: 1.55;
  color: var(--fg);
  transition: border-color var(--dur-med) var(--ease-out);
}
.term:hover { border-color: var(--border-hi); }
.term-head {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 10px 14px;
  background: #0d0d10;
  border-bottom: 1px solid var(--border);
  color: var(--dim);
  font-size: var(--t-mono-s);
}
.term-dots {
  display: flex;
  gap: 6px;
}
.term-dots span {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #29292e;
}
.term-dots span:nth-child(1) { background: #3a3a40; }
.term-dots span:nth-child(2) { background: #2e2e34; }
.term-dots span:nth-child(3) { background: #232328; }
.term-head .label {
  color: var(--dim);
  letter-spacing: 0.01em;
}
.term-head .label .accent { color: var(--muted); }
.term-body {
  padding: var(--s-4) 18px var(--s-5);
  min-height: 120px;
  white-space: pre-wrap;
  word-break: break-word;
}
.term-body .prompt { color: var(--dim); }
.term-body .user   { color: var(--cyan); }
.term-body .host   { color: var(--purple); }
.term-body .ok     { color: var(--green); }
.term-body .warn   { color: var(--pink); }
.term-body .dim    { color: var(--dim); }
.term-body .muted  { color: var(--muted); }
.term-body .cmd    { color: var(--fg); }
.term-body .flag   { color: var(--purple); }
.term-body .str    { color: var(--green); }

.cursor {
  display: inline-block;
  width: 8px;
  height: 1em;
  vertical-align: -2px;
  background: var(--fg);
  margin-left: 2px;
  animation: blink 1s steps(2) infinite;
}
@keyframes blink {
  50% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; opacity: 1; }
}

/* ---------- Status dot ---------- */
.dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  vertical-align: 1px;
  margin-right: 6px;
}
.dot.cyan { background: var(--cyan); }
.dot.pink { background: var(--pink); }
.dot.purple { background: var(--purple); }
.dot.dim { background: var(--dim); }

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  position: relative;
  padding-top: var(--s-9);
  padding-bottom: var(--s-9);
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.86fr);
  gap: var(--s-8);
  align-items: center;
  width: 100%;
}
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; gap: var(--s-7); }
}
.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--t-mono-s);
  color: var(--dim);
  margin-bottom: var(--s-5);
  letter-spacing: 0;
  max-width: 48ch;
  line-height: 1.5;
}
.hero h1 {
  font-size: var(--t-hero);
  letter-spacing: -0.035em;
  line-height: 1.02;
  font-weight: 600;
  margin-bottom: var(--s-5);
  max-width: 18ch;
}
.hero h1 .machine-2 {
  background: linear-gradient(90deg, #22d3ee, #f472b6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  position: relative;
  display: inline-block;
}
.hero h1 .machine-2::after {
  /* sweep highlight */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.4) 50%, transparent 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  mix-blend-mode: screen;
  transform: translateX(-110%);
  animation: sweep 1.2s var(--ease-out) 0.4s 1 forwards;
  pointer-events: none;
}
@keyframes sweep {
  to { transform: translateX(110%); }
}
@media (prefers-reduced-motion: reduce) {
  .hero h1 .machine-2::after { animation: none; opacity: 0; }
}

.hero-sub {
  color: var(--muted);
  font-size: var(--t-body);
  max-width: 52ch;
  margin-bottom: var(--s-6);
  line-height: 1.5;
}
.hero-sub .nb { white-space: nowrap; }
.hero-sub code {
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 4px;
}

.hero-ctas {
  display: flex;
  gap: var(--s-3);
  flex-wrap: wrap;
  align-items: center;
}
.installer.hero-installer {
  width: 100%;
  max-width: 460px;
}
.hero-installer {
  width: 100%;
  max-width: 520px;
}

.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: var(--s-6);
  transform: translateX(-50%);
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: var(--t-mono-s);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  animation: bob 2.4s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translate(-50%, 0); }
  50%      { transform: translate(-50%, 4px); }
}
@media (prefers-reduced-motion: reduce) { .scroll-hint { animation: none; } }

/* hero terminal peek */
.hero-term-wrap {
  position: relative;
}
.hero-term-wrap .term {
  width: 100%;
  max-width: 460px;
  margin-left: auto;
  box-shadow: 0 24px 60px -28px rgba(227,122,180, 0.22);
}

/* ---------- Three-up grid ---------- */
.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-5);
}
@media (max-width: 1024px) {
  .why-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .why-grid { grid-template-columns: 1fr; }
}
.why-card {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-6) var(--s-5);
  background: var(--surface);
  transition: border-color var(--dur-med) var(--ease-out);
}
.why-card:hover { border-color: var(--border-hi); }
.why-card .why-num {
  font-family: var(--font-mono);
  font-size: var(--t-mono-s);
  color: var(--dim);
  margin-bottom: var(--s-5);
}
.why-card h3 {
  font-size: 20px;
  margin-bottom: var(--s-3);
  letter-spacing: -0.015em;
}
.why-card p {
  color: var(--muted);
  font-size: var(--t-small);
  line-height: 1.5;
}
.why-card code {
  display: inline-block;
  margin-top: var(--s-4);
  font-family: var(--font-mono);
  font-size: var(--t-mono-s);
  color: var(--cyan);
  background: rgba(227,122,180,.07);
  border: 1px solid rgba(227,122,180,.22);
  padding: 3px 8px;
  border-radius: 4px;
}

/* ---------- Machine Room diagram ---------- */
.machine-room {
  position: relative;
}
.diagram {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}
.diagram-captions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-5);
  margin-top: var(--s-7);
}
@media (max-width: 640px) {
  .diagram-captions { grid-template-columns: 1fr; }
}
.diagram-captions .cap {
  border-top: 1px solid var(--border);
  padding-top: var(--s-4);
}
.diagram-captions .cap .k {
  font-family: var(--font-mono);
  font-size: var(--t-mono-s);
  color: var(--cyan);
  margin-bottom: 6px;
}
.diagram-captions .cap .v {
  color: var(--muted);
  font-size: var(--t-small);
  line-height: 1.5;
}

/* ---------- Ghost (threat model) ---------- */
.ghost {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  overflow: hidden;
}
@media (max-width: 760px) {
  .ghost { grid-template-columns: 1fr; }
  .ghost .col + .col {
    border-left: 0;
    border-top: 1px dashed var(--border-hi);
  }
}
.ghost .col {
  padding: var(--s-6);
}
.ghost .col + .col {
  border-left: 1px dashed var(--border-hi);
}
.ghost .col h4 {
  font-family: var(--font-mono);
  font-size: var(--t-mono-s);
  font-weight: 500;
  text-transform: lowercase;
  letter-spacing: 0;
  color: var(--muted);
  margin-bottom: var(--s-5);
  display: flex;
  align-items: center;
  gap: 8px;
}
.ghost .col h4 .glyph {
  display: inline-grid;
  place-items: center;
  width: 18px; height: 18px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.ghost .col.allow h4 .glyph { background: rgba(52, 211, 153, .14); color: var(--green); }
.ghost .col.deny  h4 .glyph { background: rgba(244, 114, 182, .12); color: var(--pink); }

.ghost ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.ghost li {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: var(--s-3);
  align-items: start;
  font-size: var(--t-small);
  color: var(--fg);
  line-height: 1.45;
  padding: 6px 0;
}
.ghost li .ic {
  font-family: var(--font-mono);
  color: var(--green);
  font-size: 12px;
  padding-top: 3px;
}
.ghost .deny li .ic { color: var(--pink); }
.ghost li .sub {
  display: block;
  color: var(--muted);
  font-size: var(--t-mono-s);
  font-family: var(--font-mono);
  margin-top: 2px;
}

/* ---------- Profile / Machine Shop ---------- */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-4);
}
@media (max-width: 1024px) {
  .profile-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .profile-grid { grid-template-columns: 1fr; }
}
.profile-card {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  transition: border-color var(--dur-med) var(--ease-out);
}
.profile-card:hover { border-color: var(--border-hi); }
.profile-card .head {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.profile-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--fg);
}
.profile-card .name {
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  color: var(--fg);
}
.profile-card .desc {
  color: var(--muted);
  font-size: var(--t-small);
  line-height: 1.5;
  min-height: 42px;
}
.profile-card .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 8px;
}
.profile-card.byo {
  border-style: dashed;
  background: transparent;
}
.profile-card.byo .profile-icon {
  background: transparent;
  border-style: dashed;
}

/* ---------- Live demo ---------- */
.demo-wrap {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  overflow: hidden;
}
.demo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: #0d0d10;
  font-family: var(--font-mono);
  font-size: var(--t-mono-s);
  color: var(--dim);
}
.demo-head .left { display: flex; align-items: center; gap: 12px; }
.demo-head .right { display: flex; align-items: center; gap: 12px; color: var(--dim); }
.demo-body {
  padding: 20px 20px 28px;
  min-height: 360px;
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  line-height: 1.55;
  white-space: pre-wrap;
}
.demo-restart {
  font-family: var(--font-mono);
  font-size: var(--t-mono-s);
  color: var(--cyan);
  background: rgba(227,122,180,.07);
  border: 1px solid rgba(227,122,180,.22);
  border-radius: 4px;
  padding: 3px 8px;
}
.demo-restart:hover { background: rgba(227,122,180,.14); }

/* ---------- Tend / commands grid ---------- */
.cmd-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-3);
}
@media (max-width: 1024px) {
  .cmd-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .cmd-grid { grid-template-columns: 1fr; }
}
.cmd-card {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--r-md);
  padding: var(--s-4) var(--s-4) var(--s-4);
  transition: border-color var(--dur-med) var(--ease-out);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 112px;
}
.cmd-card:hover { border-color: var(--border-hi); }
.cmd-card .k {
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  color: var(--fg);
}
.cmd-card .k .sub { color: var(--dim); }
.cmd-card .v {
  color: var(--muted);
  font-size: var(--t-small);
  line-height: 1.45;
}
/* destroy card intentionally unhighlighted — reads as just another command */

/* ---------- IDE mock ---------- */
.ide-wrap {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  overflow: hidden;
}
.ide-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #0d0d10;
  border-bottom: 1px solid var(--border);
  color: var(--dim);
  font-size: var(--t-mono-s);
  font-family: var(--font-mono);
}
.ide-body {
  padding: var(--s-5);
  font-family: var(--font-sans);
}
.ide-picker {
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 6px;
  overflow: hidden;
  max-width: 560px;
  margin: 0 auto;
  box-shadow: 0 20px 60px -20px rgba(0,0,0,.6);
}
.ide-picker .picker-input {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.ide-picker .picker-input .placeholder { color: var(--dim); }
.ide-picker .picker-list {
  display: flex;
  flex-direction: column;
}
.ide-picker .row {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 9px 12px;
  font-size: var(--t-small);
  color: var(--fg);
  border-bottom: 1px solid var(--border);
}
.ide-picker .row:last-child { border-bottom: 0; }
.ide-picker .row.active { background: rgba(227,122,180,.08); }
.ide-picker .row .glyph {
  font-family: var(--font-mono);
  color: var(--dim);
  font-size: 13px;
}
.ide-picker .row .name {
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  color: var(--fg);
}
.ide-picker .row .meta {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: var(--t-mono-s);
}
.ide-caption {
  text-align: center;
  color: var(--muted);
  font-size: var(--t-small);
  margin-top: var(--s-5);
}

/* ---------- Final CTA ---------- */
.final {
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-9) var(--s-6);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(227,122,180,.08), transparent 60%),
    var(--surface);
}
.final h2 {
  font-size: var(--t-h2);
  margin-bottom: var(--s-4);
  letter-spacing: -0.03em;
}
.final p {
  color: var(--muted);
  max-width: 48ch;
  margin: 0 auto var(--s-6);
}
.final-actions {
  display: flex;
  gap: var(--s-3);
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
}
.final .installer {
  max-width: 520px;
  margin: 0 auto var(--s-5);
}
.install-alt {
  font-size: 0.85rem;
  max-width: 56ch;
  margin: calc(var(--s-5) * -0.5) auto var(--s-6) !important;
  color: var(--muted);
}
.install-alt a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
}
.install-alt a:hover { text-decoration-color: currentColor; }

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--border);
  margin-top: var(--s-10);
  padding: var(--s-8) 0 var(--s-7);
  color: var(--muted);
}
.foot-grid {
  display: grid;
  grid-template-columns: 2fr repeat(4, 1fr);
  gap: var(--s-6);
}
@media (max-width: 1024px) {
  .foot-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .foot-grid { grid-template-columns: 1fr; }
}
.foot-tag {
  font-family: var(--font-mono);
  font-size: var(--t-mono-s);
  color: var(--dim);
  font-style: italic;
  max-width: 36ch;
  line-height: 1.5;
}
.foot-col h5 {
  font-family: var(--font-mono);
  font-size: var(--t-mono-s);
  font-weight: 500;
  color: var(--dim);
  margin: 0 0 var(--s-3);
  text-transform: lowercase;
}
.foot-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.foot-col a { font-size: var(--t-small); color: var(--muted); }
.foot-col a:hover { color: var(--fg); }
.foot-bottom {
  margin-top: var(--s-7);
  padding-top: var(--s-5);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s-3);
  font-family: var(--font-mono);
  font-size: var(--t-mono-s);
  color: var(--dim);
}
