/* ============================================================
   HydroX Portfolio — Stylesheet
   Built on the HydroX Design System v1.0 tokens.
   ============================================================ */

/* ---- Design tokens ---------------------------------------- */
:root {
  --c-bg:         #000000;
  --c-bg-2:       #000000;
  --c-surface:    #112320;
  --c-surface-2:  #1A332F;
  --c-border:     #243D39;
  --c-primary:    #0D4F4A;
  --c-accent:     #7EC845;
  --c-accent-dim: #4A7A28;
  --c-amber:      #F5A623;
  --c-text:       #E8F0EF;
  --c-text-muted: #8AAAA6;
  --c-text-dim:   #4A6B67;

  --f-display: 'Jost', sans-serif;
  --f-body:    'Public Sans', sans-serif;
  --f-mono:    'JetBrains Mono', monospace;

  --t-xs:   0.75rem;
  --t-sm:   0.95rem;
  --t-base: 1.05rem;
  --t-md:   1.2rem;
  --t-lg:   1.65rem;
  --t-xl:   clamp(1.9rem, 4.5vw, 3rem);
  --t-2xl:  clamp(2.2rem, 5vw, 3.4rem);
  --t-3xl:  4.5rem;

  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px; --sp-9: 96px;

  --r-sm: 4px; --r-md: 8px; --r-lg: 16px; --r-pill: 999px;

  --shadow-card: 0 2px 24px rgba(0,0,0,0.4);
  --glow-accent: 0 0 20px rgba(126,200,69,0.15);
  --glow-amber:  0 0 20px rgba(245,166,35,0.2);
  --transition:  all 0.2s cubic-bezier(0.4, 0, 0.2, 1);

  --nav-h: 68px;
  --maxw: 1080px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }

body {
  background-color: var(--c-bg);
  color: var(--c-text);
  font-family: var(--f-body);
  font-size: var(--t-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

a { color: inherit; }

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

::selection { background: rgba(126,200,69,0.3); color: var(--c-text); }

/* ---- Particle canvas + ambient background ----------------- */
#particles {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.bg-ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 78% -10%, rgba(13,79,74,0.45) 0%, transparent 55%),
    radial-gradient(circle at 12% 108%, rgba(126,200,69,0.10) 0%, transparent 45%),
    linear-gradient(180deg, #000000 0%, #06100E 40%, #000000 100%);
}

/* content sits above the particle field */
.site-nav, main, .site-footer { position: relative; z-index: 2; }

/* ---- Shared layout ---------------------------------------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--sp-6); }

.section { padding: var(--sp-9) 0; }
.section + .section { padding-top: 0; }

.section-head { margin-bottom: var(--sp-7); }

.eyebrow {
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  color: var(--c-accent);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}
.eyebrow::before {
  content: '';
  width: 24px; height: 1px;
  background: var(--c-accent);
  display: inline-block;
}

.section-title {
  font-family: var(--f-display);
  font-size: var(--t-xl);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--c-text);
}
.section-title span { color: var(--c-accent); }

.section-sub {
  color: var(--c-text-muted);
  margin-top: var(--sp-3);
  max-width: 620px;
}

/* ---- Navigation ------------------------------------------- */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  display: flex;
  align-items: center;
  transition: var(--transition);
  border-bottom: 1px solid transparent;
}
.site-nav.is-scrolled {
  background: rgba(6,16,14,0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--c-border);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--sp-6);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-family: var(--f-display);
  font-size: var(--t-lg);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--c-text);
  text-decoration: none;
}
.nav-logo img { width: 30px; height: 30px; object-fit: contain; }
.nav-logo span { color: var(--c-accent); }

