@import url('https://fonts.googleapis.com/css2?family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300&family=Syne:wght@400;500;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,300&display=swap');

:root {
  --bg: #0a0a0f;
  --bg2: #111118;
  --bg3: #16161f;
  --surface: #1c1c28;
  --surface2: #22222f;
  --border: rgba(255,255,255,0.07);
  --border2: rgba(255,255,255,0.12);
  --text: #e8e8f0;
  --text2: #9090a8;
  --text3: #5a5a72;
  --accent: #7c6af7;
  --accent2: #5b4de0;
  --accent-glow: rgba(124,106,247,0.15);
  --green: #3ddc97;
  --green-bg: rgba(61,220,151,0.1);
  --amber: #f59e0b;
  --amber-bg: rgba(245,158,11,0.1);
  --red: #f04f4f;
  --red-bg: rgba(240,79,79,0.1);
  --blue: #4fa8f0;
  --blue-bg: rgba(79,168,240,0.1);
  --pink: #e879a0;
  --pink-bg: rgba(232,121,160,0.1);
  --radius: 8px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'DM Mono', monospace;
  --nav-h: 64px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

.nav-logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--text);
  font-family: var(--font-display);
  font-size: 18px; font-weight: 700;
}
.nav-logo .logo-icon {
  width: 32px; height: 32px;
  background: var(--accent);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: #fff; font-weight: 800;
}

.nav-links {
  display: flex; align-items: center; gap: 2rem;
  list-style: none;
}
.nav-links a {
  color: var(--text2); text-decoration: none;
  font-size: 14px; font-weight: 400;
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }

.nav-cta {
  background: var(--accent) !important;
  color: #fff !important;
  padding: 8px 18px;
  border-radius: var(--radius);
  font-weight: 500 !important;
  transition: background 0.2s !important;
}
.nav-cta:hover { background: var(--accent2) !important; }

.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; border: none; background: none; padding: 4px; }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--text2); border-radius: 2px; transition: 0.3s; }

/* ---- LAYOUT ---- */
main { padding-top: var(--nav-h); min-height: calc(100vh - var(--nav-h)); }
.container { max-width: 1140px; margin: 0 auto; padding: 0 1.5rem; }
.container-narrow { max-width: 780px; margin: 0 auto; padding: 0 1.5rem; }

section { padding: 80px 0; }

/* ---- TYPOGRAPHY ---- */
h1,h2,h3,h4,h5 { font-family: var(--font-display); font-weight: 700; line-height: 1.2; color: var(--text); }
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; font-weight: 600; }
p { color: var(--text2); }
a { color: var(--accent); }
code { font-family: var(--font-mono); font-size: 0.875em; background: var(--surface); padding: 2px 6px; border-radius: 4px; color: var(--text); }
.mono { font-family: var(--font-mono); }

.label {
  font-size: 11px; font-weight: 500; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent);
  font-family: var(--font-mono);
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px; border-radius: var(--radius);
  font-family: var(--font-body); font-size: 15px; font-weight: 500;
  cursor: pointer; text-decoration: none; border: none;
  transition: all 0.2s; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent2); transform: translateY(-1px); }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border2); }
.btn-secondary:hover { background: var(--surface2); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border2); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-sm { padding: 7px 14px; font-size: 13px; }

