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

:root {
  --bg: #090b0e;
  --bg2: #0d1117;
  --surface: #131926;
  --surface2: #1a2030;
  --border: rgba(255,255,255,0.07);
  --text: #e2e6f0;
  --muted: #6b7590;
  --muted2: #9aa0b8;
  --accent: #00d4a0;
  --accent2: #0099ff;
  --accent-dim: rgba(0, 212, 160, 0.1);
  --accent2-dim: rgba(0, 153, 255, 0.08);
  --red: #ff5f6b;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Outfit', sans-serif;
  font-size: 17px;
  line-height: 1.75;
  overflow-x: hidden;
  cursor: default;
}

/* ── NOISE OVERLAY ── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  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)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.022;
  pointer-events: none;
  z-index: 9998;
}

/* ── BACKGROUND BLOBS ── */
.bg-blob {
  position: fixed;
  top: -10vh; right: -15vw;
  width: 65vw; height: 65vw;
  background: radial-gradient(ellipse, rgba(0,212,160,0.07) 0%, transparent 65%);
  pointer-events: none; z-index: 0;
}
.bg-blob2 {
  position: fixed;
  bottom: 5vh; left: -20vw;
  width: 55vw; height: 55vw;
  background: radial-gradient(ellipse, rgba(0,153,255,0.06) 0%, transparent 65%);
  pointer-events: none; z-index: 0;
}

/* ── GRID OVERLAY ── */
.grid-overlay {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 100%);
}

/* ── NAV ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 5vw;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s, backdrop-filter 0.3s;
}
nav.scrolled {
  border-color: var(--border);
  background: rgba(9,11,14,0.9);
  backdrop-filter: blur(20px);
}

.nav-logo {
  font-family: 'DM Mono', monospace;
  font-size: 1rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.05em;
  font-weight: 500;
}
.nav-logo .accent { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
  align-items: center;
}
.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.2s;
  counter-increment: nav-count;
}
.nav-links a:hover { color: var(--text); }
.nav-resume {
    border: 1px solid #00d4a0;
    color: #00d4a0 !important;
    border-radius: 4px;
    padding: 8px 16px !important;
    transition: all 0.3s ease;
    font-family: 'DM Mono', monospace;
    font-size: 13px;
}

.nav-resume:hover {
    background-color: rgba(0, 212, 160, 0.1);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 24px; height: 2px;
  background: var(--text);
  transition: transform 0.3s, opacity 0.3s;
  border-radius: 2px;
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(9,11,14,0.97);
  z-index: 150;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  transform: translateX(100%);
  transition: transform 0.35s ease;
}
.mobile-menu.open {
  display: flex;
  transform: translateX(0);
}
.mobile-link {
  font-family: 'DM Serif Display', serif;
  font-size: 2.5rem;
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}
.mobile-link:hover { color: var(--accent); }

/* ── SECTION BASE ── */
section { position: relative; z-index: 1; }
.section-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 7rem 5vw;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 4rem;
}
.section-num {
  font-family: 'DM Mono', monospace;
  color: var(--accent);
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}
.section-title {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 400;
  white-space: nowrap;
  flex-shrink: 0;
}
.section-line {
  display: block;
  height: 1px;
  background: var(--border);
  flex: 1;
}

/* ── HERO ── */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 8rem 5vw 5rem;
}

.hero-inner { max-width: 850px; }

.hero-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.85rem;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
  display: block;
}

.hero-name {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(3.5rem, 9vw, 7.5rem);
  line-height: 1.0;
  letter-spacing: -0.03em;
  margin-bottom: 0.6rem;
}
.accent { color: var(--accent); }

.hero-sub {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.1;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: 1.8rem;
}
.hero-sub em {
  color: var(--text);
  font-style: italic;
}

.hero-tagline {
  font-size: 1.05rem;
  color: var(--muted2);
  max-width: 520px;
  margin-bottom: 3rem;
  font-weight: 300;
  line-height: 1.8;
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 3rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.stat {
  display: flex;
  flex-direction: column;
}
.stat-value {
  font-family: 'DM Mono', monospace;
  font-size: 1.8rem;
  color: var(--text);
  line-height: 1;
  font-weight: 500;
}
.stat-unit {
  color: var(--accent);
  font-size: 1.2rem;
}
.stat-label {
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-top: 0.3rem;
  font-family: 'DM Mono', monospace;
}
.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
  margin: 0 2rem;
}

