/* =====================================================================
   Zaid Rahim — AI/ML Engineer portfolio
   Design system: dark editorial / technical-notebook aesthetic.
   Tokens → base → background → nav → sections → components → responsive.
   ===================================================================== */

/* ------------------------------------------------------------------ */
/* 1. DESIGN TOKENS                                                    */
/* ------------------------------------------------------------------ */
:root {
  /* Surfaces */
  --bg:            #0a0a0b;
  --bg-soft:       #0e0e10;
  --surface:       #131316;
  --surface-2:     #17171b;
  --surface-hover: #1c1c21;

  /* Ink */
  --fg:      #edeae3;   /* warm off-white */
  --fg-dim:  #b6b3ab;
  --muted:   #86837b;   /* muted warm grey */
  --faint:   #5a574f;
  --ghost:   #35332e;

  /* Accent — restrained warm amber */
  --accent:      #e3a066;
  --accent-2:    #d98f52;
  --accent-soft: rgba(227, 160, 102, 0.12);
  --accent-line: rgba(227, 160, 102, 0.30);
  --accent-glow: rgba(227, 160, 102, 0.16);

  /* Lines */
  --border:        rgba(237, 234, 227, 0.09);
  --border-strong: rgba(237, 234, 227, 0.16);
  --border-faint:  rgba(237, 234, 227, 0.05);

  /* Type */
  --font-display: "Instrument Serif", Georgia, "Times New Roman", serif;
  --font-sans:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Type scale (fluid) */
  --fs-hero:   clamp(3.1rem, 9vw, 8rem);
  --fs-h2:     clamp(2.2rem, 5.2vw, 4.2rem);
  --fs-h3:     clamp(1.5rem, 2.6vw, 2.1rem);
  --fs-lead:   clamp(1.05rem, 1.7vw, 1.45rem);
  --fs-body:   1rem;
  --fs-sm:     0.9rem;
  --fs-label:  0.735rem;   /* mono eyebrows */

  /* Spacing */
  --space-section: clamp(5rem, 11vw, 10rem);
  --gutter:        clamp(1.25rem, 5vw, 4.5rem);
  --maxw:          1240px;

  /* Radius */
  --r-sm: 6px;
  --r:    12px;
  --r-lg: 18px;

  /* Shadow / glow */
  --shadow:      0 20px 60px -30px rgba(0, 0, 0, 0.8);
  --shadow-lift: 0 40px 90px -40px rgba(0, 0, 0, 0.9);

  /* Motion */
  --ease:      cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
  --dur:       0.6s;
  --dur-fast:  0.28s;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--fg-dim);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  font-feature-settings: "kern", "liga";
}

body.no-scroll { overflow: hidden; }

h1, h2, h3, h4 { color: var(--fg); font-weight: 600; line-height: 1.08; letter-spacing: -0.01em; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
ul { list-style: none; }
::selection { background: var(--accent-soft); color: var(--fg); }

/* Focus visibility for keyboard users */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* Skip link */
.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 200;
  background: var(--accent); color: #0a0a0b; padding: 0.6rem 1rem;
  border-radius: var(--r-sm); font-weight: 600; font-size: var(--fs-sm);
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 1rem; }

/* ------------------------------------------------------------------ */
/* 3. LAYOUT PRIMITIVES                                                */
/* ------------------------------------------------------------------ */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

.mono {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.accent { color: var(--accent); }
.serif { font-family: var(--font-display); font-weight: 400; letter-spacing: 0; }

/* ------------------------------------------------------------------ */
/* 4. BACKGROUND ATMOSPHERE                                            */
/* ------------------------------------------------------------------ */
.bg-layer { position: fixed; inset: 0; z-index: -2; pointer-events: none; }

#particles {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: 0; transition: opacity 1.6s ease;
}
.loaded #particles { opacity: 1; }

/* Radial glow fields */
.glow {
  position: absolute; border-radius: 50%; filter: blur(90px);
  opacity: 0; transition: opacity 2s ease;
}
.loaded .glow { opacity: 1; }
.glow-1 { top: -12%; left: 8%;  width: 45vw; height: 45vw; background: radial-gradient(circle, var(--accent-glow), transparent 68%); }
.glow-2 { top: 55%;  right: -8%; width: 40vw; height: 40vw; background: radial-gradient(circle, rgba(120,120,150,0.10), transparent 70%); }
.glow-3 { bottom: -10%; left: 30%; width: 38vw; height: 38vw; background: radial-gradient(circle, rgba(227,160,102,0.07), transparent 72%); }

