@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* Industrial Medical Palette */
  --bg-primary: #ffffff;
  --bg-secondary: #f4f6f8; /* Crisp industrial gray */
  --bg-dark: #0a1128; /* Deep industrial navy */
  
  --surface-white: #ffffff;
  --surface-gray: #f1f5f9;
  --surface-dark: #121d3f;
  
  --text-primary: #0b132b;
  --text-secondary: #5a6b82;
  --text-light: #94a3b8;
  --text-inverse: #f8fafc;
  
  --accent-primary: #0077b6; /* Rich corporate medical blue */
  --accent-hover: #023e8a;
  --accent-light: #e0f2fe;
  --accent-teal: #00b4d8; /* Clinical Cyan */
  
  --border-light: #cbd5e1;
  --border-dark: #1e293b;
  
  /* Precision Layout & Utility */
  --radius-lg: 6px; /* Precise machined edge */
  --radius-md: 4px;
  --radius-sm: 2px;
  --container: min(1200px, 90vw);
  --ease: 250ms cubic-bezier(0.2, 0.8, 0.2, 1);
  
  /* Precision Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(11, 19, 43, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(11, 19, 43, 0.05), 0 2px 4px -2px rgba(11, 19, 43, 0.05);
  --shadow-lg: 0 10px 20px -3px rgba(11, 19, 43, 0.06), 0 4px 6px -4px rgba(11, 19, 43, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(11, 19, 43, 0.08), 0 8px 10px -6px rgba(11, 19, 43, 0.05);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--ease);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

h1, h2, h3, h4, p {
  margin: 0;
}

.container {
  width: var(--container);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  top: -999px;
  left: 1rem;
  z-index: 1000;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--bg-dark);
  color: var(--text-inverse);
  font-weight: 600;
  border: 1px solid var(--border-dark);
}

.skip-link:focus {
  top: 1rem;
}

/* Sections */
.section {
  padding: 6rem 0;
}

.section-bg-light {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.section-bg-dark {
  background-color: var(--bg-dark);
  color: var(--text-inverse);
}

.section-header {
  margin-bottom: 3.5rem;
  max-width: 700px;
}

.section-header.text-center {
  margin-inline: auto;
  text-align: center;
}

.section-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-primary);
  background: var(--surface-gray);
  border: 1px solid var(--border-light);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1.2rem;
}

.section-bg-dark .section-tag {
  background: rgba(37, 99, 235, 0.1);
  color: #60a5fa; /* Blue 400 */
  border-color: rgba(37, 99, 235, 0.3);
}

.section-title {
  font-size: clamp(2rem, 3vw, 2.75rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 1.125rem;
  line-height: 1.7;
}

.section-bg-dark .section-desc {
  color: var(--text-light);
}

/* Header & Nav */
.site-header {
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 100;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  transition: all var(--ease);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-teal) 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: white;
  stroke-width: 2.5;
}

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

.nav-links a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  position: relative;
}

.nav-links a:hover,
.nav-links a.active,
.nav-links a[aria-current="page"] {
  color: var(--accent-primary);
}

.nav-mobile-cta {
  display: none;
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--surface-white);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.menu-toggle span {
  width: 18px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 999px;
}

.menu-toggle:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  transition: all var(--ease);
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary {
  background-color: var(--accent-primary);
  color: white;
  border: 1px solid var(--accent-primary);
}

.btn-primary:hover {
  background-color: var(--surface-white);
  color: var(--accent-primary);
  box-shadow: 4px 4px 0px 0px var(--accent-primary);
  transform: translate(-3px, -3px);
}

.nav-cta[aria-current="page"] {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-primary);
  border-color: var(--border-light);
}

.btn-secondary:hover {
  border-color: var(--text-primary);
  background-color: var(--bg-secondary);
}

