/* ==========================================================================
   POLMED RESEARCH CENTER — MINIMALIST EDITORIAL DESIGN SYSTEM
   Pure Light Theme | Minimal Academic Aesthetic | Smooth Multi-Layer Scroll Motion
   Politeknik Negeri Medan (2026)
   ========================================================================== */

/* ── GOOGLE FONTS IMPORT ─────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;1,6..72,400;1,6..72,500&family=Plus+Jakarta+Sans:wght@500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── DESIGN TOKENS ──────────────────────────────────────────────────────── */
:root {
  /* Surfaces & Canvas (Clean Institutional Light Theme) */
  --bg-page:         #ffffff;
  --bg-subtle:       #fafafb;
  --bg-card:         #ffffff;
  --bg-muted:        #f4f4f6;

  /* Crisp Hairline Borders */
  --border-light:    #e4e4e7;
  --border-subtle:   #f0f0f2;
  --border-dark:     #18181b;
  --border-hover:    #a1a1aa;

  /* Typography Colors */
  --text-main:       #18181b;       /* Deep slate ink */
  --text-muted:      #52525b;       /* Soft neutral body text */
  --text-light:      #71717a;       /* Secondary details & meta */
  --text-subtle:     #a1a1aa;       /* Tertiary micro-captions */

  /* Typography Families (Simple yet Varied Pairing) */
  --font-display:    'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif:      'Newsreader', Georgia, serif;
  --font-body:       'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono:       'JetBrains Mono', Menlo, Monaco, Consolas, monospace;

  /* Dimensions */
  --container-width: 1140px;
  --nav-height-init: 76px;
  --nav-height-scroll: 64px;

  /* Radii */
  --radius-sm:       6px;
  --radius-md:       10px;
  --radius-lg:       16px;

  /* Natural Shadows (No Neon, Realistic Diffuse) */
  --shadow-subtle:   0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-card:     0 4px 16px -2px rgba(0, 0, 0, 0.04);
  --shadow-hover:    0 16px 36px -4px rgba(0, 0, 0, 0.08);

  /* Easing & Motion Curves */
  --ease-expo:       cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth:     cubic-bezier(0.25, 0.1, 0.25, 1);
  --dur-fast:        200ms;
  --dur-base:        350ms;
  --dur-slow:        800ms;
}

/* ── RESET & BASE ────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height-scroll) + 16px);
  font-size: 16px;
  background-color: var(--bg-page);
  color: var(--text-main);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--dur-fast) ease, opacity var(--dur-fast) ease;
}

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

button {
  background: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
}

::selection {
  background-color: var(--text-main);
  color: #ffffff;
}

/* ── CONTAINER ───────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 48px);
}

/* ── 1. SCROLL READING PROGRESS LINE ─────────────────────────────────────── */
.scroll-progress-line {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2.5px;
  background-color: transparent;
  z-index: 1200;
  pointer-events: none;
}

.scroll-progress-line__bar {
  height: 100%;
  width: 100%;
  background-color: var(--text-main);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 50ms linear;
}

/* ── 2. NAVBAR (DYNAMIIC ON SCROLL) ──────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height-init);
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: height var(--dur-base) var(--ease-expo),
              background-color var(--dur-base) ease,
              border-color var(--dur-base) ease,
              box-shadow var(--dur-base) ease;
}

.navbar.scrolled {
  height: var(--nav-height-scroll);
  background-color: rgba(255, 255, 255, 0.96);
  border-bottom-color: var(--border-light);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

/* Brand */
.navbar__brand {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 100%;
  flex-shrink: 0;
}

.navbar__logo {
  height: 100%;
  max-height: 100%;
  width: auto;
  object-fit: contain;
  padding-block: 4px;
  box-sizing: border-box;
  transition: transform var(--dur-base) var(--ease-expo);
}

.navbar__brand:hover .navbar__logo {
  transform: scale(1.03);
}

.navbar__brand-text {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text-main);
}

/* Nav Links with Smooth Underline Motion */
.navbar__nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  position: relative;
  padding-block: 6px;
  transition: color var(--dur-fast) ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1.5px;
  background-color: var(--text-main);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease-expo);
}

.nav-link:hover {
  color: var(--text-main);
}

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

.nav-link.active {
  color: var(--text-main);
  font-weight: 600;
}

.nav-link.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Mobile Toggle */
.mobile-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 36px;
  height: 36px;
  padding: 4px;
}

