/* ================================================================
   TOKENS — Consulting playbook palette
   Light: paper white + charcoal-navy text + teal accent (original brand)
   Dark:  deep charcoal + bright teal-cyan accent (NOT navy-black-teal soup)
================================================================ */
:root {
  --bg:           #fafcfc;
  --bg-card:      #ffffff;
  --bg-alt:       #eef4f4;
  --bg-header:    rgba(250,252,252,0.94);
  --text:         #12242c;
  --text-dim:     #45605f;
  --text-faint:   #587372;
  --line:         #dbe6e6;
  --line-strong:  #b9cbcb;
  --accent:       #157878;
  --accent-dk:    #0e5c5c;
  --accent-lt:    #1fa898;
  --accent-glow:  rgba(21,120,120,0.09);
  --accent-grad:  linear-gradient(90deg,#1fa898,#157878,#0e5c5c);
  --hero-bg:      linear-gradient(120deg,#0e2d2d 0%,#124f4f 48%,#157878 100%);
  --hero-text:    #ffffff;
  --hero-text-dim:rgba(255,255,255,0.76);
  --hero-num:     rgba(255,255,255,0.10);
  --shadow-sm:    0 1px 6px rgba(18,36,44,0.07);
  --shadow:       0 6px 28px rgba(18,36,44,0.09);
  --shadow-lg:    0 14px 48px rgba(18,36,44,0.14);
  --radius:       14px;
  --radius-sm:    8px;
  --top-h:        66px;
  --bot-h:        66px;
  --ease:         cubic-bezier(.25,.46,.45,.94);
  --font:         'Inter','Helvetica Neue',Arial,sans-serif;
  --font-display: 'Playfair Display',Georgia,'Times New Roman',serif;
  --font-mono:    ui-monospace,'Cascadia Code','Source Code Pro',monospace;
  --on-accent:    #ffffff; /* text/icon color sitting on top of --accent */
}

[data-theme="dark"] {
  --on-accent:    #08181a; /* dark accent is bright cyan — needs dark text for contrast */
  --bg:           #0e1417;
  --bg-card:      #161e22;
  --bg-alt:       #1b2529;
  --bg-header:    rgba(14,20,23,0.94);
  --text:         #eaf2f1;
  --text-dim:     #9db3b2;
  --text-faint:   #71908f;
  --line:         #263133;
  --line-strong:  #34423f;
  --accent:       #3ddbc4;
  --accent-dk:    #29c1aa;
  --accent-lt:    #6ee9d8;
  --accent-glow:  rgba(61,219,196,0.11);
  --accent-grad:  linear-gradient(90deg,#6ee9d8,#3ddbc4,#29c1aa);
  --hero-bg:      linear-gradient(120deg,#08161a 0%,#0b2a2a 48%,#0e3a37 100%);
  --hero-text:    #f3fbfa;
  --hero-text-dim:rgba(243,251,250,0.68);
  --hero-num:     rgba(255,255,255,0.06);
  --shadow-sm:    0 1px 6px rgba(0,0,0,0.30);
  --shadow:       0 6px 28px rgba(0,0,0,0.40);
  --shadow-lg:    0 14px 48px rgba(0,0,0,0.55);
}

/* ================================================================
   THEME SWITCH — smooth cross-fade, no flash
================================================================ */
html { transition: background-color .3s var(--ease); }
body, .site-header, .page-hero, .page-wrap, .bottom-nav,
.site-footer, .card, .social-link, .exec-summary, .framework-card,
.stat, .pull-quote, .timeline-item, table, th, td {
  transition: background-color .3s var(--ease), border-color .3s var(--ease),
              box-shadow .3s var(--ease), color .3s var(--ease);
}

/* ================================================================
   RESET
================================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; -webkit-text-size-adjust: 100%; }
img  { max-width: 100%; height: auto; display: block; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-dim);
  font-weight: 400;
  line-height: 1.75;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ================================================================
   SKIP LINK
================================================================ */
.skip-link {
  position: absolute; top: -100%; left: 1rem;
  background: var(--accent); color: var(--on-accent);
  padding: .5rem 1rem;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-size: .85rem; font-weight: 600; z-index: 9999; text-decoration: none;
}
.skip-link:focus { top: 0; }

/* ================================================================
   PROGRESS BAR
================================================================ */
#progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: var(--accent-grad); z-index: 1000;
  border-radius: 0 2px 2px 0; pointer-events: none; transition: width .08s linear;
}

/* ================================================================
   HEADER
================================================================ */
.site-header {
  position: sticky; top: 0; z-index: 500; height: var(--top-h);
  background: var(--bg-header);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
}
.site-header.scrolled { border-bottom-color: var(--line); box-shadow: var(--shadow); }

.header-inner {
  max-width: 1200px; margin: 0 auto; height: 100%;
  display: flex; align-items: center; gap: 1.25rem; padding: 0 1.5rem;
}

.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; flex-shrink: 0; transition: opacity .2s; }
.brand:hover { opacity: .72; text-decoration: none; }
.brand-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 2px solid var(--line); }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name { font-family: var(--font-display); font-size: .97rem; font-weight: 700; color: var(--text); letter-spacing: -.01em; }
.brand-role { font-size: .67rem; font-weight: 400; color: var(--text-faint); letter-spacing: .02em; }

.top-nav { display: flex; align-items: center; gap: .1rem; margin-left: auto; }
.nav-link {
  position: relative; font-size: .8rem; font-weight: 500; color: var(--text-dim);
  text-decoration: none; padding: .45rem .6rem; border-radius: var(--radius-sm); transition: color .2s;
}
.nav-link::after {
  content: ''; position: absolute; bottom: 3px; left: 50%; right: 50%; height: 2px;
  background: var(--accent); border-radius: 2px; transition: left .24s var(--ease), right .24s var(--ease);
}
.nav-link:hover        { color: var(--accent); text-decoration: none; }
.nav-link:hover::after { left: .6rem; right: .6rem; }
.nav-link.active       { color: var(--accent); font-weight: 600; }
.nav-link.active::after{ left: .6rem; right: .6rem; }

.theme-btn {
  display: flex; align-items: center; justify-content: center; width: 38px; height: 38px;
  border-radius: 50%; border: 1.5px solid var(--line); background: var(--bg-card);
  color: var(--text-dim); font-size: .88rem; cursor: pointer; flex-shrink: 0;
  transition: background .2s, border-color .2s, color .2s, transform .25s, box-shadow .2s;
}
.theme-btn:hover {
  background: var(--accent); border-color: var(--accent); color: var(--on-accent);
  transform: rotate(20deg) scale(1.08); box-shadow: 0 0 18px var(--accent-glow);
}

/* ================================================================
   MOBILE BOTTOM NAV
================================================================ */
.bottom-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  height: calc(var(--bot-h) + env(safe-area-inset-bottom, 0px));
  background: var(--bg-card); border-top: 1px solid var(--line); z-index: 400;
  align-items: center; justify-content: space-around;
  padding: 0 .5rem env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -4px 20px rgba(0,0,0,.07);
}
.bnav-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  text-decoration: none; color: var(--text-faint); font-size: .6rem; font-weight: 500;
  letter-spacing: .04em; text-transform: uppercase; padding: .4rem .65rem; border-radius: var(--radius-sm);
  transition: color .2s, background .2s;
}
.bnav-item i { font-size: 1.05rem; }
.bnav-item.active { color: var(--accent); }
.bnav-item:hover  { color: var(--accent-lt); background: var(--accent-glow); text-decoration: none; }

