/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --bg:          #fafaf8;
  --ink:         #111111;
  --ink-mid:     #444444;
  --ink-muted:   #777777;
  --ink-faint:   #aaaaaa;
  --border:      rgba(0,0,0,0.08);
  --sidebar-w:   260px;

  --ff-serif:    'DM Serif Display', Georgia, serif;
  --ff-sans:     'DM Sans', system-ui, sans-serif;
  --ff-mono:     'DM Mono', 'Courier New', monospace;

  --accent-scopus: #1a6b4a;
  --accent-sinta:  #1a4a6b;
  --accent-proc:   #5a3e8a;
  --accent-natl:   #7a5a2a;

  --gold:   #b08d2a;
  --silver: #707070;
  --honor:  #5a6e8a;

  --hl-bg:  rgba(180,145,50,0.10);
  --hl-border: rgba(180,145,50,0.25);

  --radius-sm: 4px;
  --radius:    8px;
  --radius-lg: 14px;

  --transition: 0.3s var(--ease);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ff-sans);
  font-weight: 400;
  line-height: 1.7;
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
ul { list-style: none; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 3rem 2rem;
  border-right: 1px solid var(--border);
  background: var(--bg);
  z-index: 100;
  overflow-y: auto;
}

.sidebar-top {
  margin-bottom: 3rem;
}

.sidebar-name {
  display: block;
  font-family: var(--ff-serif);
  font-size: 1.35rem;
  line-height: 1.25;
  color: var(--ink);
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}
.sidebar-name em {
  font-style: italic;
}

.sidebar-role {
  font-family: var(--ff-mono);
  font-size: 0.68rem;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.4;
}

/* NAV */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  flex: 1;
}

.nav-link {
  font-family: var(--ff-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding: 0.45rem 0;
  position: relative;
  transition: color var(--transition);
}

.nav-link::before {
  content: '';
  position: absolute;
  left: -2rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 1px;
  background: var(--ink);
  transition: width var(--transition);
}

.nav-link:hover {
  color: var(--ink);
}
.nav-link.active {
  color: var(--ink);
  padding-left: 0.85rem;
}
.nav-link.active::before {
  width: 0;
}
.nav-link.active::after {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 14px;
  background: var(--ink);
  border-radius: 2px;
  animation: borderSlide 0.35s var(--ease) forwards;
}
@keyframes borderSlide {
  from { height: 0; opacity: 0; }
  to   { height: 14px; opacity: 1; }
}

/* SIDEBAR BOTTOM */
.sidebar-bottom {
  margin-top: auto;
  padding-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-contact-link {
  font-family: var(--ff-mono);
  font-size: 0.65rem;
  color: var(--ink-muted);
  transition: color var(--transition);
  word-break: break-all;
}
.sidebar-contact-link:hover { color: var(--ink); }

/* AVAILABILITY BADGE */
.avail-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--ff-mono);
  font-size: 0.68rem;
  color: var(--ink-muted);
  letter-spacing: 0.03em;
}

.pulse-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.5); }
  50%       { box-shadow: 0 0 0 5px rgba(34,197,94,0); }
}

/* ============================================================
   HAMBURGER
   ============================================================ */
.hamburger {
  display: none;
  position: fixed;
  top: 1.2rem;
  right: 1.2rem;
  z-index: 200;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.65rem;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
}
.hamburger span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--ink);
  transition: transform var(--transition), opacity var(--transition);
}
.hamburger.open span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 90;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
}

/* ============================================================
   SECTIONS
   ============================================================ */
.section {
  padding: 100px 4rem;
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
}

