/* ============================================================
   IOL Intro Page — Styles
   Matches main site: JetBrains Mono, #013858 primary
   ============================================================ */

/* --- Fonts (shared with main site) --- */
@font-face {
  font-family: 'JetBrains Mono';
  font-weight: 400;
  font-style: normal;
  src: url('../assets/fonts/JetBrains_Mono/static/JetBrainsMono-Regular.ttf') format('truetype');
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-weight: 400;
  font-style: italic;
  src: url('../assets/fonts/JetBrains_Mono/static/JetBrainsMono-Italic.ttf') format('truetype');
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-weight: 600;
  font-style: normal;
  src: url('../assets/fonts/JetBrains_Mono/static/JetBrainsMono-SemiBold.ttf') format('truetype');
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-weight: 700;
  font-style: normal;
  src: url('../assets/fonts/JetBrains_Mono/static/JetBrainsMono-Bold.ttf') format('truetype');
  font-display: swap;
}

/* --- Design Tokens --- */
:root {
  --color-brand: #013858;
  --color-brand-light: #3a6f8f;
  --color-brand-dark: #012a42;
  --color-hero-bg: #011e2e;
  --color-hero-text: #e8eef2;
  --color-text: #666666;
  --color-heading: #013858;
  --color-bg: #fdfdfd;
  --color-bg-alt: #f4f6f8;
  --color-meta: #999999;
  --color-border: #e0e0e0;
  --font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --container-width: 1000px;
  --section-padding: 100px 0;
  --section-padding-mobile: 60px 0;
  --spacing: 30px;
}

/* --- Reset --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  font-size: 14px;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--color-text);
  text-decoration: none;
  transition: color 0.3s ease, opacity 0.3s ease;
}
a:hover {
  color: var(--color-brand);
  opacity: 0.8;
}

/* --- Container --- */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--spacing);
}

/* --- Section Base --- */
.section {
  padding: var(--section-padding);
  background: var(--color-bg);
}

/* Auto-alternate backgrounds (skip hero which is dark) */
.section:not(.section--hero):nth-of-type(odd) {
  background: var(--color-bg-alt);
}

.section__heading {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 600;
  margin-bottom: 0.4em;
  color: var(--color-heading);
}

.section__intro {
  font-size: 0.85rem;
  color: var(--color-meta);
  margin-bottom: 2.5rem;
  max-width: 600px;
}

/* ============================================================
   Section 1: Hero
   ============================================================ */
.section--hero {
  height: 100vh;
  min-height: 550px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--color-hero-bg);
  color: var(--color-hero-text);
  padding: 40px 0;
  position: relative;
}

.hero__logo {
  width: 90px;
  height: auto;
  margin-bottom: 2rem;
  filter: brightness(0) invert(1);
}

.hero__tagline {
  font-size: clamp(1.4rem, 3.5vw, 2.4rem);
  font-weight: 700;
  line-height: 1.35;
  max-width: 750px;
  margin: 0 auto 1rem;
}

.hero__subtitle {
  font-size: clamp(0.85rem, 1.8vw, 1.1rem);
  font-weight: 400;
  opacity: 0.8;
  letter-spacing: 0.03em;
}

.hero__affiliations {
  font-size: 0.75rem;
  opacity: 0.45;
  margin-top: 0.8rem;
  letter-spacing: 0.05em;
}

.hero__affiliations a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s ease;
}
.hero__affiliations a:hover {
  opacity: 0.7;
}

.hero__scroll-hint {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.4rem;
  opacity: 0.4;
  cursor: pointer;
}

/* Institutional logos at bottom of hero (currently unused, kept for re-enabling) */
.hero__institutions {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.hero__inst-logo {
  height: 32px;
  width: auto;
  opacity: 0.5;
  transition: opacity 0.3s ease;
}
.hero__inst-logo:hover {
  opacity: 0.8;
}

/* ============================================================
   Section 2: Who
   ============================================================ */
.section--who {
}

.who__layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: stretch;
}

.who__text {
  display: flex;
  flex-direction: column;
}

.who__photo-wrap {
  display: flex;
  justify-content: center;
  align-items: stretch;
}

.who__photo {
  width: 100%;
  max-width: 380px;
  height: 100%;
  border-radius: 4px;
  object-fit: cover;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.who__name {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--color-heading);
}

.role-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.role-list__item {
  font-size: 0.85rem;
  padding-left: 1.2rem;
  position: relative;
  color: var(--color-text);
}

.role-list__item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-brand);
}

.role-list__item strong {
  font-weight: 600;
  color: var(--color-heading);
}

/* Education & Experience background */
.who__background {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.8rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--color-border);
}

.who__bg-heading {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-brand);
  margin-bottom: 0.5rem;
}

.who__bg-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.bg-item {
  font-size: 0.72rem;
  color: var(--color-text);
  line-height: 1.45;
}

