/* 1. global colours and fonts
   ------------------ */
:root {
  /* 1. Define Font Bases */
  --font-serif-base: Spectral, serif;
  --font-sans-base: Rubik, sans-serif;
  --font-mono-base: "JetBrains Mono", Menlo, Monaco, Consolas, monospace;

  /* 2. Assign to Layout Roles */
  --font-head: var(--font-serif-base);
  --font-text: var(--font-sans-base);
  --font-subsec: var(--font-serif-base);
  --font-title: var(--font-serif-base);
  --font-link-box: var(--font-mono-base);

  /* Not sure what this does */
  /* Selection colors */
  --colour-selection-bg: hsl(214, 95%, 93%);
  --colour-selection-text: hsl(224, 64%, 33%);

  --colour-link-hover: rgb(0, 0, 255);

  /* colours */
  /* main page colours */
  --colour-background: hsl(0, 0%, 100%);
  --colour-background-mainpage: hsl(240, 5%, 96%);
  --colour-background-header: hsla(0, 0%, 100%, 0.95);
  --colour-text-general: hsl(240, 10%, 4%);

  /* menu colours */
  --colour-background-menu: hsla(36, 33%, 97%, 0.7);
  /* --colour-border-menu: hsla(32, 54%, 37%, 0.5); */
  --colour-border-menu: hsla(240, 6%, 10%, 0.75);
  --colour-link-menu: hsl(215, 19%, 35%);
  --colour-link-hover-menu: hsl(217, 33%, 17%);
  --colour-background-hover-menu: hsla(34, 62%, 61%, 0.2);
  --colour-link-active-menu: hsl(215, 50%, 23%);

  /* shadows */
  --colour-shadow1-header: hsla(204, 9%, 11%, 0.783);
  --colour-shadow2-header: hsla(228, 20%, 95%, 0.338);

  /* info-box */
  --colour-background-info-box: hsla(22, 33%, 94%, 0.6);
  --colour-border-info-box: hsl(0, 1%, 18%);
  --colour-title-info-box: hsl(204, 9%, 11%);
  /* shadows */
  --colour-shadow1: rgba(40, 40, 40, 0.4);
  --colour-shadow2: rgba(240, 239, 239, 0.6);
  --shadow-info-box1: -2px -2px 2px 1px var(--colour-shadow1);
  --shadow-info-box2: -1px -1px 2px 1px var(--colour-shadow2);
  --shadow-info-box1-hover: 2px 2px 2px 0px var(--colour-shadow1);
  --shadow-info-box2-hover: 1px 1px 5px 1px var(--colour-shadow2);

  /* Spacing Scale */
  --space-4: 1rem; /* 16px */

  /* side-photo */
  --photo-height: 400px;

  /* Radii */
  --radius-sm: 0.25rem; /* 4px */
  --radius-md: 0.375rem; /* 6px */
  --radius-lg: 0.5rem; /* 8px */
  --radius-xl: 0.75rem; /* 12px */
  --radius-xxl: 1rem; /* 16px */
  --radius-full: 9999px; /* Pill */

  /* Transitions & Shadows */
  --colour-mid2: rgba(0, 0, 0, 0.3);
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-mid: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-mid2: 0 2px 4px 0 var(--colour-mid2);
  --shadow-heavy: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
  --shadow-vheavy: 0 2px 3px 0 rgba(0, 0, 0, 0.7);

  --colour-shadow1-picture: rgba(40, 40, 40, 0.4);
  --colour-shadow2-picture: rgba(240, 239, 239, 0.6);

  /* horizontal  vertical selector 0=horizontal 1=vertical */
  --HV-selector: 1;

  /* button sizing */
  --button-radius-V: 16px; /* width and height */
  --button-top-offset-V: 1px;
  --button-left-offset-V: 1px;
  --button-icon-radius-V: 12px;
  --slider-height-V: 35px;
  --slider-width-V: 18px;
  --slider-icon-top-offset-V: 17px;
  --slider-icon-left-offset-V: 1px;
  --slider-icon-radius-V: 12px;
  --X-translate-V: 0;
  --Y-translate-V: 17;

  /* adjustable sizing */

  --button-radius-H: 32px; /* width and height */
  --button-top-offset-H: 2px;
  --button-left-offset-H: 2px;
  --button-icon-radius-H: 24px;
  --slider-height-H: 36px;
  --slider-width-H: 70px;
  --slider-icon-top-offset-H: 2px;
  --slider-icon-left-offset-H: 36px;
  --slider-icon-radius-H: 24px;
  --X-translate-H: 34;
  --Y-translate-H: 0;

  /* interpolation */
  --button-radius: calc(
    (1 - var(--HV-selector)) * var(--button-radius-V) + var(--HV-selector) *
      var(--button-radius-H)
  );
  --button-top-offset: calc(
    (1 - var(--HV-selector)) * var(--button-top-offset-V) + var(--HV-selector) *
      var(--button-top-offset-H)
  );
  --button-left-offset: calc(
    (1 - var(--HV-selector)) * var(--button-left-offset-V) +
      var(--HV-selector) * var(--button-left-offset-H)
  );
  --button-icon-radius: calc(
    (1 - var(--HV-selector)) * var(--button-icon-radius-V) +
      var(--HV-selector) * var(--button-icon-radius-H)
  );
  --slider-height: calc(
    (1 - var(--HV-selector)) * var(--slider-height-V) + var(--HV-selector) *
      var(--slider-height-H)
  );
  --slider-width: calc(
    (1 - var(--HV-selector)) * var(--slider-width-V) + var(--HV-selector) *
      var(--slider-width-H)
  );
  --slider-icon-top-offset: calc(
    (1 - var(--HV-selector)) * var(--slider-icon-top-offset-V) +
      var(--HV-selector) * var(--slider-icon-top-offset-H)
  );
  --slider-icon-left-offset: calc(
    (1 - var(--HV-selector)) * var(--slider-icon-left-offset-V) +
      var(--HV-selector) * var(--slider-icon-left-offset-H)
  );
  --slider-icon-radius: calc(
    (1 - var(--HV-selector)) * var(--slider-icon-radius-V) +
      var(--HV-selector) * var(--slider-icon-radius-H)
  );
  --X-translate: calc(
    (1 - var(--HV-selector)) * var(--X-translate-V) + var(--HV-selector) *
      var(--X-translate-H)
  );
  --Y-translate: calc(
    (1 - var(--HV-selector)) * var(--Y-translate-V) + var(--HV-selector) *
      var(--Y-translate-H)
  );
}