.hero-actions {
  display: flex;
  gap: 1.2rem;
  align-items: center;
  margin-bottom: 4rem;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent);
  color: #090b0e;
  font-family: 'DM Mono', monospace;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.85rem 2rem;
  border-radius: 3px;
  transition: opacity 0.2s, transform 0.2s;
}
.btn-primary:hover { opacity: 0.85; transform: translateY(-1px); }
.btn-primary.large { padding: 1rem 2.5rem; font-size: 0.88rem; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  color: var(--text);
  font-family: 'DM Mono', monospace;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.85rem 2rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  transition: border-color 0.2s, color 0.2s, transform 0.2s;
}
.btn-ghost:hover {
  border-color: rgba(255,255,255,0.2);
  color: var(--accent);
  transform: translateY(-1px);
}

.hero-scroll {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
}
.scroll-line {
  display: block;
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}
.scroll-text {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.4; transform: scaleY(1); }
  50% { opacity: 1; transform: scaleY(1.1); }
}

/* ── ABOUT ── */
#about { background: var(--bg2); }

.about-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 5rem;
  align-items: start;
}

.about-text p {
  color: var(--muted2);
  margin-bottom: 1.3rem;
  font-size: 1.0rem;
}
.about-text p strong { color: var(--text); font-weight: 500; }

.about-tech { margin-top: 2rem; }
.tech-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.tech-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem 1rem;
}
.tech-list li {
  font-family: 'DM Mono', monospace;
  font-size: 0.82rem;
  color: var(--muted2);
  padding-left: 1rem;
  position: relative;
}
.tech-list li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.7rem;
}

.about-image-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.about-image-frame {
  position: relative;
  width: 280px;
  height: 320px;
  flex-shrink: 0;
}
.about-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  display: block;
  position: relative;
  z-index: 1;
  filter: grayscale(20%);
  transition: filter 0.3s;
}
.about-image:hover { filter: grayscale(0%); }
.about-image-frame.no-image .about-image { display: none; }
.about-image-frame.no-image .image-placeholder { display: flex; }

.image-placeholder {
  display: none;
  width: 100%;
  height: 100%;
  background: var(--surface2);
  border-radius: 6px;
  align-items: center;
  justify-content: center;
  font-family: 'DM Serif Display', serif;
  font-size: 4rem;
  color: var(--muted);
  position: relative;
  z-index: 1;
}

.image-border {
  position: absolute;
  inset: -10px;
  border: 1.5px solid rgba(0,212,160,0.25);
  border-radius: 8px;
  z-index: 0;
  transition: transform 0.3s;
}
.about-image-frame:hover .image-border {
  transform: translate(6px, 6px);
}

.about-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  color: var(--muted2);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  letter-spacing: 0.04em;
}
.badge-dot {
  width: 7px; height: 7px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,212,160,0.4); }
  50% { box-shadow: 0 0 0 5px rgba(0,212,160,0); }
}

/* ── PROJECTS ── */
#projects { background: var(--bg); }

/* Featured Projects */
.project-featured {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 3rem;
  align-items: center;
  margin-bottom: 5rem;
  padding: 3rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s;
}
.project-featured::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}
.project-featured:hover { border-color: rgba(255,255,255,0.15); }
.project-featured.reverse { direction: rtl; }
.project-featured.reverse > * { direction: ltr; }

.project-tag {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.8rem;
}
.project-featured-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.8rem;
  font-weight: 400;
  margin-bottom: 1rem;
  color: var(--text);
}
.project-featured-desc {
  color: var(--muted2);
  font-size: 0.95rem;
  line-height: 1.75;
  margin-bottom: 1.5rem;
}

.project-metrics {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.metric { display: flex; flex-direction: column; }
.metric-value {
  font-family: 'DM Mono', monospace;
  font-size: 1.3rem;
  color: var(--accent);
  font-weight: 500;
  line-height: 1.1;
}
.metric-label {
  font-size: 0.72rem;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  letter-spacing: 0.04em;
}

.project-tech {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.8rem;
}
.project-tech li {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  color: var(--muted2);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0.3rem 0.75rem;
  border-radius: 3px;
}

.project-links {
  display: flex;
  gap: 1.5rem;
}
.project-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted2);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}
.project-link:hover { color: var(--text); }
.project-link.accent { color: var(--accent); }
.project-link.accent:hover { opacity: 0.8; }

