/* jameshaviland.com — tokens */
:root {
  --bg: #F7F6F2;
  --surface: #FFFFFF;
  --surface-2: #F0EFE8;
  --ink: #1C2230;
  --ink-muted: #565F6E;
  --ink-faint: #85909E;
  --line: #E1DED4;
  --line-strong: #CBC7B8;
  --accent: #33396B;
  --accent-ink: #FFFFFF;
  --accent-soft: #E7E8F1;
  --shadow: 0 1px 2px rgba(28, 34, 48, 0.05), 0 10px 28px -14px rgba(28, 34, 48, 0.22);
  --capture-error: #b3261e;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14161C;
    --surface: #1B1E27;
    --surface-2: #21242E;
    --ink: #EDECE6;
    --ink-muted: #A7ADB8;
    --ink-faint: #767C88;
    --line: #2B2F3A;
    --line-strong: #3A3F4C;
    --accent: #8489C7;
    --accent-ink: #14161C;
    --accent-soft: #262A45;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 10px 28px -14px rgba(0, 0, 0, 0.6);
  --capture-error: #ff8a80;
  }
}
:root[data-theme="dark"] {
  --bg: #14161C;
  --surface: #1B1E27;
  --surface-2: #21242E;
  --ink: #EDECE6;
  --ink-muted: #A7ADB8;
  --ink-faint: #767C88;
  --line: #2B2F3A;
  --line-strong: #3A3F4C;
  --accent: #8489C7;
  --accent-ink: #14161C;
  --accent-soft: #262A45;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 10px 28px -14px rgba(0, 0, 0, 0.6);
  --capture-error: #ff8a80;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.serif {
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman", serif;
}
.mono {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

a { color: var(--accent); }
img { max-width: 100%; display: block; }

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Nav ---- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
  gap: 16px;
}
.site-nav .wordmark {
  font-family: Georgia, "Iowan Old Style", Palatino, serif;
  font-weight: 700;
  font-size: 17px;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.site-nav .links {
  display: flex;
  gap: 22px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav .links a {
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 14px;
}
.site-nav .links a:hover { color: var(--ink); }
@media (max-width: 680px) {
  .site-nav .links { display: none; }
}
.site-nav .book {
  flex-shrink: 0;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover { opacity: 0.9; }
.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-secondary:hover { border-color: var(--ink-muted); }

/* ---- Hero ---- */
.hero {
  padding: 72px 0 56px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 48px;
  align-items: center;
}
@media (max-width: 700px) {
  .hero-grid { grid-template-columns: 1fr; }
}
.eyebrow {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 14px;
}
.hero h1 {
  font-family: Georgia, "Iowan Old Style", Palatino, serif;
  font-size: clamp(30px, 4.4vw, 44px);
  line-height: 1.15;
  margin: 0 0 16px;
  text-wrap: balance;
  letter-spacing: -0.01em;
}
.hero .dek {
  font-size: 17px;
  color: var(--ink-muted);
  max-width: 52ch;
  margin: 0 0 28px;
}
.hero .cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.hero-photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  object-fit: cover;
  box-shadow: var(--shadow);
}

/* ---- Sections ---- */
section { padding: 56px 0; border-top: 1px solid var(--line); }
section:first-of-type { border-top: none; }
.section-label {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 8px;
}
h2 {
  font-family: Georgia, "Iowan Old Style", Palatino, serif;
  font-size: 27px;
  margin: 0 0 20px;
  text-wrap: balance;
  letter-spacing: -0.005em;
}
p { max-width: 68ch; }
.lede { font-size: 16px; color: var(--ink-muted); max-width: 62ch; }

/* ---- Career timeline ---- */
.timeline { border-top: 1px solid var(--line); }
.timeline-row {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
@media (max-width: 640px) {
  .timeline-row { grid-template-columns: 1fr; gap: 4px; }
}
.timeline-row .when {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12.5px;
  color: var(--ink-faint);
  padding-top: 2px;
}
.timeline-row .what h3 { margin: 0 0 3px; font-size: 15.5px; }
.timeline-row .what .co { color: var(--ink-muted); font-size: 13px; margin-bottom: 6px; }
.timeline-row .what p { margin: 0; font-size: 13.5px; color: var(--ink-muted); max-width: 62ch; }

/* ---- Education / certifications two-column ---- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
@media (max-width: 700px) {
  .two-col { grid-template-columns: 1fr; gap: 36px; }
}
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li {
  font-size: 14px;
  color: var(--ink-muted);
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.plain-list li:last-child { border-bottom: 1px solid var(--line); }
.plain-list strong { color: var(--ink); font-weight: 600; }

/* ---- Publications ---- */
.pub-list { list-style: none; margin: 0; padding: 0; }
.pub-list li {
  padding: 14px 0;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
}
.pub-list li:last-child { border-bottom: 1px solid var(--line); }
.pub-list a, .pub-plain {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
}
.pub-list a { text-decoration: none; }
.pub-list a:hover { color: var(--accent); }
.pub-meta {
  display: block;
  width: 100%;
  font-size: 13px;
  color: var(--ink-faint);
}
.pub-tag {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 10.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: 4px;
  order: -1;
}

/* ---- Placeholder callout ---- */
.callout-todo {
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 14px 18px;
  font-size: 13.5px;
  color: var(--ink-muted);
  background: var(--surface-2);
}
.callout-todo strong { color: var(--ink); }

/* ---- Ways cards ---- */
.ways-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
@media (max-width: 700px) {
  .ways-grid { grid-template-columns: 1fr; }
}
.way-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.way-card .role {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}
.way-card h3 { margin: 0; font-size: 17px; }
.way-card p { margin: 0; font-size: 14px; color: var(--ink-muted); }
.way-card .link { font-size: 13.5px; font-weight: 600; margin-top: auto; }

/* ---- Credibility strip ---- */
.credibility {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
@media (max-width: 700px) {
  .credibility { grid-template-columns: repeat(2, 1fr); }
}
.cred-item .num {
  font-family: Georgia, serif;
  font-size: 26px;
  color: var(--ink);
  line-height: 1.1;
}
.cred-item .label {
  font-size: 13px;
  color: var(--ink-muted);
  margin-top: 4px;
}

/* ---- Video testimonials ---- */
.video-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 32px;
}
@media (max-width: 700px) {
  .video-grid { grid-template-columns: 1fr; }
}
.video-embed {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: #000;
  border: 1px solid var(--line);
}
.video-embed img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.82;
}
.video-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.video-embed .play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.video-embed .video-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 8px 12px;
  font-size: 13px;
  color: #fff;
  background: linear-gradient(to top, rgba(0,0,0,0.75), rgba(0,0,0,0));
}

/* ---- Quote / recommendations ---- */
.quote-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 700px) {
  .quote-grid { grid-template-columns: 1fr; }
}
.quote {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 18px 20px;
}
.quote p {
  margin: 0 0 10px;
  font-size: 14.5px;
  max-width: none;
}
.quote cite {
  font-style: normal;
  font-size: 13px;
  color: var(--ink-muted);
}

/* ---- Channels ---- */
.channels-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.channel-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  border-radius: 20px;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  background: var(--surface);
}
.channel-chip:hover { border-color: var(--accent); color: var(--accent); }

/* ---- Footer CTA ---- */
.footer-cta {
  background: var(--surface-2);
  border-radius: 14px;
  padding: 40px;
  text-align: center;
}
.footer-cta h2 { margin-bottom: 10px; }
.footer-cta p { margin: 0 auto 22px; }

footer.site-footer {
  padding: 32px 0 60px;
  color: var(--ink-faint);
  font-size: 13px;
}
footer.site-footer a { color: var(--ink-faint); }
