/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Tokens ── */
:root {
  --bg: #f8f7f4;
  --text: #111;
  --text-body: #333;
  --text-muted: #666;
  --text-light: #999;
  --text-xlight: #bbb;
  --border: #d8d8d8;
  --border-strong: #aaa;
  --nav-bg: #111;
  --font: 'Inter', Arial, sans-serif;
  --color-hover: #000;
}

/* ── Base ── */
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
a:hover { color: var(--color-hover); }

/* ── Skip link ── */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 9999;
  padding: 8px 16px;
  background: var(--nav-bg);
  color: #fff;
  font-size: 14px;
  text-decoration: none;
}
.skip-link:focus { left: 0; }

/* ── Nav ── */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  background: var(--nav-bg);
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-name {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  text-decoration: none;
}
.nav-name:hover { color: #fff; }
.nav-links { display: flex; gap: 24px; }
.nav-link {
  font-size: 14px;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
}
.nav-link:hover { color: #fff; }
.nav-link.active {
  color: #fff;
  border-bottom: 1px solid #fff;
  padding-bottom: 1px;
}
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.7);
  padding: 4px;
  flex-shrink: 0;
}
.nav-hamburger:hover { color: #fff; }
.nav-hamburger svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* ── Footer ── */
.footer {
  padding: 20px 32px;
  background: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 80px;
}
.footer-text { font-size: 14px; color: rgba(255,255,255,0.4); }
.footer-links { display: flex; gap: 18px; align-items: center; }
.footer-link { display: flex; align-items: center; color: rgba(255,255,255,0.4); text-decoration: none; opacity: 0.8; transition: opacity 0.2s; }
.footer-link:hover { color: rgba(255,255,255,0.4); opacity: 1; }
.footer-link svg { width: 22px; height: 22px; fill: currentColor; stroke: none; }
.footer-link:nth-child(3) svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Contact page: fixed footer */
body.page-contact .footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  margin-top: 0;
}

/* ── Back to top ── */
.back-to-top {
  position: fixed;
  bottom: 100px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 3px;
  background: #555;
  border: none;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0.3;
  transition: opacity 0.5s ease-out;
  padding: 0;
}
.back-to-top:hover { opacity: 1; }
.back-to-top.visible { display: flex; }
.back-to-top svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

/* ── Intro / summary ── */
.intro { padding: 40px 32px 36px; }
.intro p, .intro h1 { font-size: 24px; font-weight: 400; line-height: 1.75; color: var(--text); }

/* ── Homepage: companies section ── */
.cos { padding: 0 32px 52px; }
.cos-rule {
  border-top: 0.5px solid #c8c8c8;
  padding-top: 20px;
  margin-bottom: 16px;
}
.cos-label {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #777;
  margin-bottom: 16px;
}
.cos-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.cos-item {
  border: 0.5px solid #ddd;
  border-radius: 3px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}
.cos-item:hover { border-color: var(--border-strong); }
.cos-logo {
  width: 100%;
  aspect-ratio: 16/9;
  background: #ebebeb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-xlight);
  overflow: hidden;
  flex-shrink: 0;
}
.cos-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cos-item-text {
  padding: 12px 12px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
}
.cos-name { font-size: 16px; font-weight: 500; color: var(--text); text-align: center; width: 100%; }
.cos-desc { font-size: 14px; color: var(--border-strong); text-align: center; line-height: 1.4; flex-grow: 1; width: 100%; overflow-wrap: break-word; }
.cos-role { font-size: 10px; color: #888; text-align: center; line-height: 1.4; margin-top: 4px; flex-shrink: 0; width: 100%; }
.cos-year { font-size: 10px; color: var(--text-xlight); text-align: center; letter-spacing: 0.03em; margin-top: 2px; flex-shrink: 0; width: 100%; }

/* ── Homepage: project sections ── */
.section { padding: 0 32px; margin-bottom: 56px; }

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px 20px;
}

