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

:root {
  --bg: #060608;
  --bg2: #0d0d12;
  --bg3: #13131a;
  --bg4: #1a1a24;
  --bg5: #22222e;
  --gold: #c9a84c;
  --gold2: #e8c97a;
  --teal: #2dd4bf;
  --red: #ff6b6b;
  --green: #4ade80;
  --border: rgba(255,255,255,0.06);
  --border2: rgba(255,255,255,0.12);
  --text: #f0f0f8;
  --text2: #8888aa;
  --text3: #44445a;
  --radius: 16px;
  --radius-sm: 10px;
}

html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Outfit', sans-serif;
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1,h2,h3,.brand-text { font-family: 'Playfair Display', serif; }

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--bg5); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ── Topbar ── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; height: 62px;
  background: rgba(6,6,8,0.9);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(20px);
}
.brand { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.brand-icon { font-size: 20px; color: var(--gold); }
.brand-text {
  font-family: 'Playfair Display', serif;
  font-size: 18px; font-weight: 700; color: var(--text);
  letter-spacing: -0.3px;
}
.brand-text em { font-style: italic; color: var(--gold); }
.nav { display: flex; gap: 2px; }
.nav-btn {
  padding: 7px 16px; border-radius: 8px; border: none;
  background: transparent; color: var(--text2);
  font-family: 'Outfit', sans-serif; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.nav-btn:hover { color: var(--text); background: var(--bg3); }
.nav-btn.active { color: var(--gold); background: rgba(201,168,76,0.1); }
.nav-toggle { display: none; font-size: 20px; cursor: pointer; color: var(--text2); }

/* Mobile nav */
.mobile-nav {
  display: none; flex-direction: column; gap: 2px;
  background: var(--bg2); border-bottom: 1px solid var(--border);
  padding: 10px 16px;
}
.mobile-nav.open { display: flex; }
.mobile-nav button {
  padding: 10px 14px; border: none; background: transparent;
  color: var(--text2); font-family: 'Outfit',sans-serif; font-size: 14px;
  text-align: left; cursor: pointer; border-radius: 8px;
}
.mobile-nav button:hover { background: var(--bg3); color: var(--text); }

/* ── Main ── */
.main { max-width: 1200px; margin: 0 auto; padding: 0 28px 60px; }
.page { display: none; }
.page.active { display: block; animation: fadeUp 0.3s ease; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}
@keyframes progressAnim {
  0% { left: -40%; width: 40%; }
  100% { left: 100%; width: 40%; }
}
@keyframes bounce {
  0%,80%,100% { transform: translateY(0); }
  40% { transform: translateY(-6px); }
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* ── Hero ── */
.hero {
  padding: 80px 0 60px;
  max-width: 680px;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 500; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--gold); border: 1px solid rgba(201,168,76,0.3);
  padding: 6px 14px; border-radius: 20px;
  background: rgba(201,168,76,0.06); margin-bottom: 24px;
}
.hero-title {
  font-size: clamp(38px, 6vw, 64px);
  font-weight: 900; line-height: 1.1; letter-spacing: -1px;
  margin-bottom: 20px; color: var(--text);
}
.hero-title em { font-style: italic; color: var(--gold); }
.hero-sub { font-size: 17px; color: var(--text2); line-height: 1.7; margin-bottom: 36px; max-width: 520px; }
.hero-btns { display: flex; gap: 12px; flex-wrap: wrap; }

/* ── Features grid ── */
.features-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px; margin-bottom: 60px;
}
.feature-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  cursor: pointer; transition: all 0.22s; position: relative; overflow: hidden;
}
.feature-card::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(201,168,76,0.04), transparent);
  opacity: 0; transition: opacity 0.22s;
}
.feature-card:hover { border-color: rgba(201,168,76,0.3); transform: translateY(-3px); }
.feature-card:hover::before { opacity: 1; }
.feature-icon { font-size: 28px; margin-bottom: 14px; }
.feature-name { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.feature-desc { font-size: 13px; color: var(--text2); line-height: 1.5; }
.feature-arrow { font-size: 18px; color: var(--gold); margin-top: 16px; opacity: 0; transition: opacity 0.2s; }
.feature-card:hover .feature-arrow { opacity: 1; }

/* ── Footer credit ── */
.footer-credit {
  text-align: center; font-size: 13px; color: var(--text3);
  padding: 40px 0 20px; border-top: 1px solid var(--border); margin-top: 20px;
}

/* ── Page header ── */
.page-header { padding: 52px 0 36px; }
.page-tag {
  font-size: 11px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase;
  color: var(--gold); margin-bottom: 12px;
}
.page-title {
  font-size: clamp(28px, 4vw, 44px); font-weight: 700;
  letter-spacing: -0.5px; margin-bottom: 10px; line-height: 1.15;
}
.page-sub { font-size: 15px; color: var(--text2); max-width: 560px; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: 10px; border: none; cursor: pointer;
  font-family: 'Outfit', sans-serif; font-weight: 500;
  transition: all 0.18s; white-space: nowrap;
  padding: 10px 22px; font-size: 14px;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed !important; transform: none !important; }
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--gold), #a8842a);
  color: #0a0800; font-weight: 600;
}
.btn-primary:hover:not(:disabled) { background: linear-gradient(135deg, var(--gold2), var(--gold)); }
.btn-outline {
  background: transparent; color: var(--text);
  border: 1px solid var(--border2);
}
.btn-outline:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }
.btn-ghost {
  background: var(--bg3); color: var(--text2);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) { background: var(--bg4); color: var(--text); }
