/* Waffle marketing site: shares the dashboard's "Ube" design tokens
   (lavender/purple-yam palette, Fredoka + Plus Jakarta Sans, waffle-grid
   texture, soft-square radius scale) so the bot's embeds, dashboard, and
   public site all read as the same product. Values copied 1:1 from
   dashboard/app/globals.css, not reinterpreted. */

:root {
  --background: #faf7ff;
  --foreground: #241830;
  --foreground-secondary: #6b5a85;
  --foreground-tertiary: #9987b3;
  --surface: #f2ecfb;
  --surface-2: #ffffff;
  --border-subtle: #ece2f7;
  --border: #ded0f0;
  --border-strong: #c1a3e0;
  --primary: #7c4fd1;
  --primary-foreground: #ffffff;
  --ring: rgba(124, 79, 209, 0.5);

  /* Status palette: fixed, never themed, same as dashboard/app/globals.css. */
  --status-good: #0ca30c;
  --status-warning: #fab219;
  --status-critical: #d03b3b;

  --category-moderation: #81741e;
  --category-security: #696add;
  --category-logging: #578813;
  --category-leveling: #894edf;
  --category-economy: #568fd1;
  --category-reputation: #608822;
  --category-achievements: #c45f8c;
  --category-roles: #549b29;
  --category-welcome: #b85981;
  --category-integrations: #6573d9;
  --category-fun: #f53fac;
  --category-voice: #c8746e;

  --hero-gradient: linear-gradient(135deg, #d8bdf5, #7c4fd1);
  --griddle-glow: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255, 196, 110, 0.35), transparent 55%);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --shadow-sm: 0 1px 2px rgba(36, 24, 48, 0.08);
  --shadow-md: 0 4px 12px rgba(36, 24, 48, 0.10), 0 1px 2px rgba(36, 24, 48, 0.08);
  --shadow-lg: 0 16px 40px rgba(36, 24, 48, 0.18), 0 2px 8px rgba(36, 24, 48, 0.10);

  --grid-texture: repeating-linear-gradient(
      0deg,
      color-mix(in srgb, var(--foreground) 6%, transparent) 0px,
      color-mix(in srgb, var(--foreground) 6%, transparent) 1px,
      transparent 1px,
      transparent 28px
    ),
    repeating-linear-gradient(
      90deg,
      color-mix(in srgb, var(--foreground) 6%, transparent) 0px,
      color-mix(in srgb, var(--foreground) 6%, transparent) 1px,
      transparent 1px,
      transparent 28px
    );

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 120ms;
  --duration-base: 180ms;
  --duration-slow: 300ms;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #170f22;
    --foreground: #f2ecfa;
    --foreground-secondary: #b8a4d6;
    --foreground-tertiary: #8672a3;
    --surface: #1e1530;
    --surface-2: #261b3d;
    --border-subtle: #241a38;
    --border: #33234e;
    --border-strong: #4a3468;
    --primary: #b088ec;
    --primary-foreground: #1c1030;
    --ring: rgba(176, 136, 236, 0.5);

    --category-moderation: #877917;
    --category-security: #5957c8;
    --category-logging: #537f1e;
    --category-leveling: #8549da;
    --category-economy: #4b7eb9;
    --category-reputation: #5a7d29;
    --category-achievements: #b73777;
    --category-roles: #347f00;
    --category-welcome: #bb477b;
    --category-integrations: #6370df;
    --category-fun: #c23b89;
    --category-voice: #b7524e;

    --hero-gradient: linear-gradient(135deg, #cda6f5, #7c4fd1);
  }
}

