/* DVeVPN site — shared ecosystem look with DVeProto */
:root,
html[data-theme="dark"] {
  --bg: #12140f;
  --bg-2: #1a1d16;
  --bg-3: #22261c;
  --text: #ebe6d9;
  --muted: #9a9588;
  --line: #2e3228;
  --accent: #c4a35a;
  --accent-2: #8fbc8f;
  --code-bg: #0c0d0a;
  --card: rgba(255, 255, 255, 0.03);
  --card-hover: rgba(196, 163, 90, 0.08);
  --ok: #8fbc8f;
  --warn: #c4a35a;
  --bad: #a07070;
  --hero-glow: rgba(143, 188, 143, 0.07);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  --theme-meta: #12140f;
}

html[data-theme="light"] {
  --bg: #f4f1e8;
  --bg-2: #ebe6d9;
  --bg-3: #e0dac8;
  --text: #1a1d16;
  --muted: #5c594f;
  --line: #cfc8b4;
  --accent: #8a6d2f;
  --accent-2: #3d6b4f;
  --code-bg: #e8e2d2;
  --card: rgba(26, 29, 22, 0.04);
  --card-hover: rgba(138, 109, 47, 0.1);
  --ok: #2f6b45;
  --warn: #8a6d2f;
  --bad: #8a4040;
  --hero-glow: rgba(138, 109, 47, 0.12);
  --shadow: 0 12px 32px rgba(26, 29, 22, 0.08);
  --theme-meta: #f4f1e8;
}

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

html { scroll-behavior: smooth; overflow-x: clip; }

body {
  overflow-x: clip;
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  color: var(--text);
  background:
    radial-gradient(ellipse 90% 50% at 80% 0%, var(--hero-glow), transparent 55%),
    linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 42%, var(--bg) 100%);
  line-height: 1.6;
  min-height: 100dvh;
  font-size: 1.02rem;
}

a { color: var(--accent-2); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--accent); }

code {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.88em;
  color: var(--text);
  background: var(--card);
  padding: 0.05em 0.28em;
  border-radius: 3px;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding-left: max(18px, env(safe-area-inset-left));
  padding-right: max(18px, env(safe-area-inset-right));
}

/* Header */
.top {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.top-brand {
  font-family: 'Bricolage Grotesque', Georgia, serif;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}
.top-brand:hover { color: var(--accent); }
.brand-mark { border-radius: 6px; display: block; }

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-drawer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 18px;
  padding-top: 10px;
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 0.92rem;
}
.top-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 8px 2px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}
.top-nav a:hover,
.top-nav a.is-active { color: var(--accent); }

.ctrl-group { display: flex; align-items: center; gap: 8px; }
.ctrl-group-mobile { display: none; }

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  position: relative;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }
.top.is-open .nav-toggle-bars { background: transparent; }
.top.is-open .nav-toggle-bars::before { top: 0; transform: rotate(45deg); }
.top.is-open .nav-toggle-bars::after { top: 0; transform: rotate(-45deg); }

.lang-switch, .theme-switch {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
.lang-btn, .theme-btn {
  font: inherit;
  font-size: 0.78rem;
  font-family: 'IBM Plex Mono', monospace;
  background: transparent;
  color: var(--muted);
  border: 0;
  padding: 5px 9px;
  cursor: pointer;
}
.lang-btn[aria-pressed="true"],
.theme-btn[aria-pressed="true"] {
  background: var(--card-hover);
  color: var(--text);
}

/* Hero */
.hero {
  position: relative;
  max-width: 1080px;
  margin: 0 auto;
  padding: 56px max(18px, env(safe-area-inset-right)) 48px max(18px, env(safe-area-inset-left));
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 36px;
  align-items: center;
  overflow: hidden;
  min-height: min(72vh, 640px);
}

.hero-net {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.55;
  z-index: 0;
}
.hero-text { position: relative; z-index: 1; }

.brand {
  font-family: 'Bricolage Grotesque', Georgia, serif;
  font-size: clamp(2.6rem, 8vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 0.95;
  color: var(--text);
  margin-bottom: 10px;
  animation: rise 0.7s ease both;
}

.tagline {
  font-family: 'Bricolage Grotesque', Georgia, serif;
  font-size: clamp(1.25rem, 3.2vw, 1.75rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--accent);
  margin-bottom: 14px;
  animation: rise 0.7s ease 0.08s both;
}

.lede {
  color: var(--muted);
  max-width: 34em;
  margin-bottom: 26px;
  font-size: 1.08rem;
  animation: rise 0.7s ease 0.14s both;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  animation: rise 0.7s ease 0.2s both;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid var(--line);
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--accent);
  color: #12140f;
  border-color: var(--accent);
}
.btn-primary:hover { background: #d4b56a; color: #12140f; }
.btn-ghost {
  background: var(--card);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: not-allowed;
}

.hero-panel {
  position: relative;
  z-index: 1;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  padding: 22px;
  box-shadow: var(--shadow);
  animation: rise 0.8s ease 0.18s both;
}
.hero-panel h2 {
  font-family: 'Bricolage Grotesque', Georgia, serif;
  font-size: 1.05rem;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}
.stack-list {
  list-style: none;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.82rem;
  color: var(--muted);
}
.stack-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}
.stack-list li:last-child { border-bottom: 0; }
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-2) 25%, transparent);
  flex-shrink: 0;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* Sections */
