/* johnbuttery.com - main stylesheet
   Palette: charcoal headings and navigation, deep oxblood accent, warm off-white background. Charcoal footer. */

:root {
  --charcoal: #252B32;
  --charcoal-2: #252B32;
  --steel: #5c6770;
  --steel-dark: #3e4750;
  --steel-light: #e6e3dc;
  --ink: #252B32;
  --text: #000000;
  --muted: #5c6770;
  --line: #d8d4cc;
  --bg: #F5F4F1;
  --bg-alt: #ecebe6;
  /* Accent: deep oxblood. Change these three lines to try another accent. */
  --accent: #6B1F26;
  --accent-dark: #52161c;
  --accent-light: #f3e9ea;
  --radius: 6px;
  --max: 1120px;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
picture { display: block; }
.figure img { width: 100%; }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
h1, h2, h3, h4 { font-family: var(--font-serif); color: var(--ink); line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: clamp(2rem, 4vw, 2.9rem); }
h2 { font-size: clamp(1.55rem, 2.6vw, 2.1rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
ul { padding-left: 1.2em; }
li { margin-bottom: .35em; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 780px; }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--charcoal); color: #fff; padding: 8px 14px; z-index: 100; }
.skip-link:focus { left: 8px; top: 8px; }

/* Header */
.site-header { background: var(--bg); border-top: 4px solid var(--accent); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { text-decoration: none; color: var(--charcoal); line-height: 1.15; }
.brand-name { font-family: var(--font-serif); font-size: 1.35rem; font-weight: 700; display: block; }
.brand-tag { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--steel); }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.nav a { text-decoration: none; color: var(--charcoal); font-size: .93rem; font-weight: 500; padding: 8px 11px; border-radius: var(--radius); }
.nav a:hover, .nav a[aria-current="page"] { background: var(--steel-light); color: var(--charcoal); }
.nav .nav-cta { background: var(--accent); color: #fff; }
.nav .nav-cta:hover { background: var(--accent-dark); color: #fff; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--charcoal); margin: 4px 0; }

/* Breadcrumbs */
.breadcrumbs { background: var(--bg-alt); border-bottom: 1px solid var(--line); font-size: .85rem; }
.breadcrumbs ol { list-style: none; margin: 0; padding: 10px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumbs li { margin: 0; color: var(--muted); }
.breadcrumbs li + li::before { content: "/"; margin-right: 6px; color: #aab2b9; }
.breadcrumbs a { color: var(--accent); text-decoration: none; }

/* Sections */
.section { padding: 72px 0; }
.section-alt { background: var(--bg-alt); }
.section-tint { background: var(--steel-light); }
.eyebrow { font-size: .78rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: .6em; display: block; }
.lead { font-size: 1.15rem; color: var(--charcoal-2); }

/* Hero */
.hero { padding: 80px 0 72px; background: var(--bg); border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
.hero h1 { margin-bottom: .35em; }
.hero .tagline { font-size: 1.2rem; color: var(--charcoal); font-weight: 600; margin-bottom: 1em; padding-left: 14px; border-left: 3px solid var(--accent); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.4em; }
.page-hero { padding: 56px 0 44px; background: var(--bg-alt); border-bottom: 1px solid var(--line); }
.page-hero p { max-width: 760px; }

/* Buttons */
.btn { display: inline-block; text-decoration: none; font-weight: 600; font-size: .95rem; padding: 12px 22px; border-radius: var(--radius); border: 2px solid var(--accent); transition: background .15s, color .15s; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn-outline { background: transparent; color: var(--accent); }
.btn-outline:hover { background: var(--accent-light); color: var(--accent-dark); }

/* Grids and cards */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.card h3 { margin-bottom: .4em; }
.card p:last-child { margin-bottom: 0; }
.card-accent { border-top: 4px solid var(--accent); }
.card .card-label { font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--steel); }
.card-link { text-decoration: none; color: inherit; display: block; transition: border-color .15s, transform .15s; }
.card-link:hover { border-color: var(--steel); transform: translateY(-2px); color: inherit; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.audience-group > .group-label { font-family: var(--font-sans); font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--steel); margin-bottom: 14px; }

.checklist { list-style: none; padding: 0; }
.checklist li { position: relative; padding-left: 28px; }
.checklist li::before { content: ""; position: absolute; left: 4px; top: .55em; width: 12px; height: 7px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }

.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li { counter-increment: step; position: relative; padding-left: 52px; margin-bottom: 20px; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; text-align: center; }
.stat strong { display: block; font-family: var(--font-serif); font-size: 2.2rem; color: var(--accent); }
.stat span { font-size: .9rem; color: var(--charcoal-2); }

.figure { margin: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--bg-alt); }
.figure figcaption { font-size: .8rem; color: var(--muted); padding: 8px 12px; }

.callout { border-left: 4px solid var(--accent); background: var(--accent-light); padding: 18px 22px; border-radius: 0 var(--radius) var(--radius) 0; margin: 1.5em 0; }
.disclosure { font-size: .9rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 16px; margin-top: 32px; }

.cta-band { background: var(--steel-light); padding: 56px 0; text-align: center; }
.cta-band p { max-width: 640px; margin: 0 auto 1.2em; }

/* Books */
.book { display: grid; grid-template-columns: 180px 1fr; gap: 28px; align-items: start; }
.book img { border-radius: 4px; box-shadow: 0 6px 18px rgba(0,0,0,.12); }

/* Blog */
.post-meta { font-size: .85rem; color: var(--muted); margin-bottom: 1.4em; }
.article h2 { margin-top: 1.6em; }
.article h3 { margin-top: 1.3em; }
.post-card h3 a { text-decoration: none; color: var(--ink); }
.post-card h3 a:hover { color: var(--accent); }

/* CV */
.cv-role { border-bottom: 1px solid var(--line); padding: 18px 0; }
.cv-role:last-child { border-bottom: 0; }
.cv-role h3 { margin-bottom: .15em; }
.cv-meta { font-size: .9rem; color: var(--muted); margin-bottom: .5em; }
.cv-meta em { color: var(--charcoal); font-style: normal; }

/* Forms */
.form { display: grid; gap: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label { font-weight: 600; font-size: .9rem; color: var(--charcoal); display: block; margin-bottom: 4px; }
input, select, textarea { width: 100%; font: inherit; font-size: .95rem; padding: 11px 12px; border: 1px solid #c8cfd5; border-radius: var(--radius); background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--steel); outline-offset: 1px; border-color: var(--steel); }
textarea { min-height: 150px; resize: vertical; }
.hp-field { position: absolute; left: -9999px; }
.form-note { font-size: .85rem; color: var(--muted); }
.form-status { padding: 12px 16px; border-radius: var(--radius); display: none; }
.form-status.ok { display: block; background: #e5f4e4; color: #24502a; }
.form-status.err { display: block; background: #fbebeb; color: #7a2323; }

/* Footer (only dark area) */
.site-footer { background: var(--charcoal); border-top: 4px solid var(--accent); color: #c9ced3; padding: 56px 0 28px; font-size: .92rem; }
.site-footer a { color: #e4e8eb; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.site-footer h4 { font-family: var(--font-sans); color: #fff; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 12px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.footer-bottom { border-top: 1px solid #454b52; margin-top: 36px; padding-top: 18px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: .82rem; color: #9aa2a9; }

/* Responsive */
@media (max-width: 960px) {
  .hero-grid, .split { grid-template-columns: 1fr; gap: 32px; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav { position: absolute; top: 72px; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--line); display: none; }
  .nav.open { display: block; }
  .nav ul { flex-direction: column; padding: 12px 24px 20px; }
  .nav a { display: block; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .section { padding: 52px 0; }
  .grid-2, .grid-3, .grid-4, .form-row { grid-template-columns: 1fr; }
  .book { grid-template-columns: 1fr; }
  .book img { max-width: 200px; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media print {
  .site-header, .site-footer, .breadcrumbs, .cta-band, .no-print { display: none !important; }
  body { font-size: 11pt; color: #000; background: #fff; }
  .section { padding: 12px 0; }
}

/* Fee table */
.fee-table { width: 100%; border-collapse: collapse; margin-top: 16px; background: #fff; border: 1px solid var(--line, #dde3ea); }
.fee-table th, .fee-table td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line, #dde3ea); vertical-align: top; }
.fee-table th { background: var(--charcoal); color: #fff; font-weight: 600; }
.fee-table td:last-child { white-space: nowrap; font-weight: 600; }
.narrow h3 { margin-top: 1.4em; }
@media (max-width: 640px) { .fee-table td:last-child { white-space: normal; } }
.split .fee-table td:last-child { white-space: normal; }
a.stat-link { display: block; color: inherit; text-decoration: none; border-radius: 8px; }
a.stat-link:hover span { text-decoration: underline; color: var(--accent); }
[hidden] { display: none !important; }

/* Accent details */
.card-link:hover { border-color: var(--accent); }
.post-card h3 a:hover { color: var(--accent); }
a.stat-link:hover span { color: var(--accent-dark); }
input:focus, select:focus, textarea:focus { outline-color: var(--accent); border-color: var(--accent); }
.section-tint .eyebrow { color: var(--accent-dark); }

h2.h3 { font-size: 1.25rem; }
.group-label { font-weight: 700; }

/* Article extras */
.toc { background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 22px; margin: 28px 0; }
.toc-title { font-weight: 700; font-size: .85rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin: 0 0 8px; }
.toc ol { margin: 0; padding-left: 1.2em; }
.toc li { margin-bottom: .2em; font-size: .95rem; }
.article h2[id] { scroll-margin-top: 90px; }
.author-box { display: grid; grid-template-columns: 96px 1fr; gap: 20px; align-items: start; border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: var(--radius); padding: 22px; margin-top: 40px; background: #fff; }
.author-box img { border-radius: 50%; width: 96px; height: 96px; object-fit: cover; }
.author-name { font-weight: 700; color: var(--ink); margin-bottom: .4em; }
.author-box p:last-child { margin-bottom: 0; font-size: .95rem; }
.related { margin-top: 32px; }
.related ul { padding-left: 1.2em; }
@media (max-width: 640px) { .author-box { grid-template-columns: 1fr; } }
.pull-quote { margin: 1.6em 0; padding: 6px 0 6px 22px; border-left: 4px solid var(--accent); font-family: var(--font-serif); font-size: 1.3rem; line-height: 1.45; color: var(--ink); }
.table-wrap { overflow-x: auto; margin: 1.2em 0; }
.compare-table caption { caption-side: top; text-align: left; font-size: .85rem; color: var(--muted); padding-bottom: 8px; }
.compare-table tbody th { background: var(--bg-alt); color: var(--ink); font-weight: 600; white-space: nowrap; }
.compare-table td:last-child { white-space: normal; font-weight: 400; }
.compare-table td, .compare-table th { font-size: .92rem; }

/* Stronger accent moments */
.eyebrow::before { content: ""; display: inline-block; width: 28px; height: 3px; background: var(--accent); vertical-align: middle; margin-right: 10px; }
.hero .figure { border: 0; box-shadow: 12px 12px 0 var(--accent); }
.cta-band { background: var(--accent); color: #fff; }
.cta-band h2 { color: #fff; }
.cta-band a:not(.btn) { color: #fff; }
.cta-band .btn-primary { background: #fff; border-color: #fff; color: var(--accent); }
.cta-band .btn-primary:hover { background: var(--accent-light); border-color: var(--accent-light); color: var(--accent-dark); }
@media (max-width: 640px) { .hero .figure { box-shadow: 8px 8px 0 var(--accent); } }

/* Diagrams */
.diagram svg { display: block; width: 100%; height: auto; }
.dg-flow-box { fill: #fff; stroke: var(--steel); stroke-width: 1.5; }
.dg-flow-go { fill: var(--accent-light); stroke: var(--accent); stroke-width: 2; }
.dg-flow-gate { fill: var(--accent); }
.dg-flow-line { fill: none; stroke: var(--charcoal); stroke-width: 2; }
.dg-flow-loop { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 7 5; }
.dg-flow-title { font-family: var(--font-sans); font-size: 16px; font-weight: 700; fill: var(--ink); }
.dg-flow-text { font-family: var(--font-sans); font-size: 14px; fill: var(--text); }
.dg-flow-num { font-family: var(--font-sans); font-size: 13px; font-weight: 700; fill: var(--accent); letter-spacing: .08em; }
.dg-flow-gate-text { font-family: var(--font-sans); font-size: 16px; font-weight: 700; fill: #fff; }
.dg-flow-tag { font-family: var(--font-sans); font-size: 14px; font-weight: 700; fill: var(--accent); }
.diagram-flow { margin: 32px 0 0; }
.diagram svg.diagram-flow-narrow { display: none; }
.diagram-flow-narrow .dg-flow-title { font-size: 18px; }
.diagram-flow-narrow .dg-flow-text { font-size: 16px; }
@media (max-width: 760px) {
  .diagram svg.diagram-flow-wide { display: none; }
  .diagram svg.diagram-flow-narrow { display: block; max-width: 420px; }
}
/* Arrowheads: CSS overrides the fill colors written inside the page's SVG markers */
#dg-arrow path, #dg-arrow-n path { fill: var(--charcoal); }
#dg-arrow-accent path, #dg-arrow-accent-n path { fill: var(--accent); }
