@import url('https://fonts.googleapis.com/css2?family=Geist+Mono:wght@400;500;700&family=Clash+Display:wght@500;600;700&family=Instrument+Sans:wght@400;500;600&display=swap');

/* fallback if Clash Display not available via that name */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Geist+Mono:wght@400;500;700&family=Instrument+Sans:wght@400;500;600&display=swap');

:root {
  --bg:        #0d0d0d;
  --surface:   #141414;
  --surface2:  #1a1a1a;
  --border:    #242424;
  --border2:   #2e2e2e;
  --text:      #ebebeb;
  --text2:     #888;
  --text3:     #555;
  --green:     #4ade80;
  --amber:     #f59e0b;
  --mono:      'Geist Mono', 'Courier New', monospace;
  --display:   'Space Grotesk', sans-serif;
  --body:      'Instrument Sans', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

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

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

/* scrollbar */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border2); }

/* ===================== NOISE + BG ===================== */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='250' height='250'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='250' height='250' filter='url(%23n)' opacity='.4'/%3E%3C/svg%3E");
  opacity: .028;
}

/* ===================== NAV ===================== */
.nav {
  position: sticky; top: 0; z-index: 200;
  border-bottom: 1px solid var(--border);
  background: rgba(13,13,13,.88);
  backdrop-filter: blur(20px) saturate(1.2);
}
.nav-wrap {
  max-width: 1100px; margin: 0 auto;
  padding: 0 28px; height: 54px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  font-family: var(--mono);
  font-size: 13px; font-weight: 700;
  letter-spacing: .04em;
  color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.nav-logo-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  flex-shrink: 0;
}
.nav-links {
  display: flex; align-items: center; gap: 4px;
}
.nav-links a {
  font-family: var(--mono); font-size: 12px;
  color: var(--text2); padding: 5px 12px;
  border-radius: 6px; letter-spacing: .03em;
  transition: color .12s, background .12s;
}
.nav-links a:hover { color: var(--text); background: var(--surface); }
.nav-contact {
  border: 1px solid var(--border2) !important;
  color: var(--text) !important;
}
.nav-contact:hover { border-color: var(--green) !important; color: var(--green) !important; background: transparent !important; }

.hamburger {
  display: none; background: none; border: none;
  cursor: pointer; padding: 6px; gap: 4px; flex-direction: column;
}
.hamburger span {
  display: block; width: 18px; height: 1.5px;
  background: var(--text); border-radius: 2px;
}
.mobile-menu {
  display: none;
  background: var(--bg); border-bottom: 1px solid var(--border);
}
.mobile-menu.open { display: block; }
.mobile-menu a {
  display: block; padding: 12px 28px;
  font-family: var(--mono); font-size: 13px;
  color: var(--text2); border-bottom: 1px solid var(--border);
}
.mobile-menu a:last-child { border-bottom: none; }

/* ===================== HERO ===================== */
.hero {
  position: relative; z-index: 1;
  max-width: 1100px; margin: 0 auto;
  padding: 100px 28px 80px;
  border-bottom: 1px solid var(--border);
}

/* big line number aesthetic */
.hero-index {
  font-family: var(--mono); font-size: 11px;
  color: var(--text3); letter-spacing: .1em;
  text-transform: uppercase; margin-bottom: 32px;
  display: flex; align-items: center; gap: 12px;
}
.hero-index::after { content: ''; flex: 0 0 40px; height: 1px; background: var(--border2); }

.hero-h1 {
  font-family: var(--display);
  font-size: clamp(52px, 7vw, 96px);
  font-weight: 700;
  line-height: .95;
  letter-spacing: -.03em;
  color: var(--text);
  margin-bottom: 36px;
}
.hero-h1 .dim { color: var(--text3); }

.hero-row {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 64px; align-items: end;
}
.hero-bio {
  font-size: 16px; line-height: 1.75;
  color: var(--text2); max-width: 48ch;
  margin-bottom: 36px;
}
.hero-bio b { color: var(--text); font-weight: 500; }

