/* ═══════════════════════════════════════════════════════════════
   main.css: foyeasy.github.io
   Theme: beige · cobalt · sun yellow
   ALL COLORS LIVE IN SECTION 1. Change a value there, the whole site follows.
   ═══════════════════════════════════════════════════════════════ */

/* ───────── 1. COLOR TOKENS ───────── */
:root {
  /* surfaces */
  --bg:            #EDECE6;   /* page background (beige) */
  --bg-alt:        #E5E4DC;   /* alternating sections */
  --card:          #F6F5F0;   /* cards */
  --card-alt:      #ECEBE3;   /* inputs, chips, hover fills */

  /* brand */
  --primary:       #1546D9;   /* cobalt: links, headings, buttons */
  --primary-hover: #0F34A8;
  --on-primary:    #FFFFFF;   /* text on a cobalt button */
  --accent:        #F9B318;   /* sun yellow: badges, banners, buttons with dark text */
  --on-accent:     #14181F;   /* dark text that sits ON yellow */

  /* brand surfaces (navbar, footer, stat tiles) */
  --brand-surface: #1546D9;
  --on-brand:      #EDECE6;   /* beige text on cobalt */

  /* text */
  --text:          #14181F;   /* ink */
  --text-2:        #4A4F58;   /* secondary */
  --text-muted:    #5B606A;   /* tertiary, still AA on beige */

  /* lines + shadows */
  --border:        rgba(20, 24, 31, 0.14);
  --border-accent: rgba(21, 70, 217, 0.35);
  --focus:         #1546D9;
  --overlay:       rgba(14, 19, 32, 0.78);
  --shadow-sm: 0 1px 3px rgba(20,24,31,.06), 0 1px 2px rgba(20,24,31,.04);
  --shadow-md: 0 4px 16px rgba(20,24,31,.09), 0 2px 6px rgba(20,24,31,.05);
  --shadow-lg: 0 12px 40px rgba(20,24,31,.13), 0 4px 12px rgba(20,24,31,.06);

  /* status */
  --ok:            #1F7A4D;
  --error:         #B3261E;

  /* non-color tokens */
  --radius:    14px;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Nunito Sans', 'Segoe UI', system-ui, sans-serif;
  --font-mono:    'DM Mono', ui-monospace, monospace;
  --nav-h: 64px;
  --container: 1400px;   /* max width of the page content, navbar and footer. Raise or lower to taste */
  color-scheme: light;
}

/* Dark mode: deep navy, beige text, lighter cobalt, same yellow.
   Set by the toggle (and first-visit system preference) via <html data-theme="dark"> */
[data-theme="dark"] {
  --bg:            #0E1320;
  --bg-alt:        #121A2B;
  --card:          #161F33;
  --card-alt:      #1C2740;

  --primary:       #6C8FF5;
  --primary-hover: #8FAAF8;
  --on-primary:    #0E1320;
  --accent:        #F9B318;
  --on-accent:     #14181F;

  --brand-surface: #172A82;   /* deep cobalt so beige + yellow stay readable */
  --on-brand:      #EDECE6;

  --text:          #EDECE6;
  --text-2:        #B9BECB;
  --text-muted:    #98A0B2;

  --border:        rgba(237, 236, 230, 0.14);
  --border-accent: rgba(108, 143, 245, 0.45);
  --focus:         #F9B318;
  --overlay:       rgba(5, 8, 16, 0.85);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,.45);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.55);

  --ok:            #5BD18F;
  --error:         #FF8A80;
  color-scheme: dark;
}

