@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=DM+Mono:wght@400;500&family=Outfit:wght@300;400;500;600;700&display=swap');

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

:root {
  /* Core palette */
  --ink:      #0D0F14;
  --ink-2:    #13161E;
  --ink-3:    #1C2030;
  --ink-4:    #252A3A;
  --rim:      rgba(255,255,255,0.07);
  --rim-2:    rgba(255,255,255,0.12);

  /* Text */
  --text:     #F0EEE8;
  --text-2:   #9DA3B4;
  --text-3:   #5C6278;

  /* Accent — amber */
  --amber:    #F5A623;
  --amber-2:  #FFC347;
  --amber-dim: rgba(245,166,35,0.12);
  --amber-glow: rgba(245,166,35,0.25);

  /* Success */
  --green:    #3ECF8E;
  --green-dim: rgba(62,207,142,0.12);

  /* Geometry */
  --radius:    14px;
  --radius-sm: 9px;
  --radius-xs: 6px;
  --nav-h:     60px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Outfit', system-ui, sans-serif;
  background: var(--ink);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── 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.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}

/* ── NAV ── */
nav {
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2rem;
  position: sticky; top: 0; z-index: 100;
  background: rgba(13,15,20,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--rim);
}

.logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--text);
  font-family: 'Outfit', sans-serif;
  font-weight: 700; font-size: 18px;
  letter-spacing: -0.3px;
}

.logo-icon {
  width: 32px; height: 32px;
  background: var(--amber);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}

/* Mountain silhouette in logo */
.logo-icon svg { width: 20px; height: 20px; }

.logo span { color: var(--amber); }

.nav-links { display: flex; align-items: center; gap: 2px; }

.nav-link {
  font-size: 13.5px; font-weight: 400;
  color: var(--text-2); text-decoration: none;
  padding: 6px 13px; border-radius: var(--radius-xs);
  transition: all 0.15s;
}
.nav-link:hover { color: var(--text); background: var(--rim); }
.nav-link.active { color: var(--text); font-weight: 500; }

.nav-cta {
  margin-left: 8px;
  background: var(--amber); color: var(--ink) !important;
  font-weight: 600 !important; font-size: 13px !important;
  padding: 7px 18px !important;
  border-radius: var(--radius-xs) !important;
  transition: background 0.15s, transform 0.1s !important;
}
.nav-cta:hover { background: var(--amber-2) !important; transform: translateY(-1px); }

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--rim);
  padding: 3.5rem 2rem 2.5rem;
  margin-top: 5rem;
  position: relative; z-index: 1;
}

.footer-inner {
  max-width: 1100px; margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
}

.footer-brand p {
  font-size: 13px; color: var(--text-3);
  margin-top: 10px; line-height: 1.7;
  max-width: 230px;
}

.footer-col h5 {
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--text-3); margin-bottom: 14px;
}

.footer-col a {
  display: block; font-size: 13px;
  color: var(--text-2); text-decoration: none;
  margin-bottom: 9px; transition: color 0.15s;
}
.footer-col a:hover { color: var(--amber); }

.footer-bottom {
  max-width: 1100px; margin: 2rem auto 0;
  padding-top: 1.5rem; border-top: 1px solid var(--rim);
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--text-3);
}

/* ── SHARED TOOL COMPONENTS ── */
.tool-page {
  max-width: 740px; margin: 0 auto;
  padding: 3rem 2rem;
  position: relative; z-index: 1;
}

.back-btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; color: var(--text-3);
  text-decoration: none; margin-bottom: 2rem;
  padding: 6px 12px 6px 8px;
  border: 1px solid var(--rim);
  border-radius: var(--radius-xs);
  transition: all 0.15s;
  background: var(--ink-2);
}
.back-btn:hover { color: var(--text); border-color: var(--rim-2); }

.tool-header { margin-bottom: 2.5rem; }

.tool-header h1 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 40px; font-weight: 400;
  letter-spacing: -0.5px; margin-bottom: 8px;
  line-height: 1.1;
}

.tool-header p { font-size: 15px; color: var(--text-2); line-height: 1.6; }

/* ── DROP ZONE ── */
.drop-zone {
  border: 1.5px dashed var(--rim-2);
  border-radius: var(--radius);
  padding: 3.5rem 2rem;
  text-align: center; cursor: pointer;
  transition: all 0.2s;
  background: var(--ink-2);
  position: relative;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--amber);
  background: var(--amber-dim);
}
.drop-zone input[type="file"] {
  position: absolute; inset: 0; opacity: 0;
  cursor: pointer; width: 100%; height: 100%;
}
.drop-icon {
  font-size: 34px; margin-bottom: 14px; display: block;
  filter: grayscale(0.3);
}
.drop-title { font-size: 16px; font-weight: 500; margin-bottom: 6px; }
.drop-hint { font-size: 13px; color: var(--text-3); }

/* ── FILE LIST ── */
.file-list { margin-top: 1.25rem; display: flex; flex-direction: column; gap: 8px; }

.file-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--ink-2); border: 1px solid var(--rim);
  border-radius: var(--radius-sm); padding: 11px 14px;
  cursor: grab; transition: border-color 0.15s;
  user-select: none;
}
.file-item:hover { border-color: var(--rim-2); }
.file-item.sortable-ghost { opacity: 0.35; }
.file-item.sortable-chosen { box-shadow: 0 6px 24px rgba(0,0,0,0.4); border-color: var(--amber); }

