:root {
  --red:          #e63946;
  --orange:       #f4722b;
  --yellow:       #ffbe0b;
  --pink:         #ff006e;
  --cream:        #fefee3;
  --ink:          #1a0a00;
  --ink-soft:     #3d2010;
  --glass-bg:     rgba(254, 254, 227, 0.75);
  --glass-border: rgba(244, 114, 43, 0.25);
  --card-shadow:  0 8px 32px rgba(230, 57, 70, 0.10);
  --glow-orange:  0 0 28px rgba(244, 114, 43, 0.40);
  --glow-red:     0 0 28px rgba(230, 57, 70, 0.35);
  --grad:         linear-gradient(135deg, var(--red), var(--orange), var(--yellow));
  --font:         'Outfit', sans-serif;
  --mono:         'Fira Code', monospace;
  --nav-h:        64px;
  --max-w:        1100px;
  --ease:         cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 17px; }
body {
  font-family: var(--font);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: var(--font); cursor: pointer; border: none; background: none; }

/* ── Canvas ─────────────────────────────────────────────────── */
#bgCanvas {
  position: fixed;
  inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.3;
}

/* ── Nav ────────────────────────────────────────────────────── */
#header {
  background: rgba(254, 254, 227, 0);
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 1000;
  transition: background 0.3s, box-shadow 0.3s;
}
#header.scrolled {
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  background: rgba(254, 254, 227, 0.75);
  box-shadow: 0 2px 20px rgba(230, 57, 70, 0.08);
}
nav {
  max-width: var(--max-w);
  margin: 0 auto;
  height: 100%;
  padding: 0 2rem;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  font-family: var(--mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  transition: color 0.2s;
}
.nav-logo .bracket { color: var(--orange); }
.nav-logo:hover { color: var(--red); }

.nav-links { display: flex; gap: 0.1rem; }

@media (min-width: 769px) {
  .nav-links {
    position: fixed;
    top: 0;
    right: max(calc((100vw - var(--max-w)) / 2 + 2rem), 2rem);
    height: var(--nav-h);
    align-items: center;
    z-index: 1001;
  }
}
.nav-link {
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.45rem 0.8rem;
  border-radius: 6px;
  color: var(--ink-soft);
  position: relative;
  transition: color 0.2s;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 3px; left: 50%;
  transform: translateX(-50%);
  width: 0; height: 2px;
  background: var(--grad);
  border-radius: 99px;
  transition: width 0.25s var(--ease);
}
.nav-link:hover,
.nav-link.active { color: var(--red); }
.nav-link:hover::after,
.nav-link.active::after { width: 70%; }

.burger { display: none; flex-direction: column; gap: 5px; padding: 8px; }
.burger span { display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 99px; transition: all 0.3s var(--ease); }
.burger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ── Layout ─────────────────────────────────────────────────── */
main { position: relative; z-index: 1; }

.section {
  padding: 7rem 0;
  position: relative;
  background: rgba(254, 254, 227, 0.5);
  /* backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px); */
}
.section-inner { max-width: var(--max-w); margin: 0 auto; padding: 0 2rem; }

.section-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 3rem; }
.section-num { font-family: var(--mono); font-size: 0.75rem; color: var(--orange); font-weight: 500; min-width: 24px; }
.section-title {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.section-title .bracket { color: var(--orange); }
.section-rule { flex: 1; height: 2px; background: linear-gradient(to right, var(--orange), transparent); border-radius: 99px; }

/* Fade-in */
.fade-up { opacity: 0; transform: translateY(28px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.fade-up.visible { opacity: 1; transform: none; }

/* Hero typewriter cursor */
.hero-cursor {
  display: inline-block;
  width: 5px;
  height: 0.8em;
  background: var(--ink);
  margin-left: 5px;
  vertical-align: baseline;
  border-radius: 1px;
  animation: cursorBlink 0.7s step-end infinite;
}
@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ── Hero ───────────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex; align-items: center;
  padding: calc(var(--nav-h) + 1rem) 2rem 10rem;
  max-width: var(--max-w);
  margin: 0 auto 250px auto;
  gap: 4rem;
  position: relative; z-index: 1;
}
.hero-content { flex: 1; }
.hero-visual { flex: 0 0 300px; display: flex; align-items: center; justify-content: center; position: relative; }

.hero-greeting { font-family: var(--mono); font-size: 0.9rem; color: var(--orange); margin-bottom: 0.6rem; }
.hero-name {
  font-size: clamp(3rem, 5.5vw, 5rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.03em;
  margin-top: 3rem;
  margin-bottom: 0.75rem;
}
.hero-role {
  font-size: clamp(1rem, 2vw, 1.3rem);
  font-weight: 700;
  color: var(--orange);
  margin-bottom: 1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.hero-desc {
  font-size: 1.05rem;
  color: var(--ink-soft);
  max-width: 440px;
  margin-bottom: 2rem;
  line-height: 1.8;
}

/* Hero social links */
.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}
.hero-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  border: 1.5px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  color: var(--ink);
  transition: all 0.2s var(--ease);
}
.hero-link i { color: var(--orange); font-size: 0.9rem; }
.hero-link:hover {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--glow-orange);
}
.hero-link:hover i { color: #fff; }

.gitea-bg { fill: white; }
.gitea-fg { fill: var(--orange); }

.hero-link:hover .gitea-bg { fill: var(--orange); }
.hero-link:hover .gitea-fg { fill: white; }

/* Avatar */
.avatar-ring {
  width: 350px; height: 350px;
  border-radius: 50%;
  position: relative;
  background: var(--glass-bg);
  border: 2px solid var(--glass-border);
  backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: center;
}

.avatar-placeholder {
  width: 330px; height: 330px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  display: flex; align-items: center; justify-content: center;
  font-size: 4.5rem;
  color: rgba(244, 114, 43, 0.45);
  overflow: hidden;
}
.avatar-placeholder img { width: 100%; height: 100%; object-fit: cover; }


.scroll-hint {
  position: absolute; bottom: 2rem; left: 2rem;
  display: flex; align-items: center; gap: 0.65rem;
  font-family: var(--mono); font-size: 0.68rem;
  color: var(--orange); letter-spacing: 0.1em; text-transform: uppercase;
}
.scroll-line { width: 36px; height: 1px; background: var(--orange); position: relative; overflow: hidden; }
.scroll-line::after {
  content: ''; position: absolute; top: 0; left: -100%;
  width: 100%; height: 100%; background: var(--yellow);
  animation: scanline 1.8s linear infinite;
}
@keyframes scanline { to { left: 200%; } }

.hero-pronouns {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-bottom: 0.85rem;
  letter-spacing: 0.06em;
}

/* ── About ──────────────────────────────────────────────────── */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3.5rem; align-items: start; }
.about-right { display: flex; flex-direction: column; gap: 1.25rem; }
.about-text p { font-size: 0.97rem; color: var(--ink-soft); margin-bottom: 1.1rem; line-height: 1.85; }
.about-text strong { color: var(--ink); }

.pepsi-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  text-align: center;
}
.pepsi-placeholder {
  height: 400px;
  background: rgba(255,255,255,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 4rem;
  color: rgba(244, 114, 43, 0.4);
}
.pepsi-placeholder img {
  width: 100%; height: 100%; object-fit: cover;
}
.pepsi-caption {
  padding: 0.6rem 1rem;
  font-size: 0.78rem;
  font-style: italic;
  color: var(--ink-soft);
}

/* ── Skills ─────────────────────────────────────────────────── */
.skills-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.skill-card {
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  border-radius: 18px; padding: 1.75rem;
  box-shadow: var(--card-shadow);
  transition: transform 0.3s var(--ease), box-shadow 0.3s;
}
.skill-card:hover { box-shadow: var(--glow-orange); }
.skill-card-icon { width: 42px; height: 42px; border-radius: 10px; background: var(--grad); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.05rem; margin-bottom: 0.85rem; }
.skill-card h3 { font-size: 1.05rem; font-weight: 800; margin-bottom: 1.25rem; }

/* ── Projects (list layout) ─────────────────────────────────── */
.projects-list { display: flex; flex-direction: column; gap: 2rem; }

.project-card {
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--card-shadow);
  transition: transform 0.3s var(--ease), box-shadow 0.3s;
  will-change: transform;
}
.project-card:hover { box-shadow: var(--glow-orange); }

