/* ======================================
   COSMIC TOOLBOX - Redesigned UI System
   Organic · Asymmetrical · Immersive
   ====================================== */

/* ===== Design Variables ===== */
:root {
  /* Backgrounds - Lightened */
  --space-black: #0e0e1e;
  --space-deep: #151530;
  --space-mid: #1c1c3a;
  --space-card: rgba(28, 28, 58, 0.55);

  /* Cosmic Accents */
  --neon-cyan: #00e5ff;
  --neon-pink: #ff3d9a;
  --neon-purple: #b366ff;
  --neon-amber: #fbbf24;
  --neon-teal: #34d399;
  --neon-red: #ff4d4d;

  /* Gradients */
  --gradient-cosmic: linear-gradient(135deg, #00e5ff, #b366ff, #ff3d9a);
  --gradient-fire: linear-gradient(135deg, #ff3d9a, #fbbf24);
  --gradient-ocean: linear-gradient(135deg, #00e5ff, #34d399);
  --gradient-deep: linear-gradient(135deg, #b366ff, #34d399);
  --gradient-card-1: linear-gradient(135deg, rgba(0, 229, 255, 0.2), rgba(179, 102, 255, 0.12));
  --gradient-card-2: linear-gradient(135deg, rgba(255, 61, 154, 0.2), rgba(251, 191, 36, 0.1));
  --gradient-card-3: linear-gradient(135deg, rgba(52, 211, 153, 0.2), rgba(0, 229, 255, 0.12));

  /* Glass */
  --glass-bg: rgba(21, 21, 48, 0.55);
  --glass-border: rgba(255, 255, 255, 0.10);
  --glass-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);

  /* Text */
  --text-primary: #f5f5ff;
  --text-secondary: rgba(245, 245, 255, 0.78);
  --text-muted: rgba(245, 245, 255, 0.48);

  /* Typography */
  --font-display: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'JetBrains Mono', monospace;

  /* Sizes */
  --size-1: 0.25rem;
  --size-2: 0.5rem;
  --size-3: 0.75rem;
  --size-4: 1rem;
  --size-5: 1.25rem;
  --size-6: 1.5rem;
  --size-8: 2rem;
  --size-10: 2.5rem;
  --size-12: 3rem;
  --size-16: 4rem;
  --size-20: 5rem;
  --size-24: 6rem;

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-round: 50%;
  --radius-blob: 40% 60% 60% 40% / 60% 30% 70% 40%;
}

/* ===== Reset ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--space-black);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== Cosmic Background ===== */
.cosmic-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 15% 20%, rgba(0, 229, 255, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 85% 80%, rgba(179, 102, 255, 0.07) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 50% 50%, rgba(255, 61, 154, 0.04) 0%, transparent 50%);
}

/* Stars */
.stars {
  position: absolute;
  inset: 0;
}
.star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: white;
  border-radius: 50%;
  animation: twinkle var(--duration, 3s) ease-in-out infinite alternate;
  opacity: 0.5;
}
@keyframes twinkle {
  0% { opacity: 0.3; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1.3); }
}

/* Floating Orbs */
.orb {
  position: absolute;
  border-radius: var(--radius-round);
  filter: blur(80px);
  opacity: 0.45;
  animation: orbDrift 20s ease-in-out infinite;
}
.orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.20), transparent);
  top: -10%; left: -5%;
  animation-delay: 0s;
}
.orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(179, 102, 255, 0.16), transparent);
  bottom: -5%; right: -5%;
  animation-delay: -7s;
}
.orb-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(255, 61, 154, 0.14), transparent);
  top: 40%; left: 50%;
  animation-delay: -14s;
}
@keyframes orbDrift {
  0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
  25% { transform: translate(30px, -40px) rotate(5deg) scale(1.05); }
  50% { transform: translate(-20px, 20px) rotate(-3deg) scale(0.95); }
  75% { transform: translate(40px, 30px) rotate(4deg) scale(1.02); }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* ===== Header ===== */
.header {
  position: fixed;
  top: 0;
  left: 0; right: 0;
  z-index: 100;
  padding: var(--size-4) var(--size-8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.4s ease;
}
.header.scrolled {
  background: rgba(14, 14, 30, 0.85);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: var(--size-3) var(--size-8);
}

.header-logo {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  position: relative;
  text-decoration: none;
  color: white;
}
.header-logo span {
  background: var(--gradient-cosmic);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.header-logo::after {
  content: '✦';
  font-size: 0.5rem;
  position: absolute;
  top: -4px;
  right: -12px;
  color: var(--neon-pink);
  -webkit-text-fill-color: var(--neon-pink);
  animation: sparkle 2s ease-in-out infinite;
}
@keyframes sparkle {
  0%, 100% { opacity: 1; transform: scale(1) rotate(0deg); }
  50% { opacity: 0.3; transform: scale(1.3) rotate(180deg); }
}

.header-nav {
  display: flex;
  align-items: center;
  gap: var(--size-2);
}
.header-nav a {
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.3px;
  padding: var(--size-2) var(--size-4);
  border-radius: var(--radius-sm);
  transition: all 0.3s ease;
  text-decoration: none;
  position: relative;
}
.header-nav a::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-sm);
  background: var(--gradient-cosmic);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}
.header-nav a:hover::before,
.header-nav a.active::before { opacity: 0.12; }
.header-nav a:hover,
.header-nav a.active { color: white; }

/* Nav close button - desktop hidden */
.nav-close { display: none; }

/* Mobile menu */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: var(--size-2);
  z-index: 101;
}
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}
.overlay.show { display: block; }

