/* ==========================================================================
   BrainDock Landing Page - "Seraphic Focus" Design System
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Custom Properties (Design Tokens)
   -------------------------------------------------------------------------- */
:root {
  /* Colors */
  --bg-primary: #FEFEFD;
  --bg-primary-dark: #D9D9D8;  /* 20% darker for gradient left */
  --bg-primary-light: #FFFFFF;  /* 3% lighter for gradient right */
  --bg-secondary: #FCFBF8;
  --bg-secondary-dark: #D4D3D1;  /* 20% darker for gradient left */
  --bg-secondary-light: #FEFEFD;  /* 3% lighter for gradient right */
  --bg-surface: #FFFFFF;
  --text-primary: #1C1C1E;
  --text-secondary: rgba(60, 60, 67, 0.6);
  --text-tertiary: rgba(60, 60, 67, 0.45);
  --accent-highlight: #648610;
  --border-subtle: #E5E5EA;
  --success: #34C759;
  --warning: #FF9500;
  --error: #FF3B30;
  --btn-primary-bg: #648610;
  --btn-primary-hover: #5A7A0D;

  /* Typography */
  --font-serif: Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Spacing */
  --space-xs: 4px;
  --space-s: 8px;
  --space-m: 16px;
  --space-l: 24px;
  --space-xl: 32px;
  --space-xxl: 48px;
  --space-xxxl: 64px;

  /* Layout */
  --max-width: 1200px;
  --text-width: 680px;

  /* Components */
  --radius-md: 12px;
  --btn-radius: 30px;
  --card-radius: 20px;
  --bg-surface-elevated: #FAFAF8;
  --shadow-subtle: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-card: 0 6px 28px rgba(0, 0, 0, 0.035);
  --shadow-hover: 0 14px 40px rgba(0, 0, 0, 0.06);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px; /* Account for floating pill nav (56px + 8px gap + breathing room) */
  color-scheme: light; /* Ensure browser chrome matches our light theme */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: 100%;
  line-height: 1.5;
  color: var(--text-primary);
  background: linear-gradient(to right, var(--bg-primary-dark) 0%, var(--bg-primary-light) 45%);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

ul, ol {
  list-style: none;
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}

h3 {
  font-family: var(--font-sans);
  font-size: 1.25rem;
}

p {
  color: var(--text-secondary);
}

/* Desktop typography */
@media (min-width: 768px) {
  h1 {
    font-size: 3rem;
  }

  h2 {
    font-size: 2rem;
  }

  h3 {
    font-size: 1.5rem;
  }
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-m);
}

.section {
  padding: var(--space-xxl) 0;
}

@media (min-width: 768px) {
  .section {
    padding: var(--space-xxxl) 0;
  }
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-xxl);
}

.section-header h2 {
  margin-bottom: var(--space-m);
}

.section-header p {
  max-width: 600px;
  margin: 0 auto;
  font-size: 1.125rem;
}

/* Why BrainDock - larger heading with more breathing room */
.why-braindock h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
}

.why-braindock .section-header {
  margin-bottom: var(--space-xxxl);
}

/* --------------------------------------------------------------------------
   Roadmap - "Why Use BrainDock" S-curve journey (compact)
   -------------------------------------------------------------------------- */

/* Container anchors the absolute SVG */
.roadmap-container {
  position: relative;
  max-width: min(1100px, 100%);
  margin: 0 auto;
}

/* SVG path layer - sits behind the cards */
.roadmap-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: visible;
}

.roadmap-path {
  fill: none;
  stroke: var(--btn-primary-bg);
  stroke-width: 2.5;
  stroke-dasharray: 8 8;
  stroke-linecap: round;
  opacity: 0.5;
}

/* Ordered list reset */
.roadmap {
  position: relative;
  list-style: none;
  padding: 0;
  margin: 0;
  z-index: 1;
}

/* Each step - mobile: left-aligned vertical stack */
.roadmap-step {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--space-l);
  padding-bottom: var(--space-l);
  padding-left: 52px;
}

.roadmap-step:last-child {
  padding-bottom: 0;
}

/* Green dot marker with icon inside + soft outer ring */
.roadmap-dot {
  position: absolute;
  left: 0;
  top: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--btn-primary-bg);
  flex-shrink: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 6px rgba(100, 134, 16, 0.15);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

/* Dot grows + glows when its card is hovered */
.roadmap-step:hover .roadmap-dot {
  transform: scale(1.15);
  box-shadow: 0 0 0 6px rgba(100, 134, 16, 0.15), 0 0 12px rgba(100, 134, 16, 0.4);
}

/* Mobile: straight dotted line via pseudo-element (SVG hidden) */
.roadmap::before {
  content: '';
  position: absolute;
  left: 17px;
  top: 18px;
  bottom: 18px;
  border-left: 2px dotted var(--btn-primary-bg);
  opacity: 0.35;
  z-index: 0;
}

