/* ============================================================
   Second Shift — design system
   Palette: "public-service" — deep ink, warm neutral paper,
   one municipal green. Deliberately NOT Inter/purple, NOT
   cream/terracotta.
   Type: Public Sans (body) + Bricolage Grotesque (display).
   Signature: the task ledger, styled as a ruled paper ledger.
   ============================================================ */

:root {
  --ink: #16202e;
  --ink-soft: #3e4859;
  --paper: #f2f1ea;
  --card: #fbfaf5;
  --line: #d9d7cb;
  --green: #1a6b4a;
  --green-deep: #14543a;
  --green-tint: #e4efe7;
  --graphite: #565f6d;
  --graphite-tint: #ebeae2;
  --amber: #8a5c14;
  --radius: 6px;
  --font-body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Bricolage Grotesque", "Public Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { color-scheme: light; }

body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  padding: 0 1.25rem;
}

main { max-width: 56rem; margin: 0 auto; }

/* ---------- Focus & access ---------- */
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 2px; }

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

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

/* ---------- Header ---------- */
.site-header {
  max-width: 56rem; margin: 0 auto; padding: 1.4rem 0 0;
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
}
.wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
.wordmark::before { content: "\2197\00a0"; color: var(--green); }
.proto-pill {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-soft); border: 1.5px solid var(--line); border-radius: 999px;
  padding: 0.15rem 0.65rem; background: var(--card);
}

/* ---------- Thesis ---------- */
.thesis {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.75rem, 4.6vw, 2.7rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 2.6rem 0 0.7rem;
  text-wrap: balance;
}
.thesis em { font-style: normal; color: var(--green); }
.subthesis { color: var(--ink-soft); margin-bottom: 2rem; }

/* ---------- Input card ---------- */
.input-card {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: 0 1px 0 rgba(22, 32, 46, 0.05);
}
.input-card label { display: block; font-weight: 700; margin-bottom: 0.25rem; }
.input-help { color: var(--ink-soft); font-size: 0.92rem; margin-bottom: 0.8rem; }

textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--graphite);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  resize: vertical;
  min-height: 8.5rem;
}
textarea::placeholder { color: #6d7684; }
textarea:focus-visible { outline-offset: 0; }

.input-meta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin: 0.6rem 0 1rem; flex-wrap: wrap;
}
#char-count { font-size: 0.85rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

.chip {
  font: inherit; font-size: 0.88rem; font-weight: 600;
  color: var(--green-deep); background: var(--green-tint);
  border: 1.5px solid var(--green);
  border-radius: 999px; padding: 0.3rem 0.85rem; cursor: pointer;
}
.chip:hover { background: #d8e8dd; }

.analyze-btn {
  font: inherit; font-weight: 700; font-size: 1.05rem;
  color: #fff; background: var(--green);
  border: none; border-radius: var(--radius);
  padding: 0.85rem 1.5rem; cursor: pointer;
  width: 100%;
}
.analyze-btn:hover { background: var(--green-deep); }
.analyze-btn:disabled { background: var(--graphite); cursor: wait; }

.kbd-hint { text-align: center; font-size: 0.8rem; color: var(--ink-soft); margin-top: 0.5rem; }
kbd {
  font-family: inherit; font-size: 0.75rem; border: 1px solid var(--line);
  border-bottom-width: 2px; border-radius: 4px; padding: 0 0.3rem; background: var(--card);
}

/* ---------- Status & errors ---------- */
.status { min-height: 1.6rem; margin: 1.1rem 0.2rem; color: var(--green-deep); font-weight: 600; }
.status.working::before { content: ""; display: inline-block; width: 0.55rem; height: 0.55rem;
  border-radius: 50%; background: var(--green); margin-right: 0.5rem; animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }

.error-box {
  margin: 1rem 0; padding: 0.9rem 1.1rem;
  border: 1.5px solid var(--amber); border-radius: var(--radius);
  background: #f6efe0; color: #5c3d0a; font-weight: 600;
}

/* ---------- Results ---------- */
.results { margin: 0.5rem 0 3rem; }

.role-summary {
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.35rem; line-height: 1.3; margin: 1.2rem 0 0.4rem;
  text-wrap: balance;
}

.eyebrow {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--green-deep); margin: 2.4rem 0 0.15rem;
  display: flex; align-items: center; gap: 0.6rem;
}
.eyebrow::after { content: ""; flex: 1; height: 1.5px; background: var(--line); }
.section-note { color: var(--ink-soft); font-size: 0.95rem; margin-bottom: 1rem; }