.nav-links {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  list-style: none;
}
.nav-links a {
  position: relative;
  z-index: 1;
  display: inline-block;
  padding: 9px 16px;
  border-radius: var(--r-pill);
  font-size: var(--t-sm);
  color: var(--c-text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
}
.nav-links a:hover { color: var(--c-text); }
.nav-links a.active { color: var(--c-accent); }

/* Glass indicator: tracks the hovered link, snaps back to the
   active section's link otherwise. Position/size set via JS. */
.nav-indicator {
  position: absolute;
  top: 0; left: 0;
  width: 0; height: 0;
  border-radius: var(--r-pill);
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.16);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  box-shadow: 0 4px 18px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.10);
  opacity: 0;
  z-index: 0;
  pointer-events: none;
  transition:
    top 0.35s cubic-bezier(0.4,0,0.2,1),
    left 0.35s cubic-bezier(0.4,0,0.2,1),
    width 0.35s cubic-bezier(0.4,0,0.2,1),
    height 0.35s cubic-bezier(0.4,0,0.2,1),
    opacity 0.25s ease;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  width: 44px; height: 44px;
  cursor: pointer;
  padding: 0;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--c-text);
  border-radius: 2px;
}

/* ---- Buttons ---------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--r-pill);
  font-family: var(--f-body);
  font-size: var(--t-sm);
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.btn-primary { background: var(--c-amber); color: #0B1A19; }
.btn-primary:hover { background: #ffc14a; box-shadow: var(--glow-amber); transform: translateY(-1px); }
.btn-secondary { background: transparent; color: var(--c-accent); border: 1px solid var(--c-accent); }
.btn-secondary:hover { background: rgba(126,200,69,0.08); box-shadow: var(--glow-accent); }

/* ---- Tags ------------------------------------------------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--r-pill);
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.05em;
}
.tag-accent { background: rgba(126,200,69,0.1); color: var(--c-accent); border: 1px solid rgba(126,200,69,0.25); }
.tag-amber  { background: rgba(245,166,35,0.1); color: var(--c-amber);  border: 1px solid rgba(245,166,35,0.25); }
.tag-teal   { background: rgba(13,79,74,0.4);   color: #7ecdc8;         border: 1px solid rgba(13,79,74,0.6); }
.tag-muted  { background: var(--c-surface-2);   color: var(--c-text-muted); border: 1px solid var(--c-border); }
.tag-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); }

/* ---- Hero ------------------------------------------------- */
.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding-top: calc(var(--nav-h) + var(--sp-7));
  padding-bottom: var(--sp-8);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: var(--sp-8);
  align-items: center;
  width: 100%;
}
.hero-eyebrow {
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  color: var(--c-accent);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: var(--sp-5);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.hero-eyebrow::before { content: ''; width: 32px; height: 1px; background: var(--c-accent); display: inline-block; }

.hero-name {
  font-family: var(--f-display);
  font-size: clamp(2.8rem, 7vw, 6rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 0.98;
  color: var(--c-text);
}
.hero-name em { font-style: normal; color: var(--c-accent); }

.hero-role {
  font-family: var(--f-body);
  font-size: var(--t-lg);
  font-weight: 500;
  color: var(--c-text);
  margin-top: var(--sp-4);
}
.hero-role b { color: var(--c-accent); font-weight: 700; }

.hero-lead {
  font-size: var(--t-md);
  color: var(--c-text-muted);
  max-width: 560px;
  line-height: 1.65;
  margin-top: var(--sp-5);
}
.hero-cta { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-6); }

.hero-tags { margin-top: var(--sp-6); }

/* Social icons */
.socials-icons { display: flex; gap: var(--sp-4); }
.socials-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--c-border);
  background: var(--c-surface-2);
  transition: var(--transition);
}
.socials-icons a:hover {
  border-color: var(--c-accent-dim);
  box-shadow: var(--glow-accent);
  transform: translateY(-2px);
}
.socials-icons .ico {
  width: 18px;
  height: 18px;
  background-color: var(--c-text-muted);
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  transition: var(--transition);
}
.socials-icons a:hover .ico { background-color: var(--c-accent); }

