/* ==========================================================================
   AI Logo Generator - Core Stylesheet (Pure CSS3, Zero Frameworks)
   Optimized for Core Web Vitals (LCP < 1.2s, FID/INP < 50ms, CLS = 0)
   ========================================================================== */

:root {
  /* Color Palette - Premium Dark/Light Tech Neutral */
  --bg-primary: #0a0c10;
  --bg-secondary: #12161f;
  --bg-tertiary: #1a202c;
  --bg-card: #151a24;
  --bg-card-hover: #1c2331;
  --bg-glass: rgba(18, 22, 31, 0.85);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --brand-primary: #3b82f6;
  --brand-primary-hover: #2563eb;
  --brand-accent: #6366f1;
  --brand-cyan: #06b6d4;
  --brand-emerald: #10b981;
  --brand-amber: #f59e0b;
  --brand-rose: #f43f5e;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --border-focus: #3b82f6;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.25);

  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-display: 'Outfit', system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Sizing & Spacing */
  --header-height: 72px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --container-max: 1240px;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-glass: rgba(255, 255, 255, 0.9);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --border-subtle: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.16);

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 24px -4px rgba(15, 23, 42, 0.12);
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.15);
}

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

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  position: relative;
  background-color: var(--bg-primary);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

ul, ol {
  list-style: none;
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 4vw + 1rem, 3.25rem); }
h2 { font-size: clamp(1.5rem, 2.5vw + 0.5rem, 2.25rem); }
h3 { font-size: clamp(1.25rem, 1.5vw + 0.5rem, 1.5rem); }
h4 { font-size: 1.125rem; }

p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

p:last-child {
  margin-bottom: 0;
}

.text-gradient {
  background: linear-gradient(135deg, #60a5fa 0%, #a855f7 50%, #ec4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

.section {
  padding-top: 5rem;
  padding-bottom: 5rem;
}

.section-tight {
  padding-top: 3rem;
  padding-bottom: 3rem;
}

.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-2 { grid-template-columns: repeat(1, 1fr); }
.grid-3 { grid-template-columns: repeat(1, 1fr); }
.grid-4 { grid-template-columns: repeat(1, 1fr); }

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

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

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  white-space: nowrap;
  min-height: 44px;
  min-width: 44px;
  text-align: center;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--brand-primary-hover), var(--brand-primary));
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}

.btn-secondary:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--brand-primary);
  color: #ffffff;
}

.btn-outline {
  background-color: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}

.btn-outline:hover {
  background-color: var(--bg-tertiary);
  border-color: var(--brand-primary);
}

.btn-sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  min-height: 36px;
}

.btn-lg {
  padding: 0.9rem 2rem;
  font-size: 1.05rem;
  border-radius: var(--radius-lg);
}

.btn-block {
  width: 100%;
}

/* Badges & Pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: var(--radius-full);
  background-color: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-emerald {
  background-color: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
}

.badge-amber {
  background-color: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.3);
}

/* Cards */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

.card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card-highlight {
  position: relative;
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.05) 0%, rgba(18, 22, 31, 0.8) 100%);
  border-color: rgba(59, 130, 246, 0.25);
}

/* Header & Navigation */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  height: var(--header-height);
  display: flex;
  align-items: center;
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 0.75rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
  flex-shrink: 0;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
  flex-shrink: 0;
}

.nav {
  display: none;
}

@media (min-width: 900px) {
  .nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
  }
}

.nav-link {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-secondary);
  padding: 0.5rem 0.25rem;
  position: relative;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-accent));
  border-radius: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  position: relative;
  flex-shrink: 0;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
  cursor: pointer;
  flex-shrink: 0;
}

.theme-toggle:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background-color: var(--bg-card-hover);
}

/* Top Right Side Navigation Menu & Slide-out Drawer */
.top-menu-wrapper {
  position: relative;
}

.top-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.95rem;
  min-height: 40px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.top-menu-btn:hover,
.top-menu-btn:focus-visible,
.top-menu-wrapper.active .top-menu-btn {
  background-color: var(--bg-card-hover);
  border-color: var(--brand-primary);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.25);
}

/* Header Responsiveness for Mobile Devices */
@media (max-width: 768px) {
  .logo {
    font-size: 1.12rem;
    gap: 0.5rem;
  }
  .logo-icon {
    width: 32px;
    height: 32px;
  }
  .logo-icon svg {
    width: 18px;
    height: 18px;
  }
  .header-actions {
    gap: 0.5rem;
  }
  /* On tablets and mobile phones, hide the redundant header CTA to prevent bar cramping */
  #headerCtaBtn, #headerHomeBtn {
    display: none !important;
  }
  .top-menu-btn {
    padding: 0.45rem 0.75rem;
    min-height: 38px;
    font-size: 0.85rem;
  }
  .theme-toggle {
    width: 38px;
    height: 38px;
  }
}

