/* ===============================
   Fengyun Hou — Site Styles
   Matches index.html (assets/style.css)
   =============================== */

/* -------- CSS Variables & Color Scheme -------- */
:root{
  --bg-grad-start:#667eea;
  --bg-grad-end:#764ba2;
  --text:#2c3e50;
  --muted:#7f8c8d;
  --card:#ffffff;
  --primary:#667eea;
  --primary-2:#764ba2;
  --accent:#3498db;
  --success:#27ae60;
  --warning:#f39c12;
  --danger:#e74c3c;
  --surface: rgba(255,255,255,0.96);
  --shadow: 0 10px 40px rgba(0,0,0,0.10);
  --shadow-soft: 0 5px 15px rgba(0,0,0,0.08);
  --radius-lg: 20px;
  --radius-md: 15px;
  --nav-h: 70px;
}

@media (prefers-color-scheme: dark){
  :root{
    --bg-grad-start:#14213d;
    --bg-grad-end:#282a36;
    --text:#e6e6e6;
    --muted:#b8c0cc;
    --card:#0f172a;
    --surface: rgba(17,24,39,0.82);
    --shadow: 0 10px 40px rgba(0,0,0,0.35);
    --shadow-soft: 0 5px 15px rgba(0,0,0,0.25);
  }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce){
  *{animation: none !important; transition: none !important;}
}

/* -------- Reset & Base -------- */
*{box-sizing:border-box; margin:0; padding:0;}
html{scroll-behavior:smooth;}
body{
  font-family: 'Segoe UI','Roboto','Oxygen','Ubuntu','Cantarell',system-ui,-apple-system,sans-serif;
  line-height:1.6;
  color:var(--text);
  background: linear-gradient(135deg, var(--bg-grad-start) 0%, var(--bg-grad-end) 100%);
  min-height:100vh;
}

