/* ================================================================
   style.css — Razu Mohiuddin Portfolio
   ================================================================
   Sections:
    1.  Custom Properties (dark / light)
    2.  Reset & Base
    3.  Typography
    4.  Layout utilities
    5.  Components (buttons)
    6.  Navigation
    7.  Hero
    8.  Research
    9.  Timeline
   10.  Publications
   11.  Skills
   12.  About
   13.  Contact
   14.  Footer
   15.  Floating Buttons
   16.  Media Queries
   ================================================================ */

/* ── 1. Custom Properties ──────────────────────────────────────── */

:root {
  /* Dark mode (default) */
  --color-bg:           #0f172a;
  --color-bg-alt:       #1a2540;
  --color-surface:      #123455;
  --color-border:       #2e4060;

  --color-accent:       #3399FF;  /* bright blue  – links, borders, hover states */
  --color-accent-hover: #66b3ff;
  --color-warm:         #FF9933;  /* orange – CTAs, timeline dots, section labels */
  --color-warm-hover:   #ffb366;

  --color-text:         #f1f5f9;
  --color-text-dim:     #94a3b8;
  --color-text-muted:   #64748b;

  --color-nav-bg:       #0a1628;
  --color-footer-bg:    #0a1628;

  /* Typography */
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Layout */
  --container-width:  900px;
  --container-narrow: 680px;
  --nav-height:       64px;
  --section-pad:      5rem;

  /* Borders / shadows */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --shadow-sm:  0 1px 4px rgba(0, 0, 0, 0.4);
  --shadow-md:  0 4px 20px rgba(0, 0, 0, 0.55);

  /* Transition */
  --t: 180ms ease;
}

[data-theme="light"] {
  --color-bg:           #f8fafc;
  --color-bg-alt:       #eef2f7;
  --color-surface:      #ffffff;
  --color-border:       #cbd5e1;

  --color-accent:       #1a7fd4;
  --color-accent-hover: #1565b8;
  --color-warm:         #e07b00;
  --color-warm-hover:   #c86e00;

  --color-text:         #0f172a;
  --color-text-dim:     #475569;
  --color-text-muted:   #94a3b8;

  --color-nav-bg:       #0a1628;
  --color-footer-bg:    #0a1628;

  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.12);
}

/* ── 2. Reset & Base ───────────────────────────────────────────── */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font);
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  background-color: var(--color-bg);
  color: var(--color-text);
  transition: background-color var(--t), color var(--t);
}