/* ───────── 2. BASE + ACCESSIBILITY ───────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); }
body { font-family: var(--font-body); background: var(--bg); color: var(--text); line-height: 1.75; overflow-x: hidden; transition: background .25s, color .25s; }
img { max-width: 100%; height: auto; }
a { color: var(--primary); }
a:hover { color: var(--primary-hover); }
h1, h2, h3, h4 { color: var(--primary); }
button { font-family: inherit; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 3000; background: var(--accent); color: var(--on-accent); padding: .6rem 1rem; border-radius: 8px; font-weight: 700; text-decoration: none; transition: top .2s; }
.skip-link:focus { top: .75rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ───────── 3. NAVBAR (cobalt, beige text, yellow underline on active) ───────── */
nav#mainNav { position: fixed; inset: 0 0 auto 0; z-index: 1000; background: var(--brand-surface); border-bottom: 1px solid rgba(237,236,230,.15); transition: box-shadow .3s; }
nav#mainNav.scrolled { box-shadow: var(--shadow-md); }
.nav-inner { max-width: var(--container); margin: 0 auto; padding: 0 2rem; display: flex; align-items: center; justify-content: space-between; height: var(--nav-h); gap: 1rem; }
.nav-brand { text-decoration: none; color: var(--on-brand); }
.nav-brand:hover { color: var(--on-brand); }
.nav-brand-text { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; }
.nav-brand-text span { color: var(--accent); }
.nav-right { display: flex; align-items: center; gap: .4rem; }
.nav-links { display: flex; gap: .1rem; list-style: none; }
.nav-links a { display: block; color: var(--on-brand); text-decoration: none; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: .45rem .8rem; border-bottom: 3px solid transparent; border-radius: 6px 6px 0 0; transition: background .2s, border-color .2s; }
.nav-links a:hover { background: rgba(237,236,230,.14); color: var(--on-brand); }
.nav-links a.active { border-bottom-color: var(--accent); }
nav#mainNav :focus-visible { outline-color: var(--accent); }

.theme-toggle, .hamburger { background: none; border: 1px solid rgba(237,236,230,.35); color: var(--on-brand); border-radius: 8px; width: 38px; height: 38px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: background .2s, color .2s, border-color .2s; }
.theme-toggle:hover { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
.hamburger { display: none; flex-direction: column; gap: 5px; border: none; }
.hamburger span { width: 22px; height: 2px; background: var(--on-brand); display: block; transition: transform .3s, opacity .3s; }
.hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ───────── 4. LAYOUT + SECTION HEADERS ───────── */
.container { max-width: var(--container); margin: 0 auto; padding: 0 2rem; }
section { padding: 3rem 0; }
section:first-of-type { padding-top: 0; }
.sec-alt { background: var(--bg-alt); }

.sec-header-first { text-align: center; margin: 2rem 0 2.5rem; padding-top: var(--nav-h); }
.sec-header { text-align: center; margin-bottom: 1.5rem; }
.sec-label { font-size: .75rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--primary); margin-bottom: .5rem; }
.sec-header p, .sec-header-first p { color: var(--text-2); margin-top: .6rem; font-size: .95rem; }
.sec-divider { width: 50px; height: 4px; background: var(--accent); border-radius: 2px; margin: 0 auto .75rem; }