.btn-lg { padding: 13px 28px; font-size: 15px; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; padding: 14px; font-size: 15px; }

/* ── Inputs ── */
input, textarea, select {
  font-family: 'Outfit', sans-serif; font-size: 14px;
  color: var(--text); background: var(--bg3);
  border: 1px solid var(--border2); border-radius: var(--radius-sm);
  outline: none; transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}
input { padding: 10px 14px; }
input:focus, textarea:focus, select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.12);
}
textarea { padding: 14px; resize: vertical; line-height: 1.65; }
select { padding: 10px 14px; cursor: pointer; }
select option { background: var(--bg3); }
::placeholder { color: var(--text3); }

/* ── Tool layout ── */
.tool-layout {
  display: grid; grid-template-columns: 1fr 1.2fr;
  gap: 24px; align-items: start;
}
.tool-input { display: flex; flex-direction: column; gap: 14px; }
.tool-output {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); min-height: 500px;
  position: sticky; top: 80px;
}

/* ── Upload zone ── */
.upload-zone {
  border: 2px dashed var(--border2); border-radius: var(--radius);
  padding: 32px 20px; text-align: center; cursor: pointer;
  transition: all 0.2s;
}
.upload-zone:hover, .upload-zone.drag {
  border-color: var(--gold); background: rgba(201,168,76,0.04);
}
.upload-icon { font-size: 32px; margin-bottom: 10px; opacity: 0.5; }
.upload-hint { font-size: 13px; color: var(--text3); }
.file-meta {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px;
  font-size: 13px; color: var(--text2);
  display: flex; align-items: center; gap: 8px;
}

/* ── Or divider ── */
.or-divider {
  text-align: center; font-size: 12px; color: var(--text3);
  position: relative;
}
.or-divider::before, .or-divider::after {
  content: ''; position: absolute; top: 50%;
  width: 42%; height: 1px; background: var(--border);
}
.or-divider::before { left: 0; }
.or-divider::after { right: 0; }

/* ── Analysis options ── */
.analysis-options { display: flex; flex-direction: column; gap: 8px; }
.option-label { font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--text3); }
.option-chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  font-size: 12px; padding: 5px 14px; border-radius: 20px;
  background: var(--bg3); color: var(--text2);
  border: 1px solid var(--border); cursor: pointer; transition: all 0.15s;
}
.chip:hover { border-color: var(--gold); color: var(--gold); }
.chip.active { background: rgba(201,168,76,0.12); color: var(--gold); border-color: rgba(201,168,76,0.35); }