.section {
  max-width: 1080px;
  margin: 0 auto;
  padding: 48px max(18px, env(safe-area-inset-right)) 24px max(18px, env(safe-area-inset-left));
}
.section-h {
  font-family: 'Bricolage Grotesque', Georgia, serif;
  font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}
.section-lede {
  color: var(--muted);
  max-width: 40em;
  margin-bottom: 28px;
}

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

.grid-2,
.grid-3,
.grid-4,
.install-cols {
  width: 100%;
  max-width: 100%;
}
.grid-2 > *,
.grid-3 > *,
.grid-4 > *,
.install-cols > * {
  min-width: 0;
  max-width: 100%;
}

.card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  padding: 20px 18px;
  transition: background 0.2s, border-color 0.2s;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.card:hover { background: var(--card-hover); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.card-icon {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--accent);
  margin-bottom: 12px;
  font-size: 1.1rem;
}
.card h3 {
  font-family: 'Bricolage Grotesque', Georgia, serif;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.card ul { padding-left: 1.1em; color: var(--muted); font-size: 0.95rem; }
.card li { margin: 4px 0; }
.card p { color: var(--muted); font-size: 0.95rem; }
.card .cmd {
  margin-top: 12px;
  font-size: 0.8rem;
  word-break: break-all;
}

.badge {
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--line);
  color: var(--muted);
  vertical-align: middle;
  white-space: nowrap;
}
.badge-ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.badge-exp { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }
.badge-plan { color: var(--muted); }

/* Table */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}
table.compare {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 560px;
}
.compare th, .compare td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.compare th {
  font-family: 'Bricolage Grotesque', Georgia, serif;
  font-weight: 600;
  background: var(--bg-3);
}
.compare tr:last-child td { border-bottom: 0; }
.compare td.yes { color: var(--ok); font-weight: 600; }
.compare td.no { color: var(--bad); opacity: 0.75; }
.note {
  margin-top: 14px;
  font-size: 0.88rem;
  color: var(--muted);
}

/* Code blocks */
pre.code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.82rem;
  max-width: 100%;
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  overflow-x: auto;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-wrap;
  color: var(--text);
  line-height: 1.5;
  margin: 12px 0 18px;
}

.install-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.install-cols h3 {
  font-family: 'Bricolage Grotesque', Georgia, serif;
  margin-bottom: 8px;
}

/* CLI cards */
.cli-cmd {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.9rem;
  color: var(--accent);
  margin-bottom: 8px;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}

/* Architecture SVG */
.arch {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  padding: 24px 12px;
  overflow-x: auto;
}
.arch svg { display: block; margin: 0 auto; max-width: 420px; width: 100%; height: auto; }

/* Footer */
.foot {
  max-width: 1080px;
  margin: 48px auto 0;
  padding: 28px max(18px, env(safe-area-inset-right)) 40px max(18px, env(safe-area-inset-left));
  border-top: 1px solid var(--line);
}
.foot-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 18px 32px;
}
.foot-brand {
  font-family: 'Bricolage Grotesque', Georgia, serif;
  font-weight: 700;
  font-size: 1.1rem;
}
.foot-aff { color: var(--muted); font-size: 0.88rem; margin-top: 4px; }
.foot-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  font-size: 0.92rem;
}
.foot-nav a { color: var(--muted); text-decoration: none; }
.foot-nav a:hover { color: var(--accent); }

/* Docs layout */
.docs-layout {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px max(18px, env(safe-area-inset-right)) 48px max(18px, env(safe-area-inset-left));
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  align-items: start;
}
.docs-nav {
  position: sticky;
  top: 72px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  padding: 16px;
}
.docs-nav-k {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.docs-nav ul { list-style: none; }
.docs-nav a {
  display: block;
  padding: 6px 0;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
}
.docs-nav a:hover, .docs-nav a.is-active { color: var(--accent); }
.docs-body h1 {
  font-family: 'Bricolage Grotesque', Georgia, serif;
  font-size: clamp(1.6rem, 3vw, 2rem);
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}
.docs-body h2 {
  font-family: 'Bricolage Grotesque', Georgia, serif;
  font-size: 1.25rem;
  margin: 28px 0 10px;
  letter-spacing: -0.02em;
}
.docs-body p, .docs-body li { color: var(--muted); }
.docs-body ul, .docs-body ol { padding-left: 1.2em; margin: 8px 0 14px; }
.docs-body li { margin: 4px 0; }
.docs-body p { margin-bottom: 12px; }

/* Download / page hero small */
.page-hero {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px max(18px, env(safe-area-inset-right)) 12px max(18px, env(safe-area-inset-left));
}
.page-hero h1 {
  font-family: 'Bricolage Grotesque', Georgia, serif;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  letter-spacing: -0.03em;
}
.page-hero p { color: var(--muted); margin-top: 8px; max-width: 40em; }

.soon {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: var(--warn);
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 36px 20px;
  text-align: center;
  color: var(--muted);
  background: var(--card);
}

.bench-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 16px;
}

