/* ============================================================
   Erfan Yazdandoost Hamedani — Academic Website
   Design system: modern neutral (deep slate + teal)
   ============================================================ */

:root {
  --bg: #f7f9fa;
  --bg-alt: #eef3f5;
  --surface: #ffffff;
  --ink: #10202b;
  --text: #2a3b47;
  --muted: #5b6b76;
  --line: #dde5e9;
  --accent: #0e7c86;
  --accent-dark: #0a5a62;
  --accent-soft: #e2f0f1;
  --gold: #b3871e;
  --gold-soft: #f7efdc;
  --deep: #0f2a35;
  --deep-2: #123644;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 32, 43, 0.05), 0 8px 24px -12px rgba(16, 32, 43, 0.12);
  --shadow-lg: 0 2px 4px rgba(16, 32, 43, 0.06), 0 18px 44px -16px rgba(16, 32, 43, 0.22);
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--ink);
  line-height: 1.2;
  margin: 0 0 0.5em;
  font-weight: 600;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; }

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

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

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

.narrow { max-width: 860px; }

/* ---------- Navigation ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.brand {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.06rem;
  color: var(--ink);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.brand span { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-links a {
  display: block;
  padding: 8px 11px;
  border-radius: 8px;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 500;
}

.nav-links a:hover { background: var(--bg-alt); color: var(--ink); }

.nav-links a.active {
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-weight: 600;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  color: var(--ink);
}

.nav-toggle svg { display: block; }

@media (max-width: 950px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    padding: 10px 16px 16px;
    box-shadow: var(--shadow-lg);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 14px; font-size: 1rem; }
}

/* ---------- Sections ---------- */

.section { padding: 72px 0; }
.section-alt { background: var(--bg-alt); }
.section-tight { padding: 48px 0; }

.kicker {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin-bottom: 10px;
}

.section-head { margin-bottom: 34px; }
.section-head p { color: var(--muted); max-width: 640px; }

.lede { font-size: 1.12rem; color: var(--text); }

/* ---------- Hero (home) ---------- */

