/* =====================================================
   DAVID RONDON PORTFOLIO — MAIN STYLESHEET
   Aesthetic: Technical / Editorial / Dark Engineering
   Fonts: Syne (display) + Space Mono (code/labels)
   ===================================================== */

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

:root {
  --bg:        #0a0a0a;
  --bg-2:      #111111;
  --bg-3:      #1a1a1a;
  --border:    rgba(255,255,255,0.08);
  --border-md: rgba(200,169,110,0.18);
  --text:      #f0ede8;
  --text-2:    #9a9691;
  --text-3:    #5c5955;
  --accent:    #c8a96e;
  --accent-2:  #ebcf97;
  --warm:      #d98a49;
  --font-sans: 'Syne', sans-serif;
  --font-mono: 'Space Mono', monospace;
  --max-w:     1200px;
  --pad:       clamp(1.25rem, 4vw, 2.5rem);
  --radius:    6px;
  --radius-lg: 10px;
  --transition: 0.2s ease;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* === UTILITY === */
.section-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* === TYPOGRAPHY === */
.section-label {
  font-family: var(--font-mono);
  font-size: 0.675rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--text);
}

/* === BUTTONS === */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent);
  color: #000000;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background var(--transition), transform var(--transition);
}
.btn-primary:hover { background: var(--accent-2); transform: translateY(-1px); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--border-md);
  color: var(--text-2);
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  transition: border-color var(--transition), color var(--transition);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* === NAVIGATION === */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(10,10,10,0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad);
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.logo-img {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  object-fit: cover;
  display: block;
}
.logo-initials { display: none; }
.logo-slash {
  color: var(--accent);
  margin: 0;
  font-size: 1.25rem;
  font-family: var(--font-mono);
}
.logo-text { color: var(--text); }
.nav-logo:hover .logo-text { color: var(--accent-2); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2.1rem;
}

.nav-link {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
  padding: 0.45rem 0;
  border-radius: var(--radius);
  transition: color var(--transition), opacity var(--transition);
}
.nav-link:hover, .nav-link--active { color: var(--accent); }

.nav-cta {
  margin-left: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  border: 1px solid rgba(200,169,110,0.3);
  padding: 0.8rem 1.1rem;
  border-radius: 12px;
  transition: background var(--transition), border-color var(--transition);
}
.nav-cta:hover { background: rgba(200,169,110,0.1); border-color: var(--accent); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text-2);
  transition: transform var(--transition), opacity var(--transition);
}

/* === HERO === */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: 60px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(ellipse 60% 50% at 70% 40%, rgba(200,169,110,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 40% 30% at 80% 70%, rgba(217,138,73,0.05) 0%, transparent 50%);
  pointer-events: none;
}

.hero-inner {
  flex: 1;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 5rem) var(--pad);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 1.5rem;
}
.eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s ease infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.hero-name {
  font-size: clamp(3.5rem, 7vw, 6rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin-bottom: 1.75rem;
}
.name-first { display: block; color: var(--text); }
.name-last { display: block; color: var(--accent); }

.hero-desc {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text-2);
  max-width: 440px;
  margin-bottom: 1.75rem;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 2rem;
}
.htag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  border: 1px solid var(--border);
  padding: 0.3rem 0.7rem;
  border-radius: 3px;
  background: var(--bg-2);
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* HERO VISUAL */
.hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.visual-frame {
  width: 320px;
  height: 320px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.visual-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 32px 32px;
  border-radius: 50%;
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 75%);
}

.visual-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--border);
  animation: spin linear infinite;
}
.ring-1 { width: 260px; height: 260px; border-color: rgba(200,169,110,0.22); animation-duration: 20s; }
.ring-2 { width: 190px; height: 190px; border-color: rgba(200,169,110,0.14); animation-duration: 15s; animation-direction: reverse; border-style: dashed; }
.ring-3 { width: 120px; height: 120px; border-color: rgba(217,138,73,0.2); animation-duration: 10s; }

@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.visual-center {
  position: relative;
  z-index: 2;
  text-align: center;
  background: var(--bg-2);
  border: 1px solid var(--border-md);
  border-radius: 8px;
  padding: 0.75rem 1.25rem;
}
.vc-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 0.15rem;
}
.vc-val {
  display: block;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.02em;
  line-height: 1;
}