/* ===== Hero ===== */
.hero {
  min-height: 90vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: var(--size-16);
  padding: var(--size-24) var(--size-8) var(--size-16);
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
}

.hero-content { position: relative; z-index: 2; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--size-2);
  padding: var(--size-1) var(--size-4);
  background: rgba(0, 240, 255, 0.06);
  border: 1px solid rgba(0, 240, 255, 0.12);
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  color: var(--neon-cyan);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: var(--size-6);
  font-family: var(--font-mono);
}
.hero-badge .pulse-dot {
  width: 5px; height: 5px;
  background: var(--neon-cyan);
  border-radius: 50%;
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(0,240,255,0.4); }
  50% { opacity: 0.5; box-shadow: 0 0 0 6px rgba(0,240,255,0); }
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: var(--size-6);
}
.hero h1 .gradient-text {
  background: var(--gradient-cosmic);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
}
.hero h1 .gradient-text::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 0; right: 0;
  height: 4px;
  background: var(--gradient-cosmic);
  border-radius: 2px;
  opacity: 0.3;
}

.hero p {
  font-size: var(--size-5);
  color: var(--text-secondary);
  max-width: 480px;
  line-height: 1.7;
  margin-bottom: var(--size-8);
}

.hero-cta { display: flex; gap: var(--size-4); flex-wrap: wrap; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--size-2);
  padding: 0.75rem 1.8rem;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-family: inherit;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.08);
  transform: translateY(100%);
  transition: transform 0.3s ease;
}
.btn:hover::after { transform: translateY(0); }

.btn-primary {
  background: var(--gradient-cosmic);
  color: white;
  box-shadow: 0 8px 32px rgba(0, 240, 255, 0.2);
}
.btn-primary:hover {
  transform: scale(1.04) translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 240, 255, 0.3);
}

.btn-secondary {
  background: var(--glass-bg);
  color: white;
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.05);
  transform: scale(1.04) translateY(-2px);
  border-color: rgba(255,255,255,0.12);
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

/* Hero Visual */
.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.hero-blob {
  width: 400px;
  height: 400px;
  background: var(--gradient-cosmic);
  border-radius: var(--radius-blob);
  animation: blobMorph 12s ease-in-out infinite;
  filter: blur(4px);
  opacity: 0.6;
}
.hero-blob-2 {
  position: absolute;
  width: 300px;
  height: 300px;
  background: var(--gradient-fire);
  border-radius: var(--radius-blob);
  animation: blobMorph 12s ease-in-out infinite reverse;
  filter: blur(4px);
  opacity: 0.5;
  animation-delay: -4s;
}
.hero-ring {
  position: absolute;
  width: 500px;
  height: 500px;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 50%;
  animation: ringPulse 8s ease-in-out infinite;
}
.hero-ring-2 {
  width: 350px;
  height: 350px;
  animation-delay: -2s;
  border-color: rgba(179, 102, 255, 0.06);
}
@keyframes blobMorph {
  0%, 100% { border-radius: 40% 60% 60% 40% / 60% 30% 70% 40%; }
  25% { border-radius: 60% 40% 30% 70% / 50% 60% 40% 50%; }
  50% { border-radius: 30% 70% 50% 50% / 40% 50% 60% 60%; }
  75% { border-radius: 70% 30% 60% 40% / 30% 60% 40% 70%; }
}
@keyframes ringPulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.08); opacity: 1; }
}

/* ===== Section ===== */
.section {
  padding: var(--size-20) var(--size-8);
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
}
.section-header {
  margin-bottom: var(--size-12);
}
.section-header .section-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--neon-cyan);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: var(--size-3);
  display: flex;
  align-items: center;
  gap: var(--size-2);
}
.section-tag .line {
  width: 30px;
  height: 1px;
  background: rgba(0, 240, 255, 0.3);
}
.section-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  max-width: 600px;
}
.section-header h2 .gradient-text {
  background: var(--gradient-cosmic);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.section-header p {
  color: var(--text-secondary);
  max-width: 450px;
  margin-top: var(--size-4);
}

/* ===== Bento Grid ===== */
.bento-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: auto;
  gap: var(--size-5);
}

.bento-card {
  position: relative;
  border-radius: var(--radius-lg);
  padding: var(--size-8) var(--size-6);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px);
  background: var(--glass-bg);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  cursor: pointer;
  --card-accent: var(--neon-cyan);
  --card-gradient: var(--gradient-card-1);
}
.bento-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--card-gradient);
  opacity: 0;
  transition: opacity 0.5s ease;
  border-radius: inherit;
}
.bento-card:hover::before { opacity: 1; }

