/* CloudPuff Updates portal — self-contained, no external fonts or trackers. */

:root {
  --bg: #f6f1fb;
  --surface: #ffffff;
  --text: #1a1028;
  --muted: #5c4d72;
  --border: #e2d6ef;
  --purple: #963be6;
  --purple-hover: #7a24c9;
  --purple-deep: #5b2a86;
  --purple-mid: #7c3aed;
  --lilac: #d8b4fe;
  --link: #6d28d9;
  --ok: #0f7a45;
  --ok-bg: #e8f7ef;
  --err: #b42318;
  --err-bg: #fef3f2;
  --warn: #9a6700;
  --warn-bg: #fffaeb;
  --code-bg: #1a1028;
  --code-text: #f3e8ff;
  --shadow: 0 1px 2px rgba(91, 42, 134, 0.08), 0 10px 28px rgba(91, 42, 134, 0.1);
  --radius: 14px;
  --maxw: 1080px;
  --font: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --header-h: 64px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #120a1c;
    --surface: #1c1228;
    --text: #f3e8ff;
    --muted: #b9a8d0;
    --border: #3a2a52;
    --link: #d8b4fe;
    --purple: #b98cf5;
    --purple-hover: #d8b4fe;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.45), 0 10px 28px rgba(0, 0, 0, 0.4);
  }
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(900px 420px at 12% -8%, rgba(216, 180, 254, 0.35), transparent 65%),
    radial-gradient(700px 360px at 92% 8%, rgba(150, 59, 230, 0.12), transparent 60%),
    var(--bg);
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a { color: var(--link); }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--lilac);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 8px;
  z-index: 100;
}
.skip:focus { left: 8px; }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--header-h);
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--purple-deep);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.02em;
  padding: 8px 0;
}
@media (prefers-color-scheme: dark) {
  .brand { color: var(--lilac); }
}

.brand-mark {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.brand-word {
  width: min(148px, 34vw);
  height: auto;
}

.nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
}

.nav a:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--purple) 12%, transparent);
}

.nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 700;
}

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

.hero {
  color: #fff;
  text-align: center;
  padding: 56px 0 68px;
  background:
    radial-gradient(900px 420px at 50% -10%, rgba(216, 180, 254, 0.42), transparent 70%),
    linear-gradient(180deg, var(--purple-mid) 0%, var(--purple-deep) 100%);
}

.hero-logo {
  width: min(560px, 92%);
  margin: 0 auto 28px;
  /* Logo asset is the mark itself — no surrounding box/shadow frame. */
}

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.12;
  letter-spacing: -0.025em;
  font-weight: 800;
}

.hero .lead {
  max-width: 640px;
  margin: 0 auto 28px;
  font-size: clamp(17px, 2.2vw, 20px);
  color: rgba(255, 255, 255, 0.92);
}

.hero .meta {
  margin: 18px 0 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
}

.hero-mascot {
  width: min(120px, 28vw);
  margin: 28px auto 0;
  filter: drop-shadow(0 12px 24px rgba(20, 0, 40, 0.35));
  animation: float-in 0.9s ease both;
}

@keyframes float-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-weight: 700;
  font-size: 16px;
  padding: 12px 22px;
  border-radius: 999px;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.08s ease, background-color 0.15s ease, border-color 0.15s ease;
  background: transparent;
  color: inherit;
}

.btn:active { transform: translateY(1px); }
.btn:disabled,
.btn[aria-disabled="true"],
.btn.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  pointer-events: none;
}

.btn-primary {
  background: #fff;
  color: var(--purple-deep);
}
.btn-primary:hover { background: #f3e8ff; }

.btn-ghost {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.7);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.14); }

.btn-solid {
  background: var(--purple);
  color: #fff;
}
.btn-solid:hover { background: var(--purple-hover); }

.btn-outline {
  color: var(--link);
  border-color: var(--border);
}
.btn-outline:hover {
  border-color: var(--link);
  background: color-mix(in srgb, var(--purple) 8%, transparent);
}

.btn-danger {
  background: var(--err);
  color: #fff;
}
.btn-danger:hover { filter: brightness(1.05); }

/* ---------- Sections ---------- */

section {
  padding: 64px 0;
  scroll-margin-top: calc(var(--header-h) + 12px);
}

section + section { border-top: 1px solid var(--border); }