/* Content card - organic, centered */
.roadmap-content {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(100, 134, 16, 0.12);
  border-radius: var(--btn-radius);
  padding: var(--space-l) var(--space-xl);
  width: fit-content;
  max-width: 340px;
  text-align: center;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.roadmap-content:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-subtle);
}

.roadmap-content p {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--text-primary);
  margin: 0;
}

/* Icon inside the dot */
.roadmap-icon {
  width: 18px;
  height: 18px;
  stroke: #FFFFFF;
  stroke-width: 2;
  fill: none;
}

/* Varied card sizes for balanced organic rhythm */
.roadmap-step:nth-child(1) .roadmap-content { max-width: 360px; } /* left - wide */
.roadmap-step:nth-child(2) .roadmap-content { max-width: 310px; } /* right - narrow */
.roadmap-step:nth-child(3) .roadmap-content { max-width: 310px; } /* left - narrow */
.roadmap-step:nth-child(4) .roadmap-content { max-width: 360px; } /* right - wide */
.roadmap-step:nth-child(5) .roadmap-content { max-width: 340px; } /* left - medium */
.roadmap-step:nth-child(6) .roadmap-content { max-width: 340px; } /* right - medium */

/* Mobile: hide SVG, show CSS line */
@media (max-width: 767px) {
  .roadmap-svg {
    display: none;
  }
}

/* Desktop (768px+): alternating zigzag layout with SVG curve */
@media (min-width: 768px) {
  /* Hide the CSS fallback line on desktop */
  .roadmap::before {
    display: none;
  }

  .roadmap-step {
    width: 46%;
    padding-left: 0;
    padding-bottom: var(--space-xl);
    flex-direction: row;
  }

  /* Odd steps (1, 3, 5): left side */
  .roadmap-step:nth-child(odd) {
    margin-right: auto;
    margin-left: 0;
    flex-direction: row-reverse;
    text-align: right;
  }

  .roadmap-step:nth-child(odd) .roadmap-dot {
    position: relative;
    left: auto;
    top: auto;
  }

  .roadmap-step:nth-child(odd) .roadmap-content {
    text-align: center;
  }

  /* Even steps (2, 4, 6): right side */
  .roadmap-step:nth-child(even) {
    margin-left: auto;
    margin-right: 0;
    flex-direction: row;
    text-align: center;
  }

  .roadmap-step:nth-child(even) .roadmap-dot {
    position: relative;
    left: auto;
    top: auto;
  }

  .roadmap-step:nth-child(even) .roadmap-content {
    text-align: center;
  }

  /* Larger dots + icons on desktop */
  .roadmap-dot {
    width: 40px;
    height: 40px;
  }

  .roadmap-icon {
    width: 20px;
    height: 20px;
  }

  .roadmap-content p {
    font-size: 1.0625rem;
  }
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-s);
  padding: 14px 28px;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--btn-radius);
  border: none;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-base);
  text-decoration: none;
}

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

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

.btn:focus-visible {
  outline: 2px solid var(--btn-primary-bg);
  outline-offset: 2px;
}

.btn-primary {
  background-color: var(--btn-primary-bg);
  color: #FFFFFF;
  box-shadow: var(--shadow-subtle);
}

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

.btn-secondary {
  background-color: transparent;
  color: var(--text-primary);
  border: 2px solid var(--border-subtle);
}

.btn-secondary:hover {
  border-color: var(--text-primary);
}

.btn-download {
  width: 160px;
  justify-content: center;
}

#linux-download-btn {
  background-color: #F0F4D8;
  color: var(--text-primary);
  border: 2px solid rgba(212, 224, 96, 0.4);
  box-shadow: none;
}

#linux-download-btn:hover {
  background-color: #E6EDC0;
  border-color: rgba(212, 224, 96, 0.7);
}

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */
.nav {
  position: fixed;
  top: var(--space-l);
  left: 50%;
  transform: translateX(-50%);
  width: max-content; /* Never shrink below content width - no JS locking needed */
  z-index: 100;
  background: rgba(249, 248, 244, 0.72);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  border: 1px solid var(--text-primary);
}
/* Tighter top spacing on small screens */
@media (max-width: 480px) {
  .nav {
    top: var(--space-s);
  }
}

.nav-container {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: var(--space-xl);
  height: 64px;
  padding: 0 var(--space-l);
}

.nav-logo {
  flex-shrink: 0;
}

.nav-logo img {
  height: 32px;
  width: auto;
}

.nav-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-l);
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: var(--space-l);
  white-space: nowrap;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-m);
  flex-shrink: 0;
  border-left: 1px solid var(--border-subtle);
  padding-left: var(--space-m);
}

.nav-links a {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
  white-space: nowrap;
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-cta {
  display: inline-flex;
  padding: 10px 20px;
  font-size: 0.875rem;
  white-space: nowrap;
}

/* Mobile menu toggle - hidden by default, shown in compact mode */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-s);
  margin-left: auto; /* Push to right side */
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--text-primary);
  transition: transform var(--transition-fast);
}