.bento-card::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: calc(var(--radius-lg) + 2px);
  background: conic-gradient(
    from var(--angle, 0deg),
    transparent,
    var(--card-accent),
    transparent 50%,
    var(--card-accent),
    transparent
  );
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: -1;
  animation: rotateBorder 4s linear infinite;
}
.bento-card:hover::after { opacity: 0.6; }
@property --angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}
@keyframes rotateBorder {
  to { --angle: 360deg; }
}

/* Card specific accents */
.bento-card:nth-child(1) { --card-accent: var(--neon-cyan); --card-gradient: var(--gradient-card-1); }
.bento-card:nth-child(2) { --card-accent: var(--neon-pink); --card-gradient: var(--gradient-card-2); }
.bento-card:nth-child(3) { --card-accent: var(--neon-teal); --card-gradient: var(--gradient-card-3); }

/* Card sizes in bento */
.bento-card.chat-card {
  grid-column: 1 / 2;
  grid-row: 1 / 3;
  min-height: 340px;
}
.bento-card.image-card {
  grid-column: 2 / 4;
  grid-row: 1 / 2;
}
.bento-card.enhance-card {
  grid-column: 2 / 3;
  grid-row: 2 / 3;
}
.bento-card.stats-card {
  grid-column: 3 / 4;
  grid-row: 2 / 3;
  cursor: default;
}

.bento-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: var(--size-4);
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.04);
  position: relative;
  z-index: 1;
  transition: transform 0.3s ease;
}
.bento-card:hover .bento-icon {
  transform: scale(1.1) rotate(-5deg);
}

.bento-card h3 {
  font-family: var(--font-display);
  font-size: var(--size-6);
  font-weight: 700;
  margin-bottom: var(--size-2);
  position: relative;
  z-index: 1;
}
.bento-card p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.7;
  flex: 1;
  position: relative;
  z-index: 1;
}
.bento-arrow {
  display: flex;
  align-items: center;
  gap: var(--size-2);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--card-accent);
  margin-top: var(--size-4);
  transition: gap 0.3s ease;
  position: relative;
  z-index: 1;
}
.bento-card:hover .bento-arrow { gap: var(--size-4); }

/* Stats card */
.stat-number {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  background: var(--gradient-cosmic);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  z-index: 1;
}
.stat-label {
  color: var(--text-muted);
  font-size: 0.8rem;
  position: relative;
  z-index: 1;
}

/* ===== Tool Page Layout ===== */
.page-header {
  padding: 8rem var(--size-8) var(--size-8);
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
}
.page-header h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.page-header h1 .gradient-text {
  background: var(--gradient-cosmic);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.page-header p {
  color: var(--text-secondary);
  font-size: var(--size-5);
  max-width: 500px;
  margin-top: var(--size-2);
}

.tool-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 var(--size-8) var(--size-20);
  position: relative;
  z-index: 1;
}
.tool-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--size-8);
  backdrop-filter: blur(16px);
  box-shadow: var(--glass-shadow);
}
.tool-input-area { display: flex; flex-direction: column; gap: var(--size-4); }

.tool-input-area textarea,
.tool-input-area input[type="text"],
.chat-input-row input,
.prompt-row input {
  width: 100%;
  padding: var(--size-4) var(--size-5);
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: white;
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
  transition: all 0.3s ease;
  outline: none;
}
.tool-input-area textarea:focus,
.tool-input-area input:focus,
.chat-input-row input:focus {
  border-color: rgba(0, 240, 255, 0.3);
  box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.06);
}
.tool-input-area textarea::placeholder,
.tool-input-area input::placeholder { color: var(--text-muted); }

.tool-options {
  display: flex;
  gap: var(--size-2);
  flex-wrap: wrap;
}
.option-btn {
  padding: var(--size-2) var(--size-4);
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}
.option-btn:hover {
  border-color: rgba(255,255,255,0.15);
  color: white;
}
.option-btn.active {
  background: rgba(0, 240, 255, 0.08);
  border-color: rgba(0, 240, 255, 0.2);
  color: var(--neon-cyan);
}

