/* Modern refresh layered over the original TEMPLATED styles. */

:root {
  --ink: #20242a;
  --muted: #5f6670;
  --paper: #ffffff;
  --soft: #eef3f5;
  --line: #d7e0e4;
  --accent: #0d766e;
  --accent-dark: #075a55;
  --warm: #c45f35;
}

html {
  scroll-behavior: smooth;
}

body {
  background: #f5f7f5;
  color: var(--ink);
  font-family: Lato, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

a {
  color: var(--accent-dark);
}

#wrapper {
  overflow: hidden;
}

#header {
  background:
    linear-gradient(120deg, rgba(245, 247, 245, 0.96), rgba(232, 241, 241, 0.9)),
    url("../cms.jpg") center / cover;
  border-bottom: 1px solid var(--line);
  padding: 2.4em 0 2em;
}

#header .container {
  max-width: 1120px;
}

#logo {
  margin-bottom: 1.4em;
}

#logo h1 a,
#logo h1 {
  color: var(--ink);
  font-size: clamp(2.1rem, 6vw, 4.6rem);
  line-height: 0.95;
  letter-spacing: 0;
  text-transform: none;
}

#logo span,
.site-kicker {
  color: var(--accent-dark);
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 0.7rem;
  text-transform: uppercase;
}

.site-subtitle {
  color: var(--muted);
  font-size: 1.2rem;
  max-width: 720px;
}

#nav > ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding-left: 0;
}

#nav > ul > li {
  display: block;
}

#nav > ul > li > a,
#nav > ul > li > span {
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(13, 118, 110, 0.2);
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.72rem 1rem;
  text-transform: none;
}

#nav > ul > li > a:hover,
#nav li.active a {
  background: var(--accent);
  color: #fff;
}

#page {
  padding: 3.5rem 0;
}

.page-shell {
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(230px, 0.85fr) minmax(0, 2fr);
}

.profile-card,
.content-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(36, 47, 56, 0.08);
}

.profile-card {
  align-self: start;
  padding: 1.5rem;
}

.profile-photo {
  aspect-ratio: 4 / 5;
  border-radius: 8px;
  display: block;
  margin-bottom: 1.25rem;
  object-fit: cover;
  width: 100%;
}

.contact-list {
  color: var(--muted);
  list-style: none;
  margin: 0;
  padding: 0;
}

.contact-list li {
  border-top: 1px solid var(--line);
  padding: 0.75rem 0;
}

.contact-list li:first-child {
  border-top: 0;
}

.logo-strip {
  align-items: center;
  display: flex;
  gap: 1rem;
  margin-top: 1.25rem;
}

.logo-strip img {
  height: 58px;
  object-fit: contain;
  width: auto;
}

.content-panel {
  padding: clamp(1.5rem, 4vw, 3rem);
}

.content-panel h2,
.content-panel h1 {
  color: var(--ink);
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.05;
  margin-bottom: 1rem;
  text-transform: none;
}

.lead {
  color: var(--muted);
  font-size: 1.18rem;
  margin-bottom: 2rem;
}

.highlight-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 2rem;
}

.highlight {
  background: var(--soft);
  border-radius: 8px;
  padding: 1rem;
}

.highlight strong {
  color: var(--accent-dark);
  display: block;
  margin-bottom: 0.35rem;
}

.link-list {
  display: grid;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.link-list a {
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  padding: 1rem 1.15rem;
  text-decoration: none;
}

.link-list a:after {
  color: var(--warm);
  content: "Open";
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  margin-left: 1rem;
  text-transform: uppercase;
}

.link-list a:hover {
  border-color: rgba(13, 118, 110, 0.45);
  box-shadow: 0 14px 32px rgba(36, 47, 56, 0.08);
  transform: translateY(-1px);
}

.program-list {
  display: grid;
  gap: 1.25rem;
}

.program {
  border-top: 1px solid var(--line);
  padding-top: 1.25rem;
}

.program:first-child {
  border-top: 0;
  padding-top: 0;
}

.program h2 {
  font-size: 1.35rem;
  margin-bottom: 0.35rem;
}

.program p {
  color: var(--muted);
  margin: 0;
}

#copyright {
  background: var(--ink);
  color: rgba(255, 255, 255, 0.7);
}