/* Fine grain / noise overlay */
.grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Cursor glow */
#cursor-glow {
  position: fixed; width: 380px; height: 380px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow), transparent 60%);
  transform: translate(-50%, -50%); pointer-events: none; z-index: 0;
  opacity: 0; transition: opacity 0.4s ease; mix-blend-mode: screen;
}
.loaded #cursor-glow { opacity: 0.5; }

/* Scroll progress */
#progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  z-index: 120; transition: width 0.1s linear;
  box-shadow: 0 0 10px var(--accent-glow);
}

/* ------------------------------------------------------------------ */
/* 5. NAVIGATION                                                       */
/* ------------------------------------------------------------------ */
#nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: transform 0.5s var(--ease), background 0.4s ease, border-color 0.4s ease, backdrop-filter 0.4s ease;
  border-bottom: 1px solid transparent;
  transform: translateY(-110%);
}
.loaded #nav { transform: translateY(0); }
#nav.scrolled {
  background: rgba(10, 10, 11, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--border);
}
#nav.hidden { transform: translateY(-110%); }

.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter);
}
.brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 600; color: var(--fg); letter-spacing: -0.01em; }
.brand .mark {
  width: 30px; height: 30px; border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  display: grid; place-items: center; font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent);
  transition: border-color var(--dur-fast), color var(--dur-fast), transform var(--dur-fast);
}
.brand:hover .mark { border-color: var(--accent-line); transform: rotate(-6deg); }
.brand .brand-sub { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.16em; color: var(--muted); text-transform: uppercase; }

.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-links a {
  font-family: var(--font-mono); font-size: 0.76rem; letter-spacing: 0.08em; color: var(--muted);
  text-transform: uppercase; position: relative; transition: color var(--dur-fast);
}
.nav-links a .idx { color: var(--faint); margin-right: 0.35rem; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 1px; width: 0;
  background: var(--accent); transition: width var(--dur-fast) var(--ease);
}
.nav-links a:hover, .nav-links a.active { color: var(--fg); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

.nav-cta {
  font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--fg); border: 1px solid var(--border-strong); padding: 0.5rem 0.95rem; border-radius: 100px;
  display: inline-flex; align-items: center; gap: 0.5rem; transition: all var(--dur-fast) var(--ease);
}
.nav-cta:hover { border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft); }
.nav-cta svg { width: 13px; height: 13px; }

.hamburger { display: none; width: 40px; height: 40px; position: relative; }
.hamburger span {
  position: absolute; left: 9px; width: 22px; height: 1.5px; background: var(--fg);
  transition: all 0.3s var(--ease);
}
.hamburger span:nth-child(1) { top: 15px; }
.hamburger span:nth-child(2) { top: 21px; }
.hamburger span:nth-child(3) { top: 27px; }
.hamburger.open span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { top: 21px; transform: rotate(-45deg); }

/* Mobile menu */
#mobile-menu {
  position: fixed; inset: 0; z-index: 90; background: rgba(10,10,11,0.97);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  display: flex; flex-direction: column; justify-content: center; gap: 0.4rem;
  padding: var(--gutter); opacity: 0; visibility: hidden; transition: opacity 0.4s var(--ease), visibility 0.4s;
}
#mobile-menu.open { opacity: 1; visibility: visible; }
#mobile-menu a {
  font-family: var(--font-display); font-size: clamp(2rem, 9vw, 3rem); color: var(--fg-dim);
  padding: 0.35rem 0; display: flex; align-items: baseline; gap: 1rem; transition: color var(--dur-fast);
}
#mobile-menu a .idx { font-family: var(--font-mono); font-size: 0.8rem; color: var(--faint); }
#mobile-menu a:hover, #mobile-menu a:active { color: var(--accent); }
#mobile-menu .mm-foot { margin-top: 2.5rem; display: flex; gap: 1.4rem; }
#mobile-menu .mm-foot a { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); }

