:root {
  --bg: #f7f7f4;
  --paper: #ffffff;
  --ink: #171713;
  --muted: #6b6b63;
  --line: #deded7;
  --line-strong: #c8c8bf;
  --accent: #2f5cff;
  --accent-soft: #eef2ff;
  --radius: 18px;
  --shadow: 0 18px 60px rgba(26, 26, 20, 0.07);
  --max: 1080px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }

.site-header {
  width: min(calc(100% - 36px), var(--max));
  margin: 0 auto;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 760;
  text-decoration: none;
  letter-spacing: -0.015em;
}
.brand-mark {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--ink);
  color: white;
  font-size: 14px;
}
nav { display: flex; gap: 22px; }
nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}
nav a:hover { color: var(--ink); }

main { width: min(calc(100% - 36px), var(--max)); margin: 0 auto; }
.hero { padding: 76px 0 42px; max-width: 790px; }
.eyebrow, .section-kicker {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--accent);
}
h1 {
  margin: 0;
  font-size: clamp(48px, 8vw, 86px);
  line-height: 0.95;
  letter-spacing: -0.065em;
  font-weight: 820;
}
.lede {
  margin: 22px 0 0;
  max-width: 660px;
  color: var(--muted);
  font-size: clamp(18px, 2.4vw, 23px);
  letter-spacing: -0.025em;
}

.counter-shell { margin-bottom: 82px; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--line);
}
.stat {
  min-height: 108px;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #fbfbf9;
}
.stat-primary { background: var(--paper); }
.stat strong {
  font-variant-numeric: tabular-nums;
  font-size: clamp(27px, 3vw, 40px);
  line-height: 1;
  letter-spacing: -0.055em;
}
.stat span { color: var(--muted); font-size: 13px; }

.editor-card {
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow);
}
.editor-toolbar {
  min-height: 58px;
  padding: 10px 14px 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}
.goal-wrap { display: flex; align-items: center; gap: 10px; }
.goal-wrap label { color: var(--muted); font-size: 13px; font-weight: 650; }
.goal-wrap input {
  width: 100px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafaf8;
  color: var(--ink);
  outline: none;
}
.goal-wrap input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.toolbar-actions { display: flex; gap: 6px; }
.button {
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 7px 12px;
  font-weight: 700;
  font-size: 13px;
}
.button-quiet { background: transparent; color: var(--muted); }
.button-quiet:hover { background: var(--bg); color: var(--ink); }
#text-input {
  display: block;
  width: 100%;
  min-height: 330px;
  resize: vertical;
  padding: 28px;
  border: 0;
  outline: none;
  color: var(--ink);
  background: var(--paper);
  font: 18px/1.75 ui-serif, Georgia, serif;
  caret-color: var(--accent);
}
#text-input::placeholder { color: #a5a59d; }
.goal-meter { padding: 14px 20px 4px; border-top: 1px solid var(--line); }
.goal-track { height: 6px; overflow: hidden; border-radius: 99px; background: var(--line); }
.goal-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width .18s ease; }
#goal-status { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.privacy-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 20px 15px;
  color: var(--muted);
  font-size: 12px;
}
.privacy-dot { width: 7px; height: 7px; border-radius: 50%; background: #24a148; box-shadow: 0 0 0 4px rgba(36,161,72,.1); }

.detail-grid { margin-top: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.detail-card {
  min-height: 240px;
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.54);
}
.detail-card h2 { margin: 0; font-size: 18px; letter-spacing: -0.025em; }
.card-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.microcopy { color: var(--muted); font-size: 12px; }
.metric-list { margin: 17px 0 0; }
.metric-list div { display: flex; justify-content: space-between; gap: 18px; padding: 10px 0; border-top: 1px solid var(--line); }
.metric-list dt { color: var(--muted); }
.metric-list dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 720; }
.empty-state { margin-top: 24px; color: var(--muted); font-size: 14px; }
.keyword-list { margin: 16px 0 0; padding: 0; list-style: none; }
.keyword-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.keyword-list .keyword-word { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 680; }
.keyword-list .keyword-count { color: var(--muted); font-variant-numeric: tabular-nums; }
.keyword-list .keyword-density { min-width: 52px; text-align: right; font-variant-numeric: tabular-nums; }

.content-section { max-width: 850px; padding: 80px 0; border-top: 1px solid var(--line); }
.content-section h2 { margin: 0 0 22px; font-size: clamp(30px, 5vw, 46px); line-height: 1.04; letter-spacing: -0.045em; }
.content-section > p { color: #3f3f39; font-size: 17px; }
.compact-section { padding-top: 72px; }
.explain-grid { margin-top: 38px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.explain-grid article { padding-top: 18px; border-top: 2px solid var(--ink); }
.explain-grid h3 { margin: 0 0 8px; font-size: 17px; }
.explain-grid p { margin: 0; color: var(--muted); font-size: 14px; }
.faq-section { padding-bottom: 110px; }
details { border-top: 1px solid var(--line); }
details:last-child { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; padding: 19px 4px; font-weight: 720; list-style-position: outside; }
details p { margin: 0; padding: 0 4px 20px; color: var(--muted); }

footer {
  width: min(calc(100% - 36px), var(--max));
  margin: 0 auto;
  padding: 28px 0 54px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.noscript { position: fixed; inset: auto 18px 18px; padding: 12px 16px; border-radius: 10px; background: #171713; color: white; z-index: 20; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 840px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
  .explain-grid { grid-template-columns: 1fr; gap: 22px; }
}
@media (max-width: 620px) {
  .site-header { min-height: 66px; }
  nav { display: none; }
  .hero { padding: 58px 0 34px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat { min-height: 92px; padding: 18px 16px; }
  .editor-toolbar { align-items: flex-start; flex-direction: column; }
  .toolbar-actions { align-self: stretch; }
  .toolbar-actions .button { flex: 1; }
  #text-input { min-height: 300px; padding: 21px; font-size: 17px; }
  .content-section { padding: 62px 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