/* Portrait */
.hero-portrait { position: relative; justify-self: center; }
.hero-portrait::before {
  content: '';
  position: absolute;
  inset: -18px;
  border-radius: var(--r-lg);
  background: radial-gradient(circle at 30% 20%, rgba(126,200,69,0.25), transparent 60%);
  filter: blur(8px);
  z-index: 0;
}
.hero-portrait img {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: var(--r-lg);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-card);
  filter: saturate(1.05) contrast(1.02);
}
.hero-portrait .portrait-tag {
  position: absolute;
  z-index: 2;
  bottom: var(--sp-4);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(6,16,14,0.9);
  backdrop-filter: blur(8px);
  border: 1px solid var(--c-border);
  border-radius: var(--r-pill);
  padding: var(--sp-2) var(--sp-4);
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  color: var(--c-accent);
  white-space: nowrap;
}

/* ---- Stats band ------------------------------------------- */
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-4);
}
.stat-block {
  padding: var(--sp-5);
  background: rgba(17,35,32,0.7);
  backdrop-filter: blur(6px);
  border-radius: var(--r-md);
  border: 1px solid var(--c-border);
}
.stat-value {
  font-family: var(--f-display);
  font-size: var(--t-2xl);
  font-weight: 700;
  color: var(--c-amber);
  letter-spacing: -0.02em;
  line-height: 1;
}
.stat-label {
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  color: var(--c-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: var(--sp-2);
}

/* ---- Cards / panels --------------------------------------- */
.panel {
  background: rgba(17,35,32,0.72);
  backdrop-filter: blur(6px);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
}

.card {
  background: rgba(17,35,32,0.72);
  backdrop-filter: blur(6px);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  height: 100%;
}
.card:hover {
  border-color: var(--c-accent-dim);
  box-shadow: var(--glow-accent);
  transform: translateY(-2px);
}
.card-accent-bar {
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--c-accent), var(--c-primary));
}
.card-label {
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  color: var(--c-accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--sp-3);
}
.card-title {
  font-family: var(--f-display);
  font-size: var(--t-md);
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: var(--sp-3);
  line-height: 1.25;
}
.card-body { font-size: var(--t-sm); color: var(--c-text-muted); line-height: 1.6; }

/* ---- About ------------------------------------------------ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-6);
  align-items: start;
}
.about-text p { color: var(--c-text-muted); line-height: 1.75; }
.about-text p + p { margin-top: var(--sp-4); }
.about-text strong { color: var(--c-text); font-weight: 600; }

.info-list { list-style: none; display: grid; gap: var(--sp-4); }
.info-list li { display: grid; gap: 2px; }
.info-k {
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  color: var(--c-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.info-v { color: var(--c-text); font-size: var(--t-sm); }
.info-v a { color: var(--c-accent); text-decoration: none; }
.info-v a:hover { text-decoration: underline; }

.email-obfuscate { user-select: all; }
.info-v.email-obfuscate { color: var(--c-accent); }
.info-v.email-obfuscate:hover { text-decoration: underline; }

/* ---- Timeline (education / experience) -------------------- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-8); }

.timeline { position: relative; padding-left: var(--sp-6); }
.timeline::before {
  content: '';
  position: absolute;
  left: 5px; top: 6px; bottom: 6px;
  width: 1px;
  background: linear-gradient(180deg, var(--c-accent), var(--c-primary), transparent);
}
.tl-item { position: relative; padding-bottom: var(--sp-6); }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--sp-6) + 1px);
  top: 5px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(126,200,69,0.15);
}
.tl-year {
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  color: var(--c-amber);
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}
.tl-title { font-weight: 600; color: var(--c-text); font-size: var(--t-base); line-height: 1.3; }
.tl-sub { color: var(--c-text-muted); font-size: var(--t-sm); margin-top: 2px; }
.tl-badge {
  display: inline-block;
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--c-accent);
  border: 1px solid rgba(126,200,69,0.25);
  background: rgba(126,200,69,0.08);
  border-radius: var(--r-sm);
  padding: 1px 6px;
  margin-top: var(--sp-2);
}

/* ---- Projects grid ---------------------------------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--sp-4);
}
.proj-year {
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  color: var(--c-text-dim);
}
.proj-role {
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  color: var(--c-accent);
  margin-top: var(--sp-3);
}

/* ---- Publications ----------------------------------------- */
.pub-list { list-style: none; display: grid; gap: var(--sp-3); }
.pub-item {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: var(--sp-5);
  padding: var(--sp-4) var(--sp-5);
  background: rgba(17,35,32,0.6);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  transition: var(--transition);
}
.pub-item > div {
  padding-left: var(--sp-5);
  border-left: 1px solid var(--c-border);
}
.pub-item:hover { border-color: var(--c-accent-dim); background: rgba(17,35,32,0.85); }
.pub-year {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: var(--t-md);
  color: var(--c-accent);
  letter-spacing: -0.01em;
}
.pub-title { color: var(--c-text); font-size: var(--t-sm); font-weight: 500; line-height: 1.45; }
.pub-venue { color: var(--c-text-muted); font-size: var(--t-xs); margin-top: 3px; font-style: italic; }
.pub-role { font-family: var(--f-mono); font-size: var(--t-xs); margin-top: 4px; letter-spacing: 0.04em; }
.role-lead   { color: var(--c-amber); }      /* Ketua */
.role-expert { color: #7ecdc8; }             /* Tenaga Ahli */
.role-member { color: var(--c-text-muted); } /* Anggota */

/* Project list — no year gutter, theme tag + institution instead */
.pub-item.proj-item { grid-template-columns: 1fr; }
.pub-item.proj-item > div { padding-left: 0; border-left: none; }
.proj-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-top: var(--sp-3);
}
.proj-inst {
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  color: var(--c-text-dim);
  letter-spacing: 0.03em;
}

