/* Joel W. Berge: personal site.
   Type: DM Sans, weights 300 and 400 only. Nothing is bold; emphasis is a grey highlighter (<mark>).
   Colours: white, near-black ink, light grey highlighter (same grey as the portrait circle).
   Each section fills at least one screen so it reads as its own page. */

:root {
  --bg: #ffffff;
  --ink: #15171c;
  --muted: #5b626f;
  --rule: #e3e6eb;
  --rule-strong: #b9bfca;
  --hl: #dddee1;
  --hl-soft: #f1f2f3;
  --font: "DM Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --wrap: 1140px;
  --gutter: clamp(16px, 4vw, 40px);
  --section: clamp(112px, 14vw, 184px);
  --topbar: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--topbar); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 300;
  font-size: 18px;
  line-height: 1.6;
  font-optical-sizing: auto;
}
img, svg { max-width: 100%; display: block; }
b, strong, h1, h2, h3, h4, th, dt { font-weight: 400; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-color: var(--muted); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }

/* The highlighter */
mark, strong {
  color: var(--ink);
  background: linear-gradient(100deg, transparent 0.12em, var(--hl) 0.12em, var(--hl) calc(100% - 0.12em), transparent calc(100% - 0.12em));
  background-size: 100% 78%;
  background-position: 0 70%;
  background-repeat: no-repeat;
  padding: 0 0.22em;
  margin: 0 -0.08em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

.eyebrow, .label, .list-title, .meta, .audiences-label {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
}
.eyebrow { margin: 0 0 18px; }

h1, h2, h3 { margin: 0; text-wrap: balance; }
h2 {
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin-bottom: 24px;
  max-width: 20ch;
}
h3 { font-size: 26px; line-height: 1.2; letter-spacing: -0.01em; }
.section-lede { font-size: 20px; max-width: 58ch; color: var(--ink); }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 5;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.topbar-inner { display: flex; align-items: center; gap: 24px; min-height: 60px; }
.brand { text-decoration: none; font-weight: 400; font-size: 17px; white-space: nowrap; }
.nav { display: flex; gap: 22px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { text-decoration: none; font-size: 15px; color: var(--muted); white-space: nowrap; padding-block: 6px; }
.nav a:hover { color: var(--ink); }
.lang {
  display: inline-flex; align-items: center; gap: 4px;
  text-decoration: none; font-size: 14px; letter-spacing: 0.06em;
  border: 1px solid var(--rule-strong); border-radius: 999px; padding: 5px 12px;
  color: var(--muted); white-space: nowrap;
}
.lang > span { padding: 0 4px; border-radius: 3px; }
.lang-on { color: var(--ink); background: var(--hl); }
.lang:hover { border-color: var(--ink); color: var(--ink); }

@media (max-width: 860px) {
  .topbar-inner { flex-wrap: wrap; row-gap: 0; padding-block: 8px 0; }
  .lang { margin-left: auto; }
  :root { --topbar: 96px; }
  .nav { order: 3; width: 100%; margin-left: 0; gap: 18px; padding-bottom: 6px; }
}

/* ---------- Hero ---------- */
.hero { padding-block: clamp(48px, 8vw, 104px); min-height: calc(100vh - 61px); display: flex; align-items: center; }
.hero > .wrap { width: 100%; }
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(32px, 6vw, 88px); align-items: center; }
h1 {
  font-size: clamp(52px, 8.4vw, 104px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-weight: 300;
}
.role { font-size: clamp(20px, 2.4vw, 27px); margin: 22px 0 30px; line-height: 1.4; }
.lede { font-size: 19px; max-width: 54ch; }
.lede-2 { color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-photo img { width: 100%; max-width: 460px; height: auto; margin-inline: auto; }
@media (max-width: 780px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-photo { order: -1; }
  .hero-photo img { max-width: 280px; margin-inline: 0; }
}

/* ---------- Buttons and links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 10px 22px;
  border: 1px solid var(--ink); border-radius: 999px;
  text-decoration: none; font-size: 16px; font-weight: 400; line-height: 1.2;
  background: transparent; color: var(--ink);
  transition: background-color .15s, color .15s;
}
.btn:hover { background: var(--hl-soft); }
.btn-solid { background: var(--ink); color: var(--bg); }
.btn .icon { flex: none; }
.btn .icon + span { margin-left: 10px; }
.btn-icon { width: 46px; padding: 0; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.footer-li { display: inline-flex; align-items: center; gap: 6px; }
.footer-li .icon { width: 15px; height: 15px; }
.btn-solid:hover { background: var(--hl); color: var(--ink); border-color: var(--hl); }
.link-arrow { text-decoration: none; font-weight: 400; border-bottom: 1px solid var(--ink); padding-bottom: 2px; }
.link-arrow:hover { background: var(--hl-soft); }
.link-arrow span { display: inline-block; transition: transform .15s; }
.link-arrow:hover span { transform: translateX(3px); }

/* ---------- Sections ---------- */
.section { padding-block: var(--section); min-height: 100vh; border-top: 1px solid var(--rule); }
/* Menu links land on the section heading, not in the empty space above it. */
.section { scroll-margin-top: calc(28px - var(--section)); }
.section .wrap > .eyebrow { padding-bottom: 14px; border-bottom: 1px solid var(--ink); margin-bottom: clamp(32px, 5vw, 56px); }

/* Talks */
.talks-head { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: end; margin-bottom: clamp(56px, 8vw, 96px); }
.talks-photo { margin: 0; }
.talks-photo img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 2px; }
.talks-photo figcaption, .gallery figcaption { font-size: 13px; letter-spacing: 0.04em; color: var(--muted); margin-top: 10px; font-weight: 400; }
.list-title.gallery-title { margin-top: clamp(64px, 9vw, 104px); }
.gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-top: 24px; }
.gallery figure { margin: 0; }
.gallery figcaption a { text-decoration: underline; text-decoration-color: var(--rule-strong); }
.gallery img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 2px; }
@media (max-width: 900px) { .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.audiences-label { margin: 32px 0 10px; }
.audiences { display: flex; flex-wrap: wrap; gap: 8px; }
.audiences li { border: 1px solid var(--rule-strong); border-radius: 999px; padding: 4px 14px; font-size: 15px; }
@media (max-width: 860px) { .talks-head { grid-template-columns: 1fr; } }

.talk-list { border-top: 1px solid var(--ink); }
.talk {
  display: grid; grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 16px clamp(24px, 4vw, 48px); align-items: start;
  padding-block: 32px; border-bottom: 1px solid var(--rule);
}
.talk-icon { width: 96px; --hl: #b8bbc2; --rule-strong: #d3d6dc; }
.talk-icon text { display: none; }
.talk h3 { font-size: clamp(26px, 3vw, 34px); letter-spacing: -0.02em; font-weight: 300; }
.talk-q { font-size: 19px; margin: 6px 0 8px; }
.talk-sum { color: var(--muted); font-size: 17px; max-width: 62ch; margin: 0; }
.talk-ask { white-space: nowrap; font-size: 16px; margin-top: 12px; }
.talk-basis { margin-top: 14px; }
.talk-basis summary { cursor: pointer; font-size: 15px; color: var(--ink); list-style: none; display: inline-flex; align-items: center; gap: 8px; }
.talk-basis summary::-webkit-details-marker { display: none; }
.talk-basis summary::after { content: "+"; font-size: 18px; line-height: 1; color: var(--muted); }
.talk-basis[open] summary::after { content: "–"; }
.talk-basis summary:hover { text-decoration: underline; text-decoration-color: var(--muted); }
.basis-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 40px; margin-top: 16px; padding: 20px 24px; background: var(--hl-soft); border-radius: 3px; }
.basis-groups .label { margin: 0 0 6px; }
.basis-groups li { font-size: 15px; line-height: 1.4; padding-block: 7px; border-bottom: 1px solid var(--rule); }
.basis-groups li:last-child { border-bottom: 0; }
.basis-groups a { text-decoration: none; font-weight: 400; }
.basis-groups a:hover { text-decoration: underline; }
.basis-groups .meta { display: block; font-size: 11px; margin-top: 2px; }
@media (max-width: 720px) { .basis-groups { grid-template-columns: 1fr; padding: 16px; } }
@media (max-width: 720px) {
  .talk { grid-template-columns: 64px minmax(0, 1fr); align-items: start; }
  .talk-icon { width: 64px; }
  .talk-ask { grid-column: 2; justify-self: start; }
}

/* Illustrations (inline SVG) */
.viz text { font-family: var(--font); fill: var(--ink); }
.viz-q text, .viz-q { font-size: 15px; font-weight: 400; }
.viz-num { fill: var(--muted); font-size: 13px; letter-spacing: 0.06em; }
.viz-axis text { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; fill: var(--muted); }
.viz-compass .viz-q text { font-size: 14px; }
.viz-ends text { font-size: 15px; font-weight: 400; fill: var(--ink); }
.viz-word text { font-size: 26px; font-weight: 300; }
.viz-amp { font-size: 40px; font-weight: 300; fill: var(--muted); }

/* Research */
.featured { display: grid; gap: 28px; margin: 48px 0 clamp(56px, 8vw, 88px); }
.feature {
  display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(24px, 4vw, 56px);
  background: var(--bg); border: 1px solid var(--rule); padding: clamp(24px, 4vw, 44px); border-radius: 4px; align-items: center;
}
.feature-img { max-width: 300px; width: 100%; }
.feature-img img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 2px; }
.feature h3 { margin: 8px 0 8px; }
.press { font-size: 16px; margin: 0 0 20px; }
.press .label { margin-right: 8px; }
.feature .authors { color: var(--muted); font-size: 16px; }
.feature .meta mark { color: var(--ink); text-transform: uppercase; }
@media (max-width: 720px) { .feature { grid-template-columns: 1fr; } .feature-img { max-width: 220px; } }