/* 2. Dark mode colours
----------*/
:root.dark {
  --colour-link-hover: rgb(0, 238, 255);
  /* Selection & Spacing */
  --colour-selection-bg: #1e3a8a;
  --colour-selection-text: #f8fafc;

  /* colours */
  --colour-background: #07090e;
  --colour-background-mainpage: #0b0f17;
  --colour-background-header: rgba(15, 23, 42, 0.75);
  --colour-text-general: hsl(214, 32%, 91%);
  --colour-border-subtle: rgba(255, 255, 255, 0.08);

  /* shadows */
  --colour-shadow1-header: hsla(220, 11%, 95%, 0.8);
  --colour-shadow2-header: hsla(189, 66%, 16%, 0.5);

  /* Navigation Bar Tokens */
  --colour-background-menu: rgba(15, 26, 44, 0.7);
  --colour-border-menu: rgba(147, 159, 164, 0.5);
  /* --colour-border-menu: rgba(217, 119, 6, 0.45); */
  --colour-link-menu: hsl(215, 20%, 65%);
  --colour-link-hover-menu: hsl(210, 40%, 98%);
  --colour-background-hover-menu: rgba(217, 119, 6, 0.15);
  --colour-link-active-menu: hsl(43, 96%, 56%);

  /* Category Indicator Dots */
  --colour-dot-preprint: #f59e0b;
  --colour-dot-published: #3b82f6;
  --colour-dot-preprint-ai: #ea580c;
  --colour-dot-published-ai: #6366f1;

  /* shadows */
  --colour-mid2: rgba(249, 249, 249, 0.3);
  --shadow-sm: 0 1px 2px 0 rgba(249, 249, 249, 0.1);
  --shadow-mid: 0 1px 2px 0 rgba(255, 255, 255, 0.3);
  --shadow-mid2: 0 2px 4px 0 var(--colour-mid2);
  --shadow-heavy: 0 1px 2px 0 rgba(255, 255, 255, 0.5);
  --shadow-vheavy: 0 2px 3px 0 rgba(251, 251, 251, 0.7);

  --colour-shadow1-picture: hsla(0, 0%, 93%, 0.4);
  --colour-shadow2-picture: hsla(226, 61%, 16%, 0.5);

  /* info-box */
  --colour-background-info-box: hsla(0, 0%, 0%, 0.8);
  --colour-border-info-box: hsla(0, 0%, 25%, 0.6);
  --colour-title-info-box: hsl(204, 9%, 11%);
  /* shadows */
  --colour-shadow1: hsla(0, 0%, 93%, 0.4);
  --colour-shadow2: hsla(226, 61%, 16%, 0.5);
  --shadow-info-box1: -2px -2px 2px 1px var(--colour-shadow1);
  --shadow-info-box2: -1px -1px 2px 1px var(--colour-shadow2);
  --shadow-info-box1-hover: 2px 2px 2px 1px var(--colour-shadow1);
  --shadow-info-box2-hover: 1px 1px 2px 1px var(--colour-shadow2);
}