/* ================================================================
   PAGE CARD — single unified card: teal cover strip + white body,
   same width throughout so nothing looks stretched or mismatched
================================================================ */
.site-main { flex: 1; padding: 2.5rem 1.5rem 4rem; }

.page-wrap {
  max-width: 860px; margin: 0 auto;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden; /* clips hero's square corners to the card's rounded ones */
}

.page-body { padding: 3rem 4rem; }

/* ── Cover strip (top of the card, not a separate full-bleed band) ── */
.page-hero {
  background: var(--hero-bg);
  padding: 3rem 3rem 2.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-num {
  position: absolute;
  top: -0.3em;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 7rem;
  line-height: 1;
  color: var(--hero-num);
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}

.page-hero-inner { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; }

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: .55rem;
  font-size: .72rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--hero-text-dim); margin-bottom: .8rem;
}
.hero-eyebrow::before, .hero-eyebrow::after { content: ''; width: 20px; height: 1px; background: rgba(255,255,255,.35); }

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  font-weight: 700; color: var(--hero-text);
  line-height: 1.2; letter-spacing: -.02em; margin-bottom: .65rem;
}

.hero-tagline { font-size: .95rem; color: var(--hero-text-dim); max-width: 500px; margin: 0 auto; line-height: 1.6; text-align: center; }