/* ── Empty state ── */
.output-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 12px;
  height: 100%; min-height: 500px;
  color: var(--text3); font-size: 14px;
}
.empty-icon { font-size: 40px; opacity: 0.2; }

/* ── Loading ── */
.loading-state { padding: 32px; }
.loading-text { font-size: 14px; color: var(--text2); margin-bottom: 14px; }
.loading-bar {
  height: 3px; background: var(--bg4); border-radius: 2px;
  overflow: hidden; position: relative;
}
.loading-fill {
  height: 100%; width: 40%; position: absolute;
  background: linear-gradient(90deg, var(--gold), var(--teal));
  border-radius: 2px; animation: progressAnim 1.6s infinite linear;
}

/* ── Result ── */
.result-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.result-title { font-size: 13px; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: 0.5px; }
.result-actions { display: flex; gap: 8px; }
.result-content {
  padding: 20px; max-height: 600px; overflow-y: auto;
  font-size: 14px; line-height: 1.75; color: var(--text);
  white-space: pre-wrap;
}

/* ── Score card ── */
.score-card {
  display: flex; justify-content: space-between; align-items: center;
  padding: 24px 28px; border-bottom: 1px solid var(--border);
}
.score-label { font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--text3); margin-bottom: 8px; }
.score-num { font-size: 52px; font-weight: 900; font-family: 'Playfair Display',serif; line-height: 1; }
.score-verdict { font-size: 13px; margin-top: 6px; }
.score-ring-wrap { width: 90px; height: 90px; }
.score-ring { width: 100%; height: 100%; }

/* ── Humanizer layout ── */
.humanizer-layout {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 24px; align-items: start;
}
.humanizer-input-col, .humanizer-output-col { display: flex; flex-direction: column; gap: 14px; }
.col-label { font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--text3); }
.humanizer-output-col .output-empty {
  min-height: 300px; background: var(--bg2);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.humanizer-output-col .result-content {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  max-height: 520px; overflow-y: auto;
  font-size: 14px; line-height: 1.75; color: var(--text);
  white-space: pre-wrap;
}

/* ── Multi-paper layout ── */
.multi-layout {
  display: grid; grid-template-columns: 1fr 1.2fr;
  gap: 24px; align-items: start;
}
.multi-papers { display: flex; flex-direction: column; gap: 12px; }
.multi-papers-header { display: flex; justify-content: space-between; align-items: center; }
.multi-paper-slot {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px;
}
.slot-num {
  font-size: 11px; font-weight: 700; color: var(--gold);
  letter-spacing: 1px; min-width: 24px; margin-top: 4px;
}
.multi-paper-slot textarea { flex: 1; background: var(--bg3); border-radius: 8px; }
.slot-remove {
  background: transparent; border: none; color: var(--text3);
  cursor: pointer; font-size: 14px; padding: 4px; transition: color 0.15s;
}
.slot-remove:hover { color: var(--red); }

/* ── References cards ── */
.ref-card {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 10px;
}
.ref-num { font-size: 11px; color: var(--teal); font-weight: 600; margin-bottom: 5px; }
.ref-text { font-size: 13px; line-height: 1.6; color: var(--text2); }
.ref-copy {
  font-size: 11px; color: var(--text3); background: none;
  border: none; cursor: pointer; margin-top: 8px; padding: 0;
  font-family: 'Outfit',sans-serif; transition: color 0.15s;
}
.ref-copy:hover { color: var(--gold); }

/* ── Error ── */
.error-msg {
  background: rgba(255,107,107,0.1); border: 1px solid rgba(255,107,107,0.25);
  border-radius: var(--radius-sm); padding: 12px 16px;
  font-size: 13px; color: var(--red);
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .tool-layout, .humanizer-layout, .multi-layout { grid-template-columns: 1fr; }
  .tool-output { position: static; min-height: 300px; }
  .nav { display: none; }
  .nav-toggle { display: block; }
  .topbar { padding: 0 16px; }
  .main { padding: 0 16px 40px; }
  .features-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .features-grid { grid-template-columns: 1fr; }
  .hero-btns { flex-direction: column; }
  .hero-title { font-size: 34px; }
}