.visual-stat {
  position: absolute;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.4rem 0.65rem;
  text-align: center;
  min-width: 72px;
}
.visual-stat span {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  color: var(--text-3);
  text-transform: uppercase;
}
.visual-stat strong {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-mono);
}
.vs-1 { top: 20px; right: 0; }
.vs-2 { bottom: 50px; right: -10px; }
.vs-3 { top: 60px; left: -10px; }

.hero-scroll-hint {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1.5rem var(--pad);
  display: flex;
  align-items: center;
  gap: 1rem;
}
.hero-scroll-hint span {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-3);
}
.scroll-line {
  flex: 1;
  max-width: 80px;
  height: 1px;
  background: linear-gradient(to right, var(--border-md), transparent);
}

/* === SECTIONS SHARED === */
.section-projects,
.section-research,
.section-about {
  padding: clamp(3rem, 6vw, 5rem) 0;
  border-top: 1px solid var(--border);
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.section-link {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  transition: opacity var(--transition);
}
.section-link:hover { opacity: 0.7; }

/* === PROJECT CARDS === */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.project-grid--full {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.project-card {
  background: var(--bg);
  transition: background var(--transition);
}
.project-card:hover { background: var(--bg-2); }

.card-link {
  display: block;
  height: 100%;
}

.card-thumb {
  position: relative;
  height: 160px;
  overflow: hidden;
}
.thumb-fill {
  position: absolute;
  inset: 0;
  background: var(--thumb-color, linear-gradient(135deg, #2b1c10, #6d5230 45%, #c8a96e 78%, #ebcf97));
}
.thumb-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.04) 0, rgba(255, 255, 255, 0.04) 1px, transparent 1px, transparent 20px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.04) 0, rgba(255,255,255,0.04) 1px, transparent 1px, transparent 20px);
}
.thumb-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 20%, transparent 60%);
  z-index: 1;
}
.card-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.card-category {
  position: absolute;
  bottom: 0.75rem;
  left: 0.875rem;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
}

.card-body { padding: 1.25rem; }
.card-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.3;
  color: var(--text);
}
.card-desc {
  font-size: 0.8125rem;
  line-height: 1.65;
  color: var(--text-2);
  margin-bottom: 0.875rem;
}
.card-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.ctag {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  border: 1px solid var(--border);
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
}

/* === RESEARCH LIST === */
.research-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0,0,0,0.18);
}

.research-item a {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 1.5rem;
  align-items: center;
  padding: 1.45rem 1.6rem;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01)),
    var(--bg);
  transition: background var(--transition), transform var(--transition);
}
.research-item a:hover {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.015)),
    var(--bg-2);
}

.ri-num {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--accent);
  opacity: 0.8;
}
.ri-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  color: var(--text);
  line-height: 1.25;
}
.ri-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: var(--text-3);
}
.ri-summary { font-size: 0.8125rem; color: var(--text-2); margin-top: 0.35rem; line-height: 1.55; }
.ri-arrow {
  color: var(--text-3);
  font-size: 1rem;
  transition: transform var(--transition);
}
.research-item a:hover .ri-arrow { transform: translateX(4px); color: var(--accent); }

/* === ABOUT SECTION (HOME) === */
.about-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}
.about-text .section-title { margin-bottom: 1.25rem; }
.about-body { font-size: 1rem; line-height: 1.75; color: var(--text-2); margin-bottom: 1.75rem; }

.about-skills { display: flex; flex-direction: column; gap: 1.5rem; }
.skill-group {}
.sg-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 0.6rem;
}
.sg-items { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.sg-items span {
  font-size: 0.8125rem;
  color: var(--text-2);
  background: var(--bg-2);
  border: 1px solid var(--border);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius);
}

/* === PAGE HEADER === */
.page-header {
  padding-top: 108px;
  position: relative;
}
.page-header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: clamp(2.5rem, 5vw, 4rem) var(--pad) clamp(2rem, 4vw, 3rem);
  position: relative;
}
.page-header-inner::before {
  content: '';
  position: absolute;
  inset: 0 var(--pad);
  border: 1px solid var(--border);
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(200,169,110,0.1), transparent 42%),
    linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  pointer-events: none;
}
.page-header-inner > * {
  position: relative;
  z-index: 1;
}
.page-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin-bottom: 0.75rem;
}
.page-intro { font-size: 1.0625rem; color: var(--text-2); max-width: 560px; margin-top: 1rem; line-height: 1.7; }

.list-section { padding: clamp(2rem, 5vw, 4rem) 0 5rem; }