/* 4. some global styles
 --------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0rem;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scrollbar-gutter: stable;
}

body {
  font-family: var(--font-text);
  background-color: var(--colour-background);
  color: var(--colour-text-general);
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: 0rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
::selection {
  background-color: var(--colour-selection-bg);
  color: var(--colour-selection-text);
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
h4 {
  font-size: inherit; /* Force them to inherit the parent box font size */
  font-weight: inherit; /* Force them to inherit the parent font thickness */
  margin: 0; /* Remove default spacing around headings */
  padding: 0;
}

button {
  font: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

/* 5. Header
------------- */
.academic-header {
  display: contents;
  position: static;
  top: 0;
  z-index: 30;
  /* max-width: 64rem;
  margin-left: auto;
  margin-right: auto; */
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  padding-top: 0.4rem;
  padding-bottom: 0.3rem;
  margin-top: 0.5rem;
  /* background-color: var(--colour-background-mainpage); */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  padding: 0.2rem 0.2rem;
  margin-top: 0.2rem;
  border-radius: var(--radius-xl);
  background-color: var(--colour-background-header);
  max-width: 64rem;
  margin-left: 0;
  margin-right: 0;
  justify-content: space-between;
  box-shadow:
    0px 0px 6px var(--colour-shadow1-header),
    0 0px 1px 1px var(--colour-shadow2-header);
  grid-column: 1 / -1;
}

.my-name {
  font-family: var(--font-head);
  /* font-weight: bold; */
  font-size: clamp(1.5rem, 1.5vw, 1.5rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--colour-text-general);
}

/* 5.1. light and dark mode selector button
------------------------- */

.button-container {
  display: flex;
}

/* slider */
.theme-toggle-track {
  top: 0.5px;
  position: relative;
  width: var(--slider-width);
  height: var(--slider-height);
  background-color: #cbd5e1;
  border-radius: var(--radius-full);
  cursor: pointer;
  /* border: 0 !important; /* Zero border to avoid altering box model */
  outline: none;
  transition:
    background-color 0.35s ease,
    box-shadow 0.35s ease;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
  margin: 0 auto;
  display: block;
  line-height: 0;
  font-size: 0;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.12);
}

