/* mattkingham.com, 2026 refresh */
:root {
  --ink: #14202b;
  --ink-soft: #445463;
  --muted: #6b7a88;
  --line: #dfe5ea;
  --paper: #ffffff;
  --wash: #f4f7f9;
  --navy: #0b2a45;
  --brand: #156082;
  --brand-deep: #034867;
  --accent: #1559c7;

  /* Competency hexagon (matches the live mattkingham.com graphic) */
  --c-leadership: #034867;
  --c-td: #5d7992;
  --c-pi: #8e95ab;
  --c-eng: #156082;
  --c-maint: #629eae;
  --c-op: #88c7c8;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(11, 42, 69, .06), 0 8px 24px rgba(11, 42, 69, .08);
  --font-head: "Exo 2", "Segoe UI", system-ui, sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--brand-deep); }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; margin: 0 0 .5em; color: var(--navy); }
h2 { font-size: clamp(1.75rem, 3vw, 2.25rem); font-weight: 700; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid #f2a900; outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .wrap { padding: 0 16px; } }
.eyebrow {
  font-family: var(--font-head); font-size: .8rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--brand); margin-bottom: .5rem;
}
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  transition: background .25s ease, box-shadow .25s ease;
}
.site-header.scrolled { background: rgba(255,255,255,.94); backdrop-filter: blur(10px); box-shadow: 0 1px 0 var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; color: #fff; text-decoration: none; letter-spacing: .02em; }
.scrolled .brand { color: var(--navy); }
.nav { display: flex; gap: 28px; align-items: center; }
.nav a { color: rgba(255,255,255,.9); text-decoration: none; font-weight: 600; font-size: .95rem; }
.nav a:hover { color: #fff; }
.scrolled .nav a { color: var(--ink-soft); }
.scrolled .nav a:hover { color: var(--navy); }
.nav .nav-cta { border: 1.5px solid rgba(255,255,255,.7); padding: 6px 14px; border-radius: 999px; }
.scrolled .nav .nav-cta { border-color: var(--brand); color: var(--brand); }
.nav-toggle { display: none; background: none; border: 0; color: #fff; padding: 8px; cursor: pointer; }
.scrolled .nav-toggle { color: var(--navy); }
@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; box-shadow: 0 12px 24px rgba(0,0,0,.12); display: none; padding: 8px 0;
  }
  .nav.open { display: flex; }
  .nav a, .scrolled .nav a { color: var(--ink); padding: 12px 24px; }
  .nav .nav-cta, .scrolled .nav .nav-cta { border: 0; color: var(--brand); }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: min(78vh, 680px); display: flex; align-items: flex-end;
  background: #1b2228 url("../images/road-ahead.jpg") center 60% / cover no-repeat;
  color: #fff; padding: 120px 0 64px;
}
@media (max-width: 1200px) { .hero { background-image: url("../images/road-ahead-1200.jpg"); } }
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(3,30,52,.55) 0%, rgba(3,30,52,.25) 40%, rgba(3,30,52,.85) 100%);
}
.hero .wrap { position: relative; width: 100%; }
.hero h1 { color: #fff; font-size: clamp(2.5rem, 7vw, 4.75rem); font-weight: 700; margin-bottom: .2em; text-shadow: 0 2px 16px rgba(0,0,0,.35); }
.hero h1 .cred { font-weight: 400; opacity: .85; }
.hero .tagline { font-family: var(--font-head); font-size: clamp(1.1rem, 2.2vw, 1.5rem); max-width: 40ch; margin-bottom: 1.5rem; color: rgba(255,255,255,.92); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.chips li {
  font-size: .85rem; font-weight: 600; padding: 6px 12px; border-radius: 999px;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.28); backdrop-filter: blur(4px);
}

/* ---------- Sections ---------- */
section { padding: 88px 0; }
@media (max-width: 600px) { section { padding: 56px 0; } }
.alt { background: var(--wash); }

.about-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 56px; align-items: center; }
@media (max-width: 900px) { .about-grid { grid-template-columns: 1fr; gap: 32px; } }
.about-grid .lead { font-size: 1.2rem; color: var(--ink); }
.about-grid p { color: var(--ink-soft); }
.portrait { max-width: 340px; margin: 0 auto; border-radius: 50%; box-shadow: 0 20px 50px rgba(11,42,69,.22); }
@media (max-width: 900px) { .portrait { max-width: 240px; order: -1; } }