/* ================================================================
   HEADINGS
================================================================ */
h1 {
  font-family: var(--font-display); font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 700;
  color: var(--text); text-align: center; line-height: 1.22; letter-spacing: -.02em;
  padding-bottom: 1.15rem; margin-bottom: 2rem; position: relative;
}
h1::after {
  content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 46px; height: 3px; background: var(--accent-grad); border-radius: 3px;
}

h2 {
  font-family: var(--font-display); font-size: clamp(1.18rem, 3vw, 1.5rem); font-weight: 700;
  color: var(--accent); line-height: 1.3; letter-spacing: -.015em; text-align: center;
  margin: 3rem 0 1.35rem; display: flex; align-items: center; gap: 1rem;
}
h2::before, h2::after { content: ''; flex: 1; height: 1px; background: var(--line); }
h2:first-child { margin-top: 0; }

h3 {
  font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; color: var(--text);
  line-height: 1.32; margin: 2rem 0 .6rem; padding-left: .85rem; border-left: 3px solid var(--accent);
}

h4 { font-size: .74rem; font-weight: 600; color: var(--text-faint); text-transform: uppercase; letter-spacing: .1em; margin: 1.75rem 0 .5rem; }

/* ================================================================
   BODY COPY
================================================================ */
p {
  color: var(--text-dim); font-size: 1rem; line-height: 1.78; margin-bottom: 1.15rem;
  text-align: justify; text-align-last: left;
  hyphens: auto; -webkit-hyphens: auto; -ms-hyphens: auto;
}
p:last-child { margin-bottom: 0; }
p strong, li strong { color: var(--text); font-weight: 600; }
a { color: var(--accent); text-decoration: none; transition: color .18s; }
a:hover { color: var(--accent-dk); text-decoration: underline; text-underline-offset: 3px; }
ul, ol { padding-left: 1.5rem; margin-bottom: 1.15rem; color: var(--text-dim); }
li { margin-bottom: .4rem; }
li:last-child { margin-bottom: 0; }
ul li::marker { color: var(--accent); }
ol li::marker { color: var(--accent); font-weight: 700; }
hr { border: none; height: 1px; background: var(--line); margin: 2.75rem 0; }

blockquote {
  border-left: 3px solid var(--accent); padding: 1rem 1.5rem; margin: 2rem 0;
  background: var(--accent-glow); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-dim); font-style: italic;
}

code {
  font-family: var(--font-mono); font-size: .84em; background: var(--bg-alt);
  color: var(--accent-dk); padding: .15em .45em; border-radius: 4px; border: 1px solid var(--line);
}
pre {
  background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 1.25rem 1.5rem; overflow-x: auto; margin: 1.5rem 0;
}
pre code { background: none; border: none; padding: 0; font-size: .875rem; }

/* Rouge / Jekyll syntax highlighting — theme-aware, replaces what the
   Cayman theme's rouge-github.scss used to provide before it was removed */