.eyebrow {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--purple-mid);
}
@media (prefers-color-scheme: dark) {
  .eyebrow { color: var(--lilac); }
}

h2 {
  margin: 0 0 12px;
  font-size: clamp(26px, 3.4vw, 34px);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h3 {
  margin: 0 0 6px;
  font-size: 19px;
  line-height: 1.3;
}

.section-lead {
  max-width: 680px;
  color: var(--muted);
  margin: 0 0 36px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.app {
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 28px;
  padding: 28px;
  align-items: start;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.14);
  background:
    radial-gradient(520px 260px at 8% 12%, rgba(216, 180, 254, 0.35), transparent 70%),
    linear-gradient(135deg, #3b1766 0%, #5b2a86 55%, #7c3aed 100%);
  animation: rise 0.7s ease both;
}

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

.app .icon {
  width: 128px;
  height: 128px;
  object-fit: contain;
  filter: drop-shadow(0 8px 22px rgba(0, 0, 40, 0.45));
}

.app h3 {
  font-size: 28px;
  margin: 0;
  color: #fff;
  letter-spacing: -0.01em;
}

.app .sub {
  margin: 2px 0 12px;
  color: rgba(255, 255, 255, 0.78);
}

.app p { margin: 0 0 16px; color: rgba(255, 255, 255, 0.92); }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.chips li {
  font-size: 13.5px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, #e9d5ff, #d8b4fe);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #2a1530;
}

.app .actions { justify-content: flex-start; }
.app .fine {
  margin: 14px 0 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
}

.app .btn-solid {
  background: #fff;
  color: var(--purple-deep);
}
.app .btn-solid:hover { background: #f3e8ff; }
.app .btn-outline {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.55);
}
.app .btn-outline:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  padding: 0;
  margin: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  padding: 22px 20px;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: var(--purple);
  color: #fff;
  font-weight: 750;
}

.steps p {
  margin: 0;
  color: var(--muted);
  font-size: 15.5px;
}

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

.grid .card { padding: 22px 22px 20px; }
.grid p {
  margin: 0;
  color: var(--muted);
  font-size: 15.5px;
}

.faq { max-width: 780px; }
.faq details {
  border-bottom: 1px solid var(--border);
  padding: 4px 0;
}
.faq summary {
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  padding: 14px 32px 14px 0;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 6px;
  top: 10px;
  font-size: 24px;
  font-weight: 400;
  color: var(--muted);
}
.faq details[open] summary::after { content: "\2212"; }
.faq details p,
.faq details ul {
  margin: 0 0 16px;
  color: var(--muted);
}

/* ---------- Releases ---------- */

.page-head {
  padding: 48px 0 36px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--purple) 14%, var(--bg)), transparent);
  border-bottom: 1px solid var(--border);
}

.page-head h1 {
  margin: 0 0 8px;
  font-size: clamp(30px, 4.4vw, 42px);
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.page-head p {
  margin: 0;
  color: var(--muted);
  max-width: 680px;
}

.table-wrap { overflow-x: auto; }

table.releases {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  table-layout: fixed;
  min-width: 760px;
}

.releases th,
.releases td {
  text-align: left;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.releases th {
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.releases tbody tr:last-child td { border-bottom: 0; }
.releases td.ver { font-weight: 700; white-space: nowrap; }
.releases .hash {
  font-family: var(--mono);
  font-size: 12px;
  word-break: break-all;
  color: var(--muted);
}
.releases .dl-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  white-space: nowrap;
}

.tag {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--lilac);
  color: #2a1530;
  vertical-align: middle;
}

.notice {
  padding: 18px 22px;
  color: var(--muted);
  margin: 0;
}

.empty-state {
  padding: 28px 24px;
  text-align: center;
}

.empty-state h3 { margin-bottom: 8px; }
.empty-state p {
  margin: 0 auto;
  max-width: 420px;
  color: var(--muted);
}

.callout {
  border-left: 4px solid var(--purple);
  background: color-mix(in srgb, var(--purple) 10%, var(--surface));
  padding: 14px 18px;
  border-radius: 0 10px 10px 0;
  margin: 24px 0 0;
}
.callout p { margin: 0; }

.notes {
  white-space: pre-wrap;
  font-size: 14px;
  color: var(--muted);
  margin: 6px 0 0;
}

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

.site-footer {
  border-top: 1px solid var(--border);
  padding: 36px 0 48px;
  color: var(--muted);
  font-size: 14.5px;
}

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  gap: 16px 32px;
  flex-wrap: wrap;
}

