@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/static/fonts/outfit-latin.woff2') format('woff2');
}

:root {
  --primary-50: #f0f4ee;
  --primary-100: #dce5d8;
  --primary-200: #bcceb5;
  --primary-300: #9CAF88;
  --primary-400: #7a9a6a;
  --primary-500: #5a7d50;
  --primary-600: #3A4F3A;
  --primary-700: #2d3d2d;
  --primary-800: #1f2b1f;
  --primary-900: #121a12;

  --accent-300: #ddc57a;
  --accent-400: #C4A55A;
  --accent-500: #a88e40;

  --warm-400: #E8983A;

  --neutral-50: #FAFAF9;
  --neutral-100: #F5F5F4;
  --neutral-200: #E7E5E4;
  --neutral-300: #D6D3D1;
  --neutral-500: #78716C;
  --neutral-600: #57534E;
  --neutral-700: #44403C;
  --neutral-800: #292524;
  --neutral-900: #1C1917;

  --light: #FFFFFF;
  --text: var(--neutral-900);
  --text-muted: var(--neutral-600);

  --radius: 8px;
  --radius-lg: 12px;
  --max-width: 1080px;

  --font-sans: 'Outfit', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--neutral-50);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
}

.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;
}

/* ---------- Hero ---------- */

.hero {
  background: linear-gradient(135deg, var(--primary-700) 0%, var(--primary-600) 60%, var(--primary-500) 100%);
  color: var(--light);
  padding: 72px 0 56px;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 88% 18%, rgba(196, 165, 90, 0.28), transparent 55%),
    radial-gradient(ellipse at 12% 92%, rgba(232, 152, 58, 0.10), transparent 60%);
  pointer-events: none;
}

.hero-inner { position: relative; z-index: 1; }

.hero-eyebrow {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-300);
  border: 1px solid rgba(221, 197, 122, 0.45);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 20px;
  font-weight: 500;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(36px, 5.5vw, 60px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.hero-tagline {
  margin: 0 0 28px;
  font-size: clamp(17px, 1.8vw, 21px);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.82);
  max-width: 780px;
  line-height: 1.4;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 48px;
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.hero-meta-item { display: flex; flex-direction: column; gap: 4px; }

.meta-label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
  font-weight: 500;
}

.meta-value {
  font-size: 16px;
  color: var(--light);
  font-weight: 600;
}

/* ---------- Main ---------- */

.main-grid {
  display: grid;
  gap: 24px;
  padding-top: 40px;
  padding-bottom: 64px;
}

.card {
  background: var(--light);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.card-primary {
  border: 1px solid var(--primary-200);
  background: linear-gradient(180deg, var(--primary-50) 0%, var(--light) 60%);
}

.card h2 {
  margin: 0 0 16px;
  font-size: 22px;
  font-weight: 600;
  color: var(--primary-800);
  letter-spacing: -0.01em;
}

.muted { color: var(--text-muted); margin: 0 0 20px; }

/* ---------- Auth form ---------- */

.auth-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.auth-form input[type="password"] {
  flex: 1;
  min-width: 240px;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 15px;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius);
  background: var(--light);
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-form input[type="password"]:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(90, 125, 80, 0.15);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
  border: 1px solid transparent;
  font-family: inherit;
}

.btn-primary {
  background: var(--accent-400);
  color: var(--primary-800);
  border-color: var(--accent-400);
}

.btn-primary:hover {
  background: var(--accent-300);
  border-color: var(--accent-300);
  transform: translateY(-1px);
}

.btn-download {
  width: 100%;
  padding: 16px 22px;
  font-size: 16px;
  margin-bottom: 24px;
  justify-content: center;
}

.btn-download svg {
  flex-shrink: 0;
}

/* ---------- Login page ---------- */

.login-body {
  background: linear-gradient(135deg, var(--primary-700) 0%, var(--primary-600) 60%, var(--primary-500) 100%);
  min-height: 100vh;
  margin: 0;
  position: relative;
  overflow-x: hidden;
}

.login-body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 88% 18%, rgba(196, 165, 90, 0.30), transparent 55%),
    radial-gradient(ellipse at 12% 92%, rgba(232, 152, 58, 0.12), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.login-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 32px 20px;
  gap: 24px;
}

.login-card {
  width: 100%;
  max-width: 460px;
  background: var(--light);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28), 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* ---------- Brand (logo + wordmark) ---------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  line-height: 1;
}

.brand-mark {
  width: auto;
  height: 36px;
  flex-shrink: 0;
  display: block;
}

.brand-text {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: currentColor;
  white-space: nowrap;
}

.brand-dark { color: var(--primary-800); }
.brand-light { color: var(--light); }

