/* ===== Design Tokens ===== */

:root {
  --ink: #182126;
  --muted: #5e6a70;
  --paper: #f3f8ef;
  --surface: #ffffff;
  --line: #dfe4e2;
  --deep-red: #8f1d18;
  --river: #1d6f78;
  --leaf: #52764b;
  --gold: #c38b2b;
  --night: #24343d;
  --shadow: 0 24px 70px rgba(21, 38, 44, 0.12);
  --radius: 8px;
  --max: 1160px;
}

/* ===== Base Reset & Elements ===== */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

/* ===== Header & Navigation ===== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  padding: 16px 0;
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--deep-red);
  font-weight: 900;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid rgba(223, 228, 226, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 35px rgba(21, 38, 44, 0.08);
}

.site-nav a {
  padding: 9px 15px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 700;
}

.site-nav a.active,
.site-nav a:hover {
  background: var(--night);
  color: white;
}

.language-switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: 8px;
  padding: 5px 10px;
  border-left: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(247, 248, 244, 0.8);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 900;
}

.site-nav .language-switch a {
  padding: 2px 3px;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
}

.site-nav .language-switch a:hover,
.site-nav .language-switch a.active-lang {
  background: transparent;
  color: var(--deep-red);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: var(--ink);
}

main {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

/* ===== Home: Hero ===== */

.hero {
  position: relative;
  min-height: calc(100vh - 88px);
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  align-items: center;
  gap: 56px;
  padding: 54px 0 72px;
}

.eyebrow,
.section-kicker,
.pub-meta,
.post-type {
  margin: 0 0 10px;
  color: var(--deep-red);
  font-size: 0.88rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 860px;
  margin-bottom: 24px;
  font-size: clamp(1.95rem, 3.4vw, 3.35rem);
  line-height: 1.12;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(1.25rem, 1.85vw, 1.85rem);
  line-height: 1.22;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 1rem;
  line-height: 1.25;
}

.hero-text,
.page-hero p,
.origin-band p {
  max-width: 720px;
  color: var(--muted);
  font-size: 1rem;
}

.construction-note {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 18px;
  padding: 8px 12px;
  border: 1px solid rgba(195, 139, 43, 0.32);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  box-shadow: 0 10px 30px rgba(21, 38, 44, 0.06);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(195, 139, 43, 0.16);
  flex: 0 0 auto;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 18px;
  border: 1px solid var(--night);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 800;
}

.button.primary {
  background: var(--night);
  color: white;
}

.button.secondary {
  background: transparent;
  color: var(--night);
}

.hero-visual {
  position: relative;
  min-height: 540px;
  display: grid;
  place-items: center;
}

.hero-visual::before {
  content: "";
  position: absolute;
  inset: 8% 4% 4% 12%;
  border: 1px solid rgba(29, 111, 120, 0.2);
  border-radius: 50%;
  background:
    linear-gradient(135deg, rgba(143, 29, 24, 0.13), transparent 44%),
    linear-gradient(315deg, rgba(82, 118, 75, 0.16), transparent 54%),
    var(--surface);
  box-shadow: var(--shadow);
}

.portrait-frame {
  position: relative;
  width: min(78%, 380px);
  aspect-ratio: 1;
  overflow: hidden;
  border: 12px solid var(--surface);
  border-radius: 50%;
  box-shadow: var(--shadow);
}

.portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.signal-card {
  position: absolute;
  width: 178px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 45px rgba(21, 38, 44, 0.12);
}

.signal-card strong {
  display: block;
  color: var(--river);
  font-size: 1.7rem;
  line-height: 1;
}

.signal-card span {
  color: var(--muted);
  font-size: 0.9rem;
}

.signal-one {
  left: 0;
  bottom: 18%;
}

.signal-two {
  right: 0;
  top: 15%;
}

.scroll-cue {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 13px;
  min-height: 54px;
  padding: 10px 16px 10px 18px;
  border: 1px solid rgba(223, 228, 226, 0.95);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--muted);
  box-shadow: 0 16px 44px rgba(21, 38, 44, 0.12);
  backdrop-filter: blur(12px);
  font-size: 0.84rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
  transform: translateX(-50%);
  transition: opacity 180ms ease, visibility 180ms ease;
}

.scroll-cue:hover {
  color: var(--deep-red);
}

.scroll-cue.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.scroll-line {
  width: 58px;
  height: 1px;
  background: var(--deep-red);
}

.scroll-dot {
  position: relative;
  display: inline-block;
  width: 28px;
  height: 42px;
  border: 2px solid var(--deep-red);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
}

.scroll-dot::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 9px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--deep-red);
  transform: translateX(-50%);
  animation: scrollPulse 1.55s ease-in-out infinite;
}

@keyframes scrollPulse {
  0% {
    opacity: 0;
    transform: translate(-50%, 0);
  }
  35% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, 16px);
  }
}

.metrics-band,
.origin-band,
.profiles,
.editorial-guide,
.gallery-note {
  margin: 16px 0 24px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 16px 45px rgba(21, 38, 44, 0.06);
}

/* ===== Home: Metrics Band ===== */

.metrics-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  padding: 0;
  overflow: hidden;
}

.metrics-band div,
.metrics-band a {
  min-height: 118px;
  padding: 24px;
  background: linear-gradient(180deg, #ffffff, #f7f8f4);
}

.metrics-band a {
  text-decoration: none;
  transition: background 0.2s ease;
}

.metrics-band a:hover {
  background: linear-gradient(180deg, #f7f8f4, #eef1ea);
}

.metrics-band strong {
  display: block;
  color: var(--deep-red);
  font-size: 2.1rem;
  line-height: 1;
}

.metrics-band span {
  color: var(--muted);
  font-weight: 700;
}

.section-grid,
.news-section,
.timeline-section,
.two-column,
.writing-layout,
.gallery-grid,
.publication-grid,
.publication-list {
  margin: 0 0 24px;
}

/* ===== Home: News ===== */

.news-card {
  display: grid;
  gap: 4px;
  padding: 16px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(29, 111, 120, 0.08), transparent 54%),
    var(--surface);
  box-shadow: 0 16px 45px rgba(21, 38, 44, 0.06);
}

.news-list {
  display: grid;
}

.news-item {
  display: grid;
  grid-template-columns: 64px auto 1fr;
  align-items: baseline;
  column-gap: 12px;
  padding: 7px 2px;
  border-bottom: 1px solid rgba(29, 111, 120, 0.12);
}

.news-list .news-item:last-of-type {
  border-bottom: none;
}

.news-item[hidden] {
  display: none;
}

.news-item.news-extra {
  opacity: 0.72;
}

.news-item time {
  color: var(--deep-red);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.4;
  white-space: nowrap;
}

.news-tags {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.news-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(29, 111, 120, 0.1);
  color: var(--river);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.5;
  text-transform: uppercase;
  white-space: nowrap;
}

.news-tag--journal {
  background: rgba(29, 111, 120, 0.1);
  color: var(--river);
}

.news-tag--conference {
  background: rgba(195, 139, 43, 0.16);
  color: #8a611d;
}

.news-tag--health {
  background: rgba(82, 118, 75, 0.14);
  color: var(--leaf);
}

.news-tag--service {
  background: rgba(94, 106, 112, 0.14);
  color: var(--muted);
}

.news-tag--review {
  background: rgba(143, 29, 24, 0.1);
  color: var(--deep-red);
  border: 1px dashed rgba(143, 29, 24, 0.4);
  padding: 0 7px;
}

.news-new {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--deep-red);
  color: #fff;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.5;
  text-transform: uppercase;
  white-space: nowrap;
}