/* ───────── 5. HERO ───────── */
.hero { min-height: 100vh; display: flex; align-items: center; padding-top: var(--nav-h); background: var(--bg); }
.hero .container { width: 100%; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 4rem; align-items: center; padding: 3rem 0; width: 100%; }
.hero-text { animation: fadeUp .7s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
.hero-affiliation { display: inline-flex; align-items: center; gap: .6rem; margin-bottom: 1.5rem; padding: .4rem 1rem .4rem .45rem; background: var(--card); border: 1px solid var(--border); border-radius: 100px; box-shadow: var(--shadow-sm); }
.hero-affiliation img { width: 28px; height: 28px; border-radius: 50%; object-fit: contain; background: #fff; }
.hero-affiliation span { font-size: .76rem; font-weight: 700; color: var(--text-2); }
.hero-name { white-space: nowrap; font-family: var(--font-display); font-size: clamp(1.5rem, 4vw, 3.4rem); font-weight: 700; line-height: 1.1; color: var(--text); margin-bottom: 1.2rem; }
.hero-name em { font-style: italic; color: var(--primary); display: block; }   /* HOSSAIN in cobalt */
.hero-title { font-size: 1.05rem; color: var(--primary); font-weight: 700; margin-bottom: 1rem; display: flex; align-items: center; gap: .5rem; }
.hero-title::before { content: ''; flex: 0 0 26px; height: 3px; background: var(--accent); }
.hero-summary { font-size: .96rem; color: var(--text-2); line-height: 1.85; max-width: 620px; margin-bottom: 2rem; text-align: justify; }

/* Stats: yellow numbers on cobalt tiles */
.hero-metrics { display: flex; flex-wrap: wrap; gap: 1rem; padding-top: 1.75rem; border-top: 1px solid var(--border); }
.metric { background: var(--brand-surface); border-radius: 12px; padding: .9rem 1.2rem; min-width: 120px; box-shadow: var(--shadow-sm); }
.metric-value { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--accent); line-height: 1.1; }
.metric-label { font-size: .68rem; color: var(--on-brand); text-transform: uppercase; letter-spacing: .1em; margin-top: .25rem; font-weight: 700; }

.hero-photo { display: flex; justify-content: center; animation: fadeUp .9s ease .15s both; }
.photo-frame { width: 460px; max-width: 100%; aspect-ratio: 1; border-radius: 20px; background: var(--card); border: 4px solid var(--accent); box-shadow: var(--shadow-lg); overflow: hidden; }
.photo-frame img { width: 100%; height: 100%; object-fit: cover; }

/* ───────── 6. BUTTONS + BADGES ───────── */
.btn, .more-btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .6rem 1.3rem; background: var(--primary); color: var(--on-primary); border: 2px solid var(--primary); border-radius: 8px; font-size: .8rem; font-weight: 800; cursor: pointer; text-transform: uppercase; letter-spacing: .05em; text-decoration: none; transition: background .2s, border-color .2s, transform .2s, color .2s; }
.btn:hover, .more-btn:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--on-primary); transform: translateY(-1px); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }   /* yellow, dark text */
.btn-accent:hover { background: var(--on-accent); border-color: var(--on-accent); color: var(--accent); }
[data-theme="dark"] .btn-accent:hover { background: #FFD066; border-color: #FFD066; color: var(--on-accent); }
.btn-outline { background: transparent; color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: var(--on-primary); }

.pub-badge { display: inline-flex; align-items: center; font-size: .68rem; font-weight: 800; letter-spacing: .08em; padding: .2rem .7rem; border-radius: 100px; margin: 0 .3rem .5rem 0; width: fit-content; background: var(--accent); color: var(--on-accent); }
.pub-badge.review { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }

/* ───────── 7. CARDS ───────── */
.research-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.r-card { display: block; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.6rem; transition: border-color .3s, box-shadow .3s, transform .3s; color: var(--text); text-decoration: none; }
a.r-card:hover, .r-card:hover { border-color: var(--border-accent); box-shadow: var(--shadow-md); transform: translateY(-3px); color: var(--text); }
.r-card-icon { width: 42px; height: 42px; border-radius: 11px; background: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; margin-bottom: .9rem; }
.r-card h3 { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; margin-bottom: .4rem; }
.r-card p, .r-card .r-card-text { font-size: .85rem; color: var(--text-2); line-height: 1.7; }
.cta-card { max-width: 650px; margin: 0 auto; text-align: center; padding: 2rem; border-top: 5px solid var(--accent); }
.cta-card h3 { font-size: 1.3rem; margin-bottom: .5rem; }
.cta-card p { margin-bottom: 1.5rem; }
.vision-text { max-width: 1000px; margin: 0 auto; color: var(--text-2); font-size: 1.02rem; line-height: 1.85; text-align: justify; }

/* ───────── 8. PUBLICATIONS + FILTER TOOLBAR ───────── */
.pub-toolbar { display: grid; gap: 1rem; margin-bottom: 1.5rem; padding: 1.1rem; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.pub-search { width: 100%; padding: .7rem 1rem; background: var(--card-alt); color: var(--text); border: 1.5px solid var(--border); border-radius: 10px; font: inherit; font-size: .92rem; }
.pub-search::placeholder { color: var(--text-muted); }
.pub-search:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px var(--border-accent); }
.pub-filters { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: center; }
.filter-group { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.filter-label { font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); margin-right: .2rem; }
.chip { padding: .3rem .85rem; border-radius: 100px; border: 1.5px solid var(--border); background: var(--card-alt); color: var(--text-2); font-size: .78rem; font-weight: 700; cursor: pointer; transition: all .2s; }
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.pub-count { font-size: .8rem; color: var(--text-muted); }
.pub-empty { text-align: center; padding: 2rem; color: var(--text-2); }

.pub-list { display: flex; flex-direction: column; gap: 1.2rem; }
.pub-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.75rem; display: grid; grid-template-columns: 64px 1fr; gap: 1.25rem; transition: box-shadow .3s, border-color .3s; }
.pub-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-accent); }
.pub-card[hidden] { display: none; }
.pub-logo { width: 60px; height: 60px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--brand-surface); color: var(--on-brand); text-align: center; line-height: 1.1; padding: 4px; }
.pub-logo-main { font-family: var(--font-display); font-weight: 700; font-size: .78rem; color: var(--accent); }
.pub-logo-sub { font-size: .5rem; letter-spacing: .03em; margin-top: 2px; opacity: .9; }
.pub-title { font-family: var(--font-display); font-size: 1.08rem; font-weight: 600; color: var(--primary); line-height: 1.5; margin-bottom: .4rem; }
.pub-authors { font-size: .85rem; color: var(--text-2); margin-bottom: .3rem; }
.pub-authors strong { color: var(--text); font-weight: 800; }
.pub-journal { font-size: .82rem; color: var(--text-muted); font-style: italic; }
.pub-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; align-items: center; }
.pub-link, .mini-btn { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; font-weight: 800; text-decoration: none; padding: .35rem .8rem; border-radius: 8px; border: 1.5px solid var(--primary); color: var(--primary); background: transparent; cursor: pointer; transition: all .2s; }
.pub-link:hover, .mini-btn:hover { background: var(--primary); color: var(--on-primary); }
.pub-link { background: var(--primary); color: var(--on-primary); }
.pub-link:hover { background: var(--primary-hover); border-color: var(--primary-hover); }