/* ===== Chat ===== */
.chat-messages {
  height: 380px;
  overflow-y: auto;
  padding: var(--size-4);
  margin-bottom: var(--size-4);
  display: flex;
  flex-direction: column;
  gap: var(--size-4);
  scroll-behavior: smooth;
}
.chat-message {
  display: flex;
  gap: var(--size-3);
  max-width: 88%;
  animation: messageIn 0.3s ease;
}
@keyframes messageIn {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.chat-message.user { align-self: flex-end; flex-direction: row-reverse; }
.chat-message.assistant { align-self: flex-start; }
.chat-message .avatar {
  width: 30px; height: 30px;
  border-radius: var(--radius-round);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem;
  flex-shrink: 0;
  font-weight: 700;
}
.chat-message.user .avatar { background: var(--gradient-cosmic); color: white; }
.chat-message.assistant .avatar { background: rgba(168, 85, 247, 0.2); color: var(--neon-purple); }
.chat-message .bubble {
  padding: var(--size-3) var(--size-4);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}
.chat-message.user .bubble {
  background: var(--gradient-cosmic);
  color: white;
  border-bottom-right-radius: var(--size-1);
}
.chat-message.assistant .bubble {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  border-bottom-left-radius: var(--size-1);
}

.chat-input-row {
  display: flex;
  gap: var(--size-3);
}
.chat-input-row input { flex: 1; }

/* ===== Image ===== */
.image-prompt-input {
  display: flex;
  gap: var(--size-3);
}
.image-prompt-input input { flex: 1; }
.image-result {
  margin-top: var(--size-6);
  text-align: center;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.image-result img {
  max-width: 100%;
  max-height: 500px;
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
}

/* ===== Enhance ===== */
.enhance-result {
  margin-top: var(--size-6);
  padding: var(--size-6);
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  white-space: pre-wrap;
  line-height: 1.8;
  font-size: 0.85rem;
  min-height: 80px;
  position: relative;
}
.word-count {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-align: right;
  font-family: var(--font-mono);
}

/* ===== Spinner ===== */
.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: var(--neon-cyan);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner-lg { width: 36px; height: 36px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Content Pages (About, Contact, Legal) ===== */
.content-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 var(--size-8) var(--size-20);
  position: relative;
  z-index: 1;
}

.about-card, .legal-section {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--size-8);
  margin-bottom: var(--size-6);
  backdrop-filter: blur(12px);
  transition: all 0.3s ease;
}
.about-card:hover {
  border-color: rgba(0, 240, 255, 0.1);
  box-shadow: 0 8px 30px rgba(0, 240, 255, 0.03);
}
.about-card .emoji { font-size: 1.8rem; display: block; margin-bottom: var(--size-4); }
.about-card h3 {
  font-family: var(--font-display);
  font-size: var(--size-6);
  font-weight: 700;
  margin-bottom: var(--size-4);
  background: var(--gradient-cosmic);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}
.about-card p, .legal-section p {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: var(--size-4);
}
.about-card p:last-child, .legal-section p:last-child { margin-bottom: 0; }

/* Contact */
.contact-card {
  text-align: center;
  padding: var(--size-12) var(--size-8);
}
.contact-card .contact-icon { font-size: 2.5rem; display: block; margin-bottom: var(--size-4); }
.contact-card h2 {
  font-family: var(--font-display);
  font-size: var(--size-8);
  font-weight: 700;
  margin-bottom: var(--size-3);
}
.contact-card p {
  color: var(--text-secondary);
  margin-bottom: var(--size-6);
}
.contact-email {
  display: inline-flex;
  align-items: center;
  gap: var(--size-3);
  padding: var(--size-4) var(--size-6);
  background: rgba(0, 240, 255, 0.04);
  border: 1px solid rgba(0, 240, 255, 0.1);
  border-radius: var(--radius-md);
  color: var(--neon-cyan);
  font-size: var(--size-5);
  font-weight: 600;
  font-family: var(--font-mono);
  word-break: break-all;
}

/* Legal */
.legal-section { cursor: default; }
.legal-section h2 {
  font-family: var(--font-display);
  font-size: var(--size-5);
  font-weight: 700;
  margin-bottom: var(--size-4);
  padding-bottom: var(--size-3);
  border-bottom: 1px solid var(--glass-border);
  color: var(--neon-cyan);
}
.legal-section h3 {
  font-size: var(--size-4);
  font-weight: 600;
  margin-bottom: var(--size-2);
  margin-top: var(--size-5);
  color: var(--text-primary);
}
.legal-section ul, .legal-section ol {
  color: var(--text-secondary);
  margin: var(--size-4) 0;
  padding-left: var(--size-6);
  line-height: 1.8;
}
.legal-section li { margin-bottom: var(--size-2); }
.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--size-5) 0;
  font-size: 0.8rem;
}
.legal-table th, .legal-table td {
  border: 1px solid var(--glass-border);
  padding: var(--size-3) var(--size-4);
  text-align: left;
}
.legal-table th {
  background: rgba(0, 240, 255, 0.04);
  color: var(--neon-cyan);
  font-weight: 600;
}
.legal-table td { color: var(--text-secondary); }
.last-updated {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: var(--size-8);
}

/* ===== Footer ===== */
.footer {
  position: relative;
  z-index: 1;
  padding: var(--size-12) var(--size-8) var(--size-8);
  text-align: center;
  border-top: 1px solid var(--glass-border);
  margin-top: var(--size-8);
}

