/* ==========================================================================
   Shahariar Ryehan — Academic Site
   Design system: warm off-white academic theme
   ========================================================================== */

:root {
  --bg:            #ffffff;
  --bg-alt:        #ffffff;
  --card:          #ffffff;
  --card-border:   #e6e0d3;
  --ink:           #232019;
  --ink-soft:      #5b5648;
  --ink-faint:     #8a8474;
  --accent:        #1f3a5f;   /* deep academic navy */
  --accent-soft:   #345580;
  --accent-tint:   #e9eef4;
  --rust:          #a8501f;   /* warm secondary accent */
  --rust-tint:     #f6e9df;
  --gold:          #b6862c;
  --line:          #e2dbca;
  --shadow:        0 1px 2px rgba(35,32,25,0.04), 0 8px 24px -12px rgba(35,32,25,0.12);
  --shadow-lg:      0 4px 12px rgba(35,32,25,0.06), 0 24px 48px -24px rgba(35,32,25,0.20);
  --radius:        14px;
  --radius-sm:     8px;
  --serif: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --hand: "Caveat", "Segoe Script", cursive;
  --maxw: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--rust); }

h1, h2, h3, h4 {
  font-family: var(--sans);
  color: var(--ink);
  line-height: 1.18;
  margin: 0 0 0.5em;
  font-weight: 800;
  letter-spacing: -0.015em;
}

h1 { font-size: clamp(2.1rem, 4vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
h3 { font-size: 1.22rem; font-weight: 700; }

p { margin: 0 0 1em; color: var(--ink-soft); }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------- Eyebrow / section labels ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--hand);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--rust);
  margin-bottom: 10px;
  transform: rotate(-1.2deg);
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--rust);
  display: inline-block;
  transform: translateY(1px);
}

/* ---------- Top navigation ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
  white-space: nowrap;
}
.brand:hover { color: var(--ink); }
.brand span { color: var(--rust); }
.brand-mark { flex-shrink: 0; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 999px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.nav-links a:hover { background: rgba(35,32,25,0.05); color: var(--accent); }
.nav-links a.active { color: var(--accent); font-weight: 700; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s, color 0.15s;
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-soft); color: #fff; transform: translateY(-1px); }
.btn-outline { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 7px 14px; font-size: 0.82rem; }

/* ---------- Hero ---------- */
.hero {
  padding: 72px 0 56px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 56px;
  align-items: center;
}
.hero-kicker {
  font-family: var(--hand);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--accent);
  margin-bottom: 10px;
  transform: rotate(-1deg);
}
.hero h1 { margin-bottom: 18px; }
.hero .lede {
  font-size: 1.12rem;
  color: var(--ink-soft);
  max-width: 54ch;
  margin-bottom: 28px;
}
.hero .lede::first-letter {
  font-family: var(--serif);
  font-size: 2.6em;
  font-weight: 700;
  color: var(--rust);
  float: left;
  line-height: 0.78;
  padding: 4px 6px 0 0;
}
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.hero-photo {
  position: relative;
  transform: rotate(-1.6deg);
  transition: transform 0.25s ease;
}
.hero-photo:hover { transform: rotate(0deg); }
.hero-photo img {
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  border: 8px solid var(--card);
}
.hero-photo::before {
  content: "";
  position: absolute;
  top: -14px;
  left: 50%;
  width: 74px;
  height: 26px;
  background: rgba(182,134,44,0.35);
  border: 1px solid rgba(182,134,44,0.45);
  transform: translateX(-50%) rotate(-3deg);
  box-shadow: 0 2px 4px rgba(35,32,25,0.12);
}
.hero-photo .tag-float {
  position: absolute;
  bottom: -16px;
  left: -16px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 10px 16px;
  font-family: var(--hand);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--accent);
  transform: rotate(2deg);
}

.social-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.social-chip {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  font-size: 0.85rem;
  font-weight: 700;
  transition: all 0.15s;
}
.social-chip:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- Sections ---------- */
section { padding: 56px 0; }
section.alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head {
  max-width: 640px;
  margin-bottom: 40px;
}
.section-head p { font-size: 1.02rem; }
.section-head h2::after {
  content: "";
  display: block;
  width: min(220px, 60%);
  height: 8px;
  margin-top: 2px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12'%3E%3Cpath d='M2 8 C 30 2, 60 10, 90 6 S 150 2, 198 7' fill='none' stroke='%23a8501f' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 100% 100%;
  opacity: 0.55;
}

