/* ========================================
   Nonlinear Dynamics — Stylesheet
   ======================================== */

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

:root {
  --red: #C41E1E;
  --red-light: #e8383833;
  --black: #1a1a1a;
  --gray-900: #2a2a2a;
  --gray-700: #555;
  --gray-500: #888;
  --gray-300: #ccc;
  --gray-100: #f5f5f7;
  --white: #fff;
  --off-white: #fafafa;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  --nav-h: 72px;
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: var(--font);
  color: var(--black);
  background: var(--white);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: var(--red);
  text-decoration: none;
  transition: opacity 0.2s var(--ease);
}
a:hover { opacity: 0.7; }

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

/* --- Container --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(24px, 5vw, 80px);
}

/* ========================================
   Navigation
   ======================================== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  z-index: 1000;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.nav.scrolled {
  border-bottom-color: rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.95);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(24px, 5vw, 80px);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--black);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.nav-logo:hover { opacity: 1; }
.nav-logo-img { width: 36px; height: 36px; }

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 36px;
}
.nav-links a {
  color: var(--gray-700);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: color 0.2s var(--ease);
}
.nav-links a:hover { color: var(--black); opacity: 1; }
.nav-cta {
  color: var(--red) !important;
  font-weight: 600 !important;
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--black);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.2s;
}
.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }



/* ========================================
   Hero
   ======================================== */
/* Equation Header Banner */
.eq-header {
  margin-top: var(--nav-h);
  width: 100%;
  border-bottom: 3px solid var(--red);
  overflow: hidden;
}

.eq-header img {
  width: 100%;
  display: block;
  filter: grayscale(100%) contrast(1.3);
}

.hero {
  position: relative;
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 24px 80px;
  overflow: hidden;
  background: var(--white);
}



/* Subtle gradient overlay for depth */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 40%, rgba(196,30,30,0.03) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 60%, rgba(196,30,30,0.02) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 900px;
  text-align: center;
}

.hero-label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 32px;
  opacity: 0;
  animation: fadeUp 0.8s var(--ease-out) 0.2s forwards;
}

.hero-statement {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.03em;
  color: var(--black);
  margin-bottom: 24px;
  opacity: 0;
  animation: fadeUp 0.8s var(--ease-out) 0.4s forwards;
}

.hero-sub {
  font-size: clamp(1.2rem, 2.5vw, 1.65rem);
  font-weight: 300;
  line-height: 1.45;
  color: var(--gray-700);
  letter-spacing: -0.01em;
  opacity: 0;
  animation: fadeUp 0.8s var(--ease-out) 0.6s forwards;
}

.hero-line {
  width: 48px;
  height: 2px;
  background: var(--red);
  margin: 48px auto 0;
  opacity: 0;
  animation: fadeUp 0.8s var(--ease-out) 0.8s forwards;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ========================================
   Sections
   ======================================== */
.section {
  padding: clamp(80px, 12vw, 160px) 0;
}
.section-alt {
  background: var(--gray-100);
}

.section-label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 16px;
}

h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.section-intro {
  font-size: 1.1rem;
  color: var(--gray-700);
  max-width: 640px;
  line-height: 1.65;
  margin-bottom: 56px;
}

.body-lg {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--gray-700);
  margin-bottom: 16px;
}

p + p { margin-top: 12px; }

/* ========================================
   About — Two Column
   ======================================== */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}
.col-text p { color: var(--gray-700); line-height: 1.7; }

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
.stat {
  padding: 28px;
  background: var(--gray-100);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stat-number {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--red);
}
.stat-label {
  font-size: 0.82rem;
  color: var(--gray-500);
  font-weight: 500;
}

