/* ==========================================================================
   Ben Hommerding — Professional site (beninbeta.com/professional)
   Editorial theme. Distinct from the BenInBeta detailing brand: serif reading
   type, restrained pine accent, generous whitespace. Light + dark.
   ========================================================================== */

:root {
  --font-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --bg: #f8f6f1;
  --surface: #ffffff;
  --surface-2: #f2efe7;
  --text: #1a1d1b;
  --text-2: #545d57;
  --muted: #8b9189;
  --border: #e6e1d6;
  --border-strong: #d7d1c3;
  --accent: #235c4a;
  --accent-hover: #2f7a62;
  --on-accent: #ffffff;

  --radius: 10px;
  --radius-lg: 16px;
  --measure: 43rem;
  --shadow-sm: 0 1px 2px rgba(26, 29, 27, 0.05);
  --shadow-md: 0 6px 24px rgba(26, 29, 27, 0.08);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141613;
    --surface: #1c1f1b;
    --surface-2: #242822;
    --text: #ecebe4;
    --text-2: #a8ada2;
    --muted: #7f857c;
    --border: #2a2e28;
    --border-strong: #3a3f38;
    --accent: #86c06e;
    --accent-hover: #9bcf86;
    --on-accent: #12150f;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #141613;
  --surface: #1c1f1b;
  --surface-2: #242822;
  --text: #ecebe4;
  --text-2: #a8ada2;
  --muted: #7f857c;
  --border: #2a2e28;
  --border-strong: #3a3f38;
  --accent: #86c06e;
  --accent-hover: #9bcf86;
  --on-accent: #12150f;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }

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

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

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

img { max-width: 100%; height: auto; display: block; }

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

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

.wrap { max-width: 68rem; margin: 0 auto; padding: 0 24px; }
.reading { max-width: var(--measure); margin: 0 auto; padding: 0 24px; }

.eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--muted);
}

/* ---- Header ------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 900;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.1) blur(8px);
  -webkit-backdrop-filter: saturate(1.1) blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-header .inner {
  max-width: 68rem; margin: 0 auto; padding: 0 24px;
  height: 62px; display: flex; align-items: center; gap: 20px;
}
.brand {
  font-family: var(--font-sans); font-weight: 700; font-size: 19px;
  color: var(--text); letter-spacing: -0.01em; white-space: nowrap;
}
.brand:hover { text-decoration: none; color: var(--text); }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a {
  color: var(--text-2); font-size: 14px; font-weight: 500;
  padding: 8px 12px; border-radius: var(--radius);
}
.nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.theme-toggle {
  border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); width: 34px; height: 34px; border-radius: var(--radius);
  cursor: pointer; font-size: 15px; line-height: 1; display: inline-flex;
  align-items: center; justify-content: center;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* ---- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-sans); font-size: 14px; font-weight: 600;
  padding: 10px 18px; border-radius: var(--radius); cursor: pointer;
  border: 1px solid transparent; transition: background .15s, border-color .15s, color .15s;
}
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-hover); color: var(--on-accent); text-decoration: none; }
.btn--ghost { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ---- Landing ------------------------------------------------------------ */
.hero { padding: 72px 0 40px; }
.hero h1 {
  font-family: var(--font-sans); font-weight: 700;
  font-size: clamp(2.1rem, 5vw, 3.1rem); line-height: 1.08;
  letter-spacing: -0.02em; margin: 14px 0 0;
}
.hero .role { font-size: 1.05rem; color: var(--text-2); margin: 12px 0 0; font-weight: 500; }
.hero .intro { max-width: var(--measure); margin: 22px 0 0; }
.hero .intro p { font-size: 1.08rem; color: var(--text-2); margin: 0 0 16px; }
.hero .cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.hero--center { text-align: center; }
.hero--center .cta { justify-content: center; }
.hero-tagline { font-size: 1.18rem; color: var(--text-2); max-width: 36rem; margin: 16px auto 0; line-height: 1.5; }
.hero--center .intro { text-align: left; max-width: 40rem; margin: 36px auto 0; }

.section { padding: 40px 0; border-top: 1px solid var(--border); }
.section > .wrap > h2, .section-title {
  font-family: var(--font-sans); font-weight: 700; font-size: 1.5rem;
  letter-spacing: -0.01em; margin: 0 0 6px;
}
.section .lead { color: var(--text-2); margin: 0 0 26px; max-width: var(--measure); }

.grid-highlights { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow-sm);
}
.card h3 { font-size: 1.02rem; margin: 0 0 8px; font-weight: 700; letter-spacing: -0.01em; }
.card p { margin: 0; color: var(--text-2); font-size: 0.97rem; }

