@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Mono:wght@300;400;500&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f0ede8;
  --bg2: #e8e4de;
  --surface: #fffefb;
  --surface2: #f5f2ed;
  --border: rgba(0,0,0,0.10);
  --border-strong: rgba(0,0,0,0.18);
  --accent: #1a1a1a;
  --accent2: #ff4d1c;
  --text: #1a1a1a;
  --muted: #7a7570;
  --muted2: #b5b0aa;
  --success: #1a7a4a;
  --success-bg: #d4f0e0;
  --error: #c0392b;
  --error-bg: #fde8e6;
  --mono: 'DM Mono', monospace;
  --sans: 'Syne', sans-serif;
  --radius: 16px;
  --radius-sm: 8px;
  --shadow: 0 2px 40px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.05);
  --shadow-hover: 0 8px 60px rgba(0,0,0,0.14), 0 2px 8px rgba(0,0,0,0.08);
}

[data-theme="dark"] {
  --bg: #111110;
  --bg2: #181816;
  --surface: #1e1e1c;
  --surface2: #242422;
  --border: rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.15);
  --accent: #f0ede8;
  --accent2: #ff4d1c;
  --text: #f0ede8;
  --muted: #7a7870;
  --muted2: #4a4840;
  --success: #3dd68c;
  --success-bg: #0d3320;
  --error: #f87171;
  --error-bg: #3d1515;
  --shadow: 0 2px 40px rgba(0,0,0,0.4), 0 1px 4px rgba(0,0,0,0.3);
  --shadow-hover: 0 8px 60px rgba(0,0,0,0.6), 0 2px 8px rgba(0,0,0,0.4);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ── Noise texture overlay ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

/* ── Nav ── */
nav {
  background: transparent;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 20px;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.nav-logo-icon {
  width: 34px;
  height: 34px;
  background: var(--accent2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.nav-logo:hover .nav-logo-icon {
  transform: rotate(-8deg) scale(1.05);
  box-shadow: 0 4px 16px rgba(255,77,28,0.4);
}

.nav-logo-icon svg {
  width: 16px; height: 16px;
  fill: none; stroke: #fff;
  stroke-width: 2.2;
  stroke-linecap: round; stroke-linejoin: round;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-links a, .nav-links button {
  color: var(--muted);
  background: transparent;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--sans);
  padding: 8px 14px;
  border-radius: 100px;
  transition: all 0.15s;
  border: 1px solid transparent;
  cursor: pointer;
  letter-spacing: 0.01em;
}

.nav-links a:hover, .nav-links button:hover {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
}

#themeToggle {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 38px; height: 38px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--muted);
  font-size: 15px;
}
#themeToggle:hover {
  border-color: var(--border-strong);
  transform: scale(1.05);
}

.nav-links button.accent {
  color: #fff;
  background: var(--accent2);
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(255,77,28,0.25);
}
.nav-links button.accent:hover {
  background: #e03d0e;
  box-shadow: 0 6px 24px rgba(255,77,28,0.4);
  transform: translateY(-1px);
}

/* ── Main ── */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 80px 20px 100px;
  position: relative;
  z-index: 1;
}

/* ── Hero ── */
.hero {
  text-align: center;
  margin-bottom: 48px;
  max-width: 820px;
  animation: heroIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes heroIn {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero h1 {
  font-size: clamp(3.2rem, 7vw, 6rem);
  font-weight: 800;
  letter-spacing: -3px;
  line-height: 0.92;
  color: var(--text);
  margin-bottom: 20px;
}

.hero h1 span {
  color: var(--accent2);
  display: inline-block;
  position: relative;
}

.hero h1 span::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 0; right: 0;
  height: 3px;
  background: var(--accent2);
  border-radius: 2px;
  opacity: 0.3;
}

.hero p {
  font-size: 16px;
  color: var(--muted);
  max-width: 520px;
  margin: 0 auto 28px;
  font-weight: 400;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0 auto 36px;
}

.hero-pill {
  padding: 7px 14px;
  border-radius: 100px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--mono);
  letter-spacing: 0.03em;
  transition: all 0.15s;
}
.hero-pill:hover {
  color: var(--text);
  border-color: var(--accent2);
}

