:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1117;
  --bg-elevated: #161b22;
  --bg-inset: #010409;
  --bg-hover: #1c2128;
  --bg-overlay: rgba(13, 17, 23, 0.72);
  --border: #30363d;
  --border-muted: #21262d;
  --border-strong: #6e7681;
  --fg: #e6edf3;
  --fg-default: #c9d1d9;
  --fg-muted: #8b949e;
  --fg-subtle: #6e7681;
  --accent: #58a6ff;
  --accent-emphasis: #1f6feb;
  --accent-subtle: rgba(56, 139, 253, 0.15);
  --accent-on: #ffffff;
  --success: #3fb950;
  --success-subtle: rgba(63, 185, 80, 0.16);
  --warning: #d29922;
  --warning-subtle: rgba(187, 128, 9, 0.18);
  --danger: #f85149;
  --danger-subtle: rgba(248, 81, 73, 0.16);
  --done: #3fb950;
  --pending: #d29922;
  --code-fg: #adbac7;
  --code-string: #a5d6ff;
  --code-keyword: #ff7b72;
  --code-comment: #8b949e;
  --code-number: #79c0ff;
  --shadow-sm: 0 1px 0 rgba(1, 4, 9, 0.4);
  --shadow-md: 0 8px 24px rgba(1, 4, 9, 0.4);
  --shadow-lg: 0 24px 48px rgba(1, 4, 9, 0.45);
  --terminal-prompt: #7ee787;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --bg-elevated: #f6f8fa;
  --bg-inset: #f6f8fa;
  --bg-hover: #eaeef2;
  --bg-overlay: rgba(255, 255, 255, 0.72);
  --border: #d0d7de;
  --border-muted: #d8dee4;
  --border-strong: #8c959f;
  --fg: #1f2328;
  --fg-default: #1f2328;
  --fg-muted: #59636e;
  --fg-subtle: #6e7781;
  --accent: #0969da;
  --accent-emphasis: #0550ae;
  --accent-subtle: rgba(9, 105, 218, 0.1);
  --accent-on: #ffffff;
  --success: #1a7f37;
  --success-subtle: rgba(26, 127, 55, 0.1);
  --warning: #9a6700;
  --warning-subtle: rgba(154, 103, 0, 0.12);
  --danger: #cf222e;
  --danger-subtle: rgba(207, 34, 46, 0.1);
  --done: #1a7f37;
  --pending: #9a6700;
  --code-fg: #1f2328;
  --code-string: #0a3069;
  --code-keyword: #cf222e;
  --code-comment: #6e7781;
  --code-number: #0550ae;
  --shadow-sm: 0 1px 0 rgba(31, 35, 40, 0.04);
  --shadow-md: 0 3px 6px rgba(140, 149, 159, 0.15);
  --shadow-lg: 0 8px 24px rgba(140, 149, 159, 0.2);
  --terminal-prompt: #1a7f37;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg-default);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial,
    sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3,
h4,
p,
dd,
dt,
ol,
ul {
  margin: 0;
}

code,
pre {
  font-family:
    ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
  font-size: 0.875rem;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-on);
  font-weight: 600;
  transform: translateY(-150%);
  transition: transform 0.15s ease-out;
}

.skip-link:focus {
  transform: translateY(0);
  text-decoration: none;
}

/* ============================================================ */
/* Header                                                       */
/* ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px clamp(16px, 4vw, 32px);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  backdrop-filter: saturate(180%) blur(6px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  font-weight: 600;
  font-size: 1rem;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-elevated);
  color: var(--accent);
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 12px;
}

.site-nav a {
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--fg-default);
  font-size: 0.875rem;
  font-weight: 500;
}

.site-nav a:hover {
  background: var(--bg-elevated);
  text-decoration: none;
}

.header-spacer {
  flex: 1;
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.icon-link,
.theme-toggle {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-elevated);
  color: var(--fg-default);
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}

.icon-link:hover,
.theme-toggle:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
  text-decoration: none;
}

.icon-link svg,
.theme-toggle svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.theme-toggle .icon-sun {
  display: none;
}

.theme-toggle .icon-moon {
  display: block;
}

:root[data-theme="light"] .theme-toggle .icon-sun {
  display: block;
}

:root[data-theme="light"] .theme-toggle .icon-moon {
  display: none;
}

/* ============================================================ */
/* Hero                                                          */
/* ============================================================ */

main {
  display: block;
}

.hero {
  position: relative;
  padding: clamp(56px, 9vw, 120px) clamp(16px, 4vw, 32px)
    clamp(48px, 7vw, 88px);
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(
      ellipse 80% 60% at 70% 0%,
      var(--accent-subtle),
      transparent 70%
    ),
    var(--bg);
  isolation: isolate;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
  max-width: 1180px;
  margin: 0 auto;
}

.hero-copy {
  min-width: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  padding: 2px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--fg-muted);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

h1 {
  margin-bottom: 16px;
  color: var(--fg);
  font-size: clamp(2.25rem, 4.6vw, 3.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h1 .accent {
  color: var(--accent);
}

.lead {
  max-width: 56ch;
  margin-bottom: 24px;
  color: var(--fg-muted);
  font-size: 1.125rem;
  line-height: 1.55;
}

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

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}

.button:hover {
  text-decoration: none;
}

.button svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.button.primary {
  background: var(--accent-emphasis);
  border-color: var(--accent-emphasis);
  color: #ffffff;
}

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

.button.secondary {
  background: var(--bg-elevated);
  border-color: var(--border);
  color: var(--fg-default);
}

.button.secondary:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

.hero-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
  overflow: hidden;
}

.hero-facts div {
  padding: 14px 18px;
}