.exp { display: flex; flex-direction: column; }
.exp-item {
  display: grid; grid-template-columns: 12rem 1fr; gap: 20px;
  padding: 20px 0; border-top: 1px solid var(--border);
}
.exp-item:first-child { border-top: none; }
.exp-when { color: var(--muted); font-size: 0.9rem; font-weight: 500; }
.exp-org { font-weight: 700; margin: 0; }
.exp-role { color: var(--text-2); font-size: 0.95rem; margin: 2px 0 0; }
.exp-note { color: var(--muted); font-size: 0.92rem; margin: 8px 0 0; }
.edu { color: var(--text-2); margin-top: 22px; font-size: 0.95rem; }

/* ---- Article cards ------------------------------------------------------ */
.posts { display: flex; flex-direction: column; gap: 4px; }
.post-card {
  display: grid; grid-template-columns: 1fr; gap: 6px;
  padding: 22px 0; border-top: 1px solid var(--border);
}
.post-card:first-child { border-top: none; }
.post-card .kicker { font-size: 13px; color: var(--muted); }
.post-card h3 {
  font-family: var(--font-sans); font-weight: 700; font-size: 1.4rem;
  line-height: 1.2; margin: 2px 0 0; letter-spacing: -0.01em;
}
.post-card h3 a { color: var(--text); }
.post-card h3 a:hover { color: var(--accent); text-decoration: none; }
.post-card p { margin: 6px 0 0; color: var(--text-2); }
.post-card .more { font-size: 14px; font-weight: 600; margin-top: 10px; }

/* ---- Article page ------------------------------------------------------- */
.article { padding: 44px 0 64px; }
.article-head { max-width: var(--measure); margin: 0 auto; padding: 0 24px; }
.article-head h1 {
  font-family: var(--font-sans); font-weight: 700;
  font-size: clamp(2rem, 4.5vw, 2.9rem); line-height: 1.12;
  letter-spacing: -0.02em; margin: 12px 0 0;
}
.article-meta { color: var(--muted); font-size: 0.92rem; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 8px 14px; }
.article-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tag {
  font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-2); background: var(--surface-2);
  border: 1px solid var(--border); padding: 4px 10px; border-radius: 999px;
}
.article-hero { max-width: 60rem; margin: 30px auto 0; padding: 0 24px; }
.article-hero img { width: 100%; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.article-hero--css {
  height: clamp(180px, 34vw, 340px); border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 140% at 12% 10%, color-mix(in srgb, var(--accent) 32%, transparent), transparent 60%),
    linear-gradient(135deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
}

.prose {
  font-family: var(--font-sans);
  max-width: var(--measure); margin: 40px auto 0; padding: 0 24px;
  font-size: 1.14rem; line-height: 1.72; color: var(--text);
  letter-spacing: -0.003em;
}
.prose p { margin: 0 0 1.35em; }
.prose h2 { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.01em; margin: 1.8em 0 0.5em; }
.prose h3 { font-size: 1.3rem; font-weight: 700; margin: 1.6em 0 0.4em; }
.prose a { text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.prose blockquote {
  margin: 1.6em 0; padding: 6px 0 6px 22px; border-left: 3px solid var(--accent);
  color: var(--text-2); font-style: italic;
}
.prose ul, .prose ol { margin: 0 0 1.4em; padding-left: 1.3em; }
.prose li { margin: 0.4em 0; }
.prose img { border-radius: var(--radius); margin: 1.6em 0; }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 2.2em 0; }
.prose code {
  font-family: var(--font-mono); font-size: 0.88em; background: var(--surface-2);
  padding: 2px 6px; border-radius: 5px; border: 1px solid var(--border);
}

.article-foot {
  max-width: var(--measure); margin: 48px auto 0; padding: 26px 24px 0;
  border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between;
}
.article-foot .who { color: var(--text-2); font-size: 0.95rem; }

/* ---- Footer ------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border); margin-top: 20px;
  padding: 34px 0; color: var(--muted); font-size: 0.9rem;
}
.site-footer .inner { max-width: 68rem; margin: 0 auto; padding: 0 24px; display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; }
.site-footer a { color: var(--text-2); }
.site-footer .spacer { margin-left: auto; }

/* ---- Responsive --------------------------------------------------------- */
@media (max-width: 720px) {
  body { font-size: 16px; }
  .grid-highlights { grid-template-columns: 1fr; }
  .exp-item { grid-template-columns: 1fr; gap: 4px; }
  .exp-when { order: -1; }
  .prose { font-size: 1.15rem; }
  .prose > p:first-of-type::first-letter { font-size: 2.8rem; }
  .hero { padding: 48px 0 28px; }
  .nav a[data-hide-mobile] { display: none; }
}

/* ---- Landing hero media banner ----------------------------------------- */
.hero--media { padding-top: 30px; }
.hero-banner { max-width: 62rem; margin: 0 auto 34px; }
.hero-banner img {
  width: 100%; aspect-ratio: 2000 / 760; object-fit: cover;
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}
@media (max-width: 720px) { .hero-banner { margin-bottom: 24px; } }
