/* ================================
   Kulathinal Lab – Home (fixed)
   Key fixes:
   - Restores global background + overlay
   - Constrains logo size (prevents “logo fills screen”)
   - Polished header grid: logo left, tagline center, nav right (nav sits on lower portion)
   ================================ */

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

html, body { height: 100%; }

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--page-bg);
}

/* =========================
   Global content defaults
   ========================= */

:root {
  --content-max: 1100px;
  --content-pad: 1.5rem;
  --stack-1: 0.6rem;
  --stack-2: 1rem;
  --stack-3: 1.6rem;

  /* Theme tokens (default: dark) */
  --page-bg: linear-gradient(135deg, #020617 0%, #020617 100%);
  --overlay-1: rgba(96, 165, 250, 0.20);
  --overlay-2: rgba(16, 185, 129, 0.16);
  --overlay-3: rgba(129, 140, 248, 0.20);

  --text: #e5e7eb;
  --muted: #9ca3af;
  --heading: #f9fafb;

  --surface: rgba(15, 23, 42, 0.75);
  --surface-strong: rgba(15, 23, 42, 0.85);
  --border: rgba(51, 65, 85, 0.9);
  --shadow: 0 14px 34px rgba(15, 23, 42, 0.55);

  --accent: rgba(165, 180, 252, 0.95);
  --link: rgba(110, 231, 224, 0.95);
  --link-hover: rgba(165, 180, 252, 0.95);
}


/* Constrain main page content like the hero */
main,
.section,
.about-section {
  max-width: var(--content-max);
  margin: 0 auto;
}

/* Make any content area readable by default */
.section-content,
.about-content {
  padding: 0 var(--content-pad);
}

/* Vertical rhythm: space between common blocks */
.section-content > * + *,
.about-content > * + * {
  margin-top: var(--stack-2);
}

/* Headings */
h1, h2, h3 {
  color: var(--heading);
  line-height: 1.15;
}

h2 {
  font-size: 1.35rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

/* Body text */
p {
  color: var(--text);
  line-height: 1.7;
}

.section-content > p {
  max-width: 70ch;
}

/* Lede / intro text */
.section-lede {
  color: var(--muted);
  max-width: 120ch;
}

/* Lists – this is the big one */
ul, ol {
  padding-left: 1.2rem;
}

li + li {
  margin-top: 0.5rem;  /* space between list items */
}

li {
  line-height: 1.55;
  color: var(--text);
}

/* Optional: make links look consistent */
a {
  color: inherit;
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}


/* Page wrapper */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  isolation: isolate;
  padding: 1.5rem;
}

/* Background overlay */
.bg-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(circle at 20% 18%, var(--overlay-1), transparent 60%),
    radial-gradient(circle at 60% 40%, var(--overlay-2), transparent 60%),
    radial-gradient(circle at 82% 78%, var(--overlay-3), transparent 58%),
    var(--page-bg);
}

/* ---------- Header ---------- */
.site-header {
  margin-bottom: 2.25rem;
}

/* Header layout aligned to content column */
.header-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding-left: var(--content-pad);
  padding-right: var(--content-pad);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: 1.25rem;
  row-gap: 0.25rem;
  align-items: start;
}

  .logo-mark {
  grid-column: 1;
  grid-row: 1 / span 2;
  display: inline-flex;
  align-items: flex-start;
}

/* CRITICAL: keep the logo from taking over the page */
.lab-logo {
  display: block;
  width: 140px;        /* tweak 80–120px */
  height: auto;
  max-height: 140px;   /* keeps it aligned with header */
}

.header-center {
  grid-column: 2;
  grid-row: 1 / span 2;
  text-align: center;
  padding-top: 0.25rem;
}

.header-title {
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: clamp(1.05rem, 0.55vw + 0.85rem, 1.35rem);
  color: #f1f5f9;
}

.header-subtitle {
  margin-top: 0.15rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: clamp(0.9rem, 0.35vw + 0.75rem, 1.05rem);
  color: rgba(165, 180, 252, 0.92);
}

/* Nav sits on lower portion of header */
.top-nav {
  grid-column: 3;
  grid-row: 2;
  display: flex;
  gap: 2.0rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: flex-end;
  padding-top: 0.2rem;
}