/* button sittong position on slider */
.track-slot {
  position: absolute;
  left: var(--button-left-offset);
  width: var(--button-radius);
  height: var(--button-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  /* background-color: rgb(0, 0, 0); */
  z-index: 1;
  line-height: 0;
}

/* slider icon */
.track-icon {
  width: var(--slider-icon-radius);
  height: var(--slider-icon-radius);
  display: block;
  margin: auto;
  transition:
    opacity 0.35s ease,
    stroke 0.35s ease,
    transform 0.35s ease;
}

/* button icon */
.thumb-icon {
  width: var(--button-icon-radius);
  height: var(--button-icon-radius);
  display: block;
  margin: auto;
  position: absolute;
  transition:
    transform 0.4s ease,
    opacity 0.3s ease,
    stroke 0.35s ease;
}

/* button */
.theme-toggle-thumb {
  position: absolute;
  top: var(--button-top-offset);
  left: var(--button-left-offset);
  width: var(--button-radius);
  height: var(--button-radius);
  background-color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  /* box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2); */
  box-shadow:
    0px 0px 12px hsla(173, 70%, 33%, 0.572),
    /* 0px 0px 12px hsla(42, 53%, 50%, 0.45), */ 0 0px 1px 1px
      hsla(0, 100%, 0%, 0.45);
  z-index: 2;
  transform: translateY(0px) translateX(0px);
  transition:
    transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    background-color 0.35s ease,
    box-shadow 0.35s ease;
  will-change: transform;
  line-height: 0;
}

/* Dark Mode: translated button */
.dark .theme-toggle-thumb {
  /* transform: translateY(17px); */
  transform: translateY(calc(var(--Y-translate) * 1px))
    translateX(calc(var(--X-translate) * 1px));
  /* translateX(calc(var(--X-translate-V) * 1px)); */
  background-color: #0f172a;
  box-shadow:
    0px 0px 12px rgba(223, 47, 47, 0.49),
    0 0px 1px 1px rgba(255, 255, 255, 0.459);
}

/* Top Slot: top: 4px */
.track-slot.top-slot {
  top: var(--button-top-offset);
}

/* Bottom Slot: top: 40px (80 - 36 - 4 = 40) */
.track-slot.bottom-slot {
  top: var(--slider-icon-top-offset);
  left: var(--slider-icon-left-offset);
}

.horizontal.track-slot.top-slot {
  top: 0px;
  left: var(--button-left-offset);
}

/* Bottom Slot: top: 40px (80 - 36 - 4 = 40) */
.horizontal.track-slot.bottom-slot {
  top: 0px;
  left: var(--slider-icon-offset);
}

.dark .theme-toggle-track {
  background-color: #1e293b;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.5);
}

.theme-toggle-track:focus-visible {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.5);
}

/* Background Icon Opacity Logic */
.sun-track-icon {
  stroke: #d97706;
  opacity: 0; /* Covered by thumb in Light Mode */
  transform: scale(0.8);
}

.moon-track-icon {
  stroke: #64748b;
  opacity: 0.35; /* Faint Moon at bottom in Light Mode */
  transform: scale(1);
}

.dark .sun-track-icon {
  stroke: #94a3b8;
  opacity: 0.35; /* Faint Sun at top in Dark Mode */
  transform: scale(1);
}

.dark .moon-track-icon {
  stroke: #38bdf8;
  opacity: 0; /* Covered by thumb in Dark Mode */
  transform: scale(0.8);
}