hr.divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: 0;
}

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 1px 2px rgba(35,32,25,0.03), 0 3px 10px -6px rgba(35,32,25,0.10);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(35,32,25,0.05), 0 10px 20px -10px rgba(35,32,25,0.16);
}
.card-grid {
  display: grid;
  gap: 24px;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ---------- Stat cards ---------- */
.stat-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 22px 20px;
  text-align: left;
}
.stat-num {
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--accent);
  display: block;
  margin-bottom: 4px;
}
.stat-label {
  font-size: 0.85rem;
  color: var(--ink-faint);
  font-weight: 500;
}

/* ---------- Featured / flagship project block ---------- */
.feature-block {
  position: relative;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.feature-block > * { position: relative; }

/* ---------- Placeholder figure ---------- */
.fig-placeholder {
  border: 1.5px dashed #c7c2b4;
  background: repeating-linear-gradient(135deg, #ffffff, #ffffff 10px, #f6f5f2 10px, #f6f5f2 20px);
  border-radius: var(--radius-sm);
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  color: var(--ink-faint);
  gap: 8px;
}
.fig-placeholder svg { width: 34px; height: 34px; opacity: 0.55; }
.fig-placeholder .fp-title { font-family: var(--hand); font-weight: 600; font-size: 1.2rem; color: var(--ink-soft); }
.fig-placeholder .fp-desc { font-size: 0.78rem; max-width: 30ch; }
.fig-placeholder.sm { min-height: 120px; padding: 14px; gap: 4px; }
.fig-placeholder.sm .fp-title { font-size: 1rem; }
.fig-placeholder.sm .fp-desc { font-size: 0.72rem; max-width: 24ch; }
.fig-placeholder.thumb { min-height: 84px; aspect-ratio: 4/3; padding: 8px; gap: 2px; border-radius: var(--radius-sm); }
.fig-placeholder.thumb .fp-title { font-size: 0.78rem; }
.fig-placeholder.thumb .fp-desc { font-size: 0.64rem; max-width: 20ch; }

figure { margin: 0; }
figcaption {
  font-size: 0.82rem;
  color: var(--ink-faint);
  margin-top: 10px;
  line-height: 1.5;
}
figcaption b { color: var(--ink-soft); }

/* ---------- Timeline ---------- */
.timeline {
  position: relative;
  padding-left: 32px;
  border-left: 2px solid var(--line);
}
.tl-item { position: relative; padding-bottom: 40px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: "";
  position: absolute;
  left: -38px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent);
}
.tl-date {
  font-family: var(--hand);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--rust);
  margin-bottom: 2px;
}
.tl-item h3 { margin-bottom: 4px; }
.tl-org { font-size: 0.92rem; color: var(--ink-faint); margin-bottom: 10px; font-style: italic; }

/* ---------- Pills / tags ---------- */
.tag {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--accent);
  color: var(--accent);
  margin: 0 6px 6px 0;
}
.tag.rust { border-color: var(--rust); color: var(--rust); }

/* ---------- Publication list ---------- */
.pub {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 20px;
}
.pub .pub-badge { line-height: 1.05; }
.pub:last-child { border-bottom: none; }
.pub-badge {
  font-family: var(--hand);
  font-size: 1.15rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.01em;
  color: var(--rust);
  padding-top: 0;
}
.pub h3 { margin-bottom: 6px; font-size: 1.08rem; }
.pub .venue { font-style: italic; color: var(--ink-faint); font-size: 0.9rem; margin-bottom: 8px; }
.pub .desc { font-size: 0.94rem; margin-bottom: 10px; }

/* ---------- People / mentor cards ---------- */
.person-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px;
}
.person-card img {
  width: 64px; height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--card-border);
}
.person-card:nth-child(odd) img { transform: rotate(-2deg); }
.person-card:nth-child(even) img { transform: rotate(2deg); }
.person-card .role { font-size: 0.76rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--rust); margin-bottom: 4px; }
.person-card h3 { font-size: 1rem; margin-bottom: 2px; }
.person-card .org { font-size: 0.85rem; color: var(--ink-faint); margin-bottom: 6px; }
.person-card a.email { font-size: 0.82rem; }