@media (max-width: 480px) {
  .header-inner {
    gap: 0.35rem;
  }
  .logo span {
    font-size: 1.05rem;
  }
  .logo-badge {
    display: none;
  }
  .top-menu-btn {
    width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
    justify-content: center;
  }
  .top-menu-label {
    display: none;
  }
  .theme-toggle {
    width: 38px;
    height: 38px;
  }
}

.top-menu-bars-icon {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3.5px;
  width: 16px;
  height: 14px;
}

.top-menu-bars-icon span {
  display: block;
  height: 2px;
  width: 100%;
  background-color: currentColor;
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.top-menu-wrapper.active .top-menu-bars-icon span:nth-child(1) {
  transform: translateY(5.5px) rotate(45deg);
}

.top-menu-wrapper.active .top-menu-bars-icon span:nth-child(2) {
  opacity: 0;
}

.top-menu-wrapper.active .top-menu-bars-icon span:nth-child(3) {
  transform: translateY(-5.5px) rotate(-45deg);
}

/* Backdrop for Top-Right Menu */
.top-menu-backdrop {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.top-menu-wrapper.active ~ .top-menu-backdrop,
.top-menu-wrapper.active .top-menu-backdrop,
body.top-menu-open .top-menu-backdrop {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Top-Right Side Drawer Panel - Zero leak when closed */
.top-menu-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(380px, 86vw);
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  background-color: var(--bg-card);
  border-left: 1px solid var(--border-strong);
  box-shadow: -15px 0 45px rgba(0, 0, 0, 0.7);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  transform: translateX(105%);
  visibility: hidden; /* CRITICAL: Never register horizontal width in mobile browsers when closed */
  opacity: 0;
  pointer-events: none;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease, visibility 0.28s;
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

@media (max-width: 480px) {
  .top-menu-panel {
    width: 100vw;
    border-left: none;
  }
}

.top-menu-wrapper.active ~ .top-menu-panel,
.top-menu-wrapper.active .top-menu-panel,
body.top-menu-open .top-menu-panel {
  transform: translateX(0);
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.top-menu-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
}

.top-menu-panel-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.top-menu-close-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.top-menu-close-btn:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--border-strong);
  color: var(--text-primary);
  transform: scale(1.05);
}

.top-menu-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Featured Studio Card in Menu */
.menu-featured-card {
  display: block;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(139, 92, 246, 0.18) 100%);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.menu-featured-card:hover {
  border-color: var(--brand-primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.25);
}

.menu-featured-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.5rem;
  background: var(--brand-primary);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.menu-featured-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.menu-featured-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

.menu-section {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.menu-section-heading {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border-subtle);
}

.menu-item-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.menu-item-link:hover,
.menu-item-link.active {
  background-color: var(--bg-tertiary);
  color: var(--brand-primary);
  padding-left: 0.95rem;
}

.menu-item-link.active {
  font-weight: 600;
  border-left: 3px solid var(--brand-primary);
}

.menu-item-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  background: var(--bg-secondary);
}

.menu-item-text {
  display: flex;
  flex-direction: column;
}

.menu-item-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
}

.menu-item-sub {
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.menu-tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.menu-tag-pill {
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.35rem 0.65rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.menu-tag-pill:hover {
  background: var(--bg-card-hover);
  border-color: var(--brand-primary);
  color: var(--text-primary);
}

.menu-tag-pill.highlight {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.3);
  color: #60a5fa;
  font-weight: 600;
}

.menu-panel-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.menu-footer-theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.85rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
}

.menu-footer-theme-toggle:hover {
  border-color: var(--brand-primary);
}

/* Homepage Showcase Cards Grid */
.showcase-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1.25rem;
  margin: 2.5rem 0;
}

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

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

.showcase-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all var(--transition-normal);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.showcase-card:hover {
  transform: translateY(-4px);
  border-color: var(--brand-primary);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35), 0 0 20px rgba(59, 130, 246, 0.15);
}

.showcase-vector-preview {
  width: 100%;
  height: 140px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border-subtle);
  transition: background var(--transition-fast);
}

.showcase-card:hover .showcase-vector-preview {
  background: var(--bg-primary);
}

.showcase-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.5rem;
}

