

:root {
  --rgb-primary-color: 0, 95, 113;
  --rgb-bg-color: 241, 243, 245;
  --bg-color: #f1f3f5;
  --text-color: #212529;
  --primary-color: #005f73;
  --secondary-color: #e9ecef;
  --accent-color: #0a9396;
  --card-bg: #ffffff;
  --border-color: #dee2e6;
  --link-color: #005f73;
  --link-hover-color: #0a9396;
  --nav-bg-scrolled: #ffffff;
  --nav-border-scrolled: rgba(0, 0, 0, 0.1);
  --nav-shadow-scrolled: 0 4px 15px rgba(0, 0, 0, 0.05);
  --hero-text: #ffffff;
  --hero-subtext: #eeeeee;
  --icon-color: #495057;
  --icon-hover-bg: #dee2e6;
  --footer-bg: #e9ecef;
  --mobile-menu-bg: #ffffff;
  --rgb-overlay-color: 0, 0, 0;
  --overlay-opacity: 0.4;
  --font-primary: 'Montserrat', sans-serif;
  --font-secondary: 'Lato', sans-serif;
}



body.dark-mode {
  --rgb-primary-color: 148, 210, 189;
  --rgb-bg-color: 18, 18, 18;
  --bg-color: #121212;
  --text-color: #e0e0e0;
  --primary-color: #94d2bd;
  --secondary-color: #1e1e1e;
  --accent-color: #ade8f4;
  --card-bg: #2c2c2c;
  --border-color: #444;
  --link-color: #94d2bd;
  --link-hover-color: #ade8f4;
  --nav-bg-scrolled: #2c2c2c;
  --nav-border-scrolled: rgba(255, 255, 255, 0.15);
  --nav-shadow-scrolled: 0 4px 15px rgba(0, 0, 0, 0.2);
  --hero-text: #ffffff;
  --hero-subtext: #e0e0e0;
  --icon-color: #b0b0b0;
  --icon-hover-bg: #3a3a3a;
  --footer-bg: #1e1e1e;
  --mobile-menu-bg: #2c2c2c;
  --rgb-overlay-color: 0, 0, 0;
  --overlay-opacity: 0.5;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-secondary);
  line-height: 1.7;
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: background-color 0.3s ease, color 0.3s ease;
  font-size: 16px;

}


body.mobile-nav-open {
  overflow: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-primary);
  color: var(--primary-color);
  margin-bottom: 1rem;
  line-height: 1.3;
}

h1 { font-size: 2.8rem; }
h2 { font-size: 2.2rem; margin-bottom: 2rem; text-align: center; }
h3 { font-size: 1.4rem; color: var(--text-color); margin-bottom: 0.5rem; }

p { margin-bottom: 1rem; }
a { color: var(--link-color); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--link-hover-color); }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

a[href="https://www.kcl.ac.uk/bhi"] { color: #7db48d; }
a[href="https://phidatalab.org/about-us/"] { color: #7db48d; }

#main-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 0.5rem 5%;
  transition: background-color 0.3s ease, box-shadow 0.3s ease, padding 0.3s ease;
}

#main-header.scrolled nav {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--nav-border-scrolled);
  border-radius: 50px;
  background-color: var(--nav-bg-scrolled);
  box-shadow: var(--nav-shadow-scrolled);
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  transition: background-color 0.3s ease, border 0.3s ease, padding 0.3s ease;
}

#main-header:not(.scrolled) nav {
  background-color: transparent;
  box-shadow: none;
}

#main-header:not(.scrolled) .nav-links a {
  color: #fff;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

#main-header:not(.scrolled) .logo {
  color: #fff;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

#main-header:not(.scrolled) #theme-toggle {
  color: #fff;
}

nav {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.5rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.3s ease, box-shadow 0.3s ease, border-radius 0.3s ease, border 0.3s ease, padding 0.3s ease, margin 0.3s ease;
  position: relative;
}

.logo-link { text-decoration: none; }

.logo {
  display: flex;
  align-items: center;
  font-family: var(--font-primary);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary-color);
  transition: color 0.3s ease;
}

.logo i { margin-right: 0.5rem; font-size: 1.5rem; }

.svg-logo svg {
  height: 35px;
  width: auto;
  vertical-align: middle;
}

.svg-logo .svg-primary {
  stroke: var(--primary-color);
  fill: var(--primary-color);
  transition: stroke 0.3s ease, fill 0.3s ease;
}

.svg-logo .svg-accent {
  stroke: var(--accent-color);
  fill: var(--accent-color);
  transition: stroke 0.3s ease, fill 0.3s ease;
}