.sun-thumb-icon {
  stroke: #f59e0b;
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.moon-thumb-icon {
  stroke: #38bdf8;
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}

.dark .sun-thumb-icon {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

.dark .moon-thumb-icon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* 6. navigation menu, main container and page sections
--------------- */

.site-wrap {
  background-color: var(--colour-background-mainpage);
  max-width: 64rem;
  margin-left: auto;
  margin-right: auto;
  display: grid;
  grid-template-columns: 1fr 300px;
  grid-template-rows: auto auto 1fr;
  padding: 0.1rem 1.5rem 2.5rem 1.5rem;
  gap: 0.5rem;
  align-items: start;
}

.page-container {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
  grid-column: 1;
  padding-top: 0.2rem;
}

/* menu box */
.menu-head {
  grid-column: 1;
  position: sticky;
  z-index: 10;
  width: 100%;
  background-color: var(--colour-background-menu);
  top: 0.2rem;
  border: 0.15rem solid var(--colour-border-menu);
  display: flex;
  padding: 0.2rem 0.2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  /* flex-direction: column; */
  /* align-items: center; */
}

/* navigation menu and links */
.page-nav {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 0.4rem;
  overflow-x: auto;
  -ms-overflow-style: none;
  /* justify-content: center; */
  scrollbar-width: none;
}

/* Update your existing link styles */
.page-nav-link {
  position: relative; /* CRUCIAL: Keeps the hidden text container bounded */
  display: inline-flex; /* Forces the link box to respect layout changes */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: clamp(0.5rem, 3vw, 0.7rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--colour-link-menu);
  padding: 0.5rem 0.5rem; /* Slightly increased horizontal padding for balance */
  margin: 0 0;
  transition: color var(--transition-fast);
  /* transition: var(--transition-fast); */

  white-space: nowrap;
  /* text-transform: lowercase; */
}

/* Adjust hover state padding so it matches the default link padding */
.page-nav-link.inactive:hover {
  color: var(--colour-link-hover-menu);
  margin: 0.2rem 0.2rem;
  padding: 0.3rem 0.3rem;
  border-radius: var(--radius-md);
  border-bottom: 1px outset var(--colour-link-active-menu);
  box-shadow: var(--shadow-mid);
  background-color: var(--colour-background-hover-menu);
}
.page-nav-link.inactive:active {
  padding: 0.4rem 0.4rem;
  margin: 0.1rem 0.1rem;
  border-bottom: 2px solid var(--colour-link-active-menu);
  box-shadow: var(--shadow-vheavy);
  /* transition:
    padding var(--transition-fast),
    margin var(--transition-fast); */
}

.page-nav-link.active:hover {
  /* Changes only the visible text to uppercase */
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-vheavy);
}

/* Make sure active hover doesn't change sizes either */
.page-nav-link.active {
  color: var(--colour-link-hover-menu);
  padding: 0.5rem 0.5rem;
  border-bottom: 2px solid var(--colour-link-active-menu);
  background-color: var(--colour-background-hover-menu);
  border-radius: var(--radius-md);
  text-transform: uppercase;
}

/* ADD THIS NEW RULE BELOW YOUR LINKS: The Invisible Space Anchor */
.page-nav-link::after {
  content: attr(data-text); /* Grabs the lowercase text value from HTML */
  text-transform: uppercase; /* Forces the math engine to measure it in UPPERCASE */
  font-weight: 600; /* Must match the font-weight of your links */
  height: 0; /* Collapses the element vertically so it doesn't push things down */
  visibility: hidden; /* Completely hides it from sight */
  overflow: hidden;
  user-select: none;
  pointer-events: none;
}

.lang-switcher {
  margin-left: auto;
}

/* .lang-link {
} */

.section-global {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  width: 100%;
}

/* 7. side picture settings
----------*/
.picture-positioning {
  top: 0.2rem;
  width: 300px;
  border-radius: 12px;
  grid-column: 2;
  grid-row: 2 / 4; /* Floats next to both the nav and the content box */
  position: sticky;
}

.picture-container {
  z-index: 1;
  background-color: transparent;
  width: 100%;
  height: var(--photo-height);
  perspective: 1000px; /* Gives 3D depth effect during flip */
  cursor: pointer;
}

.picture-front,
.picture-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 12px;
  overflow: hidden;
}

.picture-front img,
.picture-back img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* display: block; */
  /* backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden; */
}

.picture-flip {
  z-index: 1;
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
  border-radius: 12px;
  box-shadow:
    -2px -2px 2px 1px var(--colour-shadow1-picture),
    -1px -1px 1px 1px var(--colour-shadow2-picture);
}

.picture-container.flipped .picture-flip {
  transform: rotateY(180deg);
}

.picture-back {
  transform: rotateY(180deg);
}

.picture-img {
  width: 300px;
}

/* 8. info box: its own aside under the photo (desktop), inline copy on mobile */
.info-aside {
  grid-column: 2;
  grid-row: 2 / 4; /* same cell as the photo */
  align-self: start;
  position: sticky;
  width: 300px;
  margin-top: calc(var(--photo-height) + 0.75rem); /* starts below the photo */
  top: calc(
    0.2rem + var(--photo-height) + 0.75rem
  ); /* sticks below the photo */
}

.info-box {
  padding: 0.5rem 0.5rem;
  font-size: clamp(0.9rem, 0.9vw, 0.9rem);
  background-color: var(--colour-background-info-box);
  border: 0.15rem solid var(--colour-border-info-box);
  box-shadow: var(--shadow-info-box1), var(--shadow-info-box2);
  border-radius: var(--radius-xl);
}

