/* ===== Tokens ===== */
:root {
  --bg: #1B1812;
  --bg-panel: #211D16;
  --bg-panel-hover: #262119;
  --hairline: #3B3527;
  --text: #F0EAD8;
  --text-muted: #ABA189;
  --gold: #D8A63D;
  --teal: #7FA898;

  --cat-ml: #7FA898;    /* Machine Learning */
  --cat-dl: #D8A63D;    /* Deep Learning */
  --cat-data: #8FA9C9;  /* Data Analysis with Python */
  --cat-genai: #B98CC4; /* Gen AI */
  --cat-auto: #C97B4A;  /* Automation */

  --font-display: "Fraunces", serif;
  --font-body: "IBM Plex Sans", sans-serif;
  --measure: 62ch;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

@keyframes reveal-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes line-grow {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
@keyframes spin-cw {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes spin-ccw {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}
@keyframes reveal-scale {
  from { opacity: 0; transform: scale(0.82); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(216, 166, 61, 0.28), 0 0 22px 4px rgba(216, 166, 61, 0.35); }
  50% { box-shadow: 0 0 0 16px rgba(216, 166, 61, 0), 0 0 30px 8px rgba(216, 166, 61, 0.5); }
}

body {
  margin: 0;
  background: var(--bg);
  background-image:
    linear-gradient(rgba(240, 234, 216, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(240, 234, 216, 0.028) 1px, transparent 1px);
  background-size: 42px 42px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; margin: 0; color: var(--text); }
p { margin: 0; }
a { color: var(--teal); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color 0.15s ease, opacity 0.15s ease; }
a:hover, a:focus-visible { border-bottom-color: var(--teal); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.section-inner { max-width: 980px; margin: 0 auto; padding: 0 28px; }

/* ===== Scroll reveal (generic, used on every section) ===== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.in-view { opacity: 1; transform: translateY(0); }
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-stagger.in-view > *:nth-child(1) { transition-delay: 0.02s; }
.reveal-stagger.in-view > *:nth-child(2) { transition-delay: 0.1s; }
.reveal-stagger.in-view > *:nth-child(3) { transition-delay: 0.18s; }
.reveal-stagger.in-view > *:nth-child(4) { transition-delay: 0.26s; }
.reveal-stagger.in-view > *:nth-child(5) { transition-delay: 0.34s; }
.reveal-stagger.in-view > *:nth-child(6) { transition-delay: 0.42s; }
.reveal-stagger.in-view > * { opacity: 1; transform: translateY(0); }

/* ===== Top nav ===== */
.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(27, 24, 18, 0.88);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--hairline);
}
.topnav-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topnav-mark {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--gold);
  font-size: 1.1rem;
}
.topnav-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.topnav-status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--gold);
  animation: pulse-glow 2.4s ease-in-out infinite;
}
.topnav-links { display: flex; gap: 26px; align-items: center; }
.topnav-links a {
  position: relative;
  font-size: 0.88rem;
  color: var(--text-muted);
  border-bottom: none;
  padding-bottom: 3px;
}
.topnav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.25s ease;
}
.topnav-links a:hover { color: var(--text); }
.topnav-links a:hover::after,
.topnav-links a.nav-active::after { transform: scaleX(1); }
.topnav-links a.nav-active { color: var(--gold); }
.topnav-back { font-size: 0.88rem; color: var(--text-muted); }

/* ===== Hero ===== */
.hero { padding: 88px 0 72px; border-bottom: 1px solid var(--hairline); }
.hero-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
  text-align: left;
}
.hero-text { flex: 1 1 440px; max-width: 540px; }
.hero-orbit { flex: 0 0 auto; }