/* ───────── 9. TIMELINE (education, research) ───────── */
.timeline { max-width: 1000px; margin: 0 auto; position: relative; padding-left: 42px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 3px; background: linear-gradient(to bottom, var(--accent), var(--primary)); border-radius: 2px; }
.tl-item { position: relative; margin-bottom: 1.75rem; }
.tl-item::before { content: ''; position: absolute; left: -42px; top: 1.4rem; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); border: 3px solid var(--bg); box-shadow: 0 0 0 2px var(--primary); z-index: 1; }
.tl-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; transition: box-shadow .3s, border-color .3s; }
.tl-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-accent); }
.tl-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; width: 100%; background: none; border: none; text-align: left; color: inherit; cursor: pointer; }
.tl-head-main { flex: 1; }
.tl-year, .tl-date { font-family: var(--font-mono); font-size: .78rem; color: var(--primary); font-weight: 500; margin-bottom: .25rem; }
.tl-card h3 { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; margin-bottom: .2rem; }
.tl-card .inst { font-size: .88rem; color: var(--text-2); margin-bottom: .4rem; display: flex; align-items: center; gap: .5rem; }
.tl-card .inst img { width: 20px; height: 20px; border-radius: 4px; object-fit: contain; background: #fff; }
.tl-sub { font-size: .8rem; color: var(--text-muted); margin-top: .5rem; }
.tl-toggle { flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--primary); background: var(--card-alt); display: flex; align-items: center; justify-content: center; color: var(--primary); }
.tl-toggle svg { width: 16px; height: 16px; transition: transform .25s; }
.tl-item.open .tl-toggle svg, .proj-item.open .tl-toggle svg { transform: rotate(180deg); }
.tl-body { display: block; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.tl-item.open .tl-body { display: block; }
.tl-body p { font-size: .85rem; color: var(--text-2); line-height: 1.8; text-align: justify; }
.gpa-tag { display: inline-flex; font-family: var(--font-mono); font-size: .78rem; font-weight: 500; color: var(--on-accent); background: var(--accent); padding: .2rem .7rem; border-radius: 6px; }

.bullets { list-style: none; margin: 1rem 0; font-size: .86rem; color: var(--text-2); }
.bullets li { display: flex; gap: .6rem; align-items: flex-start; margin-bottom: .5rem; }
.bullets li::before { content: '▶'; color: var(--primary); font-size: .6rem; line-height: 1.9; min-width: 1rem; }
.bullets li span { flex: 1; text-align: justify; hyphens: auto; }

/* Image thumbnails (research + projects) */
.thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 1rem; }
.thumb { aspect-ratio: 16/10; padding: 0; background: var(--card-alt); border-radius: 8px; border: 1.5px solid var(--border); overflow: hidden; cursor: zoom-in; transition: border-color .2s, transform .2s; }
.thumb:hover { border-color: var(--primary); transform: translateY(-2px); }
.thumb img { width: 100%; height: 100%; object-fit: contain; background: var(--bg); }