:root[data-theme="dark"] {
  --background: #170f22;
  --foreground: #f2ecfa;
  --foreground-secondary: #b8a4d6;
  --foreground-tertiary: #8672a3;
  --surface: #1e1530;
  --surface-2: #261b3d;
  --border-subtle: #241a38;
  --border: #33234e;
  --border-strong: #4a3468;
  --primary: #b088ec;
  --primary-foreground: #1c1030;
  --ring: rgba(176, 136, 236, 0.5);
  --category-moderation: #877917;
  --category-security: #5957c8;
  --category-logging: #537f1e;
  --category-leveling: #8549da;
  --category-economy: #4b7eb9;
  --category-reputation: #5a7d29;
  --category-achievements: #b73777;
  --category-roles: #347f00;
  --category-welcome: #bb477b;
  --category-integrations: #6370df;
  --category-fun: #c23b89;
  --category-voice: #b7524e;
  --hero-gradient: linear-gradient(135deg, #cda6f5, #7c4fd1);
}

:root[data-theme="light"] {
  --background: #faf7ff;
  --foreground: #241830;
  --foreground-secondary: #6b5a85;
  --foreground-tertiary: #9987b3;
  --surface: #f2ecfb;
  --surface-2: #ffffff;
  --border-subtle: #ece2f7;
  --border: #ded0f0;
  --border-strong: #c1a3e0;
  --primary: #7c4fd1;
  --primary-foreground: #ffffff;
  --ring: rgba(124, 79, 209, 0.5);
  --category-moderation: #81741e;
  --category-security: #696add;
  --category-logging: #578813;
  --category-leveling: #894edf;
  --category-economy: #568fd1;
  --category-reputation: #608822;
  --category-achievements: #c45f8c;
  --category-roles: #549b29;
  --category-welcome: #b85981;
  --category-integrations: #6573d9;
  --category-fun: #f53fac;
  --category-voice: #c8746e;
  --hero-gradient: linear-gradient(135deg, #d8bdf5, #7c4fd1);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: "Plus Jakarta Sans", Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
  font-family: "Fredoka", "Plus Jakarta Sans", sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

a { color: inherit; }

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

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Nav --- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: color-mix(in srgb, var(--background) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 1.15rem;
  text-decoration: none;
  color: var(--foreground);
}

.brand img { width: 34px; height: 34px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 0.95rem;
  font-weight: 500;
}

.nav-links a:not(.btn) {
  text-decoration: none;
  color: var(--foreground-secondary);
  transition: color var(--duration-fast) var(--ease-out);
}
.nav-links a:not(.btn):hover { color: var(--foreground); }

@media (max-width: 640px) {
  .site-nav { padding: 14px 16px; }
  .nav-links { gap: 14px; }
  .nav-links a:not(.btn) { display: none; }
  .brand { font-size: 1.05rem; }
  .btn-sm { padding: 8px 14px; font-size: 0.85rem; }
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  /* Isolate from the sticky nav's backdrop-filter: without its own stacking
     context, an opaque child can still get visibly blended/washed out by an
     ancestor's backdrop-filter in some browsers, even though its own
     computed background/opacity are unaffected. */
  isolation: isolate;
  transition: transform var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
  box-shadow: var(--shadow-md);
}
.btn-primary:hover { box-shadow: var(--shadow-lg); }

.btn-ghost {
  background: var(--surface-2);
  color: var(--foreground);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--border-strong); }

.btn-sm { padding: 9px 16px; font-size: 0.9rem; }

/* --- Hero --- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 96px 24px 80px;
  text-align: center;
  background-image: var(--grid-texture);
  background-position: center;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 0%, color-mix(in srgb, var(--primary) 16%, transparent), transparent 70%);
  pointer-events: none;
}

.hero-inner { position: relative; max-width: 720px; margin: 0 auto; }

.hero-mascot {
  width: 128px;
  height: 128px;
  margin: 0 auto 28px;
  filter: drop-shadow(0 12px 28px color-mix(in srgb, var(--primary) 45%, transparent));
  animation: mascot-float 5s ease-in-out infinite;
}

@keyframes mascot-float {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-10px) rotate(1deg); }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  padding: 6px 14px;
  border-radius: var(--radius-xl);
  margin-bottom: 22px;
}
.eyebrow .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--status-good, #0ca30c);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--status-good, #0ca30c) 25%, transparent);
}

.hero h1 {
  font-size: clamp(2.4rem, 5.5vw, 3.6rem);
  line-height: 1.08;
  margin-bottom: 20px;
}
.hero h1 .accent {
  background: var(--hero-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p.lead {
  font-size: 1.15rem;
  color: var(--foreground-secondary);
  line-height: 1.6;
  margin-bottom: 36px;
}

.hero-ctas {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Sections --- */
section { padding: 88px 0; }
.section-head { text-align: center; max-width: 620px; margin: 0 auto 52px; }
.section-head .kicker {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 10px;
}
.section-head h2 { font-size: clamp(1.7rem, 3.5vw, 2.3rem); margin-bottom: 14px; }
.section-head p { color: var(--foreground-secondary); font-size: 1.05rem; line-height: 1.6; }

/* --- Waffle iron feature grid --- */
.griddle {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}

.cell {
  --cell-accent: var(--primary);
  position: relative;
  overflow: hidden;
  background: var(--surface-2);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  min-height: 168px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  isolation: isolate;
}

.cell::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--griddle-glow);
  opacity: 0;
  transition: opacity var(--duration-slow) var(--ease-out);
  z-index: -1;
}
.cell:hover::before,
.cell:focus-within::before { opacity: 1; }

.cell-icon {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--cell-accent) 16%, transparent);
  color: var(--cell-accent);
}
.cell-icon svg { width: 20px; height: 20px; }

.cell h3 { font-size: 1.05rem; }
.cell p { margin: 0; font-size: 0.9rem; color: var(--foreground-secondary); line-height: 1.5; }

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

/* --- Trust / honesty band --- */
.trust {
  background: var(--surface);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}
.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.trust-item h3 { font-size: 1.05rem; margin-bottom: 8px; display: flex; align-items: center; gap: 10px; }
.trust-item p { color: var(--foreground-secondary); font-size: 0.95rem; line-height: 1.6; margin: 0; }
.trust-item svg { width: 20px; height: 20px; color: var(--primary); flex-shrink: 0; }