.hero-text > * {
  opacity: 0;
  animation: reveal-up 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.hero-text > *:nth-child(1) { animation-delay: 0.05s; }
.hero-text > *:nth-child(2) { animation-delay: 0.18s; }
.hero-text > *:nth-child(3) { animation-delay: 0.32s; }
.hero-text > *:nth-child(4) { animation-delay: 0.46s; }
.hero-text > *:nth-child(5) { animation-delay: 0.6s; }

.hero-orbit {
  opacity: 0;
  animation: reveal-scale 1.1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 0.3s;
}

.hero h1 { font-size: clamp(2.3rem, 5vw, 3.2rem); letter-spacing: -0.01em; margin-bottom: 18px; }
.tagline { font-size: 1.12rem; color: var(--text); max-width: 46ch; margin: 0 0 14px; }
.hero-status { color: var(--gold); font-size: 0.96rem; max-width: 44ch; margin: 0 0 18px; }
.hero-meta { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 32px; }
.hero-links { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.hero-btn {
  display: inline-block;
  font-size: 0.92rem;
  padding: 12px 24px;
  border-radius: 6px;
  border-bottom: none;
  font-weight: 600;
  transition: transform 0.2s ease, filter 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.hero-btn-primary {
  background: var(--gold);
  color: var(--bg);
  border: 1px solid var(--gold);
}
.hero-btn-primary:hover { filter: brightness(1.08); transform: translateY(-2px); border-bottom: none; }
.hero-btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--hairline);
}
.hero-btn-secondary:hover { border-color: var(--gold); color: var(--gold); transform: translateY(-2px); border-bottom: 1px solid var(--gold); }

@media (max-width: 860px) {
  .hero-inner { flex-direction: column-reverse; text-align: center; gap: 40px; }
  .hero-text { max-width: 520px; text-align: center; }
  .tagline, .hero-status { margin-left: auto; margin-right: auto; }
  .hero-links { justify-content: center; }
}

/* ===== Orbit (replaces a photo) ===== */
.orbit-wrap {
  width: 320px;
  height: 320px;
  margin: 8px auto 12px;
  position: relative;
}
.orbit-core {
  position: absolute;
  top: 50%; left: 50%;
  width: 58px; height: 58px;
  margin: -29px 0 0 -29px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #F3D98B, #D8A63D 60%, #93701F 100%);
  animation: pulse-glow 3.2s ease-in-out infinite;
  z-index: 2;
}
.orbit-core-halo {
  position: absolute;
  top: 50%; left: 50%;
  width: 84px; height: 84px;
  margin: -42px 0 0 -42px;
  border-radius: 50%;
  border: 1px dashed rgba(216, 166, 61, 0.35);
  animation: spin-cw 46s linear infinite;
  z-index: 1;
}
.orbit-ring {
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
}
.orbit-ring-a { animation: spin-cw 26s linear infinite; }
.orbit-ring-b { animation: spin-cw 38s linear infinite; }
.orbit-chip {
  position: absolute;
  top: 0; left: 0;
}
.orbit-chip-counter {
  position: absolute;
  top: 0; left: 0;
}
.orbit-chip-label {
  position: absolute;
  top: 0; left: 0;
  transform: translate(-50%, -50%);
}
.orbit-chip-label span {
  display: inline-block;
  background: var(--bg-panel);
  border: 1px solid var(--hairline);
  color: var(--text-muted);
  font-size: 0.72rem;
  padding: 5px 11px;
  border-radius: 999px;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .orbit-wrap { width: 260px; height: 260px; }
}

/* ===== Stats strip ===== */
.stats-strip { padding: 44px 0; border-bottom: 1px solid var(--hairline); }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  text-align: center;
}
.stat-item .stat-number {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  color: var(--gold);
  display: block;
  margin-bottom: 4px;
}
.stat-item .stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
}
@media (max-width: 720px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 28px 16px; }
}

/* ===== Category icon (replaces plain dot) ===== */
.category-icon {
  width: 16px; height: 16px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.category-icon svg { width: 100%; height: 100%; }

/* ===== Mini charts on project cards ===== */
.card-chart { margin-bottom: 14px; }
.chart-bar-track {
  width: 100%;
  height: 6px;
  background: var(--hairline);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 6px;
}
.chart-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--card-accent, var(--gold));
  border-radius: 999px;
  transition: width 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}
.chart-caption { font-size: 0.8rem; color: var(--text-muted); }
.chart-compare { display: flex; gap: 10px; align-items: flex-end; height: 40px; margin-bottom: 6px; }
.chart-compare-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; justify-content: flex-end; height: 100%; }
.chart-compare-bar {
  width: 60%;
  background: var(--hairline);
  border-radius: 3px 3px 0 0;
  height: 4px;
  transition: height 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}