.highlight .c, .highlight .c1, .highlight .cm { color: var(--text-faint); font-style: italic; } /* comments */
.highlight .k, .highlight .kd, .highlight .kn, .highlight .kr { color: var(--accent); font-weight: 600; } /* keywords */
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb { color: #c9895a; } /* strings */
[data-theme="dark"] .highlight .s, [data-theme="dark"] .highlight .s1, [data-theme="dark"] .highlight .s2 { color: #e0a876; }
.highlight .n, .highlight .nb { color: var(--text); }        /* names */
.highlight .nf { color: var(--accent-dk); font-weight: 600; } /* function names */
.highlight .mi, .highlight .mf { color: var(--accent-lt); }   /* numbers */
.highlight .o { color: var(--text-dim); }                     /* operators */
.highlight .err { color: #d64545; }

/* ================================================================
   CONSULTING COMPONENTS
================================================================ */

/* Executive summary callout — top-of-page key takeaway */
.exec-summary {
  background: var(--accent-glow);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 1.5rem 1.75rem;
  margin: 0 0 2.25rem;
}
.exec-summary-label {
  font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: .5rem; display: block;
}
.exec-summary p { color: var(--text); font-size: 1.02rem; margin-bottom: 0; }

/* KPI / stat row */
.stat-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1.25rem; margin: 2rem 0;
}
.stat {
  text-align: center; padding: 1.5rem 1rem;
  background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.stat-num {
  display: block; font-family: var(--font-display); font-weight: 700;
  font-size: 2.1rem; color: var(--accent); line-height: 1;
}
.stat-label {
  display: block; font-size: .72rem; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-faint); margin-top: .5rem;
}

/* Framework / methodology cards — 3 col grid */
.framework-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem; margin: 2rem 0;
}
.framework-card {
  background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 1.5rem 1.5rem; transition: border-color .22s, box-shadow .22s, transform .22s;
}
.framework-card:hover { border-color: var(--accent-lt); box-shadow: var(--shadow); transform: translateY(-2px); }
.framework-num {
  font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; color: var(--accent);
  margin-bottom: .6rem; display: block;
}
.framework-title { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; color: var(--text); margin-bottom: .4rem; }
.framework-desc { font-size: .9rem; color: var(--text-dim); line-height: 1.6; }

/* Timeline — professional experience */
.timeline { position: relative; margin: 2rem 0; padding-left: 2rem; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline-item { position: relative; padding-bottom: 2rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: ''; position: absolute; left: -2rem; top: 4px; width: 14px; height: 14px;
  border-radius: 50%; background: var(--bg-card); border: 3px solid var(--accent);
}
.timeline-date { font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-bottom: .3rem; }
.timeline-title { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: var(--text); margin-bottom: .25rem; }
.timeline-org { font-size: .85rem; color: var(--text-faint); margin-bottom: .5rem; }
.timeline-desc { font-size: .93rem; color: var(--text-dim); line-height: 1.65; }

/* Project cards — GitHub apps / tools grid */
.project-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.25rem; margin: 2rem 0;
}
.project-card {
  background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 1.5rem; display: flex; flex-direction: column; gap: .75rem;
  transition: border-color .22s, box-shadow .22s, transform .22s;
}
.project-card:hover { border-color: var(--accent-lt); box-shadow: var(--shadow); transform: translateY(-3px); }
.project-card-head { display: flex; align-items: center; gap: .65rem; }
.project-icon {
  width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0;
  background: var(--accent-glow); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-size: 1rem;
}
.project-title { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; color: var(--text); }
.project-desc { font-size: .9rem; color: var(--text-dim); line-height: 1.6; flex: 1; margin-bottom: 0; }
.project-tags { display: flex; flex-wrap: wrap; gap: .3rem; }
.project-link {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .82rem; font-weight: 600; color: var(--accent); margin-top: .25rem;
}
.project-link:hover { color: var(--accent-dk); text-decoration: underline; text-underline-offset: 3px; }
.project-card.placeholder { opacity: .55; border-style: dashed; }
.project-card.placeholder:hover { transform: none; box-shadow: none; }

/* Pull quote */
.pull-quote {
  text-align: center; padding: 2rem 2.5rem; margin: 2.5rem 0;
  background: var(--bg-alt); border-radius: var(--radius-sm); border: 1px solid var(--line);
}
.pull-quote p {
  font-family: var(--font-display); font-style: italic; font-size: 1.25rem;
  color: var(--text); line-height: 1.5; margin-bottom: .75rem; text-align: center;
}
.pull-quote cite { font-size: .78rem; color: var(--text-faint); font-style: normal; letter-spacing: .03em; }

/* Section divider with label */
.section-divider {
  display: flex; align-items: center; gap: 1rem; margin: 3rem 0 2rem; text-align: center;
}
.section-divider::before, .section-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.section-divider span { font-size: .7rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--text-faint); white-space: nowrap; }