.section-label {
  font-family: var(--ff-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 3rem;
}

/* FADE IN */
.fade-section {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.fade-section.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   HERO
   ============================================================ */
.section-hero {
  padding-top: 5rem;
  padding-bottom: 5rem;
}

.hero-inner {
  display: flex;
  gap: 3.5rem;
  align-items: flex-start;
}

.hero-text {
  flex: 1;
  min-width: 0;
}

.hero-tagline {
  font-family: var(--ff-serif);
  font-size: clamp(52px, 4.5vw, 68px);
  line-height: 1.12;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin-bottom: 1.5rem;
}
.hero-tagline em {
  font-style: italic;
}

/* Word reveal */
.word-reveal {
  display: inline-block;
  clip-path: inset(0 100% 0 0);
  animation: wordReveal 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes wordReveal {
  to { clip-path: inset(0 0% 0 0); }
}

.word-reveal:nth-child(1)  { animation-delay: 0.05s; }
.word-reveal:nth-child(2)  { animation-delay: 0.15s; }
.word-reveal:nth-child(3)  { animation-delay: 0.25s; }
.word-reveal:nth-child(4)  { animation-delay: 0.38s; }
.word-reveal:nth-child(5)  { animation-delay: 0.48s; }
.word-reveal:nth-child(6)  { animation-delay: 0.58s; }

.hero-description {
  font-size: 1.05rem;
  color: var(--ink-mid);
  line-height: 1.75;
  margin-bottom: 2.5rem;
  max-width: 560px;
}

/* STATS ROW */
.stats-row {
  display: flex;
  gap: 0;
  margin-bottom: 2.5rem;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: flex-start;
}
.stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.stat-number {
  font-family: var(--ff-serif);
  font-size: 2rem;
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.stat-label {
  font-family: var(--ff-mono);
  font-size: 0.63rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.hero-avail {
  margin-top: 0.5rem;
}

/* PHOTO */
.hero-photo-wrap {
  flex-shrink: 0;
  width: 220px;
}
.hero-photo {
  width: 220px;
  height: 290px;
  object-fit: cover;
  border-radius: 12px;
  filter: grayscale(12%);
  box-shadow: 0 8px 40px rgba(0,0,0,0.10);
  transition: filter 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.hero-photo:hover {
  filter: grayscale(0%);
  box-shadow: 0 12px 48px rgba(0,0,0,0.14);
}

.photo-fallback {
  display: none;
  width: 220px;
  height: 290px;
  border-radius: 12px;
  background: #e8e5de;
  align-items: center;
  justify-content: center;
  font-family: var(--ff-serif);
  font-size: 2.5rem;
  color: var(--ink-mid);
  letter-spacing: 0.05em;
  box-shadow: 0 8px 40px rgba(0,0,0,0.08);
}

/* ============================================================
   HIGHLIGHT STYLE
   ============================================================ */
.hl {
  background: var(--hl-bg);
  border-bottom: 1px solid var(--hl-border);
  border-radius: 2px;
  padding: 0 2px;
  font-weight: 500;
}

/* ============================================================
   TIMELINE (Experience & Education)
   ============================================================ */
.timeline {
  display: flex;
  flex-direction: column;
}

.timeline-entry {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 0 2.5rem;
  padding: 2rem 0;
  border-top: 0.5px solid var(--border);
}
.timeline-entry:last-child {
  border-bottom: 0.5px solid var(--border);
}

.timeline-date {
  padding-top: 0.15rem;
}
.entry-date {
  font-family: var(--ff-mono);
  font-size: 0.65rem;
  color: var(--ink-faint);
  letter-spacing: 0.05em;
  display: block;
  white-space: nowrap;
}

.entry-title {
  font-family: var(--ff-sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.2rem;
}

.entry-org {
  font-family: var(--ff-mono);
  font-size: 0.68rem;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
  margin-bottom: 0.75rem;
}

.entry-desc {
  font-size: 0.9rem;
  color: var(--ink-mid);
  line-height: 1.72;
}

/* ============================================================
   PROJECTS
   ============================================================ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5px;
  border: 0.5px solid var(--border);
  align-items: stretch;
}

.project-card {
  padding: 2rem;
  background: var(--bg);
  position: relative;
  transition: transform 0.3s var(--ease), background 0.3s ease;
  overflow: hidden;
  transform-style: preserve-3d;
  will-change: transform;
  cursor: none;
}
.project-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--mx,50%) var(--my,50%), rgba(255,255,255,0.07) 0%, transparent 60%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.project-card:hover::after { opacity: 1; }

.project-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
  flex-wrap: wrap;
}

.project-num {
  font-family: var(--ff-mono);
  font-size: 0.65rem;
  color: var(--ink-faint);
  letter-spacing: 0.1em;
}

.award-badge {
  font-family: var(--ff-mono);
  font-size: 0.6rem;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  line-height: 1.3;
}
.award-badge.gold   { background: rgba(176,141,42,0.12); color: var(--gold); }
.award-badge.silver { background: rgba(112,112,112,0.1); color: var(--silver); }
.award-badge.muted  { background: rgba(90,110,138,0.1); color: var(--honor); }

.project-title {
  font-family: var(--ff-sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.project-desc {
  font-size: 0.875rem;
  color: var(--ink-mid);
  line-height: 1.72;
  margin-bottom: 1rem;
}

.project-link {
  display: inline-block;
  font-family: var(--ff-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: #fff;
  background: #111;
  border: 1px solid #111;
  padding: 0.45rem 0.7rem;
  border-radius: 4px;
  margin-top: 0.25rem;
  transition: background var(--transition), border-color var(--transition);
}
.project-link:hover {
  color: #fff;
  background: #000;
  border-color: #000;
}

/* TAGS */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.tag {
  font-family: var(--ff-mono);
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  border: 0.5px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  background: transparent;
  transition: color var(--transition), border-color var(--transition);
}
.tag:hover { color: var(--ink); border-color: rgba(0,0,0,0.2); }

/* ============================================================
   PUBLICATIONS
   ============================================================ */
.pub-list {
  display: flex;
  flex-direction: column;
}

.pub-entry {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 0 2rem;
  padding: 2rem 0;
  border-top: 0.5px solid var(--border);
}
.pub-entry:last-child { border-bottom: 0.5px solid var(--border); }

.pub-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 0.2rem;
}

.pub-year {
  font-family: var(--ff-mono);
  font-size: 0.65rem;
  color: var(--ink-faint);
  letter-spacing: 0.05em;
}

.pub-index {
  font-family: var(--ff-mono);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  display: inline-block;
  width: fit-content;
}
.pub-index.scopus { background: rgba(26,107,74,0.1); color: var(--accent-scopus); }
.pub-index.sinta  { background: rgba(26,74,107,0.1); color: var(--accent-sinta); }
.pub-index.proc   { background: rgba(90,62,138,0.1); color: var(--accent-proc); }
.pub-index.natl   { background: rgba(122,90,42,0.1); color: var(--accent-natl); }

.pub-title {
  font-family: var(--ff-sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.45;
  margin-bottom: 0.5rem;
}

.pub-authors {
  font-size: 0.82rem;
  color: var(--ink-muted);
  line-height: 1.5;
  margin-bottom: 0.3rem;
}
.pub-authors strong { color: var(--ink); font-weight: 600; }

.pub-venue {
  font-family: var(--ff-mono);
  font-size: 0.65rem;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
  margin-bottom: 0.75rem;
  font-style: italic;
}

.pub-desc {
  font-size: 0.875rem;
  color: var(--ink-mid);
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

.pub-link {
  display: inline-block;
  font-family: var(--ff-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 1px;
  transition: color var(--transition), border-color var(--transition);
}
.pub-link:hover {
  color: var(--ink);
  border-color: var(--ink);
}

/* ============================================================
   AWARDS
   ============================================================ */
.awards-list {
  display: flex;
  flex-direction: column;
}

.award-entry {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  padding: 1.5rem 0;
  border-top: 0.5px solid var(--border);
}
.award-entry:last-child { border-bottom: 0.5px solid var(--border); }

.award-medal {
  font-size: 0.65rem;
  padding-top: 0.35rem;
  flex-shrink: 0;
}
.gold-medal   { color: var(--gold); }
.silver-medal { color: var(--silver); }
.honor-medal  { color: var(--honor); }

.award-placement {
  font-family: var(--ff-mono);
  font-size: 0.65rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}
.gold-text   { color: var(--gold); }
.silver-text { color: var(--silver); }
.honor-text  { color: var(--honor); }

.award-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.2rem;
}

.award-org {
  font-family: var(--ff-mono);
  font-size: 0.65rem;
  color: var(--ink-faint);
}

/* ============================================================
   SKILLS
   ============================================================ */
.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem 3rem;
}

.skill-col-wide {
  grid-column: 1 / -1;
}

.skill-category {
  font-family: var(--ff-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 1rem;
}

.cert-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.cert-list li {
  font-size: 0.875rem;
  color: var(--ink-mid);
  line-height: 1.5;
}
.cert-org {
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  color: var(--ink-faint);
}

/* ============================================================
   CONTACT
   ============================================================ */
.section-contact {
  text-align: center;
  padding-left: 4rem;
  padding-right: 4rem;
}

.contact-heading {
  font-family: var(--ff-serif);
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 0.75rem;
  font-weight: 400;
}
.contact-heading em { font-style: italic; }

.contact-sub {
  font-size: 1rem;
  color: var(--ink-muted);
  margin-bottom: 2.5rem;
}

.contact-btns {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  font-family: var(--ff-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.8rem 1.8rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition), transform var(--transition);
  display: inline-block;
}
.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--ink);
  color: var(--bg);
}
.btn-primary:hover { background: #333; }

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 0.5px solid rgba(0,0,0,0.25);
}
.btn-secondary:hover { background: rgba(0,0,0,0.04); }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  padding: 2rem 4rem;
  border-top: 0.5px solid var(--border);
  max-width: 860px;
  margin: 0 auto;
}

/* ============================================================
   CUSTOM CURSOR
   ============================================================ */
.cursor-dot {
  position: fixed;
  width: 8px;
  height: 8px;
  background: var(--ink);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10001;
  transform: translate(-50%, -50%);
  transition: width 0.2s ease, height 0.2s ease;
  will-change: left, top;
}
.cursor-ring {
  position: fixed;
  width: 32px;
  height: 32px;
  border: 1.5px solid rgba(0,0,0,0.28);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  transform: translate(-50%, -50%);
  transition: width 0.3s var(--ease), height 0.3s var(--ease), border-color 0.3s ease;
  will-change: left, top;
}
.cursor-ring.ring-hover {
  width: 48px;
  height: 48px;
  border-color: rgba(0,0,0,0.55);
}
.cursor-dot.dot-press  { width: 4px;  height: 4px; }
.cursor-ring.ring-press { width: 24px; height: 24px; }
.site-footer p {
  font-family: var(--ff-mono);
  font-size: 0.65rem;
  color: var(--ink-faint);
  letter-spacing: 0.05em;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    width: 240px;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.1);
  }
  .hamburger { display: flex; }
  .overlay.open { display: block; }
  .main-content { margin-left: 0; }

  /* Restore default cursor on touch */
  body, a, button, .project-card { cursor: auto !important; }
  .cursor-dot, .cursor-ring { display: none !important; }

  .section { padding: 72px 1.8rem; }
  .section-contact { padding-left: 1.8rem; padding-right: 1.8rem; }
  .site-footer { padding: 2rem 1.8rem; }

  .hero-inner { flex-direction: column-reverse; gap: 2rem; }
  .hero-photo-wrap { width: 100%; }
  .hero-photo { width: 150px; height: 195px; }
  .photo-fallback { width: 150px; height: 195px; font-size: 2rem; }
  .stats-row { flex-wrap: wrap; gap: 1.5rem; justify-content: flex-start; }

  .projects-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .skill-col-wide { grid-column: auto; }

  .timeline-entry { grid-template-columns: 1fr; gap: 0.3rem; }
  .timeline-date { margin-bottom: 0.5rem; }

  .pub-entry { grid-template-columns: 1fr; gap: 0.75rem; }
  .pub-meta { flex-direction: row; align-items: center; }
}

@media (max-width: 540px) {
  .stats-row { gap: 1.5rem; }
  .hero-tagline { font-size: 2.2rem; }
  .contact-heading { font-size: 1.8rem; }
}
