/* imck.ca shared styles
   Palette: drafting paper, ink, ledger green, green-bar band, rule grey, amber for source notes */
:root {
  --paper: #f6f8f6;
  --ink: #1e2b33;
  --ink-soft: #4a5a63;
  --ledger: #2d6a4f;
  --ledger-dark: #1f4d39;
  --band: #e3eee6;
  --rule: #c8d3cc;
  --amber: #8a5a10;
  --white: #ffffff;
  --head: "Archivo", "Arial Narrow", Arial, sans-serif;
  --body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --measure: 40rem;
}

* { box-sizing: border-box; }

html { font-size: 112.5%; }
@media (max-width: 600px) { html { font-size: 106%; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ledger); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--ledger-dark); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--ledger); outline-offset: 3px; border-radius: 2px; }

.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--white); padding: 0.5rem 1rem; }
.skip:focus { left: 1rem; top: 1rem; }

/* ---------- header ---------- */
.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}
.site-header .wrap {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
  padding-top: 1.1rem; padding-bottom: 1.1rem;
}
.mark {
  font-family: var(--head); font-weight: 800; font-stretch: 75%;
  font-size: 1.5rem; letter-spacing: 0.04em; color: var(--ink); text-decoration: none;
}
.mark span { font-weight: 400; font-stretch: 100%; letter-spacing: 0; font-size: 0.85rem; color: var(--ink-soft); margin-left: 0.6rem; }
.site-nav { display: flex; gap: 1.4rem; font-family: var(--head); font-size: 0.95rem; }
.site-nav a { color: var(--ink); text-decoration: none; padding-bottom: 0.15rem; border-bottom: 2px solid transparent; }
.site-nav a:hover, .site-nav a[aria-current="page"] { border-bottom-color: var(--ledger); }

.wrap { max-width: 68rem; margin: 0 auto; padding-left: 1.5rem; padding-right: 1.5rem; }

/* ---------- type ---------- */
h1, h2, h3, h4 { font-family: var(--head); color: var(--ink); line-height: 1.15; margin: 0; }
h1 { font-weight: 800; font-stretch: 75%; font-size: clamp(2.6rem, 7vw, 4.6rem); letter-spacing: -0.01em; }
h2 { font-weight: 700; font-stretch: 87.5%; font-size: 1.7rem; margin-top: 3.5rem; margin-bottom: 1rem; }
h3 { font-weight: 700; font-size: 1.15rem; margin-top: 2rem; margin-bottom: 0.4rem; }
h4 { font-weight: 600; font-size: 1rem; margin-top: 1.4rem; margin-bottom: 0.3rem; }
p, li { max-width: var(--measure); }
p { margin: 0 0 1rem; }
ul, ol { padding-left: 1.3rem; margin: 0 0 1rem; }
li { margin-bottom: 0.35rem; }
strong { font-weight: 650; }

.lead { font-size: 1.25rem; line-height: 1.5; max-width: 34rem; color: var(--ink); margin-top: 1.2rem; }

main { padding-bottom: 5rem; }

/* ---------- hero ---------- */
.hero { padding-top: 3.5rem; padding-bottom: 1rem; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 3rem; align-items: start; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; gap: 2rem; } }
.actions { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 1.6rem; }
.btn {
  display: inline-block; font-family: var(--head); font-weight: 600; font-size: 0.98rem;
  padding: 0.7rem 1.2rem; border-radius: 3px; text-decoration: none;
  border: 2px solid var(--ledger);
}
.btn-primary { background: var(--ledger); color: var(--white); }
.btn-primary:hover { background: var(--ledger-dark); border-color: var(--ledger-dark); color: var(--white); }
.btn-plain { color: var(--ledger); background: transparent; }
.btn-plain:hover { background: var(--band); }

/* ---------- the green-bar ledger: the signature element ---------- */
.ledger { border-top: 3px solid var(--ink); border-bottom: 1px solid var(--ink); margin: 0; }
.ledger caption, .ledger-title {
  font-family: var(--head); font-weight: 600; font-size: 0.9rem; color: var(--ink-soft);
  text-align: left; padding: 0 0 0.5rem;
}
.ledger-row {
  display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 1rem;
  padding: 0.75rem 0.8rem; align-items: baseline;
}
.ledger-row:nth-child(odd) { background: var(--band); }
.ledger-row dt { font-family: var(--head); font-weight: 800; font-stretch: 75%; font-size: 1.35rem; color: var(--ledger-dark); }
.ledger-row dd { margin: 0; font-size: 0.98rem; line-height: 1.45; }
@media (max-width: 480px) { .ledger-row { grid-template-columns: 1fr; gap: 0.1rem; } }