/* Mobile menu - dropdown merges with pill */
.nav-mobile {
  display: none;
  position: absolute;
  top: calc(100% - 1px); /* Overlap 1px into pill border for seamless connection */
  left: -1px; /* Align with pill's outer border */
  right: -1px;
  background: rgba(249, 248, 244, 0.95);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--text-primary);
  border-top: none;
  border-radius: 0 0 16px 16px;
  padding: var(--space-m) var(--space-l);
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* When mobile menu is open, flatten pill bottom corners to merge with dropdown */
.nav.nav-menu-open {
  border-radius: 16px 16px 0 0;
  border-bottom: none;
}

.nav-mobile.active {
  display: block;
}

.nav-mobile a {
  display: block;
  padding: var(--space-m) 0;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-mobile a:last-of-type {
  border-bottom: none;
}

/* Compact/mobile navigation mode - triggered by JavaScript when elements overflow */
.nav.nav-compact .nav-center {
  display: none;
}

.nav.nav-compact .nav-links {
  display: none;
}

.nav.nav-compact .nav-actions {
  border-left: none;
  padding-left: 0;
}

.nav.nav-compact .nav-cta-signup {
  display: none;
}

.nav.nav-compact .nav-toggle {
  display: flex;
}

/* Mini state: same as compact but scaled down for very small screens */
.nav.nav-mini .nav-container {
  height: 48px;
  padding: 0 var(--space-m);
  gap: var(--space-m);
}
.nav.nav-mini .nav-logo img {
  height: 26px;
}
.nav.nav-mini .nav-cta-download {
  padding: 6px 14px;
  font-size: 0.75rem;
}
.nav.nav-mini .nav-cta-download svg {
  width: 12px;
  height: 12px;
}
.nav.nav-mini .nav-toggle {
  padding: var(--space-xs);
}
.nav.nav-mini .nav-toggle span {
  width: 20px;
}
.nav.nav-mini .nav-mobile {
  /* top: calc(100% - 1px) inherited - works automatically for mini height */
}

/* CSS-only fallback for browsers without JavaScript (uses a safe breakpoint) */
@media (max-width: 1200px) {
  .nav:not(.nav-compact):not([data-js-ready]) .nav-center {
    display: none;
  }

  .nav:not(.nav-compact):not([data-js-ready]) .nav-links {
    display: none;
  }

  .nav:not(.nav-compact):not([data-js-ready]) .nav-cta-signup {
    display: none;
  }

  .nav:not(.nav-compact):not([data-js-ready]) .nav-center {
    /* already hidden above */
  }

  .nav:not(.nav-compact):not([data-js-ready]) .nav-toggle {
    display: flex;
  }
}


/* --------------------------------------------------------------------------
   Binary Canvas inside Hero - "BrainDock" in binary digits
   -------------------------------------------------------------------------- */
.hero-binary-canvas {
  display: block;
  width: 100%;
  align-self: stretch;
  flex-shrink: 0; /* Never shrink the canvas */
  position: relative;
  z-index: 1; /* Canvas renders above hero content overflow */
}

/* --------------------------------------------------------------------------
   Hero Section - Fluid Scaling Design
   Fixed maximum size (original 16" MacBook Pro layout).
   Only scales down when screen is smaller. Never expands beyond max.
   Fixed 50px minimum edge padding.
   -------------------------------------------------------------------------- */
.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 0; /* Canvas sits flush at the top */
  padding-bottom: clamp(80px, 14vh, 180px);
  background: linear-gradient(to right, var(--bg-primary-dark) 0%, var(--bg-primary-light) 45%);
}

/* Hero container padding - responsive */
.hero .container {
  max-width: 1570px;
  padding: 0 var(--space-l); /* Mobile padding */
  margin: 0 auto;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 0; /* Below the canvas (z-index: 1) so it doesn't cover the fade */
  margin-top: -60px; /* Shift content up while keeping section height */
}

/* Desktop: 80px edge padding */
@media (min-width: 1024px) {
  .hero .container {
    padding: 0 80px;
  }
}

.hero-grid {
  display: flex;
  flex-direction: column-reverse; /* Image appears above text on mobile */
  align-items: center;
  justify-content: center;
  gap: 1px;
  text-align: center;
  width: 100%;
}

.hero-content {
  max-width: 720px;
  text-align: center;
}

/* Fluid typography - scales down when needed, capped at max */
.hero h1 {
  font-size: clamp(1.75rem, 4.5vw, 3.25rem);
  margin-bottom: clamp(var(--space-s), 1.5vh, var(--space-m));
}

.hero-subtitle {
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  color: var(--text-secondary);
  max-width: 580px;
  margin: 0 auto clamp(var(--space-m), 2vh, var(--space-l));
}

.hero-ctas {
  display: flex;
  flex-direction: row;
  gap: var(--space-m);
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap; /* Prevent wrapping - JS will detect overflow */
}

.hero-ctas .btn {
  white-space: nowrap;
  padding: 13px 26px;
  font-size: 1rem;
}