#copyright a {
  color: #fff;
}

@media (max-width: 760px) {
  #header {
    padding-top: 5rem;
  }

  .page-shell,
  .highlight-grid {
    grid-template-columns: 1fr;
  }

  .content-panel,
  .profile-card {
    box-shadow: none;
  }

  .link-list a {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.4rem;
  }

  .link-list a:after {
    margin-left: 0;
  }
}

/* Stronger physics identity and archive states. */
body {
  background:
    radial-gradient(circle at 12% 0%, rgba(34, 146, 160, 0.12), transparent 30rem),
    radial-gradient(circle at 90% 10%, rgba(196, 95, 53, 0.13), transparent 28rem),
    #f4f6f5;
}

#header {
  background:
    linear-gradient(90deg, rgba(7, 17, 24, 0.88), rgba(7, 38, 44, 0.66) 46%, rgba(7, 17, 24, 0.28)),
    url("../cms.png") center / cover;
  border-bottom: 4px solid var(--warm);
  min-height: 410px;
  padding: 3.4em 0 2.4em;
  position: relative;
}

#header:after {
  background: linear-gradient(90deg, var(--accent), #3fb6c9, var(--warm));
  bottom: 0;
  content: "";
  height: 6px;
  left: 0;
  position: absolute;
  right: 0;
}

#logo h1 a,
#logo h1,
.site-subtitle {
  color: #fff;
  text-shadow: 0 2px 22px rgba(0, 0, 0, 0.35);
}

.site-kicker {
  color: #8ce8ee;
}

#nav > ul > li > a,
#nav > ul > li > span {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.38);
}

.identity-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
}

.identity-image {
  border-radius: 8px;
  margin: 0;
  overflow: hidden;
}

.identity-image img {
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: cover;
  width: 100%;
}

.identity-image figcaption {
  background: #111a20;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.88rem;
  padding: 0.8rem 1rem;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.4rem;
}

.badge {
  background: #eaf6f6;
  border: 1px solid rgba(13, 118, 110, 0.2);
  border-radius: 999px;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  padding: 0.45rem 0.7rem;
  text-transform: uppercase;
}

.link-list a {
  align-items: flex-start;
  gap: 1rem;
}

.course-main {
  display: grid;
  gap: 0.2rem;
}

.course-meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.course-status {
  border-radius: 999px;
  flex: 0 0 auto;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  padding: 0.4rem 0.65rem;
  text-transform: uppercase;
}

.course-status.current {
  background: #e6f4ef;
  color: #096143;
}

.course-status.archived {
  background: #f4eee8;
  color: #93502f;
}

.link-list a:after {
  content: none;
}

.archive-note {
  background: #fff8ef;
  border: 1px solid #ecd8c2;
  border-radius: 8px;
  color: #6f4b32;
  margin-bottom: 1.5rem;
  padding: 1rem 1.15rem;
}

.program-list:before {
  background: url("../EXOpic.png") center / cover;
  border-radius: 8px;
  content: "";
  display: block;
  min-height: 240px;
}

@media (max-width: 760px) {
  #header {
    min-height: 360px;
  }

  .identity-grid {
    grid-template-columns: 1fr;
  }

  .course-status {
    align-self: flex-start;
  }
}

/* Navigation, mobile menu, footer, and research page polish. */
#nav li.active a,
#nav > ul > li > a[aria-current="page"] {
  background: var(--warm);
  border-color: var(--warm);
  color: #fff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.highlight {
  color: var(--ink);
  display: block;
  text-decoration: none;
}

.highlight:hover {
  box-shadow: 0 14px 32px rgba(36, 47, 56, 0.08);
  transform: translateY(-1px);
}

#site-footer {
  background: #111a20;
  color: rgba(255, 255, 255, 0.78);
}

.footer-grid {
  align-items: start;
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 1fr) auto;
  padding-bottom: 2rem;
  padding-top: 2rem;
}

.footer-grid strong {
  color: #fff;
  display: block;
  font-size: 1.15rem;
  margin-bottom: 0.35rem;
}

.footer-grid p {
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: flex-end;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links a {
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: #fff;
  display: block;
  font-size: 0.86rem;
  font-weight: 700;
  padding: 0.55rem 0.8rem;
  text-decoration: none;
}

.footer-links a:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.45);
}