.landd-card {
  margin-top: 32px; display: flex; gap: 20px; align-items: center; padding: 20px 24px;
  border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow);
}
.landd-card img { width: 150px; flex: none; border-radius: 10px; }
.landd-card p { margin: 0 0 .4em; color: var(--ink-soft); font-size: .98rem; }
.landd-card a.btn { margin-top: 4px; }
@media (max-width: 560px) { .landd-card { flex-direction: column; align-items: flex-start; } }

.btn {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: .95rem;
  padding: 10px 18px; border-radius: 999px; text-decoration: none; border: 0; cursor: pointer;
  background: var(--brand); color: #fff; transition: background .2s, transform .2s;
}
.btn:hover { background: var(--brand-deep); color: #fff; transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--brand); border: 1.5px solid var(--brand); }
.btn.ghost:hover { background: var(--brand); color: #fff; }

/* ---------- Interactive resume ---------- */
.resume-head { text-align: center; max-width: 640px; margin: 0 auto 48px; }
.resume-head p { color: var(--ink-soft); }
.resume-grid { display: grid; grid-template-columns: 1fr 1.45fr 1fr; gap: 32px; align-items: start; }
@media (max-width: 1040px) {
  .resume-grid { grid-template-columns: 1fr 1fr; }
  .resume-grid .hex-col { grid-column: 1 / -1; order: -1; }
}
@media (max-width: 640px) { .resume-grid { grid-template-columns: 1fr; } }
.col-title { font-size: 1.1rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 16px; }
.hex-col .col-title { text-align: center; }

.stack { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.item {
  width: 100%; text-align: left; font: inherit; cursor: pointer; display: block;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px 12px 18px;
  position: relative; transition: border-color .2s, box-shadow .2s, transform .2s;
}
.item::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--brand); opacity: .35; transition: opacity .2s; }
.item:hover { border-color: #b9c8d4; box-shadow: var(--shadow); transform: translateY(-1px); }
.item:hover::before, .item:focus-visible::before { opacity: 1; }
.item .when { display: block; font-size: .8rem; font-weight: 700; color: var(--brand); letter-spacing: .04em; }
.item .org { display: block; font-family: var(--font-head); font-weight: 700; color: var(--navy); line-height: 1.3; }
.item .role { display: block; font-size: .9rem; color: var(--muted); line-height: 1.35; margin-top: 2px; }
.item .more { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: #b5c2cd; transition: color .2s, transform .2s; }
.item:hover .more { color: var(--brand); transform: translate(2px, -50%); }

.creds { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 8px; }
.creds li { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; color: var(--ink-soft); line-height: 1.4; }
.creds li::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: 6px; border-radius: 2px; background: var(--brand); transform: rotate(45deg); }
.creds strong { color: var(--ink); font-weight: 600; }
.sphr { display: inline-block; margin-top: 16px; }
.sphr img { width: 96px; }

/* Hexagon graphic */
.hex-wrap { max-width: 560px; margin: 0 auto; }
#competencies { width: 100%; height: auto; overflow: visible; }
.tri { cursor: pointer; outline: none; }
.tri path {
  transform-box: fill-box; transform-origin: center;
  transition: transform .28s cubic-bezier(.2,.8,.2,1), filter .28s, fill .2s;
  filter: drop-shadow(4px 6px 6px rgba(11,42,69,.28));
}
.tri text {
  fill: #fff; font-family: var(--font-head); font-weight: 600; font-size: 25px; text-anchor: middle;
  pointer-events: none; paint-order: stroke; stroke: rgba(1, 30, 41, .18); stroke-width: 3px;
  transition: transform .28s cubic-bezier(.2,.8,.2,1);
  transform-box: fill-box; transform-origin: center;
}
.tri:hover path, .tri:focus-visible path { transform: scale(1.05); filter: drop-shadow(6px 12px 14px rgba(11,42,69,.38)) brightness(1.12); }
.tri:hover text, .tri:focus-visible text { transform: scale(1.05); }
.tri:focus-visible path { stroke: #f2a900; stroke-width: 4; }
.hex-wrap:has(.tri:hover) .tri:not(:hover) path { filter: drop-shadow(4px 6px 6px rgba(11,42,69,.2)) saturate(.55) brightness(1.05); }
.hex-hint { text-align: center; color: var(--muted); font-size: .9rem; margin-top: 8px; }
@media (prefers-reduced-motion: reduce) { .tri path, .tri text, .item, .btn { transition: none; } }

/* ---------- Publications / quote ---------- */
.pubs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-top: 24px; }
@media (max-width: 760px) { .pubs { grid-template-columns: 1fr; } }
.pub { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.pub .kind { font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--brand); }
.pub h3 { font-size: 1.12rem; margin: 6px 0 8px; }
.pub p { color: var(--muted); font-size: .95rem; margin: 0; }

.quote { max-width: 860px; margin: 0 auto; text-align: center; }
.quote blockquote { margin: 0; font-family: var(--font-head); font-size: clamp(1.25rem, 2.4vw, 1.6rem); line-height: 1.45; color: var(--navy); font-weight: 500; }
.quote blockquote::before { content: "\201C"; display: block; font-size: 4rem; line-height: .6; color: var(--brand); opacity: .4; margin-bottom: 8px; }
.quote figcaption { margin-top: 18px; color: var(--muted); font-size: .95rem; }

footer { background: #061a2b; color: rgba(255,255,255,.75); padding: 28px 0; font-size: .9rem; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; }
footer a { color: rgba(255,255,255,.9); text-decoration: none; margin-left: 20px; }
footer a:first-child { margin-left: 0; }
footer a:hover { color: #fff; text-decoration: underline; }

/* ---------- Detail panels (modernized pop-ups) ---------- */
.panels { display: none; }

dialog.detail {
  --accent-c: var(--brand);
  width: min(760px, calc(100vw - 32px)); max-height: min(86vh, 900px);
  padding: 0; border: 0; border-radius: 18px; background: #fff; color: var(--ink);
  box-shadow: 0 30px 80px rgba(3, 20, 36, .35);
  overflow: hidden; display: none; flex-direction: column;
}
dialog.detail[open] { display: flex; animation: dlg-in .32s cubic-bezier(.2,.8,.2,1); }
dialog.detail.closing { animation: dlg-out .2s ease-in forwards; }
dialog.detail::backdrop { background: rgba(6, 22, 38, .55); backdrop-filter: blur(4px); animation: fade-in .3s ease; }
dialog.detail.closing::backdrop { animation: fade-out .2s ease-in forwards; }
@keyframes dlg-in { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes dlg-out { to { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }

.dlg-head {
  position: relative; padding: 26px 64px 22px 28px; color: #fff;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent-c) 78%, #011e29) 0%, color-mix(in srgb, var(--accent-c) 50%, #011e29) 100%);
  flex: none;
}
.dlg-head::after {
  content: ""; position: absolute; right: 70px; bottom: -1px; width: 120px; height: 100%;
  background: rgba(255,255,255,.07); clip-path: polygon(50% 100%, 0 0, 100% 0); pointer-events: none;
}
.dlg-head-inner { position: relative; z-index: 1; display: flex; align-items: center; gap: 20px; }
.dlg-titles { flex: 1 1 auto; min-width: 0; }
.dlg-logo {
  flex: none; display: grid; place-items: center; width: 168px; height: 72px; padding: 10px 14px;
  background: #fff; border-radius: 12px; box-shadow: 0 6px 18px rgba(1, 30, 41, .25), 0 0 0 1px rgba(255,255,255,.35);
}
.dlg-logo[hidden] { display: none; }
.dlg-logo img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.dlg-kicker { font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; opacity: .85; }
.dlg-head h3 { color: #fff; font-size: clamp(1.4rem, 3vw, 1.85rem); margin: 4px 0 0; }
.dlg-sub { margin: 6px 0 0; opacity: .9; font-size: 1rem; }
.dlg-close {
  position: absolute; top: 16px; right: 16px; width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: rgba(255,255,255,.16); color: #fff; cursor: pointer; display: grid; place-items: center;
  transition: background .2s, transform .2s;
}
.dlg-close:hover { background: rgba(255,255,255,.3); transform: rotate(90deg); }
.dlg-body { padding: 24px 28px 8px; overflow-y: auto; overscroll-behavior: contain; flex: 1 1 auto; }
.dlg-body h4 { font-size: 1.05rem; margin: 1.4em 0 .4em; color: var(--navy); }
.dlg-body h4:first-child { margin-top: 0; }
.dlg-body p, .dlg-body li { color: var(--ink-soft); }
.dlg-body ul { padding-left: 1.2em; margin: 0 0 1em; }
.dlg-body li { margin-bottom: .35em; }
.dlg-body li::marker { color: var(--accent-c); }
.dlg-body .role-block { border-left: 3px solid color-mix(in srgb, var(--accent-c) 35%, #fff); padding-left: 16px; margin-bottom: 18px; }
.dlg-body .role-title { font-family: var(--font-head); font-weight: 700; color: var(--navy); margin: 0 0 .3em; }
.dlg-body .tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; }
.dlg-body .tags li { margin: 0; font-size: .85rem; padding: 4px 10px; border-radius: 999px; background: var(--wash); border: 1px solid var(--line); color: var(--ink-soft); }
.dlg-body .callout { background: var(--wash); border-radius: 10px; padding: 14px 16px; font-size: .95rem; }

.dlg-foot {
  flex: none; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 20px; border-top: 1px solid var(--line); background: #fbfcfd;
}
.dlg-nav {
  display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; cursor: pointer;
  font: inherit; font-weight: 600; font-size: .92rem; color: var(--ink-soft); padding: 8px 10px; border-radius: 8px;
}
.dlg-nav:hover { background: var(--wash); color: var(--navy); }
.dlg-nav .lbl { max-width: 24ch; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dlg-count { font-size: .82rem; color: var(--muted); }
body.dlg-open { overflow: hidden; }

/* Phones: pop-ups become a bottom sheet */
@media (max-width: 600px) {
  dialog.detail {
    width: 100vw; max-width: 100vw; max-height: 92vh; margin: auto 0 0 0;
    border-radius: 18px 18px 0 0;
  }
  dialog.detail[open] { animation: sheet-in .34s cubic-bezier(.2,.8,.2,1); }
  dialog.detail.closing { animation: sheet-out .22s ease-in forwards; }
  .dlg-head { padding: 22px 60px 18px 20px; }
  .dlg-head-inner { flex-direction: column-reverse; align-items: flex-start; gap: 12px; }
  .dlg-logo { width: 132px; height: 56px; padding: 8px 10px; }
  .dlg-head::before { content: ""; position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: rgba(255,255,255,.45); }
  .dlg-body { padding: 20px 20px 8px; }
  .dlg-nav .lbl { max-width: 13ch; white-space: normal; line-height: 1.25; }
  .dlg-nav[data-dir="1"] .lbl { text-align: right; }
  .dlg-count { display: none; }
}
@keyframes sheet-in { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-out { to { transform: translateY(100%); } }
@media (prefers-reduced-motion: reduce) {
  dialog.detail[open], dialog.detail.closing, dialog.detail::backdrop { animation-duration: .01s; }
}
