:root {
  --bg: #0e1218;
  --bg-elevated: #161c25;
  --bg-soft: #1c2430;
  --border: #2a3444;
  --text: #e8eef6;
  --muted: #8b98a8;
  --accent: #2dd4a8;
  --accent-dim: #1a9e7c;
  --danger: #f07178;
  --warn: #e6c07b;
  --radius: 10px;
  --font: "Segoe UI", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100%;
}

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

.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(45, 212, 168, 0.12), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(80, 120, 200, 0.1), transparent 55%),
    var(--bg);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: rgba(14, 18, 24, 0.75);
  backdrop-filter: blur(8px);
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.brand strong {
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  font-weight: 650;
}
.brand span {
  font-size: 0.75rem;
  color: var(--muted);
}

.main {
  flex: 1;
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

.hero {
  display: grid;
  gap: 1rem;
  padding: 3rem 0 2rem;
  max-width: 40rem;
}
.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 650;
  letter-spacing: -0.02em;
}
.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

/* Marketing landing */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.landing-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  width: min(56rem, 100%);
  margin: 0 auto;
  padding: 1.25rem 1.75rem 0;
}
.landing .crumb {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.landing .crumb a {
  color: var(--muted);
  text-decoration: none;
}
.landing .crumb a:hover {
  color: var(--accent);
  text-decoration: none;
}
.landing .crumb-sep {
  color: var(--muted);
  opacity: 0.7;
  font-size: 0.95rem;
  line-height: 1;
}
.landing .crumb-current {
  color: var(--text);
  font-weight: 600;
}
.landing .logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.landing .napa-logo {
  display: block;
  height: 28px;
  width: auto;
}
.landing-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  width: min(56rem, 100%);
  margin: 0 auto;
  padding: 2.25rem 1.75rem 4rem;
  gap: 1.25rem;
}
.landing-main h1 {
  margin: 0;
  font-size: clamp(1.75rem, 3.8vw, 2.45rem);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.18;
  max-width: none;
}
.landing-lead {
  margin: 0;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.6;
  max-width: none;
}
.downloads {
  width: 100%;
  margin-top: 0.35rem;
}
.download-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
@media (min-width: 720px) {
  .download-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.download-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
  padding: 0.85rem;
  background: rgba(22, 28, 37, 0.55);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.download-card .btn-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.2;
  padding: 0.9rem 0.55rem;
  border-radius: 10px;
  text-decoration: none;
  text-align: center;
}
.download-card .btn-download span {
  min-width: 0;
}
.download-card .btn-download:hover {
  text-decoration: none;
  filter: brightness(1.06);
}
.download-card .os-icon {
  font-size: 1.05rem;
  width: 1.1em;
  text-align: center;
  flex-shrink: 0;
}
.download-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
  line-height: 1.35;
}
.download-card.is-disabled .btn-download {
  background: var(--bg-soft);
  color: #6b7787;
  border: 1px solid var(--border);
  cursor: not-allowed;
  filter: none;
  pointer-events: none;
}
.download-card.is-disabled .download-meta {
  color: #6b7787;
}
.safety {
  margin-top: 1.25rem;
  width: 100%;
}
.safety h2 {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: var(--text);
}
.safety-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.75rem;
}
.safety-item {
  display: flex;
  gap: 0.95rem;
  align-items: flex-start;
  padding: 1.05rem 1.1rem;
  background: rgba(22, 28, 37, 0.72);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.safety-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  flex-shrink: 0;
  border-radius: 8px;
  background: rgba(45, 212, 168, 0.1);
  color: var(--accent);
}
.safety-icon i {
  font-size: 1.05rem;
  line-height: 1;
}
.safety-item strong {
  display: block;
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
}
.safety-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.grid {
  display: grid;
  gap: 1rem;
}
.grid.stats {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-bottom: 1.5rem;
}
.stat-value {
  font-size: 1.75rem;
  font-weight: 650;
  color: var(--accent);
}
.stat-label {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  background: var(--accent);
  color: #06261d;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 8px;
  padding: 0.55rem 1rem;
  cursor: pointer;
  font-family: inherit;
}
.btn:hover { filter: brightness(1.05); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn.danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}
.btn.ghost {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
}

.input, .select {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  font: inherit;
}
.input:focus, .select:focus {
  outline: 2px solid rgba(45, 212, 168, 0.35);
  border-color: var(--accent-dim);
}
.label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.field { margin-bottom: 0.9rem; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.table th, .table td {
  text-align: left;
  padding: 0.7rem 0.5rem;
  border-bottom: 1px solid var(--border);
}
.table th {
  color: var(--muted);
  font-weight: 550;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.tab {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  font: inherit;
}
.tab.active {
  color: var(--text);
  border-color: var(--accent-dim);
  background: rgba(45, 212, 168, 0.1);
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
}
.badge.on { color: var(--accent); border-color: var(--accent-dim); }
.badge.off { color: var(--muted); }

.login-wrap {
  flex: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.login-form {
  width: min(360px, 100%);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.login-logo {
  display: block;
  height: 36px;
  width: auto;
  margin: 0 auto 1.75rem;
}
.login-submit {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.7rem 1rem;
}
.turnstile-field {
  display: flex;
  justify-content: center;
  margin: 0.5rem 0 0.15rem;
}
.login-card {
  width: min(380px, 100%);
}
.login-card h1 {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
}
.login-card .sub {
  color: var(--muted);
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
}
.error {
  color: var(--danger);
  font-size: 0.85rem;
  margin: 0.5rem 0 0;
  min-height: 1.2em;
}
.muted { color: var(--muted); }
.row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.hidden { display: none !important; }
.footer {
  padding: 1rem 1.5rem 1.5rem;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: grid;
  place-items: center;
  padding: 1rem;
  z-index: 50;
}
.modal {
  width: min(420px, 100%);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.modal h2 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
}