/* === SINGLE ARTICLE === */
.article-header {
  padding-top: 108px;
}
.article-header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: clamp(2.5rem, 5vw, 4rem) var(--pad);
  position: relative;
}
.article-header-inner::before {
  content: '';
  position: absolute;
  inset: 0 var(--pad);
  border: 1px solid var(--border);
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(200,169,110,0.08), transparent 38%),
    linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  pointer-events: none;
}
.article-header-inner > * {
  position: relative;
  z-index: 1;
}
.back-link {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 1.5rem;
  transition: color var(--transition);
}
.back-link:hover { color: var(--accent); }

.article-meta {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}
.article-category {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(200,169,110,0.3);
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
}
.article-date {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: var(--text-3);
}

.article-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 0.75rem;
}
.article-subtitle { font-size: 1.125rem; color: var(--text-2); max-width: 600px; margin-bottom: 1rem; line-height: 1.6; }
.article-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 1rem; }

.article-hero-img {
  max-width: var(--max-w);
  margin: 2rem auto;
  padding: 0 var(--pad);
}
.article-hero-img img { 
   width: 100%; 
   border-radius: var(--radius-lg); 
   border: 1px solid var(--border); 
}

/* Mini hero — fixed top-right under nav */
.hero-mini-wrap {
  position: fixed;
  top: 96px;
  right: var(--pad);
  width: 160px;
  z-index: 98;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
  opacity: 0;
  transform: scale(0.85) translateY(-8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}
.hero-mini-wrap.visible {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}
.hero-mini-wrap img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  display: block;
}

.article-body-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3rem var(--pad) 4rem;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 4rem;
  align-items: start;
}

.article-toc {
  position: sticky;
  top: 80px;
}
.article-toc nav {
  font-size: 0.775rem;
  line-height: 1.7;
  color: var(--text-3);
}
.article-toc nav ul { list-style: none; }
.article-toc nav li { margin-bottom: 0.2rem; }
.article-toc nav a { color: var(--text-3); transition: color var(--transition); }
.article-toc nav a:hover { color: var(--accent); }
.article-toc #TableOfContents > ul > li > a { color: var(--text-2); font-weight: 600; font-size: 0.75rem; }

/* ARTICLE BODY PROSE */
.article-body {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--text-2);
  max-width: 680px;
}
.article-body h2 {
  font-size: 1.625rem;
  font-weight: 700;
  color: var(--text);
  margin: 2.5rem 0 0.875rem;
  letter-spacing: -0.02em;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.article-body h3 {
  font-size: 1.1875rem;
  font-weight: 700;
  color: var(--text);
  margin: 1.75rem 0 0.625rem;
}
.article-body p { margin-bottom: 1.25rem; }
.article-body ul, .article-body ol {
  margin: 1rem 0 1.25rem 1.5rem;
}
.article-body li { margin-bottom: 0.35rem; }
.article-body strong { color: var(--text); font-weight: 600; }
.article-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.article-body a:hover { text-decoration: none; }
.article-body code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-3);
  color: var(--accent-2);
  padding: 0.15em 0.45em;
  border-radius: 3px;
  border: 1px solid var(--border);
}
.article-body pre {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}
.article-body pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.875rem;
  color: var(--text-2);
}
.article-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.75rem 0 0.75rem 1.5rem;
  margin: 1.5rem 0;
  color: var(--text-2);
  font-style: italic;
}
.article-body img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 1.5rem 0;
}
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.875rem;
}
.article-body th, .article-body td {
  padding: 0.65rem 1rem;
  border: 1px solid var(--border);
  text-align: left;
}
.article-body th {
  background: var(--bg-2);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
  font-weight: 400;
}

/* ARTICLE NAV */
.article-links { padding: 2rem var(--pad); border-top: 1px solid var(--border); }
.link-list { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.75rem; }
.ext-link {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  border: 1px solid rgba(200,169,110,0.3);
  padding: 0.45rem 1rem;
  border-radius: var(--radius);
  transition: background var(--transition);
}
.ext-link:hover { background: rgba(200,169,110,0.1); }

.article-nav {
  display: flex;
  gap: 1px;
  background: var(--border);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
  padding: 0;
}
.anav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1.25rem 1.5rem;
  background: var(--bg);
  transition: background var(--transition);
}
.anav-item:hover { background: var(--bg-2); }
.anav-item span {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}
.anav-item strong { font-size: 0.9375rem; font-weight: 600; color: var(--text); }
.anav-next { text-align: right; }