/* Cards (generic) */
.card { background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1.5rem 1.75rem; margin-bottom: 1.25rem; box-shadow: var(--shadow-sm); transition: border-color .22s, box-shadow .22s, transform .22s; }
.card:hover { border-color: var(--accent-lt); box-shadow: var(--shadow); transform: translateY(-2px); }
.card-title { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; color: var(--text); margin-bottom: .35rem; }
.card-meta { font-size: .78rem; color: var(--text-faint); margin-bottom: .75rem; }

/* Badges */
.badge { display: inline-block; font-size: .72rem; font-weight: 500; padding: .2rem .65rem; border-radius: 999px; background: var(--accent-glow); color: var(--accent); border: 1px solid var(--line); margin: .15rem; text-align: left; }

/* Tag row — justifies a wrapped list of badges so blank space is
   distributed evenly between them (including the last line), rather
   than left-hugging with all the slack on the right */
/* Tag row - plain left-aligned wrap, no justify (text-align-last isn't
   supported in Safari at all, and stretched gaps on sparse tag rows
   looked wrong regardless of browser) */
.tag-row { text-align: left; margin-top: .75rem; }

/* Icon chip — badge with a small image, for languages/interests */
.icon-chip {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .3rem .8rem .3rem .3rem; border-radius: 999px;
  background: var(--accent-glow); border: 1px solid var(--line);
  margin: .2rem; font-size: .8rem; font-weight: 500; color: var(--text);
}
.icon-chip img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; display: inline-block; }

/* Core expertise - larger icon over label, 3-across, restoring the
   original site's icon treatment within the new design system */
.expertise-grid {
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: 2rem; margin: 2rem 0; text-align: center;
}
.expertise-item { flex: 1; min-width: 130px; max-width: 160px; }
.expertise-icon {
  width: 52px; height: 52px; margin: 0 auto .75rem; display: block;
  object-fit: contain;
}
.expertise-label {
  font-weight: 600; color: var(--text); font-size: .92rem; text-align: center;
}

/* Profile photo — single headshot, circular */
.profile-photo {
  display: block; width: 148px; height: 148px; border-radius: 50%;
  object-fit: cover; margin: 0 auto 2rem;
  border: 4px solid var(--bg-card); box-shadow: var(--shadow-lg);
  outline: 1px solid var(--line);
}

/* Profile collage — multi-photo image, rounded rectangle (not cropped to a circle) */
.profile-collage {
  display: block; width: 100%; max-width: 480px;
  margin: 0 auto 2.25rem; border-radius: var(--radius);
  box-shadow: var(--shadow-lg); border: 1px solid var(--line);
}

/* Status / warning callout */
.callout {
  padding: 1rem 1.5rem; margin: 2rem 0;
  background: var(--accent-glow); border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-dim); font-size: .95rem;
}
.callout strong { color: var(--text); }

