/* =========================================
   GLOBAL COLOR SYSTEM (LIGHT + DARK)
========================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #f1f5f9;            /* page background (soft gray) */
  --card: #ffffff;         /* main cards */
  --card-soft: #e9f4ff;    /* textarea + stat cards */

  --text: #0f172a;
  --text-muted: #475569;

  --border: #e2e8f0;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.15);
}

:root.dark {
  --bg: #0b1220;
  --card: #111827;
  --card-soft: #0f172a;

  --text: #e5e7eb;
  --text-muted: #9ca3af;

  --border: #1f2937;
  --accent: #60a5fa;
  --accent-soft: rgba(96, 165, 250, 0.25);
}


/* =========================================
   BASE / RESET
========================================= */

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* =========================================
   HEADER
========================================= */

.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1100px;
  margin: auto;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo a {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text);
}

.nav a {
  margin: 0 10px;
  color: var(--text-muted);
}

.nav a:hover {
  color: var(--accent);
}

#themeToggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  color: var(--text);
}

/* =========================================
   HEADER Responsive
========================================= */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 18px;
  color: var(--text);
}

/* Mobile Nav */
@media (max-width: 768px) {
  .nav {
    position: absolute;
    top: 64px;
    right: 18px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    display: none;
    flex-direction: column;
    width: 220px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  }

  .nav a {
    margin: 8px 0;
  }

  .nav.open {
    display: flex;
  }

  .menu-toggle {
    display: inline-block;
  }
}


/* =========================================
   LAYOUT
========================================= */

.container {
  max-width: 980px;
  margin: auto;
  padding: 30px 18px 70px;
}

/* =========================================
   COUNTER TOOL
========================================= */

.tool {
  background: var(--card);
  border-radius: 16px;
  padding: 24px;
  margin-top: 28px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.08);
}


.tool textarea {
  width: 100%;
  max-width: 100%;
  min-height: 240px;
  padding: 16px 18px;
  font-size: 16px;
  line-height: 1.6;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card-soft);
  color: var(--text);
  resize: vertical;
}

.tool textarea::placeholder {
  color: var(--text-muted);
}

.tool textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

/* Controls */

.controls {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.controls button {
  background: var(--card-soft);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 14px;
  font-size: 14px;
  border-radius: 8px;
  cursor: pointer;
  
}

.controls button:hover {
  background: rgba(0,0,0,0.04);
}

:root.dark .controls button:hover {
  background: rgba(255,255,255,0.06);
}

/* Stats */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.stat {
  background: var(--card-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 12px;
  text-align: center;
}

.stat strong {
  display: block;
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}

.privacy {
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-muted);
}

/* =========================================
   CONTENT / ARTICLE
========================================= */

article {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  margin-top: 40px;
}

article h2 {
  margin-top: 36px;
  font-size: 1.7rem;
  color: var(--text);
}

article h2:first-child {
  margin-top: 0;
}

article h3 {
  margin-top: 22px;
  font-size: 1.2rem;
  color: var(--text);
}

article p {
  margin: 10px 0;
  color: var(--text-muted);
}

article ul {
  margin: 12px 0 12px 20px;
}

article li {
  margin-bottom: 6px;
  color: var(--text-muted);
}

/* =========================================
   FOOTER
========================================= */

footer,
.site-footer {
  text-align: center;
  margin-top: 60px;
  font-size: 14px;
  color: var(--text-muted);
}

.footer-inner a {
    color: var(--text-muted);
}

/* =========================================
   RESPONSIVE
========================================= */

@media (max-width: 600px) {
  h1 {
    font-size: 1.8rem;
  }
}
