/* ============================================
   BrainStorm — Shared Styles
   Nature Journal Aesthetic: white, clean, authoritative
   ============================================ */

:root {
  /* Colors — Nature-inspired clean palette */
  --white: #ffffff;
  --bg: #ffffff;
  --bg-light: #f8f8f6;
  --bg-warm: #f4f3f0;
  --bg-card: #ffffff;

  --ink: #1a1a2e;
  --ink-secondary: #555568;
  --ink-muted: #8e8e9e;
  --ink-faint: #c0c0cc;

  --primary: #1a6b5a;
  --primary-dark: #145549;
  --primary-light: rgba(26, 107, 90, 0.07);
  --primary-lighter: rgba(26, 107, 90, 0.03);

  --accent: #6e4c8e;
  --accent-light: rgba(110, 76, 142, 0.06);

  --warm: #b37d4e;
  --warm-light: rgba(179, 125, 78, 0.07);

  --rose: #c0392b;
  --rose-light: rgba(192, 57, 43, 0.06);

  --border: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(0, 0, 0, 0.16);
  --divider: #e5e5e0;

  /* Typography */
  --font-display: 'Cormorant Garamond', 'Georgia', serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Menlo', monospace;

  /* Layout */
  --container: 80%;
  --container-max: 1400px;

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --transition: 0.25s var(--ease);

  /* Shadows — very subtle for Nature feel */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.03);
  --shadow-sm: 0 1px 6px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.08);

  /* Radius */
  --radius-sm: 3px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-xl: 16px;
}

/* === Reset === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.72;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }

/* === Typography === */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.22;
  color: var(--ink);
}
h1 { font-size: clamp(2.2rem, 4vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: clamp(1.1rem, 1.8vw, 1.35rem); }

/* === Layout === */
.container {
  width: var(--container);
  max-width: var(--container-max);
  margin: 0 auto;
}
.section { padding: 72px 0; position: relative; }

/* === Buttons === */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 11px 24px;
  font-family: var(--font-body);
  font-weight: 600; font-size: 0.85rem;
  border: none; border-radius: var(--radius-md);
  cursor: pointer; transition: var(--transition);
  text-decoration: none; white-space: nowrap;
  letter-spacing: 0.01em;
}
.btn-primary {
  background: var(--ink); color: #fff;
}
.btn-primary:hover {
  background: #0d0d1e; color: #fff;
  transform: translateY(-1px); box-shadow: var(--shadow-md);
}
.btn-outline {
  background: transparent; color: var(--ink);
  border: 1.5px solid var(--divider);
}
.btn-outline:hover {
  border-color: var(--ink); transform: translateY(-1px);
}
.btn-sm { padding: 8px 18px; font-size: 0.8rem; }

/* === Cards === */
.card {
  background: var(--bg-card);
  border: 1px solid var(--divider);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: var(--transition);
}
.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* === Section Labels === */
.section-label {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.7rem; font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 10px;
}
.section-label::before {
  content: ''; width: 20px; height: 1.5px;
  background: var(--primary);
}
.section-title {
  margin-bottom: 12px;
  font-style: italic;
}
.section-desc {
  color: var(--ink-secondary);
  font-size: 0.98rem; line-height: 1.8;
}

/* === Badge === */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  font-size: 0.66rem; font-weight: 600;
  font-family: var(--font-mono);
  border-radius: 100px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-accent { background: var(--accent-light); color: var(--accent); }

/* === Navigation === */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid transparent;
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.site-nav.scrolled {
  background: rgba(255,255,255,0.95);
  border-bottom-color: var(--divider);
  box-shadow: 0 1px 12px rgba(0,0,0,0.04);
}
.nav-inner {
  width: var(--container); max-width: var(--container-max);
  margin: 0 auto;
  display: flex; align-items: center; height: 56px;
}