/* ------------------------------------------------------------------ */
/* 6. SECTION FRAME + NUMBERED STICKY LABELS                          */
/* ------------------------------------------------------------------ */
.section { position: relative; padding-block: var(--space-section); }
.section + .section { border-top: 1px solid var(--border-faint); }

.section-head {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.4rem; margin-bottom: clamp(2.5rem, 6vw, 4.5rem);
}
.section-eyebrow { display: flex; align-items: center; gap: 0.9rem; }
.section-eyebrow .num {
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--accent); letter-spacing: 0.1em;
}
.section-eyebrow .rule { height: 1px; flex: 1; max-width: 0; background: var(--border-strong); transition: max-width 1s var(--ease); }
.reveal.visible .section-eyebrow .rule, .section.in .section-eyebrow .rule { max-width: 120px; }
.section-eyebrow .tag { font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }

.section-title { font-size: var(--fs-h2); max-width: 16ch; }
.section-title em { font-family: var(--font-display); font-style: italic; color: var(--accent); font-weight: 400; }
.section-desc { color: var(--muted); max-width: 52ch; font-size: var(--fs-lead); margin-top: 0.4rem; }

/* ------------------------------------------------------------------ */
/* 7. HERO                                                             */
/* ------------------------------------------------------------------ */
#hero {
  min-height: 100svh; display: flex; align-items: center; position: relative;
  padding-top: 68px; padding-bottom: clamp(2rem, 6vw, 4rem);
}
.hero-grid { display: grid; gap: clamp(2rem, 5vw, 3.5rem); width: 100%; }

.hero-status {
  display: inline-flex; align-items: center; gap: 0.6rem; align-self: start;
  border: 1px solid var(--border); border-radius: 100px; padding: 0.45rem 0.95rem;
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-dim);
  background: var(--surface); width: max-content; max-width: 100%;
}
.hero-status .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-glow); animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(227,160,102,0.5); }
  70% { box-shadow: 0 0 0 9px rgba(227,160,102,0); }
  100% { box-shadow: 0 0 0 0 rgba(227,160,102,0); }
}

.hero-eyebrow { display: flex; flex-wrap: wrap; gap: 0.6rem 1.4rem; color: var(--muted); }

.hero-title { font-family: var(--font-display); font-weight: 400; font-size: var(--fs-hero); line-height: 0.98; letter-spacing: -0.015em; color: var(--fg); }
.hero-title .line { display: block; overflow: hidden; }
.hero-title .line > span { display: block; }
.hero-title .accent-word { color: var(--accent); font-style: italic; }

.hero-name {
  font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--fg-dim); margin-bottom: 1.2rem;
}
.hero-name .sep { color: var(--faint); margin-inline: 0.6rem; }

.hero-intro { font-size: var(--fs-lead); color: var(--fg-dim); max-width: 56ch; line-height: 1.55; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; align-items: center; }

.btn {
  display: inline-flex; align-items: center; gap: 0.6rem; padding: 0.85rem 1.4rem; border-radius: 100px;
  font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.05em; text-transform: uppercase;
  transition: all var(--dur-fast) var(--ease); border: 1px solid transparent; white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; transition: transform var(--dur-fast) var(--ease); }
.btn-primary { background: var(--accent); color: #0a0a0b; font-weight: 600; }
.btn-primary:hover { background: var(--fg); transform: translateY(-2px); }
.btn-primary:hover svg { transform: translate(3px, -3px); }
.btn-ghost { border-color: var(--border-strong); color: var(--fg); }
.btn-ghost:hover { border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft); transform: translateY(-2px); }
.btn-ghost:hover svg { transform: translate(2px, -2px); }

.hero-socials { display: flex; gap: 0.5rem; margin-left: 0.2rem; }
.icon-btn {
  width: 42px; height: 42px; border: 1px solid var(--border); border-radius: 50%;
  display: grid; place-items: center; color: var(--muted); transition: all var(--dur-fast) var(--ease);
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { color: var(--accent); border-color: var(--accent-line); transform: translateY(-2px); background: var(--accent-soft); }

/* Hero stats */
.hero-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-top: 1rem;
  border-top: 1px solid var(--border);
}
.hero-stats .stat { padding: 1.25rem 1.25rem 0.2rem 0; border-right: 1px solid var(--border); }
.hero-stats .stat:last-child { border-right: none; }
.hero-stats .stat .v { font-family: var(--font-display); font-size: clamp(1.7rem, 3.4vw, 2.6rem); color: var(--fg); line-height: 1; }
.hero-stats .stat .l { font-size: 0.8rem; color: var(--muted); margin-top: 0.5rem; line-height: 1.4; max-width: 22ch; }

