/* ModelFoundry — static mirror stylesheet */

:root {
  --bg: #08090d;
  --bg-2: #0b0d13;
  --panel: #10131b;
  --panel-2: #151927;
  --panel-3: #1a1f30;
  --border: #202636;
  --border-2: #2b3248;
  --text: #e9ebf3;
  --muted: #99a1b6;
  --faint: #6a7286;
  --accent: #7c5cff;
  --accent-2: #27d3ee;
  --accent-soft: rgba(124, 92, 255, 0.14);
  --accent-line: rgba(124, 92, 255, 0.38);
  --ok: #37d99a;
  --warn: #f5b544;
  --err: #fb7185;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 12px 34px rgba(0, 0, 0, 0.38);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.25);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --maxw: 1180px;
  --header-h: 64px;
}

html[data-theme="light"] {
  --bg: #f7f8fc;
  --bg-2: #ffffff;
  --panel: #ffffff;
  --panel-2: #f4f6fb;
  --panel-3: #eef1f8;
  --border: #e2e6ef;
  --border-2: #d2d8e6;
  --text: #171a23;
  --muted: #5b6478;
  --faint: #7b8497;
  --accent-soft: rgba(124, 92, 255, 0.1);
  --accent-line: rgba(124, 92, 255, 0.3);
  --shadow: 0 12px 30px rgba(23, 26, 35, 0.1);
  --shadow-sm: 0 3px 12px rgba(23, 26, 35, 0.07);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 18px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(760px 420px at 12% -8%, rgba(124, 92, 255, 0.16), transparent 62%),
    radial-gradient(680px 420px at 92% 2%, rgba(39, 211, 238, 0.11), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 72%);
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

h1, h2, h3, h4 {
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
  font-weight: 700;
}
h1 { font-size: clamp(2.1rem, 5.2vw, 3.5rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.55rem, 3.1vw, 2.1rem); }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.02rem; }
p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

::selection { background: rgba(124, 92, 255, 0.35); color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
  border-radius: 6px;
}

code, kbd, pre, samp { font-family: var(--mono); font-size: 0.875em; }

:not(pre) > code {
  background: var(--panel-3);
  border: 1px solid var(--border);
  padding: 0.12em 0.42em;
  border-radius: 6px;
  color: #cbd2e6;
}
html[data-theme="light"] :not(pre) > code { color: #3b3fae; }

kbd {
  background: var(--panel-2);
  border: 1px solid var(--border-2);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 0.1em 0.4em;
  color: var(--muted);
}

/* ---------- layout ---------- */

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

.section { padding: 74px 0; }
.section-sm { padding: 48px 0; }
.section-head { max-width: 720px; margin-bottom: 34px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head p { color: var(--muted); font-size: 1.03rem; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 14px;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}

.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 44px; align-items: center; }

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 0.86rem; }
.center { text-align: center; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.mt0 { margin-top: 0; }
.mb0 { margin-bottom: 0; }
.hr { height: 1px; background: var(--border); border: 0; margin: 42px 0; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-2);
  background: var(--panel-2);
  color: var(--text);
  font-weight: 600;
  font-size: 0.94rem;
  line-height: 1.2;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); border-color: var(--accent-line); background: var(--panel-3); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: 0.6; pointer-events: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #5b8bff 55%, var(--accent-2) 130%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 22px rgba(124, 92, 255, 0.28);
}
.btn-primary:hover { box-shadow: 0 12px 28px rgba(124, 92, 255, 0.38); background: linear-gradient(135deg, #8a6cff 0%, #6a94ff 55%, #35dcf4 130%); }

.btn-ghost { background: transparent; }
.btn-lg { padding: 14px 26px; font-size: 1rem; border-radius: 12px; }
.btn-sm { padding: 8px 14px; font-size: 0.85rem; }
.btn-block { width: 100%; }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- badges & pills ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--panel-3);
  border: 1px solid var(--border);
  color: var(--muted);
  white-space: nowrap;
}
.badge-accent { background: var(--accent-soft); border-color: var(--accent-line); color: #b7a6ff; }
html[data-theme="light"] .badge-accent { color: #5a41d6; }
.badge-ok { background: rgba(55, 217, 154, 0.12); border-color: rgba(55, 217, 154, 0.35); color: var(--ok); }
.badge-warn { background: rgba(245, 181, 68, 0.12); border-color: rgba(245, 181, 68, 0.35); color: var(--warn); }
.badge-err { background: rgba(251, 113, 133, 0.12); border-color: rgba(251, 113, 133, 0.35); color: var(--err); }

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 22%, transparent);
}

