:root {
  /* AppPalette Bento Light */
  --bg: #f3f8f4;
  --surface: #ffffff;
  --surface-soft: #f4fbf8;
  --text: #0a140f;
  --text-secondary: #102118;
  --muted: #4e6657;
  --border: rgba(14, 84, 58, 0.11);
  --header-bg: rgba(243, 248, 244, 0.82);
  --primary-light: #4ed19d;
  --primary: #4caf50;
  --primary-end: #11a06f;
  --primary-dark: #1b5e20;
  --accent: #f59f00;
  --pill-bg: rgba(76, 175, 80, 0.12);
  --pill-accent-bg: rgba(245, 159, 0, 0.14);
  --glow-rgb: 76, 175, 80;
  --glow-alpha: 0.20;
  --shadow-card: 0 10px 30px rgba(10, 20, 15, 0.05);
  --shadow-card-hover: 0 18px 40px rgba(10, 20, 15, 0.09);
  --radius: 20px;
  --max-width: 800px;
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
}

[x-cloak] {
  display: none !important;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 14.5px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  font-family: 'Sora', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

a {
  color: var(--primary-dark);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* GlowBackground (matches glow_background.dart) */
.glow-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
}

.glow-orb-top {
  top: -130px;
  right: -130px;
  width: 460px;
  height: 460px;
  background: radial-gradient(
    circle,
    rgba(var(--glow-rgb), var(--glow-alpha)) 0%,
    rgba(var(--glow-rgb), calc(var(--glow-alpha) * 0.55)) 45%,
    rgba(var(--glow-rgb), 0) 72%
  );
}

.glow-orb-bottom {
  bottom: -150px;
  left: -150px;
  width: 420px;
  height: 420px;
  background: radial-gradient(
    circle,
    rgba(var(--glow-rgb), calc(var(--glow-alpha) * 0.78)) 0%,
    rgba(var(--glow-rgb), calc(var(--glow-alpha) * 0.43)) 45%,
    rgba(var(--glow-rgb), 0) 72%
  );
}

.site-header,
main.container,
.site-footer {
  position: relative;
  z-index: 1;
}

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

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

main.container {
  animation: fadeSlideUp 0.45s var(--ease-spring) both;
}

/* Header */
.site-header {
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 58px;
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  transition: transform 0.2s var(--ease-spring);
}

.brand:hover {
  text-decoration: none;
  transform: scale(1.02);
}

.brand:active {
  transform: scale(0.97);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  font-size: 0.9rem;
}

.nav-links a {
  color: var(--muted);
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  transition: color 0.2s ease, background-color 0.25s var(--ease-spring), transform 0.15s var(--ease-spring), box-shadow 0.2s ease;
}

.nav-links a:hover {
  color: var(--primary-dark);
  background: rgba(76, 175, 80, 0.1);
  text-decoration: none;
}

.nav-links a.active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary-light), var(--primary-end));
  box-shadow: 0 4px 12px rgba(17, 160, 111, 0.25);
  text-decoration: none;
}

.nav-links a:focus-visible,
.lang-btn:focus-visible,
.menu-toggle:focus-visible,
.mobile-nav-item:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.nav-links a:active {
  transform: scale(0.96);
}

.header-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Mobile Menu Button */
.menu-toggle {
  display: none;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.2s var(--ease-spring), background-color 0.2s ease;
}

.menu-toggle:active {
  transform: scale(0.92);
}

/* Mobile Slide Drawer */
.mobile-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 15, 0.45);
  z-index: 50;
}

/* Alpine x-transition utilities for mobile slide drawer */
.transition {
  transition-property: transform, opacity;
  transition-timing-function: var(--ease-spring);
}
.ease-out {
  transition-timing-function: var(--ease-spring);
}
.ease-in {
  transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
}
.duration-250 {
  transition-duration: 260ms;
}
.duration-180 {
  transition-duration: 180ms;
}
.opacity-0 {
  opacity: 0;
}
.opacity-100 {
  opacity: 1;
}
.translate-x-full {
  transform: translateX(100%);
}
.translate-x-0 {
  transform: translateX(0);
}

.mobile-drawer {
  position: fixed;
  top: 12px;
  right: 12px;
  bottom: 12px;
  width: min(300px, calc(100vw - 24px));
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(10, 20, 15, 0.22);
  padding: 18px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mobile-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.mobile-drawer-close {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.15s var(--ease-spring);
}

.mobile-drawer-close:active {
  transform: scale(0.92);
}

.mobile-nav-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  border-radius: 16px;
  background: var(--surface-soft);
  border: 1px solid transparent;
  color: var(--text);
  font-weight: 600;
  font-size: 0.98rem;
  transition: transform 0.18s var(--ease-spring), background-color 0.2s ease, border-color 0.2s ease;
}

.mobile-nav-item:hover {
  text-decoration: none;
  border-color: var(--border);
}

.mobile-nav-item:active {
  transform: scale(0.97);
}

.mobile-nav-item.active {
  background: linear-gradient(135deg, var(--primary-light), var(--primary-end));
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(17, 160, 111, 0.22);
}

.mobile-drawer-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--muted);
}

/* Language Switcher */
.lang-switch {
  display: inline-flex;
  align-items: center;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}

.lang-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.2s var(--ease-spring), color 0.2s ease, transform 0.15s var(--ease-spring);
}

.lang-btn:active {
  transform: scale(0.94);
}