.text-slot {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 10px;
  border-top: 0.5px solid #c8c8c8;
  padding-top: 20px;
}
.text-slot-label {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #777;
  line-height: 1.6;
}
.text-slot-body { font-size: 14px; line-height: 1.7; color: var(--text-muted); }

/* Project cards */
.pc { display: block; text-decoration: none; color: inherit; }
.pc-top { border-top: 0.5px solid #e4e4e4; padding-top: 20px; }
.pc-text { margin-top: 0; }
.pc.featured {
  grid-column: span 2;
  border-top: 0.5px solid #c8c8c8;
  padding-top: 20px;
}
.pc.featured .pt { font-size: 16px; }
.pc.featured .pd { font-size: 14px; }

.pi {
  width: 100%;
  border-radius: 2px;
  margin-bottom: 10px;
  overflow: hidden;
  background: #1a1a2e;
}
.pi img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pi.r169 { aspect-ratio: 16/9; }
.pi.r43  { aspect-ratio: 4/3; }

.pt { font-size: 16px; font-weight: 500; color: var(--text); margin-bottom: 3px; line-height: 1.35; }
.pd { font-size: 14px; color: var(--text-muted); line-height: 1.5; }
.py { font-size: 10px; color: var(--text-xlight); margin-top: 4px; letter-spacing: 0.03em; }
@media (hover: hover) and (pointer: fine) {
  .pc:hover .pt { color: #000; }
}

/* ── Project page ── */
.hero {
  width: 100%;
  height: 90vh;
  min-height: 500px;
  background: #1a1a2e;
  position: relative;
  overflow: hidden;
}
.hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 48px 32px 40px;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0) 100%);
}
.hero-category {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  margin-bottom: 10px;
}
.hero-title {
  font-size: 48px;
  font-weight: 500;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.hero-year { font-size: 12px; color: rgba(255,255,255,0.5); letter-spacing: 0.03em; }

.summary {
  max-width: 1100px;
  margin: 0 auto;
  padding: 56px 32px 48px;
}
.summary p, .summary h1 { font-size: 24px; line-height: 1.65; color: var(--text-body); font-weight: 400; }

/* Bio page summary overrides */
body.page-about .summary {
  max-width: 660px;
  margin: 0 auto;
  padding: 40px 32px 16px;
}
body.page-about .summary p, body.page-about .summary h1 { line-height: 1.75; color: var(--text); }

.content { padding-bottom: 80px; }

.text-block { max-width: 660px; margin: 0 auto; padding: 0 32px 32px; }
.text-block p { font-size: 16px; line-height: 1.75; color: var(--text-body); margin-bottom: 20px; }
.text-block p:last-child { margin-bottom: 0; }
.text-block h2 { font-size: 21px; font-weight: 600; color: var(--text); margin: 4px 0 12px; }
.text-block h3 { font-size: 15px; font-weight: 600; color: var(--text); margin: 4px 0 8px; }
.text-block a {
  color: var(--text);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: #888;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
}
.text-block a:hover { color: var(--color-hover); text-decoration-color: var(--color-hover); }

.img-block { max-width: 1100px; margin: 0 auto; padding: 0 32px; margin-bottom: 48px; }
.img-block img { width: 100%; height: auto; display: block; border-radius: 2px; }
.img-block .caption { font-size: 12px; color: var(--text-muted); margin-top: 8px; margin-bottom: 0; }

.dimg-block {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(45%, 1fr));
  align-items: start;
  gap: 4px;
  max-width: 1100px;
  margin: 0 auto 40px;
  padding: 0 32px;
}
.dimg-block .dimg-item img { width: 100%; height: auto; display: block; }
.dimg-block .dimg-item .caption { font-size: 12px; color: var(--text-muted); margin-top: 6px; margin-bottom: 16px; padding: 0 4px; }

.video-block { max-width: 1100px; margin: 0 auto; padding: 0 32px; }
.video-embed { display: none; padding-top: 56.25%; position: relative; background: var(--text); border-radius: 2px; }
.video-embed iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }
.video-block .caption { font-size: 12px; color: var(--text-muted); margin-top: 8px; margin-bottom: 48px; }