/* ───────── 10. LISTS: experience, training, courses, volunteering, skills ───────── */
.experience-list, .training-list, .course-list { display: flex; flex-direction: column; gap: .7rem; margin: 0 auto; }
.experience-list { max-width: 1000px; }
.training-list, .course-list { max-width: 1000px; }
.experience-item, .train-item, .course-item { display: flex; gap: 1rem; padding: 1.1rem 1.3rem; background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 11px; align-items: center; transition: border-color .25s, box-shadow .25s; }
.experience-item { align-items: flex-start; }
.experience-item:hover, .train-item:hover, .course-item:hover { border-color: var(--border-accent); border-left-color: var(--accent); box-shadow: var(--shadow-sm); }
.experience-date, .train-date, .course-date { font-family: var(--font-mono); font-size: .74rem; color: var(--primary); flex: 0 0 112px; width: 112px; line-height: 1.5; font-weight: 500; }   /* fixed width = every text column lines up */
.date-line { display: block; white-space: nowrap; }
.train-logo { width: 40px; height: 40px; flex-shrink: 0; background: #fff; border-radius: 8px; padding: 3px; display: flex; align-items: center; justify-content: center; }
.train-logo img { width: 100%; height: 100%; object-fit: contain; }
.experience-item h4, .train-item h4, .course-item h4 { font-size: .92rem; font-weight: 700; margin-bottom: .1rem; }
.experience-item h5, .train-item h5 { font-size: .82rem; color: var(--text-2); font-weight: 600; }
.experience-item p, .train-item p, .course-company { font-size: .82rem; color: var(--text-muted); margin: 0; }
.course-info { flex: 1; }
.course-item.course-hidden { display: none; }
.course-list.expanded .course-item.course-hidden { display: flex; }

.skills-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.skill-group { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.skill-group h3 { font-family: var(--font-display); font-size: 1.05rem; margin-bottom: .9rem; padding-bottom: .65rem; border-bottom: 2px solid var(--accent); }
.skill-tags { display: flex; flex-wrap: wrap; gap: .35rem; list-style: none; }
.skill-tag { font-size: .78rem; padding: .3rem .7rem; background: var(--card-alt); border: 1px solid var(--border); border-radius: 7px; color: var(--text-2); font-weight: 600; transition: all .2s; }
.skill-tag:hover { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

/* ───────── 11. PROJECTS (accordion) ───────── */
.proj-list { display: flex; flex-direction: column; gap: .6rem; max-width: 1000px; margin: 0 auto; }
.proj-item { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: border-color .25s; }
.proj-item:hover { border-color: var(--border-accent); }
.proj-header { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.25rem; cursor: default; width: 100%; background: none; border: none; text-align: left; color: inherit; }
.proj-num { flex-shrink: 0; width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; font-size: .9rem; }
.proj-main { flex: 1; min-width: 0; }
.proj-title { font-family: var(--font-display); font-size: 1rem; font-weight: 600; color: var(--primary); }
.proj-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-left: auto; padding-left: 1rem; justify-content: flex-end; }
.proj-tag { font-size: .72rem; padding: .2rem .6rem; border-radius: 6px; background: var(--card-alt); border: 1px solid var(--border); color: var(--text-2); white-space: nowrap; }
.proj-body { display: block; padding: 0 1.25rem 1.25rem calc(1.25rem + 38px + 1rem); border-top: 1px solid var(--border); }
@media (max-width: 600px) { .proj-body { padding-left: 1.25rem; } }
.proj-item.open .proj-body { display: block; }
.proj-desc-full { font-size: .86rem; color: var(--text-2); margin: 1rem 0 .75rem; line-height: 1.8; text-align: justify; }
.proj-highlights { list-style: none; font-size: .85rem; color: var(--text-2); line-height: 1.75; margin-top: .6rem; }
.proj-highlights li { margin-bottom: .45rem; text-align: justify; }
.proj-highlights strong { color: var(--text); }

/* Home: carousel (left) and news (right) side by side */
.home-split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 2.5rem; align-items: start; }
.home-split > :only-child { grid-column: 1 / -1; }
.home-split .featured-carousel, .home-split .news-list { max-width: none; }
.home-split .featured-slides { height: 540px; }   /* tall enough to line up with the news column */
.home-split .news-item { grid-template-columns: 1fr; gap: .2rem; }
.home-split-side .sec-header, .home-split-main .sec-header { margin-bottom: 1.2rem; }

/* ───────── 12. HOME CAROUSEL (swipe-ready) ───────── */
.featured-section { padding: 0 0 2.5rem; background: var(--bg); }
.featured-carousel { position: relative; max-width: 1000px; margin: 0 auto; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-md); }
.featured-slides { position: relative; width: 100%; height: 400px; overflow: hidden; background: var(--bg-alt); touch-action: pan-y; user-select: none; }
.featured-slide { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: opacity .6s ease, visibility 0s linear .6s; }
.featured-slide.active { opacity: 1; visibility: visible; transition: opacity .6s ease; }
.featured-slide img { max-width: 100%; max-height: 100%; object-fit: contain; -webkit-user-drag: none; }
.featured-caption { position: absolute; left: 0; right: 0; bottom: 0; padding: .55rem 1rem .55rem 1.1rem; background: var(--accent); color: var(--on-accent); font-size: .82rem; font-weight: 800; z-index: 5; }
.featured-arrow, .modal-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; background: var(--brand-surface); color: var(--on-brand); border: 2px solid var(--on-brand); cursor: pointer; font-size: 18px; display: flex; align-items: center; justify-content: center; transition: background .2s, color .2s, transform .2s; z-index: 10; }
.featured-arrow:hover, .modal-arrow:hover { background: var(--accent); color: var(--on-accent); border-color: var(--accent); transform: translateY(-50%) scale(1.1); }
.featured-arrow.prev, .modal-arrow.prev { left: 12px; }
.featured-arrow.next, .modal-arrow.next { right: 12px; }
.featured-dots, .modal-dots { position: absolute; bottom: 44px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 10; padding: 5px 9px; background: rgba(14,19,32,.55); border-radius: 100px; }
.modal-dots { bottom: 12px; }
.featured-dot, .modal-dot { width: 10px; height: 10px; border-radius: 50%; background: transparent; border: 2px solid #fff; cursor: pointer; padding: 0; transition: all .3s; }
.featured-dot.active, .modal-dot.active { background: var(--accent); border-color: var(--accent); width: 26px; border-radius: 5px; }

/* ───────── 13. GALLERY MODAL (research + project images) ───────── */
.modal-overlay { position: fixed; inset: 0; background: var(--overlay); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); z-index: 2000; display: none; align-items: center; justify-content: center; }
.modal-overlay.active { display: flex; }
.modal { position: relative; width: 90%; max-width: 900px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; border-top: 5px solid var(--accent); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.5rem; border-bottom: 1px solid var(--border); }
.modal-title { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; color: var(--primary); }
.modal-close { width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--border); background: var(--card-alt); cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text); transition: all .2s; }
.modal-close:hover { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.modal-carousel { position: relative; width: 100%; height: 420px; overflow: hidden; background: var(--bg); touch-action: pan-y; }
.modal-slides { position: relative; width: 100%; height: 100%; }
.modal-slide { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: opacity .4s; }
.modal-slide.active { opacity: 1; visibility: visible; }
.modal-slide img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* ───────── 14. NEWS ───────── */
.news-list { list-style: none; max-width: 1000px; margin: 0 auto; display: flex; flex-direction: column; gap: .7rem; }
.news-item { display: grid; grid-template-columns: 92px 1fr; gap: 1rem; align-items: start; padding: 1rem 1.2rem; background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 11px; }
.news-date { font-family: var(--font-mono); font-size: .76rem; color: var(--primary); font-weight: 500; padding-top: .1rem; }
.news-tag { display: inline-block; font-size: .64rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; background: var(--accent); color: var(--on-accent); padding: .1rem .55rem; border-radius: 100px; margin-bottom: .25rem; }
.news-text { font-size: .9rem; color: var(--text-2); line-height: 1.6; }
.news-text a { font-weight: 700; }

/* ───────── 15. CONTACT + FORM + REFERENCES ───────── */
.contact-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; }
.contact-info, .ref-list { display: flex; flex-direction: column; gap: .85rem; }
.c-item, .ref-card { display: flex; gap: .9rem; padding: 1.1rem; background: var(--card); border: 1px solid var(--border); border-radius: 11px; align-items: center; transition: border-color .25s; }
.c-item:hover, .ref-card:hover { border-color: var(--border-accent); }
.c-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.c-icon svg { width: 20px; height: 20px; stroke: currentColor; }
.c-label { font-size: .7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 800; }
.c-value { font-size: .92rem; color: var(--text); word-break: break-word; }
.c-value a { font-weight: 700; }
.contact-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: .4rem; }