#copyright {
  background: rgba(0, 0, 0, 0.22);
}

.research-layout {
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.9fr);
}

.research-figure img {
  aspect-ratio: 1 / 1;
}

.research-list .program h2 {
  color: var(--accent-dark);
}

#titleBar .toggle:before {
  background: rgba(17, 26, 32, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
}

#titleBar .toggle:after {
  opacity: 0.86;
}

#navPanel {
  background: #101b21;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.08);
}

#navPanel .link {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.72);
  font-weight: 700;
  height: auto;
  letter-spacing: 0.03em;
  line-height: 1.2;
  padding: 1rem 1.2rem;
}

#navPanel .link:hover,
#navPanel .link:focus {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

#navPanel .link[href="index.html"],
#navPanel .link[href="research.html"],
#navPanel .link[href="teaching.html"],
#navPanel .link[href="outreach.html"] {
  color: #fff;
}

@media (max-width: 760px) {
  #nav > ul {
    display: none;
  }

  .footer-grid,
  .research-layout {
    grid-template-columns: 1fr;
  }

  .footer-links {
    justify-content: flex-start;
  }
}

/* Palette revision: deep detector blue with gold highlights. */
:root {
  --ink: #17212b;
  --muted: #596673;
  --paper: #ffffff;
  --soft: #eef4fa;
  --line: #d5e0ea;
  --accent: #2f6fa7;
  --accent-dark: #164b78;
  --warm: #d8a23a;
}

body {
  background:
    radial-gradient(circle at 12% 0%, rgba(47, 111, 167, 0.13), transparent 30rem),
    radial-gradient(circle at 90% 10%, rgba(216, 162, 58, 0.16), transparent 28rem),
    #f5f7fa;
}

#header {
  background:
    linear-gradient(90deg, rgba(10, 20, 35, 0.9), rgba(22, 75, 120, 0.7) 48%, rgba(10, 20, 35, 0.26)),
    url("../cms.png") center / cover;
  border-bottom-color: var(--warm);
}

#header:after {
  background: linear-gradient(90deg, #164b78, #63a7d8, var(--warm));
}

.site-kicker {
  color: #a8d8ff;
}

#nav > ul > li > a,
#nav > ul > li > span {
  border-color: rgba(47, 111, 167, 0.28);
}

#nav > ul > li > a:hover,
#nav li.active a,
#nav > ul > li > a[aria-current="page"] {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #fff;
}

.profile-photo {
  object-position: 68% 50%;
}

.badge {
  background: #eaf3fb;
  border-color: rgba(47, 111, 167, 0.22);
  color: var(--accent-dark);
}

.highlight strong,
.research-list .program h2 {
  color: var(--accent-dark);
}

.link-list a:hover {
  border-color: rgba(47, 111, 167, 0.45);
}

.course-status.current {
  background: #e9f3fb;
  color: #164b78;
}

.course-status.archived,
.archive-note {
  background: #fbf6e8;
  color: #73541b;
}

.archive-note {
  border-color: #ead9a9;
}

/* Hero readability and overflow fix. */
#header {
  background:
    linear-gradient(90deg, rgba(6, 14, 24, 0.94), rgba(14, 43, 72, 0.82) 48%, rgba(6, 14, 24, 0.58)),
    url("../cms.png") center / cover;
  text-align: left;
}

#header .container {
  max-width: 1120px;
  padding-left: 2rem;
  padding-right: 2rem;
}

#logo {
  max-width: 820px;
}

.site-kicker {
  color: #f3c85f;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.75);
}

#logo h1 a,
#logo h1 {
  font-size: clamp(2.6rem, 8vw, 5rem);
  overflow-wrap: anywhere;
}

.site-subtitle {
  color: rgba(255, 255, 255, 0.94);
  font-size: clamp(1.05rem, 2.5vw, 1.34rem);
  line-height: 1.45;
  max-width: 760px;
}

@media (max-width: 760px) {
  #header .container {
    padding-left: 1.2rem;
    padding-right: 1.2rem;
  }

  .site-kicker {
    font-size: 0.78rem;
    letter-spacing: 0.06em;
  }
}