body {
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a   { color: var(--color-accent); text-decoration: none; }
a:hover { color: var(--color-accent-hover); }
ul, ol { list-style: none; }

/* ── 3. Typography ─────────────────────────────────────────────── */

h1, h2, h3, h4 {
  line-height: 1.2;
  font-weight: 700;
  color: var(--color-text);
}

h1 { font-size: clamp(1.875rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.5rem,   3vw, 2rem); }
h3 { font-size: 1.1875rem; font-weight: 600; }
h4 { font-size: 1rem;      font-weight: 600; }

p     { color: var(--color-text-dim); }
small { font-size: 0.8125rem; color: var(--color-text-muted); }

/* ── 4. Layout Utilities ───────────────────────────────────────── */

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

.container-narrow {
  max-width: var(--container-narrow);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.section {
  padding-block: var(--section-pad);
  background-color: var(--color-bg);
}

.section-alt {
  background-color: var(--color-bg-alt);
}

.section-label {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-warm);
  margin-bottom: 0.4rem;
}

.section-title {
  margin-bottom: 2.75rem;
}

/* ── 5. Components ─────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.375rem;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  border: 2px solid transparent;
  transition: background-color var(--t), color var(--t), border-color var(--t);
  text-decoration: none;
}

.btn-primary {
  background-color: var(--color-warm);
  color: #0f172a;
  border-color: var(--color-warm);
}
.btn-primary:hover {
  background-color: var(--color-warm-hover);
  border-color: var(--color-warm-hover);
  color: #0f172a;
}

.btn-outline {
  background-color: transparent;
  color: var(--color-accent);
  border-color: var(--color-accent);
}
.btn-outline:hover {
  background-color: var(--color-accent);
  color: #fff;
}

/* ── 6. Navigation ─────────────────────────────────────────────── */

.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  height: var(--nav-height);
  background-color: var(--color-nav-bg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  padding-inline: 1.5rem;
}

.nav-inner {
  max-width: var(--container-width);
  margin-inline: auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-size: 1.0625rem;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}
.nav-brand:hover { color: #fff; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.125rem;
}

.nav-link {
  position: relative;
  font-size: 0.8125rem;
  font-weight: 500;
  color: rgba(241, 245, 249, 0.65);
  padding: 0.375rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: color var(--t);
  white-space: nowrap;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 0.5rem;
  right: 0.5rem;
  height: 2px;
  background-color: var(--color-warm);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t);
  border-radius: 1px;
}
.nav-link:hover { color: #f1f5f9; }
.nav-link:hover::after { transform: scaleX(1); }

/* Theme toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: rgba(241, 245, 249, 0.7);
  margin-left: 0.5rem;
  transition: background-color var(--t), color var(--t);
  flex-shrink: 0;
}
.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #f1f5f9;
}

/* Hamburger — hidden on desktop */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px; height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-hamburger span {
  display: block;
  width: 100%; height: 2px;
  background-color: #f1f5f9;
  border-radius: 2px;
  transition: transform var(--t), opacity var(--t);
}
.nav-hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile overlay */
.nav-mobile {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 199;
  background-color: var(--color-nav-bg);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
}
.nav-mobile.is-open { display: flex; }

.nav-mobile .nav-link {
  font-size: 1.375rem;
  font-weight: 600;
  color: rgba(241, 245, 249, 0.7);
}
.nav-mobile .nav-link::after { left: 0; right: 0; }
.nav-mobile .nav-link:hover { color: #f1f5f9; }

.nav-mobile-close {
  position: absolute;
  top: 1rem; right: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(241, 245, 249, 0.6);
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.5rem;
}
.nav-mobile-close:hover { color: #f1f5f9; }

/* ── 7. Hero ───────────────────────────────────────────────────── */

.hero {
  padding-top: calc(var(--nav-height) + var(--section-pad));
}

.hero-inner {
  display: flex;
  align-items: center;
  gap: 3.5rem;
}

.hero-photo {
  flex-shrink: 0;
  width: 210px; height: 210px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--color-accent);
  box-shadow: var(--shadow-md);
}
.hero-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.hero-text { flex: 1; min-width: 0; }

.hero-name {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.3rem;
}

.hero-title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-warm);
  margin-bottom: 1.125rem;
}

.hero-bio {
  color: var(--color-text-dim);
  max-width: 500px;
  margin-bottom: 1.5rem;
  font-size: 0.9375rem;
  line-height: 1.75;
}

.hero-credential {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  opacity: 0.75;
  transition: opacity var(--t);
}
.hero-credential:hover { opacity: 1; }
.hero-credential img { height: 32px; width: auto; }
.hero-credential-label {
  font-size: 0.8125rem;
  color: var(--color-text-dim);
}

/* ── 8. Research ───────────────────────────────────────────────── */

.research-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.research-card {
  display: flex;
  gap: 1.75rem;
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  border-left: 3px solid var(--color-accent);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}

.research-logo {
  flex-shrink: 0;
  width: 96px;
  display: flex;
  align-items: flex-start;
  padding-top: 0.125rem;
}
.research-logo a,
.research-logo img {
  width: 100%;
  height: auto;
}

.research-body { flex: 1; min-width: 0; }

.research-body h3 {
  margin-bottom: 0.75rem;
}

.research-body p {
  font-size: 0.9375rem;
  line-height: 1.75;
  margin-bottom: 1rem;
}
.research-body p:last-child { margin-bottom: 0; }

.research-figure {
  margin-block: 1rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  max-width: 460px;
}