.hero-note {
  margin-top: clamp(var(--space-m), 2vh, var(--space-l));
  font-size: 0.875rem;
  color: var(--text-tertiary);
}

/* Fluid image sizing - scales down when needed */
.hero-image {
  max-width: clamp(260px, 38vw, 420px);
  width: 100%;
}

.hero-image img {
  width: 100%;
  height: auto;
}

/* Hero compact mode - triggered by JavaScript when CTA buttons would overflow */
body.hero-compact .hero-ctas {
  flex-direction: column;
}

/* CSS-only fallback for narrow screens without JavaScript */
@media (max-width: 500px) {
  body:not(.hero-compact) .hero-ctas {
    flex-direction: column;
  }
}

/* Reduce content overlap on mobile */
@media (max-width: 768px) {
  .hero .container {
    margin-top: -30px;
  }
}

/* Desktop layout (1024px+): Side-by-side with fluid scaling */
@media (min-width: 1024px) {
  .hero-grid {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: clamp(var(--space-m), 2vw, var(--space-xl));
  }

  .hero-content {
    text-align: left;
    flex: 1;
    max-width: 580px; /* Fixed max, scales down with flex */
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-left: 40px; /* Shift content slightly right */
  }

  /* Fluid title - scales down when needed, capped at max */
  .hero h1 {
    font-size: clamp(2rem, min(4.5vw, 5.5vh), 3.25rem);
  }

  .hero-subtitle {
    font-size: clamp(1rem, min(1.4vw, 2vh), 1.2rem);
    margin-left: 0;
    margin-right: 0;
  }

  .hero-ctas {
    justify-content: flex-start;
  }

  /* Fluid image - fixed max, scales down when needed */
  .hero-image {
    flex: 0 1 640px; /* Starts at 640px max, shrinks if needed */
    max-width: min(640px, min(42vw, 62vh));
    width: auto;
    margin-right: clamp(10px, 2vw, 24px); /* Slight right shift, scales with viewport */
  }
}

/* --------------------------------------------------------------------------
   Why Use BrainDock Section
   -------------------------------------------------------------------------- */
.why-braindock {
  background:
    radial-gradient(ellipse at 50% 60%, rgba(100, 134, 16, 0.06) 0%, transparent 70%),
    linear-gradient(to right, var(--bg-secondary-dark) 0%, var(--bg-secondary-light) 45%);
  padding-bottom: 96px;
}

/* --------------------------------------------------------------------------
   Made For You - Light Card
   -------------------------------------------------------------------------- */
.mfy-card {
  background:
    radial-gradient(ellipse at 50% 50%, rgba(100, 134, 16, 0.06) 0%, transparent 70%),
    #E5EBD4;
  border: 1px solid rgba(100, 134, 16, 0.12);
  border-radius: var(--card-radius);
  overflow: hidden;
  margin-top: 120px;
  margin-bottom: var(--space-xl);
}

.mfy-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  padding: 4rem 3rem;
  align-items: stretch;
}

/* Left column - heading at top, pills at bottom */
.mfy-left {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.mfy-heading {
  font-size: clamp(4.25rem, 9vw, 8rem);
  font-weight: 700;
  line-height: 1.02;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  font-family: var(--font-serif);
  margin-bottom: 3rem;
}

.mfy-heading-accent {
  color: var(--btn-primary-bg);
}

/* Pills - 3 per row, 2 rows */
.mfy-pills {
  display: grid;
  grid-template-columns: repeat(3, max-content);
  gap: 0.75rem;
}

.mfy-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.25rem;
  background: transparent;
  border: 1.5px solid rgba(100, 134, 16, 0.30);
  border-radius: 9999px;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
}

.mfy-pill:hover {
  border-color: rgba(100, 134, 16, 0.60);
  color: var(--text-primary);
}

.mfy-pill:focus-visible {
  outline: 2px solid var(--btn-primary-bg);
  outline-offset: 2px;
}

.mfy-pill.active {
  background: var(--btn-primary-bg);
  border-color: var(--btn-primary-bg);
  color: #FFFFFF;
  font-weight: 600;
}

/* Right column - panels */
.mfy-right {
  position: relative;
  min-height: 280px;
  display: flex;
  flex-direction: column;
}

.mfy-panel {
  display: none;
  animation: mfyFadeIn 0.35s ease;
}

.mfy-panel.active {
  display: flex;
  flex-direction: column;
  height: 100%;
}

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

.mfy-panel-title {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  font-family: var(--font-serif);
}

.mfy-panel-title em {
  font-style: italic;
  text-decoration: underline;
  text-decoration-color: var(--btn-primary-bg);
  text-underline-offset: 6px;
}

.mfy-panel-desc {
  font-family: var(--font-sans);
  font-size: 1.125rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 2rem;
  max-width: 520px;
}

.mfy-panel-actions {
  display: flex;
  gap: var(--space-m);
  flex-wrap: wrap;
  margin-top: auto;
}

