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

:root {
  --bg: #0d0d0f;
  --bg-alt: #111114;
  --surface: #18181c;
  --border: #25252b;
  --text: #e8e8ed;
  --text-muted: #8a8a9a;
  --accent: #10b981;
  --accent-light: #34d399;
  --accent-glow: rgba(16, 185, 129, 0.15);
  --font: 'Inter', system-ui, sans-serif;
  --mono: 'Fira Code', monospace;
  --nav-bg: rgba(13, 13, 15, 0.85);
  --terminal-bg: #0f0f12;
  --terminal-bar: #1c1c21;
}

html.light {
  --bg: #f5f5f7;
  --bg-alt: #ebebef;
  --surface: #ffffff;
  --border: #d8d8e0;
  --text: #1a1a2e;
  --text-muted: #666678;
  --accent: #064e3b;
  --accent-light: #065f46;
  --accent-glow: rgba(6, 78, 59, 0.12);
  --nav-bg: rgba(245, 245, 247, 0.85);
  --terminal-bg: #1e1e24;
  --terminal-bar: #2a2a32;
}

html {
  scroll-behavior: smooth;
}

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

/* nav */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2.5rem;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}

.nav.scrolled {
  border-bottom-color: var(--border);
}

.nav-logo {
  font-family: var(--mono);
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--accent-light);
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

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

/* theme toggle */
.theme-toggle {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  flex-shrink: 0;
}

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

/* hero */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 8rem 2.5rem 4rem;
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 680px;
}

.hero-greeting {
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--accent-light);
  margin-bottom: 0.75rem;
  opacity: 0;
  animation: fadeUp 0.6s ease 0.1s forwards;
}

.hero-name {
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-bottom: 1rem;
  opacity: 0;
  animation: fadeUp 0.6s ease 0.2s forwards;
}

.hero-role {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--text-muted);
  margin-bottom: 1rem;
  opacity: 0;
  animation: fadeUp 0.6s ease 0.3s forwards;
}

.cursor-text::after {
  content: '|';
  color: var(--accent);
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.hero-sub {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  opacity: 0;
  animation: fadeUp 0.6s ease 0.4s forwards;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
  opacity: 0;
  animation: fadeUp 0.6s ease 0.5s forwards;
}

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.6rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
}

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

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent-light);
  transform: translateY(-1px);
}

/* social links */
.social-links {
  display: flex;
  gap: 1.25rem;
  opacity: 0;
  animation: fadeUp 0.6s ease 0.6s forwards;
}

.social-links a {
  color: var(--text-muted);
  transition: color 0.2s, transform 0.2s;
  display: flex;
  align-items: center;
}

.social-links a:hover {
  color: var(--accent-light);
  transform: translateY(-2px);
}

.social-links-center {
  justify-content: center;
  animation: none;
  opacity: 1;
  margin-top: 2rem;
}

/* hero decoration */
.hero-decoration {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.25;
}

.blob-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #10b981, transparent 70%);
  top: -150px;
  right: -100px;
  animation: float 8s ease-in-out infinite;
}

.blob-2 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, #06b6d4, transparent 70%);
  bottom: 50px;
  right: 200px;
  animation: float 10s ease-in-out 2s infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-30px) scale(1.05); }
}

/* sections */
.section {
  padding: 6rem 2.5rem;
}

.section-alt {
  background: var(--bg-alt);
}

.container {
  max-width: 1000px;
  margin: 0 auto;
}

.section-title {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 3rem;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 40px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

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

.about-text p {
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.75;
}

.about-text p:last-child {
  margin-bottom: 0;
}

.skills-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
}

.skill-label {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 0.6rem;
}

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

.skill-tags span {
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.25rem 0.65rem;
}

/* projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.project-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent-glow);
  opacity: 0;
  transition: opacity 0.2s;
  border-radius: inherit;
}

.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(16, 185, 129, 0.12);
}

.project-card:hover::before {
  opacity: 1;
}

.project-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.project-icon {
  color: var(--accent-light);
}

.project-arrow {
  color: var(--text-muted);
  transition: color 0.2s, transform 0.2s;
}

.project-card:hover .project-arrow {
  color: var(--accent-light);
  transform: translate(2px, -2px);
}

.project-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
  letter-spacing: -0.02em;
  position: relative;
}

.project-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.25rem;
  position: relative;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  position: relative;
}

.project-tags span {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent-light);
  background: rgba(16, 185, 129, 0.1);
  border-radius: 4px;
  padding: 0.2rem 0.6rem;
}

/* contact */
.contact-container {
  text-align: center;
}

.contact-sub {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 460px;
  margin: 0 auto 2rem;
}

.contact-btn {
  font-size: 1rem;
  padding: 0.85rem 2rem;
}

/* footer */
.footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-family: var(--mono);
}

/* nav actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5em;
}

/* hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  flex-shrink: 0;
}

.hamburger:hover {
  color: var(--accent-light);
  border-color: var(--accent);
}

.hamburger-line {
  display: block;
  width: 15px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
  transform-origin: center;
}

.hamburger.active .hamburger-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.hamburger.active .hamburger-line:nth-child(2) {
  opacity: 0;
}
.hamburger.active .hamburger-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* terminal button */
.terminal-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  flex-shrink: 0;
}

.terminal-btn:hover,
.terminal-btn.active {
  color: var(--accent-light);
  border-color: var(--accent);
}

/* terminal window */
.terminal-window {
  position: fixed;
  z-index: 999;
  top: 80px;
  right: 2rem;
  width: 500px;
  background: var(--terminal-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-family: var(--mono);
  font-size: 0.82rem;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  animation: windowOpen 0.2s ease forwards;
}

.terminal-bar {
  background: var(--terminal-bar);
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
  cursor: grab;
  user-select: none;
}

.terminal-bar:active {
  cursor: grabbing;
}

.terminal-dots {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.terminal-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot-red    { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green  { background: #28c840; }

.terminal-title {
  flex: 1;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-left: -3rem;
}

.terminal-body {
  padding: 1rem;
  height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.terminal-body::-webkit-scrollbar { width: 4px; }
.terminal-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.terminal-line {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.6rem;
}

.terminal-output {
  color: var(--text-muted);
  line-height: 1.8;
  padding-left: 0.2rem;
}

.terminal-output .t-success { color: #28c840; }
.terminal-output .t-error   { color: #ff5f57; }

.terminal-input-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1rem;
  border-top: 1px solid var(--border);
}

.terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.82rem;
  caret-color: var(--accent-light);
}

.t-accent { color: #28c840; }
.t-muted  { color: var(--text-muted); }
.t-cmd    { color: var(--accent-light); }

/* animations */
@keyframes windowOpen {
  from { opacity: 0; transform: scale(0.96) translateY(-8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* responsive */
@media (max-width: 768px) {
  .terminal-window {
    width: calc(100vw - 2rem);
    right: 1rem;
    left: 1rem;
  }

  .nav {
    padding: 1rem 1.5rem;
  }

  .nav-links {
    gap: 1.25rem;
  }

  .section {
    padding: 4rem 1.5rem;
  }

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

  .blob-1 {
    width: 300px;
    height: 300px;
  }

  .blob-2 {
    display: none;
  }
}

@media (max-width: 600px) {
  .hamburger {
    display: flex;
  }

  .nav-links {
    display: none;
    position: fixed;
    top: 61px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 1.5rem 1rem;
    gap: 0;
    z-index: 99;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links li {
    border-bottom: 1px solid var(--border);
  }

  .nav-links li:last-child {
    border-bottom: none;
  }

  .nav-links a {
    display: block;
    padding: 0.85rem 0;
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }
}