/* ========================================
   Research Cards
   ======================================== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.card {
  background: var(--white);
  border-radius: 16px;
  padding: 36px 32px;
  border: 1px solid rgba(0,0,0,0.06);
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.08);
}

.card-icon {
  width: 44px;
  height: 44px;
  color: var(--red);
  margin-bottom: 20px;
}
.card-icon svg { width: 100%; height: 100%; }

.card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  line-height: 1.35;
}
.card p {
  font-size: 0.9rem;
  color: var(--gray-700);
  line-height: 1.6;
}

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

.pub {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 32px;
  padding: 32px 0;
  border-bottom: 1px solid rgba(0,0,0,0.07);
  transition: background 0.2s var(--ease);
}
.pub:first-child { border-top: 1px solid rgba(0,0,0,0.07); }
.pub:hover { background: rgba(0,0,0,0.015); }

.pub-year {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--red);
  padding-top: 4px;
  font-variant-numeric: tabular-nums;
}

.pub-body h3 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.4;
  margin-bottom: 4px;
}
.pub-meta {
  font-size: 0.85rem;
  color: var(--gray-500);
  margin-bottom: 8px;
  font-style: italic;
}
.pub-body > p:last-child {
  font-size: 0.9rem;
  color: var(--gray-700);
  line-height: 1.6;
}

/* ========================================
   Team
   ======================================== */
.team-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-top: 48px;
}

.team-member {
  background: var(--white);
  border-radius: 16px;
  padding: 40px 36px;
  border: 1px solid rgba(0,0,0,0.06);
}

.team-photo-placeholder {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--gray-100);
  color: var(--red);
  font-size: 1.4rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  border: 2px solid var(--red-light);
}

.team-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 20px;
  border: 3px solid var(--red-light);
}

.team-member-full {
  grid-column: 1 / -1;
}

.team-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.team-member h3 {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.team-role {
  font-size: 0.85rem;
  color: var(--red);
  font-weight: 500;
  margin-bottom: 0;
}
.team-member > p {
  font-size: 0.9rem;
  color: var(--gray-700);
  line-height: 1.65;
}

.team-education {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(0,0,0,0.07);
}
.team-education h4,
.team-skills h4 {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 12px;
}
.team-education p {
  font-size: 0.9rem;
  color: var(--gray-700);
  line-height: 1.6;
}

.team-skills {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(0,0,0,0.07);
}
.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.skill-tags span {
  font-size: 0.78rem;
  font-weight: 500;
  padding: 6px 14px;
  background: var(--gray-100);
  color: var(--gray-700);
  border-radius: 20px;
  letter-spacing: 0.01em;
}

/* ========================================
   Contact
   ======================================== */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}
.contact-text p { color: var(--gray-700); line-height: 1.7; }

.contact-details {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.contact-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.contact-item-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gray-500);
}
.contact-item span,
.contact-item a {
  font-size: 1rem;
  color: var(--black);
}
.contact-item a { color: var(--red); }

/* Form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--gray-700);
}
.form-group input,
.form-group textarea {
  font-family: var(--font);
  font-size: 0.95rem;
  padding: 12px 16px;
  border: 1px solid var(--gray-300);
  border-radius: 10px;
  background: var(--white);
  color: var(--black);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
  outline: none;
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-light);
}
.form-group textarea { resize: vertical; min-height: 120px; }

.btn {
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 14px 32px;
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s var(--ease), transform 0.15s var(--ease);
  align-self: flex-start;
}
.btn:hover { background: #a81919; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

/* ========================================
   Footer
   ======================================== */
.footer {
  padding: 40px 0;
  border-top: 1px solid rgba(0,0,0,0.07);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--black);
}
.footer-logo-img { width: 28px; height: 28px; }
.footer-copy {
  font-size: 0.8rem;
  color: var(--gray-500);
}

/* ========================================
   Scroll Reveal
   ======================================== */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 1024px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col { gap: 48px; }
  .contact-layout { gap: 48px; }
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 32px 24px;
    gap: 24px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    transform: translateY(-20px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s var(--ease-out), opacity 0.25s var(--ease);
  }
  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }
  .nav-links a { font-size: 1.1rem; }
  .nav-logo-text { display: none; }

  .hero { min-height: 90vh; padding-bottom: 60px; }
  .hero-statement { font-size: clamp(1.5rem, 6vw, 2.2rem); }
  .hero-sub { font-size: clamp(1rem, 4vw, 1.3rem); }

  .two-col,
  .team-grid,
  .contact-layout { grid-template-columns: 1fr; }

  .card-grid { grid-template-columns: 1fr; }

  .stat-grid { grid-template-columns: 1fr 1fr; }

  .pub { grid-template-columns: 60px 1fr; gap: 16px; }

  .footer-inner { flex-direction: column; gap: 12px; text-align: center; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .hero { min-height: 85vh; }
}
