/* ════════════════════════════════════════════════════════
   Comet — site.css
   Core layout, background, nav, buttons, footer, animations
   ════════════════════════════════════════════════════════ */

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── CSS custom properties (default = "original" Comet palette) ── */
:root {
  /* Comet original accent — warm white/silver */
  --accent-rgb: 217, 215, 215;
  --accent:     #d9d7d7;
  --accent-hi:  #f2f0f0;
  --accent-dim: rgba(217, 215, 215, 0.14);

  /* Background */
  --bg-rgb: 8, 8, 8;
  --bg:  #080808;
  --bg2: #0e0e0e;

  /* Borders */
  --border:  rgba(255, 255, 255, 0.07);
  --border2: rgba(255, 255, 255, 0.12);

  /* Text */
  --ink:      rgba(255, 255, 255, 0.94);
  --ink-dim:  rgba(255, 255, 255, 0.50);
  --ink-mute: rgba(255, 255, 255, 0.27);

  /* Status colours */
  --green:               #22c55e;
  --green-bg:            rgba(34, 197, 94, 0.10);
  --green-border:        rgba(34, 197, 94, 0.22);
  --yellow-status:       #f5b454;
  --yellow-status-bg:    rgba(245, 180, 84, 0.10);
  --yellow-status-border:rgba(245, 180, 84, 0.22);
  --red:               #f87171;
  --red-bg:            rgba(248, 113, 113, 0.10);
  --red-border:        rgba(248, 113, 113, 0.22);

  /* Join / purchase button glow (adapts per theme) */
  --join-glow-color: #d9d7d7;

  /* Download button hover colours (adapts per theme) */
  --dl-hero-bg:     rgba(217, 215, 215, 0.15);
  --dl-hero-border: rgba(217, 215, 215, 0.40);
  --dl-hero-glow:   rgba(217, 215, 215, 0.25);

  --sans: 'Instrument Sans', 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --radius: 10px;
}

/* ── Theme overrides (data-theme set by theme.js on <html>) ── */
html[data-theme="abyss"] {
  --accent-rgb:     59, 130, 246;
  --accent:         #3B82F6;
  --accent-hi:      #60a5fa;
  --accent-dim:     rgba(59, 130, 246, 0.14);
  --bg:             #05080f;
  --bg2:            #0a101c;
  --bg-rgb:         5, 8, 15;
  --join-glow-color: #3B82F6;
  --dl-hero-bg:     rgba(59, 130, 246, 0.15);
  --dl-hero-border: rgba(59, 130, 246, 0.40);
  --dl-hero-glow:   rgba(59, 130, 246, 0.25);
}
html[data-theme="nebula"] {
  --accent-rgb:     198, 59, 255;
  --accent:         #C63BFF;
  --accent-hi:      #d966ff;
  --accent-dim:     rgba(198, 59, 255, 0.14);
  --bg:             #09050f;
  --bg2:            #100819;
  --bg-rgb:         9, 5, 15;
  --join-glow-color: #C63BFF;
  --dl-hero-bg:     rgba(198, 59, 255, 0.15);
  --dl-hero-border: rgba(198, 59, 255, 0.40);
  --dl-hero-glow:   rgba(198, 59, 255, 0.25);
}
html[data-theme="scarlet"] {
  --accent-rgb:     255, 45, 85;
  --accent:         #FF2D55;
  --accent-hi:      #ff5577;
  --accent-dim:     rgba(255, 45, 85, 0.14);
  --bg:             #0d0507;
  --bg2:            #160a0d;
  --bg-rgb:         13, 5, 7;
  --join-glow-color: #FF2D55;
  --dl-hero-bg:     rgba(255, 45, 85, 0.15);
  --dl-hero-border: rgba(255, 45, 85, 0.40);
  --dl-hero-glow:   rgba(255, 45, 85, 0.25);
}

/* ── Liquid Glass mode (toggled by .glass on <html>) ── */
html.glass body {
  background:
    radial-gradient(700px 480px at 12% 18%, rgba(var(--accent-rgb), .20), transparent 70%),
    radial-gradient(800px 560px at 88% 75%, rgba(var(--accent-rgb), .14), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}

/* ── Scrollbar ── */
html { scrollbar-width: thin; scrollbar-color: var(--border2) transparent; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.07); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.14); }

