/* site.css - whitmanhm.org design system
   Palette derived from the Campbell PowerShell terminal scheme (the console this
   site's subject actually works in): deep console navy, Campbell bright cyan for
   links and structure, Campbell bright yellow reserved for "What if:" moments. */

/* ---------- tokens ---------- */

:root {
  --bg: #0A1626;          /* page background: deepened PS console blue (#012456) */
  --panel: #0E1E36;       /* raised surfaces: cards, terminal chrome */
  --term: #081120;        /* terminal body: darker than the page */
  --rule: #22385C;        /* hairlines and borders */
  --ink: #E9EEF6;         /* primary text */
  --muted: #96A9C8;       /* secondary text */
  --cyan: #61D6D6;        /* Campbell brightCyan: links, eyebrows, prompts */
  --whatif: #F9F1A5;      /* Campbell brightYellow: "What if:" lines only */
  --warn: #E5C07B;        /* warning stream */
  --err: #FF8389;         /* error stream (404 page) */

  --font-mono: 'Cascadia Code', 'Cascadia Mono', Consolas, 'SF Mono', Menlo, monospace;
  --font-body: system-ui, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  --wrap-max: 1080px;
  --prose-max: 68ch;
}

@font-face {
  font-family: 'Cascadia Code';
  src: url('../fonts/CascadiaCode.woff2') format('woff2');
  font-weight: 200 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- base ---------- */

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--cyan);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
  border-radius: 2px;
}

::selection {
  background: var(--cyan);
  color: var(--bg);
}

code {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

.wrap {
  max-width: var(--wrap-max);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

/* ---------- header / nav (duplicated static markup per page) ---------- */

.site-header {
  border-bottom: 1px solid var(--rule);
}

.header-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.1rem;
  flex-wrap: wrap;
}

.brand {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink);
  text-decoration: none;
}

.brand:hover {
  color: var(--cyan);
}

.site-nav {
  display: flex;
  gap: 1.4rem;
}

.site-nav a {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--ink);
}

.site-nav a[aria-current='page'] {
  color: var(--cyan);
  text-decoration: underline;
  text-underline-offset: 5px;
}

/* ---------- headings and structure ---------- */

/* Section headings are set as PowerShell comments: "# work", "# contact".
   The hash is decorative markup (aria-hidden in the HTML). */
.eyebrow {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: 0.04em;
  color: var(--cyan);
  margin: 0 0 1.2rem;
}

.section {
  padding-block: clamp(2.5rem, 7vw, 4.5rem);
  border-top: 1px solid var(--rule);
}

/* ---------- hero ---------- */

.hero {
  padding-block: clamp(3.5rem, 10vw, 6.5rem);
}

.hero-meta {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0 0 1.4rem;
  max-width: none;
}

.hero h1 {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: clamp(1.65rem, 4.5vw, 2.6rem);
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 0 0 1.4rem;
}

/* Blinking block cursor at the end of the headline. Static when motion is reduced. */
.cursor {
  display: inline-block;
  width: 0.5em;
  height: 1em;
  margin-left: 0.15em;
  vertical-align: text-bottom;
  background: var(--cyan);
  animation: blink 1.1s steps(2, start) infinite;
}

@keyframes blink {
  to {
    visibility: hidden;
  }
}

.hero .lede {
  color: var(--muted);
  font-size: 1.1rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2rem;
}

/* Links styled as commands: "> walk through the rebuild" */
.cmd-link {
  font-family: var(--font-mono);
  font-size: 0.98rem;
  color: var(--ink);
  text-decoration: none;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.65rem 1.1rem;
  transition: border-color 120ms ease, color 120ms ease;
}