.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }
.site-footer nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.site-footer p { margin: 0; }

/* ---------- Admin ---------- */

.admin-shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 24px 64px;
}

.admin-panel {
  padding: 28px;
}

.admin-panel + .admin-panel { margin-top: 20px; }

.admin-panel h1 {
  margin: 0 0 8px;
  font-size: clamp(26px, 3vw, 34px);
  letter-spacing: -0.02em;
}

.admin-panel .lede {
  margin: 0 0 24px;
  color: var(--muted);
}

.admin-status {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 20px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--purple) 8%, var(--surface));
}

.pill[data-tone="ok"] {
  background: var(--ok-bg);
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 30%, transparent);
}

.pill[data-tone="warn"] {
  background: var(--warn-bg);
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 30%, transparent);
}

.pill[data-tone="err"] {
  background: var(--err-bg);
  color: var(--err);
  border-color: color-mix(in srgb, var(--err) 30%, transparent);
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.field label {
  font-weight: 700;
  font-size: 14px;
}

.field .hint {
  margin: 0;
  font-size: 13.5px;
  color: var(--muted);
}

.field input[type="password"],
.field input[type="text"],
.field textarea {
  width: 100%;
  font: inherit;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.field textarea {
  min-height: 110px;
  resize: vertical;
  font-family: var(--font);
}

.dropzone {
  border: 2px dashed color-mix(in srgb, var(--purple) 45%, var(--border));
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  background: color-mix(in srgb, var(--purple) 6%, var(--surface));
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.dropzone:hover,
.dropzone[data-active="true"] {
  border-color: var(--purple);
  background: color-mix(in srgb, var(--purple) 12%, var(--surface));
}

.dropzone strong { display: block; margin-bottom: 4px; }
.dropzone span { color: var(--muted); font-size: 14.5px; }

.file-browse-row { margin-top: 12px; }

.file-list {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.file-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 14.5px;
}

.file-list .meta {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12.5px;
}

.progress-wrap {
  margin: 16px 0 0;
}

.progress-meter {
  display: block;
  width: 100%;
  height: 12px;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  background: color-mix(in srgb, var(--purple) 12%, var(--border));
  accent-color: var(--purple-mid);
}

.progress-meter::-webkit-progress-bar {
  background: color-mix(in srgb, var(--purple) 12%, var(--border));
  border-radius: 999px;
}

.progress-meter::-webkit-progress-value {
  background: linear-gradient(90deg, var(--purple-mid), var(--lilac));
  border-radius: 999px;
}

.progress-meter::-moz-progress-bar {
  background: linear-gradient(90deg, var(--purple-mid), var(--lilac));
  border-radius: 999px;
}

.banner {
  padding: 12px 14px;
  border-radius: 10px;
  margin: 0 0 18px;
  font-size: 14.5px;
  border: 1px solid transparent;
}

.banner[data-tone="ok"] {
  background: var(--ok-bg);
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 25%, transparent);
}

.banner[data-tone="err"] {
  background: var(--err-bg);
  color: var(--err);
  border-color: color-mix(in srgb, var(--err) 25%, transparent);
}

.banner[data-tone="warn"] {
  background: var(--warn-bg);
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 25%, transparent);
}

.banner[hidden],
[hidden] { display: none !important; }

.banner-follow { margin-top: 20px; }

.result-detail {
  margin-top: 16px;
  box-shadow: none;
}

.toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

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

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

:not(pre) > code {
  background: color-mix(in srgb, var(--purple) 12%, transparent);
  padding: 1px 6px;
  border-radius: 6px;
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .steps { grid-template-columns: repeat(2, 1fr); }
  .grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  .wrap { padding: 0 18px; }
  section { padding: 48px 0; }
  .hero { padding: 36px 0 48px; }
  .app {
    grid-template-columns: 1fr;
    padding: 22px;
    gap: 18px;
  }
  .app .icon {
    width: 96px;
    height: 96px;
  }
  .steps,
  .grid { grid-template-columns: 1fr; }
  .brand-word { width: 120px; }
  .admin-shell { padding: 28px 18px 48px; }
  .admin-panel { padding: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn,
  .dropzone { transition: none; }
  .hero-mascot,
  .app { animation: none; }
}
