/* ─────────────────────────────────────────────────────────────────
   adhdpm.com
   Ink on pale blue-grey paper. Teal marks current state, amber marks
   stale or blocked — the two accents carry meaning, nothing else.
   ───────────────────────────────────────────────────────────────── */

:root {
  --paper:        #eaedf2;
  --paper-raised: #f7f8fa;
  --ink:          #15202b;
  --ink-soft:     #4a5a6a;
  --rule:         #c8d0da;
  --teal:         #0e6b57;
  --amber:        #b8761f;

  --measure: 34rem;        /* ~68 characters of Source Serif */
  --gutter: 1.5rem;
  --step: 1.5rem;

  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --text: "Source Serif 4", Georgia, "Times New Roman", serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-optical-sizing: auto;
}

main {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

p { max-width: var(--measure); }

a {
  color: var(--teal);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1rem;
  z-index: 10;
}
.skip:focus { left: 0; }

/* ─── Hero ────────────────────────────────────────────────────── */

.hero {
  max-width: 44rem;
  margin: 0 auto;
  padding: 3.5rem var(--gutter) 0;
}

.wordmark {
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
  margin: 0 0 3rem;
}

.hero h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.1rem, 6.2vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.021em;
  margin: 0 0 1.25rem;
  max-width: 19ch;
  text-wrap: balance;
}

.standfirst {
  font-size: 1.1875rem;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0 0 2.75rem;
}

/* The state-reload block — the hero device */
.state {
  margin: 0;
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--rule);
}

.state-row {
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: 0 1.75rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--rule);
}
.state-row:last-child { border-bottom: 0; }

.state dt {
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.55;
  padding-top: 0.18rem;
  color: var(--ink-soft);
}

.state dd {
  margin: 0;
  max-width: var(--measure);
}

.mark {
  font-family: var(--display);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.14em 0.5em;
  border-radius: 2px;
  margin-right: 0.45rem;
  vertical-align: 0.1em;
  white-space: nowrap;
}
.mark-live  { background: var(--teal);  color: #fff; }
.mark-stale { background: var(--amber); color: #fff; }

.state-note {
  font-size: 0.95rem;
  color: var(--ink-soft);
  font-style: italic;
  margin: 1rem 0 0;
}

/* ─── Section rhythm ──────────────────────────────────────────── */

.tool, .systems, .signup, .bio {
  padding-top: calc(var(--step) * 2.8);
}

h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.5rem, 3.6vw, 2rem);
  line-height: 1.18;
  letter-spacing: -0.015em;
  margin: 0 0 0.7rem;
  max-width: 26ch;
  text-wrap: balance;
}

/* ─── Tool ────────────────────────────────────────────────────── */

.tool-sub {
  color: var(--ink-soft);
  margin: 0 0 1.5rem;
}

#tool-form { margin: 0; }

textarea {
  width: 100%;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--ink);
  border-radius: 2px;
  padding: 1rem 1.1rem;
  font-family: var(--text);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  resize: vertical;
  min-height: 11rem;
}
textarea::placeholder { color: #8d99a6; }
textarea:focus-visible { border-left-color: var(--teal); }

.tool-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.9rem;
  flex-wrap: wrap;
}

button {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1rem;
  background: var(--ink);
  color: var(--paper-raised);
  border: 0;
  border-radius: 2px;
  padding: 0.7rem 1.4rem;
  cursor: pointer;
}
button:hover { background: var(--teal); }
button[disabled] { opacity: 0.55; cursor: default; }
button[disabled]:hover { background: var(--ink); }

.counter {
  font-family: var(--display);
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.counter.over { color: var(--amber); }

.fineprint {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin: 0.75rem 0 0;
}

/* Output — the one orchestrated moment on the page */
.output { margin-top: 2rem; }
.output[hidden] { display: none; }

.out-block { margin-bottom: 1.75rem; }

.out-block h3 {
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 0 0 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--rule);
}

.out-block ul { margin: 0; padding-left: 1.1rem; }
.out-block li { margin-bottom: 0.45rem; }
.out-block p { margin: 0; }

.owner {
  font-family: var(--display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--teal);
}
.owner-unknown { color: var(--amber); }

.copy-row { margin-top: 0.5rem; }
.copy-row button {
  background: transparent;
  color: var(--teal);
  border: 1px solid var(--rule);
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}
.copy-row button:hover { background: var(--teal); color: #fff; }

.reveal { animation: rise 320ms ease-out both; }
@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.error {
  margin-top: 1.25rem;
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--amber);
  background: var(--paper-raised);
  color: var(--ink);
  font-size: 0.95rem;
  max-width: var(--measure);
}
.error[hidden] { display: none; }

/* ─── Systems ─────────────────────────────────────────────────── */

.system {
  padding: 1.25rem 0;
  border-top: 1px solid var(--rule);
}
.system:first-of-type { border-top: 2px solid var(--ink); }

.system h3 {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
  letter-spacing: -0.01em;
}
.system p { margin: 0; color: var(--ink-soft); }

/* ─── Signup ──────────────────────────────────────────────────── */

.subscribe {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: var(--paper-raised);
  border-left: 3px solid var(--teal);
  border-radius: 2px;
}

.subscribe label {
  display: block;
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.subscribe-row { display: flex; gap: 0.6rem; flex-wrap: wrap; }

.subscribe input {
  flex: 1 1 15rem;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.7rem 0.85rem;
  font-family: var(--text);
  font-size: 1rem;
  color: var(--ink);
  min-width: 0;
}
.subscribe input::placeholder { color: #8d99a6; }

/* ─── Bio + footer ────────────────────────────────────────────── */

.bio p { color: var(--ink-soft); }

footer {
  max-width: 44rem;
  margin: calc(var(--step) * 3) auto 0;
  padding: 1.5rem var(--gutter) 3rem;
  border-top: 1px solid var(--rule);
}
footer p {
  font-size: 0.875rem;
  color: var(--ink-soft);
  margin: 0;
  max-width: var(--measure);
}
.colophon {
  font-family: var(--display);
  margin-top: 0.75rem !important;
}

/* ─── Narrow screens ──────────────────────────────────────────── */

@media (max-width: 36rem) {
  :root { --gutter: 1.15rem; }

  .hero { padding-top: 2.5rem; }
  .wordmark { margin-bottom: 2rem; }

  .state-row {
    grid-template-columns: 1fr;
    gap: 0.3rem;
    padding: 0.95rem 0;
  }
  .state dt { padding-top: 0; }

  .tool-bar button { width: 100%; }
  .subscribe { padding: 1.15rem; }
  .subscribe-row button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; }
  * { transition: none !important; }
}