.arch { color: var(--text); }
.arch svg .box { stroke: var(--accent); }
.arch svg .lbl { fill: var(--text); }
.arch svg .sub { fill: var(--muted); }
.arch svg .arr { stroke: var(--accent-2); }

/* Tablet */
@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 40px max(16px, env(safe-area-inset-right)) 32px max(16px, env(safe-area-inset-left));
    gap: 22px;
  }
  .hero-net { opacity: 0.32; }
  .hero-panel { order: 2; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 > *, .grid-3 > *, .grid-4 > *, .install-cols > * { min-width: 0; max-width: 100%; }
  .install-cols { grid-template-columns: 1fr; }
  .docs-layout { grid-template-columns: 1fr; gap: 18px; }
  .docs-nav {
    position: static;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 12px 14px;
  }
  .docs-nav ul {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }
  .docs-nav li { flex: 0 0 auto; }
  .docs-nav a { padding: 8px 0; white-space: nowrap; }
}

/* Phone */
@media (max-width: 720px) {
  body { font-size: 1rem; }
  .top { padding-bottom: 10px; }
  .top-drawer {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 12px 0 4px;
    border-top: 1px solid var(--line);
    margin-top: 10px;
  }
  .top.is-open .top-drawer { display: flex; }
  .top-nav {
    flex-direction: column;
    gap: 0;
    width: 100%;
  }
  .top-nav a {
    width: 100%;
    padding: 12px 4px;
    border-bottom: 1px solid var(--line);
    font-size: 1rem;
  }
  .top-nav a:last-child { border-bottom: 0; }
  .ctrl-group-desktop { display: none; }
  .ctrl-group-mobile {
    display: flex;
    justify-content: flex-start;
    padding-top: 4px;
  }
  .nav-toggle { display: inline-flex; }

  .brand { font-size: clamp(2.1rem, 12vw, 2.8rem); }
  .tagline { font-size: 1.15rem; }
  .lede { font-size: 1rem; margin-bottom: 20px; }
  .cta-row {
    flex-direction: column;
    align-items: stretch;
  }
  .btn {
    width: 100%;
    min-height: 46px;
    padding: 12px 16px;
    font-size: 1rem;
  }
  .section {
    padding: 36px max(16px, env(safe-area-inset-right)) 18px max(16px, env(safe-area-inset-left));
  }
  .section-h { font-size: 1.55rem; }
  .page-hero {
    padding: 28px max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
  }
  .page-hero h1 { font-size: 1.7rem; }
  .grid-2, .grid-3, .grid-4, .install-cols {
    grid-template-columns: 1fr;
    gap: 12px;
    width: 100%;
  }
  .card {
    padding: 16px 14px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .card h3 { font-size: 1.08rem; }
  .cli-cmd { font-size: 0.82rem; }
  .section,
  .page-hero,
  .foot {
    max-width: 100%;
    overflow-x: clip;
  }
  pre.code {
    font-size: 0.74rem;
    padding: 12px;
    border-radius: 8px;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .table-wrap {
    margin: 0 -4px;
    border-radius: 10px;
  }
  table.compare {
    font-size: 0.82rem;
    min-width: 520px;
  }
  .compare th, .compare td { padding: 10px 10px; }
  .badge { font-size: 0.62rem; }
  .arch { padding: 16px 8px; }
  .arch svg { max-width: 100%; }
  .foot {
    margin-top: 28px;
    padding: 22px max(16px, env(safe-area-inset-right)) calc(28px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  }
  .foot-grid { flex-direction: column; gap: 14px; }
  .foot-nav {
    flex-direction: column;
    gap: 10px;
  }
  .foot-nav a { min-height: 40px; display: inline-flex; align-items: center; }
  .empty-state { padding: 28px 16px; }
  .hero-panel { padding: 16px; }
}

/* Narrow phones */
@media (max-width: 380px) {
  .top-brand span { font-size: 1.05rem; }
  .brand { letter-spacing: -0.04em; }
  .ctrl-group { gap: 6px; }
  .lang-btn, .theme-btn { padding: 6px 8px; }
}
