/* PicBrew — "Glacial" Arctic Precision Theme */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;600;700&family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --bg: #0A0E14;
  --bg-card: #0F1923;
  --bg-elevated: #162030;
  --text: #E4EAF1;
  --text-muted: #5E7A94;
  --accent: #00D4FF;
  --accent-hover: #33DFFF;
  --accent-glow: rgba(0, 212, 255, 0.12);
  --green: #34D399;
  --green-hover: #6EE7B7;
  --border: #1A2636;
  --border-hover: #2A4058;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,0.4), 0 1px 3px rgba(0,0,0,0.3);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.5), 0 0 24px var(--accent-glow);
  --font-display: 'Space Grotesk', 'Segoe UI', sans-serif;
  --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --max-width: 1100px;
  --violet: #7C5CFC;
  --violet-glow: rgba(124, 92, 252, 0.1);
}

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

html { overflow-x: hidden; }

body {
  overflow-x: hidden;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Subtle dot grid overlay — replaces film grain */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.03;
  background-image: radial-gradient(circle, #5E7A94 0.5px, transparent 0.5px);
  background-size: 24px 24px;
}

/* Entrance animations */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

/* Nav */
.nav {
  background: rgba(10, 14, 20, 0.8);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.nav-brand {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.03em;
}
.nav-brand span { color: var(--accent); }
.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.15rem;
}
.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 500;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--accent);
  background: rgba(0, 212, 255, 0.07);
}
.nav-coffee {
  background: rgba(0, 212, 255, 0.1) !important;
  color: var(--accent) !important;
  font-weight: 600 !important;
}
.nav-coffee:hover { background: rgba(0, 212, 255, 0.18) !important; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text);
}
.nav-mobile-header {
  display: none;
}

/* Main */
.main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.25rem;
  width: 100%;
  flex: 1;
  animation: fadeIn 0.5s ease;
}

/* Hero */
.hero {
  text-align: center;
  padding: 4.5rem 0 3rem;
  position: relative;
  animation: fadeUp 0.6s ease;
}
.hero::before {
  content: '';
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 450px;
  background:
    radial-gradient(ellipse at 35% 50%, rgba(0, 212, 255, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 65% 50%, rgba(124, 92, 252, 0.05) 0%, transparent 60%);
  pointer-events: none;
  z-index: -1;
}
.hero-logo {
  margin-bottom: 1.5rem;
}
.hero-logo-icon {
  filter: drop-shadow(0 4px 20px rgba(0, 212, 255, 0.25)) drop-shadow(0 2px 8px rgba(124, 92, 252, 0.2));
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 1rem;
  letter-spacing: -0.04em;
}
.hero-title-line1 {
  display: block;
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  font-family: var(--font-body);
}
.hero-title-line2 {
  display: block;
  font-size: 3.8rem;
  background: linear-gradient(135deg, var(--accent) 0%, var(--violet) 50%, var(--accent) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 6s linear infinite;
}
.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.75;
  font-weight: 400;
}

/* Privacy badge */
.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(52, 211, 153, 0.08);
  color: var(--green);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  margin-top: 1.5rem;
  border: 1px solid rgba(52, 211, 153, 0.18);
}
.privacy-badge svg { flex-shrink: 0; }

/* Tool grid */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 2.5rem 0;
}
.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.25s;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  animation: fadeUp 0.5s ease backwards;
}
.tool-card:nth-child(1) { animation-delay: 0.04s; }
.tool-card:nth-child(2) { animation-delay: 0.07s; }
.tool-card:nth-child(3) { animation-delay: 0.10s; }
.tool-card:nth-child(4) { animation-delay: 0.13s; }
.tool-card:nth-child(5) { animation-delay: 0.16s; }
.tool-card:nth-child(6) { animation-delay: 0.19s; }
.tool-card:nth-child(7) { animation-delay: 0.22s; }
.tool-card:nth-child(8) { animation-delay: 0.25s; }
.tool-card:nth-child(9) { animation-delay: 0.28s; }
.tool-card:nth-child(10) { animation-delay: 0.31s; }
.tool-card:nth-child(11) { animation-delay: 0.34s; }
.tool-card:nth-child(12) { animation-delay: 0.37s; }
.tool-card:nth-child(13) { animation-delay: 0.40s; }
.tool-card:nth-child(14) { animation-delay: 0.43s; }
.tool-card:nth-child(15) { animation-delay: 0.46s; }