.hero-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  letter-spacing: .05em; padding: 10px 18px;
  border-radius: 6px; border: 1px solid transparent;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all .15s; cursor: pointer;
}
.btn-solid { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn-solid:hover { background: var(--green); border-color: var(--green); color: #000; }
.btn-outline { background: transparent; color: var(--text2); border-color: var(--border2); }
.btn-outline:hover { color: var(--text); border-color: var(--text2); }

/* hero right: stat card */
.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden;
}
.hero-card-row {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.hero-card-row:last-child { border-bottom: none; }
.hcr-label {
  font-family: var(--mono); font-size: 10px;
  color: var(--text3); letter-spacing: .08em; text-transform: uppercase;
}
.hcr-val {
  font-family: var(--mono); font-size: 13px;
  color: var(--text); font-weight: 600;
}
.hcr-val.green { color: var(--green); }
.hcr-val.amber { color: var(--amber); }
.status-dot {
  display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; background: var(--green);
  margin-right: 6px;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

/* ===================== SECTIONS ===================== */
.section {
  position: relative; z-index: 1;
  max-width: 1100px; margin: 0 auto;
  padding: 80px 28px 0;
}
.section-header {
  display: flex; align-items: baseline;
  gap: 16px; margin-bottom: 36px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 20px;
}
.section-num {
  font-family: var(--mono); font-size: 11px;
  color: var(--text3); letter-spacing: .1em;
}
.section-title {
  font-family: var(--display);
  font-size: 22px; font-weight: 600;
  letter-spacing: -.02em;
}

/* ===================== ABOUT ===================== */
.about-layout {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
}
.about-cell {
  background: var(--surface); padding: 28px 24px;
}
.about-cell-label {
  font-family: var(--mono); font-size: 10px;
  color: var(--text3); letter-spacing: .1em;
  text-transform: uppercase; margin-bottom: 16px;
}
.about-cell p {
  font-size: 14px; color: var(--text2); line-height: 1.8;
}
.about-cell p b { color: var(--text); font-weight: 500; }
.about-items {
  display: flex; flex-direction: column; gap: 8px;
}
.about-item {
  font-size: 13px; color: var(--text2);
  padding: 8px 10px;
  background: var(--surface2); border-radius: 6px;
  border: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.about-item::before { content: '▸'; color: var(--green); font-size: 10px; }

/* ===================== SKILLS ===================== */
.skills-table {
  border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden;
}
.skill-item {
  display: grid;
  grid-template-columns: 180px 1fr 90px;
  align-items: center; gap: 20px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  transition: background .12s;
}
.skill-item:last-child { border-bottom: none; }
.skill-item:hover { background: var(--surface2); }

.skill-name {
  font-family: var(--display);
  font-size: 14px; font-weight: 600;
}
.skill-track {
  height: 2px; background: var(--border2);
  border-radius: 2px; overflow: hidden;
}
.skill-fill {
  height: 100%; width: 0%; border-radius: 2px;
  background: var(--text3);
  transition: width 1.1s cubic-bezier(.16,1,.3,1);
}
.skill-fill.hi { background: var(--text); }
.skill-badge {
  font-family: var(--mono); font-size: 10px;
  color: var(--text3); letter-spacing: .06em;
  text-align: right;
}

/* ===================== PROJECTS ===================== */
.projects-list {
  display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
}
.project-card {
  display: grid; grid-template-columns: 220px 1fr;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  transition: background .12s;
  overflow: hidden;
}
.project-card:last-child { border-bottom: none; }
.project-card:hover { background: var(--surface2); }
.project-card:hover .project-thumb img { transform: scale(1.05); }

.project-thumb {
  width: 220px; height: 180px; overflow: hidden;
  border-right: 1px solid var(--border);
  background: var(--surface2);
  flex-shrink: 0; align-self: stretch;
}
.project-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.project-thumb-fallback {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 11px;
  color: var(--text3); letter-spacing: .06em;
}

.project-info { padding: 24px 28px; }
.project-meta {
  font-family: var(--mono); font-size: 10px;
  color: var(--text3); letter-spacing: .1em;
  text-transform: uppercase; margin-bottom: 8px;
}
.project-name {
  font-family: var(--display);
  font-size: 20px; font-weight: 600;
  letter-spacing: -.02em; margin-bottom: 10px;
  color: var(--text);
}
.project-desc {
  font-size: 13px; color: var(--text2);
  line-height: 1.75; margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.project-more {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  letter-spacing: .06em; color: var(--text3);
  border: 1px solid var(--border); border-radius: 4px;
  padding: 3px 9px; margin-bottom: 14px;
  transition: color .12s, border-color .12s;
}
.project-more:hover { color: var(--text); border-color: var(--border2); }
.project-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.project-tag {
  font-family: var(--mono); font-size: 10px;
  font-weight: 500; letter-spacing: .06em;
  padding: 3px 8px; border-radius: 4px;
  border: 1px solid var(--border2);
  color: var(--text3); background: var(--bg);
}

/* ===================== CONTACT STRIP ===================== */
.contact-strip {
  position: relative; z-index: 1;
  max-width: 1100px; margin: 0 auto;
  padding: 80px 28px;
  border-top: 1px solid var(--border);
  margin-top: 80px;
  display: flex; align-items: center;
  justify-content: space-between; gap: 40px;
  flex-wrap: wrap;
}
.contact-left h2 {
  font-family: var(--display);
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 700; letter-spacing: -.03em;
  margin-bottom: 8px;
}
.contact-left p {
  font-size: 14px; color: var(--text2);
}
.contact-handle {
  font-family: var(--mono); font-size: 13px;
  font-weight: 600; color: var(--text);
  padding: 12px 20px;
  border: 1px solid var(--border2);
  border-radius: 8px;
  display: flex; align-items: center; gap: 10px;
  transition: border-color .15s, color .15s;
  white-space: nowrap;
}
.contact-handle:hover { border-color: var(--green); color: var(--green); }
.contact-handle-icon {
  width: 14px; height: 14px; opacity: .5; flex-shrink: 0;
}

/* ===================== FOOTER ===================== */
.footer {
  position: relative; z-index: 1;
  border-top: 1px solid var(--border);
  padding: 24px 28px;
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1100px; margin: 0 auto;
}
.footer-l { font-family: var(--mono); font-size: 11px; color: var(--text3); }
.footer-r { font-family: var(--mono); font-size: 11px; color: var(--text3); }

/* ===================== REVEAL ===================== */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 860px) {
  .hero-row { grid-template-columns: 1fr; gap: 40px; }
  .about-layout { grid-template-columns: 1fr; }
  .skill-item { grid-template-columns: 1fr auto; }
  .skill-item .skill-track { display: none; }
  .project-card { grid-template-columns: 1fr; }
  .project-thumb { width: 100%; height: 160px; border-right: none; border-bottom: 1px solid var(--border); }
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .contact-strip { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 560px) {
  .hero { padding: 60px 20px 60px; }
  .hero-h1 { font-size: 42px; }
  .section { padding: 64px 20px 0; }
  .footer { flex-direction: column; gap: 8px; padding: 20px; text-align: center; }
}

/* ===================== HERO LAYOUT FIX ===================== */
/* Profile + heading grouped together, bio below — no floating gap */
.hero-main-row {
  display: flex;
  align-items: flex-end;
  gap: 28px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.hero-pfp-wrap {
  flex-shrink: 0;
}
.hero-pfp {
  width: 72px; height: 72px;
  border-radius: 12px; object-fit: cover;
  border: 1px solid var(--border2);
  display: block;
}
.hero-text-block {
  flex: 1;
  min-width: 0;
}
/* h1 stays tight below the pfp row now */
.hero-h1 {
  margin-bottom: 0; /* remove old bottom margin — row handles spacing */
}

/* ===================== PAGINATION ===================== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.pag-btn {
  font-family: var(--mono);
  font-size: 13px; font-weight: 600;
  color: var(--text2);
  width: 38px; height: 38px;
  border: 1px solid var(--border2);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  transition: color .12s, border-color .12s;
  cursor: pointer;
}
.pag-btn:hover { color: var(--text); border-color: var(--border3); }
.pag-btn.disabled { opacity: .25; pointer-events: none; cursor: default; }
.pag-pages { display: flex; gap: 4px; }
.pag-num {
  font-family: var(--mono);
  font-size: 12px;
  width: 34px; height: 34px;
  border-radius: 6px;
  border: 1px solid transparent;
  display: flex; align-items: center; justify-content: center;
  color: var(--text2);
  transition: all .12s;
}
.pag-num:hover { color: var(--text); background: var(--surface2); }
.pag-num.active {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border2);
  cursor: default; pointer-events: none;
}

/* ===================== PROJECT IMAGE SLIDER ===================== */
.project-slider { position: relative; overflow: hidden; }
.slide-img { width: 100%; height: 100%; object-fit: cover; }
.slide-dots {
  position: absolute; bottom: 8px; left: 0; right: 0;
  display: flex; justify-content: center; gap: 5px;
}
.slide-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: rgba(255,255,255,.3);
  cursor: pointer; transition: background .15s;
}
.slide-dot.active { background: rgba(255,255,255,.85); }

@media (max-width: 860px) {
  .hero-main-row { gap: 18px; }
  .hero-pfp { width: 56px; height: 56px; }
}
@media (max-width: 560px) {
  .hero-main-row { flex-direction: row; align-items: center; }
  .pagination { gap: 5px; }
  .pag-btn { width: 32px; height: 32px; font-size: 12px; }
  .pag-num { width: 28px; height: 28px; font-size: 11px; }
}
