:root {
  --bg: #ffffff;
  --bg-soft: #f4f7fb;
  --ink: #101828;
  --ink-soft: #475467;
  --blue-deep: #1b2a56;
  --blue: #2f5fd0;
  --blue-pale: #dce6fa;
  --line: #d0daea;
  --mono: 'IBM Plex Mono', monospace;
  --display: 'Space Grotesk', sans-serif;
  --body: 'Inter', sans-serif;
}

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

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

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

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

.mono-label {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--blue);
  text-transform: none;
  display: block;
}

.section-title {
  font-family: var(--display);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 600;
  color: var(--blue-deep);
  margin: 0.5rem auto 1.5rem;
  letter-spacing: -0.01em;
  text-align: center;
  text-wrap: balance;
}

/* Background grid */
.grid-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.25;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 20%, transparent 75%);
}

/* NAV */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem clamp(1.5rem, 5vw, 4rem);
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.nav-logo {
  display: flex;
  align-items: center;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--blue-deep);
}

.nav-logo-img {
  height: 38px;
  width: auto;
  object-fit: contain;
  border-radius: 6px;
}

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

.nav-links {
  display: flex;
  gap: 1.75rem;
  font-family: var(--mono);
  font-size: 0.88rem;
}

.nav-links a { color: var(--ink-soft); transition: color 0.15s; }
.nav-links a:hover, .nav-links a.active { color: var(--blue); }
.slash { color: var(--blue); }

.nav-cta {
  font-family: var(--mono);
  font-size: 0.85rem;
  border: 1px solid var(--blue-deep);
  color: var(--blue-deep);
  padding: 0.45rem 0.9rem;
  border-radius: 3px;
  transition: background 0.15s, color 0.15s;
}
.nav-cta:hover { background: var(--blue-deep); color: #fff; }

@media (max-width: 720px) {
  .nav-links { display: none; }
}

/* HERO */
.hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
  padding: 2rem clamp(1.5rem, 5vw, 4rem);
  overflow: hidden;
}

.hero-inner {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2.5rem;
  position: relative;
  z-index: 2;
}

/* Left side text */
.hero-text-content {
  flex: 1;
  min-width: 0;
}

/* Right side photo container */
.hero-photo-wrapper {
  flex-shrink: 0;
}

/* Desktop Photo Size */
.hero-photo {
  width: 260px;
  height: 320px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
  display: block;
}

.hero-name {
  font-family: var(--display);
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  font-weight: 700;
  color: var(--blue-deep);
  line-height: 1.05;
  margin: 0.4rem 0 0.3rem;
  letter-spacing: -0.02em;
}

.hero-role {
  font-family: var(--display);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  color: var(--blue);
  font-weight: 500;
  margin-bottom: 1.2rem;
}

.hero-intro {
  color: var(--ink-soft);
  font-size: 1rem;
  max-width: 540px;
  margin-bottom: 2rem;
  text-wrap: balance;
}

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

.btn {
  font-family: var(--mono);
  font-size: 0.88rem;
  padding: 0.75rem 1.3rem;
  border-radius: 3px;
  border: 1px solid var(--blue-deep);
  transition: transform 0.15s, background 0.15s, color 0.15s;
  display: inline-block;
}
.btn-primary { background: var(--blue-deep); color: #fff; }
.btn-primary:hover { background: var(--blue); border-color: var(--blue); transform: translateY(-1px); }
.btn-ghost { color: var(--blue-deep); }
.btn-ghost:hover { background: var(--blue-pale); transform: translateY(-1px); }

.hero-status { display: flex; align-items: center; gap: 0.6rem; }
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #2f9e44;
  box-shadow: 0 0 0 0 rgba(47,158,68,0.5);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(47,158,68,0.45); }
  70% { box-shadow: 0 0 0 8px rgba(47,158,68,0); }
  100% { box-shadow: 0 0 0 0 rgba(47,158,68,0); }
}

/* MOBILE RESPONSIVE FIX (Screens under 768px width) */
@media (max-width: 768px) {
  .hero-inner {
    flex-direction: column-reverse; /* Places text first, photo under it */
    align-items: center;
    text-align: center;
    gap: 2rem;
  }

  .hero-intro {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-status {
    justify-content: center;
  }

  .hero-photo {
    width: 200px;
    height: 250px;
  }
}

/* SECTIONS */
.section {
  padding: 5rem clamp(1.5rem, 5vw, 4rem);
  border-top: 1px solid var(--line);
  max-width: 1100px;
  margin: 0 auto;
}

/* ABOUT */
.about-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 3rem;
  align-items: center;
}

