/* KronHub site theme: same tokens as the docs page (dark first, light when the OS asks for it). */
:root {
  --bg: #15161c;
  --bg-deep: #101116;
  --surface: #1c1e27;
  --surface-2: #242734;
  --line: #2f3242;
  --line-strong: #3b3f52;
  --fg: #e9eaf1;
  --prose: #c9cbd8;
  --muted: #9c9fb2;
  --faint: #6c7084;
  --accent: #7d93ee;
  --accent-soft: rgba(125, 147, 238, 0.14);
  --dot: rgba(255, 255, 255, 0.07);
  --font-display: "Titillium Web", "Segoe UI", system-ui, sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f3f4f8;
    --bg-deep: #eceef6;
    --surface: #ffffff;
    --surface-2: #eceef6;
    --line: #d8dbe7;
    --line-strong: #b9bdcc;
    --fg: #1a1c26;
    --prose: #33364a;
    --muted: #5a5e73;
    --faint: #7b7f93;
    --accent: #3048cc;
    --accent-soft: rgba(48, 72, 204, 0.09);
    --dot: rgba(26, 28, 38, 0.12);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
}
a { color: var(--accent); text-underline-offset: 2px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
h1, h2 { font-family: var(--font-display); line-height: 1.1; text-wrap: balance; }

.page { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-rows: 1fr auto; }

/* Footer shared by every page */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 18px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: var(--bg-deep);
  color: var(--faint);
  font-size: 0.9rem;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; }
.site-footer a { color: var(--muted); text-decoration: none; transition: color 0.2s ease; }
.site-footer a:hover { color: var(--fg); }

/* Landing */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.backdrop .dots,
.backdrop .spot {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--dot) 1.2px, transparent 1.5px);
  background-size: 28px 28px;
  background-position: center;
}
.backdrop .dots {
  -webkit-mask-image: radial-gradient(ellipse 70% 62% at 50% 45%, #000 15%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 62% at 50% 45%, #000 15%, transparent 75%);
}
.backdrop .spot {
  background-image: radial-gradient(var(--accent) 1.4px, transparent 1.7px);
  opacity: 0;
  transition: opacity 0.4s ease;
  -webkit-mask-image: radial-gradient(200px circle at var(--mx, 50%) var(--my, 50%), #000, transparent 72%);
  mask-image: radial-gradient(200px circle at var(--mx, 50%) var(--my, 50%), #000, transparent 72%);
}
.backdrop.lit .spot { opacity: 0.55; }

.hero {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 0;
  padding: 48px 20px 72px;
  text-align: center;
}
.hero-logo { width: 84px; height: auto; margin-bottom: 14px; filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.35)); }
.hero-logo-float { animation: float 6s ease-in-out 1.2s infinite; }
.hero h1 { margin: 0; font-size: clamp(3.2rem, 11vw, 5.6rem); font-weight: 700; letter-spacing: -0.01em; }
.hero h1 span { color: var(--accent); }
.hero-tag { margin: 6px 0 34px; max-width: 34em; font-size: 1.2rem; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 220px;
  height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface);
  color: var(--fg);
  font: 700 1rem/1 var(--font-body);
  text-decoration: none;
  transition: background-color 0.2s ease;
}
.btn svg { width: 14px; height: 14px; color: var(--muted); transition: color 0.2s ease, transform 0.2s ease; }
.btn:hover { background: var(--surface-2); }
.btn:hover svg { color: var(--fg); transform: translate(2px, -2px); }
.hero-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 22px; color: var(--muted); font-size: 0.95rem; font-weight: 600; text-decoration: none; transition: color 0.2s ease; }
.hero-link span { display: inline-block; transition: transform 0.2s ease; }
.hero-link:hover { color: var(--fg); }
.hero-link:hover span { transform: translateX(3px); }

.rise { animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.d1 { animation-delay: 0.12s; }
.d2 { animation-delay: 0.24s; }
.d3 { animation-delay: 0.36s; }
.d4 { animation-delay: 0.44s; }
.d5 { animation-delay: 0.52s; }
.d6 { animation-delay: 0.6s; }

@keyframes rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }

@media (max-width: 720px) {
  .actions { flex-direction: column; width: min(320px, 100%); }
  .btn { width: 100%; }
}

