/* styles.css – 0xFilter */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --bg: #030305;
  --accent: #FFDE21;
  --accent-glow: rgba(255, 222, 33, 0.35);
  --accent-dim: rgba(255, 222, 33, 0.12);
  --text: #e8e8ec;
  --text-dim: #7a7a8a;
  --card-bg: rgba(255, 255, 255, 0.035);
  --card-border: rgba(255, 255, 255, 0.07);
  --green: #22c55e;
  --font-heading: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;
}

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

html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  overflow-x: hidden;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}

/* Dot Grid */
.dot-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(circle, rgba(255, 222, 33, 0.07) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ─── Nav ─── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.7rem 1.5rem;
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  background: rgba(3, 3, 5, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.nav-left { display: flex; align-items: center; gap: 0.7rem; }

.nav-brand { display: flex; flex-direction: column; }

.nav-logo {
  font-family: var(--font-heading); font-size: 1.2rem; font-weight: 700;
  color: var(--text); letter-spacing: -0.5px; line-height: 1.2;
}
.nav-logo span { color: var(--accent); }

.nav-byline {
  font-size: 0.58rem; font-weight: 500; color: var(--text-dim);
  text-decoration: none; letter-spacing: 0.5px; line-height: 1;
  transition: color 0.2s ease;
}
.nav-byline:hover { color: var(--accent); }

.btn-download {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.45rem 1rem;
  background: var(--accent); color: var(--bg); border: none;
  border-radius: 100px;
  font-family: var(--font-heading); font-size: 0.8rem; font-weight: 700;
  cursor: pointer; transition: all 0.3s ease;
  box-shadow: 0 2px 16px rgba(255, 222, 33, 0.2);
  -webkit-tap-highlight-color: transparent;
}
.btn-download:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(255, 222, 33, 0.35); }
.btn-download:active { transform: scale(0.96); }

/* ─── Main ─── */
main { position: relative; z-index: 1; padding-top: 3.5rem; }

/* ─── Upload Section ─── */
.upload-section {
  min-height: calc(100vh - 3.5rem);
  display: flex; align-items: center; justify-content: center;
  padding: 2rem 1.2rem;
}

.upload-inner { max-width: 520px; width: 100%; text-align: center; }

.upload-header { margin-bottom: 1.8rem; }

.hero-badge {
  display: inline-flex; padding: 0.3rem 1rem;
  border: 1px solid rgba(255, 222, 33, 0.2); border-radius: 100px;
  font-size: 0.6rem; font-weight: 600; letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--accent); background: rgba(255, 222, 33, 0.05);
  margin-bottom: 1rem;
  opacity: 0; animation: fadeUp 0.6s 0.1s ease forwards;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(1.7rem, 6vw, 2.6rem);
  font-weight: 800; line-height: 1.1; letter-spacing: -1.5px;
  margin-bottom: 0.7rem;
  opacity: 0; animation: fadeUp 0.6s 0.2s ease forwards;
}
.accent { color: var(--accent); }

.hero-desc {
  font-size: 0.88rem; color: var(--text-dim); line-height: 1.7;
  max-width: 420px; margin: 0 auto;
  opacity: 0; animation: fadeUp 0.6s 0.3s ease forwards;
}

/* Drop Zone */
.drop-zone {
  border: 2px dashed rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg); background: var(--card-bg);
  cursor: pointer; transition: all 0.3s ease; overflow: hidden;
  opacity: 0; animation: fadeUp 0.6s 0.4s ease forwards;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--accent); background: rgba(255, 222, 33, 0.03);
  box-shadow: 0 0 40px rgba(255, 222, 33, 0.06);
}

.drop-zone-inner {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 3rem 1.5rem; text-align: center; gap: 0.4rem;
}

.drop-icon { color: var(--accent); opacity: 0.6; margin-bottom: 0.3rem; transition: all 0.3s ease; }
.drop-zone:hover .drop-icon { opacity: 1; transform: translateY(-3px); }

.drop-text { font-family: var(--font-heading); font-size: 1rem; font-weight: 600; }
.drop-hint { font-size: 0.78rem; color: var(--text-dim); }

/* ─── Editor ─── */
.editor-section { animation: fadeIn 0.4s ease; }

/* Preview */
.preview-area {
  position: relative;
  max-width: 100%;
  background: #000;
  display: flex; align-items: center; justify-content: center;
  min-height: 300px;
  overflow: hidden;
}

#previewCanvas {
  max-width: 100%;
  max-height: 55vh;
  display: block;
  object-fit: contain;
}