.showcase-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.showcase-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.showcase-action {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--brand-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.showcase-card:hover .showcase-action {
  color: #93c5fd;
}

/* Hero Section */
.hero {
  padding-top: 3.5rem;
  padding-bottom: 4rem;
  position: relative;
  overflow: hidden;
  text-align: center;
}

@media (max-width: 640px) {
  .hero {
    padding-top: 2rem;
    padding-bottom: 2.5rem;
  }
}

.hero-glow {
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 300px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, rgba(139, 92, 246, 0.05) 50%, transparent 80%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin: 0 auto;
}

.hero-title {
  margin-top: 1rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 640px) {
  .hero-title {
    font-size: clamp(1.85rem, 7vw, 2.5rem);
    line-height: 1.18;
  }
}

.hero-desc {
  font-size: clamp(1.05rem, 1.2vw + 0.8rem, 1.25rem);
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 640px) {
  .hero-desc {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }
}

/* Quick Generator Bar on Homepage */
.quick-generator-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  max-width: 760px;
  margin: 0 auto 3rem auto;
  text-align: left;
}

.quick-inputs-row {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 640px) {
  .quick-inputs-row {
    flex-direction: row;
    align-items: center;
  }
}

.form-input, .form-select {
  width: 100%;
  padding: 0.85rem 1rem;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 16px; /* 16px prevents iOS Safari automatic page zoom */
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  min-height: 44px;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

/* Interactive Studio Layout (ai-logo-generator.html) */
.studio-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
  margin-bottom: 4rem;
}

@media (min-width: 1024px) {
  .studio-container {
    grid-template-columns: 380px 1fr;
  }
}

@media (max-width: 1023px) {
  .studio-container {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 5.5rem; /* Reserve space for sticky mobile bottom quick-bar */
  }

  .studio-stage {
    display: contents; /* Unwraps children so Canvas is placed first */
  }

  .studio-canvas-block {
    order: 1; /* LIVE CANVAS FIRST ON MOBILE */
    width: 100%;
  }

  .studio-sidebar {
    order: 2; /* STUDIO CONTROLS SECOND ON MOBILE */
    width: 100%;
    margin-top: 0.25rem;
  }

  .studio-showcase-block {
    order: 3; /* MOCKUPS & VARIATIONS THIRD ON MOBILE */
    width: 100%;
    margin-top: 1rem;
  }
}

.studio-sidebar {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (max-width: 640px) {
  .studio-sidebar {
    padding: 1.25rem 1rem;
    gap: 1.25rem;
  }
}

.studio-stage {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.studio-canvas-block {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.studio-showcase-block {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.canvas-preview-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 2.5rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 420px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: background-color var(--transition-fast);
}

@media (max-width: 768px) {
  .canvas-preview-card {
    min-height: 240px;
    max-height: 310px;
    padding: 1rem 0.75rem;
    border-radius: var(--radius-lg);
  }
}

.canvas-preview-card.bg-transparent {
  background-image: linear-gradient(45deg, #181f2c 25%, transparent 25%), linear-gradient(-45deg, #181f2c 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #181f2c 75%), linear-gradient(-45deg, transparent 75%, #181f2c 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  background-color: #0f131a;
}

.canvas-preview-card.bg-dark {
  background-color: #0a0c10;
}

.canvas-preview-card.bg-light {
  background-color: #f8fafc;
}

.canvas-preview-card.bg-gradient {
  background: radial-gradient(circle at center, #1e293b 0%, #090d16 100%);
}

#logoSvgContainer {
  width: 100%;
  max-width: 480px;
  max-height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

@media (max-width: 768px) {
  #logoSvgContainer {
    max-height: 240px;
    max-width: 100%;
  }
}

#logoSvgContainer svg {
  width: 100%;
  height: auto;
  max-height: 100%;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.15));
}

/* Canvas Controls Bar (BG Switcher + Export Actions) */
.canvas-controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.canvas-bg-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.canvas-export-group {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .canvas-controls-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .canvas-bg-group {
    display: grid;
    grid-template-columns: auto repeat(4, 1fr);
    gap: 0.35rem;
    align-items: center;
    width: 100%;
  }

  .canvas-bg-group .btn {
    padding: 0.45rem 0.3rem;
    font-size: 0.78rem;
    min-height: 38px;
    text-align: center;
    justify-content: center;
  }

  .canvas-export-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    width: 100%;
  }

  .canvas-export-group .btn {
    width: 100%;
    font-size: 0.82rem;
    padding: 0.6rem 0.5rem;
    min-height: 42px;
    justify-content: center;
  }
}

/* Control Tabs */
.control-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.75rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.control-tab {
  padding: 0.5rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  white-space: nowrap;
  min-height: 38px;
  cursor: pointer;
}

.control-tab.active {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}

/* Color Swatches */
.palette-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.palette-btn {
  height: 42px;
  min-height: 42px;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  display: flex;
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.palette-btn.active, .palette-btn:hover {
  transform: scale(1.05);
  border-color: #ffffff;
}

.palette-btn span {
  flex: 1;
  height: 100%;
}

/* Layout Options */
.layout-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
  gap: 0.45rem;
}

