/* ==============================================
   Custom Properties — Dark (default) / Light
   ============================================== */
:root {
  --bg: #0d0d14;
  --bg-alt: #111118;
  --bg-card: #161620;
  --border: #1e1e2e;
  --text: #e2e8f0;
  --muted: #64748b;
  --accent: #38bdf8;
  --accent-dim: rgba(56, 189, 248, 0.1);
  --accent-glow: rgba(56, 189, 248, 0.25);
  --font: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
  --radius: 10px;
  --ease: 0.2s ease;
}

[data-theme="light"] {
  --bg: #f8fafc;
  --bg-alt: #f1f5f9;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #0284c7;
  --accent-dim: rgba(2, 132, 199, 0.08);
  --accent-glow: rgba(2, 132, 199, 0.2);
}

/* ==============================================
   Reset
   ============================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background var(--ease), color var(--ease);
}
ul { list-style: none; }
a { color: var(--accent); text-decoration: none; transition: opacity var(--ease); }
a:hover { opacity: 0.75; }

/* ==============================================
   Layout
   ============================================== */
.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.section { padding: 100px 0; }
.section--alt { background: var(--bg-alt); }

.section__label {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}

.section__heading {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 48px;
  line-height: 1.2;
}

.accent { color: var(--accent); }

/* ==============================================
   Buttons
   ============================================== */
.btn {
  display: inline-block;
  padding: 11px 26px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--ease);
  border: 1.5px solid transparent;
}

.btn--primary {
  background: var(--accent);
  color: #0a0a0f;
  border-color: var(--accent);
}

.btn--primary:hover {
  opacity: 1;
  box-shadow: 0 0 24px var(--accent-glow);
  transform: translateY(-1px);
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn--ghost:hover {
  opacity: 1;
  border-color: var(--accent);
  color: var(--accent);
}

/* ==============================================
   Navbar
   ============================================== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(13, 13, 20, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background var(--ease);
}

[data-theme="light"] .navbar {
  background: rgba(248, 250, 252, 0.88);
}

.navbar__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 60px;
}

.navbar__logo {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  margin-right: auto;
  letter-spacing: 0.04em;
}

.logo-dot { color: var(--accent); }
.navbar__logo:hover { opacity: 0.7; }

.navbar__links {
  display: flex;
  gap: 32px;
}

.navbar__links a {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color var(--ease);
}

.navbar__links a:hover,
.navbar__links a.is-active {
  color: var(--text);
  opacity: 1;
}

/* Theme toggle */
.theme-toggle {
  width: 32px; height: 32px;
  border-radius: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--muted);
  transition: all var(--ease);
}

.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* Hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all var(--ease);
}

.nav-hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.is-open span:nth-child(2) { opacity: 0; }
.nav-hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  display: none;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--border);
}

.mobile-menu ul { display: flex; flex-direction: column; gap: 14px; }
.mobile-menu a { color: var(--text); font-weight: 500; font-size: 1rem; }
.mobile-menu.is-open { display: block; }

/* ==============================================
   Hero
   ============================================== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 60px;
  position: relative;
  overflow: hidden;
}

.hero__bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.5;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 20%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 20%, transparent 100%);
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 700px;
}

.hero__label {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 16px;
  letter-spacing: 0.03em;
}

.hero__name {
  font-size: clamp(3rem, 9vw, 6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.0;
  margin-bottom: 20px;
}

.hero__sub {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 10px;
  font-weight: 500;
}

.hero__tagline {
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  color: var(--muted);
  margin-bottom: 40px;
  font-style: italic;
  max-width: 460px;
}

.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; }

.hero__scroll-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  animation: float 2.5s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-6px); }
}

/* ==============================================
   About
   ============================================== */
.about__grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 64px;
  align-items: start;
}

.about__visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.about__avatar {
  width: 120px; height: 120px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.about__badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 6px 14px;
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

.badge-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
  flex-shrink: 0;
}

.about__text .section__label { margin-bottom: 8px; }
.about__text .section__heading { margin-bottom: 20px; font-size: clamp(1.6rem, 3vw, 2.2rem); }

.about__text p {
  color: var(--muted);
  font-size: 1rem;
  margin-bottom: 14px;
  line-height: 1.8;
}

.about__text strong { color: var(--text); font-weight: 600; }

.about__links {
  display: flex;
  gap: 20px;
  margin-top: 24px;
}

.icon-link {
  color: var(--text);
  font-weight: 500;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
  transition: border-color var(--ease), color var(--ease);
}

.icon-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  opacity: 1;
}

/* ==============================================
   Projects
   ============================================== */
.projects__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color var(--ease), transform var(--ease);
  display: flex;
  flex-direction: column;
}

.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card--placeholder { opacity: 0.45; }

.card__header {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.card__tag {
  font-family: var(--mono);
  font-size: 0.72rem;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 3px 10px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}

.card__tag--muted {
  background: transparent;
  color: var(--muted);
  border-color: var(--border);
}

.card__title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.card__desc {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.7;
  flex: 1;
  margin-bottom: 20px;
}

.card__img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 16px;
}

.card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.card__link {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 500;
}

.card__year {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
}

/* ==============================================
   Skills
   ============================================== */
.skills__groups {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.skill-group__title {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.skill-group__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill-tag {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 7px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--ease);
  cursor: default;
}

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

/* ==============================================
   Contact
   ============================================== */
.contact__wrap { max-width: 560px; }

.contact__desc {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 32px;
}

.contact__links { display: flex; gap: 12px; flex-wrap: wrap; }

/* ==============================================
   Footer
   ============================================== */
.footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 24px 0;
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
}

/* ==============================================
   Scroll Animations
   ============================================== */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==============================================
   Responsive
   ============================================== */
@media (max-width: 768px) {
  .navbar__links { display: none; }
  .nav-hamburger { display: flex; }

  .about__grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .about__visual {
    flex-direction: row;
    align-items: center;
    gap: 20px;
  }

  .footer__inner { flex-direction: column; gap: 8px; }
}

@media (max-width: 480px) {
  .section { padding: 72px 0; }
  .hero__actions,
  .contact__links { flex-direction: column; }
}