.svg-logo .svg-text {
  fill: var(--primary-color);
  font-family: var(--font-primary);
  transition: fill 0.3s ease;
}

body.dark-mode .svg-logo .svg-primary,
body.dark-mode .svg-logo .svg-text {
  stroke: var(--primary-color);
  fill: var(--primary-color);
}

body.dark-mode .svg-logo .svg-accent {
  stroke: var(--accent-color);
  fill: var(--accent-color);
}

#main-header:not(.scrolled) .svg-logo .svg-primary,
#main-header:not(.scrolled) .svg-logo .svg-text,
#main-header:not(.scrolled) .svg-logo .svg-accent {
  stroke: var(--primary-color);
  fill: var(--primary-color);
}

.nav-right-group {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  font-family: var(--font-primary);
  font-weight: 600;
  color: var(--text-color);
  padding: 0.5rem 0;
  position: relative;
  transition: color 0.3s ease;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--accent-color);
  transition: width 0.3s ease;
}

.nav-links a:hover::after { width: 100%; }

#theme-toggle {
  display: none !important;
}

#mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--icon-color);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1001;
}

#main-header:not(.scrolled) #mobile-menu-toggle {
  color: #706d6d;
}

#hero {
  height: 100vh;
  position: relative;
  text-align: center;
  overflow: hidden;
  width: 100%;
  padding: 0;
  box-sizing: border-box;
}

.hero-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  background-image: url('images/background-logo.png');
  background-size: contain;
  background-position: center top;
  background-repeat: no-repeat;
  opacity: 1;
  transition: opacity 0.5s ease-out;
  pointer-events: none;
}

.hero-background::before {
  content: '';
  position: absolute;
  inset: 0;
  background-color: rgba(var(--rgb-overlay-color), var(--overlay-opacity));
  z-index: 0;
  transition: background-color 0.3s ease;
}

.hero-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 1000px;
  z-index: 1;
  text-align: center;
}

.hero-content h1 {
  font-size: 2.8rem;
  color: var(--hero-text);
  margin-bottom: 1rem;
  font-weight: 700;
}

.hero-content p {
  font-size: 1.2rem;
  color: var(--hero-subtext);
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.hero-button {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: inline-block;
  background-color: var(--accent-color);
  color: #fff;
  padding: 0.8rem 1.8rem;
  border-radius: 50px;
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-shadow: none;
  transition: background-color 0.2s ease, transform 0.2s ease;
  border: 2px solid transparent;
  z-index: 1;
  margin-top: 28vh;
}

.hero-button:hover {
  background-color: var(--link-hover-color);
  color: #fff;
  transform: translateX(-50%) translateY(-2px);
}

main section {
  padding: 6rem 5%;
  background-color: var(--bg-color);
  position: relative;
  z-index: 2;
  transition: background-color 0.3s ease;
}

#hero + section { padding-top: 6rem; }
main section:last-of-type { padding-bottom: 6rem; }

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.team-member-card {
  background-color: var(--card-bg);
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.team-member-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
}

.team-member-card img {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  margin: 0 auto 1rem auto;
  object-fit: cover;
  border: 3px solid var(--secondary-color);
}

.team-member-card img[alt="Dr. Logan Ellis"] {
  object-position: .1% center;
}

.team-member-card .position {
  font-size: 0.9rem;
  color: var(--primary-color);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.team-member-card .bio {
  font-size: 0.9rem;
  margin-bottom: 1rem;
  color: var(--text-color);
  opacity: 0.8;
}

.social-links a {
  color: var(--icon-color);
  margin: 0 0.5rem;
  font-size: 1.2rem;
  transition: color 0.2s ease;
}

.social-links a:hover {
  color: var(--accent-color);
}


.projects-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;
  align-items: stretch;
}

.project-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.project-image {
  width: calc(100% - 2rem);
  height: 180px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
  margin: 1rem auto 0 auto;
  padding: 0.5rem;
  border: 3px solid rgba(11, 114, 133, 0.35);
  border-radius: 12px;
  background: #ffffff;
  box-shadow:
    0 1px 2px rgba(11, 114, 133, 0.08),
    0 8px 20px rgba(11, 114, 133, 0.10);
}

.project-image--architecture {
  height: 240px;
}

.project-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
}

.project-title {
  margin: 0 0 0.85rem 0;
  font-size: 1.35rem;
  line-height: 1.3;
  color: #0b7285;
}

.project-title a {
  color: #0b7285;
  text-decoration: none;
}

.project-title a:hover {
  color: #0b7285;
  text-decoration: underline;
}

.project-text {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.75;
  color: #2f3b45;
  text-align: justify;
}