.contact-form { display: grid; gap: 1rem; padding: 1.5rem; background: var(--card); border: 1px solid var(--border); border-top: 5px solid var(--accent); border-radius: var(--radius); }
.form-row { display: grid; gap: .35rem; }
.form-row label { font-size: .78rem; font-weight: 800; color: var(--text); letter-spacing: .03em; }
.form-row input, .form-row textarea { width: 100%; padding: .7rem .9rem; background: var(--card-alt); color: var(--text); border: 1.5px solid var(--border); border-radius: 10px; font: inherit; font-size: .92rem; }
.form-row textarea { min-height: 140px; resize: vertical; }
.form-row input:focus, .form-row textarea:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px var(--border-accent); }
.form-hp { position: absolute; left: -9999px; height: 0; width: 0; overflow: hidden; }   /* honeypot, hidden from people */
.form-status { font-size: .88rem; font-weight: 700; min-height: 1.4em; }
.form-status.ok { color: var(--ok); }
.form-status.error { color: var(--error); }

.ref-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--brand-surface); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 1rem; font-weight: 700; color: var(--accent); flex-shrink: 0; }
.ref-card h4 { font-size: .92rem; font-weight: 700; color: var(--text); }
.ref-title { font-size: .78rem; color: var(--primary); font-weight: 700; }
.ref-dept { font-size: .76rem; color: var(--text-muted); }
.ref-institution { font-size: .76rem; color: var(--text-muted); }
.ref-email { font-family: var(--font-mono); font-size: .72rem; }