.btn-change-photo {
  position: absolute; top: 0.8rem; right: 0.8rem;
  width: 36px; height: 36px;
  background: rgba(0,0,0,0.6); border: 1px solid rgba(255,255,255,0.1);
  color: var(--text); border-radius: 10px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  -webkit-tap-highlight-color: transparent;
}
.btn-change-photo:hover { background: rgba(255,222,33,0.15); border-color: var(--accent); color: var(--accent); }

/* Intensity */
.intensity-row {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.8rem 1.2rem;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.intensity-label {
  font-family: var(--font-heading); font-size: 0.72rem; font-weight: 700;
  color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px;
  flex-shrink: 0;
}

.intensity-value {
  font-family: var(--font-heading); font-size: 0.75rem; font-weight: 700;
  color: var(--accent); min-width: 36px; text-align: right; flex-shrink: 0;
}

/* Slider */
.slider {
  -webkit-appearance: none; appearance: none;
  flex: 1; height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 4px; outline: none;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px;
  background: var(--accent); border: none;
  border-radius: 50%; cursor: pointer;
  box-shadow: 0 0 10px rgba(255,222,33,0.3);
}
.slider::-moz-range-thumb {
  width: 18px; height: 18px;
  background: var(--accent); border: none;
  border-radius: 50%; cursor: pointer;
}

/* ─── Filter Grid ─── */
.filter-section {
  padding: 0.8rem 0.6rem 2rem;
}

.filter-grid {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  padding: 0.4rem 0.6rem;
}
.filter-grid::-webkit-scrollbar { display: none; }

/* Filter Card */
.filter-card {
  flex-shrink: 0;
  width: 80px;
  cursor: pointer;
  text-align: center;
  transition: all 0.25s ease;
  scroll-snap-align: start;
  -webkit-tap-highlight-color: transparent;
}

.filter-thumb {
  width: 80px; height: 80px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid transparent;
  transition: all 0.25s ease;
  background: rgba(255,255,255,0.03);
  position: relative;
}

.filter-thumb canvas {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}

.filter-card:hover .filter-thumb {
  border-color: rgba(255,222,33,0.3);
}

.filter-card.active .filter-thumb {
  border-color: var(--accent);
  box-shadow: 0 0 14px rgba(255,222,33,0.25);
}

.filter-name {
  font-family: var(--font-heading);
  font-size: 0.6rem; font-weight: 600;
  color: var(--text-dim);
  margin-top: 0.35rem;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.filter-card.active .filter-name { color: var(--accent); }
.filter-card:hover .filter-name { color: var(--text); }

/* ─── Toast ─── */
.toast-container {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; align-items: center;
  gap: 0.5rem; width: 90%; max-width: 300px; pointer-events: none;
}

.toast {
  padding: 0.6rem 1.1rem; border-radius: var(--radius-sm);
  font-size: 0.78rem; font-weight: 600;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  animation: toastIn 0.3s ease;
  display: flex; align-items: center; gap: 0.5rem;
  width: 100%; pointer-events: auto;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.3); color: var(--green);
}

@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.toast.out { animation: toastOut 0.3s ease forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px); } }

/* ─── Footer ─── */
.footer {
  position: relative; z-index: 1;
  padding: 2rem 1.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}
.footer-inner {
  max-width: 680px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
}
.footer-logo { font-family: var(--font-heading); font-size: 1.1rem; font-weight: 700; color: var(--text-dim); }
.footer-logo span { color: var(--accent); opacity: 0.6; }
.footer-text { font-size: 0.75rem; color: var(--text-dim); opacity: 0.5; }
.footer-link { color: var(--accent); text-decoration: none; opacity: 0.8; transition: opacity 0.2s ease; }
.footer-link:hover { opacity: 1; }

/* ─── Animations ─── */
@keyframes fadeUp { from { opacity:0; transform: translateY(20px); } to { opacity:1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }

/* ─── Responsive ─── */
@media (max-width: 600px) {
  .nav { padding: 0.6rem 1rem; }
  .hero-title { font-size: 1.5rem; letter-spacing: -1px; }
  .hero-desc { font-size: 0.8rem; }
  #previewCanvas { max-height: 45vh; }
  .filter-card { width: 70px; }
  .filter-thumb { width: 70px; height: 70px; border-radius: 10px; }
  .filter-name { font-size: 0.55rem; }
  .footer-inner { flex-direction: column; gap: 0.3rem; text-align: center; }
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .footer { padding-bottom: max(2rem, env(safe-area-inset-bottom)); }
  .toast-container { bottom: max(1.5rem, env(safe-area-inset-bottom)); }
}