/* ── Base elements ── */
html, body { height: 100%; }

body {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.3s ease;
}

a { color: inherit; text-decoration: none; }

/* ── CK Studios-style background layers ── */
.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.022;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 128px;
}

.bg-orb {
  position: fixed;
  top: -280px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(var(--accent-rgb), 0.07) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
  transition: background 0.4s ease;
}

/* ── Navbar (CK Studios sticky style) ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(var(--bg-rgb), 0.80);
  border-bottom: 1px solid var(--border);
  transition: background 0.4s ease;
}

.nav-inner {
  max-width: 1380px;
  margin: 0 auto;
  padding: 13px 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: transparent;
}

.brand-mark img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  border-radius: 5px;
}

.nav-divider {
  width: 1px;
  height: 18px;
  background: var(--border);
}

.nav-spacer { flex: 1; }

/* Nav link pills */
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--ink-dim);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all .15s;
  letter-spacing: 0.02em;
  cursor: pointer;
}
.nav-link:hover { color: var(--ink); border-color: var(--border2); }

/* ── Status indicator (top-right, replaces clock) ── */
.nav-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: var(--ink-dim);
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  white-space: nowrap;
  transition: border-color 0.3s, background 0.3s, color 0.3s;
}

.nav-status-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.nav-status-dot::before,
.nav-status-dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
}
.nav-status-dot::after {
  animation: ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* Green — Working */
.nav-status.is-working { border-color: var(--green-border); background: var(--green-bg); color: var(--green); }
.nav-status.is-working .nav-status-dot::before,
.nav-status.is-working .nav-status-dot::after { background: var(--green); }

/* Yellow — Working with Issues */
.nav-status.is-issues { border-color: var(--yellow-status-border); background: var(--yellow-status-bg); color: var(--yellow-status); }
.nav-status.is-issues .nav-status-dot::before,
.nav-status.is-issues .nav-status-dot::after { background: var(--yellow-status); }

/* Red — Patched */
.nav-status.is-patched { border-color: var(--red-border); background: var(--red-bg); color: var(--red); }
.nav-status.is-patched .nav-status-dot::before,
.nav-status.is-patched .nav-status-dot::after { background: var(--red); }

.nav-status-label { font-size: 12px; font-weight: 600; }

/* ── Main content area ── */
main {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  padding: 64px 24px 24px;
  text-align: center;
}

/* ── Wordmark ── */
.wordmark {
  margin: 0;
  font-size: clamp(2.75rem, 11vw, 4.25rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1;
  display: inline-flex;
  align-items: baseline;
}

.wordmark-o {
  display: block;
  height: 1.0em;
  width: auto;
  margin-left: -0.01em;
  margin-right: -0.01em;
}

/* ── Button row ── */
.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 4px;
}

/* ── Download button (Comet FIELD style + CKswitch theme-adaptive hover) ── */
.btn {
  --btn-bg: #1a1a1f;
  --btn-border: var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 190px;
  padding: 13px 26px;
  border: 1px solid var(--btn-border);
  border-radius: var(--radius);
  background: var(--btn-bg);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  cursor: pointer;
  text-decoration: none;
  transition:
    background .22s var(--ease),
    border-color .22s var(--ease),
    transform .22s var(--ease),
    box-shadow .22s var(--ease);
}
.btn:hover {
  --btn-bg: #22232a;
  --btn-border: var(--border2);
  transform: translateY(-1px);
}
.btn:active { transform: translateY(0); }

/* Download — "btn-primary" from Comet FIELD (solid accent fill, dark text) */
.btn-primary {
  --btn-bg: var(--accent);
  --btn-border: var(--accent);
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #101116;
  font-weight: 600;
  box-shadow: 0 8px 26px -12px rgba(var(--accent-rgb), .55);
  transition:
    background .22s var(--ease),
    border-color .22s var(--ease),
    transform .22s var(--ease),
    box-shadow .22s var(--ease);
}
.btn-primary:hover {
  background: var(--accent-hi);
  border-color: var(--accent-hi);
  color: #101116;
  box-shadow: 0 12px 32px -12px rgba(var(--accent-rgb), .85);
  transform: translateY(-1px);
}

/* ── Purchase Key button (Translucent with CKswitch moving shine animation) ── */
.btn-purchase,
.btn-join {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.12) 0%, rgba(var(--accent-rgb), 0.05) 100%);
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  border-radius: var(--radius);
  color: var(--accent);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  padding: 13px 26px;
  min-width: 190px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  transition:
    border-color .3s ease,
    box-shadow .3s ease,
    transform .3s ease,
    color .3s ease;
}