.chart-compare-col.is-after .chart-compare-bar { background: var(--card-accent, var(--gold)); }
.chart-compare-tick { font-size: 0.7rem; color: var(--text-muted); }
.journey { padding: 76px 0; border-bottom: 1px solid var(--hairline); }
.journey h2 { font-size: 1.75rem; margin-bottom: 10px; }
.journey-intro { color: var(--text-muted); margin-bottom: 44px; max-width: var(--measure); }
.path-track { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.path-node { position: relative; padding: 28px 20px 0 0; opacity: 0; }
.path-node::before {
  content: ""; position: absolute; top: 0; left: 0; right: 20px; height: 2px;
  background: var(--hairline); transform-origin: left center; transform: scaleX(0);
}
.path-node-current::before { background: var(--gold); }
.path-node:last-child { padding-right: 0; }
.path-node:last-child::before { right: 0; }
.path-track.in-view .path-node { animation: reveal-up 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.path-track.in-view .path-node::before { animation: line-grow 0.5s ease-out forwards; }
.path-track.in-view .path-node:nth-child(1) { animation-delay: 0.05s; }
.path-track.in-view .path-node:nth-child(1)::before { animation-delay: 0.05s; }
.path-track.in-view .path-node:nth-child(2) { animation-delay: 0.25s; }
.path-track.in-view .path-node:nth-child(2)::before { animation-delay: 0.25s; }
.path-track.in-view .path-node:nth-child(3) { animation-delay: 0.45s; }
.path-track.in-view .path-node:nth-child(3)::before { animation-delay: 0.45s; }
.path-track.in-view .path-node:nth-child(4) { animation-delay: 0.65s; }
.path-track.in-view .path-node:nth-child(4)::before { animation-delay: 0.65s; }
.path-dot { position: absolute; top: -6px; left: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--hairline); }
.path-node-current .path-dot { background: var(--gold); }
.path-node h3 { font-size: 1.05rem; margin-bottom: 8px; }
.path-node p { color: var(--text-muted); font-size: 0.92rem; max-width: 26ch; }
.path-node-current h3 { color: var(--gold); }

/* ===== Projects ===== */
.projects { padding: 76px 0; border-bottom: 1px solid var(--hairline); }
.projects-head { margin-bottom: 8px; }
.projects h2 { font-size: 1.75rem; margin-bottom: 10px; }
.projects-intro { color: var(--text-muted); margin-bottom: 44px; max-width: var(--measure); }

.category-block { margin-bottom: 52px; }
.category-block:last-child { margin-bottom: 0; }
.category-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.category-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.category-heading h3 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
.project-card {
  background: var(--bg-panel);
  border: 1px solid var(--hairline);
  border-top: 3px solid var(--card-accent, var(--hairline));
  border-radius: 8px;
  padding: 22px 22px 20px;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease, background 0.25s ease;
}
.project-card:hover {
  transform: translateY(-4px);
  background: var(--bg-panel-hover);
  border-color: var(--card-accent, var(--hairline));
}
.card-status {
  display: inline-block;
  font-size: 0.72rem;
  color: var(--text-muted);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 2px 10px;
  margin-bottom: 12px;
}
.card-status.status-live { color: var(--gold); border-color: var(--gold); }
.project-card h4 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
  margin-bottom: 8px;
}
.project-card .card-summary { color: var(--text-muted); font-size: 0.93rem; margin-bottom: 14px; }
.card-metric { color: var(--gold); font-size: 0.85rem; margin-bottom: 14px; }
.card-open {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--text);
  border-bottom: 1px solid var(--hairline);
}
.project-card:hover .card-open { border-bottom-color: var(--card-accent, var(--teal)); color: var(--card-accent, var(--text)); }

@media (max-width: 720px) {
  .card-grid { grid-template-columns: 1fr; }
}

/* ===== Skillset ===== */
.skillset { padding: 76px 0; border-bottom: 1px solid var(--hairline); }
.skillset h2 { font-size: 1.75rem; margin-bottom: 40px; }
.skill-groups { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px 40px; }
.skill-group {
  padding: 18px 0 0;
  border-top: 2px solid var(--hairline);
  transition: border-color 0.25s ease;
}
.skill-group:hover { border-top-color: var(--gold); }
.skill-group h3 { font-size: 0.92rem; color: var(--gold); margin-bottom: 8px; font-family: var(--font-body); font-weight: 600; }
.skill-group p { color: var(--text-muted); font-size: 0.94rem; line-height: 1.7; }
.skill-group .py-emphasis { color: var(--text); font-weight: 600; }

