@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/space-grotesk-400.woff2") format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/space-grotesk-500.woff2") format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/space-grotesk-700.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/jetbrains-mono-400.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/jetbrains-mono-500.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/jetbrains-mono-700.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --bg: #f5f4f0;
  --surface: #ffffff;
  --text: #15150f;
  --muted: #6c6c62;
  --faint: #a6a69c;
  --line: rgba(21, 21, 15, 0.12);
  --line-strong: rgba(21, 21, 15, 0.22);
  --accent: #157f3b;
  --accent-ink: #0c4f25;
  --term-bg: #16160f;
  --term-bar: #100f0a;
  --term-ink: #ededed;
  --term-dim: #8f8f84;
  --term-green: #46d07a;
  --term-line: rgba(255, 255, 255, 0.1);
  --term-line-strong: rgba(255, 255, 255, 0.2);
  --max: 1100px;
  --font-display: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100svh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

/* ---------- shared shell ---------- */
.site-header,
.footer,
main,
.hero,
.legal-shell {
  width: min(calc(100% - 40px), var(--max));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-weight: 500;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
  font-family: var(--font-mono);
}

.nav a:hover,
.text-link:hover,
.legal-content a:hover,
.footer a:hover {
  color: var(--accent);
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

/* ---------- hero (terminal-anchored) ---------- */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
  padding: 28px 0 52px;
  max-width: 900px;
}

.hero h1 {
  font-size: clamp(27px, 3.8vw, 42px);
  line-height: 1.04;
  font-weight: 500;
  letter-spacing: -0.03em;
  max-width: 17ch;
}

/* ---------- terminal window ---------- */
.term {
  border: 1px solid var(--term-bg);
  border-radius: 12px;
  background: var(--term-bg);
  overflow: hidden;
  box-shadow: 0 22px 60px -28px rgba(21, 21, 15, 0.55);
}

.term-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: var(--term-bar);
  border-bottom: 1px solid var(--term-line);
  color: var(--term-dim);
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.term-dots {
  display: inline-flex;
  gap: 6px;
}

.term-dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--term-line-strong);
}

.term-body {
  min-height: 286px;
  padding: 18px 18px 20px;
  font-family: var(--font-mono);
  font-size: clamp(13px, 1.45vw, 15px);
  line-height: 1.75;
  color: var(--term-ink);
  letter-spacing: 0;
}

.t-line {
  display: block;
  overflow-wrap: anywhere;
}

.t-line + .t-line {
  margin-top: 2px;
}

.who {
  color: var(--term-dim);
  user-select: none;
}

.t-agent,
.t-agent .who {
  color: var(--term-green);
}

.t-cursor {
  display: inline-block;
  width: 9px;
  height: 1.02em;
  background: var(--term-ink);
  vertical-align: -2px;
  margin-left: 1px;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

.t-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0;
  padding: 11px 13px;
  border: 1px solid var(--term-line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.045);
}

.t-card .meta {
  color: var(--term-ink);
}

.t-card .acts {
  display: inline-flex;
  gap: 8px;
}

.t-btn {
  border: 1px solid var(--term-line-strong);
  border-radius: 7px;
  padding: 3px 10px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--term-ink);
}

.t-btn.ok {
  border-color: var(--term-green);
  color: var(--term-green);
}

/* typing reveal */
.term.is-typing .t-line {
  opacity: 0;
}

.t-line.show,
.term.is-typing .t-line.show {
  opacity: 1;
  transition: opacity 0.22s ease;
}

/* ---------- copy command ---------- */
.cmd {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
}

.cmd-label {
  width: 100%;
  color: var(--muted);
  font-size: 14px;
}

.cmd-note {
  max-width: 64ch;
  margin: -2px 0 0;
  color: var(--faint);
  font-size: 13px;
}

.cmd-field {
  flex: 1 1 340px;
  min-width: 0;
  display: flex;
  gap: 9px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text);
  overflow-wrap: anywhere;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  border: 1px solid var(--text);
  border-radius: 10px;
  background: var(--text);
  color: var(--surface);
  padding: 0 18px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    opacity 0.18s ease;
}

.button:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.button.accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.button.accent:hover {
  background: var(--accent-ink);
  border-color: var(--accent-ink);
}

.button-muted {
  background: transparent;
  color: var(--muted);
  border-color: var(--line-strong);
}

.button-muted:hover {
  background: var(--bg);
  color: var(--text);
}

.copy-icon {
  width: 14px;
  height: 14px;
}

.copy-status {
  min-height: 18px;
  margin: -8px 0 0;
  color: var(--accent);
  font-size: 13px;
  font-family: var(--font-mono);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.agent-prompt {
  overflow-x: auto;
  margin: 0;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  padding: 13px 15px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.agent-prompt code {
  font: inherit;
}

/* ---------- footer ---------- */
.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 0 28px;
  color: var(--muted);
  font-size: 14px;
}

.footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-family: var(--font-mono);
}

.platform-line {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 13px;
}

/* ---------- product + auth surfaces (mcp.bernar.xyz) ---------- */
.product-main {
  width: min(calc(100% - 40px), 700px);
  margin-inline: auto;
  padding: 48px 0 64px;
}

.product-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 24px;
  color: var(--text);
  font-weight: 500;
}

.product-brand img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.product-main h1 {
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 14px;
}

.product-main h2 {
  margin: 30px 0 12px;
  font-size: 16px;
  font-weight: 500;
  color: var(--muted);
}

.product-lead {
  max-width: 56ch;
  color: var(--muted);
}

.auth-card {
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 26px;
}

.auth-card h1 {
  margin-bottom: 12px;
  font-size: clamp(24px, 4vw, 34px);
}

.auth-card h2 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 500;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.field label {
  color: var(--muted);
  font-size: 13px;
}

.field input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  padding: 11px 13px;
  font: inherit;
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
}

.auth-divider {
  margin: 24px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.mcp-links {
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}

.mcp-links li {
  border-bottom: 1px solid var(--line);
  padding: 11px 0;
}

.mcp-links a {
  color: var(--accent);
}

.note-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.note-list li {
  margin-bottom: 6px;
}

.client-name {
  color: var(--text);
  font-weight: 500;
}

/* ---------- legal pages ---------- */
.legal-shell {
  max-width: 820px;
}

.legal-hero {
  padding: 56px 0 30px;
}

.legal-hero h1 {
  font-size: clamp(34px, 7vw, 56px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.02;
}

.legal-hero p {
  max-width: 70ch;
  margin-top: 14px;
  color: var(--muted);
}

.legal-content {
  padding-bottom: 64px;
}

.legal-content section {
  padding: 24px 0;
  border-top: 1px solid var(--line);
}

.legal-content h2 {
  margin-bottom: 12px;
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.legal-content p,
.legal-content li {
  color: var(--text);
}

.legal-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-content ul {
  margin: 8px 0 0;
  padding-left: 22px;
}

.legal-content li + li {
  margin-top: 8px;
}

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  .term-body {
    min-height: 320px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .t-cursor {
    animation: none;
  }
  .term.is-typing .t-line {
    opacity: 1;
  }
}
