/* ─── Google Font ───────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap');

/* ─── Design tokens ─────────────────────────────────────── */
:root {
  --font-mono: 'Space Mono', monospace;
  --color-bg: #09090b;
  --color-surface: #0f1012;
  --color-border: #1c1e24;
  --color-text: #e4ddd4;
  --color-muted: #6b6560;
  --color-accent: #538BC2;
  --color-accent-dim: #3a6a9a;
}

html[data-theme="light"] {
  --color-bg: #f5f2ed;
  --color-surface: #e8e4dc;
  --color-border: #c8c3bb;
  --color-text: #111110;
  --color-muted: #4a4540;
  --color-accent: #538BC2;
  --color-accent-dim: #3a6a9a;
}

/* ─── Base ──────────────────────────────────────────────── */
html {
  scroll-behavior: smooth;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-mono);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, #ffffff08 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
}

html[data-theme="light"] body::before {
  background-image: radial-gradient(circle, #00000012 1px, transparent 1px);
}

#root {
  overflow-x: hidden;
}

a {
  text-decoration: none;
}

button {
  font-family: var(--font-mono);
  cursor: pointer;
}

/* ─── Animations ────────────────────────────────────────── */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.animate-fade-up {
  animation: fade-up 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.animate-fade-in {
  animation: fade-in 0.6s ease both;
}

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-700 { animation-delay: 0.7s; }

/* ─── Shared Components ─────────────────────────────────── */
.section-label {
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.skill-tag {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 3px;
  font-size: 0.72rem;
  color: var(--color-muted);
  background: var(--color-surface);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.skill-tag:hover {
  border-color: var(--color-accent-dim);
  color: var(--color-text);
}

/* ─── Nav ───────────────────────────────────────────────── */
#nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background-color: rgba(9, 9, 11, 0.85);
  transition: background-color 0.3s;
}

html[data-theme="light"] #nav {
  background-color: rgba(245, 242, 237, 0.9);
}

#nav > nav {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#nav-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

#nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

#nav-links a {
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-muted);
  transition: color 0.2s;
}

#nav-links a:hover {
  color: var(--color-text);
}

#nav-controls {
  display: flex;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  overflow: hidden;
}

#theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.65rem;
  border: none;
  border-right: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

#theme-toggle:hover {
  color: var(--color-text);
  background: rgba(128, 128, 128, 0.08);
}

.lang-btn {
  padding: 0.35rem 0.75rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: none;
  background: transparent;
  color: var(--color-muted);
  font-weight: 400;
  transition: background 0.2s, color 0.2s;
}

.lang-btn.active {
  background: var(--color-accent);
  color: #09090b;
  font-weight: 500;
}

/* ─── Hero ──────────────────────────────────────────────── */
#hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 120px 2rem 80px;
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  top: 15%;
  left: 0;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(83, 139, 194, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

#hero h1 {
  font-size: clamp(2.5rem, 9vw, 7rem);
  font-weight: 700;
  line-height: 1.0;
  letter-spacing: -0.02em;
  color: var(--color-text);
  margin-bottom: 1.5rem;
}

#hero .section-label {
  margin-bottom: 1.5rem;
}

#hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: 3px;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

#hero-cta:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.scroll-indicator {
  position: absolute;
  bottom: 2.5rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.scroll-text {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-muted);
  writing-mode: vertical-rl;
}

.scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, var(--color-accent), transparent);
}

/* ─── About ─────────────────────────────────────────────── */
#about {
  padding: 8rem 2rem;
  position: relative;
  border-top: 1px solid var(--color-border);
}

#about .section-inner {
  max-width: 1100px;
  margin: 0 auto;
}

#about .section-label {
  margin-bottom: 3rem;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

#about h2 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--color-text);
  white-space: pre-line;
}

.about-body {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--color-muted);
  margin-bottom: 3rem;
}

.stats {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-accent);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.68rem;
  color: var(--color-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: pre-line;
}

/* ─── Skills ────────────────────────────────────────────── */
#skills {
  padding: 8rem 2rem;
  border-top: 1px solid var(--color-border);
  position: relative;
  overflow: hidden;
}

#skills .section-inner {
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
}

#skills .section-label {
  margin-bottom: 1rem;
}

#skills h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text);
  margin-bottom: 4rem;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}

.skill-category-name {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border);
}

.skill-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ─── Experience ────────────────────────────────────────── */
#experience {
  padding: 8rem 2rem;
  border-top: 1px solid var(--color-border);
  position: relative;
  overflow: hidden;
}