.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 1.06rem;
  flex-shrink: 0;
}
.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(140deg, var(--accent), #5b8bff 60%, var(--accent-2));
  display: grid;
  place-items: center;
  box-shadow: 0 4px 14px rgba(124, 92, 255, 0.35);
  flex-shrink: 0;
}
.brand-mark svg { width: 18px; height: 18px; }
.brand small {
  font-weight: 600;
  font-size: 0.68rem;
  color: var(--faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-left: 8px;
  margin-left: 2px;
  border-left: 1px solid var(--border-2);
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
}
.nav a {
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 0.92rem;
  font-weight: 550;
  color: var(--muted);
  transition: color 0.15s ease, background 0.15s ease;
}
.nav a:hover { color: var(--text); background: var(--panel-2); }
.nav a.active { color: var(--text); background: var(--accent-soft); }

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  font-size: 0.8rem;
  color: var(--muted);
  transition: border-color 0.15s ease, color 0.15s ease;
}
.status-pill:hover { border-color: var(--ok); color: var(--text); }
.status-pill .dot { color: var(--ok); animation: pulse 2.4s infinite; }

.icon-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  cursor: pointer;
  color: var(--muted);
  transition: color 0.15s ease, border-color 0.15s ease;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-2); }

.nav-toggle { display: none; }

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

/* ---------- hero ---------- */