/* ── Steps ── */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 0;
}

.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  text-align: left;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.step::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent2), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}

.step:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.step:hover::before { opacity: 1; }

.step-number {
  width: 28px; height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--accent2);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 12px;
  font-family: var(--mono);
}

.step-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.step-text { font-size: 13px; color: var(--muted); line-height: 1.6; }

/* ── Upload Card ── */
.upload-card {
  width: 100%;
  max-width: 600px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow);
  animation: cardIn 0.7s 0.1s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(32px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.tab-bar {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
  padding: 6px 6px 0;
  gap: 2px;
}

.tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
  border-radius: 10px 10px 0 0;
  letter-spacing: 0.01em;
}
.tab:hover { color: var(--text); background: color-mix(in srgb, var(--surface) 60%, transparent); }
.tab.active {
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 -2px 0 0 var(--accent2) inset;
}

.tab-panel { display: none; padding: 28px 28px 24px; }
.tab-panel.active { display: block; }

/* ── Drop Zone ── */
.drop-zone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 52px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  background: var(--bg2);
}
.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--accent2);
  background: color-mix(in srgb, var(--accent2) 4%, var(--bg2));
}
.drop-zone:hover .drop-icon, .drop-zone.dragover .drop-icon {
  background: var(--accent2);
  border-color: var(--accent2);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(255,77,28,0.3);
}
.drop-zone:hover .drop-icon svg, .drop-zone.dragover .drop-icon svg {
  stroke: #fff;
}
.drop-zone input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
  width: 100%; height: 100%;
}

.drop-icon {
  width: 52px; height: 52px;
  margin: 0 auto 16px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.drop-icon svg {
  width: 22px; height: 22px;
  stroke: var(--muted);
  stroke-width: 1.8; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
  transition: stroke 0.2s;
}

.drop-label { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.drop-sub { font-size: 12px; color: var(--muted); font-family: var(--mono); letter-spacing: 0.03em; }

/* ── Progress ── */
.progress-wrap { display: none; margin-top: 20px; }
.progress-track {
  height: 2px;
  background: var(--border-strong);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent2), #ff8c42);
  width: 0%;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 99px;
}
.progress-label {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--muted);
  margin-top: 8px;
  text-align: center;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ── URL Tab ── */
.url-row { display: flex; gap: 8px; }
.url-input {
  flex: 1;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 13px;
  font-family: var(--mono);
  color: var(--text);
  background: var(--bg2);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.url-input:focus {
  border-color: var(--accent2);
  box-shadow: 0 0 0 3px rgba(255,77,28,0.12);
}
.url-input::placeholder { color: var(--muted2); }

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: var(--radius-sm);
  padding: 11px 22px;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--sans);
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.btn-primary:hover {
  background: var(--accent2);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(255,77,28,0.35);
}
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

.url-note { font-size: 12px; color: var(--muted); margin-top: 10px; font-family: var(--mono); }

/* ── Result ── */
.result {
  display: none;
  margin-top: 18px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  animation: resultIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes resultIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--success-bg);
  border-bottom: 1px solid rgba(52,214,140,0.15);
}
.result-header.error { background: var(--error-bg); border-bottom-color: rgba(248,113,113,0.15); }

.result-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
}
.result-dot.error { background: var(--error); }