/* ---- CARDS ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.card:hover { border-color: var(--border2); }

/* ---- BADGE ---- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 100px;
  font-size: 12px; font-weight: 500;
}
.badge-accent { background: var(--accent-glow); color: var(--accent); border: 1px solid rgba(124,106,247,0.3); }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-amber { background: var(--amber-bg); color: var(--amber); }

/* ---- SCORE CIRCLE ---- */
.score-ring { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.score-ring svg { transform: rotate(-90deg); }
.score-ring .score-value {
  position: absolute;
  font-family: var(--font-display);
  font-size: 2.4rem; font-weight: 800;
  line-height: 1;
}
.score-ring .score-label {
  position: absolute; bottom: 10px;
  font-size: 11px; color: var(--text3);
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}

/* ---- HIGHLIGHT COLORS ---- */
.hl-vocab { background: rgba(240,79,79,0.18); border-bottom: 2px solid var(--red); border-radius: 2px; }
.hl-passive { background: rgba(79,168,240,0.15); border-bottom: 2px solid var(--blue); border-radius: 2px; }
.hl-transition { background: rgba(245,158,11,0.15); border-bottom: 2px solid var(--amber); border-radius: 2px; }
.hl-redundant { background: rgba(232,121,160,0.15); border-bottom: 2px solid var(--pink); border-radius: 2px; }
.hl-uniform { background: rgba(124,106,247,0.12); border-radius: 2px; }

/* ---- FOOTER ---- */
footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 60px 0 30px;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 3rem; margin-bottom: 50px; }
.footer-brand p { font-size: 14px; line-height: 1.7; margin-top: 0.75rem; }
.footer-col h5 { font-family: var(--font-display); font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 1rem; letter-spacing: 0.05em; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 0.6rem; }
.footer-col ul li a { color: var(--text3); text-decoration: none; font-size: 14px; transition: color 0.2s; }
.footer-col ul li a:hover { color: var(--text2); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 24px; display: flex; align-items: center; justify-content: space-between; }
.footer-bottom p { font-size: 13px; color: var(--text3); }

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

/* ---- PROSE (for legal/about pages) ---- */
.prose h2 { font-size: 1.4rem; margin: 2rem 0 0.75rem; }
.prose h3 { font-size: 1.1rem; margin: 1.5rem 0 0.5rem; color: var(--text); }
.prose p { margin-bottom: 1rem; }
.prose ul, .prose ol { margin: 0.75rem 0 1rem 1.5rem; }
.prose li { margin-bottom: 0.4rem; color: var(--text2); }
.prose a { color: var(--accent); }
.prose strong { color: var(--text); font-weight: 500; }

/* ---- FAQ ---- */
.faq-item { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.faq-q {
  width: 100%; text-align: left; padding: 1.2rem 1.5rem;
  background: var(--surface); color: var(--text);
  font-family: var(--font-body); font-size: 15px; font-weight: 500;
  border: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center;
  gap: 1rem;
}
.faq-q:hover { background: var(--surface2); }
.faq-q .arrow { transition: transform 0.3s; font-size: 18px; color: var(--text3); flex-shrink: 0; }
.faq-item.open .faq-q .arrow { transform: rotate(180deg); }
.faq-a { display: none; padding: 1.2rem 1.5rem; background: var(--bg2); font-size: 14px; border-top: 1px solid var(--border); }
.faq-item.open .faq-a { display: block; }

/* ---- METRIC CARD ---- */
.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}
.metric-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.metric-card.red::before { background: var(--red); }
.metric-card.blue::before { background: var(--blue); }
.metric-card.amber::before { background: var(--amber); }
.metric-card.pink::before { background: var(--pink); }
.metric-card.green::before { background: var(--green); }
.metric-card.accent::before { background: var(--accent); }
.metric-card .metric-icon { font-size: 24px; margin-bottom: 1rem; }
.metric-card h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.metric-card p { font-size: 13px; line-height: 1.6; }

/* ---- GRID HELPERS ---- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.auto-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; }

/* ---- HERO ---- */
.hero { padding: 100px 0 80px; text-align: center; }
.hero .label { margin-bottom: 1.5rem; display: block; }
.hero h1 { margin-bottom: 1.5rem; }
.hero .hero-sub { font-size: 1.15rem; max-width: 600px; margin: 0 auto 2.5rem; }
.hero-actions { display: flex; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap; }

/* ---- PAGE HERO ---- */
.page-hero { padding: 60px 0 50px; border-bottom: 1px solid var(--border); margin-bottom: 60px; }
.page-hero .label { margin-bottom: 1rem; display: block; }
.page-hero h1 { font-size: clamp(1.8rem, 4vw, 3rem); margin-bottom: 1rem; }
.page-hero p { font-size: 1.05rem; max-width: 600px; }