/* Legal pages */
.legal { width: 100%; max-width: 760px; margin: 0 auto; padding-inline: 20px; padding-block: 28px 72px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: 0.95rem; font-weight: 600; transition: color 0.2s ease; }
.back span { display: inline-block; transition: transform 0.2s ease; }
.back:hover { color: var(--fg); }
.back:hover span { transform: translateX(-3px); }
.back img { width: 20px; height: auto; }
.legal h1 { margin: 40px 0 12px; font-size: clamp(2.2rem, 6vw, 3rem); font-weight: 700; }
.updated { margin: 0; color: var(--muted); font-size: 0.95rem; }
.updated b { color: var(--fg); }
.legal hr { margin: 28px 0 32px; border: 0; border-top: 1px solid var(--line); }
.legal h2 { margin: 44px 0 10px; font-size: 1.3rem; font-weight: 700; scroll-margin-top: 24px; }
.legal p, .legal li { color: var(--prose); line-height: 1.75; }
.legal p { margin: 0 0 14px; max-width: 65ch; }
.legal ul { margin: 0 0 14px; padding-left: 1.2em; display: grid; gap: 6px; max-width: 65ch; }
.legal a { color: var(--fg); }
.legal strong { color: var(--fg); }
.note {
  margin: 0 0 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--prose);
  max-width: 65ch;
}

/* Resellers */
.resellers { width: 100%; max-width: 1080px; margin: 0 auto; padding-inline: 20px; padding-block: 28px 72px; }
.resellers h1 { margin: 40px 0 10px; font-size: clamp(2.2rem, 6vw, 3rem); font-weight: 700; }
.resellers-tag { margin: 0; max-width: 52ch; color: var(--muted); }
.reseller-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 18px;
  margin-top: 36px;
}
.reseller {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 330px;
  padding: 0 20px 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
  text-align: center;
  transition: border-color 0.25s ease;
}
.reseller:hover { border-color: var(--line-strong); }
.reseller h2 { margin: 12px 0 8px; font-size: 1.35rem; font-weight: 700; }
.reseller-banner {
  position: relative;
  align-self: stretch;
  height: 128px;
  margin: 0 -20px;
  background-color: var(--bg-deep);
  background-image: radial-gradient(var(--dot) 1.2px, transparent 1.5px), linear-gradient(160deg, var(--accent-soft), transparent 70%);
  background-size: 18px 18px, auto;
  overflow: hidden;
}
.reseller-banner img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
.reseller-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 30%, var(--surface)); }
.reseller:hover .reseller-banner img { transform: scale(1.04); }
.reseller-avatar {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  margin-top: -50px;
  border: 4px solid var(--surface);
  border-radius: 50%;
  background: var(--surface-2);
}
.reseller-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.reseller-initial { color: var(--fg); font: 700 2rem/1 var(--font-display); }
.reseller-badge {
  position: absolute;
  right: -2px;
  bottom: 2px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
}
.reseller-badge svg { width: 12px; height: 12px; }
.reseller-handle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 12px;
  border: 0;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font: 600 0.85rem/1.5 var(--font-body);
  cursor: pointer;
  transition: color 0.2s ease;
}
.reseller-handle i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); transition: background-color 0.2s ease; }
.reseller-handle:hover { color: var(--fg); }
.reseller-handle.copied { color: var(--fg); }
.reseller-visit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 150px;
  height: 40px;
  margin-top: auto;
  padding: 0 20px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  font: 700 0.95rem/1 var(--font-body);
  text-decoration: none;
  transition: background-color 0.2s ease;
}
.reseller-visit svg { width: 13px; height: 13px; transition: transform 0.2s ease; }
.reseller-visit:hover { background: color-mix(in srgb, var(--accent) 24%, transparent); }
.reseller-visit:hover svg { transform: translate(2px, -2px); }
.reseller-handle, .reseller h2:has(+ .reseller-visit) { margin-bottom: 24px; }
.reseller-apply {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 18px;
  padding: 20px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
}
.reseller-apply h2 { margin: 0 0 2px; font-size: 1.15rem; font-weight: 700; }
.reseller-apply p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.reseller-apply .reseller-visit { flex-shrink: 0; margin: 0 0 0 auto; }
.reseller-apply-icon { display: grid; flex-shrink: 0; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.reseller-apply-icon svg { width: 20px; height: 20px; }
.reseller-grid:empty { display: none; }
.reseller-grid:empty + .reseller-apply { margin-top: 36px; }
@media (max-width: 640px) {
  .reseller-apply { flex-wrap: wrap; }
  .reseller-apply > div:nth-child(2) { flex: 1 1 200px; }
  .reseller-apply .reseller-visit { width: 100%; margin: 4px 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  .rise, .hero-logo-float { animation: none; }
  .btn, .btn svg, .back, .back span, .hero-link, .hero-link span, .backdrop .spot, .reseller, .reseller-banner img, .reseller-visit, .reseller-visit svg { transition: none; }
  .btn:hover svg, .back:hover span, .hero-link:hover span, .reseller:hover .reseller-banner img, .reseller-visit:hover svg { transform: none; }
}
