/* ==========================================================================
   Karim Lakhani — personal site
   Custom stylesheet (replaces the HTML5UP "Story" theme on this branch)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Newsreader:opsz,wght@6..72,400;6..72,500;6..72,600;6..72,700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --navy-950: #070f1e;
  --navy-900: #0c1c34;
  --navy-800: #13294b;
  --navy-700: #1d3a63;
  --gold: #c9a24d;
  --gold-light: #e8d9ad;
  --teal: #4f9d95;
  --teal-deep: #2f6d68;
  --cream: #faf6ee;
  --cream-dim: #f1ead9;
  --ink: #16223a;
  --ink-soft: #51607a;
  --line: #e4ddc9;
  --surface: #ffffff;

  --font-display: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --container: 1080px;
  --radius: 16px;
  --shadow-soft: 0 20px 45px -25px rgba(8, 20, 38, 0.35);
  --shadow-lift: 0 30px 60px -30px rgba(8, 20, 38, 0.45);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

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

a { color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
  color: var(--navy-900);
}

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal-deep);
  margin-bottom: 0.9em;
}

.eyebrow::before {
  content: '';
  width: 1.6em;
  height: 2px;
  background: var(--gold);
  display: inline-block;
}

/* ---------- Buttons & pills ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75em 1.5em;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
  cursor: pointer;
}

.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--gold);
  color: var(--navy-950);
  box-shadow: var(--shadow-soft);
}
.btn-primary:hover { background: var(--gold-light); }

.btn-ghost {
  background: rgba(250, 246, 238, 0.08);
  border-color: rgba(250, 246, 238, 0.4);
  color: var(--cream);
}
.btn-ghost:hover { background: rgba(250, 246, 238, 0.16); }

.btn-outline {
  background: transparent;
  border-color: var(--navy-800);
  color: var(--navy-900);
}
.btn-outline:hover { background: var(--navy-900); color: var(--cream); }

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6em;
  margin: 1.4em 0 0;
  padding: 0;
  list-style: none;
}

.tag {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4em 0.9em;
  border-radius: 999px;
  background: var(--cream-dim);
  border: 1px solid var(--line);
  color: var(--navy-800);
}

.draft-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3em 0.7em;
  border-radius: 999px;
  background: rgba(79, 157, 149, 0.14);
  color: var(--teal-deep);
  border: 1px dashed var(--teal);
  margin-left: 0.75em;
  vertical-align: middle;
}

/* ---------- Nav ---------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 246, 238, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
  color: var(--navy-900);
  display: flex;
  align-items: center;
  gap: 0.6em;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--navy-900);
  color: var(--gold-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.94rem;
  color: var(--ink-soft);
  transition: color 0.15s ease;
}

.nav-links a:hover,
.nav-links a.is-active { color: var(--navy-900); }

.nav-cta { display: flex; align-items: center; gap: 1rem; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
}
.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--navy-900);
  display: block;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  /* same left/right edges as the content of every other section */
  width: min(calc(100% - 3rem), calc(var(--container) - 3rem));
  margin: 1.5rem auto 0;
  min-height: min(80vh, 720px);
  display: flex;
  align-items: center;
  color: var(--cream);
  overflow: hidden;
  border-radius: 24px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(155deg, rgba(7, 15, 30, 0.92) 10%, rgba(13, 28, 52, 0.75) 55%, rgba(47, 109, 104, 0.55) 100%), url('../../images/Beach.jpg');
  background-size: cover;
  background-position: center 65%;
  z-index: 0;
}

.hero .container {
  position: relative;
  z-index: 1;
  padding: 4rem 3rem;
}

/* the wave only made sense when the hero ran full-bleed */
.hero .wave-divider { display: none; }

.hero-content { max-width: 640px; }

.hero .eyebrow { color: var(--gold-light); }
.hero .eyebrow::before { background: var(--teal); }

.hero h1 {
  color: var(--cream);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  margin-bottom: 0.3em;
}

.hero .role {
  font-family: var(--font-body);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  font-weight: 600;
  color: var(--gold-light);
  margin-bottom: 1em;
}

.hero .role a { color: inherit; text-decoration: underline; text-decoration-color: rgba(232, 217, 173, 0.5); }

.hero-tagline {
  font-size: 1.05rem;
  color: rgba(250, 246, 238, 0.86);
  max-width: 54ch;
}

.hero-tagline a { color: var(--gold-light); text-decoration: underline; text-decoration-color: rgba(232, 217, 173, 0.5); }
.hero-tagline a:hover { text-decoration-color: var(--gold-light); }

.hero-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  margin: 1.6rem 0 0;
}

.hero-contacts a {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  text-decoration: none;
  font-size: 0.92rem;
  color: rgba(250, 246, 238, 0.85);
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.hero-contacts a:hover { color: var(--cream); border-color: var(--gold); }
.hero-contacts i { color: var(--gold-light); }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2.2rem;
}

.wave-divider {
  display: block;
  width: 100%;
  line-height: 0;
  position: relative;
  z-index: 1;
  margin-top: -6px;
}
.wave-divider svg { width: 100%; height: 64px; display: block; }

/* ---------- Sections (general) ---------- */

section.block {
  padding: 5.5rem 0;
}

section.block.tight { padding: 4rem 0; }

.section-head {
  max-width: 640px;
  margin-bottom: 2.6rem;
}

.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
.section-head p { color: var(--ink-soft); font-size: 1.02rem; }

.alt-surface { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* ---------- About ---------- */

.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3.5rem;
  align-items: start;
}

.about-photo {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lift);
  border: 6px solid var(--surface);
  outline: 1px solid var(--line);
}

.about-photo img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4/5; }

