/* Reset & base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 100%; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: #faf9f6;
  color: #1a1a1a;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background 0.3s, color 0.3s;
}
body.dark {
  background: #121212;
  color: #e0e0e0;
}

/* Theme toggle */
.theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 100;
}
.theme-toggle button {
  background: transparent;
  border: none;
  cursor: pointer;
  color: inherit;
  padding: 0.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.theme-toggle button:hover { background: rgba(128,128,128,0.15); }

/* Navigation */
header {
  border-bottom: 1px solid rgba(0,0,0,0.08);
  padding: 0.75rem 2rem;
}
body.dark header { border-bottom-color: rgba(255,255,255,0.08); }
.nav {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.logo {
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
  color: inherit;
  letter-spacing: -0.02em;
}
.nav-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.nav-links a {
  text-decoration: none;
  color: inherit;
  opacity: 0.75;
  font-size: 0.95rem;
  transition: opacity 0.2s;
}
.nav-links a:hover { opacity: 1; }

/* Main */
main {
  flex: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  width: 100%;
}

/* Hero */
.hero {
  text-align: center;
  margin-bottom: 2.5rem;
}
.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}
.hero-sub {
  font-size: 1.1rem;
  max-width: 520px;
  margin: 0 auto 1.5rem;
  opacity: 0.8;
}

/* Tracker section */
.tracker {
  background: #ffffff;
  border-radius: 1.5rem;
  padding: 2rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
  margin-bottom: 3rem;
  transition: background 0.3s;
}
body.dark .tracker { background: #1e1e1e; box-shadow: 0 4px 24px rgba(0,0,0,0.3); }

.goal-setter, .word-entry {
  width: 100%;
  max-width: 400px;
}
.goal-setter label, .word-entry label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
  opacity: 0.7;
}
.input-row {
  display: flex;
  gap: 0.5rem;
}
.input-row input {
  flex: 1;
  padding: 0.7rem 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 0.75rem;
  font-size: 1rem;
  background: #fafafa;
  color: inherit;
  transition: border 0.2s;
  min-width: 0;
}
body.dark .input-row input {
  background: #2a2a2a;
  border-color: #444;
}
.input-row input:focus {
  outline: none;
  border-color: #4f46e5;
}
.input-row button {
  padding: 0.7rem 1.4rem;
  background: #4f46e5;
  color: #fff;
  border: none;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  white-space: nowrap;
}
.input-row button:hover { background: #4338ca; }
.input-row button:active { transform: scale(0.97); }

/* Progress ring */
.progress-ring-container {
  width: 200px;
  height: 200px;
}
.progress-ring {
  width: 100%;
  height: 100%;
}
.ring-bg {
  stroke: #e5e7eb;
}
body.dark .ring-bg { stroke: #333; }
.ring-fill {
  stroke: #4f46e5;
  transition: stroke-dashoffset 0.5s ease;
}
.ring-percent { fill: currentColor; }
.ring-label { fill: currentColor; opacity: 0.6; }

/* Stats */
.stats {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  justify-content: center;
}
.stat {
  text-align: center;
}
.stat-value {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
}
.stat-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.65;
}

/* Milestone */
.milestone {
  font-size: 1rem;
  font-weight: 600;
  color: #4f46e5;
  min-height: 1.5em;
  text-align: center;
}
body.dark .milestone { color: #818cf8; }

/* Streak */
.streak {
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  opacity: 0.8;
}
.streak-icon { font-size: 1.2rem; }

/* Actions */
.actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}
.secondary {
  padding: 0.6rem 1.4rem;
  background: transparent;
  border: 2px solid #d1d5db;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  color: inherit;
  transition: background 0.2s;
}
body.dark .secondary { border-color: #444; }
.secondary:hover { background: rgba(128,128,128,0.1); }

/* Info section */
.info {
  margin-bottom: 2rem;
}
.info h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}
.info p {
  margin-bottom: 1rem;
  opacity: 0.85;
  font-size: 1.05rem;
}

/* Footer */
footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.85rem;
  opacity: 0.6;
  border-top: 1px solid rgba(0,0,0,0.06);
}
body.dark footer { border-top-color: rgba(255,255,255,0.06); }

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* Responsive */
@media (max-width: 600px) {
  .hero h1 { font-size: 1.8rem; }
  .tracker { padding: 1.5rem 1rem; }
  .stats { gap: 1.25rem; }
  .stat-value { font-size: 1.4rem; }
  .input-row { flex-direction: column; }
  .input-row button { width: 100%; }
  .nav { flex-direction: column; align-items: flex-start; }
}

/* About / legal pages */
.page-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}
.page-content h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}
.page-content p {
  margin-bottom: 1rem;
  opacity: 0.85;
}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