/* CTA buttons */
.btn-row { display: flex; gap: .75rem; flex-wrap: wrap; justify-content: center; margin: 2rem 0; }
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .7rem 1.4rem; border-radius: var(--radius-sm);
  font-weight: 600; font-size: .9rem; text-decoration: none;
  background: var(--accent); color: var(--on-accent); border: 2px solid var(--accent);
  transition: background .2s, transform .2s, box-shadow .2s, color .2s;
}
.btn:hover { background: var(--accent-dk); border-color: var(--accent-dk); transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; color: var(--on-accent); }
.btn-outline { background: transparent; color: var(--accent); }
.btn-outline:hover { background: var(--accent); color: var(--on-accent); }

/* Contact tiles */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin: 2rem 0; }
.contact-tile {
  display: flex; align-items: center; gap: .85rem; padding: 1.25rem;
  background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius-sm);
  text-decoration: none; transition: transform .2s, box-shadow .2s, border-color .2s;
}
.contact-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--accent-lt); text-decoration: none; }
.contact-icon { width: 42px; height: 42px; border-radius: 10px; background: var(--accent-glow); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 1.15rem; flex-shrink: 0; }
.contact-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint); margin-bottom: .15rem; }
.contact-value { font-weight: 600; color: var(--text); font-size: .95rem; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 2rem 0; border-radius: var(--radius-sm); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
table { width: 100%; border-collapse: collapse; }
th { background: var(--accent); color: var(--on-accent); font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; padding: .8rem 1.1rem; text-align: left; white-space: nowrap; }
td { padding: .7rem 1.1rem; border-bottom: 1px solid var(--line); color: var(--text-dim); font-size: .93rem; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--accent-glow); }

/* ================================================================
   AUTOMATIC DARK-MODE CONTENT GUARD
   Old markdown/HTML content on pages we haven't rewritten yet often
   carries inline style="background:#fff" / "color:#000" left over
   from before the redesign. This neutralizes that automatically, on
   every page, with no per-page edits required.

   Named components (.card, .stat, .badge, etc.) are explicitly
   excluded by class so they keep using their own var()-based colors
   untouched — no specificity fight, because excluded elements are
   simply never matched by this rule at all.
================================================================ */
[data-theme="dark"] .page-body :where(div, span, p, li, td, tr, table, section, article):not(.card):not(.card-title):not(.card-meta):not(.exec-summary):not(.exec-summary-label):not(.framework-card):not(.framework-num):not(.framework-title):not(.framework-desc):not(.stat):not(.stat-num):not(.stat-label):not(.timeline-item):not(.timeline-date):not(.timeline-title):not(.timeline-org):not(.timeline-desc):not(.pull-quote):not(.project-card):not(.project-card-head):not(.project-icon):not(.project-title):not(.project-desc):not(.project-tags):not(.project-link):not(.badge):not(.section-divider):not(.contact-tile):not(.contact-icon):not(.contact-label):not(.contact-value):not(.btn-row):not(.callout):not(.icon-chip):not(.expertise-item):not(.expertise-label) {
  background-color: transparent !important;
  color: var(--text-dim) !important;
  border-color: var(--line) !important;
}
[data-theme="dark"] .page-body :where(h1, h2, h3, h4, h5, h6, strong, b) {
  color: var(--text) !important;
}
[data-theme="dark"] .page-body a:not(.btn):not(.project-link) { color: var(--accent) !important; }

/* Stubborn one-off blocks (e.g. a big pasted HTML chunk with many
   inline styles) can opt into the same treatment by wrapping in
   <div class="legacy-content">...</div> if the automatic guard above
   ever misses something odd inside it. */
[data-theme="dark"] .legacy-content,
[data-theme="dark"] .legacy-content * {
  color: var(--text-dim) !important;
  background-color: transparent !important;
  border-color: var(--line) !important;
}
[data-theme="dark"] .legacy-content h1,
[data-theme="dark"] .legacy-content h2,
[data-theme="dark"] .legacy-content h3,
[data-theme="dark"] .legacy-content h4,
[data-theme="dark"] .legacy-content strong,
[data-theme="dark"] .legacy-content b {
  color: var(--text) !important;
}
[data-theme="dark"] .legacy-content a { color: var(--accent) !important; }