.video-thumb {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #1a1a2e;
  border-radius: 2px;
  cursor: pointer;
  overflow: hidden;
}
.video-thumb img {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.2s;
}
.video-thumb:hover img { opacity: 0.85; }
.video-play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 96px; height: 96px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
  z-index: 2;
}
.video-thumb:hover .video-play { background: rgba(0,0,0,0.8); }
.video-play svg { width: 28px; height: 28px; fill: #fff; margin-left: 6px; }
.video-placeholder {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: #2a2a2a;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px;
  font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: #888;
  z-index: 1;
}
.video-placeholder svg { width: 40px; height: 40px; opacity: 0.6; }

.callout {
  max-width: 1100px;
  margin: 0 auto 40px;
  padding: 36px 0 4px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.content-ul { max-width: 660px; margin: 0 auto; padding: 0 32px 32px; }
.content-ul ul { font-size: 16px; line-height: 1.75; color: var(--text-body); list-style: none; padding: 0; margin: 0; }
.content-ul ul li { position: relative; padding-left: 1.2em; margin-bottom: 6px; }
.content-ul ul li::before { content: '–'; position: absolute; left: 0; color: var(--border-strong); }
.content-ul a { color: var(--text); font-weight: 500; text-decoration: underline; text-decoration-color: #888; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.content-ul a:hover { color: var(--color-hover); text-decoration-color: var(--color-hover); }

.divider { height: 24px; }

/* ── Timeline shared (writing + interviews) ── */
.list-outer { padding: 0 32px 80px; max-width: 920px; }
.writing-outer { padding: 0 32px 80px; max-width: 920px; }
/* Talks needs wider container for 3-col card grid */
body.page-talks .list-outer { max-width: 1100px; }

.row, .writing-item {
  display: grid;
  grid-template-columns: 64px 1fr;
  position: relative;
  transition: opacity 0.2s;
}
.row:has(.year-label:not(:empty)), .writing-item:has(.year-label:not(:empty)) { border-top: 0.5px solid var(--border); }
.row:first-child, .writing-item:first-child { border-top: none; }
.row:last-child, .writing-item:last-child { border-bottom: 0.5px solid var(--border); }
.row.dimmed, .writing-item.dimmed, .talk-card.dimmed { opacity: 0.2; }

.year-col {
  border-right: 0.5px solid var(--border-strong);
  padding-top: 20px;
  padding-right: 20px;
  text-align: right;
  position: relative;
}
.year-label { font-size: 10px; color: var(--text-muted); letter-spacing: 0.03em; white-space: nowrap; }
.year-col::after {
  content: '';
  position: absolute;
  right: -3px; top: 28px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--text-xlight);
  border: 1px solid var(--text-light);
}

.content-col { padding: 20px 0 20px 24px; border-top: 0.5px solid var(--border); }
.row:has(.year-label:not(:empty)) .content-col,
.writing-item:has(.year-label:not(:empty)) .content-col { border-top: none; }

/* ── Writing page ── */
.writing-header { display: flex; flex-direction: column; gap: 6px; }
.writing-header-top {
  display: flex; align-items: baseline;
  justify-content: space-between; gap: 12px;
}
.writing-title { font-size: 16px; font-weight: 500; color: var(--text); line-height: 1.4; flex: 1; }
.writing-title-link { text-decoration: none; color: inherit; }
.writing-title-link:hover .writing-title-text {
  text-decoration: underline;
  text-decoration-color: #888;
  text-underline-offset: 3px;
}
.writing-title-link:hover { color: var(--color-hover); }
.writing-title-link:hover .writing-title-text { text-decoration-color: var(--color-hover); }
.ext-icon { font-size: 15px; color: var(--text-muted); margin-left: 5px; vertical-align: middle; }
.pdf-badge {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #888;
  border: 0.5px solid #ccc;
  border-radius: 2px;
  padding: 2px 5px;
  margin-left: 6px;
  vertical-align: middle;
  text-decoration: none;
}
.pdf-badge:hover { border-color: var(--color-hover); color: var(--color-hover); }
.writing-header-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.writing-date { font-size: 10px; color: var(--text-muted); letter-spacing: 0.03em; white-space: nowrap; }
.writing-coauthors { font-size: 12px; color: var(--text-light); }
.writing-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag {
  font-size: 10px; font-weight: 500; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--text-muted);
  border: 0.5px solid #ccc; border-radius: 2px; padding: 2px 6px;
}
.writing-expanded {
  max-height: 0; overflow: hidden;
  transition: max-height 0.3s ease, margin 0.3s ease;
  margin-top: 0;
}
.writing-item.open .writing-expanded { max-height: 800px; margin-top: 12px; }
.writing-pub { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.writing-pub .pub { color: #777; }
.writing-desc { font-size: 14px; line-height: 1.75; color: #555; }

/* ── Tag filter ── */
.tag-filter { padding: 0 32px 28px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tag-filter-label {
  font-size: 10px; font-weight: 500; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-muted); margin-right: 4px;
}
.filter-tag {
  font-size: 10px; font-weight: 500; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--text-muted);
  border: 0.5px solid #ccc; border-radius: 2px; padding: 3px 8px;
  cursor: pointer; user-select: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  background: transparent;
}
.filter-tag:hover { border-color: #888; color: #555; }
.filter-tag.active { background: #555; color: #fff; border-color: #555; }

/* ── Interviews page ── */
.item-header { display: flex; flex-direction: column; gap: 6px; }
.item-header-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.item-title { font-size: 16px; font-weight: 500; color: var(--text); line-height: 1.4; flex: 1; }
.item-title a { text-decoration: none; color: inherit; }
.item-title a:hover .title-text { text-decoration: underline; text-decoration-color: #888; text-underline-offset: 3px; }
.item-title a:hover { color: var(--color-hover); }
.item-header-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.item-date { font-size: 10px; color: var(--text-muted); letter-spacing: 0.03em; white-space: nowrap; }
.item-byline { font-size: 12px; color: var(--text-muted); }
.item-byline .pub { color: #777; }
.item-tags { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.type-badge {
  font-size: 9px; font-weight: 500; letter-spacing: 0.08em;
  text-transform: uppercase; color: #fff; background: var(--border-strong);
  border-radius: 2px; padding: 2px 6px;
}
.type-badge.podcast { background: #888; }

.item-quote {
  margin-top: 12px;
  font-size: 15px; line-height: 1.7; color: #444;
  padding-left: 18px;
  border-left: 2px solid var(--border);
}
.podcast-player { margin-top: 12px; border-radius: 4px; overflow: hidden; }
.podcast-player audio { width: 100%; }

/* ── Talks page ── */
.talk-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px 16px;
}
.talk-card { }
.talk-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #1a1a1a;
  border-radius: 2px;
  overflow: hidden;
  cursor: pointer;
  margin-bottom: 8px;
}
.talk-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.2s;
}
.talk-thumb:hover img { opacity: 0.85; }
.thumb-placeholder {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px;
  font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase;
  color: #888; background: #2a2a2a;
  position: relative;
  z-index: 1;
}
.thumb-placeholder svg { width: 40px; height: 40px; opacity: 0.6; }
.talk-play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 72px; height: 72px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
  z-index: 2;
}
.talk-thumb:hover .talk-play { background: rgba(0,0,0,0.8); }
.talk-play svg { width: 24px; height: 24px; fill: #fff; margin-left: 4px; }
.talk-thumb:has(.thumb-placeholder) .talk-play { display: none; }

.talk-embed { display: none; position: relative; padding-top: 56.25%; background: var(--text); border-radius: 2px; margin-bottom: 8px; }
.talk-embed iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }


.talk-title { font-size: 14px; font-weight: 500; color: var(--text); line-height: 1.35; margin-bottom: 2px; }
.talk-desc { font-size: 13px; color: var(--text-muted); line-height: 1.4; margin-bottom: 2px; }
.talk-date { font-size: 10px; color: var(--text-muted); letter-spacing: 0.03em; }

.speaker-info {
  padding: 0 32px 40px;
  padding-left: 120px;
  max-width: 1100px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.speaker-info p { font-size: 14px; line-height: 1.75; color: #444; }
.topics-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 0; }
.topics-label {
  font-size: 10px; font-weight: 500; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-muted); margin-right: 4px; flex-shrink: 0;
}
.topic-tag {
  font-size: 10px; font-weight: 500; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--text-light);
  border: 0.5px solid #ccc; border-radius: 2px; padding: 3px 7px;
}

/* ── Bio page ── */
.photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-top: 48px;
  margin-bottom: 0;
}
.photo { overflow: hidden; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.bio {
  max-width: 660px;
  margin: 0 auto;
  padding: 8px 32px 0;
}
.bio p { font-size: 16px; line-height: 1.85; color: var(--text-body); margin-bottom: 24px; }
.bio p:last-child { margin-bottom: 0; }
.bio a {
  color: var(--text);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: #888;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
}
.bio a:hover { color: var(--color-hover); text-decoration-color: var(--color-hover); }
.bio-footer-spacer { height: 80px; }

/* ── Contact page ── */
.contact { padding: 40px 32px 80px; max-width: 760px; display: flex; flex-direction: column; gap: 24px; }
.contact-intro { font-size: 24px; font-weight: 400; line-height: 1.75; color: var(--text); margin-bottom: 16px; }
.contact-email { margin-bottom: 8px; }
.contact-email a {
  font-size: 28px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1.5px solid var(--text);
  padding-bottom: 2px;
}
.contact-email a:hover { color: #555; border-color: #888; }
.contact-seealso {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 20px;
}
.seealso-label {
  font-size: 10px; font-weight: 500; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-muted);
  flex-shrink: 0;
}
.seealso-companies {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 20px;
}
.seealso-link {
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
}
.seealso-link:hover { color: var(--color-hover); }
.contact-social { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.contact-social a {
  display: flex; align-items: center; gap: 7px;
  font-size: 14px; color: var(--text); font-weight: 500;
  text-decoration: underline; text-decoration-color: var(--text-xlight);
  text-underline-offset: 3px; text-decoration-thickness: 1px;
}
.contact-social a:hover { text-decoration-color: var(--text); }
.contact-social svg { width: 16px; height: 16px; fill: currentColor; flex-shrink: 0; }
.contact-location { font-size: 14px; color: var(--text-muted); margin-top: -16px; margin-bottom: 12px; }
body.page-contact { padding-bottom: 80px; }

/* ── 404 page ── */
.error-page { padding: 80px 32px; max-width: 660px; }
.error-page h1 { font-size: 24px; font-weight: 500; color: var(--text); margin-bottom: 16px; }
.error-page p { font-size: 16px; line-height: 1.75; color: #555; margin-bottom: 24px; }
.error-nav { display: flex; flex-wrap: wrap; gap: 12px; }
.error-nav a {
  font-size: 14px; color: var(--text); font-weight: 500;
  text-decoration: underline; text-decoration-color: #888; text-underline-offset: 3px;
}
.error-nav a:hover { color: var(--color-hover); text-decoration-color: var(--color-hover); }

/* ── Mobile (≤640px) ── */
@media (max-width: 640px) {
  .nav { padding: 14px 16px; }
  .nav-name { font-size: 13px; white-space: nowrap; }
  .nav-hamburger { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    flex-direction: column;
    gap: 0;
    padding: 4px 0 12px;
    z-index: 99;
  }
  .nav-links.open { display: flex; }
  .nav-link { font-size: 15px; padding: 10px 16px; }
  .nav-link.active { border-bottom: none; padding-bottom: 10px; }

  .intro { padding: 32px 16px 28px; }
  .intro p, .intro h1 { font-size: 19px; }

  .cos { padding: 0 0 36px; }
  .cos-rule { padding-left: 16px; padding-right: 16px; }
  .cos-grid { grid-template-columns: 1fr; gap: 24px; }
  .cos-item { border: none; border-radius: 0; position: relative; }
  .cos-logo { aspect-ratio: 1/1; }
  .cos-logo::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 60%;
    background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0) 100%);
    pointer-events: none;
  }
  .cos-item-text {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 16px;
    align-items: flex-start;
    gap: 2px;
    background: none;
  }
  .cos-name { font-size: 16px; color: #fff; text-align: left; }
  .cos-desc { font-size: 13px; color: rgba(255,255,255,0.7); text-align: left; }
  .cos-role { font-size: 11px; color: rgba(255,255,255,0.55); text-align: left; margin-top: 2px; }
  .cos-year { font-size: 11px; color: rgba(255,255,255,0.4); text-align: left; }

  .section { padding: 0; margin-bottom: 40px; }
  .grid { grid-template-columns: 1fr; gap: 0; }
  .text-slot { padding: 28px 16px 24px; border-top: none; background: var(--bg); gap: 10px; }
  .text-slot-label { font-size: 14px; letter-spacing: 0.08em; }
  .text-slot-body { font-size: 13px; }

  .pc { border-top: none; padding-top: 0; margin-top: 32px; position: relative; }
  .pc-top { border-top: none; padding-top: 0; }
  .pc:first-child { margin-top: 0; }
  .pi { border-radius: 0; margin-bottom: 0 !important; }
  .pi::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 42%;
    background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0) 100%);
    pointer-events: none;
  }
  .pc-text {
    position: absolute;
    bottom: 16px; left: 16px; right: 16px;
    z-index: 1;
    display: flex; flex-direction: column; gap: 4px;
  }
  .pt { position: static; padding: 0; margin: 0; font-size: 15px; color: #fff; line-height: 1; }
  .pd { position: static; padding: 0; margin: 0; font-size: 12px; color: rgba(255,255,255,0.92); line-height: 1; }
  .py { display: block; position: static; padding: 0; margin: 0; font-size: 10px; color: rgba(255,255,255,0.8); line-height: 1; }
  .pi.r43 { aspect-ratio: 1/1; }
  .pc.featured { grid-column: span 1; border-top: none; padding-top: 0; }
  .pc.featured .pi { aspect-ratio: 2/3; }
  .pc.featured .pt { font-size: 16px; }
  .pc.featured .pd { font-size: 13px; }

  .hero { height: auto; aspect-ratio: 2/3; min-height: unset; }
  .hero-overlay { padding: 32px 16px 24px; }
  .hero-category { font-size: 10px; }
  .hero-title { font-size: 28px; }

  .summary { padding: 32px 16px 28px; max-width: 100%; margin: 0; }
  .summary p, .summary h1 { font-size: 19px; }
  .text-block { padding: 0 16px 24px; max-width: 100%; }
  .text-block p { font-size: 15px; }
  .img-block { max-width: 100%; padding: 0; margin: 0 0 32px; }
  .img-block img { border-radius: 0; aspect-ratio: 1/1; object-fit: cover; }
  .img-block .caption { padding: 0 16px; margin-bottom: 32px; }
  .dimg-block { max-width: 100%; padding: 0; gap: 2px; margin: 0 0 0; }
  .dimg-block .dimg-item img { aspect-ratio: 1/1; object-fit: cover; }
  .dimg-block .dimg-item .caption { padding: 0 8px; margin-bottom: 12px; }
  .video-block { max-width: 100%; padding: 0 16px; }
  .video-block .caption { margin-bottom: 32px; }
  .content-ul { padding: 0 16px 24px; max-width: 100%; }
  .callout { max-width: 100%; margin: 0 0 32px; padding: 28px 0 4px; border-left: none; border-right: none; border-radius: 0; }

  .list-outer, .writing-outer { padding: 0 16px 48px; max-width: 100%; }
  .row, .writing-item { grid-template-columns: 40px 1fr; }
  .year-col { padding-right: 12px; }
  .year-label { font-size: 9px; }
  .content-col { padding-left: 14px; }
  .writing-title { font-size: 15px; }
  .item-title { font-size: 15px; }
  .item-quote { font-size: 14px; padding-left: 14px; }
  .tag-filter { padding: 0 16px 24px; }

  .talk-grid { grid-template-columns: 1fr; gap: 12px; }
  .talk-title { font-size: 12px; }
  .talk-desc { font-size: 11px; }
  .speaker-info { padding: 0 16px 32px; max-width: 100%; }
  .speaker-info p { font-size: 13px; }

  .photos { grid-template-columns: 1fr; gap: 2px; }
  .photo { aspect-ratio: 1/1; }
  .bio { padding: 8px 16px 0; max-width: 100%; }
  .bio p { font-size: 15px; }

  .contact { padding: 32px 16px 48px; max-width: 100%; }
  .contact-intro { font-size: 19px; margin-bottom: 8px; }
  .contact-email a { font-size: 22px; }
  .contact-seealso { gap: 4px 16px; }

  .footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 20px 16px;
    margin-top: 48px;
  }
  .footer-text { font-size: 11px; }
  body.page-contact .footer { padding: 20px 16px; }
}

/* ── Tablet (641–960px) ── */
@media (min-width: 641px) and (max-width: 960px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .text-slot { grid-column: span 2; }
  .pc.featured { grid-column: span 2; }
  .cos-grid { grid-template-columns: repeat(3, 1fr); }
  .talk-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Page loading bar ── */
#page-loading-bar {
  position: fixed;
  top: 0; left: 0;
  width: 0;
  height: 2px;
  background: #c0392b;
  z-index: 9999;
  transition: none;
  opacity: 0;
}
#page-loading-bar.loading {
  animation: loading-bar 2s ease-in forwards;
  opacity: 1;
}
@keyframes loading-bar {
  0%   { width: 0; }
  40%  { width: 60%; }
  80%  { width: 85%; }
  100% { width: 95%; }
}

