/* ---------------------------------------------------------------
   Dr. Nahid Afrin Nisa — portfolio
   Custom styles beyond what Tailwind utilities express cleanly.
   ------------------------------------------------------------- */

:root {
  --ink: #0b2420;
  --primary: #10534c;
  --primary-dark: #072f2a;
  --paper: #eff3ef;
  --gold: #c08a2e;
  --gold-light: #e7c97a;
  --slate: #4a5b58;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  background-color: var(--paper);
  color: var(--ink);
}

/* Fine paper-grain texture, layered over the cream background */
.grain {
  position: relative;
}
.grain::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Custom scrollbar, teal + gold themed */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--paper);
}
::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 999px;
  border: 2px solid var(--paper);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gold);
}
html {
  scrollbar-width: thin;
  scrollbar-color: var(--primary) var(--paper);
}

/* Scroll-reveal base states, toggled by IntersectionObserver in main.js */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }

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

/* Hero ambient gradient motion */
@keyframes driftA {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(4%, -6%) scale(1.08); }
}
@keyframes driftB {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-6%, 5%) scale(1.05); }
}
.orb-a { animation: driftA 18s ease-in-out infinite; }
.orb-b { animation: driftB 22s ease-in-out infinite; }

/* Pinned field-photo treatment: a photograph clipped to the page */
.pinned-photo {
  transform: rotate(-2.5deg);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.pinned-photo:hover {
  transform: rotate(0deg) scale(1.015);
}
.photo-pin {
  position: absolute;
  top: -0.65rem;
  left: 50%;
  transform: translateX(-50%) rotate(-6deg);
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  background: radial-gradient(circle at 32% 28%, #f2d999, var(--gold) 60%, #8a5f1c 100%);
  box-shadow: 0 3px 6px rgba(7, 47, 42, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.6);
  z-index: 10;
}

/* Section marker glyph */
.eyebrow::before {
  content: "\00A7";
  margin-right: 0.4em;
  color: var(--gold);
}

/* Timeline rule */
.timeline-rule {
  background: linear-gradient(to bottom, transparent, var(--primary) 6%, var(--primary) 94%, transparent);
}
.timeline-dot {
  box-shadow: 0 0 0 4px var(--paper), 0 0 0 5px rgba(16, 83, 76, 0.35);
}

/* Animated underline for nav links */
.nav-link {
  position: relative;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
}
.nav-link.active {
  color: var(--gold-light);
}

/* Publication / cert card lift */
.lift-card {
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease, border-color 0.35s ease;
}
.lift-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px -18px rgba(7, 47, 42, 0.35);
}

/* Skill chip */
.skill-chip {
  transition: transform 0.25s ease, background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.skill-chip:hover {
  transform: translateY(-2px);
  background-color: var(--primary);
  color: var(--paper);
  border-color: var(--primary);
}

/* Mobile nav panel */
#mobile-nav {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
#mobile-nav.open {
  max-height: 32rem;
}

/* Focus visibility (accessibility floor) */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Count-up number readiness (JS swaps textContent) */
.stat-num {
  font-variant-numeric: tabular-nums;
}