@media (max-width: 600px) {
  .who__background {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }
}

/* Institutional logos below roles — pushed to bottom of column */
.who__institutions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.2rem;
  margin-top: auto;
  padding-top: 1.5rem;
}

.who__inst-logo {
  height: 26px;
  width: auto;
  /* White SVGs/PNGs → hero navy #011e2e via CSS filter */
  filter: brightness(0) saturate(100%) invert(7%) sepia(30%) saturate(4500%) hue-rotate(190deg) brightness(95%) contrast(105%);
  transition: opacity 0.3s ease;
}
.who__inst-logo:hover {
  opacity: 0.7;
}

/* ============================================================
   Section 2b: Awards & Honors
   ============================================================ */
.section--awards {
}

.awards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}

.award-item {
  display: flex;
  gap: 0.9rem;
  align-items: baseline;
}

.award-item__year {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-brand);
  white-space: nowrap;
  min-width: 2.8rem;
}

.award-item__body {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.award-item__title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-heading);
}

.award-item__detail {
  font-size: 0.7rem;
  color: var(--color-meta);
}

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

/* ============================================================
   Section 2c: Areas of Interest
   ============================================================ */
.section--interests {
}

.interests-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.interests-col__heading {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-brand);
  margin-bottom: 1rem;
}

.interests-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.interest-item {
  font-size: 0.8rem;
  color: var(--color-text);
  padding-left: 1rem;
  position: relative;
}

.interest-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-brand);
  opacity: 0.5;
}

/* ============================================================
   Section 3: Research Areas
   ============================================================ */
.section--research {
}

.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.research-card {
  background: #fff;
  border-left: 3px solid var(--color-brand);
  border-radius: 2px;
  padding: 1.1rem 1.3rem;
  transition: box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
}
.research-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07);
}

.research-card__label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-brand);
  margin-bottom: 0.3rem;
}

.research-card__title {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--color-heading);
}

.research-card__desc {
  font-size: 0.72rem;
  color: var(--color-meta);
  line-height: 1.5;
  margin-bottom: 0.5rem;
  flex: 1;
}

.research-card__pubs {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.62rem;
  font-weight: 600;
  background: var(--color-brand);
  color: #fff;
  border-radius: 10px;
  padding: 2px 9px;
  letter-spacing: 0.02em;
}

/* ============================================================
   Section 4: Scale / Stats
   ============================================================ */
.section--scale {
}

.stats-row {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 2rem;
  margin-top: 2rem;
}

.stat {
  text-align: center;
  flex: 1 1 140px;
  max-width: 200px;
}

.stat__number {
  display: block;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  color: var(--color-brand);
  line-height: 1.1;
}

.stat__label {
  display: block;
  font-size: 0.75rem;
  color: var(--color-meta);
  margin-top: 0.4rem;
}

/* ============================================================
   Section 4b: Industry & Funding
   ============================================================ */
.section--industry {
}

.stats-row--wide {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem 2rem;
  margin-top: 2rem;
}

.stats-row--wide .stat {
  max-width: none;
  flex: none;
}

@media (max-width: 600px) {
  .stats-row--wide {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem 1rem;
  }
}

/* ============================================================
   Section 5: Highlights
   ============================================================ */
.section--highlights {
}

.highlights-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.highlight-item {
  padding-left: 1.5rem;
  position: relative;
}

.highlight-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6em;
  height: 2px;
  width: 0;
  background: var(--color-brand);
  transition: width 0.6s ease-out;
}

.highlight-item.is-visible::before {
  width: 14px;
}

.highlight-item__text {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-heading);
}

.highlight-item__detail {
  font-size: 0.75rem;
  color: var(--color-meta);
  margin-top: 0.15rem;
}

/* ============================================================
   Section 5b: Project Highlights
   ============================================================ */
.section--projects {
}

.projects-grid {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.project-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--color-border);
  border-radius: 3px;
  overflow: hidden;
  transition: box-shadow 0.25s ease;
}
.project-card:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.07);
}

/* Alternate: even cards flip image to right */
.project-card:nth-child(even) {
  direction: rtl;
}
.project-card:nth-child(even) > * {
  direction: ltr;
}

.project-card__image {
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
  display: block;
}

.project-card__body {
  padding: 1.8rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.project-card__tag {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fff;
  background: var(--color-brand);
  padding: 3px 10px;
  border-radius: 2px;
  margin-bottom: 0.7rem;
  align-self: flex-start;
}

.project-card__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-heading);
  margin-bottom: 0.6rem;
}

.project-card__desc {
  font-size: 0.75rem;
  color: var(--color-text);
  line-height: 1.65;
  margin-bottom: 0.8rem;
}

.project-card__impact {
  font-size: 0.7rem;
  color: var(--color-heading);
  font-weight: 600;
  padding: 0.5rem 0.8rem;
  background: var(--color-bg-alt);
  border-radius: 2px;
  margin-bottom: 0.7rem;
  line-height: 1.5;
}