/* ---------- Gallery ---------- */
.gallery-item {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--card-border);
  background: var(--card);
  box-shadow: 0 1px 2px rgba(35,32,25,0.04), 0 6px 14px -10px rgba(35,32,25,0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.gallery-item:nth-child(4n+1) { transform: rotate(-0.9deg); }
.gallery-item:nth-child(4n+2) { transform: rotate(0.7deg); }
.gallery-item:nth-child(4n+3) { transform: rotate(-0.5deg); }
.gallery-item:nth-child(4n+4) { transform: rotate(1deg); }
.gallery-item:hover {
  transform: rotate(0deg) translateY(-3px);
  box-shadow: 0 4px 8px rgba(35,32,25,0.08), 0 14px 24px -14px rgba(35,32,25,0.24);
}
.gallery-item img { width: 100%; height: 200px; object-fit: cover; }
.gallery-cap { padding: 12px 14px; font-size: 0.85rem; color: var(--ink-soft); font-weight: 600; }

/* ---------- Footer ---------- */
footer {
  background: var(--bg);
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  padding: 48px 0 28px;
  margin-top: 40px;
}
footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}
footer .f-name { font-family: var(--sans); font-weight: 800; color: var(--ink); font-size: 1.1rem; }
footer .f-name::after {
  content: "— thanks for reading";
  display: block;
  font-family: var(--hand);
  font-size: 1.05rem;
  color: var(--rust);
  margin-top: 4px;
  transform: rotate(-1deg);
}
footer a { color: var(--ink-soft); }
footer a:hover { color: var(--rust); }
footer .f-copy { font-size: 0.8rem; color: var(--ink-faint); margin-top: 6px; }
footer .social-chip { background: #fff; border-color: var(--card-border); color: var(--ink-soft); }
footer .social-chip:hover { background: var(--rust); border-color: var(--rust); color: #fff; }

/* ---------- CTA band ---------- */
.cta-band {
  background: var(--bg-alt);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 48px 0;
  text-align: center;
}
.cta-band h2 { margin-bottom: 10px; }
.cta-band p { max-width: 52ch; margin-left: auto; margin-right: auto; margin-bottom: 22px; }

/* ---------- Page header (non-home pages) ---------- */
.page-hero {
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--line);
}
.page-hero .eyebrow { margin-bottom: 10px; }
.page-hero p { font-size: 1.05rem; max-width: 62ch; }

/* ---------- Gentle entrance / float motion ---------- */
@keyframes gentleRise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes gentleFloat {
  0%, 100% { transform: rotate(-1.6deg) translateY(0); }
  50%      { transform: rotate(-1.6deg) translateY(-8px); }
}
.hero-photo { animation: gentleRise 0.7s ease both, gentleFloat 6s ease-in-out 0.7s infinite; }
.hero-photo:hover { animation-play-state: paused; transform: rotate(0deg); }
.hero-kicker, .hero h1, .hero .lede, .hero-actions { animation: gentleRise 0.6s ease both; }
.hero h1 { animation-delay: 0.08s; }
.hero .lede { animation-delay: 0.16s; }
.hero-actions { animation-delay: 0.24s; }
.page-hero .eyebrow, .page-hero h1, .page-hero p { animation: gentleRise 0.6s ease both; }
.page-hero h1 { animation-delay: 0.08s; }
.page-hero p { animation-delay: 0.16s; }
@media (prefers-reduced-motion: reduce) {
  .hero-photo, .hero-kicker, .hero h1, .hero .lede, .hero-actions,
  .page-hero .eyebrow, .page-hero h1, .page-hero p { animation: none; }
}

/* ---------- CV nav link ---------- */
.nav-links a.cv-link {
  border: 1px solid var(--line);
  font-family: var(--hand);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--rust);
  padding: 6px 16px;
  margin-left: 4px;
}
.nav-links a.cv-link:hover { background: var(--rust-tint); border-color: var(--rust); color: var(--rust); }

/* ---------- University / lab logo strip ---------- */
.uni-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.uni-chip {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
}
.uni-chip img { height: 42px; width: auto; max-width: 120px; object-fit: contain; }
.uni-chip .uc-mark {
  width: 44px; height: 44px; border-radius: 50%;
  background: #fff; border: 1.5px solid var(--accent); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--sans); font-weight: 800; font-size: 1rem; flex-shrink: 0;
}
.uni-chip .uc-text { display: flex; flex-direction: column; line-height: 1.2; }
.uni-chip .uc-text small { font-family: var(--sans); font-weight: 500; font-size: 0.76rem; color: var(--ink-faint); }

/* ---------- Uniform lab-photo tiles ---------- */
.lab-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* ---------- Lab / research-stage blocks (Research page) ---------- */
.lab-block { padding: 56px 0; border-top: 1px solid var(--line); }
.lab-block:first-of-type { border-top: none; }
.lab-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.lab-num {
  font-family: var(--hand);
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--rust);
  line-height: 1;
  transform: rotate(-2deg);
}
.lab-head h2 { margin-bottom: 0; }
.lab-place { font-size: 0.92rem; color: var(--ink-faint); font-style: italic; margin-bottom: 24px; }
.lab-block .section-head { margin-bottom: 24px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-photo { max-width: 320px; margin: 0 auto; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
  .nav { flex-direction: column; align-items: flex-start; gap: 12px; }
}
@media (max-width: 640px) {
  .container { padding: 0 20px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .pub { grid-template-columns: 1fr; gap: 6px; }
  footer .container { flex-direction: column; align-items: flex-start; }
}