.hero {
  padding: 86px 0 66px;
  position: relative;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  gap: 52px;
  align-items: center;
}
.hero h1 { margin-bottom: 20px; }
.hero h1 .grad {
  background: linear-gradient(100deg, #b7a6ff 0%, #7cc4ff 50%, #5eead4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
html[data-theme="light"] .hero h1 .grad {
  background: linear-gradient(100deg, #6a4dff 0%, #0ea5e9 55%, #0d9488 100%);
  -webkit-background-clip: text;
  background-clip: text;
}
.hero-lead {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 56ch;
  margin-bottom: 28px;
}
.hero-meta {
  margin-top: 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 0.83rem;
  color: var(--faint);
}
.hero-meta span { display: inline-flex; align-items: center; gap: 7px; }

.hero-panel {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.hero-panel-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel-3) 70%, transparent);
}
.hero-panel-top .lights { display: flex; gap: 6px; }
.hero-panel-top .lights i { width: 10px; height: 10px; border-radius: 50%; background: var(--border-2); display: block; }
.hero-panel-top span { font-size: 0.76rem; color: var(--faint); font-family: var(--mono); }
.hero-panel-body { padding: 20px; }

/* ---------- stats ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.stat {
  background: var(--panel);
  padding: 22px 20px;
}
.stat .value {
  font-size: 1.72rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  display: block;
}
.stat .label { font-size: 0.8rem; color: var(--faint); }
.stat .delta { font-size: 0.76rem; color: var(--ok); font-weight: 600; }

/* ---------- cards ---------- */

.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
a.card:hover, .card.hoverable:hover {
  transform: translateY(-3px);
  border-color: var(--accent-line);
  box-shadow: var(--shadow);
}
.card h3 { margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 0.93rem; }
.card-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: #b7a6ff;
  margin-bottom: 16px;
}
html[data-theme="light"] .card-icon { color: #5a41d6; }
.card-icon svg { width: 20px; height: 20px; }

.feature-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.feature-list li { display: flex; gap: 11px; align-items: flex-start; color: var(--muted); font-size: 0.94rem; }
.feature-list svg { width: 18px; height: 18px; color: var(--ok); flex-shrink: 0; margin-top: 3px; }

/* ---------- model catalog ---------- */

.catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  margin-bottom: 26px;
  position: sticky;
  top: calc(var(--header-h) + 10px);
  z-index: 40;
  backdrop-filter: blur(10px);
}
.search {
  position: relative;
  flex: 1 1 260px;
  min-width: 200px;
}
.search input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border-radius: 10px;
  border: 1px solid var(--border-2);
  background: var(--bg-2);
  color: var(--text);
  font-size: 0.92rem;
  font-family: inherit;
}
.search input::placeholder { color: var(--faint); }
.search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--faint);
  pointer-events: none;
}
select.control {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-2);
  background: var(--bg-2);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
}

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.chip:hover { color: var(--text); border-color: var(--border-2); }
.chip.on { background: var(--accent-soft); border-color: var(--accent-line); color: #b7a6ff; }
html[data-theme="light"] .chip.on { color: #5a41d6; }

.model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.model-card {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.model-card:hover { transform: translateY(-3px); border-color: var(--accent-line); box-shadow: var(--shadow); }
.model-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.model-name {
  font-family: var(--mono);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  word-break: break-word;
}
.model-org { font-size: 0.78rem; color: var(--faint); }
.model-desc { color: var(--muted); font-size: 0.9rem; margin-bottom: 14px; }
.model-specs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.spec { min-width: 0; }
.spec dt { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--faint); }
.spec dd { margin: 0; font-size: 0.87rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.model-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.model-foot .dl { font-size: 0.82rem; color: var(--faint); font-variant-numeric: tabular-nums; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  border: 1px dashed var(--border-2);
  border-radius: var(--radius);
}

/* ---------- code blocks ---------- */

.code-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
  margin: 18px 0;
}
.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel-3) 65%, transparent);
  font-size: 0.78rem;
  color: var(--faint);
  font-family: var(--mono);
}
.copy-btn {
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--muted);
  border-radius: 7px;
  padding: 4px 10px;
  font-size: 0.74rem;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.15s ease;
}
.copy-btn:hover { color: var(--text); border-color: var(--border-2); }
.copy-btn.done { color: var(--ok); border-color: rgba(55, 217, 154, 0.4); }
.code-block pre {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  font-size: 0.855rem;
  line-height: 1.7;
  color: #c9d1e6;
}
html[data-theme="light"] .code-block pre { color: #2c3245; }
.code-block .c { color: #6a7286; font-style: italic; }
.code-block .k { color: #c792ea; }
.code-block .s { color: #9ece6a; }
.code-block .f { color: #7aa2f7; }
.code-block .n { color: #ff9e64; }
.code-block .p { color: #89ddff; }
html[data-theme="light"] .code-block .c { color: #8a93a6; }
html[data-theme="light"] .code-block .k { color: #8a3ffc; }
html[data-theme="light"] .code-block .s { color: #197a3d; }
html[data-theme="light"] .code-block .f { color: #1d4ed8; }
html[data-theme="light"] .code-block .n { color: #b45309; }
html[data-theme="light"] .code-block .p { color: #0e7490; }

/* ---------- tables ---------- */

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
th {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--faint);
  background: var(--panel-2);
  font-weight: 700;
  white-space: nowrap;
}
td { color: var(--muted); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--panel-2) 55%, transparent); }
td strong { color: var(--text); }

/* ---------- alerts ---------- */

.alert {
  display: flex;
  gap: 13px;
  padding: 15px 17px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel);
  font-size: 0.92rem;
  margin: 18px 0;
}
.alert svg { width: 19px; height: 19px; flex-shrink: 0; margin-top: 2px; }
.alert-info { border-color: var(--accent-line); background: var(--accent-soft); }
.alert-info svg { color: #b7a6ff; }
.alert-warn { border-color: rgba(245, 181, 68, 0.35); background: rgba(245, 181, 68, 0.08); }
.alert-warn svg { color: var(--warn); }
.alert-err { border-color: rgba(251, 113, 133, 0.4); background: rgba(251, 113, 133, 0.08); }
.alert-err svg { color: var(--err); }
.alert-ok { border-color: rgba(55, 217, 154, 0.35); background: rgba(55, 217, 154, 0.08); }
.alert-ok svg { color: var(--ok); }
.alert b { color: var(--text); }

/* ---------- auth / forms ---------- */

.auth-wrap {
  min-height: calc(100vh - var(--header-h));
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.auth-aside {
  padding: 64px 56px;
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 70%, transparent), transparent);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.auth-aside h1 { font-size: clamp(1.8rem, 3.4vw, 2.5rem); }
.auth-aside .lead { color: var(--muted); max-width: 46ch; }
.auth-main {
  display: grid;
  place-items: center;
  padding: 56px 24px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow);
}
.auth-card h2 { margin-bottom: 6px; font-size: 1.35rem; }
.auth-card > p { color: var(--muted); font-size: 0.92rem; margin-bottom: 22px; }

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 0.83rem;
  font-weight: 650;
  margin-bottom: 7px;
  color: var(--text);
}
.field .hint { font-size: 0.78rem; color: var(--faint); margin-top: 6px; }
.input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-2);
  background: var(--bg-2);
  color: var(--text);
  font-size: 0.94rem;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input::placeholder { color: var(--faint); }
.input.mono { letter-spacing: 0.04em; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.check {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.86rem;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.check input { width: 16px; height: 16px; accent-color: var(--accent); }

.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 0;
  color: var(--faint);
  font-size: 0.78rem;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.form-msg {
  display: none;
  gap: 11px;
  align-items: flex-start;
  padding: 13px 15px;
  border-radius: 10px;
  font-size: 0.88rem;
  margin-bottom: 18px;
  border: 1px solid rgba(251, 113, 133, 0.4);
  background: rgba(251, 113, 133, 0.08);
  color: #ffc4cd;
}
html[data-theme="light"] .form-msg { color: #9f1239; }
.form-msg.show { display: flex; }
.form-msg svg { width: 18px; height: 18px; color: var(--err); flex-shrink: 0; margin-top: 1px; }
.form-msg.ok { border-color: rgba(55, 217, 154, 0.4); background: rgba(55, 217, 154, 0.08); color: #a7f3d0; }
html[data-theme="light"] .form-msg.ok { color: #065f46; }

.auth-foot { margin-top: 22px; text-align: center; font-size: 0.86rem; color: var(--muted); }
.auth-foot a { color: #b7a6ff; font-weight: 600; }
html[data-theme="light"] .auth-foot a { color: #5a41d6; }

.busy .btn-primary .btn-label { opacity: 0.6; }

.spinner {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
  display: none;
}
.busy .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.avatar-stack { display: flex; }
.avatar-stack i {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  border: 2px solid var(--panel);
  margin-left: -9px;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
}
.avatar-stack i:first-child { margin-left: 0; }

/* ---------- docs layout ---------- */

.docs-layout {
  display: grid;
  grid-template-columns: 246px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}
.docs-side {
  position: sticky;
  top: calc(var(--header-h) + 22px);
  max-height: calc(100vh - var(--header-h) - 44px);
  overflow-y: auto;
  padding-right: 6px;
}
.docs-side h4 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--faint);
  margin: 20px 0 9px;
}
.docs-side h4:first-child { margin-top: 0; }
.docs-side a {
  display: block;
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 0.88rem;
  color: var(--muted);
  border-left: 2px solid transparent;
}
.docs-side a:hover { color: var(--text); background: var(--panel-2); }
.docs-side a.active { color: var(--text); border-left-color: var(--accent); background: var(--accent-soft); }
.docs-body { min-width: 0; max-width: 780px; }
.docs-body h2 {
  margin-top: 52px;
  padding-top: 8px;
  scroll-margin-top: calc(var(--header-h) + 20px);
}
.docs-body h2:first-child { margin-top: 0; }
.docs-body h3 { margin-top: 30px; }
.docs-body p, .docs-body li { color: var(--muted); }
.docs-body strong { color: var(--text); }
.docs-body ul, .docs-body ol { padding-left: 22px; }
.docs-body li { margin-bottom: 7px; }
.docs-body li::marker { color: var(--accent); }

.anchor {
  opacity: 0;
  margin-left: 8px;
  font-size: 0.8em;
  color: var(--faint);
  text-decoration: none;
}
h2:hover .anchor, h3:hover .anchor { opacity: 1; }

/* ---------- changelog ---------- */

.release {
  position: relative;
  padding: 0 0 46px 34px;
  border-left: 1px solid var(--border);
}
.release:last-child { border-left-color: transparent; padding-bottom: 0; }
.release::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 6px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}
.release.latest::before { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.release-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.release-head h3 { margin: 0; font-size: 1.15rem; }
.release-head .tag { font-family: var(--mono); font-size: 0.8rem; color: var(--faint); }
.release ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.release li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--muted);
  font-size: 0.93rem;
}
.release li svg { width: 16px; height: 16px; margin-top: 4px; flex-shrink: 0; }
.release li.plus svg { color: var(--ok); }
.release li.minus svg { color: var(--err); }
.release li.change svg { color: var(--warn); }

/* ---------- status ---------- */

.svc-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  margin-bottom: 10px;
}
.svc-name { font-weight: 650; }
.svc-desc { font-size: 0.82rem; color: var(--faint); }
.svc-state { margin-left: auto; display: flex; align-items: center; gap: 9px; font-size: 0.85rem; color: var(--ok); font-weight: 600; }

.uptime-bars { display: flex; gap: 3px; align-items: flex-end; height: 34px; }
.uptime-bars i {
  width: 7px;
  border-radius: 2px;
  background: var(--ok);
  display: block;
  opacity: 0.85;
}
.uptime-bars i.warn { background: var(--warn); }

/* ---------- blog ---------- */

.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.post-card { display: flex; flex-direction: column; }
.post-card h3 { font-size: 1.08rem; line-height: 1.35; }
.post-card p { font-size: 0.9rem; }
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--faint);
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.post-body { max-width: 760px; }
.post-body h2 { margin-top: 44px; }
.post-body h3 { margin-top: 30px; }
.post-body p, .post-body li { color: var(--muted); font-size: 1.02rem; line-height: 1.78; }
.post-body strong { color: var(--text); }
.post-body ul, .post-body ol { padding-left: 22px; }
.post-body blockquote {
  margin: 26px 0;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  font-style: italic;
}
.byline {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 30px;
}
.byline .avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
}
.byline .who { font-weight: 650; font-size: 0.92rem; }
.byline .what { font-size: 0.8rem; color: var(--faint); }

/* ---------- ticker ---------- */

.ticker {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel) 55%, transparent);
  overflow: hidden;
  padding: 11px 0;
}
.ticker-track {
  display: flex;
  gap: 44px;
  width: max-content;
  animation: slide 46s linear infinite;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-track span {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.82rem;
  color: var(--muted);
  font-family: var(--mono);
  white-space: nowrap;
}
.ticker-track .dot { color: var(--ok); }
@keyframes slide { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel) 60%, transparent);
  padding: 60px 0 34px;
  margin-top: 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(4, minmax(0, 1fr));
  gap: 34px;
  margin-bottom: 40px;
}
.footer-grid h4 {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--faint);
  margin-bottom: 14px;
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.footer-grid a { font-size: 0.89rem; color: var(--muted); }
.footer-grid a:hover { color: var(--text); }
.footer-about p { font-size: 0.89rem; color: var(--muted); max-width: 38ch; margin-top: 14px; }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--faint);
}
.footer-bottom .mono { color: var(--muted); }

.social { display: flex; gap: 9px; margin-top: 18px; }
.social a {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid var(--border);
  color: var(--muted);
  transition: all 0.15s ease;
}
.social a:hover { color: var(--text); border-color: var(--border-2); transform: translateY(-2px); }
.social svg { width: 17px; height: 17px; }

/* ---------- 404 ---------- */

.error-page {
  min-height: calc(100vh - var(--header-h) - 200px);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 70px 0;
}
.error-code {
  font-size: clamp(4rem, 16vw, 9rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.05em;
  background: linear-gradient(140deg, #b7a6ff, #5eead4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 12px;
}
.error-page p { color: var(--muted); max-width: 52ch; margin: 0 auto 26px; }

/* ---------- reveal animation ---------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
[data-reveal].in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  [data-reveal] { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  background: var(--panel-3);
  border: 1px solid var(--border-2);
  color: var(--text);
  padding: 11px 18px;
  border-radius: 10px;
  font-size: 0.88rem;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 9px;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast svg { width: 16px; height: 16px; color: var(--ok); }

/* ---------- modal ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(3, 4, 8, 0.72);
  backdrop-filter: blur(4px);
}
.modal.show { display: grid; }
.modal-card {
  width: 100%;
  max-width: 470px;
  background: var(--panel);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
  animation: modal-in 0.22s ease;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
.modal-card h3 { margin-bottom: 8px; }
.modal-card p { color: var(--muted); font-size: 0.92rem; }

/* ---------- responsive ---------- */

@media (max-width: 1080px) {
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .footer-about { grid-column: 1 / -1; }
  .split, .hero-grid { gap: 34px; }
}

@media (max-width: 900px) {
  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 14px 22px 20px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    display: none;
  }
  body.nav-open .nav { display: flex; }
  body.nav-open .nav a { padding: 12px; }
  .nav-toggle { display: grid; }
  .status-pill span { display: none; }
  .status-pill { padding: 8px; }
  .hero-grid, .split, .auth-wrap, .docs-layout { grid-template-columns: 1fr; }
  .hero { padding: 54px 0 40px; }
  .auth-aside { border-right: 0; border-bottom: 1px solid var(--border); padding: 44px 24px; }
  .auth-main { padding: 34px 20px 60px; }
  .docs-side {
    position: static;
    max-height: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    background: var(--panel);
  }
  .docs-side h4:not(:first-child) { margin-top: 14px; }
  .g4, .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .container { padding: 0 16px; }
  .section { padding: 52px 0; }
  .g2, .g3, .g4, .field-row { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .brand small { display: none; }
  .catalog-toolbar { position: static; }
  .model-grid, .post-grid { grid-template-columns: 1fr; }
  .hero-panel-body { padding: 16px; }
  .auth-card { padding: 24px 20px; }
  .section-head { margin-bottom: 26px; }
}