.project-footer {
  margin-top: auto;
  background: #eef3f5;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  padding: 1rem 1.25rem;
  text-align: center;
  flex-shrink: 0;
}

.project-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  color: #0b7285;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.95rem;
}

.project-link:hover {
  text-decoration: underline;
}

#publications .publication-intro {
  font-size: 1rem;
  color: var(--primary-color);
  opacity: 0.9;
  text-align: center;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 2rem;
}

.contact-info p { margin-bottom: 0.5rem; font-size: 1rem; }
.contact-info i { margin-right: 0.7rem; color: var(--primary-color); width: 20px; text-align: center; }

footer {
  background-color: var(--footer-bg);
  color: var(--text-color);
  text-align: center;
  padding: 1.5rem;
  font-size: 0.9rem;
  border-top: 1px solid var(--border-color);
  transition: background-color 0.3s ease, color 0.3s ease;
}


#publications-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

.publication-item {
  width: 100%;
  padding: 1.25rem 1.5rem;
  border: 1px solid #ddd;
  border-radius: 10px;
  background: #fff;
  color: var(--text-color);
  opacity: 1;
  text-align: left;
  margin: 0;
}

.publication-item h3 {
  font-size: 1rem;
  line-height: 1.35;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.publication-item p {
  margin-bottom: 0.55rem;
  color: var(--text-color);
}

.publication-item a {
  color: var(--link-color);
  font-weight: 600;
}

/* TIMELY-Agent project page */
.timely-page {
  overflow-x: hidden;
}

.timely-page #main-header:not(.scrolled) .svg-logo .svg-primary,
.timely-page #main-header:not(.scrolled) .svg-logo .svg-text,
.timely-page #main-header:not(.scrolled) .svg-logo .svg-accent {
  stroke: var(--hero-text);
  fill: var(--hero-text);
}

.timely-page #main-header:not(.scrolled) #mobile-menu-toggle {
  color: var(--hero-text);
}

#timely-hero {
  min-height: 560px;
  padding: 8rem 5% 5rem;
  display: flex;
  align-items: center;
  background-color: var(--primary-color);
}

.timely-hero-content {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

.timely-hero-content > div {
  max-width: 850px;
}

.timely-hero-content h1 {
  color: var(--hero-text);
  font-size: 3.5rem;
  margin-bottom: 1.25rem;
}

.timely-eyebrow {
  color: var(--hero-subtext);
  font-family: var(--font-primary);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}

.timely-hero-content .timely-lead {
  max-width: 680px;
  color: var(--hero-subtext);
  font-size: 1.25rem;
  line-height: 1.7;
  margin-bottom: 0;
  text-align: left;
}

.timely-content {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  text-align: left;
}

.timely-content > h2 {
  text-align: left;
}

.timely-content > p {
  max-width: 820px;
}

.timely-lead {
  font-size: 1.15rem;
  line-height: 1.8;
}

#experience {
  background-color: var(--secondary-color);
  scroll-margin-top: 6.5rem;
}

.timely-showcase-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2rem;
  align-items: end;
  margin-bottom: 2.5rem;
}

.timely-showcase-intro h2 {
  margin-bottom: 1rem;
  text-align: left;
}

.timely-showcase-intro p:not(.timely-section-kicker) {
  max-width: 760px;
  margin-bottom: 0;
}

.timely-section-kicker {
  color: var(--primary-color);
  font-family: var(--font-primary);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  margin-bottom: 0.65rem;
  text-transform: uppercase;
}

.timely-website-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 48px;
  padding: 0.8rem 1.35rem;
  background-color: var(--primary-color);
  border-radius: 50px;
  color: var(--hero-text);
  font-family: var(--font-primary);
  font-weight: 600;
  white-space: nowrap;
}

.timely-website-link:hover {
  color: var(--hero-text);
  transform: translateY(-2px);
}

.timely-video-card {
  margin: 0 0 2.5rem;
  overflow: hidden;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  box-shadow: 0 20px 46px rgba(var(--rgb-overlay-color), 0.14);
}

.timely-demo-video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  background-color: #0d2d45;
}

.timely-demo-video::cue {
  color: #ffffff;
  background-color: rgba(4, 31, 45, 0.88);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1rem;
  line-height: 1.35;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}

.timely-video-card figcaption {
  padding: 1rem 1.25rem 1.15rem;
  color: var(--text-color);
  font-size: 0.92rem;
  line-height: 1.55;
}

.timely-gallery-heading {
  margin: 0 0 1.25rem;
  color: var(--primary-color);
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  text-align: left;
}