.lang-btn.active {
  background: var(--surface);
  color: var(--primary-dark);
  box-shadow: 0 2px 6px rgba(10, 20, 15, 0.1);
}

/* Floating Hero KumplLogo (matches LOGO_DESIGN_SYSTEM.md floating: true) */
.hero {
  padding: 36px 0 34px;
  text-align: center;
}

.hero-logo-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  width: 112px;
}

@keyframes kumplFloat {
  0%, 100% {
    transform: translateY(0px) scale(0.985) rotate(-1.1deg);
  }
  50% {
    transform: translateY(-11px) scale(1.015) rotate(1.1deg);
  }
}

@keyframes kumplGroundShadow {
  0%, 100% {
    transform: scaleX(1) scaleY(1);
    opacity: 0.22;
  }
  50% {
    transform: scaleX(0.76) scaleY(0.8);
    opacity: 0.1;
  }
}

.hero-logo-float {
  display: inline-flex;
  filter: drop-shadow(0 14px 24px rgba(27, 94, 32, 0.22));
  animation: kumplFloat 3.6s ease-in-out infinite;
}

.hero-logo-shadow {
  width: 78px;
  height: 14px;
  margin-top: 6px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(10, 20, 15, 0.35) 0%, rgba(10, 20, 15, 0) 72%);
  animation: kumplGroundShadow 3.6s ease-in-out infinite;
}

.hero-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--pill-bg);
  color: var(--primary-dark);
  font-size: 0.84rem;
  font-weight: 700;
  margin-bottom: 14px;
}

.hero h1 {
  margin: 0 auto 12px;
  max-width: 600px;
  font-size: clamp(1.7rem, 3.4vw, 2.45rem);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.025em;
}

.hero p {
  margin: 0 auto 22px;
  max-width: 500px;
  color: var(--muted);
  font-size: 0.98rem;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 24px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s var(--ease-spring);
  text-decoration: none;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-2px);
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-light), var(--primary-end));
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(17, 160, 111, 0.26);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}

/* Bento Grid */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  margin-bottom: 56px;
}

.bento-card {
  grid-column: span 6;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-card);
  transition: transform 0.25s var(--ease-spring), box-shadow 0.25s var(--ease-spring), border-color 0.2s ease;
}

.bento-card.bento-span-7 {
  grid-column: span 7;
}

.bento-card.bento-span-5 {
  grid-column: span 5;
}

.bento-card.bento-soft {
  background: var(--surface-soft);
}

.bento-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
}

.bento-icon-box {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--pill-bg);
  color: var(--primary-dark);
  margin-bottom: 14px;
}

.bento-icon-box.accent {
  background: var(--pill-accent-bg);
  color: var(--accent);
}

.bento-card h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.bento-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Legal / Support Bento Card & Floating Sidebar Layout */
.container.doc-wide {
  max-width: 980px;
}

.doc-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  margin: 26px 0 48px;
}

.doc-sidebar {
  position: sticky;
  top: 78px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-card);
}

.doc-sidebar-title {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 10px 10px;
}

.doc-toc {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.doc-toc-link {
  display: block;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  transition: background-color 0.2s var(--ease-spring), color 0.15s ease, transform 0.15s var(--ease-spring);
}

.doc-toc-link:hover {
  color: var(--primary-dark);
  background: rgba(76, 175, 80, 0.08);
  text-decoration: none;
}

.doc-toc-link:active {
  transform: scale(0.98);
}

.doc-toc-link.active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary-light), var(--primary-end));
  box-shadow: 0 4px 12px rgba(17, 160, 111, 0.22);
}

.doc-layout .doc-card {
  margin: 0;
}

.doc-section {
  scroll-margin-top: 84px;
  padding-top: 6px;
}

.doc-section + .doc-section {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.doc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin: 26px 0 44px;
  box-shadow: var(--shadow-card);
}

.doc-card h1 {
  margin: 0 0 8px;
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.doc-meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.doc-card h2 {
  margin: 28px 0 10px;
  font-size: 1.18rem;
  font-weight: 700;
}

.doc-card p,
.doc-card li {
  color: var(--text-secondary);
}

.doc-card ul,
.doc-card ol {
  padding-left: 20px;
}

.callout {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  padding: 14px 18px;
  border-radius: 14px;
  margin: 20px 0;
}

/* FAQ Accordion */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-soft);
  overflow: hidden;
}

.faq-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.faq-chevron {
  transition: transform 0.25s var(--ease-spring);
  color: var(--muted);
  flex-shrink: 0;
}

.faq-chevron.open {
  transform: rotate(180deg);
}

.faq-body {
  padding: 0 18px 15px;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0 40px;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links a {
  color: var(--muted);
}

@media (max-width: 780px) {
  .doc-layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .doc-sidebar {
    position: static;
    padding: 12px;
  }

  .doc-sidebar-title {
    margin: 0 0 8px 4px;
  }

  .doc-toc {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 4px;
    gap: 6px;
    scrollbar-width: thin;
  }

  .doc-toc-link {
    white-space: nowrap;
    flex-shrink: 0;
    background: var(--surface-soft);
  }
}

@media (max-width: 720px) {
  .bento-card,
  .bento-card.bento-span-7,
  .bento-card.bento-span-5 {
    grid-column: span 12;
  }

  .doc-card {
    padding: 24px 18px;
  }

  .nav-links {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-logo-float,
  .hero-logo-shadow,
  main.container {
    animation: none;
  }
}