.layout-btn {
  padding: 0.55rem 0.35rem;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.72rem;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-secondary);
  min-height: 52px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.layout-btn.active, .layout-btn:hover {
  border-color: var(--brand-primary);
  color: var(--text-primary);
  background-color: var(--bg-card-hover);
}

@media (max-width: 640px) {
  .layout-options-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 0.35rem;
  }

  .layout-btn {
    padding: 0.45rem 0.15rem;
    font-size: 0.65rem;
    min-height: 54px;
  }

  .layout-btn span {
    font-size: 0.65rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }
}

/* Font Selector Container */
.font-tab-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.font-tab-grid .control-tab {
  flex: 1 1 calc(33.333% - 0.4rem);
  text-align: center;
  font-size: 0.75rem;
  padding: 0.45rem 0.3rem;
}

@media (max-width: 640px) {
  .font-tab-grid .control-tab {
    flex: 1 1 calc(50% - 0.35rem);
    font-size: 0.82rem;
    min-height: 44px;
    padding: 0.6rem 0.5rem;
    text-align: center;
  }
}

/* Range Sliders with Touch Optimization */
.range-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.range-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

input[type="range"] {
  accent-color: var(--brand-primary);
  width: 100%;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  height: 32px;
  background: transparent;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand-primary);
  border: 2px solid #ffffff;
  margin-top: -8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s ease, background 0.15s ease;
}

input[type="range"]:active::-webkit-slider-thumb {
  transform: scale(1.15);
  background: var(--brand-primary-hover);
}

input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
}

input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand-primary);
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* Mobile Sticky Bottom Action Bar */
.mobile-sticky-bar {
  display: none;
}

@media (max-width: 1023px) {
  .mobile-sticky-bar {
    display: flex;
    align-items: center;
    justify-content: space-around;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 950;
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-strong);
    padding: 0.5rem 0.75rem;
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .mobile-sticky-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    padding: 0.4rem 0.65rem;
    border-radius: var(--radius-md);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    min-width: 60px;
    min-height: 44px;
    transition: all var(--transition-fast);
  }

  .mobile-sticky-btn:active {
    color: var(--brand-primary);
    transform: scale(0.95);
  }

  .mobile-sticky-btn.primary {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
    color: #ffffff;
    padding: 0.45rem 0.95rem;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
  }
}

/* Mockup Previews */
.mockup-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

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

.mockup-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 140px;
  position: relative;
}

.mockup-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

.mockup-inner-preview {
  width: 100%;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Variations Grid */
.variations-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

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

.variation-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.variation-card:hover {
  border-color: var(--brand-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Deep Technical Articles & SEO Content */
.article-content {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.75;
}

.article-content h2 {
  color: var(--text-primary);
  margin-top: 2.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.article-content h3 {
  color: var(--text-primary);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.article-content p {
  margin-bottom: 1.25rem;
}

.article-content ul, .article-content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.article-content ul li {
  list-style-type: disc;
  margin-bottom: 0.5rem;
}

.article-content ol li {
  list-style-type: decimal;
  margin-bottom: 0.5rem;
}

.article-content blockquote {
  border-left: 4px solid var(--brand-primary);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background-color: var(--bg-secondary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  color: var(--text-primary);
}

/* Comparison Matrix Table */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  margin: 2rem 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background-color: var(--bg-card);
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

.comparison-table th, .comparison-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.comparison-table th {
  background-color: var(--bg-tertiary);
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text-primary);
}

.comparison-table tr:last-child td {
  border-bottom: none;
}

.comparison-table tr:hover td {
  background-color: var(--bg-card-hover);
}

/* FAQ Accordion */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-item {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.faq-item.active {
  border-color: var(--border-strong);
}

.faq-question {
  width: 100%;
  padding: 1.25rem 1.5rem;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text-primary);
}

.faq-icon {
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

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

.faq-answer {
  padding: 0 1.5rem 1.25rem 1.5rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
  display: none;
}

.faq-item.active .faq-answer {
  display: block;
}

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.breadcrumbs a:hover {
  color: var(--brand-primary);
}

.breadcrumb-separator {
  color: var(--border-strong);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toastSlideIn {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Footer */
.footer {
  margin-top: auto;
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  padding: 4rem 0 2rem 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  margin-bottom: 3rem;
}

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

@media (min-width: 1024px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }
}

.footer-heading {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-link {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.footer-link:hover {
  color: var(--brand-primary);
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
}

@media (min-width: 640px) {
  .footer-bottom {
    flex-direction: row;
  }
}

/* Print Styles */
@media print {
  .header, .footer, .studio-sidebar, .btn, .theme-toggle {
    display: none !important;
  }
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .canvas-preview-card {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
  }
}
