/* =============================================
   FastDL — Clean Minimal Light Theme
   Inspired by Happn's elegant aesthetic
   ============================================= */

:root {
  --bg: #faf6f1;
  --bg-white: #ffffff;
  --bg-card: #fff;
  --border: #e8e2da;
  --border-light: #f0ebe4;
  --text: #1a1a1a;
  --text-secondary: #6b6560;
  --text-dim: #a09890;
  --accent: #1a1a1a;
  --accent-hover: #333;
  --serif: 'DM Serif Display', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow: 0 4px 20px rgba(0,0,0,0.06);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Navigation ───────────────────────────── */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(250, 246, 241, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
}

.nav-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.logo em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
}

.logo-icon {
  width: 28px;
  height: 28px;
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  transition: color 0.2s;
}

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

/* ── Main ─────────────────────────────────── */
main {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
  z-index: 2; /* Renders content above the 3D trail layer */
}

/* ── Hero ─────────────────────────────────── */
.hero {
  text-align: center;
  padding: 140px 0 80px;
  animation: fadeIn 0.7s ease-out;
}

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

.hero-trust {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px 6px 12px;
  border-radius: 999px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 40px;
  box-shadow: var(--shadow-sm);
}

.trust-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34c759;
  animation: dotPulse 2.5s ease-in-out infinite;
}

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

h1 {
  font-family: var(--serif);
  font-size: clamp(2.8rem, 7vw, 4.8rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 24px;
}

h1 em {
  font-style: italic;
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 420px;
  margin: 0 auto 48px;
  line-height: 1.65;
}

/* ── Input Area ───────────────────────────── */
.input-area {
  display: flex;
  gap: 10px;
  max-width: 560px;
  margin: 0 auto;
}

.input-box {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--bg-white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 4px 4px 16px;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
  box-shadow: var(--shadow-sm);
}

.input-box:focus-within {
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.06);
}

.input-platform {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  transition: color 0.2s;
}

.input-platform svg { width: 20px; height: 20px; }
.input-platform.youtube { color: #ff0033; }
.input-platform.instagram { color: #e1306c; }

#urlInput {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.92rem;
  padding: 14px 12px;
  min-width: 0;
}

#urlInput::placeholder { color: var(--text-dim); }

.btn-primary {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 28px;
  height: 52px;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  box-shadow: var(--shadow);
  white-space: nowrap;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-spinner {
  display: none; /* Hide by default */
  width: 20px;
  height: 20px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Error ────────────────────────────────── */
.error-msg {
  margin-top: 16px;
  text-align: center;
  font-size: 0.88rem;
  color: #d32f2f;
  animation: shakeIn 0.35s ease-out;
}

@keyframes shakeIn {
  0% { opacity: 0; transform: translateX(-6px); }
  50% { transform: translateX(3px); }
  100% { opacity: 1; transform: translateX(0); }
}

/* ── Result Card ──────────────────────────── */
.result {
  margin-top: 40px;
  animation: cardIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(32px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.result-inner {
  display: flex;
  gap: 28px;
  padding: 20px;
  background: var(--bg-white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.result-thumb {
  position: relative;
  flex-shrink: 0;
  width: 240px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.result-thumb img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.result-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

.result-platform {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 10px;
  border-radius: var(--radius-xs);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fff;
}

.result-platform.youtube { background: #ff0033; }
.result-platform.instagram { background: linear-gradient(135deg, #f09433, #dc2743, #bc1888); }

.result-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.result-info h2 {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.result-uploader {
  font-size: 0.84rem;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

/* Quality */
.result-quality { margin-bottom: 18px; }

.result-quality label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}

.select-box {
  position: relative;
}

.select-box select {
  width: 100%;
  appearance: none;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 10px 36px 10px 14px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

.select-box select:focus {
  border-color: var(--text);
}

.select-box svg {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-dim);
  pointer-events: none;
}

/* Download btn */
.btn-dark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  margin-top: auto;
}

.btn-dark:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn-dark:active { transform: scale(0.97); }

.btn-dark svg { width: 18px; height: 18px; }

/* Progress */
.progress-area { margin-top: 14px; }
.progress-track { height: 4px; background: var(--border-light); border-radius: 999px; overflow: hidden; }
.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--text);
  border-radius: 999px;
  transition: width 0.3s ease, background 0.3s ease;
}
.progress-bar.indeterminate {
  width: 40% !important;
  animation: indeterminate 1.2s ease-in-out infinite;
}
@keyframes indeterminate {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}
.progress-label {
  display: block;
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-align: center;
}

/* ── Steps Section ────────────────────────── */
.steps {
  padding: 80px 0 40px;
  text-align: center;
}

.section-title {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 400;
  margin-bottom: 48px;
}

.section-title em { font-style: italic; }

.steps-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.step {
  flex: 1;
  max-width: 220px;
  padding: 32px 20px;
  background: var(--bg-white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: all 0.25s var(--ease);
}

.step:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--text-dim);
}

.step-num {
  width: 36px;
  height: 36px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  font-size: 0.85rem;
  font-weight: 700;
}

.step h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.step p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.step-arrow {
  flex-shrink: 0;
  color: var(--text-dim);
}

.step-arrow svg { width: 24px; height: 24px; }

/* ── Features ─────────────────────────────── */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 20px 0 80px;
}

.feature-card {
  text-align: center;
  padding: 32px 20px;
  border-radius: var(--radius);
  background: var(--bg-white);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all 0.25s var(--ease);
}

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

.feature-icon {
  font-size: 1.6rem;
  margin-bottom: 12px;
}

.feature-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.feature-card p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ── Footer ───────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  background: var(--bg-white);
}

.footer-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

footer p {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

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

/* ── Responsive ───────────────────────────── */
@media (max-width: 700px) {
  .nav-links { display: none; }
  .hero { padding: 120px 0 60px; }
  .input-area { flex-direction: column; }
  .btn-primary { height: 48px; }
  .result-inner { flex-direction: column; gap: 16px; }
  .result-thumb { width: 100%; }
  .steps-grid { flex-direction: column; gap: 12px; }
  .step-arrow { transform: rotate(90deg); }
  .features { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; gap: 16px; text-align: center; }
}

/* ── Interactive 3D Cursor Image Trail ────── */
.trail-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1; /* Render behind main layout (z-index 2) but above body background */
  overflow: hidden;
}

.trail-item {
  position: absolute;
  pointer-events: none;
  display: block;
}