/* Hero Section */
.hero {
  padding: 6.5rem 0 6rem;
  background: radial-gradient(circle at top right, rgba(37, 99, 235, 0.05), transparent 40%),
              radial-gradient(circle at bottom left, rgba(8, 145, 178, 0.03), transparent 40%);
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-content h1 {
  font-size: clamp(2.5rem, 4.5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.hero-content h1 span {
  background: linear-gradient(to right, var(--accent-primary), var(--accent-teal));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-content p {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  max-width: 500px;
}

.hero-actions {
  display: flex;
  gap: 1rem;
}

.hero-visual {
  position: relative;
}

.hero-image-wrap {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(0,0,0,0.05);
}

.hero-image-wrap img {
  width: 100%;
  height: 500px;
  object-fit: cover;
  filter: contrast(1.05) saturate(1.1);
}

.hero-stats {
  position: absolute;
  bottom: -20px;
  left: -20px;
  background: white;
  padding: 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  display: flex;
  gap: 2rem;
}

.stat-item h4 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent-primary);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-item p {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Partners Band - Marquee */
.partners-marquee-wrapper {
  padding: 4rem 0;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-light);
  position: relative;
  overflow: hidden;
}

.partners-heading {
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2rem;
}

.marquee-glass {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: var(--radius-lg);
  padding: 1.5rem 0;
  box-shadow: var(--shadow-sm);
  /* Gradient masks to fade out edges smoothly */
  mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.marquee-content {
  display: flex;
  width: max-content;
  animation: marquee 30s linear infinite;
  gap: 5rem;
  padding-left: 5rem; /* Gap matched for seamless loop */
}

.marquee-content:hover {
  animation-play-state: paused;
}

.marquee-glass:hover .marquee-content {
  animation-play-state: paused;
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(calc(-50% - 2.5rem)); } /* Moves halfway including half gap */
}

.partner-logo {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  opacity: 0.55;
  filter: grayscale(100%);
  transition: all var(--ease);
  cursor: default;
}

.partner-logo:hover {
  opacity: 1;
  filter: grayscale(0%);
  color: var(--accent-primary);
  transform: scale(1.03);
  text-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.partner-logo svg {
  transition: all var(--ease);
}

.partner-logo:hover svg {
  stroke: var(--accent-primary);
  filter: drop-shadow(0 0 8px rgba(37, 99, 235, 0.3));
}

/* Research Areas */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 2rem;
}

.research-card {
  background: var(--surface-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  transition: all var(--ease);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.research-card-banner {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-bottom: 1px solid var(--border-light);
}

.research-card-body {
  padding: 2.5rem 2rem;
  flex: 1;
}

.research-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(to right, var(--accent-primary), var(--accent-teal));
  opacity: 0;
  transition: opacity var(--ease);
  z-index: 2;
}

.research-card:hover {
  transform: translate(-4px, -4px);
  box-shadow: 6px 6px 0px 0px var(--accent-primary);
  border-color: var(--accent-primary);
}

.research-card:hover::before {
  opacity: 1;
}

.value-card:hover {
  border-color: var(--accent-primary);
  transform: translate(-4px, -4px);
  box-shadow: 6px 6px 0px 0px var(--accent-primary);
}

.field-error {
  min-height: 1.1rem;
  margin-top: 0.4rem;
  font-size: 0.78rem;
  color: #b91c1c;
}

.form-control.input-error {
  border-color: #b91c1c;
  background: #fef2f2;
}

.form-status {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.form-status.error {
  color: #b91c1c;
}

.form-status.success {
  color: #0f766e;
}

.card-icon {
  width: 48px;
  height: 48px;
  background: var(--accent-light);
  color: var(--accent-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.card-icon svg {
  width: 24px; height: 24px;
  fill: none; stroke: currentColor; stroke-width: 2;
}

.research-card h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.research-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Publications */
.pub-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.pub-item {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem;
  background: var(--surface-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  transition: all var(--ease);
}

.pub-item:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-md);
}

.pub-year {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-primary);
  min-width: 60px;
}

.pub-content h4 {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.pub-authors {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.pub-journal {
  font-style: italic;
  font-size: 0.85rem;
  color: var(--text-light);
}

.pub-links {
  margin-top: 1rem;
  display: flex;
  gap: 1rem;
}

.pub-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

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

/* Team / Leadership */
.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 2rem;
}

.team-card {
  text-align: center;
}

.team-img {
  width: 100%;
  aspect-ratio: 1/1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1.25rem;
  background: var(--bg-secondary);
}

.team-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.2);
  transition: all var(--ease);
}

.team-card:hover .team-img img {
  filter: grayscale(0);
  transform: scale(1.05);
}

.team-card h4 {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.team-card p {
  color: var(--accent-primary);
  font-size: 0.85rem;
  font-weight: 500;
}

/* CTA */
.cta-box {
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-hover) 100%);
  border-radius: var(--radius-lg);
  padding: 4rem;
  text-align: center;
  color: white;
  position: relative;
  overflow: hidden;
}

.cta-box::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M54.627 0l.83.83-54.627 54.627-.83-.83L54.627 0zM0 54.627l.83.83-54.627 54.627-.83-.83L0 54.627z' fill='%23ffffff' fill-opacity='0.05' fill-rule='evenodd'/%3E%3C/svg%3E");
}

.cta-box h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  position: relative; z-index: 1;
}

.cta-box p {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 2rem;
  max-width: 600px;
  margin-inline: auto;
  position: relative; z-index: 1;
}

.cta-box .btn {
  background: white;
  color: var(--accent-primary);
  position: relative; z-index: 1;
}

.cta-box .btn:hover {
  background: var(--bg-secondary);
  transform: translateY(-2px);
}

/* Footer */
.site-footer {
  background: var(--bg-dark);
  color: var(--text-light);
  padding: 4rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 4rem;
  margin-bottom: 4rem;
}

.footer-brand .brand {
  color: white;
  margin-bottom: 1rem;
}

.footer-brand p {
  max-width: 300px;
  font-size: 0.9rem;
}

.footer-col h4 {
  color: white;
  font-size: 1rem;
  margin-bottom: 1.25rem;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links a {
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: white;
}

.copyright {
  border-top: 1px solid var(--border-dark);
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

/* Responsive & Mobile Optimization */
@media (max-width: 1024px) {
  /* Tablets and 'Desktop Site' Mobile */
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3rem;
  }
  .hero-content p {
    margin-inline: auto;
  }
  .hero-actions {
    justify-content: center;
    flex-wrap: wrap;
  }
  .hero-content h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
  }
  .hero-stats {
    position: relative;
    bottom: auto;
    left: auto;
    margin-top: 1.5rem;
    justify-content: center;
  }
  .hero-image-wrap img {
    height: 420px;
  }
  .nav {
    position: relative;
    justify-content: space-between;
    height: 72px;
  }
  .brand {
    font-size: 1.05rem;
  }
  .menu-toggle {
    display: flex;
  }
  .nav-cta {
    display: none;
  }
  .nav-links {
    position: absolute;
    top: calc(100% + 0.75rem);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    gap: 0.2rem;
    background: var(--surface-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    z-index: 101;
  }
  .nav-links.open {
    display: flex;
  }
  .nav-links a {
    font-size: 0.95rem;
    padding: 0.75rem 0.9rem;
    border-radius: var(--radius-sm);
  }
  .nav-links a:hover,
  .nav-links a.active,
  .nav-links a[aria-current="page"] {
    background: var(--bg-secondary);
  }
  .nav-mobile-cta {
    display: block;
    margin-top: 0.5rem;
    border-top: 1px solid var(--border-light);
    padding-top: 0.9rem;
    color: var(--accent-primary);
    font-weight: 700;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    text-align: center;
  }
  .footer-brand p {
    margin-inline: auto;
  }
}

@media (max-width: 768px) {
  /* Mobile Devices Portrait */
  .hero {
    padding: 3.75rem 0 2rem;
  }
  .brand {
    font-size: 1rem;
  }
  .hero-image-wrap img {
    height: 310px;
  }
  .hero-actions {
    flex-direction: column;
    gap: 0.75rem;
  }
  .hero-actions .btn {
    width: 100%;
  }
  .section {
    padding: 3.5rem 0;
  }
  .section-title {
    font-size: 1.85rem;
  }
  .grid-3 {
    gap: 1.25rem;
  }
  .research-card-banner {
    height: 150px;
  }
  .research-card-body {
    padding: 1.5rem 1.25rem;
  }
  .pub-item {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }
  .pub-year {
    font-size: 1rem;
  }
  .pub-links {
    flex-wrap: wrap;
    gap: 0.65rem;
  }
  /* Fix Marquee for Mobile */
  .marquee-glass {
    padding: 1rem 0;
  }
  .partner-logo {
    font-size: 1rem;
  }
  .hero-content p,
  .section-desc {
    font-size: 1rem;
    line-height: 1.6;
  }
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }
  .team-img {
    aspect-ratio: 4/5;
  }
  .team-card h4 {
    font-size: 1rem;
  }
  .team-card p {
    font-size: 0.8rem;
  }
  .cta-box {
    padding: 2.5rem 1.25rem;
  }
  .cta-box h2 {
    font-size: clamp(1.85rem, 8vw, 2.2rem);
    line-height: 1.15;
    overflow-wrap: anywhere;
  }
  .cta-box p {
    font-size: 1rem;
    max-width: 26ch;
  }
  /* Contact Form Mobile */
  #contact-form-grid {
    grid-template-columns: 1fr !important;
  }
  .copyright {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
}

@media (max-width: 520px) {
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 390px) {
  .cta-box h2 {
    font-size: 1.72rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  /* Keep partner marquee animated even when reduced-motion is enabled (user preference override). */
  .marquee-content {
    animation-name: marquee !important;
    animation-timing-function: linear !important;
    animation-duration: 30s !important;
    animation-iteration-count: infinite !important;
  }
  .marquee-content:hover {
    animation-play-state: paused !important;
  }
}