.tool-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(0, 212, 255, 0.06) 0%,
    rgba(124, 92, 252, 0.04) 50%,
    transparent 100%
  );
  opacity: 0;
  transition: opacity 0.35s;
}
.tool-card:hover {
  border-color: rgba(0, 212, 255, 0.25);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(0, 212, 255, 0.08),
    inset 0 1px 0 rgba(0, 212, 255, 0.06);
  transform: translateY(-4px);
}
.tool-card:hover::before {
  opacity: 1;
}
.tool-card-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 2px 8px rgba(0, 212, 255, 0.15));
}
.tool-card h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  position: relative;
  z-index: 1;
  letter-spacing: -0.02em;
}
.tool-card p {
  font-size: 0.84rem;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
  line-height: 1.5;
  font-weight: 400;
}

/* Sections */
.section-title {
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  margin: 3rem 0 1.25rem;
  letter-spacing: -0.03em;
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}
.trust-item {
  text-align: center;
  padding: 1.5rem 1rem;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: border-color 0.25s, box-shadow 0.25s;
}
.trust-item:hover {
  border-color: var(--border-hover);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
.trust-item .icon { font-size: 2rem; margin-bottom: 0.6rem; }
.trust-item h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  letter-spacing: -0.01em;
}
.trust-item p { font-size: 0.84rem; color: var(--text-muted); line-height: 1.5; }

.comparison {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin: 2.5rem 0;
  text-align: center;
}
.comparison h2 {
  font-family: var(--font-display);
  margin-bottom: 1.25rem;
  letter-spacing: -0.03em;
}
.comparison table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 auto;
  max-width: 600px;
}
.comparison th, .comparison td {
  padding: 0.7rem 1rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}
.comparison th {
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.comparison td:first-child {
  text-align: left;
  font-weight: 600;
  color: var(--text);
}
.comparison tbody tr:last-child td { border-bottom: none; }

/* Tool page layout */
.tool-header {
  text-align: center;
  margin-bottom: 2rem;
  animation: fadeUp 0.5s ease;
}
.tool-header h1 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.04em;
}
.tool-header p {
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 300;
}

/* Drop zone */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 3.5rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.3s, background 0.3s, box-shadow 0.3s;
  background: var(--bg-card);
  margin-bottom: 1.5rem;
  position: relative;
}
.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--accent);
  background: rgba(0, 212, 255, 0.03);
  box-shadow: 0 0 40px rgba(0, 212, 255, 0.06), inset 0 0 40px rgba(0, 212, 255, 0.02);
}
.drop-zone-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.drop-zone-text { color: var(--text-muted); font-size: 0.95rem; font-weight: 400; }
.drop-zone-text strong { color: var(--text); font-weight: 600; }
.drop-zone input[type="file"] { display: none; }