/* Footer decorative wave */
.footer-wave {
  position: absolute;
  top: -1px;
  left: 0; right: 0;
  height: 40px;
  overflow: hidden;
  pointer-events: none;
}
.footer-wave svg {
  width: 100%;
  height: 100%;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: var(--size-8);
  margin-bottom: var(--size-6);
  flex-wrap: wrap;
}
.footer-links a {
  color: var(--text-muted);
  font-size: 0.8rem;
  transition: all 0.3s ease;
  text-decoration: none;
}
.footer-links a:hover { color: var(--neon-cyan); }
.footer-copyright {
  color: var(--text-muted);
  font-size: 0.7rem;
  font-family: var(--font-mono);
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: var(--size-6);
  right: var(--size-6);
  padding: var(--size-3) var(--size-6);
  border-radius: var(--radius-md);
  color: white;
  font-size: 0.85rem;
  z-index: 1000;
  animation: toastIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  backdrop-filter: blur(20px);
}
.toast.error {
  background: rgba(255, 45, 149, 0.15);
  border: 1px solid rgba(255, 45, 149, 0.2);
  color: #ff8abf;
}
.toast.success {
  background: rgba(45, 212, 191, 0.15);
  border: 1px solid rgba(45, 212, 191, 0.2);
  color: #5eead4;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(20px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== Mobile-First Responsive ===== */

/* Tablet & below */
@media (max-width: 900px) {
  /* --- Header & Nav --- */
  .header {
    padding: var(--size-3) var(--size-5);
  }
  .header.scrolled {
    padding: var(--size-2) var(--size-5);
  }

  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
  }
  .menu-toggle:active {
    background: rgba(255,255,255,0.08);
  }

  .header-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 320px;
    height: 100vh;
    flex-direction: column;
    background: rgba(20, 20, 48, 0.97);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-left: 1px solid rgba(255,255,255,0.08);
    padding: 5rem 1.5rem 2rem;
    gap: 0.25rem;
    transition: right 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 100;
    box-shadow: -10px 0 40px rgba(0,0,0,0.4);
  }
  .header-nav.open { right: 0; }

  .nav-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,0.7);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
  }
  .nav-close:active {
    background: rgba(255,255,255,0.1);
    color: white;
  }

  .header-nav a {
    font-size: 1.05rem;
    width: 100%;
    padding: 0.9rem 1rem;
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,0.75);
    font-weight: 500;
    letter-spacing: 0.3px;
    transition: all 0.2s ease;
  }
  .header-nav a::before { display: none; }
  .header-nav a:active,
  .header-nav a.active {
    background: rgba(0, 229, 255, 0.1);
    color: #ffffff;
    border-left: 3px solid var(--neon-cyan);
  }
  .header-nav a:hover {
    background: rgba(255,255,255,0.05);
    color: #ffffff;
  }

  .overlay {
    background: rgba(0, 0, 0, 0.6);
  }

  /* --- Hero --- */
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--size-6);
    padding: 6rem 1.25rem 3rem;
    min-height: auto;
  }
  .hero h1 {
    font-size: clamp(2rem, 8vw, 2.8rem);
  }
  .hero h1 .gradient-text::after { display: none; }
  .hero p {
    font-size: 1rem;
    margin: 0 auto 1.5rem;
    max-width: 100%;
  }
  .hero-cta {
    justify-content: center;
    flex-direction: column;
    align-items: stretch;
  }
  .hero-cta .btn {
    justify-content: center;
    padding: 0.85rem 1.5rem;
    font-size: 0.95rem;
  }
  .hero-visual { display: none; }
  .hero-badge {
    font-size: 0.65rem;
    padding: 0.2rem 0.8rem;
  }

  /* --- Bento Grid --- */
  .bento-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .bento-card.chat-card,
  .bento-card.image-card,
  .bento-card.enhance-card,
  .bento-card.stats-card {
    grid-column: 1;
    grid-row: auto;
    min-height: auto;
    padding: 1.5rem 1.25rem;
  }
  .bento-card:hover::after { opacity: 0; } /* No animated border on mobile */
  .bento-card::after { display: none; }
  .bento-card h3 {
    font-size: 1.25rem;
  }
  .bento-card p {
    font-size: 0.9rem;
    line-height: 1.65;
  }
  .bento-icon {
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
  }
  .bento-arrow {
    font-size: 0.85rem;
    margin-top: 0.75rem;
  }
  .stat-number {
    font-size: 2rem;
  }

  /* --- Sections --- */
  .section {
    padding: 3rem 1.25rem;
  }
  .section-header {
    margin-bottom: 2rem;
  }
  .section-header h2 {
    font-size: 1.6rem;
    max-width: 100%;
  }
  .section-header p {
    font-size: 0.9rem;
    max-width: 100%;
  }
  .section-tag {
    font-size: 0.65rem;
  }

  /* --- Page Header --- */
  .page-header {
    padding: 5.5rem 1.25rem 1.5rem;
  }
  .page-header h1 {
    font-size: 1.8rem;
  }
  .page-header p {
    font-size: 0.95rem;
    max-width: 100%;
  }

  /* --- Tool Pages --- */
  .tool-container {
    padding: 0 1.25rem 3rem;
  }
  .tool-panel {
    padding: 1.25rem;
    border-radius: var(--radius-md);
  }

  .tool-input-area textarea,
  .tool-input-area input[type="text"],
  .chat-input-row input {
    font-size: 1rem;
    padding: 0.85rem 1rem;
    min-height: 48px;
  }

  .tool-options {
    gap: 0.4rem;
  }
  .option-btn {
    padding: 0.5rem 0.9rem;
    font-size: 0.8rem;
    min-height: 38px;
  }

  .enhance-btn.btn {
    padding: 0.9rem 1.5rem;
    font-size: 0.95rem;
    min-height: 48px;
  }

  /* --- Chat --- */
  .chat-messages {
    height: 320px;
    padding: 0.75rem;
    gap: 0.75rem;
  }
  .chat-message {
    max-width: 98%;
    gap: 0.5rem;
  }
  .chat-message .bubble {
    font-size: 0.9rem;
    padding: 0.65rem 0.85rem;
    line-height: 1.6;
  }
  .chat-message .avatar {
    width: 28px;
    height: 28px;
    font-size: 0.65rem;
  }
  .chat-input-row {
    gap: 0.5rem;
  }
  .chat-input-row .btn {
    min-height: 48px;
    min-width: 60px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }

  /* --- Image --- */
  .image-prompt-input {
    flex-direction: column;
    gap: 0.5rem;
  }
  .image-prompt-input .btn {
    min-height: 48px;
    font-size: 0.95rem;
  }
  .image-result {
    min-height: 150px;
  }
  .image-result img {
    max-height: 350px;
  }

  /* --- Enhance --- */
  .enhance-result {
    font-size: 0.9rem;
    padding: 1rem;
    line-height: 1.7;
  }

  /* --- Content Pages (About, Contact, Legal) --- */
  .content-container {
    padding: 0 1.25rem 3rem;
  }
  .about-card, .legal-section {
    padding: 1.5rem 1.25rem;
    margin-bottom: 1rem;
    border-radius: var(--radius-md);
  }
  .about-card .emoji {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
  }
  .about-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
  }
  .about-card p, .legal-section p {
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 0.75rem;
    color: rgba(255,255,255,0.8);
  }

  /* Contact */
  .contact-card {
    padding: 2rem 1.25rem;
  }
  .contact-card h2 {
    font-size: 1.5rem;
  }
  .contact-email {
    font-size: 1rem;
    padding: 0.75rem 1.25rem;
    word-break: break-all;
    width: 100%;
    justify-content: center;
  }

  /* Legal */
  .legal-section h2 {
    font-size: 1.05rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
  }
  .legal-section h3 {
    font-size: 0.95rem;
    margin-top: 1rem;
  }
  .legal-section ul, .legal-section ol {
    font-size: 0.9rem;
    padding-left: 1.25rem;
    margin: 0.75rem 0;
    color: rgba(255,255,255,0.8);
  }
  .legal-section li {
    margin-bottom: 0.5rem;
  }
  .legal-table {
    font-size: 0.7rem;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .legal-table th,
  .legal-table td {
    padding: 0.4rem 0.5rem;
    min-width: 100px;
  }

  /* --- Footer --- */
  .footer {
    padding: 2rem 1.25rem 1.5rem;
  }
  .footer-links {
    gap: 0.75rem;
    flex-direction: column;
  }
  .footer-links a {
    font-size: 0.9rem;
    padding: 0.4rem 0;
    color: rgba(255,255,255,0.6);
  }
  .footer-links a:hover {
    color: var(--neon-cyan);
  }
  .footer-copyright {
    font-size: 0.75rem;
  }
}