/* ---- Patents / orgs cards --------------------------------- */
.mini-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }

/* ---- Contact / footer ------------------------------------- */
.contact-panel {
  text-align: center;
  padding: var(--sp-8) var(--sp-6);
  background:
    radial-gradient(circle at 50% -20%, rgba(13,79,74,0.4), transparent 60%),
    rgba(17,35,32,0.72);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  backdrop-filter: blur(6px);
}
.contact-title {
  font-family: var(--f-display);
  font-size: var(--t-2xl);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.contact-title span { color: var(--c-accent); }
.contact-sub { color: var(--c-text-muted); margin: var(--sp-4) auto 0; max-width: 480px; }
.contact-cta { display: flex; gap: var(--sp-3); justify-content: center; flex-wrap: wrap; margin-top: var(--sp-6); }

.site-footer {
  border-top: 1px solid var(--c-border);
  margin-top: var(--sp-9);
  padding: var(--sp-6) 0;
}
.footer-nav {
  display: flex;
  justify-content: center;
  gap: var(--sp-6);
  flex-wrap: wrap;
  padding-bottom: var(--sp-5);
  margin-bottom: var(--sp-5);
  border-bottom: 1px solid var(--c-border);
}
.footer-nav a {
  font-family: var(--f-mono);
  font-size: var(--t-sm);
  color: var(--c-text-muted);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: var(--transition);
}
.footer-nav a:hover { color: var(--c-accent); }

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  color: var(--c-text-dim);
}

/* ---- Reveal animation ------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
[data-reveal].is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---- Responsive ------------------------------------------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: var(--sp-7); }
  .hero-portrait { order: -1; }
  .hero-portrait img { max-width: 260px; }
  .about-grid, .two-col { grid-template-columns: 1fr; gap: var(--sp-6); }
  .stat-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .nav-links {
    position: absolute;
    top: var(--nav-h);
    right: var(--sp-4);
    left: var(--sp-4);
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-4);
    background: rgba(6,16,14,0.97);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    padding: var(--sp-5);
    display: none;
  }
  .nav-links.is-open { display: flex; }
  .nav-toggle { display: flex; }
  .section { padding: var(--sp-8) 0; }
  .mini-grid { grid-template-columns: 1fr; }
  .pub-item { grid-template-columns: 46px 1fr; gap: var(--sp-4); }
  .pub-item > div { padding-left: var(--sp-4); }
}

@media (max-width: 460px) {
  .wrap { padding: 0 var(--sp-4); }
  .nav-inner { padding: 0 var(--sp-4); }
  .stat-row { grid-template-columns: 1fr; }
  .contact-cta { flex-direction: column; }
  .contact-cta .btn { justify-content: center; }
}