/* ---- STEP ---- */
.step { display: flex; gap: 1.5rem; align-items: flex-start; }
.step-num {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent-glow); border: 1px solid rgba(124,106,247,0.3);
  color: var(--accent); font-family: var(--font-mono); font-size: 13px; font-weight: 500;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 2px;
}
.step-body h4 { margin-bottom: 0.3rem; font-size: 15px; }
.step-body p { font-size: 14px; }

/* ---- TABLE ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; padding: 10px 16px; background: var(--surface); color: var(--text); font-weight: 500; font-family: var(--font-display); border-bottom: 1px solid var(--border2); }
td { padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--text2); vertical-align: top; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface); }

/* ---- TOOL PAGE ---- */
.tool-wrap {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 1.5rem;
  height: calc(100vh - var(--nav-h) - 120px);
  min-height: 600px;
}
.tool-left { display: flex; flex-direction: column; gap: 1rem; }
.tool-right { display: flex; flex-direction: column; gap: 1rem; overflow-y: auto; }

.tool-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }

#textInput {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.75;
  padding: 1.25rem;
  resize: none;
  outline: none;
  transition: border-color 0.2s;
}
#textInput:focus { border-color: var(--accent); }
#textInput::placeholder { color: var(--text3); }

#outputPane {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 15px;
  line-height: 1.75;
  padding: 1.25rem;
  overflow-y: auto;
  display: none;
  color: var(--text);
}

.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-btn {
  padding: 5px 12px; border-radius: 100px; font-size: 12px; font-weight: 500;
  border: 1px solid var(--border); background: var(--surface); color: var(--text2);
  cursor: pointer; transition: all 0.2s;
}
.filter-btn.active { border-color: currentColor; }
.filter-btn.f-vocab.active { color: var(--red); background: var(--red-bg); border-color: rgba(240,79,79,0.4); }
.filter-btn.f-passive.active { color: var(--blue); background: var(--blue-bg); border-color: rgba(79,168,240,0.4); }
.filter-btn.f-transition.active { color: var(--amber); background: var(--amber-bg); border-color: rgba(245,158,11,0.4); }
.filter-btn.f-redundant.active { color: var(--pink); background: var(--pink-bg); border-color: rgba(232,121,160,0.4); }
.filter-btn.f-uniform.active { color: var(--accent); background: var(--accent-glow); border-color: rgba(124,106,247,0.4); }

/* Score panel */
.score-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
}
.score-panel h4 { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; font-family: var(--font-mono); color: var(--text3); margin-bottom: 1rem; }

.metrics-list { display: flex; flex-direction: column; gap: 0.6rem; }
.metric-row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.metric-row .metric-name { color: var(--text2); }
.metric-row .metric-val { font-family: var(--font-mono); font-weight: 500; font-size: 12px; }
.metric-bar { height: 3px; background: var(--bg3); border-radius: 2px; margin-top: 3px; }
.metric-bar-fill { height: 100%; border-radius: 2px; transition: width 0.5s ease; }

.issue-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  font-size: 13px;
}
.issue-card .issue-type { font-size: 11px; font-weight: 500; font-family: var(--font-mono); letter-spacing: 0.08em; margin-bottom: 0.3rem; }
.issue-card .issue-phrase { color: var(--text); font-weight: 500; margin-bottom: 0.25rem; }
.issue-card .issue-why { color: var(--text3); font-size: 12px; }

/* tooltip */
.tooltip-wrap { position: relative; display: inline; }
.ai-highlight { cursor: pointer; }
.ai-highlight:hover { opacity: 0.85; }

/* ---- LEGEND ---- */
.legend { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text2); }
.legend-dot { width: 10px; height: 10px; border-radius: 2px; }

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .tool-wrap { grid-template-columns: 1fr; height: auto; }
  .tool-right { max-height: 500px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .nav-links { display: none; flex-direction: column; position: absolute; top: var(--nav-h); left: 0; right: 0; background: var(--bg2); border-bottom: 1px solid var(--border); padding: 1rem 2rem; gap: 1rem; }
  .nav-links.open { display: flex; }
  .hamburger { display: flex; }
  .footer-grid { grid-template-columns: 1fr; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  section { padding: 50px 0; }
  .hero { padding: 60px 0 50px; }
}