/* === ABOUT PAGE === */
.about-page { padding: clamp(2rem, 5vw, 4rem) 0 5rem; }
.about-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 4rem;
  align-items: start;
}

.about-main .article-body { max-width: 100%; }

.about-sidebar { display: flex; flex-direction: column; gap: 1px; position: sticky; top: 80px; }

.sidebar-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.01));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.35rem;
  margin-bottom: 0.75rem;
}
.sc-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.sc-value { font-size: 0.9375rem; font-weight: 700; color: var(--text); margin-bottom: 0.25rem; }
.sc-sub { font-size: 0.8125rem; color: var(--text-2); line-height: 1.5; }
.sc-list { list-style: none; }
.sc-list li {
  font-size: 0.8125rem;
  color: var(--text-2);
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border);
}
.sc-list li:last-child { border-bottom: none; }
.sc-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.sc-tags span {
  font-size: 0.75rem;
  color: var(--text-2);
  background: var(--bg-3);
  border: 1px solid var(--border);
  padding: 0.25rem 0.6rem;
  border-radius: 3px;
}
.sidebar-links { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.25rem; }
.sidebar-links .btn-primary, .sidebar-links .btn-ghost { text-align: center; justify-content: center; }

/* === EXPERIENCE TIMELINE PAGE === */
.timeline-page {
  padding: clamp(2rem, 5vw, 4rem) 0 6rem;
}

.timeline-shell {
  position: relative;
  max-width: 980px;
  margin: 0 auto;
  padding: 0 var(--pad);
}

.timeline-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  transform: translateX(-50%);
  background: linear-gradient(to bottom, transparent 0%, rgba(200,169,110,0.45) 10%, rgba(200,169,110,0.45) 90%, transparent 100%);
}

.timeline-item {
  position: relative;
  min-height: 72vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
}

.timeline-item::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg);
  border: 2px solid rgba(200,169,110,0.55);
  box-shadow: 0 0 0 10px rgba(200,169,110,0.06);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.timeline-card {
  max-width: 420px;
  padding: 1.8rem;
  border: 1px solid var(--border);
  border-radius: 22px;
  background:
    radial-gradient(circle at top right, rgba(15, 67, 210, 0.08), transparent 38%),
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  opacity: 0.28;
  transform: translateY(18px) scale(0.98);
  transition: opacity 0.35s ease, transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.timeline-item:nth-child(odd) .timeline-card {
  justify-self: end;
  margin-right: 3.5rem;
}

.timeline-item:nth-child(even) .timeline-card {
  grid-column: 2;
  justify-self: start;
  margin-left: 3.5rem;
}

.timeline-item.is-active .timeline-card {
  opacity: 1;
  transform: translateY(0) scale(1);
  border-color: rgba(200,169,110,0.35);
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}

.timeline-item.is-active::before {
  transform: translate(-50%, -50%) scale(1.08);
  border-color: var(--accent);
  box-shadow: 0 0 0 14px rgba(200,169,110,0.1);
}

.timeline-period {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.85rem;
}

.timeline-company {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
}

.timeline-role {
  font-size: 0.92rem;
  color: var(--text-2);
  margin: 0.45rem 0 0.9rem;
}

.timeline-location {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 1rem;
}

.timeline-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.timeline-bullets li {
  position: relative;
  padding-left: 1rem;
  color: var(--text-2);
  line-height: 1.65;
}

.timeline-bullets li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--accent);
}

.timeline-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.timeline-skill {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
  border: 1px solid var(--border);
  background: var(--bg-2);
  padding: 0.28rem 0.55rem;
  border-radius: 3px;
}

