@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Libre+Franklin:wght@400;500;600;700&family=Newsreader:opsz,wght@6..72,400;6..72,500&display=swap');

:root {
  --ink: #252b27;
  --muted: #777c74;
  --paper: #fffefa;
  --canvas: #f2efe7;
  --line: #d9d6cd;
  --green: #1c533c;
  --green-dark: #123d2c;
  --red: #a44939;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 0%, rgba(255,255,255,.72), transparent 28rem),
    var(--canvas);
  font-family: "Libre Franklin", Arial, sans-serif;
}

button, input, textarea { font: inherit; }

button { color: inherit; }

.topbar {
  position: sticky;
  z-index: 5;
  top: 0;
  min-height: 92px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 18px 34px;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 241, 233, .92);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .18em;
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #f7f4ec;
  background: var(--green);
  font-family: "Newsreader", Georgia, serif;
  font-size: 22px;
  font-weight: 500;
}

.session-controls { display: flex; align-items: center; gap: 22px; }

.timer-display {
  min-width: 116px;
  font-family: "DM Mono", monospace;
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -.05em;
  font-variant-numeric: tabular-nums;
}

.timer-display.running { color: var(--green); }
.timer-display.urgent { color: var(--red); }

.timer-actions { display: flex; gap: 8px; }

.button {
  min-height: 42px;
  padding: 0 19px;
  border: 1px solid var(--green);
  border-radius: 2px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button-primary { color: white; background: var(--green); }
.button-primary:hover { background: var(--green-dark); }
.button-secondary { color: var(--green); background: transparent; }
.button-secondary:hover { background: rgba(28, 83, 60, .07); }

.workspace { width: min(860px, calc(100% - 40px)); margin: 54px auto 30px; }

.editor-shell {
  min-height: calc(100vh - 190px);
  display: flex;
  flex-direction: column;
  border: 1px solid #dddad1;
  background: var(--paper);
  box-shadow: 0 14px 44px rgba(55, 52, 44, .07);
}

textarea::placeholder { color: #aaa9a2; }

textarea {
  flex: 1;
  width: 100%;
  min-height: 440px;
  resize: none;
  padding: 54px 64px;
  border: 0;
  outline: 0;
  color: #30332f;
  background: transparent;
  font-family: "Newsreader", Georgia, serif;
  font-size: 15px;
  line-height: 1.75;
  caret-color: var(--green);
}

.paper-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-top: 1px solid #e8e5de;
  background: #fbfaf6;
}

.count { display: flex; align-items: baseline; gap: 7px; }
.count #wordCount { font-family: "DM Mono", monospace; font-size: 18px; font-weight: 500; }
.count span:last-child, .assistance-status { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .13em; }
.assistance-status { display: flex; align-items: center; gap: 8px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }

.privacy-note { margin: 18px 0; color: var(--muted); font-size: 11px; text-align: center; }

@media (max-width: 680px) {
  .topbar { grid-template-columns: 1fr auto; gap: 16px; padding: 14px 18px; }
  .brand span:last-child { display: none; }
  .session-controls { grid-column: 1 / -1; grid-row: 2; justify-content: space-between; width: 100%; }
  .workspace { width: calc(100% - 20px); margin-top: 20px; }
  textarea { padding: 36px 28px 40px; font-size: 18px; }
  .paper-footer { align-items: flex-start; gap: 12px; }
  .assistance-status { max-width: 150px; line-height: 1.4; text-align: right; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