.pubs { display: grid; gap: 48px; margin-bottom: 40px; }
.list-title { margin: 0 0 8px; padding-bottom: 12px; border-bottom: 1px solid var(--ink); }
.pub-list li {
  display: grid; grid-template-columns: 7.5em 1fr; gap: 20px;
  padding-block: 16px; border-bottom: 1px solid var(--rule);
}
.pub-list li:target { background: var(--hl-soft); box-shadow: -12px 0 0 var(--hl-soft), 12px 0 0 var(--hl-soft); }
.pub-list .year { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 16px; padding-top: 2px; }
.pub-text a, .pub-title { font-weight: 400; text-decoration: none; }
.pub-text a:hover { text-decoration: underline; text-decoration-color: var(--ink); text-decoration-thickness: 1px; }
.pub-text .authors { display: block; color: var(--muted); font-size: 16px; margin-top: 2px; }
@media (max-width: 560px) { .pub-list li { grid-template-columns: 1fr; gap: 2px; } }

/* Media */
.media-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 72px); margin-top: 40px; }
@media (max-width: 780px) { .media-grid { grid-template-columns: 1fr; } }
.media-list li { padding-block: 14px; border-bottom: 1px solid var(--rule); }
.media-list a { font-weight: 400; text-decoration: none; display: block; }
.media-list a:hover { text-decoration: underline; text-decoration-color: var(--ink); text-decoration-thickness: 1px; }
.media-list .meta { display: block; margin-top: 3px; font-size: 12px; }