/* Buttons - matching site pill shape (14px 28px, 30px radius) */
.mfy-panel-actions .btn {
  padding: 14px 28px;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--btn-radius);
}

.mfy-panel-actions .btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 2px solid rgba(100, 134, 16, 0.35);
}

.mfy-panel-actions .btn-outline:hover {
  border-color: var(--btn-primary-bg);
  color: var(--btn-primary-bg);
}

.mfy-panel-actions .btn-primary {
  background: var(--btn-primary-bg);
  color: #FFFFFF;
  box-shadow: var(--shadow-subtle);
  border: none;
}

.mfy-panel-actions .btn-primary:hover {
  background: var(--btn-primary-hover);
  box-shadow: var(--shadow-hover);
}

/* Responsive - single column on mobile */
@media (max-width: 768px) {
  .mfy-wrapper {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2.5rem 1.5rem;
  }

  .mfy-heading {
    font-size: 3.25rem;
    margin-bottom: 2rem;
  }

  .mfy-pills {
    grid-template-columns: repeat(3, max-content);
    gap: 0.5rem;
  }

  .mfy-right {
    min-height: auto;
  }

  .mfy-panel-actions {
    flex-direction: column;
  }

  .mfy-panel-actions .btn {
    text-align: center;
    justify-content: center;
  }
}

/* --------------------------------------------------------------------------
   Features Section
   -------------------------------------------------------------------------- */
.features {
  background: linear-gradient(to right, var(--bg-primary-dark) 0%, var(--bg-primary-light) 45%);
  padding-bottom: 96px;
}

.features .section-header h2 {
  font-size: 1.75rem;
}

@media (min-width: 768px) {
  .features .section-header h2 {
    font-size: 2.25rem;
  }
}

.features-grid {
  display: grid;
  gap: var(--space-l);
}

.feature-card {
  background-color: var(--bg-surface);
  border-radius: var(--card-radius);
  padding: var(--space-xl);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(0, 0, 0, 0.02);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

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

.feature-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-secondary);
  border-radius: 12px;
  margin-bottom: var(--space-m);
}

.feature-icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--text-primary);
  stroke-width: 2;
  fill: none;
}

.feature-card h3 {
  margin-bottom: var(--space-s);
  font-size: 1.125rem;
}

.feature-card p {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-primary);
}

@media (min-width: 768px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* --------------------------------------------------------------------------
   How It Works (inside Download section)
   -------------------------------------------------------------------------- */
.how-it-works-wrapper {
  margin-bottom: 120px;
}

.how-it-works-heading {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  letter-spacing: -0.01em;
  text-align: center;
  margin-bottom: var(--space-m);
}

.how-it-works-subtitle {
  text-align: center;
  font-size: 1.125rem;
  max-width: 600px;
  margin: 0 auto var(--space-xxl);
}

@media (min-width: 768px) {
  .how-it-works-heading {
    font-size: 2.25rem;
  }
}

.steps {
  display: grid;
  gap: var(--space-xl);
}

.step {
  text-align: center;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background-color: var(--text-primary);
  color: #FFFFFF;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  border-radius: 50%;
  margin-bottom: var(--space-m);
}

.step h3 {
  margin-bottom: var(--space-s);
  font-size: 1.5rem;
}

.step p {
  max-width: 300px;
  margin: 0 auto;
  font-size: 0.9375rem;
}

@media (min-width: 768px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xxl);
  }
}

/* --------------------------------------------------------------------------
   FAQ (inside Download section)
   -------------------------------------------------------------------------- */
.faq-wrapper {
  margin-top: 120px;
}

.faq-heading {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  letter-spacing: -0.01em;
  text-align: center;
  margin-bottom: var(--space-xxl);
}

@media (min-width: 768px) {
  .faq-heading {
    font-size: 2.25rem;
  }
}

.faq-list {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-m);
}

.faq-item {
  background-color: #F8F7F4;
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-m);
  padding: var(--space-l) var(--space-xl);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: background-color var(--transition-fast);
}

.faq-item:not(.active) .faq-question:hover {
  background-color: var(--bg-secondary);
}

.faq-question:focus-visible {
  outline: 2px solid var(--accent-highlight);
  outline-offset: -2px;
  background-color: var(--bg-secondary);
}

.faq-question span {
  flex: 1;
}