.project-card__meta {
  font-size: 0.65rem;
  color: var(--color-meta);
  margin-top: auto;
}

.project-card__meta strong {
  color: var(--color-text);
}

/* ============================================================
   Section 6: Open Source / Software
   ============================================================ */
.section--software {
}

.software-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 1.5rem;
}

.software-item {
  display: block;
  padding: 1.1rem 1.3rem;
  border: 2px solid var(--color-border);
  border-radius: 4px;
  text-align: center;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  color: var(--color-text);
}
.software-item:hover {
  border-color: var(--color-brand);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.software-item__name {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  color: var(--color-heading);
}

.software-item__desc {
  display: block;
  font-size: 0.7rem;
  color: var(--color-meta);
}

/* ============================================================
   Section 7: Contact / CTA
   ============================================================ */
.section--contact {
  text-align: center;
}

.contact__subtext {
  font-size: 0.85rem;
  color: var(--color-meta);
  margin-bottom: 2rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.cta-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.cta-link {
  display: inline-block;
  padding: 10px 28px;
  border: 2px solid var(--color-brand);
  border-radius: 2px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-brand);
  transition: background 0.25s ease, color 0.25s ease;
}
.cta-link:hover {
  background: var(--color-brand);
  color: #fff;
  opacity: 1;
}

/* Social media row */
.social-row {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  margin-top: 2rem;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--color-border);
  color: var(--color-meta);
  font-size: 1rem;
  transition: all 0.25s ease;
}
.social-link:hover {
  color: var(--color-brand);
  border-color: var(--color-brand);
  opacity: 1;
}

/* ============================================================
   Slide Dot Navigation (right side)
   ============================================================ */
.slide-nav {
  position: fixed;
  right: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
}

.slide-nav ol {
  list-style: none;
}

.slide-nav li {
  margin: 0.9rem 0;
}

.nav-dot {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.2);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.nav-dot::after {
  content: attr(title);
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-right: 0.8rem;
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border-radius: 3px;
  font-size: 0.65rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.2s ease;
}

.nav-dot:hover::after {
  opacity: 1;
  visibility: visible;
}

.nav-dot[aria-current="true"] {
  background: var(--color-brand);
  transform: scale(1.3);
  box-shadow: 0 0 0 2px rgba(1, 56, 88, 0.2);
}

.nav-dot:hover {
  background: var(--color-brand);
}

/* On hero (dark bg), dots should be lighter */
.section--hero ~ .slide-nav .nav-dot,
.slide-nav .nav-dot {
  /* default handles both */
}

@media (max-width: 600px) {
  .slide-nav {
    display: none;
  }
}

@media print {
  .slide-nav {
    display: none;
  }
}

/* ============================================================
   Footer
   ============================================================ */
.intro-footer {
  text-align: center;
  padding: 2rem var(--spacing);
  font-size: 0.7rem;
  color: rgba(255,255,255,0.5);
  background: var(--color-brand);
}

.intro-footer a {
  color: rgba(255,255,255,0.7);
}
.intro-footer a:hover {
  color: #fff;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 800px) {
  .container {
    padding: 0 20px;
  }
  .section {
    padding: var(--section-padding-mobile);
  }
}

@media (max-width: 600px) {
  .research-grid {
    grid-template-columns: 1fr;
  }
  .software-grid {
    grid-template-columns: 1fr 1fr;
  }
  .stats-row {
    gap: 2.5rem 1rem;
  }
  .stat {
    flex: 1 1 120px;
  }
  .cta-links {
    flex-direction: column;
    align-items: center;
  }
  .cta-link {
    width: 100%;
    max-width: 280px;
    text-align: center;
  }
  .hero__tagline {
    font-size: 1.3rem;
  }
  .who__institutions {
    justify-content: space-around;
    gap: 1.4rem;
  }
  .who__inst-logo {
    height: 20px;
  }
  .interests-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .who__layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .who__photo-wrap {
    order: -1;
  }
  .who__photo {
    max-width: 280px;
  }
  .project-card {
    grid-template-columns: 1fr;
  }
  .project-card:nth-child(even) {
    direction: ltr;
  }
  .project-card__image {
    min-height: 180px;
    max-height: 220px;
  }
  .project-card__body {
    padding: 1.3rem 1.4rem;
  }
}

/* ============================================================
   Print
   ============================================================ */
@media print {
  .section--hero {
    height: auto;
    min-height: 0;
    background: #fff;
    color: #111;
    page-break-after: always;
  }
  .hero__logo {
    filter: none;
  }
  .hero__scroll-hint {
    display: none;
  }
  .section {
    padding: 30px 0;
  }
  .animate-on-scroll {
    opacity: 1 !important;
    transform: none !important;
  }
}