/* Final hero kicker contrast override. */
#header #logo .site-kicker,
#header #logo span.site-kicker {
  background: rgba(255, 255, 255, 0.92) !important;
  border: 1px solid rgba(255, 255, 255, 0.75) !important;
  border-radius: 999px !important;
  color: #123f63 !important;
  display: inline-block !important;
  font-weight: 900 !important;
  letter-spacing: 0.08em !important;
  padding: 0.45rem 0.75rem !important;
  text-shadow: none !important;
}

#header #logo .site-subtitle {
  max-width: min(760px, calc(100vw - 4rem)) !important;
  overflow-wrap: normal !important;
  white-space: normal !important;
}

/* Tablet layout fix: avoid skinny columns at medium window sizes. */
@media (max-width: 1100px) {
  .page-shell,
  .identity-grid,
  .research-layout {
    grid-template-columns: 1fr !important;
  }

  .profile-card {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  }

  .profile-photo {
    height: 100%;
    margin-bottom: 0;
    min-height: 260px;
  }

  .logo-strip {
    grid-column: 2;
    margin-top: 0;
  }

  .highlight-grid {
    grid-template-columns: repeat(3, minmax(180px, 1fr)) !important;
  }

  .highlight {
    min-width: 0;
  }
}

@media (max-width: 860px) {
  .highlight-grid {
    grid-template-columns: 1fr !important;
  }

  .profile-card {
    display: block;
  }

  .profile-photo {
    height: auto;
    margin-bottom: 1.25rem;
    min-height: 0;
  }

  .logo-strip {
    margin-top: 1.25rem;
  }
}

.highlight-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)) !important;
}

/* Keep Teaching and Outreach aligned with the Research page composition. */
.program-list:before {
  content: none !important;
  display: none !important;
}

.course-list {
  margin-top: 1.25rem;
}

.research-layout .identity-image {
  align-self: start;
  position: sticky;
  top: 1.5rem;
}

.research-layout .identity-image img {
  min-height: 360px;
}

@media (max-width: 1100px) {
  .research-layout .identity-image {
    position: static;
  }

  .research-layout .identity-image img {
    min-height: 0;
  }
}

/* Visual-first page layout: image appears at the top when pages stack. */
.visual-first {
  grid-template-columns: minmax(300px, 0.9fr) minmax(0, 1fr);
}

.outreach-list {
  margin-top: 1.25rem;
}

.outreach-list .course-status {
  background: #e9f3fb;
  color: #164b78;
}

.outreach-figure img {
  object-position: center center;
}

@media (max-width: 1100px) {
  .visual-first .identity-image {
    order: -1;
  }
}

/* Use wide rectangular image panels on section pages. */
.research-layout .identity-image img,
.research-figure img,
.outreach-figure img {
  aspect-ratio: 16 / 10 !important;
  min-height: 0 !important;
  object-fit: cover;
}

.research-figure img[src="pinch.png"] {
  object-position: center center;
}

/* INFN footer branding. */
.footer-brand {
  align-items: center;
  display: flex;
  gap: 1rem;
}

.footer-brand img {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
  height: 74px;
  object-fit: contain;
  padding: 0.65rem;
  width: 132px;
}