.faq-icon {
  width: 20px;
  height: 20px;
  stroke: var(--text-secondary);
  stroke-width: 2;
  fill: none;
  flex-shrink: 0;
  transition: transform 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-item.active .faq-icon {
  transform: rotate(180deg);
}

/* CSS Grid technique for smooth height animation.
   Safari < 16.4 does not support grid-template-rows: 0fr, so we
   use max-height as a fallback and let modern browsers override. */
.faq-answer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-item.active .faq-answer {
  grid-template-rows: 1fr;
}

.faq-answer-inner {
  overflow: hidden;
}

/* Fallback for Safari 15-16.3 where 0fr is ignored (content stays visible) */
@supports not (grid-template-rows: 0fr) {
  .faq-answer {
    display: block;
    max-height: 0;
    overflow: hidden;
    transition: max-height 350ms cubic-bezier(0.4, 0, 0.2, 1);
  }
  .faq-item.active .faq-answer {
    max-height: 500px;
  }
  .faq-answer-inner {
    overflow: visible;
  }
}

.faq-answer p {
  padding: 0 var(--space-xl) var(--space-l);
  font-size: 0.9375rem;
  line-height: 1.7;
}

/* --------------------------------------------------------------------------
   Download Section
   -------------------------------------------------------------------------- */
.download {
  background: linear-gradient(to right, var(--bg-secondary-dark) 0%, var(--bg-secondary-light) 45%);
  padding-bottom: 96px;
}

.download .section-header h2 {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  letter-spacing: -0.01em;
}

@media (min-width: 768px) {
  .download .section-header h2 {
    font-size: 2.25rem;
  }
}

.download-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--space-m);
  align-items: center;
  margin-bottom: var(--space-l);
}

/* .download-note removed - unused */

@media (min-width: 768px) {
  .download-buttons {
    flex-direction: row;
    justify-content: center;
  }
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer {
  background-color: var(--text-primary);
  color: #FFFFFF;
  padding: var(--space-xxl) 0 var(--space-l);
  border-radius: 40px 40px 0 0;
}

/* Increase padding for footer on mobile/tablet */
.footer .container {
  padding: 0 var(--space-l);
}

.footer-content {
  display: grid;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.footer-brand img {
  height: 44px;
  width: auto;
  filter: brightness(0) invert(1);
  margin-bottom: var(--space-m);
}

.footer-brand p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.875rem;
  max-width: 300px;
}

.footer-links h4,
.footer-contact h4 {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: var(--space-m);
}

.footer-links a,
.footer-links span,
.footer-contact a,
.footer-contact p {
  display: block;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9375rem;
  margin-bottom: var(--space-s);
  transition: color var(--transition-fast);
}

/* Current page indicator in footer (non-clickable) */
.footer-links span {
  color: rgba(255, 255, 255, 0.5);
  cursor: default;
}

.footer-links a:hover,
.footer-contact a:hover {
  color: #FFFFFF;
}

.footer-bottom {
  padding-top: var(--space-l);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.95);
}

.footer-bottom p {
  font-weight: 400;
}

@media (min-width: 768px) {
  .footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-xl);
  }

  .footer-brand {
    flex: 1;
    margin-left: 40px; /* Shift brand slightly right to match hero */
  }

  .footer-links,
  .footer-contact {
    text-align: right;
    margin-right: 40px; /* Shift links/contact slightly left to match hero */
  }

  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    padding-left: 40px; /* Match hero content alignment */
    padding-right: 40px; /* Match hero image alignment */
  }
}

/* Desktop footer: Capped max-width with 80px edge padding */
@media (min-width: 1024px) {
  .footer .container {
    max-width: 1570px;
    padding: 0 80px;
    margin: 0 auto;
  }
}

/* --------------------------------------------------------------------------
   Language Selector
   -------------------------------------------------------------------------- */
.language-selector {
  position: relative;
}

.language-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  min-height: 44px; /* WCAG 2.2 recommended touch target */
  background-color: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
  transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), width 0.2s ease;
  box-sizing: border-box;
}

.language-toggle:hover {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.35);
  color: rgba(255, 255, 255, 0.9);
}

.language-toggle:focus:not(:focus-visible) {
  outline: none;
  border-color: rgba(255, 255, 255, 0.5);
}
.language-toggle:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: 2px;
}

.language-toggle .globe-icon {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
  flex-shrink: 0;
}

.language-current {
  white-space: nowrap;
  line-height: 1.3;
}