/* ===== Certifications ===== */
.certifications { padding: 76px 0; border-bottom: 1px solid var(--hairline); }
.certifications h2 { font-size: 1.75rem; margin-bottom: 40px; }
.cert-list { border-top: 1px solid var(--hairline); }
.cert-entry {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--hairline);
  transition: padding-left 0.2s ease;
}
.cert-entry:hover { padding-left: 8px; }
.cert-name { font-family: var(--font-display); font-size: 1.05rem; }
.cert-issuer { color: var(--text-muted); font-size: 0.9rem; text-align: right; }
.cert-ongoing { color: var(--gold); font-size: 0.78rem; border: 1px solid var(--gold); border-radius: 999px; padding: 1px 9px; margin-left: 10px; }

/* ===== Contact ===== */
.contact { padding: 76px 0 60px; }
.contact h2 { font-size: 1.75rem; margin-bottom: 14px; }
.contact-intro { color: var(--text-muted); margin-bottom: 36px; max-width: var(--measure); }
.contact-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 44px; }
.contact-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-panel);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 20px 18px;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.contact-box:hover { transform: translateY(-3px); border-color: var(--gold); background: var(--bg-panel-hover); }
.contact-box-icon {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem;
  color: var(--gold);
  font-family: var(--font-display);
  font-style: italic;
}
.contact-box-label { font-size: 0.95rem; color: var(--text); border-bottom: none; }
.footer-note { color: var(--text-muted); font-size: 0.85rem; }

@media (max-width: 720px) {
  .contact-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===== Project detail page ===== */
.detail-hero { padding: 48px 0 44px; border-bottom: 1px solid var(--hairline); }
.detail-category {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  color: var(--card-accent, var(--gold));
  margin-bottom: 18px;
}
.detail-category .category-dot { background: var(--card-accent, var(--gold)); }
.detail-hero h1 { font-size: clamp(2rem, 4.5vw, 2.8rem); margin-bottom: 16px; max-width: 22ch; }
.detail-summary { color: var(--text-muted); font-size: 1.05rem; max-width: var(--measure); margin-bottom: 22px; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.detail-tag { font-size: 0.78rem; color: var(--text-muted); border: 1px solid var(--hairline); padding: 3px 10px; border-radius: 999px; }
.detail-links { display: flex; gap: 14px; flex-wrap: wrap; }
.detail-link-btn {
  display: inline-block;
  font-size: 0.88rem;
  color: var(--bg);
  background: var(--card-accent, var(--gold));
  border: 1px solid var(--card-accent, var(--gold));
  border-radius: 6px;
  padding: 9px 18px;
  font-weight: 600;
}
.detail-link-btn:hover { filter: brightness(1.08); }

.detail-body { padding: 56px 0; }
.detail-section { margin-bottom: 44px; max-width: var(--measure); }
.detail-section:last-child { margin-bottom: 0; }
.detail-section-label {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--card-accent, var(--gold));
  font-weight: 600;
  margin-bottom: 10px;
}
.detail-section p { color: var(--text); font-size: 1.02rem; }
.skills-used-list { display: flex; flex-wrap: wrap; gap: 10px; }
.skills-used-list span {
  font-size: 0.88rem; color: var(--text); border: 1px solid var(--hairline);
  padding: 6px 14px; border-radius: 6px;
}

.detail-footer { padding: 40px 0 60px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }

/* ===== Responsive ===== */
@media (max-width: 720px) {
  .hero { padding: 60px 0 48px; }
  .journey, .projects, .skillset, .certifications { padding: 52px 0; }
  .path-track { grid-template-columns: 1fr; gap: 24px; }
  .path-node { padding: 0 0 0 20px; border-left: 2px solid var(--hairline); }
  .path-node::before { display: none; }
  .path-node-current { border-left-color: var(--gold); }
  .path-dot { top: 6px; left: -6px; }
  .skill-groups { grid-template-columns: 1fr; }
  .topnav-links { display: none; }
  .cert-entry { flex-direction: column; gap: 4px; }
  .cert-issuer { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
  .hero-text > *, .hero-orbit, .path-node, .reveal, .reveal-stagger > * { opacity: 1 !important; transform: none !important; }
  .path-node::before { transform: scaleX(1) !important; }
}