.news-new[hidden] {
  display: none;
}

.news-item p {
  margin: 0;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.4;
}

.news-highlight {
  padding: 0 3px;
  border-radius: 4px;
  background: rgba(195, 139, 43, 0.13);
  color: #604415;
  font-weight: 650;
}

.news-toggle {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  justify-self: start;
  margin-top: 2px;
  padding: 2px 0;
  border: none;
  background: none;
  color: var(--river);
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 800;
}

.news-toggle::after {
  content: "\2304";
  font-size: 0.7em;
  transition: transform 150ms ease;
}

.news-toggle[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

.news-toggle:hover {
  color: var(--ink);
  text-decoration: underline;
}

/* ===== Home: Highlights & Focus Cards ===== */

.section-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.section-grid > div:first-child {
  max-width: 680px;
}

.focus-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

.focus-card,
.panel,
.publication-card,
.feature-post,
.post-list article,
.gallery-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 16px 45px rgba(21, 38, 44, 0.06);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.focus-card:hover,
.panel:hover,
.publication-card:hover,
.feature-post:hover,
.post-list article:hover,
.gallery-item:hover,
.timeline-content:hover,
.service-row:hover,
.thesis-link:hover {
  border-color: rgba(29, 111, 120, 0.42);
  box-shadow: 0 22px 58px rgba(21, 38, 44, 0.12);
  transform: translateY(-2px);
}

.focus-card {
  display: block;
  min-width: 0;
  min-height: 172px;
  padding: 20px;
  overflow: hidden;
}

.focus-card-visual {
  padding-top: 12px;
}

.focus-card-image {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 14px 0 0;
  aspect-ratio: 1482 / 359;
  overflow: hidden;
  border: 1px solid rgba(29, 111, 120, 0.14);
  border-radius: 7px;
  background: #f7f8f4;
}

.focus-image-button {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.focus-image-button:focus-visible {
  outline: 2px solid var(--river);
  outline-offset: -3px;
}

.focus-card-image img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 100%;
  object-fit: fill;
}

.focus-card h3 {
  margin-bottom: 6px;
}

.focus-card p {
  margin-bottom: 0;
}

.focus-card p,
.timeline p,
.panel p,
.publication-card p,
.post-list p,
.feature-post p,
.gallery-note p {
  color: var(--muted);
}

.post-source {
  margin-bottom: 14px;
  color: var(--deep-red);
  font-weight: 900;
}

/* ===== Shared Icon Pictograms (.mini-icon / .pub-icon) ===== */

.mini-icon,
.pub-icon {
  display: block;
  width: 46px;
  height: 46px;
  margin-bottom: 14px;
  border-radius: 8px;
  background: var(--night);
  position: relative;
  overflow: hidden;
}

.mini-icon::before,
.mini-icon::after,
.pub-icon::before,
.pub-icon::after {
  content: "";
  position: absolute;
}

.mini-icon.vision::before {
  width: 27px;
  height: 17px;
  left: 10px;
  top: 15px;
  border: 3px solid white;
  border-radius: 50%;
}

.mini-icon.vision::after {
  width: 7px;
  height: 7px;
  left: 20px;
  top: 20px;
  border-radius: 50%;
  background: var(--gold);
}

.mini-icon.edge::before,
.mini-icon.robot::before,
.pub-icon.chip::before,
.pub-icon.accelerator::before {
  inset: 11px;
  border: 2px solid white;
  border-radius: 4px;
}

.mini-icon.edge::after,
.pub-icon.chip::after {
  width: 28px;
  height: 2px;
  left: 9px;
  top: 22px;
  background: var(--gold);
  box-shadow: 0 -9px var(--gold), 0 9px var(--gold);
}

.mini-icon.robot::after {
  width: 18px;
  height: 18px;
  right: 7px;
  bottom: 7px;
  border: 3px solid var(--gold);
  border-radius: 50%;
}

.mini-icon.agri {
  background: var(--leaf);
}

.mini-icon.agri::before,
.pub-icon.leaf::before {
  width: 23px;
  height: 28px;
  left: 12px;
  top: 9px;
  border-radius: 28px 2px 28px 2px;
  background: white;
}

.mini-icon.agri::after,
.pub-icon.leaf::after {
  width: 2px;
  height: 23px;
  left: 23px;
  top: 15px;
  background: var(--leaf);
  transform: rotate(35deg);
}

/* ===== Section Heading & Career Timeline ===== */

.section-heading {
  max-width: 680px;
  margin-bottom: 8px;
}

.timeline {
  display: grid;
  gap: 0;
  padding: 4px 0;
}

.timeline article {
  position: relative;
  display: grid;
  grid-template-columns: 160px 44px minmax(0, 1fr);
  gap: 14px;
  min-height: auto;
}

.timeline article::before {
  content: "";
  box-sizing: border-box;
  position: absolute;
  left: 194px;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 999px;
  background: rgba(29, 111, 120, 0.22);
}

.timeline article::after {
  content: "";
  box-sizing: border-box;
  position: absolute;
  left: 181px;
  top: 22px;
  width: 30px;
  height: 30px;
  border: 7px solid var(--paper);
  border-radius: 50%;
  background: var(--deep-red);
  box-shadow: 0 0 0 1px rgba(143, 29, 24, 0.25), 0 12px 26px rgba(21, 38, 44, 0.12);
}

.timeline article:first-child::before {
  top: 22px;
}

.timeline article:last-child::before {
  bottom: calc(100% - 38px);
}

.timeline article:nth-child(even)::after {
  background: var(--river);
  box-shadow: 0 0 0 2px rgba(29, 111, 120, 0.22);
}

.timeline article:nth-child(3n)::after {
  background: var(--leaf);
}

.timeline-meta {
  grid-column: 1;
  display: grid;
  align-content: start;
  justify-items: end;
  gap: 8px;
  padding-top: 18px;
  text-align: right;
}

.timeline-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #f7f8f4;
  color: var(--deep-red);
  font-size: 0.83rem;
  font-weight: 900;
}

