/* ===========================================================================
   Design notes - "Run log"
   ---------------------------------------------------------------------------
   The offer is software that runs quietly and reports honestly, so the page
   reads like a well-kept log book: paper, ink, hairline rules, a monospace
   voice for anything machine-made.

   Rules this file encodes:
     - No web fonts. A serif for headings, the system sans for reading,
       the system mono for data. Zero font requests, no layout shift.
     - Structure comes from rules and spacing, not boxes. No card grids,
       no wide soft shadows, no gradients, no pill buttons.
     - Status colours (ok / warn / fail) mean status and nothing else.
       The link colour is the only other hue on the page.
     - Left-aligned. Centred text is kept for nothing.
   =========================================================================== */

:root {
  --paper: #fbfaf6;
  --paper-2: #f3f1ea;
  --ink: #17181c;
  --ink-2: #4a4e58;
  --ink-3: #6b6f79;
  --rule: #dedad0;
  --link: #1d4ed8;
  --ok: #17703f;
  --warn: #9a5b00;
  --fail: #b42318;

  --serif: "Iowan Old Style", "Charter", "Sitka Text", Cambria, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  --measure: 42rem;
  --page: 72rem;
  --gutter: clamp(1rem, 4vw, 2rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #131417;
    --paper-2: #1b1c20;
    --ink: #ecebe6;
    --ink-2: #b9bac0;
    --ink-3: #9a9ca4;
    --rule: #2e3036;
    --link: #8fb0ff;
    --ok: #5fcf8f;
    --warn: #e7b24f;
    --fail: #ff8a7a;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1.0625rem/1.6 var(--sans);
  font-variant-numeric: tabular-nums;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 0.6em;
  text-wrap: balance;
}
h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.45rem, 2.6vw, 1.9rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; text-wrap: pretty; }

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

code, small { font-family: var(--mono); font-size: 0.88em; }

.wrap { max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: calc(var(--measure) + 2 * var(--gutter)); }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--paper); padding: 0.5rem 0.75rem; z-index: 10; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* --- header & footer ---------------------------------------------------- */

.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4rem; flex-wrap: wrap; }
.brand { color: var(--ink); text-decoration: none; font-family: var(--serif); font-weight: 600; font-size: 1.15rem; display: flex; align-items: baseline; gap: 0.75rem; flex-wrap: wrap; }
.brand-note { font-family: var(--sans); font-weight: 400; font-size: 0.85rem; color: var(--ink-3); }
.site-header nav { display: flex; gap: 1.5rem; }
.site-header nav a { color: var(--ink-2); text-decoration: none; font-size: 0.95rem; padding: 0.25rem 0; border-bottom: 1px solid transparent; }
.site-header nav a:hover, .site-header nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }

.site-footer { border-top: 1px solid var(--rule); margin-top: 0; padding: 3rem 0 4rem; font-size: 0.92rem; color: var(--ink-2); }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: 2fr 1fr 2fr 1fr; }
.footer-name { font-family: var(--serif); font-weight: 600; color: var(--ink); font-size: 1.05rem; margin-bottom: 0.4rem; }
.site-footer h2 { font-family: var(--mono); font-weight: 400; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); margin-bottom: 0.75rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.4rem; }
@media (max-width: 52rem) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 30rem) { .footer-grid { grid-template-columns: 1fr; } }

/* --- buttons ------------------------------------------------------------- */

.button {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  font: 500 1rem/1 var(--sans);
  padding: 0.85rem 1.25rem;
  border: 0;
  border-radius: 3px;
  text-decoration: none;
  cursor: pointer;
}
.button:hover { background: var(--ink-2); }
.actions { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; margin-top: 1.75rem; }

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