.mobile-toggle span {
  display: block;
  width: 100%;
  height: 1.5px;
  background-color: var(--text-main);
  transition: transform var(--dur-base) var(--ease-expo), opacity var(--dur-base);
}

/* ── 3. BUTTONS & ACTIONS ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  transition: all var(--dur-base) var(--ease-expo);
  line-height: 1;
  white-space: nowrap;
}

.btn--dark {
  background-color: var(--text-main);
  color: #ffffff;
  border: 1px solid var(--text-main);
}

.btn--dark:hover {
  background-color: #27272a;
  border-color: #27272a;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
}

.btn--dark:active {
  transform: translateY(0);
}

.btn--outline {
  background-color: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-light);
}

.btn--outline:hover {
  border-color: var(--text-main);
  background-color: var(--bg-subtle);
  transform: translateY(-2px);
}

.btn--outline:active {
  transform: translateY(0);
}

.btn--lg {
  font-size: 0.96rem;
  padding: 15px 30px;
  border-radius: 8px;
}

/* ── 4. SECTION ARCHITECTURE ─────────────────────────────────────────────── */
.section {
  padding-block: clamp(80px, 12vw, 128px);
  border-bottom: 1px solid var(--border-light);
  position: relative;
  scroll-margin-top: calc(var(--nav-height-scroll) + 16px);
}

.hero {
  scroll-margin-top: calc(var(--nav-height-scroll) + 16px);
}

.section-tag {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-light);
  margin-bottom: 16px;
  display: block;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 3.8vw, 3.1rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.16;
  color: var(--text-main);
  margin-bottom: 24px;
}

/* ── 5. HALAMAN UTAMA (MAIN / HERO) ──────────────────────────────────────── */
.hero {
  padding-top: clamp(88px, 14vw, 150px);
  padding-bottom: clamp(80px, 13vw, 140px);
  border-bottom: 1px solid var(--border-light);
  background-color: var(--bg-page);
  position: relative;
}

.hero__inner {
  max-width: 860px;
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 5.5vw, 4.3rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.08;
  color: var(--text-main);
  margin-bottom: 28px;
}

.hero__desc {
  font-size: clamp(1.06rem, 1.4vw, 1.25rem);
  color: var(--text-muted);
  line-height: 1.72;
  max-width: 680px;
  margin-bottom: 40px;
}

.hero__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

/* ── 6. TENTANG (ABOUT SECTION) ─────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.55fr;
  gap: clamp(40px, 8vw, 84px);
  align-items: start;
  margin-top: 16px;
}

.about-lead {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 2.2vw, 1.85rem);
  line-height: 1.4;
  color: var(--text-main);
  font-style: italic;
  font-weight: 400;
  position: relative;
  padding-left: 20px;
  border-left: 2px solid var(--border-dark);
}

.about-body {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.about-body p {
  font-size: 1.04rem;
  color: var(--text-muted);
  line-height: 1.78;
}

/* ── 7. DAFTAR PENELITI (RESEARCHERS SECTION) ────────────────────────────── */
.team-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 48px;
}

.team-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card);
  transition: transform 0.5s var(--ease-expo),
              border-color 0.4s ease,
              box-shadow 0.5s var(--ease-expo);
  box-shadow: var(--shadow-subtle);
  position: relative;
}

.team-card:hover {
  transform: translateY(-8px);
  border-color: var(--border-dark);
  box-shadow: var(--shadow-hover);
}

/* Photo Frame with Silky Zoom & Overflow Mask */
.team-card__photo-frame {
  width: 100%;
  aspect-ratio: 4 / 5;
  background-color: var(--bg-muted);
  overflow: hidden;
  position: relative;
  border-bottom: 1px solid var(--border-light);
}

.team-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.8s var(--ease-expo), filter 0.4s ease;
  filter: contrast(1.02);
}

.team-card:hover .team-card__img {
  transform: scale(1.05);
}