/* Focus visible for a11y */
:focus-visible{
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

/* Skip link (optional, harmless if not present) */
.skip-link{
  position:absolute; left:-9999px; top:auto;
}
.skip-link:focus{
  left:16px; top:16px; z-index:1001;
  background:#fff; color:#000; padding:8px 12px; border-radius:8px;
}

/* -------- Navigation Bar -------- */
.navbar{
  background: var(--surface);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: fixed; top:0; left:0; right:0; z-index:1000;
  box-shadow: 0 2px 20px rgba(0,0,0,0.1);
}

.nav-container{
  max-width:1200px; margin:0 auto;
  padding:0 20px; display:flex; justify-content:space-between; align-items:center;
  height: var(--nav-h);
}

.nav-logo h3{ color:var(--text); font-weight:700; font-size:1.35rem; letter-spacing:.2px; }

.nav-menu{ list-style:none; display:flex; gap:30px; align-items:center; }

.nav-link{
  text-decoration:none; color:var(--text); font-weight:500;
  padding:8px 16px; border-radius:999px; transition: all .25s ease;
  position:relative;
}
.nav-link:hover, .nav-link.active{
  color:var(--primary);
  background: color-mix(in oklab, var(--primary) 12%, #fff);
}

/* Mobile trigger */
.hamburger{
  display:none; flex-direction:column; cursor:pointer; padding:6px; border-radius:8px;
  border:1px solid rgba(0,0,0,0.06);
}
.hamburger span{
  width:25px; height:3px; background: var(--text);
  margin:3px 0; transition:.3s; border-radius:2px;
}
.hamburger.active span:nth-child(1){ transform: rotate(-45deg) translate(-5px, 6px); }
.hamburger.active span:nth-child(2){ opacity:0; }
.hamburger.active span:nth-child(3){ transform: rotate(45deg) translate(-5px, -6px); }

/* -------- Layout Container -------- */
.container{
  max-width:1200px; margin: var(--nav-h) auto 0; /* leave space for fixed nav */
  padding: 0 20px;
}

/* -------- Sections (cards) -------- */
section{
  background: var(--surface);
  margin: 40px 0;
  padding: 50px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  animation: fadeInUp .6s ease-out;
}

h2{
  font-size:2.25rem; color:var(--text); margin-bottom:26px; text-align:center; position:relative;
}
h2::after{
  content:''; display:block; width:60px; height:4px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  margin: 14px auto 0; border-radius:2px;
}

/* -------- Welcome Section -------- */
.welcome-section{ background: rgba(255,255,255,0.98); }
@media (prefers-color-scheme: dark){
  .welcome-section{ background: rgba(17,24,39,0.82); }
}

.profile-section{
  display:flex; align-items:center; gap:50px; margin-bottom:40px; flex-wrap:wrap;
}
.profile-image{
  width:280px; height:340px; object-fit:cover; border-radius:20px;
  box-shadow: 0 15px 35px rgba(0,0,0,0.15);
  transition: transform .3s ease;
}
.profile-image:hover{ transform: translateY(-4px); }

.profile-info{ flex:1; min-width: 320px; }
.profile-info h1{
  font-size: clamp(2rem, 4vw, 3.25rem);
  margin-bottom: 12px; font-weight:800;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent;
}
.title{ font-size:1.1rem; color:var(--muted); margin-bottom: 14px; }
.affiliation{ font-size:1.05rem; color:#34495e; margin-bottom:18px; line-height:1.7; }
@media (prefers-color-scheme: dark){
  .affiliation{ color:#cfd8e3; }
}

.research-focus{
  background: linear-gradient(135deg, color-mix(in oklab, var(--primary) 12%, transparent) 0%, color-mix(in oklab, var(--primary-2) 12%, transparent) 100%);
  padding:18px; border-radius:14px; margin-bottom:18px;
}
.research-focus h3{ color:var(--text); margin-bottom:8px; font-size:1.1rem; }
.research-focus p{ color:#5a6c7d; font-weight:600; }
@media (prefers-color-scheme: dark){
  .research-focus p{ color:#cbd5e1; }
}

.links{ display:flex; gap:12px; flex-wrap:wrap; }
.links a{
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  color:#fff; text-decoration:none; padding:10px 16px; border-radius:999px;
  font-weight:600; transition: transform .2s ease, box-shadow .2s ease;
  box-shadow: 0 4px 15px color-mix(in oklab, var(--primary) 35%, transparent);
}
.links a:hover{ transform: translateY(-2px); box-shadow: 0 6px 22px color-mix(in oklab, var(--primary) 45%, transparent); }

/* -------- Welcome Content -------- */
.welcome-content{ margin-top: 18px; }
.welcome-content h2{ text-align:left; font-size: 2rem; margin-bottom: 18px; }
.welcome-content p{ font-size:1.06rem; line-height:1.85; color:#34495e; margin-bottom: 16px; }
@media (prefers-color-scheme: dark){
  .welcome-content p{ color:#d1d5db; }
}

/* -------- Research Highlights -------- */
.research-highlights{ margin: 30px 0; }
.highlight-grid{
  display:grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap:22px; margin-top: 20px;
}
.highlight-item{
  background: var(--card); padding:22px; border-radius: var(--radius-md); text-align:center;
  box-shadow: var(--shadow-soft); transition: transform .25s ease, box-shadow .25s ease;
  border-top: 4px solid var(--primary);
}
.highlight-item:hover{ transform: translateY(-4px); box-shadow: 0 8px 25px rgba(0,0,0,0.12); }
.highlight-icon{ font-size: 2.25rem; margin-bottom: 10px; }
.highlight-item h4{ color:var(--text); margin-bottom:10px; font-size:1.12rem; }
.highlight-item p{ color:#34495e; line-height:1.6; }
@media (prefers-color-scheme: dark){
  .highlight-item{ background:#111827; }
  .highlight-item p{ color:#cbd5e1; }
}

/* -------- Quick Navigation (Skills) -------- */
.quick-navigation{ margin: 30px 0; }
.nav-cards{
  display:grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap:20px; margin-top: 18px;
}
.nav-card{
  background: var(--card); padding:22px; border-radius: var(--radius-md); text-align:center;
  box-shadow: var(--shadow-soft); border-top:4px solid var(--accent);
  transition: transform .25s ease, box-shadow .25s ease;
}
.nav-card:hover{ transform: translateY(-4px); box-shadow: 0 8px 25px rgba(0,0,0,0.12); }
.card-icon{ font-size:2rem; margin-bottom:10px; }
.nav-card h4{ margin-bottom:8px; font-size:1.05rem; }
.nav-card p{ color:#7f8c8d; font-size:.95rem; line-height:1.55; }
@media (prefers-color-scheme: dark){
  .nav-card{ background:#111827; }
  .nav-card p{ color:#b6bfc9; }
}

/* -------- Footer -------- */
footer{
  background: rgba(44,62,80,0.95); color:#fff; text-align:center;
  padding:26px; margin-top: 44px; border-radius: 20px 20px 0 0;
}
footer p{ opacity: .9; }

/* -------- Mobile Navigation (slide-in) -------- */
@media (max-width: 768px){
  .hamburger{ display:flex; }
  .nav-menu{
    position: fixed; left: -100%; top: var(--nav-h);
    width: 100%; flex-direction: column; gap: 10px;
    background: rgba(255,255,255,0.98);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    padding: 18px 0; transition: left .3s ease;
    box-shadow: 0 10px 27px rgba(0,0,0,0.08);
  }
  .nav-menu.active{ left: 0; }
  .nav-menu li{ margin: 6px 0; }
  .container{ padding: 0 16px; }
  section{ padding: 26px; margin: 22px 0; }
  .profile-section{ flex-direction: column; text-align:center; gap: 22px; }
  .profile-image{ width: 220px; height: 280px; }
  .welcome-content h2{ font-size: 1.6rem; }
  .links{ justify-content: center; }
}

/* -------- Larger Tablet Tweaks -------- */
@media (max-width: 1024px){
  .nav-menu{ gap: 20px; }
  section{ padding: 38px; }
}

/* -------- Small Phones -------- */
@media (max-width: 480px){
  .profile-image{ width:180px; height:220px; }
  h2{ font-size: 1.5rem; }
  section{ padding: 20px; }
  .nav-card .card-icon{ font-size:1.75rem; }
}

/* -------- Animations & Cosmetics -------- */
@keyframes fadeInUp{
  from{ opacity:0; transform: translateY(26px); }
  to{ opacity:1; transform: translateY(0); }
}

/* -------- Custom Scrollbar (WebKit) -------- */
::-webkit-scrollbar{ width: 10px; }
::-webkit-scrollbar-track{ background: #f1f1f1; }
::-webkit-scrollbar-thumb{
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover{
  filter: brightness(0.95);
}

/* -------- Print Styles -------- */
@media print{
  body{ background:#fff; color:#000; }
  .navbar{ display:none; }
  section{
    background:#fff; box-shadow:none; break-inside:avoid;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .container{ margin-top:0; }
}

/* ===============================
   (OPTIONAL) Shared components
   You can keep the following for other pages (journey/research/publications/contact)
   =============================== */

/* Page Header */
.page-header{
  text-align:center; padding:60px 0 40px;
  background: linear-gradient(135deg, color-mix(in oklab, var(--primary) 10%, transparent) 0%, color-mix(in oklab, var(--primary-2) 10%, transparent) 100%);
  margin: -50px -50px 40px -50px; border-radius: 20px 20px 0 0;
}
.page-header h1{
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent;
}
.page-subtitle{ font-size:1.05rem; color:var(--muted); max-width:720px; margin:0 auto; line-height:1.7; }

/* Timeline (for journey page) */
.timeline{ position:relative; padding-left:30px; }
.timeline::before{
  content:''; position:absolute; left:15px; top:0; bottom:0; width:3px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
}
.timeline-item{ position:relative; margin-bottom:28px; padding-left:40px; }
.timeline-marker{
  position:absolute; left:-47px; top:5px; width:20px; height:20px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  border-radius:50%; border:4px solid #fff; box-shadow: var(--shadow-soft);
}
.timeline-content h3{ color:var(--text); font-size:1.2rem; margin-bottom:6px; }
.timeline-content h4{ color: var(--primary); font-size:1.05rem; margin-bottom:8px; }
.institution{ color:#34495e; font-weight:600; margin-bottom:4px; }
.duration{ color:var(--muted); font-style:italic; margin-bottom:8px; }
.description{ color:#5a6c7d; line-height:1.7; }
@media (prefers-color-scheme: dark){
  .institution{ color:#e5e7eb; }
  .description{ color:#cbd5e1; }
}

/* Cards, grids, badges (generic) */
.card{ background:var(--card); padding:25px; border-radius: var(--radius-md); box-shadow: var(--shadow-soft); }
.grid{ display:grid; gap:20px; }
.grid.two{ grid-template-columns: repeat(2,1fr); }
.grid.three{ grid-template-columns: repeat(3,1fr); }

.skill-tag{
  background: var(--primary);
  color:#fff; padding:6px 14px; border-radius:999px;
  font-size:.9rem; font-weight:600; display:inline-block; margin-right:8px; margin-top:8px;
}

.project-status{ padding:6px 12px; border-radius:999px; font-size:.85rem; font-weight:700; text-transform:uppercase; }
.project-status.current{ background:#d5f4e6; color:var(--success); }
.project-status.past{ background:#f4f5f7; color:#7f8c8d; }

/* Publications & Conferences (shared) */
.pub-item{ background:var(--card); padding:22px; border-radius: var(--radius-md); box-shadow: var(--shadow-soft); border-left:4px solid var(--primary-2); }
.pub-item.featured{ border-left-width:6px; background: linear-gradient(135deg, color-mix(in oklab, var(--primary-2) 6%, #fff) 0%, color-mix(in oklab, var(--primary) 6%, #fff) 100%); }
.pub-item h3, .pub-item h4{ color:var(--text); line-height:1.35; }
.authors{ color:#34495e; margin-top:6px; font-weight:500; }
.journal{ color:var(--muted); font-style:italic; }
.pub-links{ display:flex; gap:10px; flex-wrap:wrap; margin-top:10px; }
.pub-links a{
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%); color:#fff; text-decoration:none;
  padding:8px 14px; border-radius:999px; font-size:.9rem; font-weight:600;
  box-shadow: 0 2px 8px rgba(231,76,60,0.3); transition: transform .2s ease, box-shadow .2s;
}
.pub-links a:hover{ transform: translateY(-2px); box-shadow: 0 4px 12px rgba(231,76,60,0.4); }
.presentation-type{
  background:#3498db; color:#fff; padding:4px 10px; border-radius:12px;
  font-size:.8rem; font-weight:700; display:inline-block; margin-bottom:8px; text-transform:uppercase;
}
.conf-item{ background: linear-gradient(135deg, rgba(52,152,219,0.05) 0%, rgba(41,128,185,0.05) 100%); padding:22px; border-radius: var(--radius-md); border-left:4px solid #3498db; }

/* Contact shared */
.contact-item{ background:var(--card); padding:22px; border-radius: var(--radius-md); box-shadow: var(--shadow-soft); }
.contact-item a{ color: var(--primary); font-weight:600; text-decoration:none; }
.contact-item a:hover{ text-decoration:underline; }
