/* ============================================
   XoonBox Landing — Dark / Light Design System
   ============================================ */

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

:root {
  --font-body: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Dark theme (default) */
  --bg: #0a0a0b;
  --bg-card: #141416;
  --bg-card-hover: #1a1a1e;
  --bg-elevated: #1e1e22;
  --border: #252529;
  --border-light: #1e1e22;

  --text: #f0f0f2;
  --text-secondary: #9a9aa0;
  --text-muted: #5a5a62;

  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.15);
  --accent-subtle: rgba(99, 102, 241, 0.08);

  --green: #34d399;
  --green-subtle: rgba(52, 211, 153, 0.1);

  --nav-bg: rgba(10, 10, 11, 0.8);
  --nav-bg-mobile: rgba(10, 10, 11, 0.97);
  --hero-gradient-from: #fff;
  --hero-gradient-to: #9a9aa0;
  --logo-invert: 1;

  --radius: 12px;
  --radius-lg: 20px;
  --max-w: 1100px;
}

/* Light theme */
[data-theme="light"] {
  --bg: hsl(210, 30%, 92.5%);
  --bg-card: hsl(210, 30%, 97%);
  --bg-card-hover: hsl(210, 28%, 93%);
  --bg-elevated: hsl(210, 25%, 90%);
  --border: hsl(214, 22%, 74%);
  --border-light: hsl(210, 22%, 85%);

  --text: hsl(222, 30%, 14%);
  --text-secondary: hsl(222, 12%, 40%);
  --text-muted: hsl(220, 10%, 55%);

  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-glow: rgba(79, 70, 229, 0.12);
  --accent-subtle: rgba(79, 70, 229, 0.07);

  --green: #059669;
  --green-subtle: rgba(5, 150, 105, 0.08);

  --nav-bg: hsla(210, 30%, 92.5%, 0.85);
  --nav-bg-mobile: hsla(210, 30%, 92.5%, 0.97);
  --hero-gradient-from: hsl(222, 30%, 14%);
  --hero-gradient-to: hsl(222, 12%, 40%);
  --logo-invert: 0;
}

html { scroll-behavior: smooth; }
html.theme-transition,
html.theme-transition *,
html.theme-transition *::before,
html.theme-transition *::after {
  transition: background 0.3s, color 0.3s, border-color 0.3s, box-shadow 0.3s, filter 0.3s !important;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.2; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --- Nav --- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.nav.scrolled { border-bottom-color: var(--border); }
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.nav-brand img { height: 26px; filter: invert(var(--logo-invert)); transition: filter 0.2s; }
.nav-links {
  display: flex;
  gap: 2rem;
}
.nav-links a {
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: 0.75rem; }

/* Theme toggle */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: color 0.15s, border-color 0.15s;
}
.theme-toggle:hover { color: var(--text); border-color: var(--text-muted); }
.theme-toggle .icon-sun,
.theme-toggle .icon-moon { width: 16px; height: 16px; }
.theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* Nav split button (Products) */
.nav-link-split {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
}
.nav-link-split-text {
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.15s;
}
.nav-link-split-text:hover { color: var(--text); }
.nav-link-split-chevron {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color 0.15s, transform 0.25s;
}
.nav-link-split-chevron:hover { color: var(--text); }
.nav-link-split-chevron[aria-expanded="true"] {
  color: var(--text);
  transform: rotate(180deg);
}

/* Products dropdown */
.nav-dropdown {
  overflow: hidden;
  max-height: 0;
  background: var(--bg-elevated);
  border-top: 1px solid transparent;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s;
}
.nav-dropdown.open {
  max-height: 120px;
  border-top-color: var(--border);
}
.nav-dropdown-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  gap: 1.5rem;
}
.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  font-size: 0.82rem;
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s;
  white-space: nowrap;
}
a.nav-dropdown-item:hover { background: var(--bg-card-hover); }
.nav-dropdown-item.muted {
  color: var(--text-muted);
  cursor: default;
}
.nav-dropdown-item strong {
  font-family: var(--font-display);
  font-weight: 600;
}
.nav-dropdown-item span:last-child {
  color: var(--text-muted);
  font-size: 0.78rem;
}
.nav-dropdown-badge {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: var(--bg-card);
  color: var(--text-muted);
}
.nav-dropdown-badge.live {
  color: var(--green);
  background: var(--green-subtle);
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn .arrow { transition: transform 0.2s; }
.btn:hover .arrow { transform: translateX(3px); }

.btn-sm { font-size: 0.8rem; padding: 0.45rem 1rem; }
.btn-lg { font-size: 0.95rem; padding: 0.75rem 1.6rem; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 0 24px var(--accent-glow); }
.btn-outline { background: transparent; color: var(--text); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--text-muted); }
.btn-ghost { background: transparent; color: var(--text-secondary); padding: 0.75rem 0.5rem; }
.btn-ghost:hover { color: var(--text); }

