/* Lora, self-hosted (SIL OFL 1.1) so no request goes to Google Fonts */
@font-face { font-family: Lora; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/lora-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: Lora; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/lora-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: Lora; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/lora-latin-400-italic.woff2") format("woff2"); }

/* Colours taken from the UncoverTheStack Substack theme + logo */
:root {
  --bg: #f7fee7;          /* Substack page background */
  --bg-2: #e8efd9;        /* Substack contrast background */
  --line: #dee5d0;        /* Substack detail/border */
  --card: #fbfff3;
  --heading: #505b38;     /* Substack heading olive */
  --text: #363737;        /* Substack body text */
  --muted: #6b7064;
  --ink: #020617;         /* Substack buttons */
  --lime: #d2e300;        /* logo */
  --orange: #c2601a;      /* from the extension icon, for warnings */
  --blue: #1f78b8;
  --radius: 12px;
  --max: 1100px;
  --serif: Lora, Georgia, "Times New Roman", serif;
  --sans: "SF Pro Display", -apple-system, system-ui, Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--serif); font-size: 19px; line-height: 1.65; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, .sans { font-family: var(--sans); color: var(--heading); }
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
img { max-width: 100%; display: block; }

/* Nav — mirrors the Substack header */
header.nav { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 10; }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-family: var(--sans); font-weight: 800; font-size: 20px; color: var(--heading); }
.brand img { width: 36px; height: 36px; }
.nav ul { list-style: none; display: flex; align-items: center; gap: 26px; margin: 0; padding: 0; font-family: var(--sans); font-size: 15px; }
.nav ul a { text-decoration: none; color: var(--muted); font-weight: 500; }
.nav ul a:hover { color: var(--heading); }
@media (max-width: 640px) { .nav ul li.hide-sm { display: none; } .nav ul { gap: 16px; } }

