/* ============================================================
   Imran Al Munyeem — portfolio
   Modern classy: warm cream palette, editorial serif accents,
   subtle motion, dark mode via prefers-color-scheme.
   ============================================================ */

:root {
  color-scheme: light dark;

  /* Light mode (default) */
  --bg: #fbfaf6;
  --bg-raised: #ffffff;
  --bg-tint: #f5f3ed;
  --fg: #1a1a1a;
  --fg-muted: #525252;
  --fg-dim: #737373;
  --border: #e8e4da;
  --border-strong: #d4cfc1;
  --accent: #9a3412;
  --accent-soft: #fef3ec;
  --accent-dark: #7c2d10;
  --ok: #15803d;

  --shadow-sm: 0 1px 2px 0 rgba(20, 15, 5, 0.04);
  --shadow-md: 0 4px 16px -4px rgba(20, 15, 5, 0.08), 0 2px 4px -2px rgba(20, 15, 5, 0.04);
  --shadow-lg: 0 12px 32px -8px rgba(20, 15, 5, 0.12), 0 4px 8px -4px rgba(20, 15, 5, 0.06);

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Instrument Serif", Georgia, "Times New Roman", serif;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --max-width: 1120px;
  --content-width: 760px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0c09;
    --bg-raised: #18140f;
    --bg-tint: #1f1b15;
    --fg: #f5f3ed;
    --fg-muted: #a8a29e;
    --fg-dim: #78716c;
    --border: #2a251e;
    --border-strong: #3d362c;
    --accent: #f59e0b;
    --accent-soft: #2a1f0f;
    --accent-dark: #fbbf24;
    --ok: #4ade80;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px -4px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 32px -8px rgba(0, 0, 0, 0.5), 0 4px 8px -4px rgba(0, 0, 0, 0.4);
  }
}

/* ============================================================
   RESET + BASE
   ============================================================ */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-feature-settings: "cv11", "ss01";
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a {
  color: var(--fg);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

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

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

::selection {
  background: var(--accent);
  color: var(--bg-raised);
}

.placeholder {
  color: var(--accent);
  font-style: italic;
  font-family: var(--font-serif);
  font-size: 1.05em;
  font-weight: 400;
}

/* ============================================================
   NAV
   ============================================================ */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  max-width: 100%;
  background: rgba(251, 250, 246, 0.8);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, background 0.2s ease;
}

@media (prefers-color-scheme: dark) {
  .nav {
    background: rgba(14, 12, 9, 0.8);
  }
}

.nav.scrolled {
  border-bottom-color: var(--border);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 500;
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
}

.logo-mark {
  width: 28px;
  height: 28px;
  background: var(--accent);
  color: var(--bg-raised);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.125rem;
  line-height: 1;
  padding-bottom: 2px;
}

.nav-links {
  display: flex;
  gap: 2rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.nav-links a {
  color: var(--fg-muted);
  position: relative;
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}

.nav-links a:hover {
  color: var(--fg);
}

.nav-links a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  background: var(--fg);
  color: var(--bg-raised) !important;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

@media (max-width: 720px) {
  .nav {
    padding: 0.875rem 1.25rem;
  }
  .nav-links {
    display: none;
  }
  .logo-text {
    display: none;
  }
}

/* ============================================================
   HERO
   ============================================================ */

.hero {
  padding: 8rem 2rem 6rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.hero-inner {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3rem;
  align-items: start;
}

.hero-avatar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.avatar-ring {
  padding: 4px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
}

.avatar-circle {
  width: 128px;
  height: 128px;
  background: var(--bg-raised);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 3rem;
  color: var(--accent);
  letter-spacing: -0.04em;
}

.hero-available {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.8125rem;
  color: var(--fg-muted);
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}

.hero-available .dot {
  width: 6px;
  height: 6px;
  background: var(--ok);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

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

.eyebrow {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1.25rem;
}

.hero-name {
  font-size: clamp(2.5rem, 6vw, 4.25rem);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin-bottom: 1.75rem;
  color: var(--fg);
}

.hero-name em {
  font-family: var(--font-serif);
  font-weight: 400;
  font-style: italic;
  color: var(--accent);
  letter-spacing: -0.02em;
  font-size: 1.05em;
}

.hero-lead {
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--fg-muted);
  margin-bottom: 2rem;
  max-width: 58ch;
}

.hero-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg-muted);
  transition: all 0.2s ease;
}

.social-link:hover {
  color: var(--fg);
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.placeholder-link {
  opacity: 0.6;
}

@media (max-width: 720px) {
  .hero {
    padding: 6rem 1.25rem 4rem;
  }
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .hero-avatar {
    align-items: flex-start;
  }
  .avatar-circle {
    width: 96px;
    height: 96px;
    font-size: 2.25rem;
  }
}

/* ============================================================
   SECTIONS
   ============================================================ */

.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 5rem 2rem;
}

.section-head {
  margin-bottom: 3rem;
  max-width: var(--content-width);
}

.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.875rem;
  padding: 0.25rem 0.625rem;
  background: var(--accent-soft);
  border-radius: 999px;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--fg);
}

.section-title em {
  font-family: var(--font-serif);
  font-weight: 400;
  font-style: italic;
  color: var(--accent);
  font-size: 1.1em;
}

@media (max-width: 720px) {
  .section {
    padding: 3.5rem 1.25rem;
  }
  .section-head {
    margin-bottom: 2rem;
  }
}

/* ============================================================
   ABOUT
   ============================================================ */

.about-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 4rem;
  align-items: start;
}

.about-prose p {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--fg-muted);
  margin-bottom: 1.25rem;
}

