/* ==========================================================================
   gavingibbons.com — static rebuild
   Single stylesheet. No frameworks, no build step, no runtime dependencies.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --brand:        #0dabe8;
  --brand-dark:   #0a8dbe;
  --brand-tint:   #e6f7fd;

  --ink:          #0e1418;
  --ink-2:        #3d4b55;
  --ink-3:        #6b7a86;
  --line:         #e3e8ec;

  --bg:           #ffffff;
  --bg-soft:      #f5f7f9;
  --bg-dark:      #0e1418;

  --maxw:         1180px;
  --maxw-prose:   720px;

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(14, 20, 24, .06), 0 2px 8px rgba(14, 20, 24, .04);
  --shadow-md: 0 4px 12px rgba(14, 20, 24, .07), 0 12px 32px rgba(14, 20, 24, .06);

  --font-head: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --step: clamp(3.5rem, 7vw, 6.5rem);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, iframe, video { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--ink);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 .6em;
  font-weight: 700;
}
h1 { font-size: clamp(2.35rem, 5.4vw, 4rem); }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); }
h3 { font-size: clamp(1.25rem, 2.2vw, 1.55rem); }
h4 { font-size: 1.1rem; }
p  { margin: 0 0 1.15em; }
a  { color: var(--brand-dark); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }
ul, ol { padding-left: 1.25em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
::selection { background: var(--brand); color: #fff; }

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

/* ---------- Layout primitives ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 1.25rem; }
.prose-wrap { width: 100%; max-width: var(--maxw-prose); margin-inline: auto; padding-inline: 1.25rem; }
.section { padding-block: var(--step); }
.section--soft { background: var(--bg-soft); }
.section--dark { background: var(--bg-dark); color: #c8d3db; }
.section--dark h1, .section--dark h2, .section--dark h3 { color: #fff; }
.section--dark p, .section--dark .lede, .section--dark li { color: #b8c5ce; }
.section--dark .muted { color: #7d8d99; }
.section--dark a:not(.btn) { color: #7fd7f5; }
.section--tight { padding-block: clamp(2.5rem, 5vw, 4rem); }
.center { text-align: center; }
.lede { font-size: clamp(1.1rem, 1.7vw, 1.28rem); color: var(--ink-2); }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: #fff; padding: .75rem 1.25rem; z-index: 200;
  border-radius: 0 0 var(--r-sm) 0;
}
.skip-link:focus { left: 0; color: #fff; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--font-head);
  font-weight: 600; font-size: 1rem; line-height: 1;
  padding: .95rem 1.75rem;
  border-radius: var(--r-pill);
  border: 2px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-dark); color: #fff; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn--light { background: #fff; color: var(--ink); }
.btn--light:hover { background: var(--brand); color: #fff; }
.btn--sm { padding: .65rem 1.2rem; font-size: .9rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex; align-items: center; gap: 1.5rem;
  min-height: 72px;
}
.brand { display: inline-flex; align-items: center; text-decoration: none; margin-right: auto; }
.brand img { max-height: 40px; width: auto; }
.brand__text {
  font-family: var(--font-head); font-weight: 700; font-size: 1.15rem;
  letter-spacing: -0.02em; color: var(--ink);
}
.nav { display: flex; align-items: center; gap: 1.75rem; }
.nav a {
  font-family: var(--font-head); font-weight: 500; font-size: .975rem;
  color: var(--ink); text-decoration: none; padding-block: .35rem;
  border-bottom: 2px solid transparent;
}
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--brand); }
.header-cta { flex-shrink: 0; }

.nav-toggle {
  display: none; background: none; border: 0; padding: .5rem; cursor: pointer;
  color: var(--ink);
}
.nav-toggle svg { width: 26px; height: 26px; }

@media (max-width: 900px) {
  .nav-toggle { display: block; order: 3; }
  .header-cta { display: none; }
  .nav {
    order: 4; flex-basis: 100%; flex-direction: column; align-items: flex-start;
    gap: .25rem; padding-bottom: 1rem; display: none;
  }
  .nav.is-open { display: flex; }
  .nav a { width: 100%; padding: .6rem 0; border-bottom: 1px solid var(--line); }
}

/* ---------- Hero ---------- */
.hero { background: var(--bg-soft); padding-block: clamp(4rem, 9vw, 8rem); }
.hero__inner {
  display: grid; gap: clamp(2.5rem, 5vw, 4.5rem); align-items: center;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
}
@media (max-width: 900px) { .hero__inner { grid-template-columns: 1fr; } }