.scroll-cue {
  position: absolute; bottom: 1.6rem; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
  font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--faint);
}
.scroll-cue .bar { width: 1px; height: 42px; background: linear-gradient(var(--faint), transparent); position: relative; overflow: hidden; }
.scroll-cue .bar::after { content: ""; position: absolute; top: -50%; left: 0; width: 100%; height: 50%; background: var(--accent); animation: cue 2.2s var(--ease) infinite; }
@keyframes cue { 0% { top: -50%; } 100% { top: 100%; } }

/* ------------------------------------------------------------------ */
/* 8. FOCUS / EXPERTISE CARDS                                          */
/* ------------------------------------------------------------------ */
.focus-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border-faint); border: 1px solid var(--border-faint); border-radius: var(--r-lg); overflow: hidden; }
.focus-card {
  background: var(--bg); padding: clamp(1.5rem, 2.6vw, 2.1rem); position: relative;
  transition: background var(--dur) var(--ease); overflow: hidden; min-height: 320px;
  display: flex; flex-direction: column;
}
.focus-card::before {
  content: ""; position: absolute; top: 0; left: 0; height: 2px; width: 0;
  background: linear-gradient(90deg, var(--accent), transparent); transition: width var(--dur) var(--ease);
}
.focus-card:hover { background: var(--surface); }
.focus-card:hover::before { width: 100%; }
.focus-head { display: flex; align-items: center; justify-content: flex-end; margin-bottom: 1.2rem; }
.focus-head .no { font-family: var(--font-mono); font-size: 0.72rem; color: var(--faint); letter-spacing: 0.1em; }
.focus-viz { width: 100%; height: 92px; margin-bottom: 1.3rem; color: var(--accent); }
.focus-viz svg { width: 100%; height: 100%; overflow: visible; }
.focus-card h3 { font-size: var(--fs-h3); margin-bottom: 0.7rem; transition: color var(--dur-fast); }
.focus-card:hover h3 { color: var(--accent); }
.focus-card p { font-size: 0.92rem; color: var(--muted); flex: 1; }
.focus-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1.2rem; }
.chip {
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.03em; color: var(--fg-dim);
  border: 1px solid var(--border); border-radius: 100px; padding: 0.28rem 0.65rem; transition: all var(--dur-fast);
}
.focus-card:hover .chip { border-color: var(--border-strong); }
.chip:hover { color: var(--accent); border-color: var(--accent-line); }

/* ------------------------------------------------------------------ */
/* 9. PROJECTS (case-study cards)                                      */
/* ------------------------------------------------------------------ */
.projects { display: flex; flex-direction: column; }
.project {
  position: relative; border-top: 1px solid var(--border); padding-block: clamp(2rem, 4vw, 3rem);
  display: grid; grid-template-columns: 1fr; gap: 1.5rem; transition: background var(--dur) var(--ease);
}
.project:last-child { border-bottom: 1px solid var(--border); }
.project::before {
  content: ""; position: absolute; top: -1px; left: 0; height: 2px; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2) 60%, transparent);
  transition: width 0.7s var(--ease);
}
.project:hover::before { width: 100%; }