@media (max-width: 640px) {
  .footer-brand {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* White transparent INFN footer mark. */
.footer-brand img {
  background: transparent !important;
  box-shadow: none !important;
  height: 70px;
  padding: 0 !important;
  width: 138px;
}

/* Research activity timeline. */
.timeline {
  display: grid;
  gap: 1rem;
  margin-top: 1.6rem;
  position: relative;
}

.timeline-section {
  background: #123f63;
  border-radius: 999px;
  color: #fff;
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  margin-top: 0.6rem;
  padding: 0.48rem 0.8rem;
  text-transform: uppercase;
  width: fit-content;
}

.timeline-item {
  background: #f6f9fc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.15rem;
}

.timeline-date {
  color: var(--accent-dark);
  font-size: 0.84rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
}

.timeline-item h3 {
  color: var(--ink);
  font-size: 1.22rem;
  font-weight: 900;
  line-height: 1.2;
  margin: 0 0 0.55rem;
}

.timeline-item p {
  color: var(--muted);
  margin: 0;
}

.timeline-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.timeline-links a {
  background: #fff;
  border: 1px solid rgba(47, 111, 167, 0.28);
  border-radius: 999px;
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0.45rem 0.65rem;
  text-decoration: none;
}

.timeline-links a:hover {
  border-color: var(--accent-dark);
  box-shadow: 0 8px 20px rgba(36, 47, 56, 0.08);
}

/* Outreach media cards. */
.outreach-card-list {
  display: grid;
  gap: 1rem;
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
}

.outreach-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  display: grid;
  gap: 1rem;
  grid-template-columns: 150px minmax(0, 1fr);
  min-height: 138px;
  overflow: hidden;
  text-decoration: none;
}

.outreach-card img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.outreach-card-body {
  display: grid;
  gap: 0.35rem;
  padding: 1rem 1rem 1rem 0;
}

.outreach-card-body strong {
  color: var(--accent-dark);
  font-size: 1.12rem;
  line-height: 1.2;
}

.outreach-card-body span {
  color: var(--muted);
}

.outreach-card-body em {
  color: var(--accent-dark);
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.outreach-card:hover {
  border-color: rgba(47, 111, 167, 0.45);
  box-shadow: 0 14px 32px rgba(36, 47, 56, 0.08);
  transform: translateY(-1px);
}

@media (max-width: 720px) {
  .outreach-card {
    grid-template-columns: 1fr;
  }

  .outreach-card img {
    aspect-ratio: 16 / 9;
    height: auto;
  }

  .outreach-card-body {
    padding: 0 1rem 1rem;
  }
}


/* Privacy page and cookie notice. */
.privacy-content {
  display: grid;
  gap: 1.25rem;
  padding-bottom: 3rem;
}

.privacy-content .content-block {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(47, 111, 167, 0.18);
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(36, 47, 56, 0.06);
  padding: clamp(1.1rem, 3vw, 1.7rem);
}

.privacy-content h2 {
  color: var(--accent-dark);
  margin: 0 0 0.55rem;
}

.cookie-banner {
  align-items: center;
  background: rgba(10, 24, 38, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  bottom: 1rem;
  box-shadow: 0 18px 42px rgba(10, 24, 38, 0.24);
  color: #fff;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  left: 50%;
  max-width: min(920px, calc(100vw - 2rem));
  padding: 0.9rem 1rem;
  position: fixed;
  transform: translateX(-50%);
  transition: opacity 180ms ease, transform 180ms ease;
  width: 100%;
  z-index: 10000;
}

.cookie-banner p {
  margin: 0;
}

.cookie-actions {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 0.65rem;
}

.cookie-actions a {
  color: #f7d06f;
  font-weight: 800;
  text-decoration: none;
}

.cookie-actions button {
  background: #f7d06f;
  border: 0;
  border-radius: 999px;
  color: #14202b;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  padding: 0.55rem 0.9rem;
}

.cookie-banner.is-hidden {
  opacity: 0;
  transform: translate(-50%, 0.4rem);
}

@media (max-width: 720px) {
  .cookie-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .cookie-actions {
    justify-content: space-between;
  }
}


/* ERNEST-inspired wider site rhythm. */
body {
  min-width: 0 !important;
}

.container,
#header .container,
#copyright .container {
  margin-left: auto !important;
  margin-right: auto !important;
  max-width: 1360px !important;
  padding-left: clamp(1.25rem, 4vw, 4rem) !important;
  padding-right: clamp(1.25rem, 4vw, 4rem) !important;
  width: 100% !important;
}

#header #logo {
  max-width: 980px !important;
}

#header #logo .site-subtitle {
  max-width: 920px !important;
}

.page-shell {
  grid-template-columns: minmax(260px, 0.55fr) minmax(0, 1.45fr);
}

.research-layout {
  gap: clamp(2rem, 4vw, 4rem);
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.8fr);
}

.visual-first {
  grid-template-columns: minmax(360px, 0.8fr) minmax(0, 1.25fr);
}

.content-panel {
  padding: clamp(1.5rem, 3vw, 3.4rem);
}

.footer-grid {
  gap: clamp(1.5rem, 4vw, 4rem);
}

@media (min-width: 1500px) {
  .container,
  #header .container,
  #copyright .container {
    max-width: 1440px !important;
  }
}

@media (max-width: 1100px) {
  .page-shell,
  .research-layout,
  .visual-first {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 640px) {
  .container,
  #header .container,
  #copyright .container {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
}


/* Contained ERNEST-style hero block instead of full-bleed header. */
#wrapper {
  overflow: visible !important;
}