.facts {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 2rem; box-shadow: var(--shadow-md);
}
.facts h2 {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .12em;
  color: var(--ink-3); margin-bottom: 1.5rem; font-weight: 600;
}
.facts dl { margin: 0; display: grid; gap: 1.35rem; }
.facts dt {
  font-family: var(--font-head); font-weight: 700; font-size: 1.85rem;
  color: var(--brand-dark); line-height: 1; letter-spacing: -0.02em;
}
.facts dd { margin: .35rem 0 0; font-size: .95rem; color: var(--ink-2); }

.hero__eyebrow {
  font-family: var(--font-head); font-weight: 600;
  font-size: clamp(1.5rem, 3vw, 2.1rem); color: var(--ink-3);
  letter-spacing: -0.02em; margin: 0 0 .1em;
}
.hero h1 { margin-bottom: .45em; max-width: 16ch; }
.hero__body { max-width: 46ch; font-size: 1.1rem; }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 1.5rem; }
.grid--3 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 1.6rem; display: flex; flex-direction: column;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
  overflow: hidden;
}
.card--media { padding: 0; }
.card--media .card__body { padding: 1.4rem 1.6rem 1.6rem; display: flex; flex-direction: column; flex: 1; }
.card__img {
  display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
}
.card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card:hover .card__img img { transform: scale(1.03); }

.article-hero {
  margin: 0 auto clamp(2rem, 4vw, 3rem); max-width: 900px; padding-inline: 1.25rem;
}
.article-hero img { width: 100%; border-radius: var(--r-lg); }
.card:hover { border-color: #cfd8de; box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card__meta {
  font-family: var(--font-head); font-size: .78rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3);
  margin-bottom: .7rem; display: flex; gap: .6rem; align-items: center; flex-wrap: wrap;
}
.card__tag {
  background: var(--brand-tint); color: var(--brand-dark);
  padding: .2rem .55rem; border-radius: var(--r-pill); letter-spacing: .04em;
}
.card h3 { font-size: 1.2rem; margin-bottom: .5rem; }
.card h3 a { color: inherit; text-decoration: none; }
.card h3 a:hover { color: var(--brand-dark); }
.card p { color: var(--ink-2); font-size: .98rem; margin-bottom: 1.15rem; }
.card__more {
  margin-top: auto; font-family: var(--font-head); font-weight: 600; font-size: .92rem;
  color: var(--brand-dark); text-decoration: none;
}
.card__more:hover { color: var(--ink); }
.card__more::after { content: " →"; }