.timely-product-showcase {
  display: grid;
  gap: 2rem;
}

.timely-product-shot {
  margin: 0;
  overflow: hidden;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(var(--rgb-overlay-color), 0.10);
}

.timely-product-shot img {
  width: 100%;
  height: auto;
  display: block;
  background-color: #f8f9fa;
}

.timely-product-shot figcaption {
  padding: 1rem 1.25rem 1.15rem;
  color: var(--text-color);
  font-size: 0.92rem;
  line-height: 1.55;
}

.timely-demo-note {
  margin: 1.5rem 0 0;
  color: var(--primary-color);
  font-family: var(--font-primary);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.timely-workflow-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem;
}

.timely-workflow-card {
  min-width: 0;
  padding: 1.5rem;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(var(--rgb-overlay-color), 0.06);
}

.timely-workflow-card h3 {
  color: var(--primary-color);
  font-size: 1.2rem;
}

.timely-workflow-card p {
  margin-bottom: 0;
  text-align: left;
}

.privacy-boundary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 1.25rem;
  align-items: stretch;
  margin: 2.5rem 0;
}

.privacy-panel {
  padding: 1.75rem;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 10px;
}

.privacy-panel h3 {
  color: var(--primary-color);
}

.privacy-panel p {
  margin-bottom: 0;
}

.privacy-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  max-width: 140px;
  color: var(--primary-color);
  font-family: var(--font-primary);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}

.privacy-arrow i {
  font-size: 1.5rem;
}

.timely-contact p {
  font-size: 1.1rem;
}

.timely-contact .project-link {
  padding: 0.8rem 1.8rem;
  background-color: var(--primary-color);
  color: var(--hero-text);
  border-radius: 50px;
  font-family: var(--font-primary);
  font-weight: 600;
  margin-top: 0.5rem;
}

.timely-contact .project-link:hover {
  color: var(--hero-text);
  transform: translateY(-2px);
}

.timely-resource-note {
  margin-top: 2rem;
  padding: 1rem 1.25rem;
  color: var(--primary-color);
  background-color: var(--secondary-color);
  border-left: 4px solid var(--accent-color);
  border-radius: 0 8px 8px 0;
  font-weight: 600;
}

@media (max-width: 1100px) and (min-width: 769px) {
  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 768px) {
  #main-header {
    padding: 0.5rem 3%;
  }

  #main-header nav,
  #main-header.scrolled nav {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  #mobile-menu-toggle {
    display: block;
  }

  .logo-link,
  #mobile-menu-toggle {
    position: relative;
    z-index: 1002;
  }

  .nav-right-group {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 5.5rem 5% 2rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    background-color: var(--mobile-menu-bg);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 8px 20px rgba(var(--rgb-overlay-color), 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-100%);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  }

  body.mobile-nav-open .nav-right-group {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .nav-links {
    flex-direction: column;
    gap: 0.25rem;
  }

  .nav-links a {
    display: block;
    padding: 0.75rem 0;
  }

  #main-header:not(.scrolled) .nav-right-group .nav-links a {
    color: var(--text-color);
    text-shadow: none;
  }

  body.mobile-nav-open.timely-page #main-header:not(.scrolled) .svg-logo .svg-primary,
  body.mobile-nav-open.timely-page #main-header:not(.scrolled) .svg-logo .svg-text,
  body.mobile-nav-open.timely-page #main-header:not(.scrolled) .svg-logo .svg-accent {
    stroke: var(--primary-color);
    fill: var(--primary-color);
  }

  body.mobile-nav-open.timely-page #main-header:not(.scrolled) #mobile-menu-toggle {
    color: var(--text-color);
  }

  main section {
    padding: 4.5rem 6%;
  }

  #timely-hero {
    min-height: 0;
    padding: 8rem 6% 4.5rem;
  }

  .timely-hero-content h1 {
    font-size: 2.5rem;
  }

  .timely-hero-content .timely-lead {
    font-size: 1.05rem;
  }

  .timely-showcase-intro {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }

  .timely-website-link {
    justify-self: start;
    white-space: normal;
  }

  .timely-product-showcase {
    gap: 1.25rem;
  }

  .timely-product-shot {
    border-radius: 12px;
  }

  .timely-video-card {
    margin-bottom: 2rem;
    border-radius: 12px;
  }

  h2 {
    font-size: 1.8rem;
  }

  .projects-grid,
  .timely-workflow-grid,
  .privacy-boundary {
    grid-template-columns: minmax(0, 1fr);
  }

  .privacy-arrow {
    max-width: none;
    padding: 0.25rem 0;
  }

  .privacy-arrow i {
    transform: rotate(90deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