@media (max-width: 760px) {
  .trust-grid { grid-template-columns: 1fr; }
}

/* --- Support / Buy Me a Coffee --- */
.support-card {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
}
.support-icon {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  font-size: 2rem;
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--primary) 14%, transparent);
}
.support-card h2 { font-size: 1.4rem; margin-bottom: 10px; }
.support-card p { color: var(--foreground-secondary); font-size: 0.98rem; line-height: 1.6; margin-bottom: 20px; max-width: 60ch; }

@media (max-width: 640px) {
  .support-card { flex-direction: column; align-items: flex-start; padding: 28px; }
}

/* --- Final CTA --- */
.cta-band {
  text-align: center;
  padding: 90px 24px;
  background-image: var(--grid-texture);
  position: relative;
}
.cta-band h2 { font-size: clamp(1.8rem, 4vw, 2.5rem); margin-bottom: 16px; }
.cta-band p { color: var(--foreground-secondary); margin-bottom: 32px; font-size: 1.05rem; }

/* --- Footer --- */
footer {
  border-top: 1px solid var(--border-subtle);
  padding: 40px 24px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-links { display: flex; gap: 24px; font-size: 0.9rem; }
.footer-links a { text-decoration: none; color: var(--foreground-secondary); }
.footer-links a:hover { color: var(--foreground); }
.footer-brand { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--foreground-tertiary); }
.footer-brand img { width: 20px; height: 20px; }

/* --- Legal pages (terms/privacy) --- */
.legal-hero {
  padding: 64px 24px 40px;
  text-align: center;
  border-bottom: 1px solid var(--border-subtle);
}
.legal-hero h1 { font-size: clamp(1.9rem, 4vw, 2.5rem); margin-bottom: 10px; }
.legal-hero p { color: var(--foreground-secondary); }

.legal-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 24px 100px;
  line-height: 1.75;
}
.legal-content h2 {
  font-size: 1.35rem;
  margin-top: 44px;
  margin-bottom: 14px;
  padding-top: 8px;
}
.legal-content h2:first-child { margin-top: 0; }
.legal-content p, .legal-content li { color: var(--foreground-secondary); font-size: 1rem; }
.legal-content ul { padding-left: 22px; }
.legal-content li { margin-bottom: 8px; }
.legal-content strong { color: var(--foreground); }
.legal-content a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.legal-updated {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--foreground-tertiary);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  padding: 5px 12px;
  border-radius: var(--radius-xl);
  margin-bottom: 8px;
}

/* --- Status page --- */
.status-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 64px 24px 100px;
}

.status-header {
  text-align: center;
  margin-bottom: 48px;
}
.status-header img { width: 56px; height: 56px; margin: 0 auto 16px; }
.status-header h1 { font-size: clamp(1.7rem, 3.5vw, 2.2rem); margin-bottom: 8px; }
.status-header p { color: var(--foreground-secondary); font-size: 0.95rem; }

.status-overall {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-bottom: 40px;
  padding: 14px 20px;
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 1.05rem;
}
.status-overall.up { background: color-mix(in srgb, var(--status-good) 14%, transparent); color: var(--status-good); }
.status-overall.down { background: color-mix(in srgb, var(--status-critical) 14%, transparent); color: var(--status-critical); }
.status-overall.unknown { background: var(--surface); color: var(--foreground-secondary); }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

.status-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  margin-bottom: 20px;
}
.status-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.status-card-head h2 { font-size: 1.1rem; display: flex; align-items: center; gap: 8px; }
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-xl);
  font-size: 0.8rem;
  font-weight: 600;
}
.status-badge.up { background: color-mix(in srgb, var(--status-good) 15%, transparent); color: var(--status-good); }
.status-badge.down { background: color-mix(in srgb, var(--status-critical) 15%, transparent); color: var(--status-critical); }
.status-badge.unknown { background: var(--border-subtle); color: var(--foreground-tertiary); }

.status-uptime { font-size: 0.85rem; color: var(--foreground-secondary); margin-bottom: 12px; }

.status-strip {
  display: flex;
  gap: 3px;
}
.status-day {
  flex: 1;
  height: 32px;
  border-radius: 3px;
  background: var(--border-subtle);
}
.status-day.up { background: var(--status-good); }
.status-day.down { background: var(--status-critical); }
.status-day.partial { background: var(--status-warning); }

.status-strip-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--foreground-tertiary);
}

.status-stats {
  display: flex;
  gap: 32px;
  justify-content: center;
  margin-top: 8px;
  font-size: 0.9rem;
  color: var(--foreground-secondary);
}
.status-stats strong { color: var(--foreground); }

.status-footer {
  text-align: center;
  margin-top: 32px;
  font-size: 0.8rem;
  color: var(--foreground-tertiary);
}