.project-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.project-meta { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.project-no { font-family: var(--font-mono); font-size: 0.8rem; color: var(--faint); }
.project-year { font-family: var(--font-mono); font-size: 0.72rem; color: var(--accent); border: 1px solid var(--accent-line); border-radius: 100px; padding: 0.22rem 0.7rem; }
.project-cat { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }

.project-title {
  font-family: var(--font-display); font-weight: 400; font-size: clamp(1.9rem, 4.2vw, 3.1rem); line-height: 1.02;
  color: var(--fg); transition: color var(--dur-fast) var(--ease); letter-spacing: -0.01em;
}
.project:hover .project-title { color: var(--accent); }
.project-summary { color: var(--fg-dim); font-size: var(--fs-lead); max-width: 62ch; line-height: 1.55; }

.project-foot { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.project-stack { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.project-actions { display: flex; align-items: center; gap: 1.2rem; flex-shrink: 0; }

.link-arrow {
  display: inline-flex; align-items: center; gap: 0.5rem; font-family: var(--font-mono);
  font-size: 0.74rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--fg-dim);
  transition: color var(--dur-fast);
}
.link-arrow svg { width: 14px; height: 14px; transition: transform var(--dur-fast) var(--ease); }
.link-arrow:hover { color: var(--accent); }
.link-arrow:hover svg { transform: translate(3px, -3px); }

.project-toggle {
  display: inline-flex; align-items: center; gap: 0.5rem; font-family: var(--font-mono);
  font-size: 0.74rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted);
  transition: color var(--dur-fast);
}
.project-toggle:hover { color: var(--fg); }
.project-toggle .plus { position: relative; width: 13px; height: 13px; }
.project-toggle .plus::before, .project-toggle .plus::after {
  content: ""; position: absolute; background: currentColor; transition: transform var(--dur-fast) var(--ease);
}
.project-toggle .plus::before { top: 6px; left: 0; width: 13px; height: 1.5px; }
.project-toggle .plus::after { left: 6px; top: 0; width: 1.5px; height: 13px; }
.project.open .project-toggle .plus::after { transform: rotate(90deg); }

/* Expandable detail */
.project-detail {
  display: grid; grid-template-rows: 0fr; overflow: hidden;
  transition: grid-template-rows 0.5s var(--ease);
}
.project.open .project-detail { grid-template-rows: 1fr; }
.project-detail-inner { min-height: 0; }
.detail-grid {
  display: grid; grid-template-columns: 1fr 1.6fr; gap: clamp(1.5rem, 4vw, 3rem);
  padding-top: 1.8rem; margin-top: 0.4rem; border-top: 1px dashed var(--border);
}
.detail-block .detail-label { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.7rem; }
.detail-block p { color: var(--muted); font-size: 0.95rem; }
.detail-list { display: flex; flex-direction: column; gap: 0.85rem; }
.detail-list li { position: relative; padding-left: 1.4rem; color: var(--fg-dim); font-size: 0.95rem; line-height: 1.55; }
.detail-list li::before { content: ""; position: absolute; left: 0; top: 0.6em; width: 7px; height: 7px; border: 1px solid var(--accent); transform: rotate(45deg); }

/* ------------------------------------------------------------------ */
/* 10. GITHUB SECTION                                                  */
/* ------------------------------------------------------------------ */
.gh-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
.gh-panel { border: 1px solid var(--border); border-radius: var(--r-lg); padding: clamp(1.4rem, 3vw, 2rem); background: var(--bg-soft); }
.gh-panel h3 { font-size: 1.15rem; margin-bottom: 1.4rem; display: flex; align-items: center; gap: 0.6rem; }
.gh-panel h3 svg { width: 18px; height: 18px; color: var(--accent); }

.gh-dist { display: flex; flex-direction: column; gap: 1.1rem; }
.dist-row .dist-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.5rem; }
.dist-row .dist-label { font-size: 0.88rem; color: var(--fg-dim); }
.dist-row .dist-count { font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); }
.dist-bar { height: 6px; background: var(--surface-2); border-radius: 100px; overflow: hidden; }
.dist-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent-2), var(--accent)); border-radius: 100px; transition: width 1.1s var(--ease); }

.gh-note { margin-top: 1.5rem; font-size: 0.82rem; color: var(--faint); font-family: var(--font-mono); line-height: 1.6; }