.project-header {
  display: flex; align-items: flex-start; gap: 1rem;
  margin-bottom: 1.25rem;
}
.project-icon {
  width: 46px; height: 46px; flex-shrink: 0;
  border-radius: 12px; background: var(--grad);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.1rem;
}
.project-title-row {
  flex: 1;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 0.5rem;
}
.project-title-row h3 { font-size: 1.2rem; font-weight: 800; }

.project-ext-links { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.project-link {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.76rem; font-weight: 700;
  padding: 0.35rem 0.8rem; border-radius: 999px;
  border: 1.5px solid var(--glass-border);
  background: rgba(255,255,255,0.4);
  color: var(--ink-soft);
  transition: all 0.2s;
}
.project-link:hover { background: var(--orange); border-color: var(--orange); color: #fff; }

.project-badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.72rem; font-weight: 700;
  padding: 0.35rem 0.85rem; border-radius: 999px;
  background: rgba(244, 114, 43, 0.12);
  color: var(--orange);
  border: 1px solid rgba(244, 114, 43, 0.25);
}

.project-body { margin-bottom: 1.25rem; }
.project-body p {
  font-size: 0.93rem; color: var(--ink-soft); line-height: 1.8;
  margin-bottom: 0.85rem;
}
.project-body p:last-child { margin-bottom: 0; }

.project-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.project-tags span, .timeline-tags span {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em;
  padding: 0.25rem 0.7rem; border-radius: 999px;
  background: rgba(26,10,0,0.07); color: var(--ink-soft);
  border: 1px solid rgba(244, 114, 43, 0.18);
  transition: all 0.2s var(--ease);
}
.project-tags span:hover, .timeline-tags span:hover {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
  box-shadow: var(--glow-orange);
}

/* ── Timeline / Experience ──────────────────────────────────── */
.timeline { position: relative; padding-left: 1.75rem; }
.timeline::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 2px; background: linear-gradient(to bottom, var(--orange), var(--yellow), transparent);
  border-radius: 99px;
}
.timeline-item { position: relative; padding-left: 2.25rem; padding-bottom: 3rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-marker {
  position: absolute; left: -2.16rem; top: 0rem;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--orange); border: 3px solid var(--cream);
  box-shadow: var(--glow-orange);
}
.timeline-card {
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  border-radius: 18px; padding: 1.75rem;
  box-shadow: var(--card-shadow);
  transition: transform 0.3s var(--ease), box-shadow 0.3s;
}
.timeline-card:hover { box-shadow: var(--glow-orange); }
.timeline-meta { display: flex; align-items: center; gap: 0.65rem; margin-bottom: 0.6rem; }
.timeline-date { font-family: var(--mono); font-size: 0.75rem; color: var(--orange); }
.timeline-tag { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; background: rgba(244,114,43,0.12); color: var(--orange); border-radius: 999px; padding: 0.18rem 0.6rem; }
.timeline-role { font-size: 1.25rem; font-weight: 900; letter-spacing: -0.01em; margin-bottom: 0.2rem; }
.timeline-company { font-size: 0.88rem; color: var(--ink-soft); margin-bottom: 0.85rem; }
.timeline-desc { font-size: 0.9rem; color: var(--ink-soft); line-height: 1.75; margin-bottom: 1rem; }
.timeline-achievements {
  display: flex; flex-direction: column; gap: 0.45rem;
  margin-bottom: 1rem; padding: 0.85rem 1.1rem;
  background: rgba(244,114,43,0.06); border-radius: 10px; border-left: 3px solid var(--orange);
}
.timeline-achievements li { font-size: 0.85rem; color: var(--ink-soft); display: flex; align-items: center; gap: 0.55rem; }
.timeline-achievements i { color: var(--orange); font-size: 0.6rem; flex-shrink: 0; }
.timeline-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }

/* ── Education ──────────────────────────────────────────────── */
.education-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.edu-card {
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  border-radius: 18px; padding: 1.75rem;
  box-shadow: var(--card-shadow);
  display: flex; gap: 1.25rem; align-items: flex-start;
  transition: transform 0.3s var(--ease), box-shadow 0.3s;
}
.edu-card:hover { box-shadow: var(--glow-orange); }
.edu-icon { width: 46px; height: 46px; flex-shrink: 0; border-radius: 12px; background: var(--grad); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.15rem; }
.edu-body h3 { font-size: 1.05rem; font-weight: 800; margin-bottom: 0.25rem; }
.edu-school { font-weight: 700; color: var(--orange); font-size: 0.85rem; margin-bottom: 0.2rem; }
.edu-date { font-family: var(--mono); font-size: 0.75rem; color: var(--ink-soft); margin-bottom: 0.65rem; }
.edu-desc { font-size: 0.85rem; color: var(--ink-soft); line-height: 1.7; }
.edu-links { margin-top: 0.85rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* ── Footer ─────────────────────────────────────────────────── */
footer {
  position: relative; z-index: 1;
  background: var(--ink); color: rgba(255,255,255,0.45);
  text-align: center; padding: 1.75rem 2rem; font-size: 0.8rem;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 960px) {
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
  .hero-visual { display: none; }
  .hero { flex-direction: column; text-align: center; padding-top: calc(var(--nav-h) + 2rem); }
  .hero-desc { max-width: 100%; }
  .hero-links { justify-content: center; }
  .scroll-hint { display: none; }
}

@media (max-width: 768px) {
  html { font-size: 14px; }
  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    background: rgba(254, 254, 227, 0.75);;
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
    gap: 0.4rem;
    transform: translateY(-140%);
    transition: transform 0.4s var(--ease);
    border-bottom: 1px solid var(--glass-border);
    z-index: 999;
  }
  .nav-links.open {
    transform: none;
  }
  .burger { display: flex; }
  .skills-grid { grid-template-columns: 1fr; }
  .education-grid { grid-template-columns: 1fr; }
  .project-title-row { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .section-header { flex-wrap: wrap; }
  .section-rule { display: none; }
  .timeline { padding-left: 1rem; }
  .timeline-item { padding-left: 1.5rem; }
  .timeline-marker { left: -1.55rem; }
}

.skills-intro {
  font-size: 1rem;
  color: var(--ink-soft);
  line-height: 1.8;
  max-width: 680px;
  margin-bottom: 2rem;
}

.lang-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.lang-tag {
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.5rem 1.25rem;
  border-radius: 999px;
  background: var(--glass-bg);
  border: 1.5px solid var(--glass-border);
  backdrop-filter: blur(8px);
  color: var(--ink);
  transition: all 0.2s var(--ease);
}

.lang-tag:hover {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
  box-shadow: var(--glow-orange);
}

/* ── Skill pills: shared behavior (no select + tooltip anchor) ─── */
.lang-tag, .project-tags span, .timeline-tags span {
  position: relative;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
}

.lang-tag[data-tip]:not([data-tip=""]):hover::after,
.project-tags span[data-tip]:not([data-tip=""]):hover::after,
.timeline-tags span[data-tip]:not([data-tip=""]):hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 220px;
  padding: 0.5rem 0.7rem;
  border-radius: 10px;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: normal;
  text-transform: none;
  text-align: center;
  white-space: normal;
  box-shadow: var(--card-shadow);
  z-index: 10;
  pointer-events: none;
}

/* Tooltip arrow */
.lang-tag[data-tip]:not([data-tip=""]):hover::before,
.project-tags span[data-tip]:not([data-tip=""]):hover::before,
.timeline-tags span[data-tip]:not([data-tip=""]):hover::before {
  content: '';
  position: absolute;
  bottom: calc(100% - 3px);
  left: 50%;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-top-color: var(--ink);
  z-index: 10;
  pointer-events: none;
}

.skills-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

@media (max-width: 600px) {
  .skills-cards { grid-template-columns: 1fr; }
}

.project-body code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: rgba(26, 10, 0, 0.07);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  color: var(--orange);
}