.about-body p { color: var(--ink-soft); }
.about-body p strong { color: var(--ink); }

.pull-note {
  margin-top: 1.8rem;
  padding: 1.2rem 1.4rem;
  border-left: 3px solid var(--gold);
  background: var(--cream-dim);
  border-radius: 0 10px 10px 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--navy-800);
}

/* ---------- Timeline ---------- */

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 2px solid var(--line);
}

.timeline li {
  position: relative;
  padding: 0 0 2.4rem 2rem;
}
.timeline li:last-child { padding-bottom: 0; }

.timeline li::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--cream);
  box-shadow: 0 0 0 2px var(--gold);
}

.timeline li.is-draft::before { background: var(--cream); box-shadow: 0 0 0 2px var(--teal); }

.timeline .when {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal-deep);
  margin-bottom: 0.3em;
  display: block;
}

.timeline h3 { font-size: 1.8rem; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 0.15em; }
.timeline p { color: var(--ink-soft); }

.timeline .org-full {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--ink-soft);
  margin-left: 0.4em;
}

.timeline h3 a { color: inherit; text-decoration: none; }
.timeline h3 a:hover { color: var(--teal-deep); }

.timeline .role-title {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--teal-deep);
  margin-bottom: 0.5em;
}
.timeline .role {
  margin-top: 1rem;
  padding-left: 1rem;
  border-left: 2px solid var(--gold);
}
.timeline .role:first-of-type { margin-top: 0.6rem; }
.timeline .role-detail,
.timeline .role-years {
  font-weight: 400;
  color: var(--ink-soft);
  margin-left: 0.5em;
}
.timeline .role-detail { font-size: 0.85rem; }

.draft-note {
  font-style: italic;
  color: var(--ink-soft);
  font-size: 0.95rem;
  border: 1px dashed var(--line);
  background: var(--surface);
  padding: 0.9em 1.1em;
  border-radius: 10px;
}

/* ---------- Beyond the lab ---------- */

.beyond-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 1.6rem;
}

.beyond-more { margin: 1.6rem 0 0; }
.beyond-more a { color: var(--navy-800); font-weight: 500; text-decoration-color: var(--gold); }

/* Photo tile with caption overlay */
.beyond-photo {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  text-decoration: none;
}
.beyond-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 46%;
  transition: transform 0.4s ease;
}
.beyond-photo:hover img { transform: scale(1.03); }

.photo-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 3rem 1.4rem 1.2rem;
  color: var(--cream);
  background: linear-gradient(to top, rgba(7, 15, 30, 0.85), rgba(7, 15, 30, 0));
}
.photo-caption strong { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; }
.photo-caption span { font-size: 0.85rem; color: var(--gold-light); }

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

.contact-block {
  background: var(--navy-900);
  color: var(--cream);
  border-radius: 24px;
  padding: 3.4rem 3rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  position: relative;
  overflow: hidden;
}

.contact-block::after {
  content: '';
  position: absolute;
  right: -60px;
  top: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 162, 77, 0.35), transparent 70%);
}

.contact-block h2 { color: var(--cream); margin-bottom: 0.3em; }
.contact-block p { color: rgba(250, 246, 238, 0.78); max-width: 42ch; }

.contact-icons {
  display: flex;
  gap: 0.9rem;
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  z-index: 1;
}

.contact-icons a {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(250, 246, 238, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--cream);
  transition: background 0.15s ease, transform 0.15s ease;
}
.contact-icons a:hover { background: var(--gold); color: var(--navy-950); transform: translateY(-2px); }

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

.site-footer {
  padding: 2.4rem 0;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

/* ---------- Research papers ---------- */

.paper-list { display: flex; flex-direction: column; gap: 2.2rem; margin-top: 0; }

.paper {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2.2rem;
  box-shadow: var(--shadow-soft);
}

.paper header { margin-bottom: 0.9rem; }
.paper h3 { font-size: 1.3rem; margin-bottom: 0.15em; }
.paper h3 a { color: var(--navy-900); text-decoration: none; }
.paper h3 a:hover { color: var(--teal-deep); }

.paper .status {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal-deep);
  margin-bottom: 0.6em;
}

.paper p { color: var(--ink-soft); }
.paper p a { color: var(--navy-800); text-decoration: underline; text-decoration-color: var(--line); }
.paper p a:hover { text-decoration-color: var(--gold); }

.paper .fig {
  float: left;
  width: 220px;
  margin: 0 1.4rem 0.6rem 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
}

/* ---------- Publication list ---------- */

.pub-block { margin-top: 3rem; }
.pub-block h3 { font-size: 1.3rem; margin-bottom: 0.8rem; }

.pub-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.pub-list li {
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}
.pub-list strong { color: var(--navy-900); }
.pub-list a { color: var(--navy-800); text-decoration: underline; text-decoration-color: var(--line); }
.pub-list a:hover { text-decoration-color: var(--gold); }

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

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal.reveal-instant { transition: none; }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-photo { max-width: 340px; margin: 0 auto; }
}

@media (max-width: 760px) {
  .nav-links, .nav-cta .btn-outline { display: none; }
  .nav-toggle { display: flex; }
  .site-nav.is-open .nav-links {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--cream);
    border-bottom: 1px solid var(--line);
    padding: 1.5rem;
    gap: 1.2rem;
  }
  .contact-block { flex-direction: column; align-items: flex-start; text-align: left; }
  .paper .fig { float: none; width: 100%; margin: 0 0 1rem; }
  section.block { padding: 3.6rem 0; }
}

@media (max-width: 480px) {
  .contact-block { padding: 2.4rem 1.6rem; }
  .hero .container { padding: 2.5rem 1.5rem; }
}