/* Small phones */
@media (max-width: 480px) {
  .header {
    padding: 0.6rem 1rem;
  }
  .header.scrolled {
    padding: 0.5rem 1rem;
  }
  .header-logo {
    font-size: 1.2rem;
  }
  .header-logo::after {
    display: none;
  }

  .hero {
    padding: 5rem 1rem 2rem;
  }
  .hero h1 {
    font-size: 1.7rem;
  }

  .section {
    padding: 2.5rem 1rem;
  }

  .page-header {
    padding: 5rem 1rem 1.25rem;
  }
  .page-header h1 {
    font-size: 1.6rem;
  }

  .tool-container {
    padding: 0 1rem 2.5rem;
  }
  .tool-panel {
    padding: 1rem;
    border-radius: 12px;
  }

  .chat-messages {
    height: 280px;
  }

  .content-container {
    padding: 0 1rem 2.5rem;
  }
  .about-card, .legal-section {
    padding: 1.25rem 1rem;
  }

  .contact-card {
    padding: 1.5rem 1rem;
  }
  .contact-email {
    font-size: 0.9rem;
    padding: 0.65rem 1rem;
  }

  .bento-card {
    padding: 1.25rem 1rem !important;
  }

  .footer {
    padding: 1.5rem 1rem 1.25rem;
  }
  .footer-links a {
    font-size: 0.85rem;
  }
}

/* Landscape phones */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    padding: 4rem 1rem 1.5rem;
    min-height: auto;
  }
  .hero h1 {
    font-size: 1.5rem;
  }
  .header-nav {
    padding-top: 3.5rem;
    overflow-y: auto;
  }
  .header-nav a {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
  }
}

/* ===== Blog Page ===== */
.blog-search {
  margin-bottom: var(--size-8);
}
.blog-search input {
  width: 100%;
  max-width: 500px;
  padding: 0.85rem 1.2rem;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: white;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.3s ease;
}
.blog-search input:focus {
  border-color: rgba(0, 229, 255, 0.3);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.06);
}
.blog-search input::placeholder { color: var(--text-muted); }