.language-toggle .chevron-icon {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.language-toggle[aria-expanded="true"] .chevron-icon {
  transform: rotate(180deg);
}

/* Dropdown menu */
.language-dropdown {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background-color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: var(--space-s) 0;
  list-style: none;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity var(--transition-fast), transform var(--transition-fast), visibility var(--transition-fast);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  z-index: 110;
}

.language-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.language-dropdown li {
  padding: 10px 16px;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.language-dropdown li:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
}

.language-dropdown li.selected {
  color: #FFFFFF;
  background-color: rgba(255, 255, 255, 0.05);
}

/* Mobile adjustments for footer bottom with language selector */
@media (max-width: 767px) {
  .footer-bottom {
    align-items: flex-start;
  }
  
  .language-selector {
    margin-top: var(--space-s);
  }
  
  .language-dropdown {
    right: auto;
    left: 0;
  }
}

/* --------------------------------------------------------------------------
   Legal Pages Styles
   -------------------------------------------------------------------------- */
.legal-page {
  padding-top: calc(100px + var(--space-xxl));
  padding-bottom: var(--space-xxxl);
}

/* Responsive padding for legal pages - matches main website */
.legal-page .container {
  padding: 0 var(--space-l); /* Mobile padding */
}

@media (min-width: 1024px) {
  .legal-page .container {
    max-width: 1570px;
    padding: 0 60px;
    margin: 0 auto;
  }
}

.legal-content {
  max-width: var(--text-width);
  margin: 0 auto;
}

.legal-header {
  margin-bottom: var(--space-xxl);
  padding-bottom: var(--space-l);
  border-bottom: 1px solid var(--border-subtle);
}

.legal-header h1 {
  margin-bottom: var(--space-s);
}

.legal-meta {
  color: var(--text-tertiary);
  font-size: 0.875rem;
}

.legal-content h2 {
  margin-top: var(--space-xxl);
  margin-bottom: var(--space-m);
  padding-top: var(--space-l);
  border-top: 1px solid var(--border-subtle);
}

.legal-content h2:first-of-type {
  border-top: none;
  padding-top: 0;
}

.legal-content h3 {
  margin-top: var(--space-xl);
  margin-bottom: var(--space-m);
  font-family: var(--font-sans);
  font-size: 1.125rem;
}

.legal-content h4 {
  margin-top: var(--space-l);
  margin-bottom: var(--space-s);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
}

.legal-content p {
  margin-bottom: var(--space-m);
  color: var(--text-primary);
}

.legal-content ul,
.legal-content ol {
  margin-bottom: var(--space-m);
  padding-left: var(--space-l);
}

.legal-content ul {
  list-style: disc;
}

.legal-content ol {
  list-style: decimal;
}

.legal-content li {
  margin-bottom: var(--space-s);
  color: var(--text-primary);
}

.legal-content a {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-content a:hover {
  color: var(--accent-highlight);
}

.legal-content strong {
  font-weight: 600;
  color: var(--text-primary);
}

.legal-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-l);
  font-size: 0.9375rem;
}

.legal-content th,
.legal-content td {
  padding: var(--space-m);
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.legal-content th {
  background-color: var(--bg-secondary);
  font-weight: 600;
  color: var(--text-primary);
}

.legal-content td {
  color: var(--text-primary);
}

.legal-content pre {
  background-color: var(--bg-secondary);
  padding: var(--space-l);
  border-radius: 12px;
  overflow-x: auto;
  margin-bottom: var(--space-l);
  font-size: 0.8125rem;
  line-height: 1.6;
}

.legal-content code {
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
}

.legal-content hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: var(--space-xl) 0;
}

.legal-content blockquote {
  border-left: 3px solid var(--accent-highlight);
  padding-left: var(--space-l);
  margin: var(--space-l) 0;
  color: var(--text-secondary);
  font-style: italic;
}

/* Back to top link */
.back-to-top {
  display: inline-flex;
  align-items: center;
  gap: var(--space-s);
  margin-top: var(--space-xxl);
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.back-to-top:hover {
  color: var(--text-primary);
}

/* --------------------------------------------------------------------------
   Coming Soon Popup
   -------------------------------------------------------------------------- */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5); /* More opaque fallback */
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 299;
  opacity: 0;
  visibility: hidden;
  transition: opacity 200ms ease, visibility 200ms;
}

@supports (backdrop-filter: blur(4px)) or (-webkit-backdrop-filter: blur(4px)) {
  .popup-overlay {
    background-color: rgba(0, 0, 0, 0.3);
  }
}

.popup-overlay.active {
  opacity: 1;
  visibility: visible;
}

.popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background-color: var(--bg-surface);
  border-radius: var(--card-radius);
  padding: var(--space-xl) var(--space-xxl);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  z-index: 300;
  opacity: 0;
  visibility: hidden;
  transition: opacity 150ms ease, transform 150ms ease, visibility 150ms;
  text-align: center;
  min-width: 200px;
}

.popup.active {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.popup-text {
  font-family: var(--font-sans);
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0 0 var(--space-l) 0;
}

.popup-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 32px;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  color: #FFFFFF;
  background-color: var(--btn-primary-bg);
  border: none;
  border-radius: var(--btn-radius);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-base);
}

