/* ===== Theme ===== */
:root {
  --bg: #0D1117;
  --surface: #161D2B;
  --border: #1E2A3A;
  --text: #F0F0F0;
  --muted: #718096;
  --accent: #F5A623;
  --accent-hover: #D4891A;

  --maxw: 1120px;
  --radius: 14px;
  --ease: cubic-bezier(.4, 0, .2, 1);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

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

/* ===== Navbar ===== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(13, 17, 23, .72);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.navbar.scrolled {
  border-bottom-color: var(--border);
  background: rgba(13, 17, 23, .9);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}
.logo img {
  height: 38px;
  width: auto;
  display: block;
  /* black signature on cream -> white signature; bg blends into dark navbar */
  filter: invert(1) brightness(1.6) contrast(1.1);
}
.nav-links { display: flex; gap: 30px; }
.nav-links a {
  font-size: .95rem;
  font-weight: 500;
  color: var(--muted);
  position: relative;
  transition: color .2s var(--ease);
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 0; height: 2px;
  background: var(--accent);
  transition: width .25s var(--ease);
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }

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

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 10px;
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  transition: transform .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: var(--accent);
  color: #1a1300;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-outline {
  border: 1px solid var(--border);
  color: var(--text);
  background: transparent;
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

/* ===== Hero ===== */
.hero {
  padding: 150px 0 100px;
  position: relative;
}
.hero::before {
  content: "";
  position: absolute;
  top: 60px; left: 50%;
  width: 700px; height: 500px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(245, 166, 35, .12), transparent 65%);
  filter: blur(20px);
  pointer-events: none;
  z-index: -1;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 60px;
  align-items: center;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--surface);
  color: var(--muted);
  font-size: .8rem;
  font-weight: 500;
  margin-bottom: 24px;
}
.badge .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #3fb950;
  box-shadow: 0 0 0 0 rgba(63, 185, 80, .6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(63, 185, 80, .5); }
  70% { box-shadow: 0 0 0 8px rgba(63, 185, 80, 0); }
  100% { box-shadow: 0 0 0 0 rgba(63, 185, 80, 0); }
}
.hero h1 {
  font-size: clamp(2.4rem, 5.5vw, 3.8rem);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -.02em;
  margin-bottom: 22px;
}
.lead {
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 520px;
  margin-bottom: 32px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* ===== Terminal ===== */
.terminal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, .45);
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, .03);
  border-bottom: 1px solid var(--border);
}
.tdot { width: 12px; height: 12px; border-radius: 50%; }
.tdot.red { background: #ff5f56; }
.tdot.yellow { background: #ffbd2e; }
.tdot.green { background: #27c93f; }
.terminal-title {
  margin-left: 10px;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: .78rem;
}
.terminal-body {
  padding: 22px 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: .9rem;
  line-height: 1.85;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}
.t-prompt { color: var(--accent); }
.t-cmd { color: #58a6ff; }
.t-key { color: var(--muted); }
.t-arrow { color: var(--accent); }
.cursor { animation: blink 1.1s steps(1) infinite; color: var(--accent); }
@keyframes blink { 50% { opacity: 0; } }

/* ===== Sections ===== */
.section { padding: 100px 0; }
.section.alt { background: var(--surface); border-block: 1px solid var(--border); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 56px; }
.eyebrow {
  display: inline-block;
  color: var(--accent);
  font-weight: 600;
  font-size: .82rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.section h2 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -.02em;
  margin-bottom: 14px;
}
.section-head .muted { font-size: 1.05rem; }

/* ===== Projects ===== */
.grid.projects {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  transition: transform .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.section.alt .card { background: var(--bg); }
.card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .4);
}
.card h3 { font-size: 1.22rem; font-weight: 700; margin-bottom: 10px; }
.card p { color: var(--muted); font-size: .96rem; margin-bottom: 18px; flex: 1; }
.card-link {
  color: var(--accent);
  font-weight: 600;
  font-size: .92rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap .2s var(--ease);
}
.card-link:hover { gap: 11px; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.tag {
  font-size: .76rem;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: 7px;
  background: rgba(245, 166, 35, .1);
  color: var(--accent);
  border: 1px solid rgba(245, 166, 35, .2);
}
.see-more { text-align: center; margin-top: 44px; }

/* ===== About & Skills ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 64px;
  align-items: start;
}
.about-me .profile {
  width: 150px; height: 150px;
  border-radius: 22px;
  overflow: hidden;
  border: 2px solid var(--border);
  margin: 16px 0 22px;
}
.about-me .profile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.about-me h2 { font-size: 1.7rem; margin-bottom: 14px; }
.about-me .muted { font-size: 1rem; max-width: 420px; }

.skills h2 { margin-bottom: 30px; }
.skill-group { margin-bottom: 26px; }
.skill-group h4 {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}
.skills .tag { margin-bottom: 0; }

/* ===== Contact ===== */
.contact-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  max-width: 680px;
  margin: 0 auto;
}
.contact-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease);
}
.contact-btn:hover { transform: translateY(-3px); border-color: var(--accent); }
.contact-btn .ci {
  flex-shrink: 0;
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(245, 166, 35, .12);
  color: var(--accent);
}
.contact-btn .ci svg { width: 22px; height: 22px; display: block; }
.contact-btn .cl { display: flex; flex-direction: column; line-height: 1.35; }
.contact-btn .cl strong { font-size: .98rem; }
.contact-btn .cl small { color: var(--muted); font-size: .82rem; }

/* ===== Footer ===== */
.footer { border-top: 1px solid var(--border); padding: 28px 0; }
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: .9rem;
}

/* ===== Reveal on scroll ===== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.reveal.in { opacity: 1; transform: none; }

/* ===== Responsive ===== */
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; gap: 48px; }
  .about-grid { grid-template-columns: 1fr; gap: 44px; }
  .nav-links {
    position: fixed;
    top: 70px; right: 0;
    flex-direction: column;
    gap: 0;
    width: min(260px, 80vw);
    height: calc(100vh - 70px);
    padding: 24px;
    background: var(--surface);
    border-left: 1px solid var(--border);
    transform: translateX(100%);
    transition: transform .3s var(--ease);
  }
  .nav-links.open { transform: translateX(0); }
  .nav-links a { padding: 16px 0; font-size: 1.05rem; width: 100%; border-bottom: 1px solid var(--border); }
  .nav-links a::after { display: none; }
  .nav-toggle { display: flex; }
}

@media (max-width: 560px) {
  .grid.projects { grid-template-columns: 1fr; }
  .contact-links { grid-template-columns: 1fr; }
  .section { padding: 72px 0; }
  .hero { padding: 120px 0 70px; }
  .footer-inner { flex-direction: column; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