/* Chart mocks */
.project-featured-image {
  display: flex;
  align-items: center;
  justify-content: center;
}
.project-chart-mock {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.5rem;
  width: 100%;
}
.chart-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.roc-chart, .bar-chart { width: 100%; height: auto; }

/* Project Cards Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2rem;
  transition: border-color 0.3s, transform 0.3s;
  display: flex;
  flex-direction: column;
}
.project-card:hover {
  border-color: rgba(255,255,255,0.15);
  transform: translateY(-4px);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}
.card-folder { flex-shrink: 0; }
.card-links { display: flex; gap: 1rem; }
.card-links a { color: var(--muted); transition: color 0.2s; text-decoration: none; }
.card-links a:hover { color: var(--text); }

.card-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.2rem;
  font-weight: 400;
  margin-bottom: 0.8rem;
  color: var(--text);
}
.card-desc {
  color: var(--muted2);
  font-size: 0.88rem;
  line-height: 1.7;
  flex: 1;
  margin-bottom: 1.5rem;
}
.card-tech {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: auto;
}
.card-tech li {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  color: var(--muted);
}
.card-tech li:not(:last-child)::after { content: ' ·'; }

/* ── SKILLS ── */
#skills { background: var(--bg2); }

.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 4rem;
}

.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2rem;
  transition: border-color 0.3s, transform 0.3s;
}
.skill-card:hover {
  border-color: rgba(0,212,160,0.2);
  transform: translateY(-2px);
}

.skill-icon { font-size: 2rem; margin-bottom: 1rem; }

.skill-name {
  font-family: 'DM Serif Display', serif;
  font-size: 1.15rem;
  font-weight: 400;
  margin-bottom: 0.75rem;
}
.skill-desc {
  color: var(--muted2);
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 1rem;
}
.skill-cert {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: opacity 0.2s;
}
.skill-cert:hover { opacity: 0.7; }

.tools-section {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2.5rem;
  background: var(--surface);
}
.tools-title {
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}
.tools-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.tool {
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
  color: var(--muted2);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0.4rem 1rem;
  border-radius: 3px;
  transition: color 0.2s, border-color 0.2s;
}
.tool:hover {
  color: var(--accent);
  border-color: rgba(0,212,160,0.3);
}

/* ── CONTACT ── */
#contact { background: var(--bg); }

.contact-inner { text-align: center; }
.contact-inner .section-header { justify-content: center; }
.contact-inner .section-line { display: none; }

.contact-block { max-width: 640px; margin: 0 auto; }

.contact-sub {
  font-family: 'DM Mono', monospace;
  font-size: 0.82rem;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.contact-heading {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  margin-bottom: 1.5rem;
  line-height: 1.15;
}
.contact-text {
  color: var(--muted2);
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 2.5rem;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}
.contact-social {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted2);
  text-decoration: none;
  font-size: 0.85rem;
  font-family: 'DM Mono', monospace;
  transition: color 0.2s;
}
.contact-social:hover { color: var(--accent); }

/* ── FOOTER ── */
footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2.5rem 5vw;
  border-top: 1px solid var(--border);
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.footer-sub { margin-top: 0.4rem; opacity: 0.5; font-size: 0.72rem; }

/* ── REVEAL ANIMATIONS ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  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-image-wrap { order: -1; flex-direction: row; justify-content: flex-start; align-items: center; gap: 2rem; }
  .about-image-frame { width: 180px; height: 200px; }
  .project-featured { grid-template-columns: 1fr; }
  .project-featured.reverse { direction: ltr; }
  .project-featured-image { display: none; }
  .skills-grid { grid-template-columns: 1fr; }
  .hero-stats { flex-wrap: wrap; gap: 1.5rem; }
  .stat-divider { display: none; }
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .hero-name { font-size: 3rem; }
  .hero-sub { font-size: 1.8rem; }
  .project-featured { padding: 1.5rem; }
  .section-inner { padding: 5rem 5vw; }
  .contact-links { gap: 1.2rem; }
}