.hero {
  background:
    radial-gradient(1000px 420px at 85% -10%, rgba(14, 124, 134, 0.10), transparent 60%),
    radial-gradient(700px 380px at -10% 110%, rgba(179, 135, 30, 0.07), transparent 55%),
    linear-gradient(180deg, #fdfefe, var(--bg));
  border-bottom: 1px solid var(--line);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 48px;
  align-items: center;
  padding: 72px 0 64px;
}

.hero .name { margin-bottom: 6px; }

.hero .role {
  font-size: 1.12rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.hero .role strong { color: var(--text); font-weight: 600; }

.hero-tagline {
  margin-top: 18px;
  font-size: 1.06rem;
  max-width: 560px;
}

.hero-actions { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 10px; }

.hero-meta {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: var(--muted);
  font-size: 0.92rem;
}

.hero-meta span { display: inline-flex; align-items: center; gap: 7px; }

.portrait-wrap { display: flex; justify-content: center; }

.portrait {
  width: min(300px, 70vw);
  aspect-ratio: 1;
  border-radius: 50%;
  box-shadow: var(--shadow-lg);
  border: 6px solid #ffffff;
  overflow: hidden;
  background: var(--deep);
}

.portrait img, .portrait svg { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 820px) {
  .hero-inner { grid-template-columns: 1fr; gap: 30px; padding: 48px 0 44px; }
  .portrait-wrap { order: -1; }
  .portrait { width: min(210px, 55vw); }
}

/* ---------- Page hero (interior pages) ---------- */

.page-hero {
  background: linear-gradient(180deg, #fdfefe, var(--bg));
  border-bottom: 1px solid var(--line);
  padding: 56px 0 44px;
}

.page-hero p { color: var(--muted); max-width: 680px; margin-bottom: 0; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.94rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:active { transform: translateY(1px); }

.btn-solid { background: var(--accent-dark); color: #ffffff !important; }
.btn-solid:hover { background: var(--accent); box-shadow: var(--shadow); }

.btn-outline { border-color: var(--line); background: var(--surface); color: var(--ink) !important; }
.btn-outline:hover { border-color: var(--accent); color: var(--accent-dark) !important; }

.btn-light { background: rgba(255, 255, 255, 0.14); color: #ffffff !important; border-color: rgba(255, 255, 255, 0.35); }
.btn-light:hover { background: rgba(255, 255, 255, 0.24); }

.btn svg { flex: none; }

/* ---------- Cards & grids ---------- */

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }

@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: 0 1px 2px rgba(16, 32, 43, 0.04);
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); border-color: #cfdade; }

.card h3 { margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 0.95rem; margin-bottom: 0; }

.card-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

/* ---------- Chips / tags ---------- */

.chip {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.chip-gold { background: var(--gold-soft); color: #8a6614; }
.chip-plain { background: var(--bg-alt); color: var(--muted); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Publications ---------- */

.pub-group { margin-bottom: 52px; }
.pub-group:last-child { margin-bottom: 0; }

.pub-group h2 {
  font-size: 1.4rem;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 6px;
}

.pub {
  padding: 22px 4px;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 18px;
}

.pub:last-child { border-bottom: none; }

.year-badge {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--accent-dark);
  padding-top: 2px;
}

.pub-title { font-weight: 600; color: var(--ink); font-size: 1.03rem; margin-bottom: 4px; line-height: 1.45; }
.pub-authors { font-size: 0.93rem; color: var(--muted); margin-bottom: 3px; }
.pub-authors strong { color: var(--text); font-weight: 600; }
.pub-venue { font-size: 0.93rem; font-style: italic; color: var(--text); margin-bottom: 8px; }
.pub-venue .accept { font-style: normal; color: var(--muted); font-size: 0.85rem; }

.pub-links { display: flex; flex-wrap: wrap; gap: 8px; }

.pub-links a, .link-pill {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent-dark);
  background: #fff;
}

.pub-links a:hover { border-color: var(--accent); background: var(--accent-soft); }

.adv-note {
  font-size: 0.88rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 16px;
  margin: 18px 0 34px;
}

sup.adv { color: var(--accent-dark); font-weight: 700; }

@media (max-width: 560px) {
  .pub { grid-template-columns: 1fr; gap: 4px; }
  .year-badge { font-size: 0.9rem; }
}

/* ---------- Timeline (news, education) ---------- */

.timeline { position: relative; margin: 0; padding: 0 0 0 26px; list-style: none; }

.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--line);
}

.timeline li { position: relative; padding: 0 0 30px 18px; }
.timeline li:last-child { padding-bottom: 4px; }

.timeline li::before {
  content: "";
  position: absolute;
  left: -26px;
  top: 7px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.timeline .tl-date {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-dark);
  display: block;
  margin-bottom: 3px;
}

.timeline .tl-title { font-weight: 600; color: var(--ink); }
.timeline p { color: var(--muted); font-size: 0.95rem; margin: 4px 0 0; }

.timeline li.gold::before { background: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft); }

/* ---------- Lists ---------- */

.styled-list { margin: 0; padding: 0; list-style: none; }

.styled-list li {
  position: relative;
  padding: 10px 0 10px 26px;
  border-bottom: 1px dashed var(--line);
}

.styled-list li:last-child { border-bottom: none; }

.styled-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 19px;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--accent);
  transform: rotate(45deg);
}

.styled-list .when { color: var(--muted); font-size: 0.88rem; }

/* ---------- Members ---------- */

.member-card { text-align: left; display: flex; flex-direction: column; }

.member-card .avatar { margin-bottom: 16px; }

.avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  overflow: hidden;
  flex: none;
  box-shadow: var(--shadow);
  border: 3px solid #fff;
}

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