.btn { display: inline-flex; align-items: center; gap: 8px; font-family: var(--sans); font-size: 15px; font-weight: 600; padding: 11px 20px; border-radius: 8px; text-decoration: none; border: 1px solid var(--ink); transition: opacity .15s ease, background .15s ease; }
.btn.dark { background: var(--ink); color: #fff; }
.btn.dark:hover { opacity: .85; }
.btn.light { background: transparent; color: var(--ink); border-color: #c9d1b8; }
.btn.light:hover { background: var(--bg-2); }
.btn.sm { padding: 8px 14px; font-size: 14px; }

/* Hero */
.hero { padding: 80px 0 72px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
@media (max-width: 880px) { .hero-grid { grid-template-columns: 1fr; gap: 40px; } .hero { padding-top: 56px; } }
.eyebrow { font-family: var(--sans); font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 18px; display: flex; align-items: center; gap: 10px; }
.eyebrow::before { content: ""; width: 18px; height: 18px; background: var(--lime); border-radius: 4px; }
h1 { font-size: clamp(2.4rem, 5.2vw, 3.7rem); line-height: 1.08; letter-spacing: -0.02em; font-weight: 900; margin: 0 0 22px; }
.lede { font-size: 1.2rem; margin: 0 0 32px; max-width: 32em; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }

.latest { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; display: block; transition: transform .15s ease, box-shadow .15s ease; }
.latest:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(80, 91, 56, .12); }
.latest img { aspect-ratio: 16 / 9; width: 100%; object-fit: cover; background: var(--bg-2); }
.latest .body { padding: 18px 20px 20px; }
.label { font-family: var(--sans); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.latest h3 { margin: 6px 0 4px; font-size: 1.3rem; line-height: 1.25; font-weight: 900; }
.latest p { margin: 0; color: var(--muted); font-size: 16px; }

/* Sections */
section { padding: 72px 0; border-top: 1px solid var(--line); }
section.alt { background: var(--bg-2); border-top-color: var(--line); }
.sec-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; margin-bottom: 36px; }
.sec-head h2 { font-size: 2.1rem; font-weight: 900; letter-spacing: -0.015em; margin: 0; }
.sec-head p { margin: 8px 0 0; color: var(--muted); max-width: 36em; }

/* Tags */
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { font-family: var(--sans); font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); }
.tag.live { background: var(--lime); border-color: var(--lime); color: var(--ink); }

/* Featured project */
.featured { display: grid; grid-template-columns: 1.15fr 1fr; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 24px; }
@media (max-width: 880px) { .featured { grid-template-columns: 1fr; } }
.featured .body { padding: 32px; }
.proj-title { display: flex; align-items: center; gap: 14px; margin: 16px 0 12px; }
.proj-title img { width: 54px; height: 54px; border-radius: 12px; flex: none; }
.proj-title h3 { margin: 0; font-size: 1.6rem; font-weight: 900; line-height: 1.2; }
.featured p { margin: 0 0 16px; }
.points { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 6px; font-size: 17px; }
.points li { padding-left: 24px; position: relative; }
.points li::before { content: ""; position: absolute; left: 0; top: .55em; width: 10px; height: 10px; border-radius: 3px; background: var(--lime); border: 1px solid var(--heading); }
.links { display: flex; flex-wrap: wrap; gap: 10px; }
code { font-family: var(--mono); font-size: .86em; background: var(--bg-2); padding: 1px 6px; border-radius: 5px; }

.preview { background: #fdfff8; border-left: 1px solid var(--line); padding: 24px; font-family: var(--mono); font-size: 13px; line-height: 1.75; overflow-x: auto; }
@media (max-width: 880px) { .preview { border-left: 0; border-top: 1px solid var(--line); } }
.preview .file { color: var(--muted); margin-bottom: 10px; font-size: 12px; }
.preview pre { margin: 0; color: #4a4f44; }
.k { color: var(--blue); } .s { color: var(--heading); font-weight: 600; }
.err { text-decoration: underline wavy var(--orange); text-underline-offset: 4px; }
.diag { margin-top: 14px; padding: 10px 12px; border-radius: 8px; background: #fff4ea; border: 1px solid #f1cfb1; color: #5b3a1d; white-space: normal; }
.diag b { color: var(--orange); }

/* Project grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; }
.card { display: flex; flex-direction: column; gap: 8px; padding: 24px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); text-decoration: none; }
a.card:hover { box-shadow: 0 10px 30px rgba(80, 91, 56, .12); }
.card h3 { margin: 4px 0 0; font-size: 1.2rem; font-weight: 800; }
.card p { margin: 0; color: var(--muted); font-size: 16px; flex: 1; }
.card .meta { font-family: var(--sans); font-size: 13px; color: var(--muted); }
.card.placeholder { border-style: dashed; background: transparent; }

/* Writing */
.series { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom: 40px; }
@media (max-width: 760px) { .series { grid-template-columns: 1fr; } }
.series a { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; text-decoration: none; }
.series a:hover { box-shadow: 0 10px 30px rgba(80, 91, 56, .12); }
.series h3 { margin: 6px 0 6px; font-size: 1.3rem; font-weight: 900; }
.series p { margin: 0; color: var(--muted); font-size: 16px; }

.posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 900px) { .posts { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .posts { grid-template-columns: 1fr; } }
.post { text-decoration: none; display: flex; flex-direction: column; gap: 10px; }
.post img { aspect-ratio: 16 / 9; width: 100%; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2); }
.post h4 { margin: 0; font-size: 1.08rem; line-height: 1.3; font-weight: 800; }
.post:hover h4 { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.post .meta { font-family: var(--sans); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.more { margin-top: 36px; display: flex; justify-content: center; }

/* Subscribe band */
.subscribe { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
@media (max-width: 820px) { .subscribe { grid-template-columns: 1fr; } }
.subscribe img.logo { width: 64px; height: 64px; margin-bottom: 16px; }
.subscribe h2 { margin: 0 0 8px; font-size: 1.9rem; font-weight: 900; }
.subscribe p { margin: 0; color: var(--muted); }
.subscribe iframe { width: 100%; height: 150px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }

/* About */
.about { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; }
@media (max-width: 880px) { .about { grid-template-columns: 1fr; } }
.about p { margin: 0 0 16px; }
dl.facts { margin: 0; display: grid; gap: 16px; font-size: 17px; }
dl.facts div { padding-bottom: 16px; border-bottom: 1px solid var(--line); }
dl.facts dt { font-family: var(--sans); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 4px; }
dl.facts dd { margin: 0; }

footer { border-top: 1px solid var(--line); padding: 32px 0 44px; font-family: var(--sans); font-size: 14px; color: var(--muted); }
footer .wrap { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
footer .brand { font-size: 16px; }
footer .brand img { width: 26px; height: 26px; }
footer nav a { text-decoration: none; margin-left: 20px; }
footer nav a:hover { color: var(--heading); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
/* Placeholder cover for posts without one */
.post img.cover-logo { object-fit: contain; padding: 18%; background: var(--lime); }

/* Contact */
.contact-line { font-family: var(--sans); font-weight: 600; }
.contact-line a { color: var(--heading); text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* Long-form pages (privacy) */
.prose { max-width: 720px; padding: 64px 0 80px; }
.prose h1 { font-size: clamp(2.1rem, 4.5vw, 3rem); margin-bottom: 12px; }
.prose .updated { font-family: var(--sans); font-size: 14px; color: var(--muted); margin: 0 0 36px; }
.prose h2 { font-size: 1.5rem; font-weight: 900; margin: 44px 0 10px; }
.prose h3 { font-size: 1.15rem; font-weight: 800; margin: 28px 0 6px; }
.prose p, .prose li { margin: 0 0 14px; }
.prose ul { padding-left: 22px; margin: 0 0 18px; }
.prose a { color: var(--heading); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose .callout { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--lime); border-radius: 10px; padding: 18px 20px; margin: 0 0 28px; }
.prose .callout p:last-child { margin: 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 20px; font-size: 16px; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.prose th { font-family: var(--sans); font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }

/* 404 */
.notfound { min-height: 62vh; display: grid; place-items: center; text-align: center; padding: 64px 0; }
.notfound img { width: 96px; height: 96px; margin: 0 auto 24px; }
.notfound h1 { margin-bottom: 10px; }
.notfound p { color: var(--muted); margin: 0 0 28px; }
.notfound .cta { justify-content: center; }

/* ---------- Consulting ---------- */
.c-hero { padding: 72px 0 56px; }
.c-hero h1 { max-width: 16em; }
.c-hero .lede { max-width: 36em; }
.c-hero .who { display: flex; gap: 10px; align-items: center; margin-top: 28px; font-family: var(--sans); font-size: 14px; color: var(--muted); }
.c-hero .who img { width: 28px; height: 28px; }

.offers { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (max-width: 820px) { .offers { grid-template-columns: 1fr; } }
.offer { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.offer h3 { margin: 0; font-size: 1.35rem; font-weight: 900; line-height: 1.25; }
.offer p { margin: 0; color: var(--muted); font-size: 16.5px; }
.offer ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 16px; }
.offer ul li { padding-left: 22px; position: relative; }
.offer ul li::before { content: ""; position: absolute; left: 0; top: .55em; width: 9px; height: 9px; border-radius: 3px; background: var(--lime); border: 1px solid var(--heading); }
.offer .foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; font-family: var(--sans); font-size: 14px; color: var(--muted); }
.offer .foot b { color: var(--heading); }

.proof { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 880px) { .proof { grid-template-columns: 1fr; } }
.proof .card h3 { font-size: 1.1rem; }
.proof .card img.icon { width: 40px; height: 40px; border-radius: 9px; }

.steps { counter-reset: step; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; list-style: none; margin: 0; padding: 0; }
@media (max-width: 880px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }
.steps li { counter-increment: step; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; font-size: 16px; color: var(--muted); }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--lime); color: var(--ink); font-family: var(--sans); font-weight: 900; margin-bottom: 12px; border: 1px solid var(--heading); }
.steps li b { display: block; font-family: var(--sans); color: var(--heading); font-size: 17px; margin-bottom: 4px; }

.faq { max-width: 760px; }
.faq details { border-bottom: 1px solid var(--line); padding: 16px 0; }
.faq summary { cursor: pointer; font-family: var(--sans); font-weight: 700; color: var(--heading); font-size: 17px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-weight: 400; font-size: 22px; line-height: 1; color: var(--muted); }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 10px 0 0; color: var(--muted); font-size: 17px; }

.cta-band { background: var(--ink); color: #e9eef2; border-radius: 16px; padding: 44px; display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: center; }
@media (max-width: 820px) { .cta-band { grid-template-columns: 1fr; padding: 32px; } }
.cta-band h2 { color: #fff; margin: 0 0 8px; font-size: 2rem; font-weight: 900; }
.cta-band p { margin: 0; color: #b9c0c7; }
.cta-band .actions { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.btn.lime { background: var(--lime); color: var(--ink); border-color: var(--lime); }
.btn.lime:hover { opacity: .9; }
.cta-band .small { font-family: var(--sans); font-size: 14px; color: #b9c0c7; }
.cta-band .small a { color: #fff; }

/* Homepage "work with us" band */
.band-section { padding: 56px 0; }
.work-band { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: center; background: var(--card); border: 1px solid var(--line); border-left: 6px solid var(--lime); border-radius: var(--radius); padding: 32px 36px; }
@media (max-width: 820px) { .work-band { grid-template-columns: 1fr; padding: 26px; } }
.work-band h2 { margin: 6px 0 8px; font-size: 1.6rem; font-weight: 900; line-height: 1.2; }
.work-band p { margin: 0; color: var(--muted); }
.work-band .actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; }
@media (max-width: 820px) { .work-band .actions { justify-content: flex-start; } }
.proof.two { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 880px) { .proof.two { grid-template-columns: 1fr; } }