.top-nav a {
  font-size: 0.92rem;
  text-decoration: none;
  color: #e5e7eb;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.top-nav a:hover {
  color: #f9fafb;
  border-bottom-color: rgba(96, 165, 250, 0.9);
}

.top-nav a.active {
  color: #f9fafb;
  border-bottom-color: rgba(165, 180, 252, 0.95);
}

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  align-items: flex-start;
  gap: 2.5rem;
  margin-bottom: 3rem;
}

.hero-text {
  max-width: 720px;
}

.lab-tagline-top {
  font-size: 1.05rem;       /* bumped up */
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(165, 180, 252, 0.95);
  margin-bottom: 0.75rem;
}

.hero-text h1 {
  font-size: clamp(2.2rem, 4.2vw, 3.2rem);
  line-height: 1.08;
  color: #f9fafb;
  margin-bottom: 1rem;
}

.hero-text h2 {
  font-size: clamp(1.0rem, 1.3vw, 1.40rem);
  letter-spacing: 0.05em;
}

.lab-subtitle {
  font-size: 1.02rem;
  line-height: 1.65;
  color: #e5e7eb;
  max-width: 42rem;
  margin-bottom: 1.3rem;
}

/* Buttons */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.1s ease;
}

.btn.primary {
  background: linear-gradient(135deg, #22c55e, #38bdf8);
  color: #0b1120;
}

.btn.primary:hover { transform: translateY(-1px); }

/* Right-side hero card */
.hero-side {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start; /* top align with left content */
}

.hero-card {
  width: 100%;
  max-width: 420px;
  padding: 1.2rem 1.25rem;
  border-radius: 1.25rem;
  background: rgba(15, 23, 42, 0.80);
  border: 1px solid var(--border);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(10px);
}

.hero-card h2 {
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(165, 180, 252, 0.95);
  margin-bottom: 0.8rem;
}

.hero-card ul {
  list-style: none;
  display: grid;
  gap: 0.55rem;
}

.hero-card li {
  color: #e5e7eb;
  line-height: 1.35;
  font-size: 0.98rem;
  padding-left: 0.85rem;
  position: relative;
}

.hero-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.9);
}

.logo-hover {
  position: relative; 
  display: block;
  height: clamp(100px, 11vw, 135px);
  margin: 0.10rem auto 0.50rem;
}
.logo-hover .research-logo {
  height: 100%;
}

.logo-hover-text{
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;      /* top */
  justify-content: center;      /* center horizontally */
  padding: 0.75rem;
  text-align: center;
  opacity: 0;
  transition: opacity 0.15s ease;
  border-radius: 12px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-size: 0.9rem;
  line-height: 1.35;
}

.logo-hover:hover .logo-hover-text{
  opacity: 1;
}

/* Section spacing */

.page-section + .page-section {
  margin-top: 4rem;
}

.section,
.about-section {
  padding: 2.5rem 0;
}

/* People/Resources “directory” list style */
.directory-list {
  list-style: none;
  padding-left: 0;
  display: grid;
  gap: 0.9rem;
  margin-top: 1.25rem;
}

.directory-list li {
  padding: 1rem 1.1rem;
  border-radius: 1rem;
  background: var(--surface-strong);
  border: 1px solid var(--border);
}


/* =========================
   Card system (reusable)
   ========================= */

.cards-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1.35rem;
  margin-top: 1.25rem;
}

.card {
  grid-column: span 6; /* 2-up by default */
  padding: 1.15rem 1.25rem;
  border-radius: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(96, 165, 250, 0.65);
}

.card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  color: #f9fafb;  font-weight: 600;
}


.card p {
  color: rgba(229, 231, 235, 0.85);
  line-height: 1.65;
}

/* Optional: small tag row */
.card .meta .pill {
  cursor: default;
  transition: background-color 0.15s ease;
}

.card .meta .pill:hover {
  background-color: rgba(165, 180, 252, 0.12);
}

.card .meta {
  margin-top: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pill {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: rgba(165, 180, 252, 0.95);
}

/* =========================
   Resources page
   ========================= */

/* Each resource card can define its own accent color via --section-color */
.resource-card {
  --section-color: rgba(165, 180, 252, 0.95); /* default (lavender) */
}

.resource-card h3 {
  color: var(--section-color);
}

/* Notes under headers */
.resource-note {
  color: rgba(229, 231, 235, 0.85);
  line-height: 1.6;
  margin-top: 0.35rem;
}

/* Pill groups */
.resource-pills {
  margin-top: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem; /* space between pills */
}

/* Pills inside resource cards */
.resource-card .pill {
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  text-transform: none;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--section-color) 55%, transparent);
  color: var(--section-color);
  background: rgba(2, 6, 23, 0.25);
  text-decoration: none;
  transition: transform 0.12s ease, background-color 0.12s ease, border-color 0.12s ease;
}