.research-bullets {
  margin: 0.75rem 0 1rem 1.25rem;
  list-style: disc;
  color: var(--color-text-dim);
  font-size: 0.9375rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.research-divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin-block: 1.5rem;
}

/* ── 9. Timeline ───────────────────────────────────────────────── */

.timeline {
  position: relative;
  padding-left: 2.75rem;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background-color: var(--color-border);
}

.timeline-item {
  position: relative;
  margin-bottom: 2.25rem;
}
.timeline-item:last-child { margin-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: calc(-2.75rem + 2px);
  top: 8px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background-color: var(--color-warm);
  border: 2px solid var(--color-bg);
  box-shadow: 0 0 0 2px var(--color-warm);
  transition: border-color var(--t);
}
.timeline-item--current .timeline-dot {
  width: 18px; height: 18px;
  top: 6px;
  left: calc(-2.75rem);
  box-shadow: 0 0 0 3px var(--color-warm), 0 0 12px rgba(255, 153, 51, 0.4);
}

.timeline-card {
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 1.375rem 1.5rem;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}
.timeline-item--current .timeline-card {
  border-color: rgba(255, 153, 51, 0.3);
}

.timeline-date {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--color-warm);
  margin-bottom: 0.375rem;
}

.timeline-card h3 { margin-bottom: 0.2rem; }

.timeline-org {
  font-size: 0.875rem;
  color: var(--color-accent);
  font-weight: 500;
  margin-bottom: 0.625rem;
}

.timeline-card p {
  font-size: 0.9375rem;
  line-height: 1.72;
}

.timeline-tag {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background-color: rgba(255, 153, 51, 0.15);
  color: var(--color-warm);
  border: 1px solid rgba(255, 153, 51, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.15rem 0.5rem;
  margin-bottom: 0.5rem;
}

.timeline-subitem {
  margin-top: 1.25rem;
  padding-top: 1.125rem;
  border-top: 1px solid var(--color-border);
}
.timeline-subitem h4 {
  margin-bottom: 0.2rem;
  font-size: 0.9375rem;
}
.timeline-subitem .timeline-org {
  font-size: 0.8125rem;
  margin-bottom: 0.5rem;
}

/* ── 10. Publications ──────────────────────────────────────────── */

.pub-list {
  display: flex;
  flex-direction: column;
  margin-bottom: 2.25rem;
}

.pub-item {
  padding: 1rem 1.125rem;
  border-left: 3px solid transparent;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  transition: border-color var(--t), background-color var(--t);
}
.pub-item + .pub-item {
  border-top: 1px solid var(--color-border);
}
.pub-item:hover {
  border-left-color: var(--color-accent);
  background-color: var(--color-surface);
  border-top-color: transparent;
}
.pub-item:hover + .pub-item {
  border-top-color: transparent;
}

.pub-title {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 0.3rem;
  line-height: 1.5;
}
.pub-title a { color: var(--color-text); }
.pub-title a:hover { color: var(--color-accent); }

.pub-meta {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}
.pub-journal {
  color: var(--color-accent);
  font-style: italic;
}

.pub-actions {
  display: flex;
  justify-content: center;
  margin-top: 0.5rem;
}

/* ── 11. Skills ────────────────────────────────────────────────── */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.125rem;
}

.skill-category {
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 1.125rem 1.25rem;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.skill-category h4 {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-warm);
  margin-bottom: 0.75rem;
}

.skill-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.skill-pill {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-accent);
  background-color: transparent;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-sm);
  padding: 0.2rem 0.55rem;
  opacity: 0.8;
  transition: opacity var(--t), background-color var(--t), color var(--t);
}
.skill-pill:hover {
  opacity: 1;
  background-color: var(--color-accent);
  color: #fff;
}

/* ── 12. About ─────────────────────────────────────────────────── */

.about-text { text-align: left; }

.about-text p {
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 1.25rem;
}
.about-text p:last-of-type { margin-bottom: 2rem; }

/* ── 13. Contact ───────────────────────────────────────────────── */

.contact-email-wrap {
  text-align: center;
  margin-bottom: 3rem;
}