.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--size-5);
  margin-bottom: var(--size-8);
}
.article-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(12px);
}
.article-card:hover {
  border-color: rgba(0, 229, 255, 0.15);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}
.article-cover {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  position: relative;
  overflow: hidden;
}
.article-body {
  padding: var(--size-5);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--size-2);
}
.article-body .article-category {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--neon-cyan);
  letter-spacing: 1px;
  text-transform: uppercase;
}
.article-body h3 {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-primary);
}
.article-body .article-excerpt {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-meta {
  display: flex;
  gap: var(--size-3);
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: auto;
  padding-top: var(--size-3);
  border-top: 1px solid var(--glass-border);
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--size-2);
  margin-top: var(--size-8);
}
.pagination .page-btn {
  min-width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  background: var(--glass-bg);
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}
.pagination .page-btn:hover {
  border-color: rgba(0, 229, 255, 0.2);
  color: white;
}
.pagination .page-btn.active {
  background: rgba(0, 229, 255, 0.1);
  border-color: rgba(0, 229, 255, 0.25);
  color: var(--neon-cyan);
}
.pagination .page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ===== Article Detail ===== */
.article-detail-header {
  margin-bottom: var(--size-8);
}
.article-detail-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: var(--size-4);
}
.article-detail-meta {
  display: flex;
  gap: var(--size-4);
  color: var(--text-muted);
  font-size: 0.82rem;
  flex-wrap: wrap;
}
.article-detail-meta span {
  display: flex;
  align-items: center;
  gap: var(--size-1);
}

.article-content {
  line-height: 1.9;
  font-size: 0.95rem;
  color: var(--text-secondary);
}
.article-content h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  margin: var(--size-8) 0 var(--size-4);
  color: var(--text-primary);
}
.article-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: var(--size-6) 0 var(--size-3);
  color: var(--text-primary);
}
.article-content p {
  margin-bottom: var(--size-4);
}
.article-content ul, .article-content ol {
  margin: var(--size-4) 0;
  padding-left: var(--size-6);
}
.article-content li {
  margin-bottom: var(--size-2);
}
.article-content blockquote {
  border-left: 3px solid var(--neon-cyan);
  padding: var(--size-4) var(--size-6);
  margin: var(--size-6) 0;
  background: rgba(0, 229, 255, 0.03);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: rgba(255,255,255,0.75);
}
.article-content strong {
  color: var(--text-primary);
}
.article-content code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  padding: 0.15em 0.4em;
  background: rgba(255,255,255,0.05);
  border-radius: 3px;
}
.article-back {
  display: inline-flex;
  align-items: center;
  gap: var(--size-2);
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: var(--size-8);
  padding: var(--size-3) var(--size-4);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all 0.2s ease;
}
.article-back:hover {
  color: var(--neon-cyan);
  border-color: rgba(0, 229, 255, 0.2);
}

/* Article content table mobile scroll */
#articleContent table,
.article-content table {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  white-space: normal;
}
#articleContent table th,
#articleContent table td,
.article-content table th,
.article-content table td {
  white-space: nowrap;
  min-width: 120px;
}
@media (max-width: 600px) {
  #articleContent table th,
  #articleContent table td,
  .article-content table th,
  .article-content table td {
    padding: 0.5rem 0.6rem;
    font-size: 0.8rem;
    min-width: 100px;
  }
}

/* ===== Info Panels (Tool Pages: How to Use, FAQ, About) ===== */
.info-panel {
  margin-top: var(--size-8);
  border-color: rgba(255,255,255,0.04) !important;
  position: relative;
  overflow: hidden;
}

/* Subtle decorative accent line at top */
.info-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: var(--size-6);
  right: var(--size-6);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.15), transparent);
}

/* Inner content width constraint - prevent too-wide text on desktop */
.info-panel .info-body {
  max-width: 680px;
  margin: 0 auto;
}

.info-panel .info-header {
  display: flex;
  align-items: center;
  gap: var(--size-3);
  margin-bottom: var(--size-6);
  padding-bottom: var(--size-4);
  border-bottom: 1px solid var(--glass-border);
}
.info-panel .info-header .info-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.info-panel .info-header .info-icon.howto { background: rgba(0, 229, 255, 0.1); color: var(--neon-cyan); }
.info-panel .info-header .info-icon.faq { background: rgba(179, 102, 255, 0.1); color: var(--neon-purple); }
.info-panel .info-header .info-icon.about { background: rgba(52, 211, 153, 0.1); color: var(--neon-teal); }

.info-panel .info-header h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
}

/* ===== Steps List (How to Use) ===== */
.steps-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--size-4);
}
.steps-list li {
  display: flex;
  gap: var(--size-4);
  align-items: flex-start;
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.65;
  padding: var(--size-3) var(--size-4);
  background: rgba(255,255,255,0.015);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.03);
  transition: all 0.2s ease;
}
.steps-list li:hover {
  background: rgba(255,255,255,0.03);
  border-color: rgba(255,255,255,0.06);
}
.steps-list li .step-num {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-round);
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.12);
  color: var(--neon-cyan);
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  font-family: var(--font-mono);
}
.steps-list li strong {
  color: var(--text-primary);
}