/* Durable skills */
.skills-grid { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem 1.4rem; }
.skills-grid li { border-left: 3px solid var(--green); padding: 0.15rem 0 0.15rem 0.85rem; }
.skills-grid .skill-name { font-weight: 700; display: block; }
.skills-grid .skill-why { color: var(--ink-soft); font-size: 0.95rem; }

/* ---------- The ledger (signature element) ----------
   Styled as a ruled paper ledger sheet: heavy outer rule,
   double center rule, hand-sorted entries left and right. */
.ledger {
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
}
.ledger-head { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 2px solid var(--ink); }
.col-label {
  font-size: 0.82rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 0.7rem 1.1rem;
}
.automating-label { color: #fff; background: var(--graphite); }
.amplifying-label { color: #fff; background: var(--green); }

.ledger-body { display: grid; grid-template-columns: 1fr 1fr; }
.ledger-col { list-style: none; padding: 0.4rem 0 0.7rem; }
.ledger-col.automating { border-right: 3px double var(--ink); background: var(--graphite-tint); }
.ledger-col.amplifying { background: var(--green-tint); }

.ledger-col li { padding: 0.65rem 1.1rem 0.7rem; }
.ledger-col li + li { border-top: 1px solid var(--line); }
.ledger-col .task { font-weight: 700; display: block; }
.ledger-col.automating .task { color: var(--ink-soft); }
.ledger-col .rationale { font-size: 0.92rem; color: var(--ink-soft); display: block; margin-top: 0.1rem; }

/* ---------- Adjacent roles ---------- */
.roles { display: grid; gap: 1rem; }
.role-card {
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
  border-top: 4px solid var(--green);
}
.role-card h3 { font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; margin-bottom: 0.35rem; }
.role-card .fit { margin-bottom: 0.75rem; }
.role-card .fit strong { color: var(--green-deep); }

.close-skills { list-style: none; display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 0.85rem; }
.close-skills li {
  font-size: 0.85rem; font-weight: 600; color: var(--ink);
  background: var(--paper); border: 1.5px solid var(--line);
  border-radius: 999px; padding: 0.18rem 0.7rem;
}

.role-line { font-size: 0.98rem; margin-top: 0.35rem; }
.role-line .lead { font-weight: 700; }
.first-week .lead { color: var(--green-deep); }
.first-week .lead::before { content: "\2192\00a0"; }
.watch-out .lead { color: var(--amber); }

/* ---------- Caveats + copy ---------- */
.caveats {
  font-size: 0.95rem; color: var(--ink-soft);
  border-left: 3px solid var(--line); padding-left: 0.85rem; margin: 2.2rem 0 1rem;
}
.copy-chip { margin-bottom: 0.5rem; }

/* ---------- Footer ---------- */
.site-footer {
  max-width: 56rem; margin: 0 auto; padding: 1.5rem 0 2.5rem;
  border-top: 1.5px solid var(--line);
  color: var(--ink-soft); font-size: 0.92rem;
}
.honest-line { margin-bottom: 0.7rem; }
.site-footer a { color: var(--green-deep); }
.how summary { cursor: pointer; font-weight: 700; color: var(--ink); }
.how-body { padding: 0.7rem 0 0; }
.how-body p { margin-bottom: 0.7rem; max-width: 46rem; }

/* Sample-data badge (demo mode only) */
.sample-badge {
  display: inline-block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--amber); border: 1.5px dashed var(--amber);
  border-radius: 999px; padding: 0.15rem 0.7rem; margin-top: 1rem;
}

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(7px); animation: rise 0.35s ease-out forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; opacity: 1; transform: none; }
  .status.working::before { animation: none; opacity: 1; }
}

/* ---------- Small screens ---------- */
@media (max-width: 44rem) {
  .ledger-head { grid-template-columns: 1fr; }
  .ledger-head .amplifying-label { display: none; } /* re-shown as block label below */
  .ledger-body { grid-template-columns: 1fr; }
  .ledger-col.automating { border-right: none; border-bottom: 3px double var(--ink); }
  .ledger-col.amplifying::before {
    content: "\2197\00a0 AI is amplifying this";
    display: block; font-size: 0.82rem; font-weight: 700; letter-spacing: 0.1em;
    text-transform: uppercase; color: #fff; background: var(--green);
    padding: 0.7rem 1.1rem; margin: -0.4rem 0 0.3rem;
  }
  .skills-grid { grid-template-columns: 1fr; }
}

/* ---------- Print (a coach can hand the map to a client) ---------- */
@media print {
  body { background: #fff; padding: 0; font-size: 11pt; }
  .site-header, .input-card, .status, .error-box, .kbd-hint,
  .copy-chip, .how, .sample-badge { display: none !important; }
  .results { margin: 0; }
  .ledger, .role-card { break-inside: avoid; }
  .reveal { animation: none; opacity: 1; transform: none; }
}