#experience .section-inner {
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
}

#experience .section-label {
  margin-bottom: 1rem;
}

#experience h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text);
  margin-bottom: 4rem;
}

/* Desktop two-column */
.exp-grid-desktop {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 3rem;
}

.exp-job-btn {
  width: 100%;
  text-align: left;
  padding: 1.25rem 1rem;
  border: none;
  border-left: 2px solid var(--color-border);
  background: transparent;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 0.25rem;
  color: inherit;
}

.exp-job-btn:hover {
  border-left-color: var(--color-accent-dim);
}

.exp-job-btn.active {
  border-left-color: var(--color-accent);
  background: var(--color-surface);
}

.exp-job-name {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-muted);
  margin-bottom: 0.25rem;
  transition: color 0.2s;
}

.exp-job-btn.active .exp-job-name {
  color: var(--color-text);
}

.exp-job-period {
  font-size: 0.65rem;
  color: var(--color-muted);
  letter-spacing: 0.06em;
}

/* Job Detail */
.job-detail {
  padding: 1.5rem 0 0.5rem;
}

.job-header {
  margin-bottom: 1.5rem;
}

.job-company {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0.35rem;
}

.job-role {
  font-size: 0.85rem;
  color: var(--color-accent);
  letter-spacing: 0.06em;
  margin-bottom: 0.2rem;
}

.job-meta {
  font-size: 0.78rem;
  color: var(--color-muted);
  letter-spacing: 0.04em;
}

.project-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.project-tab {
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: 3px;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  background: transparent;
  color: var(--color-muted);
  transition: all 0.2s;
}

.project-tab.active {
  border-color: var(--color-accent);
  background: rgba(83, 139, 194, 0.1);
  color: var(--color-accent);
}

.proj-title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 1rem;
}

.bullet-list {
  list-style: none;
}

.bullet-item {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--color-muted);
}

.bullet-diamond {
  color: var(--color-accent);
  margin-top: 0.35rem;
  flex-shrink: 0;
  font-size: 0.6rem;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1.5rem;
}

/* Mobile accordion */
.exp-accordion-mobile {
  display: none;
}

.accordion-item {
  border-top: 1px solid var(--color-border);
}

.accordion-header {
  width: 100%;
  text-align: left;
  padding: 1.25rem 0;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: inherit;
}

.accordion-icon {
  color: var(--color-accent);
  font-size: 1.2rem;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.accordion-icon.open {
  transform: rotate(45deg);
}

.accordion-content {
  padding-bottom: 1.5rem;
}

/* ─── Contact ───────────────────────────────────────────── */
#contact {
  padding: 8rem 2rem 10rem;
  border-top: 1px solid var(--color-border);
  position: relative;
  text-align: center;
  overflow: hidden;
}

.contact-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(83, 139, 194, 0.05) 0%, transparent 70%);
  pointer-events: none;
}

.contact-inner {
  max-width: 700px;
  margin: 0 auto;
  position: relative;
}

#contact .section-label {
  margin-bottom: 2rem;
}

#contact h2 {
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--color-text);
  margin-bottom: 1.5rem;
  white-space: pre-line;
}

.contact-body {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--color-muted);
  margin-bottom: 3rem;
}

#contact-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  background-color: var(--color-accent);
  border-radius: 3px;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #09090b;
  transition: opacity 0.2s, transform 0.2s;
}

#contact-cta:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

/* ─── Footer ────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--color-border);
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-name {
  font-size: 0.85rem;
  color: var(--color-muted);
  letter-spacing: -0.01em;
}

.linkedin-link {
  color: var(--color-muted);
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.linkedin-link:hover {
  color: var(--color-accent);
}

/* ─── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-accent-dim); }

/* ─── Mobile ────────────────────────────────────────────── */
@media (max-width: 640px) {
  #hero {
    padding: 5rem 1.5rem 3rem;
    min-height: auto;
    justify-content: flex-start;
  }

  #about,
  #skills,
  #experience,
  #contact {
    padding: 4rem 1.5rem;
  }

  footer .footer-inner {
    padding: 1.25rem 1.5rem;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .exp-grid-desktop {
    display: none;
  }

  .exp-accordion-mobile {
    display: block;
  }

  .scroll-indicator {
    display: none;
  }

  #nav > nav {
    padding: 0 1.25rem;
  }

  #nav-links {
    display: none;
  }
}