.hero { padding: clamp(3rem, 8vw, 6rem) 0 clamp(3rem, 6vw, 5rem); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero h1 { max-width: 18ch; }
/* The searchable phrase, inside the H1 but set as a quiet line above the punchline. */
.h1-kicker { display: block; font-family: var(--sans); font-size: 0.95rem; font-weight: 500; letter-spacing: 0; color: var(--ink-3); margin-bottom: 1rem; }
.lede { font-size: 1.2rem; color: var(--ink-2); max-width: var(--measure); }
@media (max-width: 56rem) { .hero-grid { grid-template-columns: 1fr; } }

/* The run log: a real table, set like terminal output on paper. */
.runlog { margin: 0; font-family: var(--mono); font-size: 0.8rem; }
.runlog table { width: 100%; border-collapse: collapse; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink); }
.runlog th { text-align: left; font-weight: 400; color: var(--ink-3); padding: 0.55rem 0.5rem 0.45rem 0; border-bottom: 1px solid var(--rule); }
.runlog td { padding: 0.5rem 0.5rem 0.5rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.runlog tr:last-child td { border-bottom: 0; }
.runlog td:first-child { white-space: nowrap; color: var(--ink-3); }
.runlog figcaption { color: var(--ink-3); font-size: 0.75rem; margin-top: 0.6rem; }
.status { font-weight: 600; }

/* Status cell: "running" and the final status sit in the same grid cell. */
.runlog .st { display: inline-grid; }
.runlog .st > span { grid-area: 1 / 1; }
.runlog .st-run { color: var(--ink-3); opacity: 0; }

@media (prefers-reduced-motion: no-preference) {
  /* Row n starts at 0.4s + n * 0.9s: appears, runs for 0.6s, then resolves. */
  .runlog tbody tr { animation: row-in 0.35s ease-out both; }
  .runlog .st-run { animation: run-blink 0.6s linear both; }
  .runlog .st-end, .runlog .res { animation: resolve 0.3s ease-out both; }
  .runlog figcaption { animation: resolve 0.4s ease-out 5.2s both; }

  .runlog tbody tr:nth-child(1), .runlog tbody tr:nth-child(1) .st-run { animation-delay: 0.4s; }
  .runlog tbody tr:nth-child(2), .runlog tbody tr:nth-child(2) .st-run { animation-delay: 1.3s; }
  .runlog tbody tr:nth-child(3), .runlog tbody tr:nth-child(3) .st-run { animation-delay: 2.2s; }
  .runlog tbody tr:nth-child(4), .runlog tbody tr:nth-child(4) .st-run { animation-delay: 3.1s; }
  .runlog tbody tr:nth-child(5), .runlog tbody tr:nth-child(5) .st-run { animation-delay: 4.0s; }
  .runlog tbody tr:nth-child(1) :is(.st-end, .res) { animation-delay: 1.0s; }
  .runlog tbody tr:nth-child(2) :is(.st-end, .res) { animation-delay: 1.9s; }
  .runlog tbody tr:nth-child(3) :is(.st-end, .res) { animation-delay: 2.8s; }
  .runlog tbody tr:nth-child(4) :is(.st-end, .res) { animation-delay: 3.7s; }
  .runlog tbody tr:nth-child(5) :is(.st-end, .res) { animation-delay: 4.6s; }
}
@keyframes row-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes run-blink { 0%, 30% { opacity: 1; } 45% { opacity: 0.3; } 60%, 97% { opacity: 1; } 100% { opacity: 0; } }
@keyframes resolve { from { opacity: 0; } to { opacity: 1; } }
.status--done { color: var(--ok); }
.status--check { color: var(--warn); }
.status--fail { color: var(--fail); }
@media (max-width: 34rem) { .runlog td:nth-child(4), .runlog th:nth-child(4) { display: none; } }

/* --- sections ------------------------------------------------------------ */

.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.section--rule { border-top: 1px solid var(--rule); }
.section-intro { color: var(--ink-2); max-width: var(--measure); margin-bottom: 2rem; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 1rem; }

.page-head { padding: clamp(2.5rem, 6vw, 4.5rem) 0 2rem; }
.crumbs { font-family: var(--mono); font-size: 0.8rem; color: var(--ink-3); margin-bottom: 1rem; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); }
.two-col--wide-left { grid-template-columns: 1.4fr 1fr; }
@media (max-width: 48rem) { .two-col, .two-col--wide-left { grid-template-columns: 1fr; } }

ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li { padding: 0.6rem 0; border-top: 1px solid var(--rule); }
ul.plain li:last-child { border-bottom: 1px solid var(--rule); }

/* Four deliverables: a numbered ledger, not icon cards. */
.deliverables, .steps { list-style: none; margin: 0; padding: 0; counter-reset: n; display: grid; gap: 0 clamp(1.5rem, 4vw, 3rem); }
.deliverables { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.deliverables li, .steps li { counter-increment: n; border-top: 1px solid var(--ink); padding: 1rem 0 1.5rem; }
.deliverables li::before, .steps li::before { content: counter(n, decimal-leading-zero); font-family: var(--mono); font-size: 0.8rem; color: var(--ink-3); display: block; margin-bottom: 0.4rem; }
.deliverables p, .steps p { color: var(--ink-2); margin: 0; }
@media (max-width: 52rem) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 36rem) { .deliverables, .steps { grid-template-columns: 1fr; } }

/* Work list: rows with a rule between them. */
.work-list { list-style: none; margin: 0; padding: 0; }
.work-list li { display: grid; grid-template-columns: 12rem minmax(0, 1fr); column-gap: 2rem; padding: 1.5rem 0; border-top: 1px solid var(--rule); }
.work-list li:last-child { border-bottom: 1px solid var(--rule); }
.work-list .work-kind { grid-row: span 3; font-family: var(--mono); font-size: 0.78rem; color: var(--ink-3); padding-top: 0.3rem; margin: 0; }
.work-list h3 { margin-bottom: 0.4rem; }
.work-list h3 a { color: var(--ink); text-decoration: none; }
.work-list h3 a:hover { text-decoration: underline; }
.work-list p { margin: 0 0 0.5rem; color: var(--ink-2); max-width: var(--measure); }
.work-list .work-stack { font-family: var(--mono); font-size: 0.78rem; color: var(--ink-3); margin: 0; }
@media (max-width: 40rem) { .work-list li { grid-template-columns: 1fr; } .work-list .work-kind { grid-row: auto; margin-bottom: 0.3rem; } }