.info-box a:hover {
  color: var(--colour-link-hover);
}

.info-box:hover {
  box-shadow: var(--shadow-info-box1-hover), var(--shadow-info-box2-hover);
}
.info-box.info-title {
  color: var(--colour-title);
}

.info-title {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.info-list dt {
  font-weight: 600;
  margin-top: 0rem;
}
.info-list dd {
  overflow-wrap: anywhere;
}
.info-list a {
  text-decoration: underline;
}

.info-box-row {
}

.info-title {
  /* display: none; */
}

.info-box--inline {
  display: none;
  background-color: var(--colour-background-info-box);
  border: 0.15rem solid var(--colour-border-info-box);
  box-shadow: var(--shadow-info-box1), var(--shadow-info-box2);
  margin-bottom: 0rem;
  border-radius: var(--radius-xl);
} /* the mobile copy is hidden on desktop */

.info-box--inline:hover {
  box-shadow: var(--shadow-info-box1-hover), var(--shadow-info-box2-hover);
}

/* email reveal */
.reveal-email {
  background: hsla(0, 0%, 61%, 0.4);
  /* border: none; */
  padding: 0rem 0.1rem;
  margin-left: 8px;
  font: inherit;
  color: inherit;
  font-weight: 600;
  /* text-decoration: underline; */
  cursor: pointer;
  border: 2px solid hsl(0, 0%, 73%);
  box-shadow: 2px 2px 2px 0 var(--colour-mid2);
}

.reveal-email:hover {
  /* opacity: 0.8; */
  background: hsla(0, 0%, 61%, 0.3);
  border: 2px solid hsla(0, 0%, 73%, 0.6);
  box-shadow: 1px 1px 2px 0 var(--colour-mid2);
}

.reveal-email:active {
  margin-top: 1px;
  margin-left: 9px;
  box-shadow: 0px 0px 1px 0 var(--colour-mid2);
}

/* last updated footer */
.site-footer {
  /* grid-column: 1 / -1; */
  /* text-align: right; */
  display: flex;
  justify-content: space-between;
  padding-top: 1rem;
  font-size: 0.8rem;
  opacity: 0.75;
  width: 95%;
  font-family: var(--font-link-box);
}

.last-updated {
  /* margin-left: auto; */
}

.visitor-counter {
}

/* 3. mobile view fixes
----------*/
@media (max-width: 620px) {
  body {
    padding-bottom: 1rem;
  }
  .academic-header {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    padding-top: 0.4rem;
    padding-bottom: 0.3rem;
  }

  .header-inner {
    display: flex;
    justify-content: space-between; /* Name on left, buttons on right */
    align-items: center;
    margin-top: 0.2rem;
    width: 100%;
    order: -4;
  }
  .site-wrap {
    padding: 0.1rem 0.5rem 0.5rem;
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 0.2rem;
    position: -webkit-sticky;
    position: sticky;
    z-index: 100;
  }

  .page-container {
    display: contents;
    gap: 0.2rem;
    order: -1;
  }
  .menu-head {
    justify-content: center;
    align-items: center;
    order: -3;
  }
  .page-nav {
    justify-content: center;
    gap: 0.2rem;
  }

  .picture-flip {
    height: 250px;
    border-radius: 12px;
    box-shadow:
      -2px -2px 2px 1px var(--colour-shadow1-picture),
      -1px -1px 1px 1px var(--colour-shadow2-picture);
  }
  .picture-positioning {
    height: 240px;
    width: 100%;
    position: static; /* Disable sticky behavior on small screens */
    overflow: hidden;
    border-radius: 12px;
    order: -2; /* Ensure it appears after the menu */
    box-shadow:
      -2px -2px 2px 1px var(--colour-shadow1-picture),
      -1px -1px 1px 1px var(--colour-shadow2-picture);
  }
  .picture-img {
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
  }

  .picture-container {
    height: 340px;
  }

  .section-global {
    order: 10;
  }

  .info-aside {
    display: none;
  }

  .info-box--inline {
    display: block;
    width: 100%;
    margin: 0.4rem 0 1rem;
  }

  .site-footer {
    order: 20;
    align-self: flex-end;
  } /* after .section-global (order 10) */
}