/* Logo */
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--ink);
  flex-shrink: 0; margin-right: 8px;
  transition: opacity 0.2s ease;
}
.nav-logo:hover { opacity: 0.8; }
.nav-logo img {
  height: 32px; width: 32px; border-radius: 50%;
  object-fit: cover; background: #fff; padding: 2px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.nav-logo .logo-icon {
  width: 32px; height: 32px;
  background: var(--ink); border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; font-size: 0.95rem;
}
.nav-logo span {
  font-family: var(--font-display);
  font-weight: 700; font-size: 1.12rem;
  font-style: italic; letter-spacing: -0.01em;
}

/* Logo-links separator */
.nav-separator {
  width: 1px; height: 20px;
  background: var(--divider);
  margin: 0 10px 0 6px;
  flex-shrink: 0;
}

/* Links */
.nav-links {
  display: flex; align-items: center;
  gap: 1px; list-style: none; margin-left: 0;
}
.nav-item { position: relative; }
.nav-link {
  display: flex; align-items: center; gap: 5px;
  padding: 7px 13px;
  font-size: 0.82rem; font-weight: 500;
  color: var(--ink-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: color 0.2s ease, background 0.2s ease;
  white-space: nowrap;
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%; right: 50%;
  height: 1.5px;
  background: var(--primary);
  border-radius: 1px;
  transition: left 0.25s var(--ease), right 0.25s var(--ease);
}
.nav-link:hover::after,
.nav-link.active::after {
  left: 13px; right: 13px;
}
.nav-link:hover, .nav-link.active {
  color: var(--ink);
}
.nav-link.active {
  font-weight: 600;
}
.nav-link svg {
  width: 13px; height: 13px;
  opacity: 0.4; flex-shrink: 0;
  transition: opacity 0.2s ease;
}
.nav-link:hover svg { opacity: 0.7; }
.nav-arrow {
  width: 9px !important; height: 9px !important;
  opacity: 0.3 !important;
  transition: transform 0.3s var(--ease), opacity 0.2s ease !important;
  margin-left: -1px;
}
.nav-item:hover .nav-arrow {
  transform: rotate(180deg);
  opacity: 0.6 !important;
}

/* Dropdown */
.nav-dropdown {
  position: absolute;
  top: calc(100% + 8px); left: 50%;
  transform: translateX(-50%) translateY(8px);
  min-width: 260px;
  background: rgba(255,255,255,0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: var(--radius-xl);
  padding: 6px;
  opacity: 0; visibility: hidden;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0.25s;
  box-shadow: 0 12px 40px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
}
/* Top arrow indicator */
.nav-dropdown::before {
  content: '';
  position: absolute;
  top: -5px; left: 50%; transform: translateX(-50%) rotate(45deg);
  width: 10px; height: 10px;
  background: rgba(255,255,255,0.98);
  border-top: 1px solid rgba(0,0,0,0.06);
  border-left: 1px solid rgba(0,0,0,0.06);
  border-radius: 2px 0 0 0;
}
.nav-item:hover .nav-dropdown {
  opacity: 1; visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Dropdown link */
.dropdown-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  color: var(--ink-secondary); text-decoration: none;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.dropdown-link:hover {
  background: var(--bg-light);
  color: var(--ink);
  transform: translateX(2px);
}
.dropdown-link .dd-text {
  display: flex; flex-direction: column; gap: 1px;
}
.dropdown-link .dd-title {
  font-weight: 600; color: var(--ink);
  font-size: 0.83rem; line-height: 1.3;
}
.dropdown-link .dd-desc {
  font-size: 0.72rem; color: var(--ink-muted);
  line-height: 1.3; font-weight: 400;
}
.dropdown-link:hover .dd-title { color: var(--primary); }
.dropdown-icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; flex-shrink: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.dropdown-link:hover .dropdown-icon {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* Dropdown section divider */
.dd-divider {
  height: 1px;
  background: var(--divider);
  margin: 4px 8px;
  opacity: 0.6;
}

/* Mega dropdown (two-column) for Tools */
.nav-dropdown.mega {
  min-width: 480px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 8px;
}
.nav-dropdown.mega .dropdown-link {
  padding: 8px 10px;
}
.nav-dropdown.mega .dropdown-icon {
  width: 28px; height: 28px;
  font-size: 0.78rem;
}
.nav-dropdown.mega .dd-title {
  font-size: 0.8rem;
}
.nav-dropdown.mega .dd-desc {
  font-size: 0.68rem;
}

/* CTA button */
.nav-cta { margin-left: auto; }
.nav-cta .btn {
  font-size: 0.78rem;
  padding: 8px 18px;
  border-radius: 100px;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 8px rgba(26,26,46,0.12);
  transition: all 0.25s var(--ease);
}
.nav-cta .btn:hover {
  box-shadow: 0 4px 16px rgba(26,26,46,0.18);
  transform: translateY(-1px);
}

/* Mobile toggle */
.mobile-toggle {
  display: none; flex-direction: column; gap: 4px;
  background: none; border: none; cursor: pointer;
  padding: 8px; margin-left: auto;
  border-radius: var(--radius-sm);
  transition: background 0.2s ease;
}
.mobile-toggle:hover { background: rgba(0,0,0,0.04); }
.mobile-toggle span {
  display: block; width: 18px; height: 1.5px;
  background: var(--ink); border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* === Footer === */
.site-footer {
  background: var(--ink); color: rgba(255,255,255,0.65); padding: 52px 0 0;
}
.footer-inner { width: var(--container); max-width: var(--container-max); margin: 0 auto; }
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 44px; padding-bottom: 40px;
}
.footer-brand p {
  font-size: 0.86rem; margin-top: 10px; line-height: 1.7;
  color: rgba(255,255,255,0.4);
}
.footer-heading {
  font-family: var(--font-body); font-weight: 600;
  font-size: 0.74rem; color: rgba(255,255,255,0.35);
  margin-bottom: 14px; text-transform: uppercase; letter-spacing: 0.1em;
}
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.footer-links a { color: rgba(255,255,255,0.6); font-size: 0.84rem; }
.footer-links a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.07);
  padding: 16px 0;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.76rem; color: rgba(255,255,255,0.3);
}
.footer-status { display: flex; align-items: center; gap: 6px; }
.status-dot {
  width: 5px; height: 5px; background: #2ecc71;
  border-radius: 50%; animation: pulse 2s infinite;
}

/* === Animations === */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; } to { opacity: 1; }
}
@keyframes pulse {
  0%,100% { opacity: 1; } 50% { opacity: 0.3; }
}

