/* stinson.me.uk — single stylesheet, no build step.
   Design language: engineering drawing — blueprint grid, drafting ticks, mono labels. */

:root {
  --bg: #f7f6f2;
  --surface: #fffefb;
  --surface-2: #efede6;
  --text: #1a1e21;
  --muted: #5b6470;
  --accent: #0e6577;
  --accent-strong: #0a4c5a;
  --accent-soft: #e2eef0;
  --border: #e2ddd2;
  --border-strong: #c6bfb1;
  --on-accent: #ffffff;
  --grid-line: rgba(14, 101, 119, 0.08);
  --grid-line-bold: rgba(14, 101, 119, 0.16);
  --shadow: 0 10px 30px -12px rgba(26, 30, 33, 0.18);
  --header-bg: rgba(247, 246, 242, 0.85);
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1215;
    --surface: #151b1f;
    --surface-2: #1b2328;
    --text: #e9ecee;
    --muted: #9aa5ae;
    --accent: #5cc6da;
    --accent-strong: #8ad8e7;
    --accent-soft: #143038;
    --border: #273036;
    --border-strong: #3a454d;
    --on-accent: #0b1214;
    --grid-line: rgba(92, 198, 218, 0.10);
    --grid-line-bold: rgba(92, 198, 218, 0.20);
    --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
    --header-bg: rgba(13, 18, 21, 0.85);
  }
}

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

html { scroll-padding-top: 84px; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 24px; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); text-decoration: underline; }

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

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 16px;
  padding-bottom: 16px;
  flex-wrap: wrap;
}

.brand {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.brand::before {
  content: "";
  width: 11px;
  height: 11px;
  border: 2px solid var(--accent);
  border-radius: 2px;
  display: inline-block;
  transform: rotate(45deg);
  flex: none;
}
.brand:hover { text-decoration: none; color: var(--accent); }
.brand .tld { color: var(--accent); }

nav.main-nav { display: flex; gap: 22px; flex-wrap: wrap; }
nav.main-nav a {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--muted);
  position: relative;
}
nav.main-nav a:hover { color: var(--accent); text-decoration: none; }

/* ---------- hero: blueprint grid ---------- */

.hero {
  padding: 96px 0 72px;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    linear-gradient(var(--grid-line-bold) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-bold) 1px, transparent 1px);
  background-size: 28px 28px, 28px 28px, 140px 140px, 140px 140px;
}
.hero .wrap { position: relative; }

.eyebrow {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--accent);
  flex: none;
}

.hero h1 {
  font-size: clamp(32px, 5.6vw, 52px);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.02em;
  max-width: 21ch;
  margin-bottom: 24px;
}
.hero h1 .accent { color: var(--accent); }

.hero .lede {
  font-size: clamp(17px, 2.4vw, 20px);
  color: var(--muted);
  max-width: 62ch;
  margin-bottom: 32px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 38px;
}
.hero-meta span::before { content: "▸ "; content: "▸ " / ""; color: var(--accent); }

.cta-row { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.4;
  padding: 13px 24px;
  border-radius: 7px;
  border: 1px solid var(--accent);
  cursor: pointer;
}
.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: var(--shadow);
}
.btn-primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: var(--on-accent);
  text-decoration: none;
}
.btn-ghost { color: var(--accent); background: transparent; }
.btn-ghost:hover { background: var(--accent-soft); text-decoration: none; }

@media (prefers-reduced-motion: no-preference) {
  .btn { transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease; }
  .btn:hover { transform: translateY(-1px); }
}

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

section.block { padding: 72px 0; border-bottom: 1px solid var(--border); position: relative; }
section.block:last-of-type { border-bottom: none; }

.section-head { margin-bottom: 40px; }
.section-head--minor { margin-top: 60px; }
.section-head.section-head--minor h2 { font-size: 22px; }
.section-head h2 {
  font-size: clamp(25px, 3.4vw, 32px);
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-top: 6px;
}
.section-head p.sub { color: var(--muted); max-width: 66ch; margin-top: 10px; }

.prose p { max-width: 70ch; margin-bottom: 16px; }
.prose p:last-child { margin-bottom: 0; }

main.hero { border-bottom: none; }

/* ---------- cards ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(290px, 100%), 1fr));
  gap: 18px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
}
.card h3 { font-size: 17px; font-weight: 600; }
.card p { font-size: 15px; color: var(--muted); }
.card .tag {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--accent);
  letter-spacing: 0.08em;
}

.card:hover { border-color: var(--border-strong); }
.card:hover::before { transform: scaleX(1); }
@media (prefers-reduced-motion: no-preference) {
  .card { transition: border-color 0.18s ease; }
  .card::before { transition: transform 0.22s ease; }
}

/* ---------- projects ---------- */

.projects { counter-reset: proj; border-bottom: 1px solid var(--border); }