.cmd-link:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.cmd-link.quiet {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.cmd-link.quiet:hover {
  color: var(--cyan);
}

/* ---------- terminal panel (the index signature element) ---------- */

.term {
  background: var(--term);
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
  margin-block: 1.6rem;
}

.term-title {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
  background: var(--panel);
  border-bottom: 1px solid var(--rule);
  padding: 0.5rem 1rem;
}

/* Long lines wrap, as they do in a real console; the panel never scrolls sideways. */
.term-body {
  margin: 0;
  padding: 1rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.t-prompt { color: var(--cyan); }
.t-cmd    { color: var(--ink); }
.t-info   { color: var(--muted); }
.t-warn   { color: var(--warn); }
.t-whatif { color: var(--whatif); }
.t-err    { color: var(--err); }

.term-caption {
  font-size: 0.92rem;
  color: var(--muted);
  max-width: var(--prose-max);
}

/* ---------- case-study cards ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 1rem;
  margin-top: 1.6rem;
  padding: 0;
  list-style: none;
}

.card {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1.25rem 1.4rem;
}

.card h3 {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.02rem;
  line-height: 1.4;
  margin: 0 0 0.6rem;
}

.card p {
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0 0 0.9rem;
}

.card .tags {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--cyan);
  letter-spacing: 0.03em;
}

/* ---------- contact ---------- */

.contact-list {
  list-style: none;
  padding: 0;
  margin: 1.4rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.contact-list a {
  font-family: var(--font-mono);
  font-size: 0.98rem;
  text-decoration: none;
}

.contact-list a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.contact-list .t-prompt {
  user-select: none;
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--rule);
  margin-top: clamp(2.5rem, 7vw, 4.5rem);
  padding-block: 2.2rem 2.8rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.site-footer p {
  margin: 0.35rem 0;
}

/* ---------- error page ---------- */

.error-main {
  padding-block: clamp(3.5rem, 10vw, 6.5rem);
}

/* ---------- walkthrough: sticky progress nav ---------- */

html {
  scroll-behavior: smooth;
}

.progress {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}

.progress-row {
  display: flex;
  gap: 1.4rem;
  overflow-x: auto;
  padding-block: 0.65rem;
}

.progress a {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

.progress a:hover {
  color: var(--ink);
}

.progress a[aria-current='true'] {
  color: var(--cyan);
}

.demo-main section {
  padding-block: clamp(2.5rem, 7vw, 4.5rem);
  border-top: 1px solid var(--rule);
  scroll-margin-top: 3.5rem;
}

.demo-main section:first-of-type {
  border-top: none;
}

/* ---------- walkthrough: code and exhibit blocks ---------- */

/* Base styling for every highlighted code block on the walkthrough. */
pre[class*='language-'] {
  background: var(--term);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  overflow-x: auto;
  margin-block: 1.2rem;
}

code[class*='language-'] {
  font-family: var(--font-mono);
  color: var(--ink);
  text-shadow: none;
}

/* Prism token theme, matched to the site palette. Echoes the VS Code dark
   PowerShell colors an engineer sees daily. */
.token.comment  { color: #7A8CA8; }
.token.string   { color: #CE9178; }
.token.keyword  { color: #C586C0; }
.token.function { color: #61AFEF; }
.token.variable { color: #9CDCFE; }
.token.boolean,
.token.number   { color: #D19A66; }
.token.operator,
.token.punctuation { color: #96A9C8; }
.token.namespace   { color: #61D6D6; }

/* Line-highlight plugin: tint the annotated lines. */
.line-highlight {
  background: rgba(249, 241, 165, 0.07);
  border-left: 2px solid var(--whatif);
}

/* Line-numbers plugin: mute the gutter. */
.line-numbers .line-numbers-rows {
  border-right: 1px solid var(--rule);
}

.line-numbers-rows > span:before {
  color: #55688A;
}

/* Raw-text exhibits (the prompt, the standards excerpt). */
.exhibit {
  background: var(--term);
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
  margin-block: 1.2rem;
}

.exhibit-title {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
  background: var(--panel);
  border-bottom: 1px solid var(--rule);
  padding: 0.5rem 1rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.exhibit-pre {
  margin: 0;
  padding: 1rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.65;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

/* Annotation list under the legacy script. */
.annotations {
  list-style: none;
  padding: 0;
  margin: 1.2rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  max-width: var(--prose-max);
}

.annotations .line-ref {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--whatif);
  margin-right: 0.5rem;
  white-space: nowrap;
}

.annotations li {
  color: var(--muted);
  font-size: 0.97rem;
}

/* ---------- walkthrough: decisions accordion ---------- */

.decision {
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--panel);
  margin-block: 0.7rem;
}

.decision summary {
  cursor: pointer;
  padding: 0.9rem 1.2rem;
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  flex-wrap: wrap;
  list-style: none;
}

.decision summary::-webkit-details-marker {
  display: none;
}

.decision summary::before {
  content: '+';
  font-family: var(--font-mono);
  color: var(--cyan);
  flex-shrink: 0;
}

.decision[open] summary::before {
  content: '-';
}

.decision .d-num {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--cyan);
}

.decision .d-title {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--ink);
}

.decision .d-sub {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 0.92rem;
  padding-left: 1.8rem;
}

.decision .d-body {
  padding: 0 1.2rem 1.1rem;
  border-top: 1px solid var(--rule);
}

.decision .d-body p {
  color: var(--muted);
  font-size: 0.97rem;
}

.decision .d-body p:first-child {
  margin-top: 1rem;
}

.decision .d-compare a {
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

/* ---------- walkthrough: comparison strips ---------- */

.comparison {
  border-top: 1px dashed var(--rule);
  padding-block: 1.8rem;
  scroll-margin-top: 4.5rem;
}

.comparison h3 {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.05rem;
  margin: 0 0 1rem;
}

.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}

@media (max-width: 860px) {
  .compare-grid {
    grid-template-columns: 1fr;
  }
}

/* min-width: 0 lets the code block shrink inside the grid track instead of
   blowing the column out past the viewport (grid items default to min-width auto). */
.compare-cell {
  min-width: 0;
}

.compare-cell .cell-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 0 0 0.5rem;
}

.compare-cell .cell-label .side-before {
  color: var(--warn);
}

.compare-cell .cell-label .side-after {
  color: var(--cyan);
}

.compare-cell .cell-note {
  color: var(--muted);
  font-size: 0.95rem;
  background: var(--panel);
  border: 1px dashed var(--rule);
  border-radius: 6px;
  padding: 0.9rem 1.1rem;
  margin-block: 1.2rem 0;
}

.compare-cell pre[class*='language-'] {
  margin-block: 0;
}

.comparison .verdict {
  color: var(--ink);
  font-size: 0.98rem;
  border-left: 2px solid var(--cyan);
  padding-left: 1rem;
  margin-top: 1.2rem;
}

/* Flash a comparison row when it is the deep-link target. */
@keyframes rowflash {
  0%   { background: rgba(97, 214, 214, 0.12); }
  100% { background: transparent; }
}

.comparison:target {
  animation: rowflash 1.4s ease-out 1;
}

/* ---------- walkthrough: terminal replay ---------- */

.term-controls {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

.term-controls button {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.15rem 0.7rem;
  cursor: pointer;
}

.term-controls button:hover {
  color: var(--cyan);
  border-color: var(--cyan);
}

.replay-pre {
  min-height: 24rem;
}

.t-plan    { color: var(--ink); }
.t-summary { color: var(--ink); }

/* Money-moment tint applied when the replay finishes. */
.t-money {
  background: rgba(249, 241, 165, 0.07);
  box-shadow: -2px 0 0 0 var(--whatif);
}

.money {
  list-style: none;
  padding: 0;
  margin: 1.2rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: var(--prose-max);
}

.money li {
  color: var(--muted);
  font-size: 0.95rem;
  padding-left: 1.2rem;
  position: relative;
}

.money li::before {
  content: '>';
  font-family: var(--font-mono);
  color: var(--whatif);
  position: absolute;
  left: 0;
}

.money[hidden] {
  display: none;
}

/* ---------- case-study pages ---------- */

.card .read-link {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-decoration: none;
  display: inline-block;
  margin-top: 0.2rem;
}

.card .read-link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.card .pending {
  color: var(--muted);
  opacity: 0.75;
}

.case h2.eyebrow {
  margin-top: 2.4rem;
}

.case h2.eyebrow:first-child {
  margin-top: 0;
}

.case p {
  color: var(--muted);
}

.case .verdict {
  color: var(--ink);
}

/* ---------- resume page ---------- */

.resume-header {
  padding-block: clamp(2.5rem, 7vw, 4rem) 0;
}

.resume-header h1 {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: clamp(1.5rem, 3.5vw, 2.1rem);
  margin: 0 0 0.3rem;
}

.resume-title {
  color: var(--muted);
  font-size: 1.1rem;
  margin: 0 0 0.8rem;
}

.resume-contact {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--muted);
  max-width: none;
}

.resume-contact a {
  color: var(--cyan);
}

.skills-list {
  margin: 1.2rem 0 0;
}

.skills-list div {
  display: grid;
  grid-template-columns: 15rem 1fr;
  gap: 0.4rem 1.2rem;
  padding-block: 0.45rem;
  border-bottom: 1px dashed var(--rule);
}

@media (max-width: 700px) {
  .skills-list div {
    grid-template-columns: 1fr;
  }
}

.skills-list dt {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--cyan);
}

.skills-list dd {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.job {
  margin-top: 1.8rem;
  max-width: 78ch;
}

.job h3 {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.02rem;
  margin: 0 0 0.2rem;
}

.job-meta {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0 0 0.6rem;
}

.job ul {
  margin: 0.4rem 0 0;
  padding-left: 1.2rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.job li {
  margin-block: 0.35rem;
}

.job li::marker {
  color: var(--cyan);
}

.cert-list {
  list-style: none;
  padding: 0;
  margin: 1.2rem 0 0;
  color: var(--muted);
}

.cert-list li {
  padding-block: 0.3rem;
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .cursor {
    animation: none;
  }

  .cmd-link {
    transition: none;
  }

  .comparison:target {
    animation: none;
    outline: 1px solid var(--cyan);
    outline-offset: 6px;
  }
}