/* Content */
.team-card__content {
  padding: 22px 20px 26px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.team-card__role {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.team-card__name {
  font-family: var(--font-display);
  font-size: 1.04rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-main);
  letter-spacing: -0.015em;
  margin-bottom: 8px;
}

.team-card__institution {
  font-size: 0.84rem;
  color: var(--text-light);
  line-height: 1.4;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

/* ── 8. PROYEK (BUTTON ONLY TO DASHBOARD) ────────────────────────────────── */
.project-cta-box {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: clamp(52px, 8vw, 80px) clamp(24px, 6vw, 64px);
  text-align: center;
  max-width: 820px;
  margin-inline: auto;
  position: relative;
  transition: transform 0.4s var(--ease-expo),
              border-color 0.4s ease,
              box-shadow 0.4s ease;
}

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

.project-cta-box__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.4vw, 2.7rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--text-main);
  margin-bottom: 16px;
}

.project-cta-box__desc {
  font-size: 1.08rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 560px;
  margin-inline: auto;
  margin-bottom: 36px;
}

.project-cta-box .btn--dark {
  transition: all 0.3s var(--ease-expo);
}

.project-cta-box .btn--dark:hover {
  transform: translateY(-3px) scale(1.02);
}

/* ── 9. FOOTER ───────────────────────────────────────────────────────────── */
.footer {
  padding-block: clamp(52px, 8vw, 84px);
  background-color: var(--bg-page);
}

.footer__inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 40px;
  padding-bottom: 52px;
  border-bottom: 1px solid var(--border-light);
}

.footer__brand-area {
  max-width: 400px;
}

.footer__brand-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin-bottom: 10px;
}

.footer__address {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.footer__nav {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}

.footer__link {
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color var(--dur-fast) ease;
}

.footer__link:hover {
  color: var(--text-main);
}

.footer__bottom {
  padding-top: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-subtle);
}

/* ── 10. FLOATING BACK TO TOP ────────────────────────────────────────────── */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 990;
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px) scale(0.9);
  transition: opacity 0.35s var(--ease-expo),
              transform 0.35s var(--ease-expo),
              background-color 0.25s ease,
              border-color 0.25s ease,
              color 0.25s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.back-to-top:hover {
  border-color: var(--text-main);
  background-color: var(--text-main);
  color: #ffffff;
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* ── 11. ADVANCED SCROLL MOTION ENGINE ───────────────────────────────────── */
/* Initial Hidden State for Scroll Elements */
[data-scroll] {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity var(--dur-slow) var(--ease-expo),
              transform var(--dur-slow) var(--ease-expo);
  will-change: opacity, transform;
}

/* Revealed Active State */
[data-scroll].is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Cascade Stagger Delays for Natural Fluid Entrance */
[data-delay="100"] { transition-delay: 100ms; }
[data-delay="200"] { transition-delay: 200ms; }
[data-delay="300"] { transition-delay: 300ms; }
[data-delay="400"] { transition-delay: 400ms; }

/* Photo Card Entrance Animation on Scroll */
.team-card[data-scroll] .team-card__img {
  transform: scale(1.08);
  transition: transform 1.2s var(--ease-expo);
}

.team-card[data-scroll].is-revealed .team-card__img {
  transform: scale(1);
}

/* Subtle Hover Zoom maintained after reveal */
.team-card[data-scroll].is-revealed:hover .team-card__img {
  transform: scale(1.05);
}

/* ── 12. RESPONSIVE DESIGN BREAKPOINTS ───────────────────────────────────── */
@media (max-width: 1024px) {
  .team-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
}

@media (max-width: 768px) {
  :root {
    --nav-height-init: 64px;
    --nav-height-scroll: 60px;
  }

  .navbar__nav {
    display: none;
    position: absolute;
    top: var(--nav-height-scroll);
    left: 0;
    right: 0;
    background: #ffffff;
    border-bottom: 1px solid var(--border-light);
    padding: 24px 28px;
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.06);
  }

  .navbar__nav.is-open {
    display: flex;
    animation: mobileNavFade 0.3s var(--ease-expo) forwards;
  }

  @keyframes mobileNavFade {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .mobile-toggle {
    display: flex;
  }

  .team-grid {
    grid-template-columns: 1fr;
    max-width: 360px;
    margin-inline: auto;
  }

  .hero__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .footer__inner {
    flex-direction: column;
    gap: 32px;
  }

  .footer__nav {
    flex-direction: column;
    gap: 14px;
  }

  .back-to-top {
    bottom: 24px;
    right: 24px;
    width: 40px;
    height: 40px;
  }
}

/* Accessibility: Respect Reduced Motion Preference */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  [data-scroll] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .scroll-progress-line {
    display: none;
  }
  .team-card[data-scroll] .team-card__img {
    transform: none !important;
  }
}