.project {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 12px 32px;
  padding: 30px 0;
  border-top: 1px solid var(--border);
  counter-increment: proj;
}
.project .p-label {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.04em;
  padding-top: 4px;
}
.project .p-label::before {
  content: counter(proj, decimal-leading-zero);
  display: block;
  font-size: 30px;
  font-weight: 600;
  color: var(--accent);
  opacity: 0.45;
  line-height: 1.1;
  margin-bottom: 6px;
}
.project h3 { font-size: 19px; font-weight: 600; margin-bottom: 6px; }
.project p { color: var(--muted); font-size: 15.5px; max-width: 66ch; }
.project .facts {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.project .facts span {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 3px 10px;
}

@media (max-width: 640px) {
  html { scroll-padding-top: 12px; }
  .site-header { position: static; }
  .project { grid-template-columns: 1fr; gap: 6px; }
  .project .p-label::before { display: inline; font-size: 15px; margin-right: 8px; opacity: 1; }
}

/* ---------- credentials strip ---------- */

.creds {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 40px;
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--muted);
}
.creds span::before { content: "● "; content: "● " / ""; color: var(--accent); font-size: 10px; vertical-align: 2px; }

/* ---------- engagement list ---------- */

.engage-list { list-style: none; max-width: 70ch; }
.engage-list li {
  padding: 15px 0 15px 32px;
  border-bottom: 1px solid var(--border);
  position: relative;
  color: var(--muted);
  font-size: 15.5px;
}
.engage-list li:last-child { border-bottom: none; }
.engage-list li::before {
  content: "→";
  content: "→" / "";
  position: absolute;
  left: 2px;
  color: var(--accent);
  font-family: var(--mono);
}
.engage-list li strong { color: var(--text); font-weight: 600; }

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

.contact-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 36px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 36px;
  box-shadow: var(--shadow);
}
@media (max-width: 760px) { .contact-box { grid-template-columns: 1fr; } }

.contact-box h3 { font-size: 18px; font-weight: 600; margin-bottom: 12px; }
.contact-box dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; font-size: 15px; }
.contact-box dt { font-family: var(--mono); font-size: 12.5px; color: var(--muted); letter-spacing: 0.05em; text-transform: uppercase; padding-top: 3px; }
.contact-box dd { color: var(--text); }
.contact-box dd, .contact-box a { overflow-wrap: anywhere; }
.contact-box .intro { color: var(--muted); font-size: 15px; max-width: 48ch; }
.contact-box form { margin-top: 18px; }
.contact-box .note { font-size: 14px; color: var(--muted); margin-top: 16px; max-width: 46ch; }
.contact-box .direct { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--border); }
@media (max-width: 420px) {
  .contact-box { padding: 24px; }
  .contact-box dl { grid-template-columns: 1fr; gap: 2px 0; }
  .contact-box dd { margin-bottom: 8px; }
}

/* ---------- form ---------- */

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 6px; }
.field--full { grid-column: 1 / -1; }
.field label {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.field input,
.field textarea {
  font-family: var(--sans);
  font-size: 15.5px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 11px 13px;
  width: 100%;
}
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus,
.field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  border-color: var(--accent);
}
.form-foot {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.form-foot .hint { font-size: 13px; color: var(--muted); max-width: 40ch; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

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

.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0 52px;
  font-size: 14px;
  color: var(--muted);
  background: var(--surface-2);
}
.site-footer .cols {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px 40px;
}
.site-footer .legal-id { max-width: 52ch; }
.site-footer .legal-id strong { color: var(--text); font-weight: 600; }
.site-footer nav { display: flex; flex-direction: column; gap: 7px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }
.site-footer .fineprint { margin-top: 28px; font-size: 13px; }

/* ---------- legal pages ---------- */

.legal-page { padding: 60px 0 76px; }
.legal-page h1 { font-size: clamp(26px, 4vw, 34px); font-weight: 700; letter-spacing: -0.015em; margin: 8px 0 10px; }
.legal-page .updated { font-family: var(--mono); font-size: 13px; color: var(--muted); margin-bottom: 36px; }
.legal-page h2 { font-size: 20px; font-weight: 600; margin: 36px 0 12px; }
.legal-page p, .legal-page li { max-width: 74ch; color: var(--text); margin-bottom: 12px; font-size: 16px; }
.legal-page ul, .legal-page ol { padding-left: 24px; margin-bottom: 14px; }
.legal-page li { margin-bottom: 6px; }
.legal-page .callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 16px 20px;
  margin: 18px 0;
  max-width: 74ch;
  font-size: 15px;
}

/* ---------- misc ---------- */

::selection { background: var(--accent); color: var(--on-accent); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--on-accent);
  padding: 10px 16px;
  z-index: 30;
}
.skip-link:focus { left: 0; }

@media print {
  :root {
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-2: #ffffff;
    --text: #000000;
    --muted: #333333;
    --accent: #0e6577;
    --accent-strong: #0a4c5a;
    --accent-soft: #eeeeee;
    --border: #cccccc;
    --border-strong: #bbbbbb;
    --header-bg: #ffffff;
    --on-accent: #ffffff;
    --shadow: none;
    --grid-line: transparent;
    --grid-line-bold: transparent;
  }
  nav.main-nav, .skip-link, .cta-row, .btn, form { display: none; }
  .site-header { position: static; }
  .contact-box, .grid { grid-template-columns: 1fr; }
  .legal-page a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 90%; }
}