/* === FOOTER === */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-left { display: flex; flex-direction: column; gap: 0.2rem; }
.footer-name { font-weight: 700; font-size: 0.875rem; }
.footer-role {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--text-3);
  text-transform: uppercase;
}
.footer-links { display: flex; gap: 1.25rem; }
.footer-links a {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--accent);
  transition: opacity var(--transition);
}
.footer-links a:hover { opacity: 0.7; }
.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-3);
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: center;
  }
  .hero-eyebrow, .hero-tags { justify-content: center; }
  .hero-desc { margin: 0 auto 1.75rem; }
  .hero-actions { justify-content: center; }
  .hero-visual { justify-content: center; }

  .about-inner, .about-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .about-sidebar { position: static; }

  .article-body-wrap { grid-template-columns: 1fr; gap: 2rem; }
  .article-toc { display: none; }

  .project-grid { grid-template-columns: 1fr; }

  .timeline-line {
    left: 18px;
    transform: none;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 0 0 2rem 0;
  }

  .timeline-item::before {
    left: 18px;
    top: 2rem;
    transform: translate(-50%, 0);
  }

  .timeline-item.is-active::before {
    transform: translate(-50%, 0) scale(1.08);
  }

  .timeline-card,
  .timeline-item:nth-child(odd) .timeline-card,
  .timeline-item:nth-child(even) .timeline-card {
    grid-column: 1;
    justify-self: stretch;
    margin: 0 0 0 3rem;
    max-width: none;
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-links.nav-open { display: flex; flex-direction: column; position: fixed; inset: 76px 0 0; background: rgba(10,10,10,0.99); padding: 2rem var(--pad); gap: 0.9rem; z-index: 101; overflow-y: auto; }
  .nav-toggle { display: flex; }

  .section-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 1.25rem; }

  .nav-inner { height: 76px; }
  .logo-img { width: 44px; height: 44px; }
  .nav-logo { gap: 0.65rem; font-size: 0.92rem; }
  .nav-cta { margin-left: 0; width: fit-content; }

  .research-item a { grid-template-columns: 34px 1fr auto; gap: 0.8rem; padding: 1rem; }
  .ri-title { font-size: 0.98rem; }

  .visual-frame { width: 260px; height: 260px; }
  .ring-1 { width: 220px; height: 220px; }
  .ring-2 { width: 160px; height: 160px; }
  .ring-3 { width: 100px; height: 100px; }
}

/* === ANIMATIONS === */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero-content > * {
  animation: fadeUp 0.6s ease both;
}
.hero-eyebrow { animation-delay: 0.1s; }
.hero-name { animation-delay: 0.2s; }
.hero-desc { animation-delay: 0.3s; }
.hero-tags { animation-delay: 0.4s; }
.hero-actions { animation-delay: 0.5s; }
.hero-visual { animation: fadeUp 0.7s 0.4s ease both; }

/* === SOLAR SYSTEM WRAP === */
.solar-system-wrap {
  position: relative;
  width: 520px;
  height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
#solarCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}
.solar-system-wrap .visual-frame {
  position: relative;
  z-index: 2;
  width: 320px;
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}
@media (max-width: 900px) {
  .solar-system-wrap { width: 360px; height: 360px; }
  .solar-system-wrap .visual-frame { width: 240px; height: 240px; }
}
@media (max-width: 640px) {
  .solar-system-wrap { width: 300px; height: 300px; }
  .solar-system-wrap .visual-frame { width: 200px; height: 200px; }
}

/* === RESEARCH BADGE ON PROJECT CARDS === */
.card-research-badge {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  background: var(--accent);
  color: #0a0a0a;
  border: none;
  padding: 0.3rem 0.7rem;
  border-radius: 4px;
  backdrop-filter: none;
  box-shadow: 0 2px 10px rgba(200,169,110,0.35);
}
.card-venue {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  color: var(--accent2);
  text-transform: uppercase;
  margin-bottom: 0.35rem;
  opacity: 0.8;
}
/* === IMAGE GALLERY === */
.article-gallery {
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
  border-top: 1px solid var(--border);
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.gallery-item {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  aspect-ratio: 16/10;
  cursor: pointer;
}
.gallery-item img {
  width: 100%;
  height: 100;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}
.gallery-item:hover img {
  transform: scale(1.03);
}
@media (max-width: 640px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

/* === LIGHTBOX === */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 999;
  align-items: center;
  justify-content: center;
}
.lightbox-overlay.active {
  display: flex;
}
.lightbox-img {
  max-width: 82vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 60px rgba(0,0,0,0.7);
}
.lightbox-close {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  width: 2.5rem;
  height: 2.5rem;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.lightbox-close:hover {
  background: rgba(255,255,255,0.25);
}
.lightbox-prev,
.lightbox-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 2.75rem;
  height: 2.75rem;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 1000;
}
.lightbox-prev { left: 1.25rem; }
.lightbox-next { right: 1.25rem; }
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255,255,255,0.25);
}
.lightbox-prev:disabled,
.lightbox-next:disabled {
  opacity: 0.2;
  cursor: default;
}