.drag-handle { color: var(--text-3); font-size: 13px; letter-spacing: 1.5px; cursor: grab; }
.file-icon { font-size: 18px; }
.file-name { flex: 1; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: 'DM Mono', monospace; font-size: 12px; color: var(--text-2); }
.file-size { font-size: 11px; color: var(--text-3); font-family: 'DM Mono', monospace; white-space: nowrap; }
.file-remove {
  width: 26px; height: 26px; border: none;
  background: none; cursor: pointer; border-radius: var(--radius-xs);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); font-size: 16px; transition: all 0.15s; flex-shrink: 0;
}
.file-remove:hover { background: rgba(255,60,60,0.15); color: #ff6b6b; }

/* ── ACTION BAR ── */
.action-bar { margin-top: 1.5rem; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.btn-main {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--amber); color: var(--ink);
  border: none; padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-size: 14.5px; font-weight: 600;
  cursor: pointer; font-family: 'Outfit', sans-serif;
  transition: all 0.15s; letter-spacing: -0.2px;
}
.btn-main:hover { background: var(--amber-2); transform: translateY(-1px); box-shadow: 0 6px 20px var(--amber-glow); }
.btn-main:disabled { opacity: 0.35; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-main:active { transform: translateY(0); }

.btn-ghost {
  background: transparent; color: var(--text-2);
  border: 1px solid var(--rim); padding: 12px 20px;
  border-radius: var(--radius-sm); font-size: 13.5px;
  cursor: pointer; font-family: 'Outfit', sans-serif;
  transition: all 0.15s;
}
.btn-ghost:hover { border-color: var(--rim-2); color: var(--text); background: var(--ink-2); }

/* ── PROGRESS ── */
.progress-wrap { margin-top: 1.25rem; display: none; }
.progress-wrap.visible { display: block; }
.progress-bar-track {
  height: 3px; background: var(--ink-4);
  border-radius: 3px; overflow: hidden;
}
.progress-bar-fill {
  height: 100%; background: linear-gradient(90deg, var(--amber), var(--amber-2));
  border-radius: 3px; transition: width 0.3s ease; width: 0%;
}
.progress-label { font-size: 12px; color: var(--text-3); margin-top: 8px; font-family: 'DM Mono', monospace; }

/* ── SUCCESS ── */
.success-box {
  display: none;
  background: var(--green-dim); border: 1px solid rgba(62,207,142,0.25);
  border-radius: var(--radius); padding: 1.25rem 1.5rem;
  margin-top: 1.25rem; align-items: center; gap: 14px;
}
.success-box.visible { display: flex; }
.success-icon { font-size: 22px; }
.success-text { flex: 1; }
.success-text strong { font-size: 14px; font-weight: 600; color: var(--green); display: block; margin-bottom: 3px; }
.success-text span { font-size: 12px; color: var(--text-3); font-family: 'DM Mono', monospace; }
.btn-download {
  background: var(--green); color: var(--ink); border: none;
  padding: 9px 20px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: 'Outfit', sans-serif; white-space: nowrap;
  transition: all 0.15s;
}
.btn-download:hover { filter: brightness(1.1); transform: translateY(-1px); }

/* ── OPTIONS PANEL ── */
.options-panel {
  background: var(--ink-2); border: 1px solid var(--rim);
  border-radius: var(--radius); padding: 1.5rem; margin-top: 1.25rem;
}
.options-panel h4 {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 1.5px; color: var(--text-3); margin-bottom: 1rem;
}
.option-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.option-row:last-child { margin-bottom: 0; }
.option-row label { font-size: 13.5px; color: var(--text-2); min-width: 90px; }
.option-row select, .option-row input[type="text"], .option-row input[type="range"] {
  padding: 7px 11px;
  border: 1px solid var(--rim-2); border-radius: var(--radius-xs);
  font-size: 13px; font-family: 'Outfit', sans-serif;
  background: var(--ink-3); color: var(--text);
  outline: none; transition: border-color 0.15s;
}
.option-row select:focus, .option-row input:focus { border-color: var(--amber); }
.option-row input[type="color"] {
  width: 36px; height: 32px; padding: 2px;
  border: 1px solid var(--rim-2); border-radius: var(--radius-xs);
  background: var(--ink-3); cursor: pointer;
}

/* ── OTHER TOOLS STRIP ── */
.other-tools { max-width: 740px; margin: 0 auto; padding: 0 2rem 4rem; position: relative; z-index: 1; }
.other-tools h3 {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 1.5px; color: var(--text-3); margin-bottom: 1rem;
}
.other-tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.other-tile {
  background: var(--ink-2); border: 1px solid var(--rim);
  border-radius: var(--radius-sm); padding: 13px 16px;
  text-decoration: none; color: var(--text-2);
  display: flex; align-items: center; gap: 10px;
  font-size: 13.5px; transition: all 0.15s;
}
.other-tile:hover { border-color: var(--amber); color: var(--amber); background: var(--amber-dim); }
.other-tile span { font-size: 17px; }

/* ── DIVIDER ── */
.divider { border: none; border-top: 1px solid var(--rim); margin: 3rem 0; }

/* ── RESPONSIVE ── */
@media (max-width: 700px) {
  nav { padding: 0 1.25rem; }
  .nav-links .nav-link:not(.nav-cta) { display: none; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .tool-page { padding: 2rem 1.25rem; }
  .tool-header h1 { font-size: 32px; }
  .other-tools { padding: 0 1.25rem 3rem; }
}