.btn-purchase span,
.btn-join span,
.btn-join .btn-inner {
  position: relative;
  z-index: 2;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Subtle background illumination on hover */
.btn-purchase::before,
.btn-join::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(var(--accent-rgb), 0.15);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
  pointer-events: none;
}

/* CKswitch moving shine sweep bar */
.btn-purchase::after,
.btn-join::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -75%;
  width: 50%;
  bottom: -50%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transform: skewX(-20deg);
  animation: premium-shine 3s linear infinite;
  z-index: 1;
  pointer-events: none;
}

@keyframes premium-shine {
  0%   { left: -75%; }
  100% { left: 125%; }
}

.btn-purchase:hover,
.btn-join:hover {
  border-color: rgba(var(--accent-rgb), 0.6);
  box-shadow: 0 10px 30px rgba(var(--accent-rgb), 0.25);
  transform: translateY(-2px);
  color: var(--accent-hi);
}

.btn-purchase:hover::before,
.btn-join:hover::before {
  opacity: 1;
}

.btn-purchase:hover::after,
.btn-join:hover::after {
  animation: premium-shine-bright 1.5s linear infinite;
}

@keyframes premium-shine-bright {
  0%   { left: -75%; opacity: 0.5; }
  50%  { opacity: 0.9; }
  100% { left: 125%; opacity: 0.5; }
}

.btn:focus-visible,
.btn-join:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ── Discord social icon ── */
.social {
  margin-top: -12px;
  display: inline-flex;
  color: var(--ink-mute);
  transition: color .2s var(--ease), transform .2s var(--ease);
}
.social:hover { color: var(--ink); transform: translateY(-1px); }
.social:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 6px; }
.social svg { width: 21px; height: 21px; display: block; fill: currentColor; }

/* ── Footer ── */
footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 28px 24px 34px;
  font-size: 0.82rem;
  color: var(--ink-mute);
}
footer a { color: var(--ink-mute); transition: color .18s var(--ease); }
footer a:hover { color: var(--ink-dim); }
footer a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
.footer-copyright { white-space: nowrap; }
.footer-links { display: flex; align-items: center; gap: 22px; }

.dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .5; }

/* ── Entrance animations ── */
.rise { animation: rise .7s var(--ease) both; }
.rise:nth-of-type(1) { animation-delay: 0s; }
.rise:nth-of-type(2) { animation-delay: .06s; }
.actions { animation: rise .7s var(--ease) .12s both; }
.social  { animation: fade .7s var(--ease) .16s both; }
footer   { animation: fade .7s var(--ease) .20s both; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
@keyframes fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.35); opacity: 0.5; }
}
@keyframes ping {
  0%        { transform: scale(1); opacity: 0.8; }
  80%, 100% { transform: scale(2.4); opacity: 0; }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .rise, .actions, .social, footer { animation: none; }
  .btn { transition: none; }
  .btn:hover, .btn-join:hover, .btn-purchase:hover { transform: none; }
  .btn-purchase::after, .btn-join::after { animation: none; }
  .nav-status-dot::after { animation: none; }
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .nav-inner { padding: 10px 16px; gap: 10px; }
  .nav-status-label { display: none; }
}

@media (max-width: 460px) {
  main { gap: 24px; }
  .actions { flex-direction: column; width: 100%; max-width: 300px; }
  .btn, .btn-join { width: 100%; }
  .btn-join .btn-inner { justify-content: center; width: 100%; }
}