.repo-list { display: flex; flex-direction: column; gap: 1px; background: var(--border-faint); border: 1px solid var(--border-faint); border-radius: var(--r); overflow: hidden; }
.repo {
  background: var(--bg); padding: 1.15rem 1.3rem; display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; transition: background var(--dur-fast) var(--ease); position: relative;
}
.repo:hover { background: var(--surface); }
.repo-main { min-width: 0; }
.repo-name { display: flex; align-items: center; gap: 0.55rem; font-family: var(--font-mono); font-size: 0.92rem; color: var(--fg); margin-bottom: 0.3rem; }
.repo-name svg { width: 14px; height: 14px; color: var(--muted); flex-shrink: 0; }
.repo:hover .repo-name { color: var(--accent); }
.repo:hover .repo-name svg { color: var(--accent); }
.repo-desc { font-size: 0.85rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.repo-lang { font-family: var(--font-mono); font-size: 0.68rem; color: var(--fg-dim); border: 1px solid var(--border); border-radius: 100px; padding: 0.2rem 0.6rem; white-space: nowrap; flex-shrink: 0; }
.repo .arr { color: var(--faint); transition: transform var(--dur-fast), color var(--dur-fast); flex-shrink: 0; }
.repo:hover .arr { color: var(--accent); transform: translate(2px, -2px); }

/* ------------------------------------------------------------------ */
/* 11. EXPERIENCE / EDUCATION TIMELINE                                 */
/* ------------------------------------------------------------------ */
.xp-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.timeline { position: relative; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 1px; background: var(--border); }
.tl-item { position: relative; padding-left: 2.2rem; padding-bottom: 2.4rem; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: 0; top: 5px; width: 13px; height: 13px; border-radius: 50%;
  border: 1px solid var(--accent-line); background: var(--bg); transition: all var(--dur) var(--ease);
}
.tl-item.visible::before { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.tl-period { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.06em; color: var(--accent); margin-bottom: 0.4rem; }
.tl-role { font-size: 1.15rem; color: var(--fg); font-weight: 600; margin-bottom: 0.2rem; }
.tl-org { font-size: 0.9rem; color: var(--fg-dim); margin-bottom: 0.9rem; }
.tl-org .place { color: var(--muted); }
.tl-points { display: flex; flex-direction: column; gap: 0.6rem; }
.tl-points li { position: relative; padding-left: 1.1rem; font-size: 0.9rem; color: var(--muted); line-height: 1.55; }
.tl-points li::before { content: "—"; position: absolute; left: 0; color: var(--faint); }

.side-card { border: 1px solid var(--border); border-radius: var(--r-lg); padding: 1.6rem; background: var(--bg-soft); }
.side-card + .side-card { margin-top: 1.2rem; }
.side-card .sc-label { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); margin-bottom: 1.1rem; }
.edu-item .edu-degree { font-size: 1.05rem; color: var(--fg); font-weight: 600; }
.edu-item .edu-org { font-size: 0.88rem; color: var(--fg-dim); margin-top: 0.25rem; }
.edu-item .edu-period { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); margin-top: 0.5rem; }
.cert-list { display: flex; flex-direction: column; gap: 0.7rem; }
.cert-list li { display: flex; gap: 0.6rem; font-size: 0.9rem; color: var(--fg-dim); align-items: flex-start; }
.cert-list li svg { width: 15px; height: 15px; color: var(--accent); flex-shrink: 0; margin-top: 0.2rem; }
.lead-note { font-size: 0.9rem; color: var(--muted); line-height: 1.6; }

/* ------------------------------------------------------------------ */
/* 12. SKILLS                                                          */
/* ------------------------------------------------------------------ */
.skills-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border-faint); border: 1px solid var(--border-faint); border-radius: var(--r-lg); overflow: hidden; }
.skill-group { background: var(--bg); padding: clamp(1.4rem, 2.4vw, 1.9rem); transition: background var(--dur-fast); }
.skill-group:hover { background: var(--surface); }
.skill-group .sg-head { display: flex; align-items: baseline; gap: 0.6rem; margin-bottom: 1.2rem; }
.skill-group .sg-no { font-family: var(--font-mono); font-size: 0.68rem; color: var(--faint); }
.skill-group h3 { font-size: 1.05rem; color: var(--fg); }
.skill-tags { display: flex; flex-wrap: wrap; gap: 0.45rem; }

/* ------------------------------------------------------------------ */
/* 13. ABOUT                                                           */
/* ------------------------------------------------------------------ */
.about-grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.about-lead { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.8rem, 3.6vw, 2.8rem); line-height: 1.15; color: var(--fg); letter-spacing: -0.01em; }
.about-lead .accent { font-style: italic; }
.about-body { display: flex; flex-direction: column; gap: 1.2rem; }
.about-body p { color: var(--fg-dim); font-size: 1.02rem; line-height: 1.7; }
.about-sign { margin-top: 1rem; display: flex; align-items: center; gap: 0.8rem; font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); letter-spacing: 0.06em; }
.about-sign .l { height: 1px; width: 40px; background: var(--accent-line); }