.stack-list { margin: 0; }
.stack-list div { display: grid; grid-template-columns: 10rem minmax(0, 1fr); gap: 1rem; padding: 0.75rem 0; border-top: 1px solid var(--rule); }
.stack-list dt { font-weight: 600; }
.stack-list dd { margin: 0; color: var(--ink-2); }
@media (max-width: 30rem) { .stack-list div { grid-template-columns: 1fr; gap: 0.2rem; } }

.aside-note { background: var(--paper-2); padding: 1.5rem; border-left: 2px solid var(--ink); align-self: start; }
.aside-note h2, .aside-note h3 { font-size: 1.15rem; }
.aside-note p:last-child { margin-bottom: 0; }

.products { list-style: none; margin: 0; padding: 0; max-width: var(--measure); }
.products li { padding: 0.9rem 0; border-top: 1px solid var(--rule); color: var(--ink-2); }

.faq details { border-top: 1px solid var(--rule); }
.faq details:last-child { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; padding: 1rem 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--mono); color: var(--ink-3); }
.faq details[open] summary::after { content: "−"; }
.faq details p { color: var(--ink-2); margin: 0 0 1.25rem; }

.cta { border-top: 1px solid var(--rule); background: var(--paper-2); padding: clamp(2.5rem, 6vw, 4rem) 0; }
.cta p { color: var(--ink-2); max-width: var(--measure); }
.cta p:last-child { margin: 1.5rem 0 0; }

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

.facts { margin: 0 0 2.5rem; border-top: 2px solid var(--ink); }
.facts div { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 1rem; padding: 0.75rem 0; border-bottom: 1px solid var(--rule); }
.facts dt { font-family: var(--mono); font-size: 0.8rem; color: var(--ink-3); padding-top: 0.2rem; }
.facts dd { margin: 0; }
@media (max-width: 34rem) { .facts div { grid-template-columns: 1fr; gap: 0.15rem; } }

.prose { padding-bottom: 3rem; }
.prose h2 { margin-top: 2.5rem; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: 0.5rem; }
.prose li::marker { color: var(--ink-3); }
.updated { font-family: var(--mono); font-size: 0.8rem; color: var(--ink-3); margin-top: 2.5rem; }

.next-work { display: flex; flex-direction: column; gap: 0.25rem; border-top: 1px solid var(--rule); padding-top: 1.5rem; padding-bottom: 3rem; }
.next-work span { font-family: var(--mono); font-size: 0.78rem; color: var(--ink-3); }
.next-work a { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; }

/* --- screenshots --------------------------------------------------------- */

.shot { margin: 2rem 0; }
.shot img { display: block; width: 100%; height: auto; border: 1px solid var(--rule); border-radius: 2px; background: var(--paper-2); }
.shot figcaption { font-size: 0.88rem; color: var(--ink-3); margin-top: 0.6rem; }
.wide-shot { max-width: 60rem; }

/* Dev builds only: an empty slot that says which file to drop where. */
.shot-slot { aspect-ratio: 16 / 10; border: 1px dashed var(--ink-3); background: repeating-linear-gradient(-45deg, transparent 0 12px, var(--paper-2) 12px 24px); display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 0.4rem; padding: 1.5rem; font-family: var(--mono); font-size: 0.85rem; color: var(--ink-2); }
.shot-slot span { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.72rem; color: var(--ink-3); }
.shot-slot small { color: var(--ink-3); }

/* --- about --------------------------------------------------------------- */

.about-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: end; }
.about-grid .shot { margin: 0; max-width: 22rem; }
.about-grid .shot-slot { aspect-ratio: 4 / 5; }
@media (max-width: 44rem) { .about-grid { grid-template-columns: 1fr; } }

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

.contact-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); padding-bottom: 4rem; }
@media (max-width: 48rem) { .contact-grid { grid-template-columns: 1fr; } }

.form .field { margin-bottom: 1.25rem; }
.form label { display: block; font-weight: 600; margin-bottom: 0.4rem; }
.optional { font-weight: 400; color: var(--ink-3); font-size: 0.85rem; }
.form input, .form textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink-3);
  border-radius: 2px;
  padding: 0.65rem 0.75rem;
}
.form input:focus, .form textarea:focus { outline: 2px solid var(--link); outline-offset: 0; border-color: var(--link); }
.form textarea { resize: vertical; min-height: 9rem; }
.form-note { font-size: 0.88rem; color: var(--ink-3); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.cf-turnstile { margin-bottom: 1.25rem; }
