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

:root {
  --ink: #1a1814;
  --paper: #f5f0e8;
  --paper-mid: #ede7d8;
  --paper-dark: #d8d0bc;
  --accent: #8b4513;
  --accent-light: #c4783a;
  --rule: #c8bfa8;
  --muted: #7a7060;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8e0d0;
    --paper: #18160f;
    --paper-mid: #211e15;
    --paper-dark: #2e2a1f;
    --accent: #c4783a;
    --accent-light: #e0a060;
    --rule: #3a3428;
    --muted: #8a8070;
  }
}

body {
  font-family: "Lato", sans-serif;
  background: var(--paper);
  color: var(--ink);
  margin: 0;
  padding: 2.5rem 1.5rem 3rem;
  min-height: 100vh;
}

.wc-header {
  text-align: center;
  margin-bottom: 2rem;
}

.wc-header::after {
  content: "";
  display: block;
  width: 60px;
  height: 2px;
  background: var(--accent);
  margin: 1rem auto 0;
}

.wc-title {
  font-family: "Playfair Display", serif;
  font-size: 2rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
  line-height: 1.2;
}

.wc-subtitle {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.5rem;
  font-weight: 300;
}

.wc-editor-wrap {
  position: relative;
  max-width: 720px;
  margin: 0 auto 1.5rem;
}

.wc-textarea {
  width: 100%;
  min-height: 220px;
  background: var(--paper-mid);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--accent);
  border-radius: 0 0 4px 4px;
  padding: 1.25rem 1.25rem 3rem;
  font-family: "Lato", sans-serif;
  font-size: 1.05rem;
  font-weight: 300;
  line-height: 1.75;
  color: var(--ink);
  resize: vertical;
  outline: none;
  transition: box-shadow 0.2s;
  caret-color: var(--accent);
}

.wc-textarea::placeholder {
  color: var(--muted);
  font-style: italic;
  font-family: "Playfair Display", serif;
}

.wc-textarea:focus {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.07);
}

.wc-clear-btn {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: none;
  border: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 2px;
  cursor: pointer;
  font-family: "Lato", sans-serif;
  transition: all 0.15s;
  opacity: 0;
  pointer-events: none;
}

.wc-clear-btn.visible {
  opacity: 1;
  pointer-events: auto;
}

.wc-clear-btn:hover {
  background: var(--paper-dark);
  color: var(--ink);
  border-color: var(--muted);
}

/* --- stat grids --- */
.wc-stats,
.wc-row2 {
  display: grid;
  gap: 1px;
  max-width: 720px;
  margin: 0 auto;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
}

.wc-stats {
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 1px;
  border-radius: 4px 4px 0 0;
  border-bottom: none;
}
.wc-row2 {
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 1.5rem;
  border-radius: 0 0 4px 4px;
  border-top: none;
}

.wc-stat {
  background: var(--paper-mid);
  padding: 1rem 0.75rem;
  text-align: center;
  transition: background 0.15s;
}

.wc-row2 .wc-stat {
  padding: 0.7rem 0.75rem;
}

.wc-stat:hover {
  background: var(--paper-dark);
}

.wc-stat-num {
  font-family: "JetBrains Mono", monospace;
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--ink);
  display: block;
  line-height: 1;
  margin-bottom: 0.35rem;
  transition: color 0.2s;
}

.wc-row2 .wc-stat-num {
  font-size: 1.1rem;
}

.wc-stat-num.bump {
  color: var(--accent-light);
}

.wc-stat-label {
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* --- read time bar --- */
.wc-readability {
  max-width: 720px;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--accent);
  background: var(--paper-mid);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.wc-readability-label {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.wc-readability-bar-wrap {
  flex: 1;
  height: 4px;
  background: var(--paper-dark);
  border-radius: 2px;
  overflow: hidden;
}

.wc-readability-bar {
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
  transition: width 0.4s ease;
  width: 0%;
}

.wc-readability-val {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  color: var(--ink);
  white-space: nowrap;
  min-width: 90px;
  text-align: right;
}
/* --- about section --- */
.wc-about {
  max-width: 720px;
  margin: 2.5rem auto 0;
  border-top: 1px solid var(--rule);
  padding-top: 2rem;
}

.wc-about-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

@media (max-width: 560px) {
  .wc-about-inner {
    grid-template-columns: 1fr;
  }
}

.wc-about-heading {
  font-family: "Playfair Display", serif;
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 0.75rem;
  letter-spacing: -0.01em;
}

.wc-about-col p {
  font-size: 0.82rem;
  line-height: 1.75;
  color: var(--muted);
  margin: 0 0 0.75rem;
  font-weight: 300;
}

.wc-about-col code {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  background: var(--paper-dark);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--ink);
}

.wc-about-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.wc-about-list li {
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--muted);
  font-weight: 300;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.wc-about-list em {
  font-style: italic;
  color: var(--ink);
}

.wc-pill {
  flex-shrink: 0;
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 2px;
  font-weight: 400;
  font-family: "Lato", sans-serif;
}

.wc-pill-yes {
  background: #d6ead0;
  color: #2e5e25;
}

.wc-pill-no {
  background: var(--paper-dark);
  color: var(--muted);
}

.badge {
  background-color: var(--accent);
  color: #fff;
  font-size: 13px;
  padding: 2px 8px;
  border-radius: 8px;
  top: -6px;
  position: relative;
}

@media (prefers-color-scheme: dark) {
  .wc-pill-yes {
    background: #1e3b1a;
    color: #7ec472;
  }
  .wc-pill-no {
    background: #2e2a1f;
    color: #6a6050;
  }
}