/* ================================================================
   SCROLL REVEAL
================================================================ */
.reveal { opacity: 0; transform: translateY(16px); }
.reveal.in { opacity: 1; transform: translateY(0); transition: opacity .55s var(--ease), transform .55s var(--ease); }

/* ================================================================
   FOOTER
================================================================ */
.site-footer { background: var(--bg-alt); border-top: 1px solid var(--line); padding: 1.75rem 2rem 1.25rem; }
.footer-inner { max-width: 860px; margin: 0 auto; }
.footer-top {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem 2rem; margin-bottom: .9rem;
}
/* Shared CC badge + license text — mirrors the isotherm app footer */
.foot-lic { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 260px; }
.cc-badge { display: inline-flex; gap: 4px; text-decoration: none; flex-shrink: 0; }
.cc-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  border: 1.5px solid var(--text-dim); color: var(--text);
  font-size: 11px; font-weight: 700; font-family: var(--font-mono, monospace);
}
.foot-lic-txt { font-size: .72rem; color: var(--text-dim); line-height: 1.55; }
.foot-lic-txt strong { color: var(--text); }
.foot-lic-txt a { color: var(--accent); text-decoration: none; }
.foot-lic-txt a:hover { text-decoration: underline; }
/* Social icons */
.footer-social { display: flex; gap: .6rem; flex-shrink: 0; }
.social-link {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--bg-card);
  color: var(--text-faint); font-size: .9rem; text-decoration: none;
  transition: background .2s, border-color .2s, color .2s, transform .2s, box-shadow .2s;
}
.social-link:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); transform: translateY(-3px) scale(1.1); box-shadow: 0 6px 18px var(--accent-glow); text-decoration: none; }
/* Credit line */
.footer-copy { font-size: .72rem; color: var(--text-faint); margin: 0; text-align: center; }
.footer-copy a { color: var(--text-dim); }
.footer-copy a:hover { color: var(--accent); text-decoration: none; }

/* ================================================================
   RESPONSIVE
================================================================ */
@media (max-width: 960px) { .page-body { padding: 2.5rem 2.5rem; } }

@media (max-width: 880px) {
  :root { --top-h: 58px; }
  .top-nav    { display: none; }
  .bottom-nav { display: flex; }
  .site-main  { padding: 1.25rem .85rem calc(var(--bot-h) + env(safe-area-inset-bottom, 0px) + 1.5rem); }
  .page-wrap  { border-radius: var(--radius-sm); }
  .page-body  { padding: 1.75rem 1.5rem; }
  .page-hero  { padding: 2.25rem 1.25rem 1.75rem; }
  .hero-title { font-size: 1.55rem; }
  .hero-num   { font-size: 4.2rem; }
  .brand-role { display: none; }
  h1 { font-size: 1.7rem; }
  h2 { font-size: 1.15rem; margin: 2.25rem 0 1.1rem; }
  h3 { font-size: 1.02rem; }
  .framework-grid, .stat-row, .project-grid { grid-template-columns: 1fr 1fr; }
  .site-footer { padding-bottom: calc(var(--bot-h) + env(safe-area-inset-bottom, 0px) + 1rem); }
}

@media (max-width: 480px) {
  .brand-name { font-size: .88rem; }
  .page-body  { padding: 1.4rem 1rem; }
  h1          { font-size: 1.5rem; }
  .hero-title { font-size: 1.35rem; }
  .framework-grid, .stat-row, .project-grid { grid-template-columns: 1fr; }
}

/* ================================================================
   REDUCED MOTION
================================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  html { scroll-behavior: auto; transition: none; }
  .reveal, .reveal.in { opacity: 1 !important; transform: none !important; transition: none !important; }
}
