/* ===== CSS Variables & Reset ===== */
:root {
  --bg: #0b0f14;
  --bg-alt: #10161e;
  --bg-card: #141c26;
  --border: #1f2a38;
  --text: #dbe4ee;
  --text-muted: #8b9bab;
  --accent: #34d399;
  --accent-dim: rgba(52, 211, 153, 0.12);
  --accent-2: #60a5fa;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --radius: 14px;
  --max-w: 1080px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: #04110b; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container {
  width: min(100% - 3rem, var(--max-w));
  margin-inline: auto;
}
.container-narrow { max-width: 720px; }

.mono { font-family: var(--mono); }
.center { text-align: center; }

/* ===== Navbar ===== */
.navbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  background: rgba(11, 15, 20, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}
.navbar.scrolled { border-bottom-color: var(--border); }

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.brand-prompt { color: var(--accent); }
.brand-cursor { color: var(--accent); animation: blink 1s step-end infinite; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  font-size: 0.92rem;
  font-weight: 500;
}
.nav-links a:not(.btn) {
  color: var(--text-muted);
  transition: color 0.2s;
}
.nav-links a:not(.btn):hover { color: var(--text); }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 6px;
}
.hamburger span {
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn i { font-size: 1.15em; }

.btn-primary {
  background: var(--accent);
  color: #04110b;
  box-shadow: 0 8px 24px rgba(52, 211, 153, 0.25);
}
.btn-primary:hover { box-shadow: 0 12px 32px rgba(52, 211, 153, 0.35); }

.btn-outline {
  border-color: var(--border);
  color: var(--text);
  background: transparent;
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn-sm { padding: 0.45rem 1.1rem; font-size: 0.85rem; }
.btn-lg { padding: 1rem 2.4rem; font-size: 1.05rem; }

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

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 70% 20%, rgba(52, 211, 153, 0.09), transparent),
    radial-gradient(ellipse 50% 40% at 20% 80%, rgba(96, 165, 250, 0.08), transparent);
  pointer-events: none;
}
.hero-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--bg-alt) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-alt) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 30%, transparent 75%);
  opacity: 0.55;
}

.hero-inner { position: relative; }

.hero-greeting {
  color: var(--accent);
  font-size: 0.95rem;
  margin-bottom: 0.8rem;
}

.hero-name {
  font-size: clamp(2.8rem, 7vw, 4.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  background: linear-gradient(120deg, #ffffff 30%, #9fdcc4);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-name .type-cursor {
  display: inline-block;
  width: 0.06em;
  min-width: 3px;
  height: 0.85em;
  margin-left: 0.15em;
  background: var(--accent);
  transform: translateY(0.08em);
  animation: blink 0.9s step-end infinite;
}
.type-cursor.done { animation-duration: 1.1s; }

.hero-title {
  margin-top: 1rem;
  font-size: clamp(1rem, 2.4vw, 1.3rem);
  color: var(--text-muted);
  font-weight: 500;
}
.amp { color: var(--accent); }

.hero-desc {
  margin-top: 1.4rem;
  max-width: 560px;
  color: var(--text-muted);
  font-size: 1.08rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.2rem;
}

/* ===== Terminal ===== */
.terminal {
  margin-top: 3.5rem;
  max-width: 640px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(16, 22, 30, 0.85);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 1rem;
  background: #131a24;
  border-bottom: 1px solid var(--border);
}
.dot { width: 11px; height: 11px; border-radius: 50%; }
.dot-red { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green { background: #28c840; }
.terminal-title {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.terminal-body {
  padding: 1.1rem 1.3rem;
  font-size: 0.86rem;
  line-height: 1.9;
}
.t-prompt { color: var(--accent); font-weight: 600; }
.t-out { color: var(--text-muted); padding-left: 1.1rem; }

@keyframes blink { 50% { opacity: 0; } }
.blink { animation: blink 1s step-end infinite; color: var(--accent); }

/* ===== Sections ===== */
.section { padding: 6.5rem 0; scroll-margin-top: 64px; }
.section-alt { background: var(--bg-alt); }

.section-tag {
  color: var(--accent);
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  margin-bottom: 0.6rem;
}

.section-title {
  font-size: clamp(1.7rem, 3.6vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 2.4rem;
}
.center.section-title { text-align: center; }

.section-subtitle {
  color: var(--text-muted);
  max-width: 620px;
  margin-top: -1.4rem;
  margin-bottom: 2.6rem;
}

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

.about-text p + p { margin-top: 1.2rem; }
.about-text strong { color: var(--accent); font-weight: 600; }

.about-stats {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  position: sticky;
  top: 96px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.stat-card:hover { transform: translateY(-4px); border-color: var(--accent); }

.stat-number {
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.stat-number::after {
  content: "+";
  font-size: 1.6rem;
  vertical-align: super;
}
.stat-icon {
  font-size: 2.1rem;
  line-height: 1;
  color: var(--accent);
  display: inline-flex;
}
.stat-label { color: var(--text-muted); font-size: 0.92rem; }

/* ===== Cards ===== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.4rem;
}
.cards-grid-3 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.7rem;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.card:hover {
  transform: translateY(-5px);
  border-color: rgba(52, 211, 153, 0.5);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.35);
}

.card-icon {
  color: var(--accent);
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 0.9rem;
}
.card-icon-lg {
  font-size: 1.9rem;
  line-height: 1;
  margin-bottom: 1rem;
  color: var(--accent);
  display: inline-flex;
}

.card h3 {
  font-size: 1.06rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}
.card p { color: var(--text-muted); font-size: 0.93rem; }
.card-center { text-align: center; }

/* ===== Tech Stack ===== */
.stack-groups {
  display: flex;
  flex-direction: column;
  gap: 2.2rem;
}
.stack-group h3 {
  font-family: var(--mono);
  color: var(--accent-2);
  font-size: 0.92rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.chips { display: flex; flex-wrap: wrap; gap: 0.7rem; }

.chip {
  font-family: var(--mono);
  font-size: 0.86rem;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  transition: border-color 0.2s, color 0.2s, transform 0.2s;
}
.chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* ===== Philosophy ===== */
.quote {
  font-size: clamp(1.4rem, 3.4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.4;
  text-align: center;
  padding: 2rem 0;
  position: relative;
}
.quote::before,
.quote::after {
  content: "";
  display: block;
  width: 56px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  margin: 0 auto;
}
.quote::before { margin-bottom: 2rem; }
.quote::after { margin-top: 2rem; }

.philosophy-text {
  text-align: center;
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 640px;
  margin-inline: auto;
}
.philosophy-text + .philosophy-text { margin-top: 1.2rem; }

/* ===== Contact ===== */
.contact-text {
  color: var(--text-muted);
  max-width: 520px;
  margin: -1.2rem auto 2.4rem;
}
.mail-link { font-size: 1.05rem; }

/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--border);
  padding: 2.4rem 0;
  background: var(--bg-alt);
}
.footer-inner { font-size: 0.84rem; color: var(--text-muted); }
.footer-note { margin-top: 0.4rem; opacity: 0.75; }

/* ===== Reveal on Scroll ===== */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-stats {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .stat-card { flex: 1 1 150px; }
}

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

  .nav-links {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(11, 15, 20, 0.97);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 1.5rem 1.5rem;
    transform: translateY(-130%);
    transition: transform 0.3s ease;
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a:not(.btn) {
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--border);
  }
  .nav-links .btn { margin-top: 1.1rem; }

  .section { padding: 4.5rem 0; }
  .hero { padding-top: 6.5rem; }
}