/* ------------------------------------------------------------------ */
/* 14. CONTACT                                                         */
/* ------------------------------------------------------------------ */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 4.5rem); align-items: start; }
.contact-title { font-family: var(--font-display); font-weight: 400; font-size: var(--fs-h2); color: var(--fg); line-height: 1.05; margin-bottom: 1rem; }
.contact-title .accent { font-style: italic; }
.contact-body { color: var(--fg-dim); font-size: var(--fs-lead); max-width: 42ch; margin-bottom: 2rem; }
.contact-links { display: flex; flex-direction: column; gap: 0.2rem; }
.contact-link {
  display: flex; align-items: center; gap: 1rem; padding: 1rem 0; border-top: 1px solid var(--border);
  transition: padding var(--dur-fast) var(--ease); color: var(--fg-dim);
}
.contact-link:last-child { border-bottom: 1px solid var(--border); }
.contact-link:hover { padding-left: 0.6rem; color: var(--fg); }
.contact-link svg.lead-ic { width: 18px; height: 18px; color: var(--accent); flex-shrink: 0; }
.contact-link .cl-body { flex: 1; min-width: 0; }
.contact-link .cl-label { display: block; font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.2rem; }
.contact-link .cl-value { display: block; font-size: 0.98rem; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-link .arr { color: var(--faint); transition: transform var(--dur-fast), color var(--dur-fast); }
.contact-link:hover .arr { color: var(--accent); transform: translate(3px, -3px); }

/* Form */
.form-card { border: 1px solid var(--border); border-radius: var(--r-lg); padding: clamp(1.5rem, 3vw, 2.2rem); background: var(--bg-soft); }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.5rem; }
.field input, .field textarea {
  width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 0.8rem 0.95rem; color: var(--fg); font-family: var(--font-sans); font-size: 0.95rem;
  transition: border-color var(--dur-fast), background var(--dur-fast); resize: vertical;
}
.field input::placeholder, .field textarea::placeholder { color: var(--faint); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent-line); background: var(--surface-2); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-submit { width: 100%; justify-content: center; margin-top: 0.4rem; }
.form-status { display: none; margin-top: 1rem; padding: 0.8rem 1rem; border-radius: var(--r-sm); font-size: 0.88rem; }
.form-status.ok { display: block; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line); }
.form-status.err { display: block; background: rgba(224,90,90,0.1); color: #e07a7a; border: 1px solid rgba(224,90,90,0.3); }

/* ------------------------------------------------------------------ */
/* 15. FOOTER                                                          */
/* ------------------------------------------------------------------ */
#footer { border-top: 1px solid var(--border); padding-block: clamp(3rem, 6vw, 4.5rem) 2.5rem; }
.footer-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 2rem; flex-wrap: wrap; margin-bottom: 3rem; }
.footer-name { font-family: var(--font-display); font-size: clamp(2.4rem, 8vw, 5rem); color: var(--fg); line-height: 1; letter-spacing: -0.01em; }
.footer-tag { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-top: 0.8rem; }
.footer-cols { display: flex; gap: clamp(2rem, 6vw, 4rem); flex-wrap: wrap; }
.footer-col .fc-label { font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); margin-bottom: 1rem; }
.footer-col a { display: block; font-size: 0.9rem; color: var(--muted); padding: 0.3rem 0; transition: color var(--dur-fast); }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding-top: 2rem; border-top: 1px solid var(--border-faint); }
.footer-bottom p { font-family: var(--font-mono); font-size: 0.72rem; color: var(--faint); letter-spacing: 0.03em; }
.footer-bottom .to-top { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); display: inline-flex; align-items: center; gap: 0.5rem; white-space: nowrap; transition: color var(--dur-fast); }
.footer-bottom .to-top:hover { color: var(--accent); }

/* Back to top */
#back-top {
  position: fixed; bottom: 1.6rem; right: 1.6rem; width: 46px; height: 46px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border-strong); color: var(--fg-dim); z-index: 80;
  display: grid; place-items: center; opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: all var(--dur-fast) var(--ease); backdrop-filter: blur(8px);
}
#back-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
#back-top:hover { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
#back-top svg { width: 18px; height: 18px; }