/* ===== FAQ Accordion ===== */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--size-3);
}
.faq-list details {
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.2s ease;
  background: rgba(255,255,255,0.01);
}
.faq-list details:hover {
  border-color: rgba(255,255,255,0.08);
}
.faq-list details[open] {
  border-color: rgba(179, 102, 255, 0.15);
  background: rgba(179, 102, 255, 0.02);
}
.faq-list summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 600;
  padding: var(--size-3) var(--size-4);
  list-style: none;
  user-select: none;
  transition: color 0.2s ease;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: '+';
  font-size: 1rem;
  color: var(--neon-purple);
  transition: transform 0.3s ease, color 0.2s ease;
  flex-shrink: 0;
  margin-left: var(--size-3);
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-round);
  background: rgba(179, 102, 255, 0.06);
}
.faq-list details[open] summary::after {
  content: '−';
  background: rgba(179, 102, 255, 0.12);
}
.faq-list details[open] summary {
  color: var(--neon-purple);
  border-bottom: 1px solid rgba(179, 102, 255, 0.08);
  padding-bottom: var(--size-3);
}
.faq-list .faq-answer {
  padding: var(--size-3) var(--size-4) var(--size-4);
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.75;
}

/* ===== About Tool Text ===== */
.about-tool {
  position: relative;
}
.about-tool::before {
  content: '"';
  position: absolute;
  top: -0.5rem;
  left: -0.25rem;
  font-size: 4rem;
  line-height: 1;
  color: rgba(52, 211, 153, 0.08);
  font-family: var(--font-display);
  pointer-events: none;
}
.about-tool p {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.85;
  margin-bottom: var(--size-4);
  position: relative;
  z-index: 1;
}
.about-tool p:last-child { margin-bottom: 0; }
.about-tool p strong {
  color: var(--neon-teal);
  font-weight: 600;
}

/* ===== Homepage New Sections ===== */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--size-5);
}
.step-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--size-6);
  text-align: center;
  backdrop-filter: blur(12px);
  position: relative;
  transition: all 0.3s ease;
}
.step-card:hover {
  border-color: rgba(0, 229, 255, 0.1);
  transform: translateY(-3px);
}
.step-number {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  opacity: 0.08;
  position: absolute;
  top: var(--size-3);
  right: var(--size-4);
  color: var(--neon-cyan);
  line-height: 1;
}
.step-card .step-icon {
  font-size: 2rem;
  margin-bottom: var(--size-4);
  display: block;
}
.step-card h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: var(--size-2);
}
.step-card p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.6;
}

.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--size-5);
}
.testimonial-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--size-6);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: var(--size-4);
}
.testimonial-card .quote {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.7;
  font-style: italic;
  flex: 1;
}
.testimonial-card .author {
  display: flex;
  align-items: center;
  gap: var(--size-3);
  padding-top: var(--size-4);
  border-top: 1px solid var(--glass-border);
}
.testimonial-card .author .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  background: rgba(255,255,255,0.04);
}
.testimonial-card .author .name {
  font-size: 0.82rem;
  font-weight: 600;
}
.testimonial-card .author .title {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Responsive for new sections */
@media (max-width: 900px) {
  .article-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1rem !important;
  }
  /* Override JS inline styles on mobile */
  .article-card .article-cover {
    height: 160px !important;
    font-size: 2.8rem !important;
  }
  .article-card [style*="padding: 1.25rem"] {
    padding: 1rem !important;
  }
  .article-card .article-title {
    font-size: 0.95rem !important;
  }
  .article-card .article-excerpt {
    font-size: 0.8rem !important;
  }
  .article-card .article-meta {
    font-size: 0.7rem !important;
    gap: 0.5rem !important;
  }

  .steps-grid, .testimonial-grid {
    grid-template-columns: 1fr;
  }
  .steps-grid { gap: var(--size-4); }
}

@media (max-width: 480px) {
  .article-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem !important;
  }
  .article-card .article-cover {
    height: 140px !important;
    font-size: 2.5rem !important;
  }
  .article-card [style*="padding: 1.25rem"] {
    padding: 0.85rem !important;
    gap: 0.4rem !important;
  }
  .article-card .article-title {
    font-size: 0.9rem !important;
  }
  .article-card .article-excerpt {
    font-size: 0.78rem !important;
  }
  /* Compact pagination on mobile */
  #pagination {
    gap: 0.3rem !important;
    margin-top: 2rem !important;
  }
  #pagination button {
    min-width: 32px !important;
    height: 32px !important;
    font-size: 0.75rem !important;
    padding: 0.3rem 0.6rem !important;
  }
  /* Blog page header spacing */
  .page-header {
    padding-bottom: 0.5rem !important;
  }
  .section .blog-search {
    margin-bottom: 1rem !important;
  }
}
.hidden { display: none !important; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.text-center { text-align: center; }
.gradient-cosmic {
  background: var(--gradient-cosmic);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}