.timeline-meta .timeline-date {
  min-height: 0;
  padding: 0;
  background: transparent;
  color: var(--night);
  font-size: 0.88rem;
  line-height: 1.25;
}

.timeline-content {
  grid-column: 3;
  position: relative;
  margin-top: 18px;
  margin-bottom: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 16px 45px rgba(21, 38, 44, 0.06);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.timeline h3 {
  margin-bottom: 4px;
  line-height: 1.18;
}

.timeline-org {
  margin: -1px 0 6px;
  color: var(--river);
  font-weight: 850;
  line-height: 1.25;
}

.timeline-summary-row {
  margin-bottom: 0;
}

.timeline-summary-row p {
  display: inline;
  margin: 0 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.timeline details {
  display: inline;
}

.timeline summary {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 7px;
  border: 1px solid rgba(143, 29, 24, 0.22);
  border-radius: 999px;
  background: #fbfcfa;
  color: var(--deep-red);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1;
  list-style: none;
  text-transform: uppercase;
}

.timeline summary::-webkit-details-marker {
  display: none;
}

.timeline summary::after {
  content: "+";
  margin-left: 6px;
}

.timeline details[open] summary::after {
  content: "-";
}

.timeline details[open] summary {
  font-size: 0;
  gap: 0;
}

.timeline details[open] summary::before {
  content: "Hide";
  font-size: 0.78rem;
}

.timeline ul {
  display: block;
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.94rem;
}

.timeline li + li {
  margin-top: 7px;
}

.two-column,
/* ===== Home: Writing & Service Preview ===== */

.writing-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.panel,
.feature-post {
  padding: 24px;
}

.stacked-list {
  display: grid;
  gap: 9px;
}

.stacked-list article {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.stacked-list article:first-child {
  padding-top: 0;
  border-top: 0;
}

.stacked-list article h3 {
  margin-bottom: 5px;
}

.stacked-list article p {
  margin-bottom: 0;
  line-height: 1.45;
}

.stacked-list a {
  color: var(--river);
  font-weight: 900;
}

.thesis-link {
  display: grid;
  gap: 2px;
  margin-top: 7px;
  padding: 9px 11px;
  border: 1px solid rgba(29, 111, 120, 0.2);
  border-radius: var(--radius);
  background: #fbfcfa;
  text-decoration: none;
}

.thesis-link:hover {
  border-color: rgba(29, 111, 120, 0.48);
  background: #f0f7f6;
}

.thesis-link span {
  color: var(--deep-red);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.thesis-link strong {
  color: var(--river);
  font-size: 0.92rem;
  line-height: 1.28;
}

.service-list {
  display: grid;
  gap: 8px;
}

.service-row {
  display: grid;
  gap: 2px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfa;
  text-decoration: none;
}

.service-row:hover {
  border-color: rgba(29, 111, 120, 0.38);
}

.service-row span {
  color: var(--deep-red);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.service-row strong {
  color: var(--ink);
  font-size: 0.96rem;
  line-height: 1.28;
}

.service-row em {
  color: var(--muted);
  font-size: 0.88rem;
  font-style: normal;
}

.service-row-group {
  gap: 7px;
}

.service-sublist {
  display: grid;
  gap: 7px;
}

.service-sublist a {
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  border: 1px solid rgba(29, 111, 120, 0.16);
  border-radius: 7px;
  background: #ffffff;
  text-decoration: none;
}

.service-sublist a:hover {
  border-color: rgba(29, 111, 120, 0.38);
  background: #f0f7f6;
}

.service-sublist span {
  color: var(--river);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: none;
}

.service-sublist strong {
  font-size: 0.9rem;
}

.service-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.service-tags span {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7f8f4;
  color: var(--night);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

/* ===== Home: Profiles & Contact ===== */

.profiles {
  display: grid;
  grid-template-columns: 0.27fr 1fr;
  gap: 32px;
}

.profiles h2 {
  font-size: clamp(1.12rem, 1.7vw, 1.6rem);
}

.contact-section {
  display: grid;
  grid-template-columns: 0.42fr 1fr;
  gap: 26px;
  margin: 0 0 24px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(29, 111, 120, 0.08), transparent 46%),
    var(--surface);
  box-shadow: 0 16px 45px rgba(21, 38, 44, 0.06);
}

.contact-intro p {
  color: var(--muted);
}

.contact-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.contact-form label {
  display: grid;
  gap: 7px;
  color: var(--night);
  font-size: 0.84rem;
  font-weight: 900;
}

.contact-form label:nth-of-type(4),
.contact-form button,
.form-note {
  grid-column: 1 / -1;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--ink);
  font: inherit;
  padding: 10px 12px;
  outline: none;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: rgba(29, 111, 120, 0.55);
  box-shadow: 0 0 0 4px rgba(29, 111, 120, 0.1);
}

.contact-form textarea {
  resize: vertical;
}

.contact-form button {
  justify-self: start;
  cursor: pointer;
}

.form-note {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.profile-links {
  display: grid;
  gap: 9px;
}

.profile-group {
  display: grid;
  gap: 5px;
}

.profile-group-label {
  margin: 0;
  color: var(--deep-red);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.profile-group-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.profile-links a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.66);
  font-size: 0.88rem;
  text-decoration: none;
  font-weight: 800;
  backdrop-filter: blur(6px);
}

.profile-links a > span:last-child {
  min-width: 0;
  font-size: 0.88rem;
  line-height: 1.2;
}

.profile-links a:hover {
  border-color: var(--river);
  background: rgba(240, 247, 246, 0.84);
  color: var(--river);
}

.profile-links img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.profile-links .researchgate-logo {
  width: 26px;
  height: 26px;
}

.profile-links .scopus-profile img {
  width: 25px;
  height: 25px;
}

.consulting-profile {
  display: flex;
  align-items: center;
  min-height: 68px;
  gap: 12px;
  padding: 11px 13px;
  border-color: rgba(29, 111, 120, 0.26);
  background:
    linear-gradient(135deg, rgba(29, 111, 120, 0.26), transparent 50%),
    linear-gradient(90deg, rgba(20, 168, 0, 0.16), transparent 72%),
    rgba(255, 255, 255, 0.55);
}

.consulting-profile:hover {
  background:
    linear-gradient(135deg, rgba(29, 111, 120, 0.32), transparent 50%),
    linear-gradient(90deg, rgba(20, 168, 0, 0.2), transparent 72%),
    rgba(255, 255, 255, 0.62);
}

.consulting-profile .upwork-logo {
  width: 74px;
  height: auto;
  object-fit: contain;
  padding: 5px 7px;
  border: 1px solid rgba(20, 168, 0, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  flex: 0 0 auto;
}

.consulting-profile em,
.consulting-profile strong,
.consulting-profile small {
  display: block;
}

.consulting-profile em {
  margin-bottom: 2px;
  color: #108a00;
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.consulting-profile strong {
  color: var(--night);
  max-width: 720px;
  font-size: 0.9rem;
  line-height: 1.22;
}

.consulting-profile small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  line-height: 1.2;
}

.consulting-note {
  display: block;
  margin: 12px 0 0;
  text-decoration: none;
}

.consulting-note .upwork-logo {
  float: left;
  width: 96px;
  padding: 2px 4px;
  margin: 0 12px 4px 0;
}

.consulting-note::after {
  content: "";
  display: block;
  clear: both;
}

.consulting-note:hover {
  box-shadow: 0 14px 34px rgba(21, 38, 44, 0.1);
  transform: translateY(-1px);
}

/* ===== Home: Origin / About Band ===== */

.origin-band {
  display: grid;
  grid-template-columns: minmax(280px, 0.42fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(29, 111, 120, 0.1), transparent 52%),
    linear-gradient(90deg, rgba(143, 29, 24, 0.06), transparent 74%),
    var(--surface);
}

.origin-intro {
  display: grid;
  align-content: start;
  gap: 10px;
}

.origin-intro h2 {
  max-width: 500px;
  font-size: clamp(1.06rem, 1.58vw, 1.6rem);
  line-height: 1.25;
}

.origin-copy {
  display: grid;
  gap: 14px;
  max-width: 860px;
}

.origin-lead,
.origin-footprint {
  margin: 0;
  color: var(--night);
  font-size: 1.02rem;
  line-height: 1.58;
}

.origin-lead strong,
.origin-footprint strong {
  color: var(--night);
  font-weight: 900;
}

.origin-trail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 2px 0;
  padding: 10px 12px;
  border-left: 3px solid rgba(29, 111, 120, 0.5);
  background: rgba(255, 255, 255, 0.54);
}

.origin-trail span {
  color: var(--river);
  font-size: 0.84rem;
  font-weight: 900;
}

.origin-trail span + span::before {
  content: ">";
  margin-right: 8px;
  color: rgba(143, 29, 24, 0.7);
  font-weight: 900;
}

/* ===== Subpage Hero (Publications / Writing / Gallery) ===== */

.page-hero {
  padding: 60px 0 10px;
}

.page-hero h1 {
  max-width: 820px;
  font-size: clamp(1.85rem, 3vw, 2.85rem);
}

.publication-hero h1,
.publication-hero p,
.writing-hero h1,
.writing-hero p,
.gallery-hero h1,
.gallery-hero p {
  max-width: 1080px;
}

.publication-hero h1 {
  font-size: clamp(1.73rem, 2.82vw, 2.73rem);
}

.writing-hero h1 {
  font-size: clamp(1.49rem, 2.28vw, 2.14rem);
}

/* ===== Publications Page: Filters & Cards ===== */

.publication-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

.filter-button {
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 900;
  cursor: pointer;
}

.filter-button.active,
.filter-button:hover {
  background: var(--night);
  color: white;
}

.publication-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.publication-list {
  display: grid;
  gap: 11px;
}

/* ===== Publications Page: Additional Papers List ===== */

.other-publications {
  margin: 10px 0 35px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.other-publications .section-heading p {
  color: var(--muted);
}

.other-publications .section-heading a {
  color: var(--deep-red);
  font-weight: 700;
  text-decoration: none;
}

.other-publications .section-heading a:hover {
  text-decoration: underline;
}

.other-pub-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.other-pub-list a {
  display: flex;
  flex-direction: column;
  gap: 3px;
  height: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.other-pub-list a:hover {
  border-color: rgba(29, 111, 120, 0.42);
  box-shadow: 0 12px 28px rgba(21, 38, 44, 0.08);
  transform: translateY(-1px);
}

.other-pub-list strong {
  color: var(--ink);
  font-size: 0.85rem;
  line-height: 1.3;
  font-weight: 700;
}

.other-pub-authors {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 500;
  line-height: 1.3;
}

.other-pub-authors b {
  color: var(--ink);
  font-weight: 800;
}

.other-pub-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 5px;
}

.other-pub-type {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.other-pub-type.journal {
  background: rgba(143, 29, 24, 0.1);
  color: var(--deep-red);
}

.other-pub-type.conf {
  background: rgba(29, 111, 120, 0.12);
  color: #1d6f78;
}

.other-pub-meta {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.3;
}

.publication-card {
  display: grid;
  grid-template-columns: minmax(220px, 0.34fr) minmax(0, 1fr);
  align-items: start;
  gap: 16px;
  padding: 0;
  overflow: hidden;
}

.publication-card[hidden] {
  display: none;
}

.publication-card h2 {
  margin-bottom: 8px;
  font-size: 1.08rem;
  line-height: 1.22;
}

.publication-card p {
  margin-bottom: 10px;
}

.pub-summary-row {
  margin-bottom: 10px;
}

.pub-summary-row p {
  display: inline;
  margin-bottom: 0;
  margin-right: 8px;
}

.pub-body {
  padding: 8px 16px 12px 0;
}

.publication-card a,
.feature-post a,
.draft-link {
  color: var(--river);
  font-weight: 900;
}

.draft-link {
  display: inline-flex;
}

.pub-icon {
  margin: 0 auto;
  background: #29434a;
}

.pub-visual {
  --pub-tag-height: 12px;
  --pub-visual-height: 198px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-self: start;
  height: var(--pub-visual-height);
  min-height: var(--pub-visual-height);
  padding: 0 0 var(--pub-tag-height);
  overflow: hidden;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(143, 29, 24, 0.08), transparent 44%),
    linear-gradient(315deg, rgba(29, 111, 120, 0.11), transparent 52%),
    #f7f8f4;
}

.pub-visual .pub-icon {
  flex: 0 0 auto;
  width: 68px;
  height: 68px;
  margin: auto auto;
}

.pub-visual .pub-meta {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  margin: 0;
  padding: 8px 10px 6px;
  border-bottom: 1px solid rgba(223, 228, 226, 0.85);
  background: #f7f8f4;
  color: var(--deep-red);
  font-size: 0.72rem;
  line-height: 1.25;
  text-align: center;
  z-index: 2;
}

.pub-abstract {
  display: block;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  min-height: 0;
  min-width: 0;
  margin-bottom: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  object-fit: fill;
  padding: 0;
  box-shadow: none;
}

.pub-image-button {
  position: relative;
  display: block;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.pub-image-button picture {
  display: block;
  width: 100%;
  height: 100%;
}

.pub-image-button:focus-visible {
  outline: 2px solid var(--river);
  outline-offset: -3px;
}

.pub-visual::after {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  left: 0;
  bottom: 0;
  width: 100%;
  height: var(--pub-tag-height);
  padding: 0 8px;
  border-top: 1px solid rgba(223, 228, 226, 0.78);
  background: #f7f8f4;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  z-index: 2;
}

.publication-card[data-topic="edge-ai"] .pub-visual::after {
  content: "Efficient AI";
}

.publication-card[data-topic="vision"] .pub-visual::after {
  content: "Vision";
}

.publication-card[data-topic="agri"] .pub-visual::after {
  content: "Agriculture";
}

.publication-card[data-topic="health"] .pub-visual::after {
  content: "Healthcare AI";
}

.publication-card[data-topic="systems"] .pub-visual::after {
  content: "Systems";
}

/* ===== Publications Page: Image Lightbox ===== */

.image-lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(14, 24, 24, 0.72);
  backdrop-filter: blur(5px);
  z-index: 1000;
}

.image-lightbox.open {
  display: flex;
}

.image-lightbox-panel {
  position: relative;
  width: min(1120px, 92vw);
  max-height: 90vh;
  padding: 18px 18px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: #f7f8f4;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

.image-lightbox-img {
  display: block;
  width: 100%;
  max-height: 76vh;
  object-fit: contain;
  background: #fff;
}

.image-lightbox-title {
  margin: 10px 42px 0 0;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.35;
}

.image-lightbox-close {
  position: absolute;
  right: 12px;
  top: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(29, 111, 120, 0.22);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
}

.image-lightbox-close:hover,
.image-lightbox-close:focus-visible {
  border-color: rgba(29, 111, 120, 0.55);
  color: var(--river);
}

body.lightbox-open {
  overflow: hidden;
}

/* ===== Publications Page: Card Actions & Expandable Details ===== */

.pub-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pub-actions a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid rgba(29, 111, 120, 0.22);
  border-radius: 999px;
  background: #fbfcfa;
  color: var(--river);
  font-size: 0.86rem;
  text-decoration: none;
}

.pub-actions a:hover {
  border-color: rgba(29, 111, 120, 0.5);
  background: #f0f7f6;
}

.pub-details {
  display: inline;
}

.pub-details summary {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid rgba(143, 29, 24, 0.22);
  border-radius: 999px;
  background: #fbfcfa;
  color: var(--deep-red);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1;
  list-style: none;
  text-transform: uppercase;
}

.pub-details summary::-webkit-details-marker {
  display: none;
}

.pub-details summary::after {
  content: "+";
  margin-left: 6px;
}

.pub-details[open] summary::after {
  content: "-";
}

.pub-details[open] summary {
  font-size: 0;
  gap: 0;
}

.pub-details[open] summary::before {
  content: "Hide";
  font-size: 0.82rem;
}

.pub-details-body {
  display: block;
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(29, 111, 120, 0.16);
  border-radius: var(--radius);
  background: #fbfcfa;
}

.pub-details dl {
  display: grid;
  gap: 9px;
  margin: 0;
}

.pub-details dl div {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 12px;
}

.pub-details dt {
  color: var(--deep-red);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.35;
  text-transform: uppercase;
}

.pub-details dd {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.author-list sup {
  color: var(--deep-red);
  font-size: 0.68em;
  font-weight: 900;
}

.author-list strong {
  color: var(--night);
  font-weight: 900;
}

.affiliation-list {
  margin: 0;
  padding-left: 18px;
}

.affiliation-list li + li {
  margin-top: 3px;
}

.corresponding-note {
  display: block;
  margin-top: 4px;
  color: var(--deep-red);
  font-size: 0.8rem;
  font-weight: 850;
}

/* ===== Action Icons (Paper / PDF / arXiv / GitHub) ===== */

.action-icon {
  position: relative;
  display: inline-block;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.link-icon::before {
  content: "";
  position: absolute;
  inset: 2px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.link-icon::after {
  content: "";
  position: absolute;
  right: 0;
  top: 1px;
  width: 6px;
  height: 6px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
}

.pdf-icon::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 1px;
  width: 10px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 2px;
}

.pdf-icon::after {
  content: "";
  position: absolute;
  left: 5px;
  bottom: 4px;
  width: 8px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 -4px currentColor;
}

.arxiv-icon::before {
  content: "a";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 900;
  font-family: Georgia, serif;
}

.github-icon::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.github-icon::after {
  content: "";
  position: absolute;
  left: 5px;
  bottom: 0;
  width: 6px;
  height: 7px;
  border-radius: 0 0 3px 3px;
  background: currentColor;
}

/* ===== Publication Topic Icon Variants ===== */

.pub-icon.pruning::before {
  width: 36px;
  height: 36px;
  left: 9px;
  top: 9px;
  border: 2px solid white;
  border-radius: 50%;
}

.pub-icon.pruning::after {
  width: 40px;
  height: 3px;
  left: 7px;
  top: 25px;
  background: var(--gold);
  transform: rotate(-28deg);
}

.pub-icon.brain::before {
  width: 30px;
  height: 26px;
  left: 12px;
  top: 14px;
  border: 3px solid white;
  border-radius: 44% 56% 52% 48%;
}

.pub-icon.brain::after {
  width: 20px;
  height: 2px;
  left: 17px;
  top: 27px;
  background: var(--gold);
  box-shadow: 0 -7px var(--gold), 0 7px var(--gold);
}

.pub-icon.health::before {
  width: 36px;
  height: 36px;
  left: 23px;
  top: 23px;
  border-radius: 50%;
  background: white;
}

.pub-icon.health::after {
  width: 30px;
  height: 8px;
  left: 26px;
  top: 37px;
  background: var(--deep-red);
  box-shadow: 0 0 0 0 var(--deep-red);
}

.pub-icon.health {
  background: var(--river);
}

.pub-icon.health span {
  display: none;
}

.pub-icon.road::before,
.pub-icon.driver::before,
.pub-icon.systems::before {
  width: 52px;
  height: 30px;
  left: 15px;
  top: 29px;
  border: 3px solid white;
  border-radius: 6px;
}

.pub-icon.road::after {
  width: 48px;
  height: 3px;
  left: 17px;
  top: 43px;
  background: var(--gold);
  transform: perspective(50px) rotateX(35deg);
}

.pub-icon.driver::after {
  width: 18px;
  height: 18px;
  left: 32px;
  top: 23px;
  border: 3px solid var(--gold);
  border-radius: 50%;
  box-shadow: 0 25px 0 -5px var(--gold);
}

.pub-icon.systems::after {
  width: 46px;
  height: 3px;
  left: 18px;
  top: 40px;
  background: var(--gold);
  box-shadow: 0 -11px white, 0 11px white;
}

.pub-icon.interaction::before {
  width: 42px;
  height: 28px;
  left: 20px;
  top: 18px;
  border: 3px solid white;
  border-radius: 5px;
}

.pub-icon.interaction::after {
  width: 13px;
  height: 24px;
  left: 36px;
  top: 40px;
  border-radius: 999px;
  background: var(--gold);
  transform: rotate(-22deg);
}

.pub-icon.face::before {
  width: 30px;
  height: 36px;
  left: 12px;
  top: 9px;
  border: 3px solid white;
  border-radius: 45%;
}

.pub-icon.face::after {
  width: 5px;
  height: 5px;
  left: 20px;
  top: 23px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 13px 0 var(--gold), 6px 13px white;
}

.pub-icon.traffic::before {
  width: 28px;
  height: 34px;
  left: 13px;
  top: 10px;
  border-radius: 5px;
  background: white;
}

.pub-icon.traffic::after {
  width: 8px;
  height: 8px;
  left: 23px;
  top: 16px;
  border-radius: 50%;
  background: var(--deep-red);
  box-shadow: 0 10px var(--gold), 0 20px var(--leaf);
}

.pub-icon.color::before,
.pub-icon.survey::before {
  width: 24px;
  height: 24px;
  left: 8px;
  top: 9px;
  border-radius: 50%;
  background: var(--deep-red);
  box-shadow: 14px 13px var(--river), 27px 0 var(--gold);
}

.pub-icon.survey::after {
  width: 34px;
  height: 3px;
  left: 10px;
  bottom: 10px;
  background: white;
  box-shadow: 0 -7px white;
}

/* ===== Writing Page ===== */

.writing-layout {
  align-items: start;
}

.writing-section {
  margin: 0 0 24px;
  display: grid;
  grid-template-columns: minmax(150px, 0.2fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.writing-section-heading {
  position: sticky;
  top: 96px;
  padding-top: 2px;
}

.writing-section-heading .section-kicker {
  margin-bottom: 0;
  font-size: 0.86rem;
  line-height: 1.25;
}

.writing-section-heading h2 {
  margin-bottom: 8px;
  font-size: 1.35rem;
}

.writing-section-heading p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.writing-entry-list {
  display: grid;
  gap: 12px;
}

.writing-entry {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 16px 45px rgba(21, 38, 44, 0.06);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.writing-entry:hover {
  border-color: rgba(29, 111, 120, 0.42);
  box-shadow: 0 22px 58px rgba(21, 38, 44, 0.12);
  transform: translateY(-2px);
}

.writing-entry[hidden],
.explore-more[hidden] {
  display: none;
}

.writing-entry-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.35;
}

.writing-entry-meta span {
  color: var(--deep-red);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.source-logo {
  display: block;
  width: min(150px, 100%);
  height: auto;
  padding: 6px 8px;
  border: 1px solid rgba(29, 111, 120, 0.16);
  border-radius: 6px;
  background: #fff;
}

.writing-entry-copy h3 {
  margin-bottom: 7px;
  font-size: 1.04rem;
  line-height: 1.35;
}

.writing-entry-copy p {
  margin-bottom: 9px;
  color: var(--muted);
  line-height: 1.52;
}

.writing-entry-copy a {
  color: var(--river);
  font-weight: 900;
}

.writing-entry-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
  font-weight: 800;
}

.writing-entry-actions a {
  text-decoration: none;
  transition: color 180ms ease;
}

.writing-entry-actions .read-local {
  color: var(--river);
}

.writing-entry-actions .read-source {
  color: var(--deep-red);
}

.writing-entry-actions .read-separator {
  color: rgba(31, 49, 55, 0.34);
}

.writing-entry-actions a:hover {
  color: var(--night);
}

.explore-more {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px dashed rgba(29, 111, 120, 0.42);
  border-radius: var(--radius);
  background: rgba(240, 247, 246, 0.72);
  color: var(--river);
  font-weight: 900;
  text-decoration: none;
}

.explore-more::after {
  content: "→";
  margin-left: 8px;
}

.explore-more:hover {
  border-style: solid;
  background: #f0f7f6;
}

.empty-section-note {
  margin: 0;
  padding: 18px;
  border: 1px dashed rgba(29, 111, 120, 0.28);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  line-height: 1.55;
}

.article-footer-nav a {
  color: var(--river);
  font-weight: 900;
}

.feature-post {
  min-height: 360px;
  background:
    linear-gradient(145deg, rgba(29, 111, 120, 0.12), transparent),
    var(--surface);
}

.compact-feature-post {
  min-height: auto;
}

.post-list {
  display: grid;
  gap: 14px;
}

.writing-layout > .post-list {
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.post-list article {
  padding: 22px;
}

.post-list span {
  color: var(--deep-red);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag-cloud span {
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7f8f4;
  font-weight: 800;
}

/* ===== Article Page (Long-form Writing) ===== */

.article-page {
  max-width: 1040px;
}

.long-article {
  padding: 48px 0 20px;
}

.article-hero {
  max-width: 920px;
  margin-bottom: 22px;
}

.article-hero h1 {
  max-width: 780px;
  font-size: clamp(1.75rem, 3vw, 2.65rem);
  line-height: 1.18;
}

.article-deck {
  max-width: 760px;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.65;
}

.article-byline {
  color: var(--deep-red);
  font-weight: 900;
}

.article-source-link {
  margin-top: 10px;
}

.article-source-link a {
  color: var(--river);
  font-weight: 900;
}

.article-body {
  max-width: 920px;
  padding: 34px 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 18px 48px rgba(21, 38, 44, 0.07);
  color: var(--ink);
  font-size: 1.02rem;
  line-height: 1.9;
  text-align: justify;
}

.article-body h2 {
  margin: 34px 0 12px;
  color: var(--night);
  font-size: 1.35rem;
  line-height: 1.35;
  text-align: left;
}

.article-body p {
  margin-bottom: 18px;
}

.article-lead-line {
  color: var(--night);
  font-weight: 900;
}

.article-bullet-list,
.article-number-list {
  margin: 0 0 22px;
  padding-left: 24px;
  color: var(--ink);
  line-height: 1.75;
}

.article-bullet-list li,
.article-number-list li {
  margin-bottom: 10px;
}

.article-bullet-list strong,
.article-number-list strong {
  color: var(--night);
}

.article-author-note {
  margin-top: 32px;
  padding: 16px 18px;
  border-left: 4px solid var(--river);
  background: #f7f8f4;
  color: var(--muted);
  line-height: 1.7;
}

.article-footer-nav {
  max-width: 920px;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

/* ===== Gallery Page ===== */

.gallery-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr;
  grid-auto-rows: 240px;
  gap: 12px;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  margin: 0;
}

.gallery-item.large {
  grid-row: span 2;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-item figcaption {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--night);
  font-size: 0.84rem;
  font-weight: 900;
}

.generated-tile {
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(143, 29, 24, 0.16), transparent 48%),
    linear-gradient(315deg, rgba(29, 111, 120, 0.18), transparent 56%),
    #f7f8f4;
}

.generated-tile span {
  font-size: 2rem;
  font-weight: 900;
}

.generated-tile.alt {
  background:
    linear-gradient(135deg, rgba(29, 111, 120, 0.2), transparent 46%),
    #eef5f4;
}

.generated-tile.warm {
  background:
    linear-gradient(135deg, rgba(195, 139, 43, 0.28), transparent 46%),
    #fbf6e9;
}

.generated-tile.green {
  background:
    linear-gradient(135deg, rgba(82, 118, 75, 0.24), transparent 46%),
    #eef5ed;
}

/* ===== Footer ===== */

.site-footer {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 46px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.site-footer p {
  margin: 0;
}

.site-footer .copyright {
  font-size: 0.78rem;
  color: var(--muted);
  opacity: 0.85;
}

.site-footer a {
  color: var(--river);
  font-weight: 900;
}

/* ===== Responsive: Tablet (<=900px) ===== */

@media (max-width: 900px) {
  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: absolute;
    top: 64px;
    right: 0;
    display: none;
    width: min(280px, calc(100vw - 32px));
    padding: 10px;
    border-radius: var(--radius);
    flex-direction: column;
    align-items: stretch;
  }

  .site-nav.open {
    display: flex;
  }

  .site-nav a {
    border-radius: 6px;
  }

  .hero,
  .section-grid,
  .profiles,
  .contact-section,
  .origin-band,
  .writing-section,
  .writing-entry,
  .two-column,
  .writing-layout {
    grid-template-columns: 1fr;
  }

  .writing-section-heading {
    position: static;
  }

  .writing-section {
    gap: 14px;
  }

  .writing-section-heading h2 {
    font-size: 1.18rem;
  }

  .hero {
    min-height: auto;
    padding: 34px 0 86px;
  }

  .hero-visual {
    min-height: 430px;
  }

  .metrics-band,
  .profile-group-grid,
  .publication-grid,
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .timeline {
    grid-template-columns: 1fr;
    gap: 12px;
    padding-left: 0;
  }

  .timeline article {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 10px;
    min-height: auto;
  }

  .timeline article::before {
    left: 12px;
    width: 3px;
  }

  .timeline article::after {
    left: 3px;
    top: 20px;
    width: 21px;
    height: 21px;
    border-width: 5px;
  }

  .timeline-meta {
    grid-column: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    justify-items: start;
    gap: 8px;
    padding-top: 0;
    text-align: left;
  }

  .timeline-meta span {
    min-width: 0;
    white-space: nowrap;
  }

  .timeline-content {
    grid-column: 2;
    padding: 12px 13px;
    margin-top: 0;
    margin-bottom: 4px;
  }

  .timeline-meta .timeline-date {
    padding: 4px 8px;
    background: #f7f8f4;
    color: var(--deep-red);
    text-align: left;
  }
}

/* ===== Responsive: Mobile (<=620px) ===== */

@media (max-width: 620px) {
  main,
  .site-header,
  .site-footer {
    width: min(100% - 20px, var(--max));
  }

  .site-header {
    padding: 10px 0;
  }

  .brand {
    gap: 8px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    font-size: 0.86rem;
  }

  .nav-toggle {
    width: 38px;
    height: 38px;
  }

  h1 {
    margin-bottom: 14px;
    font-size: 1.72rem;
    line-height: 1.16;
  }

  h2 {
    margin-bottom: 8px;
  }

  h3 {
    margin-bottom: 6px;
  }

  p {
    margin-bottom: 12px;
  }

  .eyebrow,
  .section-kicker,
  .pub-meta,
  .post-type {
    margin-bottom: 8px;
    font-size: 0.8rem;
  }

  .hero {
    gap: 22px;
    padding: 18px 0 58px;
  }

  .hero-copy {
    min-height: calc(100svh - 86px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-bottom: 50px;
  }

  .hero-text,
  .page-hero p,
  .origin-band p {
    font-size: 0.94rem;
    line-height: 1.5;
  }

  .page-hero {
    padding: 34px 0 2px;
  }

  .page-hero h1,
  .writing-hero h1 {
    font-size: 1.37rem;
  }

  .hero-actions {
    gap: 8px;
    margin-top: 18px;
  }

  .button {
    min-height: 40px;
    padding: 9px 14px;
    font-size: 0.9rem;
  }

  .construction-note {
    margin-bottom: 12px;
    padding: 7px 10px;
    font-size: 0.82rem;
  }

  .hero-visual {
    min-height: 310px;
  }

  .news-card {
    gap: 8px;
    padding: 14px 16px;
  }

  .news-section .section-heading {
    display: block;
  }

  .news-item {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 9px;
    row-gap: 2px;
    padding: 8px 2px;
  }

  .news-item time {
    grid-column: 1;
    grid-row: 1;
  }

  .news-tags {
    grid-column: 2;
    grid-row: 1;
    justify-self: start;
  }

  .news-item p {
    grid-column: 1 / -1;
    grid-row: 2;
    font-size: 0.88rem;
    line-height: 1.35;
  }

  .news-toggle {
    font-size: 0.8rem;
  }

  .scroll-cue {
    bottom: 16px;
    min-height: 50px;
    padding: 9px 13px;
    font-size: 0.78rem;
  }

  .scroll-line {
    width: 34px;
  }

  .scroll-dot {
    width: 25px;
    height: 38px;
  }

  .signal-card {
    width: 145px;
    padding: 10px;
  }

  .signal-card strong {
    font-size: 1.35rem;
  }

  .focus-grid,
  .writing-layout > .post-list,
  .publication-grid,
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .section-grid,
  .timeline-section,
  .two-column,
  .writing-layout,
  .gallery-grid,
  .publication-grid,
  .publication-list,
  .writing-section,
  .metrics-band,
  .profiles,
  .contact-section,
  .origin-band {
    margin-bottom: 22px;
  }

  .section-grid,
  .focus-grid,
  .writing-entry-list,
  .post-list {
    gap: 10px;
  }

  .long-article {
    padding-top: 24px;
  }

  .article-body {
    padding: 18px 16px;
    font-size: 0.95rem;
    line-height: 1.72;
  }

  .article-hero {
    margin-bottom: 14px;
  }

  .article-hero h1 {
    font-size: 1.5rem;
  }

  .article-deck {
    font-size: 0.94rem;
    line-height: 1.52;
  }

  .article-body h2 {
    margin: 24px 0 8px;
    font-size: 1.12rem;
  }

  .article-body p {
    margin-bottom: 13px;
  }

  .article-bullet-list,
  .article-number-list {
    margin-bottom: 16px;
    padding-left: 19px;
    line-height: 1.62;
  }

  .article-bullet-list li,
  .article-number-list li {
    margin-bottom: 8px;
  }

  .profile-group-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .writing-entry {
    gap: 8px;
    padding: 13px;
  }

  .writing-entry-meta {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
  }

  .writing-entry-meta span {
    flex: 1 1 100%;
  }

  .writing-entry-meta time {
    flex: 1 1 100%;
  }

  .source-logo {
    width: min(136px, 54vw);
    padding: 5px 7px;
  }

  .writing-entry:has(.source-logo) {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    column-gap: 10px;
    row-gap: 5px;
  }

  .writing-entry:has(.source-logo) .writing-entry-meta,
  .writing-entry:has(.source-logo) .writing-entry-copy {
    display: contents;
  }

  .writing-entry:has(.source-logo) .source-logo {
    grid-column: 1;
    grid-row: 1;
    align-self: end;
    justify-self: start;
    width: 110px;
    height: 60px;
    max-height: none;
    object-fit: contain;
    padding: 3px;
  }

  .writing-entry:has(.source-logo) .writing-entry-copy h3 {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    margin: 0;
  }

  .writing-entry:has(.source-logo) .writing-entry-meta span {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
    justify-self: center;
    min-width: 0;
    width: 100%;
    text-align: center;
    font-size: 0.64rem;
    line-height: 1.15;
  }

  .writing-entry:has(.source-logo) .writing-entry-meta time {
    grid-column: 1 / -1;
    grid-row: 2;
    align-self: center;
    justify-self: start;
    margin-bottom: 4px;
    min-width: 0;
    text-align: left;
    font-size: 0.72rem;
    line-height: 1.2;
  }

  .writing-entry:has(.source-logo) .writing-entry-copy p {
    grid-column: 1 / -1;
    grid-row: 3;
    margin-bottom: 3px;
  }

  .writing-entry:has(.source-logo) .writing-entry-actions {
    grid-column: 1 / -1;
    grid-row: 4;
    margin-top: 0;
  }

  .writing-entry-copy h3 {
    font-size: 0.98rem;
  }

  .writing-entry-copy p {
    font-size: 0.92rem;
    line-height: 1.5;
  }

  .writing-entry-actions {
    gap: 3px 5px;
    font-size: 0.86rem;
    line-height: 1.35;
  }

  .writing-entry-copy a {
    white-space: normal;
  }

  .profile-links a,
  .profile-links a > span:last-child {
    font-size: 0.82rem;
    line-height: 1.15;
  }

  .profile-links {
    gap: 8px;
  }

  .profile-group-grid {
    gap: 7px;
  }

  .professional-grid a {
    min-width: 0;
    min-height: 48px;
    padding: 8px 6px;
    gap: 6px;
  }

  .professional-grid a span:last-child {
    overflow-wrap: normal;
  }

  .profile-links img {
    width: 25px;
    height: 25px;
  }

  .profile-links .researchgate-logo {
    width: 24px;
    height: 24px;
  }

  .metrics-band {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metrics-band div,
  .metrics-band a {
    min-height: 92px;
    padding: 16px;
  }

  .metrics-band strong {
    font-size: 1.72rem;
  }

  .consulting-profile {
    min-height: 60px;
    align-items: flex-start;
    gap: 9px;
  }

  .consulting-profile .upwork-logo {
    width: 84px;
    padding: 4px 5px;
  }

  .publication-card {
    position: relative;
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .other-pub-list {
    grid-template-columns: 1fr;
  }

  .publication-card + .publication-card::before {
    content: "";
    position: absolute;
    top: -13px;
    left: 18px;
    right: 18px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(29, 111, 120, 0.34), rgba(143, 29, 24, 0.18), transparent);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
  }

  .focus-card {
    min-height: auto;
    padding: 14px;
  }

  .focus-card-image {
    margin-top: 10px;
  }

  .panel,
  .feature-post,
  .post-list article {
    padding: 16px;
  }

  .stacked-list {
    gap: 8px;
  }

  .stacked-list article {
    padding-top: 9px;
  }

  .service-list {
    gap: 8px;
  }

  .service-row {
    padding: 11px;
  }

  .service-sublist {
    gap: 6px;
  }

  .service-sublist a,
  .thesis-link {
    padding: 8px 9px;
  }

  .contact-form {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .contact-section {
    gap: 14px;
    padding: 16px;
  }

  .contact-form label {
    gap: 5px;
    font-size: 0.8rem;
  }

  .contact-form input,
  .contact-form textarea {
    padding: 9px 10px;
  }

  .origin-intro {
    min-height: auto;
  }

  .origin-band {
    gap: 14px;
    padding: 18px;
  }

  .origin-copy {
    gap: 11px;
  }

  .origin-lead,
  .origin-footprint {
    font-size: 0.95rem;
    line-height: 1.5;
  }

  .origin-trail {
    gap: 5px 8px;
    padding: 9px 10px;
  }

  .origin-trail span {
    font-size: 0.78rem;
  }

  .origin-trail span + span::before {
    margin-right: 6px;
  }

  .pub-visual {
    --pub-tag-height: 0px;
    --pub-visual-height: clamp(193px, calc(49vw + 10px), 249px);
    height: var(--pub-visual-height);
    min-height: var(--pub-visual-height);
    padding: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .pub-visual::after {
    display: none;
  }

  .pub-abstract {
    min-height: 0;
    width: 100%;
    aspect-ratio: auto;
  }

  .pub-image-button {
    cursor: default;
    pointer-events: none;
  }

  .image-lightbox {
    padding: 12px;
  }

  .image-lightbox-panel {
    width: min(100%, 96vw);
    max-height: 88vh;
    padding: 10px 10px 12px;
  }

  .image-lightbox-img {
    max-height: 72vh;
  }

  .image-lightbox-title {
    margin: 8px 38px 0 0;
    font-size: 0.78rem;
  }

  .image-lightbox-close {
    right: 10px;
    top: 8px;
  }

  .pub-body {
    padding: 4px 14px 14px;
  }

  .publication-controls {
    gap: 7px;
    margin-bottom: 16px;
  }

  .filter-button {
    min-height: 36px;
    padding: 7px 10px;
    font-size: 0.82rem;
  }

  .publication-card h2 {
    margin-bottom: 6px;
    font-size: 0.98rem;
  }

  .publication-card p,
  .pub-details dd {
    font-size: 0.86rem;
    line-height: 1.45;
  }

  .pub-details dl div {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .gallery-grid {
    grid-auto-rows: 180px;
  }

  .gallery-item.large {
    grid-row: span 1;
  }

  .site-footer {
    gap: 8px;
    padding: 24px 0 30px;
  }
}