.result-status {
  font-size: 11px;
  font-weight: 600;
  font-family: var(--mono);
  color: var(--success);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.result-status.error { color: var(--error); }

.result-body { padding: 14px; background: var(--surface); }

.link-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.link-row:last-of-type { margin-bottom: 0; }

.link-label {
  font-size: 10px;
  font-family: var(--mono);
  font-weight: 500;
  color: var(--muted2);
  width: 50px;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.link-input {
  flex: 1;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  padding: 7px 10px;
  outline: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  transition: border-color 0.15s;
}
.link-input:focus { border-color: var(--border-strong); }

.copy-btn {
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--bg);
  padding: 0 12px;
  height: 32px;
  cursor: pointer;
  font-size: 11px;
  font-family: var(--mono);
  font-weight: 500;
  flex-shrink: 0;
  transition: all 0.15s;
  letter-spacing: 0.04em;
}
.copy-btn:hover { background: var(--accent2); border-color: var(--accent2); }
.copy-btn.copied {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

/* ── Recent Files ── */
.recent-section {
  width: 100%;
  max-width: 600px;
  margin-top: 48px;
  animation: cardIn 0.7s 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.section-title {
  font-size: 11px;
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
  white-space: nowrap;
}
.section-line { flex: 1; height: 1px; background: var(--border); }

.file-grid { display: flex; flex-direction: column; gap: 6px; }

.file-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  transition: all 0.2s;
}
.file-item:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
  transform: translateX(2px);
}

.file-thumb {
  width: 40px; height: 40px;
  border-radius: 8px;
  background: var(--bg2);
  border: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  overflow: hidden;
}
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }

.file-info { flex: 1; min-width: 0; }
.file-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta { font-size: 11px; font-family: var(--mono); color: var(--muted); margin-top: 2px; }

.file-copy {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  padding: 5px 10px;
  cursor: pointer;
  font-size: 11px;
  font-family: var(--mono);
  flex-shrink: 0;
  transition: all 0.15s;
  letter-spacing: 0.03em;
}
.file-copy:hover { border-color: var(--border-strong); color: var(--text); }
.file-copy.copied { border-color: var(--success); color: var(--success); }

.empty-state {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  font-family: var(--mono);
  padding: 32px;
  border: 1.5px dashed var(--border);
  border-radius: 12px;
}

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
footer a {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
  font-weight: 500;
}
footer a:hover { color: var(--text); }
.footer-sep { color: var(--muted2); font-size: 10px; }

/* ── Corner deco ── */
.corner-deco {
  position: fixed;
  bottom: 0; right: 0;
  width: 140px;
  pointer-events: none;
  z-index: 1;
  opacity: 0.9;
}
.corner-deco img { width: 100%; display: block; filter: drop-shadow(0 4px 12px rgba(0,0,0,0.15)); }
[data-theme="dark"] .corner-deco img { filter: drop-shadow(0 4px 16px rgba(0,0,0,0.6)); }

/* ── Mobile ── */
#hamburger {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 18px;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--text);
}
#mobileMenu {
  display: none;
  position: absolute;
  top: 64px; left: 0; right: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  flex-direction: column;
  z-index: 9;
  backdrop-filter: blur(20px);
}
#mobileMenu.active { display: flex; }
#mobileMenu a, #mobileMenu button {
  display: block; width: 100%;
  text-align: left;
  padding: 14px 24px;
  border: none; background: transparent;
  font-size: 14px; font-weight: 600; font-family: var(--sans);
  color: var(--muted); text-decoration: none;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: color 0.15s, background 0.15s;
}
#mobileMenu a:hover, #mobileMenu button:hover { color: var(--text); background: var(--surface); }
#mobileMenu #mobileAuthBtn {
  background: var(--accent2); color: #fff; border-bottom: none;
  margin: 12px 16px; width: calc(100% - 32px);
  border-radius: 10px; padding: 12px 20px;
}
#mobileMenu #mobileAuthBtn:hover { background: #e03d0e; }

/* ── Dark mode overrides ── */
[data-theme="dark"] .step { background: var(--surface); }
[data-theme="dark"] .tab.active { background: var(--surface); }
[data-theme="dark"] .upload-card { background: var(--surface); }

@media (max-width: 640px) {
  #hamburger { display: block; }
  .nav-links { display: none; }
  nav { padding: 0 16px; }
  .corner-deco { display: none; }
  .steps { grid-template-columns: 1fr; }
  main { padding: 48px 16px 80px; }
  .tab-panel { padding: 20px 20px 16px; }
}