/* Services */
.service {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 2rem 1rem; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: .9rem;
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.service:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.service svg { width: 34px; height: 34px; color: var(--brand); }
.service span { font-family: var(--font-head); font-weight: 500; color: var(--ink); font-size: 1rem; }

/* Methodology steps */
.steps { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.step {
  border: 1px solid var(--line); border-radius: var(--r-md); padding: 1.75rem; background: #fff;
}
.step__num {
  font-family: var(--font-head); font-weight: 700; font-size: .9rem;
  color: var(--brand); letter-spacing: .1em; display: block; margin-bottom: .6rem;
}
.step h3 { font-size: 1.25rem; margin-bottom: .5rem; }
.step p { margin: 0; font-size: .98rem; }

/* ---------- Newsletter ---------- */
.newsletter-embed {
  border: 0; width: 100%; min-height: 88px; background: transparent;
  border-radius: var(--r-md);
}
.newsletter-box {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: clamp(1.75rem, 4vw, 3rem); box-shadow: var(--shadow-sm);
  max-width: 760px; margin-inline: auto;
}
.section--dark .newsletter-box { background: #161e25; border-color: #26323b; }

/* ---------- Article ---------- */
.article-head { padding-block: clamp(3rem, 6vw, 5rem) clamp(1.5rem, 3vw, 2.5rem); }
.article-head h1 { max-width: 22ch; }
.article-meta {
  font-family: var(--font-head); font-size: .85rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3);
  display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; margin-bottom: 1.25rem;
}
.article-sub { font-size: 1.2rem; color: var(--ink-2); max-width: 60ch; }

.article-body { font-size: 1.12rem; line-height: 1.75; padding-bottom: clamp(3rem, 6vw, 5rem); }
.article-body h1 { font-size: clamp(1.7rem, 3vw, 2.1rem); margin-top: 2.2em; }
.article-body h2 { font-size: clamp(1.5rem, 2.6vw, 1.9rem); margin-top: 2em; }
.article-body h3 { margin-top: 1.8em; }
.article-body h1:first-child, .article-body h2:first-child { margin-top: 0; }
.article-body img { border-radius: var(--r-md); margin-block: 2rem; width: 100%; }
.article-body figure { margin: 2rem 0; }
.article-body figcaption { font-size: .9rem; color: var(--ink-3); text-align: center; margin-top: .6rem; }
.article-body figcaption:empty { display: none; }
.article-body blockquote {
  margin: 2rem 0; padding: .25rem 0 .25rem 1.5rem;
  border-left: 3px solid var(--brand); color: var(--ink); font-size: 1.15rem;
}
.article-body ul, .article-body ol { margin-block: 1.25em; }
.article-body li { margin-bottom: .5em; }
.article-body li > p { margin-bottom: .4em; }
.article-body strong { color: var(--ink); }
.article-body hr { margin-block: 2.5rem; }

.article-foot {
  border-top: 1px solid var(--line); margin-top: 3rem; padding-top: 2rem;
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center;
}

/* Post navigation */
.post-nav { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-top: 2.5rem; }
.post-nav a {
  border: 1px solid var(--line); border-radius: var(--r-md); padding: 1.1rem 1.25rem;
  text-decoration: none; color: var(--ink); display: block;
}
.post-nav a:hover { border-color: var(--brand); }
.post-nav span {
  display: block; font-family: var(--font-head); font-size: .75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin-bottom: .35rem;
}
.post-nav--next { text-align: right; }

/* ---------- Archive / list ---------- */
.list-head { padding-block: clamp(3rem, 6vw, 5rem) 2rem; }
.filter-bar {
  display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: 2rem;
}
.filter-bar a, .filter-bar button {
  font-family: var(--font-head); font-size: .85rem; font-weight: 500;
  padding: .45rem 1rem; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  text-decoration: none; cursor: pointer;
}
.filter-bar a:hover, .filter-bar button:hover { border-color: var(--brand); color: var(--ink); }
.filter-bar [aria-current="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

.search-field {
  width: 100%; max-width: 420px; padding: .8rem 1.1rem;
  border: 1px solid var(--line); border-radius: var(--r-pill);
  font: inherit; font-size: 1rem; color: var(--ink); background: #fff;
}
.search-field:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-tint); }

.pagination {
  display: flex; gap: .4rem; flex-wrap: wrap; justify-content: center;
  margin-top: 3rem; align-items: center;
}
.pagination a, .pagination span {
  font-family: var(--font-head); font-size: .95rem; font-weight: 500;
  min-width: 42px; height: 42px; padding-inline: .75rem;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  text-decoration: none; color: var(--ink-2); background: #fff;
}
.pagination a:hover { border-color: var(--brand); color: var(--ink); }
.pagination [aria-current="page"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.pagination .is-gap { border: 0; background: none; min-width: auto; padding-inline: .25rem; }

/* ---------- CTA band ---------- */
.cta-band { background: var(--bg-dark); color: #c8d3db; }
.cta-band h2 { color: #fff; }
.cta-band p { max-width: 58ch; margin-inline: auto; }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-dark); color: #93a3ae; padding-block: 3.5rem 2rem; }
.site-footer a { color: #d3dde4; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid {
  display: grid; gap: 2.5rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  padding-bottom: 2.5rem; border-bottom: 1px solid #26323b;
}
.footer-grid h4 {
  color: #fff; font-size: .8rem; text-transform: uppercase; letter-spacing: .1em;
  margin-bottom: 1rem;
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: .55rem; }
.footer-bottom {
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between;
  padding-top: 1.75rem; font-size: .9rem;
}
.social { display: flex; gap: .85rem; }
.social a {
  width: 38px; height: 38px; border-radius: var(--r-pill);
  border: 1px solid #2c3942; display: inline-flex; align-items: center; justify-content: center;
}
.social a:hover { background: var(--brand); border-color: var(--brand); }
.social svg { width: 18px; height: 18px; }

/* ---------- Utilities ---------- */
.stack > * + * { margin-top: 1.5rem; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.muted { color: var(--ink-3); }
.no-results { padding: 3rem 0; text-align: center; color: var(--ink-3); }

@media print {
  .site-header, .site-footer, .cta-band, .newsletter-box, .post-nav { display: none !important; }
  body { color: #000; }
}