#header {
  border: 1px solid rgba(213, 224, 234, 0.9) !important;
  border-radius: 0 0 14px 14px;
  box-shadow: 0 20px 52px rgba(23, 33, 43, 0.08);
  margin: 0 auto !important;
  max-width: 1360px !important;
  overflow: hidden;
  width: calc(100% - clamp(2rem, 8vw, 8rem)) !important;
}

#page {
  padding-top: 2.5rem;
}

@media (min-width: 1500px) {
  #header {
    max-width: 1440px !important;
  }
}

@media (max-width: 760px) {
  #header {
    border-left: 0 !important;
    border-radius: 0;
    border-right: 0 !important;
    width: 100% !important;
  }
}


/* Squared visual system: rectangular controls with lightly rounded corners. */
:root {
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
}

#nav {
  width: 100%;
}

#nav > ul {
  display: grid !important;
  gap: 0.7rem !important;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  width: 100%;
}

#nav > ul > li,
#nav > ul > li > a,
#nav > ul > li > span {
  width: 100%;
}

#nav > ul > li > a,
#nav > ul > li > span {
  align-items: center;
  border-radius: var(--radius-md) !important;
  display: flex;
  justify-content: center;
  min-height: 4.8rem;
  padding: 1rem 0.75rem !important;
  text-align: center;
}

.profile-card,
.content-panel,
.identity-image,
.identity-image img,
.highlight,
.link-list a,
.archive-note,
.timeline-item,
.outreach-card,
.privacy-content .content-block,
.cookie-banner {
  border-radius: var(--radius-lg) !important;
}

.footer-links a,
.course-status,
.timeline-links a,
.cookie-actions button,
#header #logo .site-kicker,
#header #logo span.site-kicker {
  border-radius: var(--radius-sm) !important;
}

#header {
  border-radius: 0 0 var(--radius-lg) var(--radius-lg) !important;
}

@media (max-width: 980px) {
  #nav > ul {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  #nav > ul {
    display: none !important;
  }

  #header {
    border-radius: 0 !important;
  }
}


/* Keep primary navigation as one horizontal row at every window width. */
#nav > ul {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  min-width: 0;
}

#nav > ul > li > a,
#nav > ul > li > span {
  font-size: clamp(0.68rem, 1.35vw, 1.35rem) !important;
  font-weight: 900 !important;
  line-height: 1.1;
  min-height: clamp(3.25rem, 8vw, 5.1rem);
  overflow: hidden;
  padding-left: 0.35rem !important;
  padding-right: 0.35rem !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 980px) {
  #nav > ul {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 760px) {
  #nav > ul {
    display: grid !important;
    gap: 0.35rem !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }

  #nav > ul > li > a,
  #nav > ul > li > span {
    font-size: clamp(0.54rem, 2.55vw, 0.82rem) !important;
    min-height: 2.7rem;
  }
}


/* Replace near-black bands with the site dark detector blue. */
.identity-image figcaption,
#site-footer {
  background: #164b78 !important;
}

#copyright {
  background: #123f63 !important;
}

#navPanel {
  background: #123f63 !important;
}

.cookie-banner {
  background: rgba(18, 63, 99, 0.96) !important;
}


/* Use the darker palette blue consistently on dark bands. */
.identity-image figcaption,
#site-footer,
#copyright,
#navPanel {
  background: #123f63 !important;
}

.cookie-banner {
  background: rgba(18, 63, 99, 0.96) !important;
}


/* Larger primary navigation labels. */
#nav > ul > li > a,
#nav > ul > li > span {
  font-size: clamp(0.9rem, 1.75vw, 1.75rem) !important;
  letter-spacing: 0 !important;
  min-height: clamp(3.6rem, 8vw, 5.4rem) !important;
}

@media (max-width: 760px) {
  #nav > ul > li > a,
  #nav > ul > li > span {
    font-size: clamp(0.62rem, 3vw, 0.95rem) !important;
    min-height: 3rem !important;
  }
}


/* Single soft-blue page background. */
html,
body {
  background: #eef4fa !important;
}


/* Remove old template white page strips. */
html,
body,
#wrapper,
#page,
#main,
.homepage #page {
  background: #eef4fa !important;
}