.resource-card .pill:hover {
  transform: translateY(-1px);
  background: color-mix(in srgb, var(--section-color) 14%, rgba(15, 23, 42, 0.75));
  border-color: color-mix(in srgb, var(--section-color) 80%, transparent);
}

/* Theme colors (match your requested palette) */
.theme-lab { --section-color: #f5d547; }         /* yellow */
.theme-teaching { --section-color: #ffffff; }    /* white */
.theme-external { --section-color: #f39c3d; }    /* orange */
.theme-journals { --section-color: #8fd19e; }    /* light green */
.theme-events { --section-color: #f28b82; }      /* light red */
/* Responsive: 1 column on small screens */
@media (max-width: 900px) {
  .card { grid-column: span 12; }
}

/* Footer */
.site-footer {
  margin-top: auto;
  padding-top: 1.25rem;
  font-size: 0.82rem;
  color: #9ca3af;
  text-align: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-side { justify-content: flex-start; }

  .header-inner {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto auto;
  }
  .logo-mark { grid-row: 1; }
  .header-center { grid-column: 1 / -1; grid-row: 2; text-align: left; }
  .top-nav { grid-column: 1 / -1; grid-row: 3; justify-content: flex-start; }
}

@media (max-width: 560px) {
  .lab-logo { width: 78px; max-height: 70px; }
  .top-nav { gap: 0.8rem; }
  .hero-text h1 { font-size: clamp(2.0rem, 7vw, 2.7rem); }
}

/* --- People cards: headshots with fallback --- */
.person-card {
  display: flex;
  align-items: flex-start;
  gap: 24px;
}

.person-body { flex: 1 1 auto; min-width: 0; }

.person-card--pi .avatar { width: 160px; height: 160px; }

/* Make PI card span full row */
.person-card--pi {
  grid-column: 1 / -1;
  grid-template-columns: 72px 1fr; /* bigger avatar */
  padding: 1.1rem 1.25rem;        /* a bit more presence */
}

/* Optional: make the PI “pill/role” line feel bigger */
.person-card--pi .muted {
  font-size: 1.02rem;
  opacity: 0.95;
}

.avatar {
  width: 150px;
  height: 150px;
  flex-shrink: 0;
  border-radius: 14px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 1.5rem;
  line-height: 1;
  opacity: 0.9;
}

/* Slightly tighten the “role” line */
.person-card .muted {
  margin-top: 0.15rem;
  margin-bottom: 0.55rem;
  opacity: 0.85;
}

/* --- Research cards: medium icons --- */
.research-card .card-icon {
  font-size: 1.8rem;
  line-height: 1;
  margin-bottom: 0.6rem;
  opacity: 0.95;
}

.research-logo {
  display: block;
  margin: 0.10rem auto 0.50rem;
  height: auto; 
  width: auto;
  max-width: 90%;
  object-fit: contain;
}

/* Optional: a tiny lift on hover */
.person-card:hover,
.research-card:hover {
  transform: translateY(-1px);
}


/* People cards: stack avatar above text on small screens */
@media (max-width: 700px) {
  .person-card { flex-direction: column; }
  .avatar { width: 96px; height: 96px; }
  .person-card--pi .avatar { width: 120px; height: 120px; }
}


/* Header subtitle sizing: keep long lines on one line on desktop */
@media (min-width: 900px) {
  .header-subtitle { white-space: nowrap; }
}

@media (min-width: 1200px) {
  :root {
    --content-max: 1240px;     /* was 1100px */
    --content-pad: 2rem;       /* was 1.5rem */
    --stack-1: 0.7rem;
    --stack-2: 1.15rem;
    --stack-3: 1.85rem;
  }

  .lab-logo {
    width: 165px;              /* was 140px */
    max-height: 165px;
  }

  .top-nav a {
    font-size: 1.02rem;        /* was 0.92rem */
  }
}