/* --- Hero --- */
.hero {
  padding: 10rem 0 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 500px;
  background: radial-gradient(ellipse, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}

.hero-logo-wrap {
  width: 160px;
  height: 160px;
  margin: 0 auto 2rem;
  cursor: pointer;
}
.hero-logo-wrap svg {
  width: 100%;
  height: 100%;
}
.hero-logo-wrap .icon-mark {
  transform-origin: 512px 428px;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.hero-logo-wrap:hover .icon-mark {
  transform: rotate(180deg);
}
.hero-logo-wrap svg .icon-mark path,
.hero-logo-wrap svg .icon-mark rect,
.hero-logo-wrap svg .wordmark path { transition: fill 0.2s; }

/* Theme-aware logo fills */
.hero-logo-wrap svg path[fill="#020202"],
.hero-logo-wrap svg text[fill="#020202"] { fill: var(--text); }
.hero-logo-wrap svg path[fill="#fff"],
.hero-logo-wrap svg rect[fill="#fff"] { fill: var(--bg); }

.hero-title {
  font-size: clamp(2.5rem, 5.5vw, 3.8rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
  background: linear-gradient(180deg, var(--hero-gradient-from) 30%, var(--hero-gradient-to) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 2.25rem;
  line-height: 1.7;
}

/* --- Section base --- */
.section { padding: 5rem 0; }
.section-header {
  text-align: center;
  margin-bottom: 3rem;
}
.section-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 0.6rem;
}
.section-title {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.6rem;
}
.section-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.65;
}

/* --- Products Grid --- */
.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: border-color 0.2s, background 0.2s;
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  border-color: var(--text-muted);
  background: var(--bg-card-hover);
}
a.product-card-link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.product-card.teaser {
  border-style: dashed;
  opacity: 0.6;
}
.product-card.teaser:hover {
  opacity: 0.8;
  border-color: var(--text-muted);
  background: var(--bg-card-hover);
}

.product-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  margin-bottom: 1rem;
  width: fit-content;
}
.product-badge.live {
  color: var(--green);
  background: var(--green-subtle);
}
.product-badge.live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}
.product-badge.new {
  color: var(--accent);
  background: var(--accent-subtle);
}
.product-badge.coming-soon {
  color: var(--text-muted);
  background: var(--bg-elevated);
}
.product-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.product-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.65;
  flex-grow: 1;
}
.product-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1rem;
}
.product-tag {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-elevated);
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
}
.product-card .product-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: 1.25rem;
  transition: color 0.15s;
}
.product-card .product-link:hover { color: var(--accent-hover); }
.product-card .product-link .arrow { transition: transform 0.2s; }
.product-card .product-link:hover .arrow { transform: translateX(3px); }

/* --- About --- */
.about-text {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}
.about-text p {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 1rem;
}
.about-text p:last-child { margin-bottom: 0; }

/* --- Newsletter --- */
.newsletter-section {
  border-top: 1px solid var(--border-light);
}
.newsletter-wrap {
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
}
.newsletter-form {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.5rem;
}
.newsletter-form input[type="email"] {
  flex: 1;
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 0.7rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}
.newsletter-form input[type="email"]::placeholder { color: var(--text-muted); }
.newsletter-form input[type="email"]:focus { border-color: var(--accent); }
.newsletter-form button {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.7rem 1.4rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.newsletter-form button:hover { background: var(--accent-hover); }
.newsletter-form button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.newsletter-msg {
  font-size: 0.8rem;
  margin-top: 0.75rem;
  min-height: 1.4em;
}
.newsletter-msg.success { color: var(--green); }
.newsletter-msg.error { color: #f43f5e; }

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0 1.5rem;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 3rem;
  margin-bottom: 2rem;
}
.footer-brand img {
  height: 22px;
  filter: invert(var(--logo-invert));
  transition: filter 0.2s;
}
.footer-brand p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.6rem;
}
.footer-links {
  display: flex;
  gap: 3.5rem;
}
.footer-col {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.footer-col h4 {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}
.footer-col a {
  font-size: 0.82rem;
  color: var(--text-secondary);
  transition: color 0.15s;
}
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  border-top: 1px solid var(--border-light);
  padding-top: 1.25rem;
}
.footer-bottom p {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.footer-disclaimer { margin-top: 0.4rem; opacity: 0.7; }

/* --- Responsive --- */
@media (max-width: 900px) {
  .products-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0; right: 0;
    background: var(--nav-bg-mobile);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    flex-direction: column;
    padding: 0.75rem 1.5rem 1.25rem;
    gap: 0;
    border-bottom: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
  .nav-links a,
  .nav-link-split { padding: 0.65rem 0; text-align: left; }
  .nav-toggle { display: flex; }

  .nav-dropdown-inner {
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem 1.5rem;
  }
  .nav-dropdown.open { max-height: 240px; }

  .hero { padding: 7rem 0 3rem; }
  .hero-title { font-size: 2.2rem; }
  .hero-logo-wrap { width: 110px; height: 110px; }

  .newsletter-form {
    flex-direction: column;
  }

  .footer-inner { flex-direction: column; gap: 1.5rem; }
  .footer-links { gap: 2rem; flex-wrap: wrap; }
}