/* Controls */
.controls {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.control-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.control-row:last-child { margin-bottom: 0; }
.control-row label {
  font-weight: 600;
  font-size: 0.88rem;
  min-width: 100px;
  color: var(--text);
}
.control-row input[type="range"] {
  flex: 1;
  min-width: 150px;
  accent-color: var(--accent);
  height: 4px;
}
.control-row input[type="number"] {
  width: 100px;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.88rem;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.control-row input[type="number"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.control-row select {
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.88rem;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.control-row select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.control-row input[type="color"] {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
}
.control-row input[type="text"],
.control-row textarea {
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.88rem;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.control-row input[type="text"]:focus,
.control-row textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
input, select, textarea {
  color: var(--text);
}
.quality-value {
  font-weight: 700;
  font-size: 0.9rem;
  min-width: 40px;
  text-align: center;
  color: var(--accent);
  font-family: var(--font-display);
}

/* Toggle switch */
.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
}
.toggle-label input { display: none; }
.toggle-track {
  width: 40px;
  height: 22px;
  background: #1A2636;
  border: 1px solid var(--border);
  border-radius: 11px;
  position: relative;
  transition: background 0.2s, border-color 0.2s;
}
.toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}
.toggle-label input:checked + .toggle-track {
  background: rgba(0, 212, 255, 0.2);
  border-color: var(--accent);
}
.toggle-label input:checked + .toggle-track::after {
  transform: translateX(18px);
  background: var(--accent);
}

/* Presets */
.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.preset-btn {
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  font-family: var(--font-body);
  transition: all 0.2s;
}
.preset-btn:hover { border-color: var(--accent); color: var(--accent); background: rgba(0, 212, 255, 0.04); }
.preset-btn.active { background: var(--accent); color: #0A0E14; border-color: var(--accent); font-weight: 600; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  border: none;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--accent);
  color: #0A0E14;
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 20px rgba(0, 212, 255, 0.25);
}
.btn-primary:disabled { background: #1A2636; color: #3A5068; cursor: not-allowed; box-shadow: none; }
.btn-green {
  background: var(--green);
  color: #0A0E14;
}
.btn-green:hover {
  background: var(--green-hover);
  box-shadow: 0 4px 20px rgba(52, 211, 153, 0.25);
}
.btn-green:disabled { background: #1A2636; color: #3A5068; cursor: not-allowed; box-shadow: none; }
.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover { background: var(--bg-elevated); border-color: var(--border-hover); }

.btn-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

/* Results / file list */
.results {
  margin-top: 1.5rem;
}
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.results-header h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}
.file-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.file-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.file-item:hover {
  border-color: var(--border-hover);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}
.file-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--bg);
  flex-shrink: 0;
}
.file-info { flex: 1; min-width: 150px; }
.file-name { font-weight: 600; font-size: 0.88rem; word-break: break-all; }
.file-meta { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.15rem; }
.file-savings {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--green);
  background: rgba(52, 211, 153, 0.08);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}
.file-actions { display: flex; gap: 0.5rem; }

/* Preview area */
.preview-area {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 1.5rem;
  text-align: center;
}
.preview-area img, .preview-area canvas {
  max-width: 100%;
  max-height: 500px;
  border-radius: 8px;
}

/* Crop canvas container */
.crop-container {
  position: relative;
  display: inline-block;
  cursor: crosshair;
}
.crop-container canvas {
  display: block;
}

/* Progress bar */
.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin: 1rem 0;
  display: none;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--violet), var(--accent));
  background-size: 200% 100%;
  border-radius: 2px;
  transition: width 0.3s;
  width: 0%;
  animation: shimmer 2s linear infinite;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 1.25rem;
  text-align: center;
  margin-top: auto;
  background: var(--bg-card);
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}
.footer p { font-size: 0.84rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.footer a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}
.footer a:hover { color: var(--accent-hover); text-decoration: underline; }
.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

/* Error message */
.error-msg {
  background: rgba(239, 68, 68, 0.08);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.15);
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.88rem;
  margin: 1rem 0;
  display: none;
}
.error-msg.show { display: block; }

/* Nav More Dropdown */
.nav-more {
  position: relative;
  list-style: none;
}
.nav-more-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 500;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}
.nav-more-btn:hover {
  color: var(--accent);
  background: rgba(0, 212, 255, 0.07);
}
.nav-more.has-active .nav-more-btn {
  color: var(--accent);
  background: rgba(0, 212, 255, 0.07);
}
.nav-more-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.375rem;
  min-width: 180px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
  list-style: none;
  z-index: 200;
}
.nav-more.open .nav-more-dropdown {
  display: block;
}
.nav-more-dropdown a {
  display: block !important;
  padding: 0.5rem 0.75rem !important;
  white-space: nowrap;
  pointer-events: auto;
}

/* Toast notification */
.toast {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
}

/* ===== MOBILE NAV — FULL-SCREEN CATEGORIZED TAKEOVER ===== */
.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 199;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.nav-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: linear-gradient(160deg, #0A0E14 0%, #0D1520 40%, #0A1018 100%);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.95);
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), visibility 0s 0.35s;
  padding: 0 0 2rem;
  display: flex;
  flex-direction: column;
}
.mobile-nav.open {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), visibility 0s 0s;
}

/* Decorative glow blobs */
.mobile-nav::before,
.mobile-nav::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
}
.mobile-nav::before {
  width: 220px; height: 220px;
  top: -50px; right: -50px;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.08) 0%, transparent 70%);
}
.mobile-nav::after {
  width: 180px; height: 180px;
  bottom: 80px; left: -40px;
  background: radial-gradient(circle, rgba(124, 92, 252, 0.06) 0%, transparent 70%);
}

/* Header bar */
.mobile-nav-header {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.15), rgba(124, 92, 252, 0.12));
  border-bottom: 1px solid rgba(0, 212, 255, 0.15);
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 2;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.mobile-nav-brand {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}
.mobile-nav-brand span { color: var(--accent); }
.mobile-nav-close {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  color: var(--text);
  font-size: 1.3rem;
  font-weight: 700;
  -webkit-tap-highlight-color: transparent;
}
.mobile-nav-close:hover { background: rgba(255, 255, 255, 0.15); }
.mobile-nav-close:active { transform: scale(0.9); }