.popup-close:hover {
  background-color: var(--btn-primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.popup-close:active {
  transform: translateY(0) scale(0.97);
}

/* --------------------------------------------------------------------------
   Page entrance animation (shared by dashboard, auth, legal)
   -------------------------------------------------------------------------- */
@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Legal pages fade in */
.legal-page .legal-content {
  animation: fadeSlideIn 0.35s ease-out both;
}

/* --------------------------------------------------------------------------
   Utility Classes
   -------------------------------------------------------------------------- */
.text-center {
  text-align: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link becomes visible on focus for keyboard users */
.sr-only:focus {
  position: fixed;
  top: var(--space-m);
  left: var(--space-m);
  width: auto;
  height: auto;
  padding: var(--space-m) var(--space-l);
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: nowrap;
  background-color: var(--btn-primary-bg);
  color: #FFFFFF;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--btn-radius);
  z-index: 1000;
  box-shadow: var(--shadow-hover);
}

/* --------------------------------------------------------------------------
   Dashboard boot loading screen (shown before JS loads)
   -------------------------------------------------------------------------- */
.dashboard-boot {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  background: linear-gradient(to right, #C7C6C3 0%, #FDFCF9 45%);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: rgba(60, 60, 67, 0.6);
}
.dashboard-boot-spinner {
  width: 36px; height: 36px;
  border: 3px solid #E5E5EA;
  border-top-color: var(--btn-primary-bg);
  border-radius: 50%;
  animation: dbspin 0.8s linear infinite;
}
@keyframes dbspin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------------------
   Respect user's motion preferences
   -------------------------------------------------------------------------- */
@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;
  }
}

/* --------------------------------------------------------------------------
   How BrainDock Helps
   -------------------------------------------------------------------------- */
.hbh-wrapper {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-xxl);
  align-items: center;
  margin-top: 120px;
}

/* --- Left column: visual panel --- */
.hbh-visual {
  position: relative;
  border-radius: var(--card-radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  box-shadow: var(--shadow-hover);
}

.hbh-bg-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hbh-dark-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
}

/* --- Google Docs editor mockup --- */
.hbh-editor {
  position: absolute;
  top: 14%;
  left: 14%;
  right: 14%;
  bottom: 22%;
  background: #ffffff;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.hbh-editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  background: #f8f9fa;
  border-bottom: 1px solid #e0e0e0;
}

.hbh-toolbar-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #5f6368;
  letter-spacing: 0.01em;
}

.hbh-toolbar-actions {
  display: flex;
  gap: 0.35rem;
}

.hbh-toolbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #5f6368;
  cursor: default;
  transition: background var(--transition-fast);
}

.hbh-toolbar-btn:hover {
  background: #e8eaed;
}

.hbh-editor-body {
  flex: 1;
  padding: 1.2rem 1.25rem;
  overflow: hidden;
  position: relative;
}

.hbh-typed-text {
  font-family: var(--font-sans);
  font-size: clamp(0.72rem, 1.1vw, 0.95rem);
  line-height: 1.7;
  color: #202124;
  margin: 0;
  display: inline;
}

/* Blinking cursor */
.hbh-cursor {
  display: inline;
  font-weight: 300;
  color: #1a73e8;
  animation: hbhBlink 1s step-end infinite;
}

@keyframes hbhBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.hbh-cursor.hidden {
  display: none;
}

/* --- Focus badge (bottom-right) --- */
.hbh-focus-badge {
  position: absolute;
  bottom: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  background: rgba(15, 15, 20, 0.75);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  color: #e0e0e0;
  z-index: 5;
}

.hbh-green-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22b07d;
  box-shadow: 0 0 6px #22b07d, 0 0 12px rgba(34, 176, 125, 0.4);
  animation: hbhGlow 2s ease-in-out infinite;
}

@keyframes hbhGlow {
  0%, 100% { box-shadow: 0 0 6px #22b07d, 0 0 12px rgba(34, 176, 125, 0.4); }
  50% { box-shadow: 0 0 10px #22b07d, 0 0 20px rgba(34, 176, 125, 0.6); }
}

/* --- Completion popup --- */
.hbh-complete-popup {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.8rem 2.5rem;
  background: rgba(10, 10, 15, 0.85);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-radius: var(--card-radius);
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hbh-complete-popup.visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.hbh-complete-check {
  font-size: 2rem;
  color: #22b07d;
}

/* --- Right column: text content --- */
.hbh-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-l);
}

.hbh-heading {
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  white-space: nowrap;
}

.hbh-desc {
  font-size: 1.125rem;
  line-height: 1.625;
  color: var(--text-secondary);
  max-width: 480px;
}

/* .hbh-list styles removed - unused (section uses <p> not <ul>) */

.hbh-actions {
  display: flex;
  gap: var(--space-m);
  margin-top: var(--space-m);
}

/* --- Responsive --- */
@media (max-width: 1023px) {
  .hbh-wrapper {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .hbh-visual {
    aspect-ratio: 16 / 10;
  }

  .hbh-heading {
    font-size: clamp(1.4rem, 3vw, 1.8rem);
    white-space: normal;
  }

  .hbh-desc {
    max-width: 100%;
  }
}

@media (max-width: 767px) {
  .hbh-wrapper {
    margin-top: var(--space-xxxl);
  }

  .hbh-visual {
    aspect-ratio: 4 / 3;
  }

  .hbh-editor {
    top: 10%;
    left: 8%;
    right: 8%;
    bottom: 18%;
  }

  .hbh-heading {
    font-size: clamp(1.25rem, 5vw, 1.5rem);
    white-space: normal;
  }

  .hbh-actions {
    flex-direction: column;
  }

  .hbh-complete-popup {
    padding: 1.2rem 1.5rem;
    font-size: 1rem;
  }
}