.reveal {
  opacity: 0; transform: translateY(18px);
  transition: opacity 0.65s var(--ease-out), transform 0.65s var(--ease-out);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal.d1 { transition-delay: 0.06s; }
.reveal.d2 { transition-delay: 0.12s; }
.reveal.d3 { transition-delay: 0.18s; }
.reveal.d4 { transition-delay: 0.24s; }
.reveal.d5 { transition-delay: 0.30s; }
.reveal.d6 { transition-delay: 0.36s; }

.nav-progress {
  position: absolute; bottom: 0; left: 0;
  height: 1.5px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  width: 0%;
}

/* === Responsive === */
@media (max-width: 1100px) { :root { --container: 88%; } }
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .section { padding: 56px 0; }
}
@media (max-width: 768px) {
  .nav-separator { display: none; }
  .nav-links {
    display: none; position: absolute; top: 56px; left: 0; right: 0;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--divider);
    flex-direction: column; padding: 8px 12px; gap: 1px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
  }
  .nav-links.open { display: flex; }
  .nav-link::after { display: none; }
  .nav-dropdown {
    position: static; transform: none; opacity: 1; visibility: visible;
    background: var(--bg-light); border: none; box-shadow: none;
    padding: 4px 0 4px 12px; min-width: auto; display: none;
    border-radius: var(--radius-md);
  }
  .nav-dropdown::before { display: none; }
  .nav-item.open .nav-dropdown { display: block; }
  .mobile-toggle { display: flex; }
  .nav-cta { display: none; }
  .footer-grid { grid-template-columns: 1fr; gap: 20px; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
}
@media (max-width: 480px) { :root { --container: 92%; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