/* "All Tools" home link */
.mobile-nav-home {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 1rem 1rem 0.4rem;
  padding: 1rem 1.2rem;
  border-radius: 14px;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(124, 92, 252, 0.18));
  border: 1px solid rgba(0, 212, 255, 0.2);
  box-shadow: 0 4px 16px rgba(0, 212, 255, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.mobile-nav-home:active { transform: scale(0.97); box-shadow: 0 2px 8px rgba(0, 212, 255, 0.08); }
.mobile-nav-home.active {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.25), rgba(124, 92, 252, 0.22));
  box-shadow: 0 4px 20px rgba(0, 212, 255, 0.15);
}

/* Section headings */
.mobile-nav-section {
  padding: 0.8rem 1rem 0.2rem;
  max-width: 100%;
}
.mobile-nav-section-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
  padding-left: 0.3rem;
}

/* Nav item grid */
.mobile-nav-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}
@media (min-width: 400px) {
  .mobile-nav-grid { grid-template-columns: 1fr 1fr; }
}

/* Individual nav items — chunky pill buttons */
.mobile-nav-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
  min-height: 52px;
  opacity: 0;
  transform: translateY(16px);
}
.mobile-nav.open .mobile-nav-item {
  animation: navBounceIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.mobile-nav-item:nth-child(1) { animation-delay: 0.06s; }
.mobile-nav-item:nth-child(2) { animation-delay: 0.10s; }
.mobile-nav-item:nth-child(3) { animation-delay: 0.14s; }
.mobile-nav-item:nth-child(4) { animation-delay: 0.18s; }
.mobile-nav-item:nth-child(5) { animation-delay: 0.22s; }
.mobile-nav-item:nth-child(6) { animation-delay: 0.26s; }
.mobile-nav-item:nth-child(7) { animation-delay: 0.30s; }
.mobile-nav-item:nth-child(8) { animation-delay: 0.34s; }

.mobile-nav-item:active {
  transform: scale(0.96);
  border-color: var(--accent);
  box-shadow: 0 2px 12px rgba(0, 212, 255, 0.2);
}
.mobile-nav-item.active {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.08), rgba(124, 92, 252, 0.06));
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.1), inset 0 0 0 1px rgba(0, 212, 255, 0.05);
}
.mobile-nav-item-icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
}
.mobile-nav-item-label { line-height: 1.2; }

/* Privacy badge at bottom */
.mobile-nav-privacy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin: 1.2rem 1rem 0;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.06);
  color: var(--green);
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid rgba(52, 211, 153, 0.15);
  flex-shrink: 0;
}

/* Coffee link at bottom of mobile nav */
.mobile-nav-coffee {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 0.75rem 1rem 0;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  text-decoration: none;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.12);
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.mobile-nav-coffee:active { background: rgba(0, 212, 255, 0.15); }

@keyframes navBounceIn {
  from { opacity: 0; transform: translateY(16px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Hamburger → X animation */
.nav-toggle {
  display: none;
  position: relative;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  font-size: 0;
  color: transparent;
}
.nav-toggle .hamburger-bar {
  display: block;
  position: absolute;
  left: 8px;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s;
}
.nav-toggle .hamburger-bar:nth-child(1) { top: 12px; }
.nav-toggle .hamburger-bar:nth-child(2) { top: 19px; }
.nav-toggle .hamburger-bar:nth-child(3) { top: 26px; }
.nav-toggle.active .hamburger-bar:nth-child(1) {
  top: 19px;
  transform: rotate(45deg);
}
.nav-toggle.active .hamburger-bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.nav-toggle.active .hamburger-bar:nth-child(3) {
  top: 19px;
  transform: rotate(-45deg);
}

/* Mobile: show hamburger, hide desktop nav-links */
@media (max-width: 1200px) {
  .nav-more-btn { display: none !important; }
  .nav-more { display: contents !important; }
  .nav-more-dropdown { display: contents !important; }

  .nav-toggle { display: flex; align-items: center; justify-content: center; }
  .nav-links { display: none !important; }
}

@media (max-width: 768px) {
  .hero-title-line1 { font-size: 1rem; }
  .hero-title-line2 { font-size: 2.4rem; }
  .hero-logo-icon { width: 44px; height: 44px; }
  .hero { padding: 2.5rem 0 2rem; }
  .drop-zone { padding: 2.5rem 1rem; }
  .control-row { flex-direction: column; align-items: stretch; }
  .control-row label { min-width: auto; }
  .file-item { flex-direction: column; align-items: flex-start; }
  .comparison table { font-size: 0.8rem; }
  .comparison th, .comparison td { padding: 0.4rem 0.5rem; }
}