/* ───────── 16. FOOTER (cobalt, beige text, yellow hover) + MISC ───────── */
footer { background: var(--brand-surface); color: var(--on-brand); padding: .8rem 0; margin-top: 1.5rem; border-top: 3px solid var(--accent); }
.footer-inner { max-width: var(--container); margin: 0 auto; padding: 0 2rem; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1rem; }
.footer-text { font-size: .82rem; color: var(--on-brand); }
.footer-text a, footer a { color: var(--on-brand); text-decoration: none; }
.footer-text a:hover, footer a:hover { color: var(--accent); }
.footer-nav { display: flex; flex-wrap: wrap; gap: .3rem 1rem; list-style: none; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.footer-nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.footer-social { display: flex; gap: .5rem; }
.footer-social a { width: 30px; height: 30px; border-radius: 8px; background: var(--on-brand); border: 2px solid transparent; display: flex; align-items: center; justify-content: center; transition: background .2s, border-color .2s, transform .2s; }
.footer-social a:hover { background: var(--accent); transform: translateY(-2px); }
.footer-social img { width: 22px; height: 22px; object-fit: contain; }
.footer-social svg { width: 18px; height: 18px; stroke: #14181F; }
footer :focus-visible { outline-color: var(--accent); }
.footer-right { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: .25rem; }
.footer-copy { text-align: right; font-size: .72rem; opacity: .85; margin-top: 0; }

.btt { position: fixed; bottom: 2rem; right: 2rem; width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: var(--on-accent); border: none; cursor: pointer; font-size: 1.1rem; font-weight: 800; display: none; align-items: center; justify-content: center; box-shadow: var(--shadow-md); transition: transform .3s; z-index: 999; }
.btt { padding: 0; line-height: 0; }
.btt svg { display: block; margin: auto; }
.btt.show { display: flex; }
.btt:hover { transform: translateY(-3px); }

.toast { position: fixed; left: 50%; bottom: 2rem; transform: translate(-50%, 20px); background: var(--brand-surface); color: var(--on-brand); border-left: 5px solid var(--accent); padding: .7rem 1.2rem; border-radius: 10px; font-size: .86rem; font-weight: 700; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 3000; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Scroll-in animation: only hides content when JS is running (class "js" set in <head>) */
.js .anim { opacity: 0; transform: translateY(18px); transition: opacity .55s ease, transform .55s ease; }
.js .anim.visible { opacity: 1; transform: none; }

/* ───────── 17. RESPONSIVE ───────── */
@media (max-width: 960px) {
  .home-split { grid-template-columns: 1fr; gap: 2rem; }
  .home-split .featured-slides { height: 400px; }
  .hero-grid { grid-template-columns: 1fr; text-align: center; gap: 2rem; }
  .hero-summary { margin: 0 auto 2rem; }
  .hero-metrics { justify-content: center; }
  .hero-affiliation { margin: 0 auto 1.5rem; }
  .hero-title { justify-content: center; }
  .photo-frame { width: 280px; }
  .research-grid, .skills-grid { grid-template-columns: 1fr 1fr; }
  .contact-layout { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .nav-inner { padding: 0 1rem; }
  .hamburger { display: inline-flex; }
  .nav-links { display: none; position: absolute; top: var(--nav-h); left: 0; right: 0; flex-direction: column; background: var(--brand-surface); padding: .6rem 1rem 1rem; border-bottom: 3px solid var(--accent); box-shadow: var(--shadow-md); }
  .nav-links.open { display: flex; }
  .nav-links a { padding: .8rem .8rem; border-bottom: none; border-left: 4px solid transparent; border-radius: 6px; }
  .nav-links a.active { border-left-color: var(--accent); background: rgba(237,236,230,.1); }
  .container { padding: 0 1rem; }
  .research-grid, .skills-grid { grid-template-columns: 1fr; }
  .pub-card { grid-template-columns: 1fr; padding: 1.25rem; }
  .pub-logo { display: none; }
  .featured-slides, .home-split .featured-slides { height: 260px; }
  .modal-carousel { height: 280px; }
  .modal { width: 95%; }
  .featured-arrow, .modal-arrow { width: 36px; height: 36px; font-size: 15px; }
  .proj-tags { display: none; }
  .train-item, .course-item, .experience-item { flex-wrap: wrap; }
  .news-item { grid-template-columns: 1fr; gap: .2rem; }
  .timeline { padding-left: 30px; }
  .tl-item::before { left: -30px; }
  .footer-inner { justify-content: center; text-align: center; padding: 0 1rem; }
  section { padding: 2.5rem 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .js .anim { opacity: 1; transform: none; }
}

@media print {
  nav#mainNav, .btt, .theme-toggle, .toast, footer .footer-social { display: none !important; }
  body { background: #fff; color: #000; }
  .js .anim { opacity: 1; transform: none; }
}
