/* =====================
   Reset & Base
===================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: #f7f6f2;
  color: #1a1a18;
  line-height: 1.7;
}

a { color: inherit; text-decoration: none; }

/* =====================
   Layout
===================== */
.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* =====================
   Header
===================== */
.site-header {
  background: #fff;
  border-bottom: 1px solid #e8e6e0;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: 'Lora', serif;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.logo span { color: #5a4fcf; }
a.logo { text-decoration: none; color: inherit; }

.scores-grid.single {
  grid-template-columns: 1fr;
  max-width: 480px;
}

.score-card.featured {
  padding: 2rem;
}

.score-card.featured .score-value {
  font-size: 56px;
  margin-bottom: 8px;
}

.score-card.featured .score-label {
  font-size: 14px;
  padding: 4px 14px;
  margin-bottom: 14px;
}

.score-card.featured .score-desc {
  font-size: 13px;
  line-height: 1.65;
}

.explainer-card a {
  color: #5a4fcf;
  text-decoration: underline;
  text-underline-offset: 2px;
}

nav { display: flex; gap: 1.5rem; align-items: center; }

nav a {
  font-size: 14px;
  color: #666;
  transition: color 0.15s;
}

nav a:hover { color: #1a1a18; }
nav a.active { color: #1a1a18; font-weight: 500; }

/* Dropdown */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: #666;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}

.nav-dropdown-btn:hover { color: #1a1a18; }

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border: 1px solid #e8e6e0;
  border-radius: 10px;
  padding: 6px 0;
  min-width: 220px;
  z-index: 200;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  margin-top: 0;
}

.nav-dropdown::after {
  content: '';
  display: block;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 12px;
}

.nav-dropdown-menu a {
  display: block;
  padding: 8px 16px;
  font-size: 13px;
  color: #333;
  white-space: nowrap;
  transition: background 0.1s;
}

.nav-dropdown-menu a:hover {
  background: #f7f6f2;
  color: #1a1a18;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  display: block;
}

/* About page styles */
.about-section {
  padding: 2.5rem 0 4rem;
}

.about-block {
  margin-bottom: 3rem;
}

.about-block h2 {
  font-family: 'Lora', serif;
  font-size: 22px;
  font-weight: 600;
  color: #1a1a18;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e8e6e0;
}

.about-block p {
  font-size: 15px;
  color: #444;
  line-height: 1.8;
  margin-bottom: 0.75rem;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.25rem;
}

.about-card {
  background: #faf9f7;
  border: 1px solid #e8e6e0;
  border-radius: 10px;
  padding: 1.25rem;
}

.about-card h3 {
  font-family: 'Lora', serif;
  font-size: 14px;
  font-weight: 600;
  color: #1a1a18;
  margin-bottom: 6px;
}

.about-card p {
  font-size: 13px;
  color: #666;
  line-height: 1.6;
  margin: 0;
}

/* Steps */
.steps {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.step {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
}

.step-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #1a1a18;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.step-text strong {
  font-size: 15px;
  font-weight: 500;
  color: #1a1a18;
  display: block;
  margin-bottom: 4px;
}

.step-text p {
  font-size: 14px;
  color: #666;
  line-height: 1.6;
  margin: 0;
}

/* Formula list */
.formula-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1.25rem;
}

.formula-item {
  padding: 1.25rem 1.5rem;
  background: #faf9f7;
  border: 1px solid #e8e6e0;
  border-radius: 10px;
}

.formula-item h3 {
  font-family: 'Lora', serif;
  font-size: 16px;
  font-weight: 600;
  color: #1a1a18;
  margin-bottom: 8px;
}

.formula-item h3 a {
  color: #1a1a18;
  text-decoration: none;
}

.formula-item h3 a:hover {
  color: #5a4fcf;
}

.formula-item p {
  font-size: 14px;
  color: #555;
  line-height: 1.75;
  margin: 0;
}

@media (max-width: 640px) {
  .about-grid { grid-template-columns: 1fr; }
  .nav-dropdown-menu { left: auto; right: 0; transform: none; }
}

/* =====================
   Hero
===================== */
.hero {
  background: #fff;
  padding: 3rem 0 2.5rem;
  border-bottom: 1px solid #e8e6e0;
  text-align: center;
}

.hero h1 {
  font-family: 'Lora', serif;
  font-size: clamp(26px, 5vw, 40px);
  font-weight: 600;
  letter-spacing: -0.5px;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.subtitle {
  font-size: 16px;
  color: #666;
  max-width: 520px;
  margin: 0 auto;
}

/* =====================
   Tool Section
===================== */
.tool-section { padding: 2.5rem 0; }

/* =====================
   Editor
===================== */
.editor-wrap {
  background: #fff;
  border: 1px solid #e8e6e0;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

#text-input {
  width: 100%;
  min-height: 200px;
  padding: 1.25rem 1.5rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  line-height: 1.75;
  border: none;
  outline: none;
  resize: vertical;
  background: #fff;
  color: #1a1a18;
}

#text-input::placeholder { color: #aaa; }

.toolbar {
  display: flex;
  gap: 10px;
  padding: 0.875rem 1.25rem;
  background: #faf9f7;
  border-top: 1px solid #e8e6e0;
  flex-wrap: wrap;
}

.btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: 8px;
  border: 1px solid #d8d5cc;
  background: #fff;
  color: #1a1a18;
  cursor: pointer;
  transition: background 0.12s, transform 0.1s;
}

.btn:hover { background: #f0ede6; }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: #1a1a18;
  color: #fff;
  border-color: #1a1a18;
}

.btn-primary:hover { background: #333; border-color: #333; }

/* =====================
   Stats Row
===================== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 1.25rem;
}

.stat-card {
  background: #fff;
  border: 1px solid #e8e6e0;
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
}

.stat-label {
  font-size: 11px;
  font-weight: 500;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 6px;
}

.stat-value {
  font-family: 'Lora', serif;
  font-size: 26px;
  font-weight: 500;
  color: #1a1a18;
  line-height: 1;
}

/* =====================
   Scores Grid
===================== */
.scores-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 1.25rem;
}

.score-card {
  background: #fff;
  border: 1px solid #e8e6e0;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
}

.score-name {
  font-size: 11px;
  font-weight: 500;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 10px;
}

.score-value {
  font-family: 'Lora', serif;
  font-size: 36px;
  font-weight: 500;
  color: #1a1a18;
  line-height: 1;
  margin-bottom: 6px;
}

.score-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  color: #555;
  background: #f1efe8;
  border-radius: 20px;
  padding: 3px 10px;
  margin-bottom: 10px;
  min-height: 22px;
}

.score-desc {
  font-size: 12px;
  color: #888;
  line-height: 1.6;
}

/* =====================
   Breakdown
===================== */
.suggestions {
  background: #fff;
  border: 1px solid #e8e6e0;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}

.suggestions h3 {
  font-size: 11px;
  font-weight: 500;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 12px;
}

.suggestion-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid #f0ede6;
  font-size: 14px;
  color: #333;
  line-height: 1.6;
}

.suggestion-item:last-child { border-bottom: none; padding-bottom: 0; }

.suggestion-item strong { font-weight: 500; color: #1a1a18; }

/* =====================
   Explainer
===================== */
.explainer {
  background: #fff;
  border-top: 1px solid #e8e6e0;
  padding: 3rem 0 4rem;
}

.explainer h2 {
  font-family: 'Lora', serif;
  font-size: 26px;
  font-weight: 600;
  margin-bottom: 2rem;
  text-align: center;
}

.explainer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.explainer-card {
  padding: 1.25rem;
  border: 1px solid #e8e6e0;
  border-radius: 12px;
  background: #faf9f7;
}

.explainer-card h3 {
  font-family: 'Lora', serif;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
}

.explainer-card p {
  font-size: 13px;
  color: #666;
  line-height: 1.65;
}

/* =====================
   Footer
===================== */
.site-footer {
  background: #1a1a18;
  color: #888;
  padding: 1.5rem 0;
  text-align: center;
  font-size: 13px;
}

/* =====================
   Responsive
===================== */
@media (max-width: 640px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .scores-grid { grid-template-columns: 1fr; }
  .explainer-grid { grid-template-columns: 1fr; }
  .hero { padding: 2rem 0 1.75rem; }
}
