/* ── Reset & base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0d0f14;
  --bg2:       #13161e;
  --bg3:       #1b1f2b;
  --border:    #252a38;
  --text:      #c9d1e0;
  --text-dim:  #5c657a;
  --text-muted:#8892a4;
  --accent:    #4f9cf9;
  --accent2:   #7c6af7;
  --green:     #4ade80;
  --yellow:    #facc15;
  --red:       #f87171;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --font-sans: 'Inter', system-ui, sans-serif;
  --radius:    8px;
  --max-w:     1000px;
}

html { scroll-behavior: smooth; }

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

/* subtle grain overlay */
.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

/* ── Nav ────────────────────────────────────────────────────── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(13,15,20,.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent);
  letter-spacing: -.5px;
}

.cursor-blink {
  animation: blink 1.1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

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

.nav-links a {
  font-family: var(--font-mono);
  font-size: .85rem;
  color: var(--text-muted);
  transition: color .2s;
}
.nav-links a:hover { color: var(--accent); }

/* ── Sections ───────────────────────────────────────────────── */
section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 5rem 2rem;
}

.section-title {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2.5rem;
}
.section-title .comment { color: var(--text-dim); }

/* ── Hero ───────────────────────────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  min-height: calc(100vh - 57px);
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.hero-label {
  font-family: var(--font-mono);
  font-size: .85rem;
  color: var(--text-dim);
  margin-bottom: .75rem;
}

.hero-name {
  font-size: clamp(2.4rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -1.5px;
  line-height: 1.1;
  margin-bottom: .5rem;
  background: linear-gradient(135deg, #fff 40%, var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-title {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--accent);
  min-height: 1.5em;
  margin-bottom: 1.25rem;
}

.hero-bio {
  color: var(--text-muted);
  max-width: 440px;
  margin-bottom: 2rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-mono);
  font-size: .85rem;
  padding: .6rem 1.4rem;
  border-radius: var(--radius);
  transition: all .2s;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent);
  color: #0d0f14;
  font-weight: 600;
}
.btn-primary:hover { background: #74b4fb; }

.btn-ghost {
  border-color: var(--border);
  color: var(--text-muted);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.hero-stack {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

/* ── Tags ───────────────────────────────────────────────────── */
.tag {
  font-family: var(--font-mono);
  font-size: .78rem;
  padding: .3rem .7rem;
  border-radius: 4px;
  background: var(--bg3);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.tag.small {
  font-size: .72rem;
  padding: .2rem .55rem;
}

/* ── Terminal widget ────────────────────────────────────────── */
.hero-terminal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: .82rem;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .65rem 1rem;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}
.dot.red    { background: #f87171; cursor: pointer; }
.dot.yellow { background: #facc15; }
.dot.green  { background: #4ade80; }

.terminal-title {
  margin-left: .5rem;
  color: var(--text-dim);
  font-size: .78rem;
}

.terminal-body {
  padding: 1.25rem 1.25rem 1.5rem;
  min-height: 220px;
  line-height: 2;
  color: var(--text-muted);
}

.t-line { display: block; }
.t-prompt { color: var(--green); }
.t-cmd    { color: var(--text); }
.t-out    { color: var(--text-muted); padding-left: .5rem; }
.t-key    { color: var(--accent); }
.t-val    { color: var(--accent2); }
.t-cursor { display: inline-block; width: 8px; height: 1em; background: var(--accent); vertical-align: text-bottom; animation: blink 1s step-end infinite; }

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

.project-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(79,156,249,.08);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-icon {
  font-size: 1.6rem;
  color: var(--accent);
}

.card-links {
  display: flex;
  gap: .75rem;
}

.icon-link {
  color: var(--text-dim);
  transition: color .2s;
  display: flex;
}
.icon-link:hover { color: var(--accent); }
.icon-link svg { width: 18px; height: 18px; }

.card-title {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
}

.card-desc {
  font-size: .875rem;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .25rem;
}

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

.contact-sub {
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  font-size: 1.05rem;
}

.contact-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--font-mono);
  font-size: .875rem;
  color: var(--text-muted);
  padding: .75rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all .2s;
}
.contact-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.contact-item:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(79,156,249,.05);
}

/* ── Footer ─────────────────────────────────────────────────── */
footer {
  display: flex;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--text-dim);
  max-width: 100%;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 3rem;
  }
  .hero-terminal { display: none; }
  nav { padding: .875rem 1.25rem; }
  .nav-links { gap: 1.25rem; }
  section { padding: 3.5rem 1.25rem; }
  footer { flex-direction: column; gap: .5rem; }
}

@media (max-width: 480px) {
  .nav-links { gap: 1rem; }
  .hero-name { font-size: 2.2rem; }
}