.about-prose em {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--fg);
  font-size: 1.1em;
  font-weight: 400;
}

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.stat {
  padding: 1.25rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.stat:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.stat-num {
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--fg);
  line-height: 1;
  margin-bottom: 0.5rem;
  font-feature-settings: "tnum";
}

.stat-num span {
  color: var(--accent);
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
}

.stat-label {
  font-size: 0.8125rem;
  color: var(--fg-muted);
  line-height: 1.4;
}

@media (max-width: 860px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

/* ============================================================
   PUBLICATIONS
   ============================================================ */

.pubs {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: var(--content-width);
}

.pub-card {
  padding: 1.75rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all 0.25s ease;
}

.pub-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.pub-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.875rem;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-venue {
  background: var(--accent-soft);
  color: var(--accent);
}

.badge-draft {
  background: var(--bg-tint);
  color: var(--fg-muted);
  border: 1px dashed var(--border-strong);
}

.pub-year {
  font-size: 0.8125rem;
  color: var(--fg-dim);
  font-variant-numeric: tabular-nums;
}

.pub-title {
  font-size: 1.1875rem;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.015em;
  margin-bottom: 0.375rem;
  color: var(--fg);
}

.pub-authors {
  font-size: 0.9375rem;
  color: var(--fg-muted);
  margin-bottom: 1rem;
}

.pub-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.pub-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  background: var(--bg-tint);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--fg-muted);
  transition: all 0.2s ease;
}

.pub-link:hover {
  background: var(--accent);
  color: var(--bg-raised);
}

.pub-pending {
  opacity: 0.7;
  border-style: dashed;
}

.pub-pending .pub-title {
  font-style: italic;
  color: var(--fg-muted);
}

/* ============================================================
   PROJECTS
   ============================================================ */

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.25s ease;
  color: var(--fg);
}

.project-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.project-thumb {
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  position: relative;
  overflow: hidden;
}

.project-glyph {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 3.5rem;
  font-weight: 400;
  letter-spacing: -0.05em;
  color: rgba(255, 255, 255, 0.92);
  position: relative;
  z-index: 1;
}

.gradient-1 { background: linear-gradient(135deg, #9a3412 0%, #c2410c 100%); }
.gradient-2 { background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%); }
.gradient-3 { background: linear-gradient(135deg, #14532d 0%, #15803d 100%); }
.gradient-4 { background: linear-gradient(135deg, #581c87 0%, #7c3aed 100%); }
.gradient-5 { background: linear-gradient(135deg, #78350f 0%, #c2410c 100%); }
.gradient-6 { background: linear-gradient(135deg, #134e4a 0%, #0d9488 100%); }

.project-body {
  padding: 1.375rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 0.875rem;
}

.tag {
  display: inline-block;
  padding: 0.1875rem 0.5rem;
  background: var(--bg-tint);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--fg-muted);
}

.project-title {
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.015em;
  margin-bottom: 0.5rem;
  color: var(--fg);
}

.project-desc {
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--fg-muted);
  margin-bottom: 1rem;
  flex: 1;
}

.project-cta {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: gap 0.2s ease;
}

.project-card:hover .project-cta {
  gap: 0.5rem;
}

/* ============================================================
   TIMELINE
   ============================================================ */

.timeline {
  position: relative;
  list-style: none;
  padding-left: 2rem;
  max-width: var(--content-width);
}

.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 0.75rem;
  bottom: 0.75rem;
  width: 1px;
  background: var(--border-strong);
}

.timeline-item {
  position: relative;
  padding-bottom: 2.25rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: calc(-2rem + 2px);
  top: 0.5rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border-strong);
  transition: all 0.2s ease;
}

.timeline-item.current .timeline-marker {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.timeline-when {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--fg-dim);
  margin-bottom: 0.25rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.timeline-role {
  font-size: 1.125rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  margin-bottom: 0.125rem;
  color: var(--fg);
}

.timeline-org {
  font-size: 0.9375rem;
  color: var(--fg-muted);
  margin-bottom: 0.5rem;
}

.timeline-org a {
  color: var(--accent);
}

.timeline-org a:hover {
  text-decoration: underline;
}

.timeline-desc {
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--fg-muted);
}

/* ============================================================
   CONTACT
   ============================================================ */

.contact {
  padding: 6rem 2rem;
  max-width: var(--max-width);
  margin: 4rem auto 2rem;
}

.contact-inner {
  padding: 4rem 3rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.contact-inner::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -20%;
  right: -20%;
  height: 100%;
  background: radial-gradient(ellipse at center, var(--accent-soft) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.contact-inner > * {
  position: relative;
  z-index: 1;
}

.contact-title {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin: 1rem auto 1.25rem;
  max-width: 24ch;
}

.contact-title em {
  font-family: var(--font-serif);
  font-weight: 400;
  font-style: italic;
  color: var(--accent);
  font-size: 1.1em;
}

.contact-lead {
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--fg-muted);
  max-width: 52ch;
  margin: 0 auto 2rem;
}

.contact-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--fg);
  color: var(--bg-raised) !important;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--fg);
}

.btn-ghost:hover {
  background: var(--bg-tint);
  border-color: var(--fg-muted);
}

@media (max-width: 720px) {
  .contact {
    padding: 3rem 1.25rem;
  }
  .contact-inner {
    padding: 2.5rem 1.5rem;
  }
}

/* ============================================================
   FOOTER
   ============================================================ */

.footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  color: var(--fg-dim);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-built {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.875rem;
}

/* ============================================================
   FADE IN ANIMATION
   ============================================================ */

.fade-in {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
  .fade-in {
    opacity: 1;
    transform: none;
  }
}

/* ============================================================
   PRINT
   ============================================================ */

@media print {
  .nav, .contact, .footer {
    display: none;
  }
  body {
    background: white;
    color: black;
  }
  .hero {
    padding-top: 2rem;
  }
}