.member-card h3 { margin-bottom: 2px; font-size: 1.12rem; }
.member-role { color: var(--accent-dark); font-weight: 600; font-size: 0.87rem; margin-bottom: 8px; }
.member-card p { font-size: 0.92rem; }
.member-card .member-links { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Callout ---------- */

.callout {
  background: linear-gradient(120deg, var(--deep), var(--deep-2) 55%, #14505c);
  color: #e8f1f2;
  border-radius: 18px;
  padding: 38px 40px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  box-shadow: var(--shadow-lg);
}

.callout h3 { color: #ffffff; font-size: 1.45rem; margin-bottom: 6px; }
.callout p { color: #b9cdd2; margin: 0; max-width: 560px; }

/* ---------- Contact ---------- */

.contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }

@media (max-width: 820px) { .contact-grid { grid-template-columns: 1fr; } }

.contact-card { display: flex; gap: 14px; align-items: flex-start; }
.contact-card .card-icon { margin-bottom: 0; width: 42px; height: 42px; flex: none; }
.contact-card h3 { font-size: 1rem; margin-bottom: 2px; font-family: var(--font-sans); font-weight: 700; }
.contact-card p, .contact-card a { font-size: 0.93rem; color: var(--muted); margin: 0; word-break: break-word; }
.contact-card a { color: var(--accent-dark); }

/* ---------- Footer ---------- */

.footer {
  background: var(--deep);
  color: #9fb6bd;
  padding: 52px 0 40px;
  margin-top: 88px;
  font-size: 0.92rem;
}

.footer a { color: #cfe0e4; }
.footer a:hover { color: #ffffff; }

.footer-inner { display: flex; flex-wrap: wrap; gap: 30px; justify-content: space-between; }

.footer .f-name { font-family: var(--font-serif); font-size: 1.15rem; color: #ffffff; font-weight: 600; margin-bottom: 6px; }

.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; margin: 0; padding: 0; }

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin-top: 34px;
  padding-top: 20px;
  font-size: 0.82rem;
  color: #7e969e;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
}

/* ---------- TinyML feature ---------- */

.tinyml-hero {
  background:
    radial-gradient(900px 500px at 110% -20%, rgba(20, 184, 166, 0.25), transparent 55%),
    radial-gradient(700px 420px at -15% 115%, rgba(179, 135, 30, 0.22), transparent 55%),
    linear-gradient(130deg, #0b2028, var(--deep-2) 60%, #14505c);
  color: #dceef0;
  border-radius: 22px;
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.tinyml-hero-inner {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 30px;
  align-items: center;
  padding: 54px 52px;
  position: relative;
  z-index: 1;
}

@media (max-width: 880px) {
  .tinyml-hero-inner { grid-template-columns: 1fr; padding: 38px 28px; }
}

.tinyml-hero .kicker { color: #7fd6cd; }

.tinyml-hero h2 { color: #ffffff; font-size: clamp(1.7rem, 3.4vw, 2.5rem); }

.tinyml-hero p { color: #b9cfd4; font-size: 1.02rem; }

.tinyml-art { display: flex; justify-content: center; }
.tinyml-art svg { width: min(360px, 82vw); height: auto; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.35)); }

.stat-row { display: flex; flex-wrap: wrap; gap: 26px 40px; margin-top: 26px; }
.stat .n { font-family: var(--font-serif); font-size: 1.7rem; font-weight: 700; color: #ffffff; line-height: 1.1; }
.stat .l { font-size: 0.82rem; letter-spacing: 0.06em; text-transform: uppercase; color: #8fb5bc; }

.step-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; counter-reset: step; }

@media (max-width: 900px) { .step-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .step-grid { grid-template-columns: 1fr; } }

.step {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  position: relative;
}

.step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.9rem;
  color: var(--accent);
  opacity: 0.35;
  display: block;
  margin-bottom: 8px;
}

.step h3 { font-size: 1.02rem; margin-bottom: 6px; }
.step p { font-size: 0.9rem; color: var(--muted); margin: 0; }

.experiment-card { border-top: 4px solid var(--accent); }
.experiment-card.alt { border-top-color: var(--gold); }
.experiment-card .exp-label { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-dark); margin-bottom: 8px; }
.experiment-card.alt .exp-label { color: #8a6614; }
.experiment-card p { margin-bottom: 12px; }
.experiment-card ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 0.92rem; }
.experiment-card li { margin-bottom: 6px; }

/* ---------- Reveal animation ---------- */

.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.55s ease, transform 0.55s ease; }
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Misc ---------- */

.divider { height: 1px; background: var(--line); border: none; margin: 40px 0; }

.note {
  font-size: 0.88rem;
  color: var(--muted);
  background: var(--gold-soft);
  border: 1px solid #ecdcb4;
  border-radius: 10px;
  padding: 12px 16px;
}

.two-col { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: start; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; gap: 28px; } }

.mt-0 { margin-top: 0; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }
.mt-40 { margin-top: 40px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.center { text-align: center; }

::selection { background: var(--accent-soft); color: var(--accent-dark); }

/* ---------- Print ---------- */

@media print {
  .nav, .footer, .btn, .reveal { display: none !important; }
  body { background: #fff; }
}