/* ---------- tables (data, artifacts) ---------- */
table { border-collapse: collapse; width: 100%; margin: 1rem 0 1.5rem; font-size: 0.92rem; line-height: 1.45; }
th { font-family: var(--head); font-weight: 600; text-align: left; border-bottom: 2px solid var(--ink); padding: 0.5rem 0.6rem; vertical-align: bottom; }
td { padding: 0.5rem 0.6rem; vertical-align: top; border-bottom: 1px solid var(--rule); }
tbody tr:nth-child(even) td { background: var(--band); }
.table-scroll { overflow-x: auto; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* source notes: every number has a source */
.src { font-family: var(--head); font-size: 0.78rem; color: var(--amber); white-space: nowrap; }

/* ---------- sections ---------- */
.columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem 3rem; }
@media (max-width: 760px) { .columns { grid-template-columns: 1fr; } }
.columns > div > h3 { margin-top: 1.2rem; }

.principles { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--rule); }
.principles li { max-width: none; padding: 0.9rem 0; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: 1.5rem; margin: 0; }
.principles strong { font-family: var(--head); font-weight: 700; }
@media (max-width: 680px) { .principles li { grid-template-columns: 1fr; gap: 0.2rem; } }

.notice {
  border-left: 4px solid var(--amber); background: var(--white);
  padding: 0.8rem 1rem; margin: 1.5rem 0; max-width: var(--measure); font-size: 0.95rem;
}
.notice p:last-child { margin-bottom: 0; }

/* portfolio entries: ledger rows, not cards */
.entries { border-top: 3px solid var(--ink); margin-top: 2rem; }
.entry { display: grid; grid-template-columns: minmax(0, 18rem) minmax(0, 1fr); gap: 2rem; padding: 2rem 0; border-bottom: 1px solid var(--rule); }
.entry h2 { margin: 0; font-size: 1.6rem; }
.entry .meta { font-family: var(--head); color: var(--ink-soft); font-size: 0.9rem; margin-top: 0.5rem; }
@media (max-width: 760px) { .entry { grid-template-columns: 1fr; gap: 0.8rem; } }

/* stage sequence on the case page: a real sequence, so numbered */
.stages { list-style: none; counter-reset: stage; padding: 0; margin: 1.5rem 0 0; }
.stages > li { counter-increment: stage; position: relative; padding: 0 0 2rem 3.4rem; max-width: 46rem; border-left: 2px solid var(--rule); margin-left: 1.1rem; }
.stages > li:last-child { border-left-color: transparent; }
.stages > li::before {
  content: counter(stage); position: absolute; left: -1.15rem; top: -0.15rem;
  width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--ledger); color: var(--white);
  font-family: var(--head); font-weight: 700; display: grid; place-items: center;
}
.stages h3 { margin-top: 0; }
.stages .files { font-size: 0.92rem; }

.file-list { columns: 2; column-gap: 3rem; padding-left: 1.2rem; }
.file-list li { break-inside: avoid; }
@media (max-width: 640px) { .file-list { columns: 1; } }

/* artifact pages */
.artifact { padding-top: 2rem; }
.artifact h1 { font-size: clamp(1.9rem, 4.5vw, 2.8rem); margin-bottom: 1rem; }
.artifact h2 { font-size: 1.35rem; margin-top: 2.4rem; }
.artifact pre { background: var(--white); border: 1px solid var(--rule); padding: 1rem; overflow-x: auto; font-size: 0.82rem; line-height: 1.45; max-width: 48rem; }
.artifact code { font-size: 0.88em; }
.artifact hr { border: 0; border-top: 1px solid var(--rule); margin: 2rem 0; }
.crumbs { font-family: var(--head); font-size: 0.9rem; margin-top: 1.5rem; }

/* footer */
.site-footer { border-top: 1px solid var(--rule); padding: 2rem 0 3rem; font-family: var(--head); font-size: 0.88rem; color: var(--ink-soft); }
.site-footer p { max-width: none; margin: 0.2rem 0; }

@media (prefers-reduced-motion: no-preference) {
  .hero h1, .hero .lead, .hero .actions { animation: rise 0.6s ease-out both; }
  .hero .lead { animation-delay: 0.08s; }
  .hero .actions { animation-delay: 0.16s; }
  @keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}

/* contact form (Netlify Forms) */
.contact-form { display: grid; gap: 0.35rem; max-width: 32rem; margin-top: 1.2rem; }
.contact-form label { font-family: var(--head); font-weight: 600; font-size: 0.92rem; margin-top: 0.7rem; }
.contact-form input, .contact-form textarea {
  font: inherit; font-size: 1rem; color: var(--ink); background: var(--white);
  border: 1px solid var(--rule); border-bottom: 2px solid var(--ink-soft); border-radius: 2px; padding: 0.6rem 0.7rem;
}
.contact-form input:focus, .contact-form textarea:focus { outline: 3px solid var(--ledger); outline-offset: 1px; }
.contact-form button { justify-self: start; margin-top: 1.2rem; cursor: pointer; }
.hp { position: absolute; left: -9999px; }

/* portrait */
.portrait { display: block; width: 160px; height: 160px; object-fit: cover; border-radius: 3px; border: 3px solid var(--white); outline: 1px solid var(--rule); margin-bottom: 1.6rem; }
