/* =====================================================================
   Tools (stealable one-pagers) for scottpresley.net
   REVIEW DRAFT. Loaded after ../styles.css; reuses its tokens
   (--bg, --ink, --accent, --font-sans, --font-display, --radius).
   Adds one token: --accent-light (#d4bc94, the Keystone highlight brass
   already used in the header glyph).
   ===================================================================== */

:root {
  --accent-light: #d4bc94;
}

/* -- Nav: current page -- */
.nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

/* -- Homepage Tools section (index.tools-draft.html) -- */
.tools-home {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem 3.5rem;
}

.tools-home__header {
  margin-bottom: 1.5rem;
  max-width: 40rem;
}

.tools-home__header h2,
.tools-landing h1 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.tools-home__lede,
.tools-landing__lede {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  max-width: 38rem;
}

.tool-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}

.tool-grid > li {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.tool-card__dl {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  align-self: flex-start;
  border-bottom: 1px solid transparent;
  padding-bottom: 0.08rem;
}

.tool-card__dl:hover,
.tool-card__dl:focus-visible {
  border-bottom-color: var(--accent);
  outline: none;
}

.tool-card {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  width: 100%;
  padding: 1.15rem 1.1rem 1.1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

a.tool-card:hover,
a.tool-card:focus-visible {
  border-color: var(--accent);
  background: #161616;
  transform: translateY(-2px);
  outline: none;
}

.tool-card__ep {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.tool-card__name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
  line-height: 1.3;
}

.tool-card__purpose {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.tool-card__cta {
  margin-top: auto;
  padding-top: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
}

.tools-home__more {
  margin: 1rem 0 0;
  font-size: 0.92rem;
  font-weight: 500;
}

.tools-home__more a,
.text-link {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 0.08rem;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.tools-home__more a:hover,
.tools-home__more a:focus-visible,
.text-link:hover,
.text-link:focus-visible {
  color: var(--accent);
  border-bottom-color: var(--accent);
  outline: none;
}

/* -- Tools landing (tools/index.html) -- */
.tools-landing {
  max-width: var(--max);
  margin: 0 auto;
  padding: 3rem 1.5rem 3.5rem;
}

.tools-landing__header {
  margin-bottom: 1.75rem;
  max-width: 42rem;
}

.tools-landing__note {
  margin: 1.5rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* -- Worksheet pages -- */
.tool {
  max-width: 62rem;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3rem;
}

.sheet {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem 1.75rem 1.5rem;
}

.sheet__head {
  border-bottom: 2px solid var(--accent);
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem 1.5rem;
  align-items: end;
}

.sheet__head .eyebrow {
  grid-column: 1 / -1;
  margin: 0;
}

.sheet h1 {
  margin: 0;
  font-size: clamp(1.7rem, 3.4vw, 2.3rem);
  letter-spacing: -0.03em;
}

.sheet__purpose {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--ink);
  font-size: 1.02rem;
  max-width: 46rem;
}

.sheet__source {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.sheet__source a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
}

.sheet__source a:hover,
.sheet__source a:focus-visible {
  color: var(--accent);
  border-bottom-color: var(--accent);
  outline: none;
}

.sheet__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  align-items: center;
}

.print-btn {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: #0a0a0a;
  background: var(--accent);
  border: 0;
  border-radius: 999px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

a.print-btn {
  color: #0a0a0a;
}

.print-btn--secondary {
  background: transparent;
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.print-btn--secondary:hover,
.print-btn--secondary:focus-visible {
  background: transparent;
  color: var(--accent-light);
  box-shadow: inset 0 0 0 1px var(--accent-light);
}

.print-btn:hover,
.print-btn:focus-visible {
  background: var(--accent-light);
  outline: none;
  box-shadow: 0 0 0 2px var(--bg-elevated), 0 0 0 3px var(--accent);
}

.block {
  margin: 0 0 1.2rem;
}

.block h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--accent);
}

.block h2 .q {
  display: inline-block;
  min-width: 1.6rem;
  color: var(--accent-light);
}

.block h3 {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.hint {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.rule {
  margin: 0.5rem 0 0;
  padding: 0.55rem 0.8rem;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 6px 6px 0;
  font-size: 0.88rem;
  color: var(--ink);
}

/* Fill-in tables */
.ws {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  table-layout: fixed;
}

.ws caption {
  text-align: left;
  font-size: 0.78rem;
  color: var(--muted);
  padding-bottom: 0.35rem;
}

.ws th,
.ws td {
  border: 1px solid var(--line-strong);
  padding: 0.4rem 0.5rem;
  text-align: left;
  vertical-align: top;
}

.ws thead th {
  background: rgba(196, 165, 116, 0.1);
  color: var(--accent-light);
  font-weight: 600;
  font-size: 0.76rem;
  letter-spacing: 0.04em;
}

.ws thead th small {
  display: block;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0;
}

.ws tbody th {
  font-weight: 600;
  color: var(--ink);
}

.ws td.blank {
  height: 2.1rem;
}

.ws tr.capacity-line td,
.ws tr.capacity-line th {
  border-top: 3px solid var(--accent);
}

.capacity-label {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

/* Field lines (label + write-in space) */
.fields {
  display: grid;
  grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr));
  gap: 0.6rem 1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.field__label {
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.field__line {
  display: block;
  min-height: 1.7rem;
  border-bottom: 1px solid var(--line-strong);
}

.field__line--tall {
  min-height: 3.2rem;
}

/* Checklists */
.checks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.checks li {
  display: grid;
  grid-template-columns: 1.1rem 1fr;
  gap: 0.6rem;
  align-items: start;
  font-size: 0.92rem;
}

.box {
  display: inline-block;
  width: 0.95rem;
  height: 0.95rem;
  margin-top: 0.22rem;
  border: 1.5px solid var(--accent);
  border-radius: 3px;
}

.box--round {
  border-radius: 50%;
}

.box--done {
  background: var(--accent);
}

/* Outcome choices (three equal controls) */
.choices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}

.choice {
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  font-size: 0.86rem;
}

.choice__name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink);
  margin-bottom: 0.25rem;
}

.choice__name .box {
  margin-top: 0;
}

.choice p {
  margin: 0 0 0.4rem;
  color: var(--muted);
}

.choice--muted {
  opacity: 0.72;
}

.choice--picked {
  border-color: var(--accent);
}

/* Phase columns (90-day map) */
.phases {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.phase {
  border: 1px solid var(--line-strong);
  border-top: 3px solid var(--accent);
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
  font-size: 0.86rem;
}

.phase h3 {
  margin-bottom: 0.15rem;
  color: var(--accent);
}

.phase__goal {
  margin: 0 0 0.45rem;
  font-weight: 600;
  color: var(--ink);
}

.phase .checks li {
  font-size: 0.84rem;
}

.phase__split {
  margin: 0.55rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.phase__split strong {
  color: var(--ink);
}

/* Two-up columns */
.two-up {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.ai-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  font-size: 0.84rem;
}

.ai-split div {
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
}

.ai-split h3 {
  margin-bottom: 0.25rem;
}

.ai-split ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

/* AI prompt box (gate card) */
.prompt {
  border: 1px dashed var(--accent);
  border-radius: 8px;
  padding: 0.65rem 0.8rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.prompt p {
  margin: 0 0 0.35rem;
}

.prompt pre {
  margin: 0;
  white-space: pre-wrap;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: var(--ink);
}

/* Worked example */
.example {
  margin-top: 1.5rem;
  padding-top: 1.1rem;
  border-top: 1px dashed var(--line-strong);
}

.example > h2 {
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--ink);
}

.example .ws td,
.example .ws th,
.example dd,
.example li {
  color: var(--muted);
}

.example .ws tbody th {
  color: var(--ink);
}

.example dl {
  margin: 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.3rem 1rem;
  font-size: 0.88rem;
}

.example dt {
  font-weight: 600;
  color: var(--ink);
}

.example dd {
  margin: 0;
}

.sheet__print-foot {
  display: none;
}

/* Footer links under the sheet */
.tool-foot {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.92rem;
  font-weight: 500;
}

.visually-hidden {
  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: 860px) {
  .tool,
  .tools-landing {
    padding: 1.75rem 1.15rem 2.5rem;
  }

  .tools-home {
    padding: 0 1.15rem 2.75rem;
  }

  .sheet {
    padding: 1.2rem 1rem 1.1rem;
  }

  .tool-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .phases,
  .choices,
  .two-up,
  .ai-split {
    grid-template-columns: 1fr;
  }

  .fields {
    grid-template-columns: 1fr 1fr;
  }

  .table-scroll {
    overflow-x: auto;
  }

  .table-scroll .ws {
    min-width: 44rem;
  }
}

@media (max-width: 560px) {
  .tool-grid,
  .fields {
    grid-template-columns: 1fr;
  }

  .sheet__head {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tool-card,
  .print-btn,
  .text-link,
  .tools-home__more a {
    transition: none;
  }

  a.tool-card:hover,
  a.tool-card:focus-visible {
    transform: none;
  }
}

/* -- Print: paper worksheet, ink on white, brass rules -- */
@media print {
  @page {
    size: letter portrait;
    margin: 0.45in;
  }

  :root {
    --ink: #0a0a0a;
    --muted: #444;
    --line: #bbb;
    --line-strong: #888;
    --accent-soft: transparent;
  }

  html,
  body {
    background: #fff !important;
    color: #0a0a0a;
    font-size: 9.5pt;
    min-height: 0;
  }

  .skip-link,
  .site-header,
  .site-footer,
  .tool-foot,
  .print-btn,
  .sheet__actions,
  .tool-card__dl {
    display: none !important;
  }

  .tool {
    max-width: none;
    padding: 0;
  }

  .sheet {
    background: #fff;
    border: 0;
    border-radius: 0;
    padding: 0;
  }

  .sheet h1 {
    font-size: 17pt;
    color: #0a0a0a;
  }

  .sheet__head {
    margin-bottom: 0.6rem;
    padding-bottom: 0.5rem;
  }

  .sheet__purpose {
    font-size: 9.5pt;
  }

  .sheet__source {
    font-size: 8pt;
  }

  .eyebrow,
  .block h2,
  .phase h3,
  .capacity-label {
    color: #8a6a3a;
  }

  .block {
    margin-bottom: 0.55rem;
    break-inside: avoid;
  }

  .block h2 {
    font-size: 10.5pt;
    margin-bottom: 0.25rem;
  }

  .hint {
    font-size: 8pt;
    margin-bottom: 0.25rem;
  }

  .rule {
    border-left-color: #c4a574;
    font-size: 8.5pt;
    padding: 0.3rem 0.5rem;
  }

  .ws {
    font-size: 8.5pt;
  }

  .ws th,
  .ws td {
    border-color: #888;
    padding: 0.22rem 0.35rem;
  }

  .ws thead th {
    background: #f3ece1 !important;
    color: #0a0a0a;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .ws td.blank {
    height: 1.55rem;
  }

  .box {
    border-color: #0a0a0a;
  }

  .box--done {
    background: #c4a574;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .choice,
  .phase,
  .ai-split div,
  .prompt {
    border-color: #888;
  }

  .phase {
    border-top-color: #c4a574;
  }

  .example {
    break-before: page;
    border-top: 0;
    margin-top: 0;
    padding-top: 0;
  }

  .example .ws td,
  .example dd,
  .example li {
    color: #333;
  }

  /* Undo the narrow-screen stacking: paper width trips the 860px query */
  .phases,
  .choices {
    grid-template-columns: repeat(3, 1fr) !important;
  }

  .two-up,
  .ai-split {
    grid-template-columns: 1fr 1fr !important;
  }

  .fields {
    grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)) !important;
    gap: 0.35rem 0.8rem;
  }

  .sheet__head {
    grid-template-columns: 1fr auto !important;
  }

  .table-scroll {
    overflow: visible;
  }

  .table-scroll .ws {
    min-width: 0;
  }

  .field__line {
    min-height: 1.35rem;
  }

  .choice {
    padding: 0.4rem 0.55rem;
  }

  .choice p {
    margin-bottom: 0.15rem;
    font-size: 8pt;
  }

  .prompt,
  .prompt pre {
    font-size: 7.5pt;
  }

  .prompt {
    padding: 0.35rem 0.55rem;
  }

  .checks {
    gap: 0.15rem;
  }

  .checks li,
  .phase .checks li {
    font-size: 8.5pt;
  }

  .phase {
    padding: 0.45rem 0.55rem;
    font-size: 8.5pt;
  }

  .phase__split {
    font-size: 7.5pt;
  }

  .sheet__print-foot {
    display: block;
    margin-top: 0.5rem;
    padding-top: 0.3rem;
    border-top: 1px solid #c4a574;
    font-size: 7.5pt;
    color: #444;
  }

  a {
    color: #0a0a0a;
    text-decoration: none;
  }
}

/* -- Small fixes -- */
.ws th small {
  display: block;
  font-weight: 400;
  color: var(--muted);
}

.lens-list {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.2rem;
}