/* Keep homepage figure credit readable on dark blue. */
.identity-image figcaption a {
  color: #fff !important;
  font-weight: 700;
  text-decoration-color: rgba(255, 255, 255, 0.55);
}

.identity-image figcaption a:hover {
  text-decoration-color: #fff;
}


/* Inline privacy link in the footer credit. */
#copyright a.privacy-inline {
  color: #fff !important;
  font-weight: 700;
  text-decoration-color: rgba(255, 255, 255, 0.6);
}

#copyright a.privacy-inline:hover {
  text-decoration-color: #fff;
}


/* Subtle homepage figure credit link. */
.identity-image figcaption a {
  color: rgba(255, 255, 255, 0.78) !important;
  font-weight: 400 !important;
}


/* Subtle inline privacy footer link. */
#copyright a.privacy-inline {
  color: rgba(255, 255, 255, 0.7) !important;
  font-weight: 400 !important;
}


/* Show the full homepage profile photo without cropping. */
.profile-photo {
  aspect-ratio: auto !important;
  background: #eef4fa;
  height: auto !important;
  max-height: none !important;
  object-fit: contain !important;
}


/* Match inline privacy underline to figure credit links. */
#copyright a.privacy-inline {
  text-decoration: underline !important;
  text-decoration-color: rgba(255, 255, 255, 0.55) !important;
  text-underline-offset: 0.12em;
}


/* Homepage contact card: let the profile photo match the contact rows. */
.homepage .profile-card {
  align-items: stretch;
  display: grid;
  gap: 1.5rem 2rem;
  grid-template-columns: minmax(260px, 0.62fr) minmax(320px, 1fr);
}

.homepage .profile-photo {
  align-self: stretch;
  height: 100% !important;
  margin-bottom: 0 !important;
  object-fit: contain !important;
  width: 100%;
}

.homepage .contact-list {
  align-self: stretch;
}

.homepage .logo-strip {
  grid-column: 1 / -1;
  margin-top: 0;
}

@media (max-width: 860px) {
  .homepage .profile-card {
    display: block;
  }

  .homepage .profile-photo {
    height: auto !important;
    margin-bottom: 1.25rem !important;
  }
}


/* Homepage: sketch belongs with contact column; academic path ends with cards. */
.homepage .profile-card {
  display: block !important;
}

.homepage .profile-photo {
  height: auto !important;
  margin-bottom: 1.25rem !important;
}

.homepage .profile-card .identity-image {
  margin-top: 1.5rem;
}

.homepage .profile-card .identity-image img {
  aspect-ratio: auto !important;
  object-fit: contain !important;
}

.homepage .identity-grid {
  display: block !important;
}

.homepage .content-panel .highlight-grid {
  margin-bottom: 0;
}


/* Homepage academic panel: responsive text width and cards. */
.homepage .page-shell {
  align-items: start;
  grid-template-columns: minmax(300px, 0.72fr) minmax(0, 1.28fr) !important;
}

.homepage .content-panel {
  min-width: 0;
}

.homepage .content-panel .lead {
  max-width: none !important;
  width: 100%;
}

.homepage .content-panel .highlight-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)) !important;
}

@media (max-width: 1250px) {
  .homepage .page-shell {
    grid-template-columns: 1fr !important;
  }
}


/* Homepage academic panel: real selector for responsive layout. */
.home-shell {
  align-items: start;
  grid-template-columns: minmax(320px, 0.68fr) minmax(0, 1.32fr) !important;
}

.home-shell .content-panel {
  min-width: 0;
}

.home-shell .content-panel .lead {
  max-width: none !important;
  width: 100%;
}

.home-shell .identity-grid {
  display: block !important;
}

.home-shell .content-panel .highlight-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)) !important;
  margin-bottom: 0;
}

.home-shell .profile-card {
  display: block !important;
}

.home-shell .profile-photo {
  height: auto !important;
  margin-bottom: 1.25rem !important;
}

.home-shell .profile-card .identity-image {
  margin-top: 1.5rem;
}

.home-shell .profile-card .identity-image img {
  aspect-ratio: auto !important;
  object-fit: contain !important;
}

@media (max-width: 1250px) {
  .home-shell {
    grid-template-columns: 1fr !important;
  }
}