.login-brand {
  margin-bottom: 24px;
}

.hero-brand {
  margin-bottom: 22px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-brand .brand-mark { height: 28px; }
.footer-brand .brand-text { font-size: 14px; }
.footer-tagline {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.62);
}

.login-card .hero-eyebrow {
  color: var(--primary-700);
  border-color: var(--primary-300);
  margin-bottom: 22px;
}

.login-title {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--primary-800);
  line-height: 1.15;
}

.login-sub {
  margin: 0 0 26px;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.5;
}

.login-card .auth-form {
  flex-direction: column;
  margin-bottom: 0;
}

.login-card .auth-form input[type="password"],
.login-card .auth-form button {
  width: 100%;
}

.login-card .auth-form input[type="password"] {
  padding: 14px 16px;
  font-size: 16px;
}

.login-card .auth-form button {
  padding: 14px 22px;
  font-size: 16px;
  margin-top: 4px;
}

.login-footer {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  margin: 0;
  text-align: center;
}

.login-footer a {
  color: var(--accent-300);
  text-decoration: none;
}

.login-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 480px) {
  .login-card { padding: 32px 24px; }
  .login-title { font-size: 24px; }
}

/* ---------- Alerts ---------- */

.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 14px;
  border: 1px solid transparent;
}

.alert-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

/* ---------- File meta ---------- */

.file-meta {
  list-style: none;
  margin: 0;
  padding: 20px 0 0;
  border-top: 1px solid var(--neutral-200);
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.file-meta li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-size: 14px;
}

.file-meta li > span {
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
}

.file-meta code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--primary-800);
  background: var(--neutral-100);
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid var(--neutral-200);
}

.file-meta code.hash {
  font-size: 11px;
  word-break: break-all;
  text-align: right;
  max-width: 60%;
  line-height: 1.4;
}

/* ---------- Manifest table ---------- */

.manifest-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.manifest-table th, .manifest-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--neutral-200);
}

.manifest-table thead th {
  background: var(--neutral-100);
  color: var(--neutral-700);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.manifest-table td.num, .manifest-table th:nth-child(1),
.manifest-table th:nth-child(3), .manifest-table th:nth-child(4) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.manifest-table tbody tr:last-child td { border-bottom: none; }

/* ---------- Release notes ---------- */

.release-notes h3 {
  font-size: 17px;
  margin: 24px 0 8px;
  color: var(--primary-700);
}

.release-notes h3:first-child { margin-top: 0; }

.release-notes ul { padding-left: 20px; }

.release-notes li { margin: 4px 0; }

.release-notes p { margin: 8px 0; }

.release-notes code {
  font-family: var(--font-mono);
  background: var(--neutral-100);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
}

/* ---------- Code block ---------- */

pre {
  background: var(--neutral-900);
  color: var(--neutral-100);
  padding: 16px;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.5;
}

pre code {
  font-family: var(--font-mono);
  background: transparent;
  color: inherit;
  padding: 0;
}

/* ---------- Footer ---------- */

.footer {
  background: var(--primary-800);
  color: rgba(255, 255, 255, 0.78);
  padding: 32px 0;
  font-size: 14px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

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

.footer-meta {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
}

@media (max-width: 768px) {
  .container { padding: 0 20px; }
  .hero { padding: 48px 0 36px; }
  .hero h1 { font-size: clamp(28px, 8vw, 38px); }
  .hero-tagline { font-size: 16px; margin-bottom: 22px; }
  .hero-meta { gap: 16px 28px; margin-top: 24px; padding-top: 22px; }
  .meta-value { font-size: 15px; }
  .main-grid { padding-top: 28px; padding-bottom: 48px; gap: 16px; }
  .card { padding: 20px; border-radius: 10px; }
  .card h2 { font-size: 19px; margin-bottom: 12px; }
  .auth-form { flex-direction: column; }
  .auth-form input[type="password"] { width: 100%; min-width: 0; }
  .auth-form button { width: 100%; }
  .file-meta li { flex-direction: column; align-items: flex-start; gap: 4px; }
  .file-meta code.hash { max-width: 100%; text-align: left; word-break: break-all; }
  .manifest-table { font-size: 13px; }
  .manifest-table th, .manifest-table td { padding: 8px 6px; }
  pre { font-size: 11px; padding: 12px; }
  pre code { white-space: pre-wrap; word-break: break-all; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 12px; }
}

@media (max-width: 420px) {
  .hero-eyebrow { font-size: 11px; padding: 5px 12px; }
  .hero h1 { font-size: 26px; }
  .file-meta code { font-size: 12px; padding: 3px 8px; }
}