/* ── Print ── */
@media print {
  .nav, .footer, .back-to-top, #page-loading-bar,
  .video-thumb, .video-embed, .tag-filter { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .hero { height: auto; max-height: 40vh; }
  .hero-overlay { position: relative; background: none; color: #000; padding: 12pt 0; }
  .hero-category, .hero-year { color: #555; }
  .summary, .text-block, .content-ul { max-width: 100%; padding: 0; }
  .text-block p { font-size: 11pt; line-height: 1.6; }
  .img-block { max-width: 100%; padding: 0; page-break-inside: avoid; }
  a { color: #000; text-decoration: underline; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 8pt; color: #555; }
  .project-nav { display: none; }
  .writing-item, .row { page-break-inside: avoid; }
}

/* ── Mobile cos-grid min-height ── */
@media (max-width: 640px) {
  .cos-logo { min-height: 180px; }
}

/* ── Project prev/next navigation ── */
.project-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 32px 40px 48px;
  border-top: 1px solid var(--border);
  margin-top: 24px;
}
.project-nav-prev, .project-nav-next {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-decoration: none;
  color: var(--text);
  max-width: 45%;
}
.project-nav-next { align-items: flex-end; text-align: right; }
.project-nav-label { font-size: 11px; color: var(--text-muted); letter-spacing: 0.05em; text-transform: uppercase; }
.project-nav-title { font-size: 15px; font-weight: 500; }
.project-nav-prev:hover .project-nav-title,
.project-nav-next:hover .project-nav-title { text-decoration: underline; }
.project-nav-empty { visibility: hidden; }
@media (max-width: 640px) {
  .project-nav { padding: 24px 16px 36px; }
  .project-nav-title { font-size: 14px; }
}

/* ── 404 search ── */
.error-search {
  margin: 24px 0 8px;
  max-width: 480px;
}
#error-search-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 15px;
  font-family: var(--font);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: #fff;
  color: var(--text);
  outline: none;
}
#error-search-input:focus { border-color: var(--text); }
.error-search-results { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.error-search-result {
  display: block;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  border-radius: 3px;
  background: rgba(0,0,0,0.03);
}
.error-search-result:hover { background: rgba(0,0,0,0.07); }
.error-search-empty { font-size: 14px; color: var(--text-muted); padding: 8px 0; }
