/* ===========================
   Pharmaceutical Portfolio — Fresh build
   =========================== */
:root {
  --bg: #f7fafc;
  --card: #ffffff;
  --text: #152238;
  --muted: #6a7a8c;
  --accent: #1ea7a8; /* clinical teal */
  --accent-2: #2b6cb0; /* medical blue */
  --accent-light: #e6f7f7;
  --border: #e2e8f0;
  --shadow: 0 10px 30px rgba(16, 24, 40, 0.06);
  --radius: 14px;
  --radius-sm: 10px;
  --transition: 300ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e141b;
    --card: #131b23;
    --text: #e8f2ff;
    --muted: #a8b3c2;
    --accent: #33c0bf;
    --accent-2: #63a4ff;
    --accent-light: rgba(51, 192, 191, 0.12);
    --border: #233142;
    --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  }
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    Roboto, "Helvetica Neue", Arial;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* --- Decorative molecules + subtle grid --- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(
      2px 2px at 12% 22%,
      rgba(43, 108, 176, 0.12) 99%,
      transparent 100%
    ),
    radial-gradient(
      2px 2px at 72% 68%,
      rgba(30, 167, 168, 0.12) 99%,
      transparent 100%
    ),
    linear-gradient(
      0deg,
      transparent 23px,
      rgba(43, 108, 176, 0.06) 24px,
      rgba(43, 108, 176, 0.06) 25px,
      transparent 26px
    ),
    linear-gradient(
      90deg,
      transparent 23px,
      rgba(43, 108, 176, 0.06) 24px,
      rgba(43, 108, 176, 0.06) 25px,
      transparent 26px
    );
  background-size: 120px 120px, 160px 160px, 26px 26px, 26px 26px;
}

/* --- Top nav --- */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  letter-spacing: -0.3px;
}
.brand-atom {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-block;
  background: linear-gradient(180deg, var(--accent), #159a9a);
  position: relative;
}
.brand-atom::after,
.brand-atom::before {
  content: "";
  position: absolute;
  inset: -6px;
  border: 2px solid var(--accent-2);
  border-radius: 50%;
  animation: orbit 6s linear infinite;
}
.brand-atom::before {
  animation-duration: 9s;
  opacity: 0.4;
}
@keyframes orbit {
  to {
    transform: rotate(360deg);
  }
}
.brand-text {
  color: var(--accent-2);
}

.nav {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}
.nav-links {
  display: flex;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  display: inline-block;
  text-decoration: none;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 10px;
  transition: var(--transition);
}
.nav-links a:hover,
.nav-links a[aria-current="true"] {
  color: var(--accent-2);
  background: var(--accent-light);
}

/* --- Sections --- */
.section {
  padding: 72px 16px;
}
.section.alt {
  background: color-mix(in oklab, var(--accent-2) 4%, var(--bg));
}
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(24px, 5vw, 40px);
}
.section-title {
  margin: 0 0 8px;
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 900;
  color: var(--text);
  border-left: 6px solid var(--accent);
  padding-left: 12px;
}
.section-title.center {
  border-left: 0;
  text-align: center;
}
.title-xl {
  font-size: clamp(32px, 6vw, 48px);
  margin: 0 0 6px;
  font-weight: 900;
}
.title-accent {
  display: block;
  color: var(--accent-2);
  font-weight: 700;
}

/* --- Layout helpers --- */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
  align-items: center;
}
@media (max-width: 860px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .nav-toggle {
    display: flex;
  }
  .nav-links {
    display: none;
    position: absolute;
    top: 60px;
    right: 10px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 8px;
    flex-direction: column;
  }
  .nav-links.open {
    display: flex;
  }
}
.stack {
  display: flex;
  flex-direction: column;
}
.row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}
.gap-2 {
  gap: 12px;
}
.gap-3 {
  gap: 16px;
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  background: linear-gradient(180deg, var(--accent) 0%, #159a9a 100%);
  color: white;
  border: 1px solid rgba(30, 167, 168, 0.35);
  padding: 12px 20px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  transition: var(--transition);
  box-shadow: var(--shadow);
}
.btn:hover {
  transform: translateY(-2px);
  filter: contrast(1.05);
}
.btn.ghost {
  background: transparent;
  color: var(--accent-2);
  border-color: var(--border);
}
.btn.ghost:hover {
  background: var(--accent-light);
  color: var(--accent);
}
.btn.small {
  padding: 8px 12px;
  border-radius: 10px;
}

/* --- Hero visual --- */
.hero-visual {
  display: grid;
  place-items: center;
}
.lab-card {
  position: relative;
  isolation: isolate;
  width: min(420px, 90vw);
  aspect-ratio: 4/3;
  border-radius: 18px;
  background: linear-gradient(180deg, #fdfefe, #eef8f8);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.lab-card__badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--accent-2);
  color: white;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: var(--shadow);
}
.lab-card__chart {
  position: absolute;
  inset: 0 0 0 0;
  background: radial-gradient(
      60px 20px at 20% 30%,
      rgba(43, 108, 176, 0.12) 30%,
      transparent 35%
    ),
    radial-gradient(
      80px 30px at 70% 60%,
      rgba(30, 167, 168, 0.15) 30%,
      transparent 40%
    );
  animation: drift 16s ease-in-out infinite alternate;
}
.lab-card__tags {
  position: absolute;
  bottom: 12px;
  left: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.lab-card__tags span {
  background: var(--accent-light);
  border: 1px solid rgba(30, 167, 168, 0.35);
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
}

@keyframes drift {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-12px);
  }
}

/* --- Lists / pills --- */
.bullets {
  margin: 12px 0 0 0;
  padding-left: 18px;
  line-height: 1.65;
}
.bullets li {
  margin: 6px 0;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}
.tags li {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-light);
  border: 1px solid rgba(30, 167, 168, 0.35);
  font-weight: 600;
}

/* --- Skill cards --- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.skill-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px;
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.skill-card:hover {
  transform: translateY(-2px);
  outline: 2px solid var(--accent);
  outline-offset: 0;
}

/* --- Timeline --- */
.timeline {
  position: relative;
  margin-left: 6px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(var(--accent-2), var(--accent));
  opacity: 0.5;
}
.time-item {
  position: relative;
  padding-left: 36px;
  margin: 20px 0;
}
.time-dot {
  position: absolute;
  left: 4px;
  top: 8px;
  width: 14px;
  height: 14px;
  background: var(--accent-2);
  border-radius: 50%;
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent-2) 20%, transparent);
}
.time-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.meta {
  color: var(--muted);
  font-weight: 600;
}

/* --- Cards --- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px;
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.card:hover {
  transform: translateY(-2px);
}

/* --- Education grid --- */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}
.edu h3 {
  margin: 0 0 6px;
}

/* --- Contact --- */
.contact-card {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}
.contact-card .row {
  gap: 10px;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 10px;
}
.contact-card .row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.pill {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--accent-light);
  color: var(--text);
  text-decoration: none;
}
.pill:hover {
  background: var(--accent);
  color: white;
  border-color: transparent;
}

/* --- Reveal on scroll (new animation system) --- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 700ms ease, transform 700ms ease;
}
.reveal.show {
  opacity: 1;
  transform: none;
}
.reveal.from-left {
  transform: translateX(-28px);
}
.reveal.from-right {
  transform: translateX(28px);
}
.reveal.from-bottom {
  transform: translateY(28px);
}

/* --- Scroll to top --- */
.scroll-top {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 90;
}
.scroll-top[hidden] {
  display: none;
}

/* --- Footer --- */
.footer {
  padding: 30px 14px;
  text-align: center;
  color: var(--muted);
}