/* Podcast */
.pod-photo { margin: 0 0 clamp(40px, 6vw, 72px); }
.pod-photo img { width: 100%; height: auto; aspect-ratio: 21 / 9; object-fit: cover; object-position: 50% 30%; border-radius: 2px; }
.pod-photo figcaption { font-size: 13px; letter-spacing: 0.04em; color: var(--muted); margin-top: 10px; font-weight: 400; }
@media (max-width: 720px) { .pod-photo img { aspect-ratio: 4 / 3; } }
.pod-cover { width: 100%; max-width: 280px; height: auto; margin-bottom: 32px; border-radius: 4px; }
.episodes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 48px; }
.episodes a { display: block; text-decoration: none; font-size: 15px; line-height: 1.35; }
.episodes img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 3px; margin-bottom: 8px; }
.episodes a:hover span { text-decoration: underline; text-decoration-color: var(--ink); }
.pod-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.pod-name { font-size: clamp(56px, 9vw, 112px); line-height: 1; letter-spacing: -0.04em; font-weight: 300; margin-bottom: 10px; }
.pod-sub { font-size: 22px; margin-bottom: 24px; }
.pod-links { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 28px; }
.pod-links .label { width: 100%; }
@media (max-width: 860px) { .pod-grid { grid-template-columns: 1fr; } }

/* CV */
.cv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px clamp(32px, 6vw, 72px); margin: 40px 0; }
@media (max-width: 780px) { .cv-grid { grid-template-columns: 1fr; } }
.cv-list { margin: 0; }
.cv-list div { display: grid; grid-template-columns: 6.5em 1fr; gap: 16px; padding-block: 12px; border-bottom: 1px solid var(--rule); }
.cv-list dt { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 16px; padding-top: 1px; }
.cv-list dd { margin: 0; }
.cv-where { display: block; }
.cv-what { display: block; color: var(--muted); font-size: 16px; margin-top: 2px; }

/* Contact */
.contact h2 { max-width: 18ch; }
.email-line { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin: 32px 0 28px; }
.email { font-size: clamp(22px, 3.4vw, 36px); letter-spacing: -0.01em; user-select: all; overflow-wrap: anywhere; }
.copy {
  font: inherit; font-size: 14px; font-weight: 400; cursor: pointer;
  background: none; border: 1px solid var(--rule-strong); border-radius: 999px; padding: 6px 14px; color: var(--ink);
}
.copy:hover { border-color: var(--ink); }
.copy.done { background: var(--hl); border-color: var(--hl); }

/* Footer */
.footer { border-top: 1px solid var(--rule); padding-block: 36px 48px; font-size: 15px; color: var(--muted); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; }
.footer p { margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 20px; }

@media (max-width: 480px) { body { font-size: 17px; } .section-lede { font-size: 18px; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .link-arrow span { transition: none; }
}