.about-text {
  text-align: center;
}

.about-text p { 
  color: var(--ink-soft); 
  margin: 0 auto 1.2rem auto; 
  max-width: 65ch; 
  text-wrap: balance;
}

.about-card {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.5rem;
  font-family: var(--mono);
  font-size: 0.85rem;
}
.about-photo-wrap {
  margin-bottom: 1.2rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px dashed var(--line);
}
.about-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
  display: block;
}
.card-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px dashed var(--line);
  color: var(--ink-soft);
}
.card-row:last-child { border-bottom: none; }
.card-row span:first-child { color: var(--blue); }
.card-row span:last-child { color: var(--ink); text-align: right; }

@media (max-width: 800px) {
  .about-grid { grid-template-columns: 1fr; }
}

/* SKILLS */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 2rem;
}

.skill-col h3 {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--blue);
  text-transform: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.6rem;
  margin-bottom: 0.8rem;
}

.skill-col ul { 
  list-style: none; 
}

.skill-col li {
  padding: 0.4rem 0;
  color: var(--ink);
  font-weight: 500;
}

/* Restores the blue node bullets */
.skill-col li::before {
  content: "› ";
  color: var(--blue);
  font-family: var(--mono);
  font-weight: 700;
}
/* EDUCATION */
.education-list { display: flex; flex-direction: column; gap: 1.25rem; }

.edu-item {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.5rem 2rem;
  text-align: center;
  transition: border-color 0.15s, transform 0.15s;
}
.edu-item:hover { border-color: var(--blue); transform: translateY(-2px); }

.edu-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}
.edu-head h3 {
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--blue-deep);
}
.edu-duration {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--blue);
  white-space: nowrap;
}
.edu-degree { color: var(--ink-soft); text-wrap: balance; }

/* PROJECTS */
.projects-list { display: flex; flex-direction: column; gap: 1.5rem; }

.project {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.75rem 2rem;
  text-align: center;
  transition: border-color 0.15s, transform 0.15s;
}
.project:hover { border-color: var(--blue); transform: translateY(-2px); }

.project-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
  flex-wrap: wrap;
}
.project-head h3 {
  font-family: var(--mono);
  font-size: 1.15rem;
  color: var(--blue-deep);
  font-weight: 500;
}
.badge {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--blue-deep);
  background: var(--blue-pale);
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
}

.project-desc { 
  color: var(--ink-soft); 
  margin: 0 auto 1.25rem auto; 
  max-width: 70ch; 
  text-align: center;
  text-wrap: balance;
}

.project-fields {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
  font-family: var(--mono);
  font-size: 0.82rem;
}
.project-fields div { display: flex; gap: 0.6rem; justify-content: center; }
.project-fields span:first-child { color: var(--blue); }
.project-fields span:last-child { color: var(--ink); }

.project-links {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
}

.project-links a {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--blue-deep);
  border-bottom: 1px solid var(--blue-deep);
  padding-bottom: 1px;
}
.project-links a:hover { color: var(--blue); border-color: var(--blue); }

.project-pending { opacity: 0.7; border-style: dashed; }

/* CONTACT */
.contact-section { text-align: center; }

.contact-intro { 
  color: var(--ink-soft); 
  margin: 0 auto 2rem auto; 
  max-width: 55ch; 
  text-align: center;
  text-wrap: balance;
}

.contact-social-icons {
  display: flex !important;
  flex-direction: row;
  gap: 1.5rem;
  align-items: center;
  justify-content: center;
  margin-top: 1.25rem;
}

.social-icon {
  font-size: 1.75rem;
  color: #334155;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.social-icon:hover {
  transform: translateY(-3px);
  color: #0f172a;
}

/* FOOTER */
.footer {
  padding: 2rem clamp(1.5rem, 5vw, 4rem);
  border-top: 1px solid var(--line);
  text-align: center;
}
/* Hide the SVG background schema on screens narrower than 1050px */
@media (max-width: 1050px) {
  .hero-schema {
    display: none;
  }
}
.nav-logo {
  font-family: var(--mono);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--blue-deep);
  letter-spacing: -0.03em;
  text-decoration: none;
}

.nav-logo .logo-bracket {
  color: var(--blue);
}