/* ------------------------------------------------------------------ */
/* 16. REVEAL ANIMATIONS                                               */
/* ------------------------------------------------------------------ */
/* Reveal system — hiding applies ONLY when .js is present, so if scripts are
   disabled or fail to load, every element stays fully visible. */
.reveal { transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out); }
.js .reveal { opacity: 0; transform: translateY(26px); }
.reveal.visible { opacity: 1; transform: none; }

/* Hero entrance: line masks + fade-ups, played when <html> gets .ready */
.hero-title .line > span { transition: transform 0.9s var(--ease-out); }
.js .hero-title .line > span { transform: translateY(105%); }
.js.ready .hero-title .line > span { transform: none; }

.anim-up { transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out); }
.js .anim-up { opacity: 0; transform: translateY(20px); }
.js.ready .anim-up { opacity: 1; transform: none; }

/* Crash / no-IntersectionObserver safety net */
.js.force-reveal .reveal { opacity: 1 !important; transform: none !important; }

/* ------------------------------------------------------------------ */
/* 17. RESPONSIVE                                                      */
/* ------------------------------------------------------------------ */
@media (max-width: 1024px) {
  .focus-grid { grid-template-columns: repeat(2, 1fr); }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .gh-grid { grid-template-columns: 1fr; }
  .xp-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; gap: 1.6rem; }
}

@media (max-width: 820px) {
  .nav-links { display: none; }
  .nav-cta { display: none; }
  .hamburger { display: block; }
  .about-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .contact-grid { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .hero-stats .stat:nth-child(2) { border-right: none; }
  .hero-stats .stat { border-bottom: 1px solid var(--border); padding-bottom: 1rem; }
}

@media (max-width: 620px) {
  :root { --fs-hero: clamp(2.7rem, 13vw, 4rem); }
  .focus-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .focus-card { min-height: auto; }
  .project-foot { flex-direction: column; align-items: flex-start; gap: 1.2rem; }
  .form-row { grid-template-columns: 1fr; }
  .repo { flex-wrap: wrap; }
  .footer-top { flex-direction: column; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 420px) {
  .hero-stats { grid-template-columns: 1fr; }
  .hero-stats .stat { border-right: none; }
}

/* ------------------------------------------------------------------ */
/* 17b. FOCUS VISUALIZATION ANIMATIONS                                 */
/* ------------------------------------------------------------------ */
.vz-pulse { animation: vzPulse 3.2s var(--ease) infinite; }
@keyframes vzPulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }

.vz-ring { transform-box: fill-box; transform-origin: center; animation: vzRing 4.2s var(--ease) infinite; }
@keyframes vzRing { 0%, 100% { opacity: 0.15; transform: scale(0.9); } 50% { opacity: 0.4; transform: scale(1.06); } }

.vz-travel { animation: vzTravel 3.6s var(--ease) infinite; }
@keyframes vzTravel {
  0% { transform: translateX(44px); opacity: 0; }
  14% { opacity: 1; } 86% { opacity: 1; }
  100% { transform: translateX(208px); opacity: 0; }
}

.vz-travel-p { animation: vzTravelP 3.8s linear infinite; }
@keyframes vzTravelP {
  0% { transform: translateX(14px); opacity: 0; }
  10% { opacity: 1; } 90% { opacity: 1; }
  100% { transform: translateX(206px); opacity: 0; }
}

.vz-arc { animation: vzArc 4.4s ease-in-out infinite; }
.vz-arc:nth-of-type(2) { animation-delay: 0.5s; }
.vz-arc:nth-of-type(3) { animation-delay: 1s; }
.vz-arc:nth-of-type(4) { animation-delay: 1.5s; }
.vz-arc:nth-of-type(5) { animation-delay: 2s; }
@keyframes vzArc { 0%, 100% { opacity: 0.16; } 50% { opacity: 0.5; } }

/* ------------------------------------------------------------------ */
/* 18. REDUCED MOTION                                                  */
/* ------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important; scroll-behavior: auto !important;
  }
  .reveal, .reveal-stagger > *, .anim-up { opacity: 1 !important; transform: none !important; }
  .hero-title .line > span { transform: none !important; }
  #particles, #cursor-glow, .scroll-cue { display: none !important; }
  .glow { opacity: 0.6 !important; }
  .dist-fill { transition: none; }
}