.hero-facts div + div {
  border-left: 1px solid var(--border);
}

.hero-facts dt {
  color: var(--fg-muted);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hero-facts dd {
  margin-top: 4px;
  color: var(--fg);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ============================================================ */
/* Terminal preview                                              */
/* ============================================================ */

.terminal {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-inset);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  min-width: 0;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}

.terminal-bar .dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--border-strong);
}

.terminal-bar .dot.red {
  background: #ff5f57;
}

.terminal-bar .dot.amber {
  background: #febc2e;
}

.terminal-bar .dot.green {
  background: #28c840;
}

.terminal-bar .title {
  flex: 1;
  text-align: center;
  color: var(--fg-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
}

.terminal pre {
  margin: 0;
  padding: 18px 20px;
  color: var(--code-fg);
  background: transparent;
  font-size: 0.86rem;
  line-height: 1.65;
  overflow-x: auto;
  white-space: pre;
}

.terminal .prompt {
  color: var(--terminal-prompt);
  user-select: none;
}

.terminal .cmd {
  color: var(--fg);
}

.terminal .arg {
  color: var(--code-string);
}

.terminal .flag {
  color: var(--code-number);
}

.terminal .out {
  color: var(--fg-muted);
}

.terminal .json-key {
  color: var(--code-keyword);
}

.terminal .json-str {
  color: var(--code-string);
}

.terminal .comment {
  color: var(--code-comment);
  font-style: italic;
}

/* ============================================================ */
/* Sections                                                      */
/* ============================================================ */

.section {
  padding: clamp(56px, 8vw, 96px) clamp(16px, 4vw, 32px);
  border-bottom: 1px solid var(--border);
}

.section-inner {
  max-width: 1180px;
  margin: 0 auto;
}

.section-heading {
  margin-bottom: 40px;
  max-width: 720px;
}

.section-heading h2 {
  color: var(--fg);
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}

.section-heading p {
  color: var(--fg-muted);
  font-size: 1.05rem;
}

/* ============================================================ */
/* Status                                                        */
/* ============================================================ */

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.status-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
  transition: border-color 0.12s ease, transform 0.12s ease;
}

.status-card:hover {
  border-color: var(--border-strong);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}

.badge.done {
  background: var(--success-subtle);
  color: var(--done);
}

.badge.pending {
  background: var(--warning-subtle);
  color: var(--pending);
}

.status-card h3 {
  color: var(--fg);
  font-size: 1rem;
  font-weight: 600;
}

.status-card p {
  color: var(--fg-muted);
  font-size: 0.92rem;
}

/* ============================================================ */
/* Contract grid                                                 */
/* ============================================================ */

.contract-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.contract-card {
  position: relative;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
}

.contract-card .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--accent-subtle);
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 14px;
}

.contract-card h3 {
  color: var(--fg);
  font-size: 1.02rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.contract-card p {
  color: var(--fg-muted);
  font-size: 0.92rem;
}

/* ============================================================ */
/* Security & operator section                                   */
/* ============================================================ */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.feature-card {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
}

.feature-card .icon {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--accent);
}

.feature-card .icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.feature-card h3 {
  color: var(--fg);
  font-size: 1.02rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.feature-card p {
  color: var(--fg-muted);
  font-size: 0.92rem;
}

/* ============================================================ */
/* Roadmap                                                       */
/* ============================================================ */

.roadmap-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.roadmap-item {
  position: relative;
  padding: 22px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: 6px;
  background: var(--bg-elevated);
}

.roadmap-item.now {
  border-left-color: var(--accent);
}

.roadmap-item.next {
  border-left-color: var(--warning);
}

.roadmap-item.later {
  border-left-color: var(--fg-subtle);
}

.roadmap-item .phase {
  color: var(--fg-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.roadmap-item h3 {
  color: var(--fg);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.roadmap-item p {
  color: var(--fg-muted);
  font-size: 0.92rem;
}

/* ============================================================ */
/* Self-host / Release                                           */
/* ============================================================ */

.deploy-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 56px);
  align-items: center;
}

.deploy-copy h2 {
  margin-bottom: 16px;
}

.deploy-copy p {
  color: var(--fg-muted);
  font-size: 1.02rem;
}

.deploy-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-inset);
  overflow: hidden;
}

.deploy-card-header {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--fg-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
}

.deploy-rows {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  gap: 0;
}

.deploy-rows dt,
.deploy-rows dd {
  padding: 12px 16px;
  border-top: 1px solid var(--border-muted);
}

.deploy-rows dt:first-of-type,
.deploy-rows dd:first-of-type {
  border-top: 0;
}

.deploy-rows dt {
  color: var(--fg-muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.deploy-rows dd {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  color: var(--fg);
}

/* ============================================================ */
/* Footer                                                        */
/* ============================================================ */

footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding: 24px clamp(16px, 4vw, 32px);
  border-top: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg-muted);
  font-size: 0.875rem;
}

footer .footer-brand {
  color: var(--fg);
  font-weight: 600;
}

footer .footer-links {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-left: auto;
}

footer .footer-links a {
  color: var(--fg-muted);
}

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

/* ============================================================ */
/* Responsive                                                    */
/* ============================================================ */

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .deploy-section {
    grid-template-columns: 1fr;
  }

  .roadmap-grid {
    grid-template-columns: 1fr;
  }

  .site-nav {
    display: none;
  }
}

@media (max-width: 540px) {
  .hero-facts {
    grid-template-columns: 1fr;
  }

  .hero-facts div + div {
    border-left: 0;
    border-top: 1px solid var(--border);
  }

  .site-header {
    padding: 10px 14px;
  }

  .header-actions {
    gap: 6px;
  }
}