.contact-email-label {
  font-size: 0.9375rem;
  color: var(--color-text-dim);
  margin-bottom: 0.75rem;
}

.email-link {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--color-accent);
  border-bottom: 2px solid transparent;
  transition: border-color var(--t), color var(--t);
  padding-bottom: 2px;
}
.email-link:hover {
  border-bottom-color: var(--color-accent);
  color: var(--color-accent-hover);
}

.contact-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.contact-card {
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.contact-card-header {
  padding: 0.75rem 1.25rem;
  background-color: var(--color-nav-bg);
  border-bottom: 2px solid var(--color-accent);
}
.contact-card-header h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: #f1f5f9;
}

.contact-card-body { padding: 1.25rem; }

.contact-card-body address {
  font-style: normal;
  font-size: 0.9375rem;
  line-height: 1.9;
  color: var(--color-text-dim);
}

.contact-card-body ul {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.contact-card-body ul li a {
  font-size: 0.9375rem;
  color: var(--color-accent);
  text-decoration: underline;
  transition: color var(--t);
}
.contact-card-body ul li a:hover { color: var(--color-accent-hover); }

/* ── 14. Footer ────────────────────────────────────────────────── */

.site-footer {
  background-color: var(--color-footer-bg);
  padding: 3rem 1.5rem 6rem; /* large bottom pad so floating buttons never overlap */
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-socials {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.125rem;
  margin-bottom: 1.5rem;
}

.footer-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  opacity: 0.55;
  transition: opacity var(--t), transform var(--t);
}
.footer-social-link:hover {
  opacity: 1;
  transform: translateY(-3px);
}
.footer-social-link img {
  width: 24px; height: 24px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.footer-copy {
  font-size: 0.8125rem;
  color: rgba(241, 245, 249, 0.35);
}

/* ── 15. Floating Buttons ──────────────────────────────────────── */

.floating-btns {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none; /* container transparent to clicks */
}

.floating-btn {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateX(20px);
  animation: floatIn 0.4s ease forwards;
  transition: background-color var(--t), border-color var(--t), transform 150ms ease, opacity var(--t);
}
.floating-btn:nth-child(1) { animation-delay: 0.2s; }
.floating-btn:nth-child(2) { animation-delay: 0.32s; }
.floating-btn:nth-child(3) { animation-delay: 0.44s; }

.floating-btn:hover {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  transform: translateX(-4px);
}
.floating-btn img {
  width: 22px; height: 22px;
  object-fit: contain;
  filter: brightness(0) invert(0.65);
  transition: filter var(--t);
}
.floating-btn:hover img { filter: brightness(0) invert(1); }

[data-theme="light"] .floating-btn img        { filter: brightness(0) invert(0.35); }
[data-theme="light"] .floating-btn:hover img  { filter: brightness(0) invert(1); }

@keyframes floatIn {
  to { opacity: 1; transform: translateX(0); }
}

/* ── 16. Media Queries ─────────────────────────────────────────── */

@media (max-width: 768px) {
  :root { --section-pad: 3.5rem; }

  /* Nav */
  .nav-links    { display: none; }
  .nav-hamburger { display: flex; }

  /* Hero */
  .hero-inner {
    flex-direction: column;
    text-align: center;
    gap: 2rem;
  }
  .hero-photo { margin-inline: auto; }
  .hero-bio   { margin-inline: auto; }
  .hero-credential { margin-inline: auto; }

  /* Research */
  .research-card { flex-direction: column; gap: 1.25rem; }
  .research-logo { width: 80px; }

  /* Contact */
  .contact-cards { grid-template-columns: 1fr; }

  /* Floating buttons */
  .floating-btn { width: 40px; height: 40px; }
  .floating-btn img { width: 20px; height: 20px; }
}

@media (max-width: 480px) {
  :root { --section-pad: 2.5rem; }

  .skills-grid { grid-template-columns: 1fr; }

  .floating-btns { bottom: 1rem; right: 0.75rem; }

  .not-found-container2 { width: 100%; padding-inline: 1rem; }
}
