/* ─── Reset & Base ─────────────────────────────────────────────────────────── */

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

:root {
  --bg:          #06080f;
  --bg-card:     #0d1117;
  --bg-card-hover: #121820;
  --border:      #1e2a38;
  --text:        #ffffff;
  --text-muted:  #94a3b8;
  --accent:      #f59e0b;
  --accent-light:#fbbf24;
  --accent-dim:  rgba(245, 158, 11, 0.12);
  --dot:         rgba(245, 158, 11, 0.09);
  --nav-bg:      rgba(6, 8, 15, 0.88);
  --hero-overlay-start: rgba(6, 8, 15, 0.82);
  --hero-overlay-mid:   rgba(6, 8, 15, 0.60);
  --hero-overlay-end:   rgba(6, 8, 15, 0.30);
  --radius:      10px;
  --transition:  200ms ease;
  --max-w:       1100px;
  --nav-h:       64px;
  --font-sans:   'Inter', system-ui, sans-serif;
  --font-mono:   'Fira Code', 'Courier New', monospace;
}

[data-theme="light"] {
  --bg:          #f5f7fa;
  --bg-card:     #ffffff;
  --bg-card-hover: #eef2f7;
  --border:      #d1d9e6;
  --text:        #0f172a;
  --text-muted:  #475569;
  --accent:      #d97706;
  --accent-light:#f59e0b;
  --accent-dim:  rgba(217, 119, 6, 0.1);
  --dot:         rgba(217, 119, 6, 0.12);
  --nav-bg:      rgba(245, 247, 250, 0.92);
  --hero-overlay-start: rgba(245, 247, 250, 0.85);
  --hero-overlay-mid:   rgba(245, 247, 250, 0.60);
  --hero-overlay-end:   rgba(245, 247, 250, 0.25);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  background-image: radial-gradient(circle, var(--dot) 1px, transparent 1px);
  background-size: 28px 28px;
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

ul {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

/* ─── Utilities ─────────────────────────────────────────────────────────────── */

.container {
  width: 90%;
  max-width: var(--max-w);
  margin-inline: auto;
}

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

.section {
  padding-block: 100px;
}

.section__title {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.section__sub {
  color: var(--text-muted);
  margin-bottom: 3rem;
}

/* ─── Buttons ────────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}

.btn--primary:hover {
  background: var(--accent-light);
  transform: translateY(-2px);
}

.btn--ghost {
  border: 1.5px solid var(--accent);
  color: var(--accent);
  background: transparent;
}

.btn--ghost:hover {
  background: rgba(245, 158, 11, 0.12);
  transform: translateY(-2px);
}

/* ─── Nav ────────────────────────────────────────────────────────────────────── */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}


.nav__inner > nav {
  margin-left: auto;
}

.nav__links {
  display: flex;
  gap: 2.5rem;
}

.nav__links a {
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color var(--transition);
}

.nav__links a:hover {
  color: var(--accent);
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-left: 2.5rem;
  transition: color var(--transition), border-color var(--transition);
  flex-shrink: 0;
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.theme-toggle .icon-sun  { display: block; }
.theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun  { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* ─── Hero ───────────────────────────────────────────────────────────────────── */

.hero {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: var(--nav-h);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(37, 99, 235, 0.52);
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition);
}

[data-theme="light"] .hero::before {
  opacity: 1;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    var(--hero-overlay-start) 0%,
    var(--hero-overlay-mid) 50%,
    var(--hero-overlay-end) 100%
  );
  z-index: 1;
  pointer-events: none;
}


.hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
}

.hero__inner {
  position: relative;
  z-index: 2;
}

.hero__text {
  max-width: 640px;
}

.hero__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--accent);
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
}

.hero__headline {
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.hero__sub {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 2.5rem;
  line-height: 1.75;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
}


.hero__cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero__scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-muted);
  font-size: 1.3rem;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(8px); }
}

/* ─── About ──────────────────────────────────────────────────────────────────── */

.about {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.about__inner {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 4rem;
  align-items: center;
}

.about__text p {
  color: var(--text-muted);
  margin-bottom: 1.2rem;
  max-width: 580px;
}

.about__text .section__title {
  margin-bottom: 1.5rem;
}

.about__skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 2rem;
}

.about__skills li {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(245, 158, 11, 0.25);
  padding: 0.3rem 0.75rem;
  border-radius: 4px;
}

.about__photo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.about__photo {
  width: 100%;
  border-radius: var(--radius);
  display: block;
  object-fit: cover;
}

.about__photo--small {
  width: 100%;
  margin-top: 1.5rem;
}

.about__photo-credit {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

.about__photo-credit a {
  color: var(--text-muted);
  text-decoration: underline;
}

/* ─── Projects ───────────────────────────────────────────────────────────────── */

.projects__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: border-color var(--transition), transform var(--transition), background var(--transition);
}

.card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  background: var(--bg-card-hover);
}

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

.card__tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(245, 158, 11, 0.25);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  letter-spacing: 0.03em;
}

.card__links {
  display: flex;
  gap: 0.75rem;
}

.card__links a {
  color: var(--text-muted);
  transition: color var(--transition);
  display: flex;
  align-items: center;
}

.card__links a:hover {
  color: var(--accent);
}

.card__title {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card__desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  flex: 1;
  line-height: 1.65;
}

.card__tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.card__tech li {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.card__tech li:not(:last-child)::after {
  content: '·';
  margin-left: 0.5rem;
}

/* ─── Contact ────────────────────────────────────────────────────────────────── */

.contact {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  text-align: center;
}

.contact__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.contact__lead {
  color: var(--text-muted);
  max-width: 500px;
  font-size: 1.05rem;
}

.contact__links {
  display: flex;
  gap: 2rem;
  margin-top: 0.5rem;
}

.contact__links a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color var(--transition);
}

.contact__links a:hover {
  color: var(--accent);
}

/* ─── Home About Snapshot ────────────────────────────────────────────────────── */

.home-about {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.home-about__label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

/* ─── Expertise ──────────────────────────────────────────────────────────────── */

.expertise__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.expertise__card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color var(--transition), transform var(--transition);
}

.expertise__card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}

.expertise__icon {
  color: var(--accent);
  display: flex;
}

.expertise__card h3 {
  font-size: 1rem;
  font-weight: 600;
}

.expertise__card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ─── Home Projects ──────────────────────────────────────────────────────────── */

.home-projects {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.home-projects__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.home-projects__header .section__title {
  margin-bottom: 0;
}

/* ─── Home CTA ───────────────────────────────────────────────────────────────── */

.home-cta {
  text-align: center;
}

.home-cta__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.home-cta__title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.home-cta__sub {
  color: var(--text-muted);
  max-width: 480px;
  font-size: 1.05rem;
  line-height: 1.7;
}

/* ─── Nav active state & logo ────────────────────────────────────────────────── */

.nav__logo {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  transition: color var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav__logo:hover {
  color: var(--accent);
}

.nav__active {
  color: var(--accent) !important;
}

/* ─── Page Header ────────────────────────────────────────────────────────────── */

.page-header {
  padding-top: calc(var(--nav-h) + 3rem);
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
}

.page-header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.page-header__title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.page-header__sub {
  color: var(--text-muted);
  margin-top: 0.4rem;
  font-size: 1rem;
}

/* ─── About subheading ───────────────────────────────────────────────────────── */

.about__subheading {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

/* ─── Contact cards ──────────────────────────────────────────────────────────── */

.contact__cards {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: nowrap;
}

.contact__card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.5rem;
  flex: 0 0 auto;
  min-width: max-content;
  text-align: center;
}

.contact__card h3 {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.contact__card p,
.contact__card a {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.contact__card a:hover {
  color: var(--accent);
}

/* ─── Resume ─────────────────────────────────────────────────────────────────── */

.resume__inner {
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
}

.resume__block {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.resume__section-title {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.resume__entry {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.resume__entry-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.resume__entry-title {
  font-size: 1rem;
  font-weight: 600;
}

.resume__entry-sub {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.resume__entry-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.resume__entry-list {
  list-style: disc;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.resume__entry-list li {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.resume__placeholder {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  opacity: 0.7;
}

.resume__skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4rem;
}

.resume__skill-group h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.75rem;
}

/* ─── Footer ─────────────────────────────────────────────────────────────────── */

.footer {
  padding-block: 2rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
}

/* ─── Responsive ─────────────────────────────────────────────────────────────── */

/* ─── Tablet (≤ 768px) ───────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .section { padding-block: 60px; }

  /* Nav */
  .nav__links { gap: 1.25rem; }

  /* Hero */
  .hero { min-height: 55vh; }
  .hero__text { max-width: 100%; }

  /* About */
  .about__inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .about__photo { width: 100%; max-width: 480px; margin: 0 auto; }

  /* Projects */
  .projects__grid { grid-template-columns: 1fr; }

  /* Home sections */
  .home-projects__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  /* Resume */
  .resume__entry-header {
    flex-direction: column;
    gap: 0.25rem;
  }
  .resume__skills-grid { grid-template-columns: 1fr 1fr; }

  /* Page header */
  .page-header__row {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Contact cards */
  .contact__cards { flex-wrap: wrap; }
  .contact__card { flex: 1 1 calc(33% - 1rem); }
}

/* ─── Mobile (≤ 600px) ───────────────────────────────────────────────────────── */

@media (max-width: 600px) {
  /* Nav: shrink logo to icon-only so links fit on one row */
  .nav__logo {
    font-size: 0;
    gap: 0;
  }
  .nav__logo svg { width: 22px; height: 22px; }
  .nav__links { gap: 1rem; font-size: 0.85rem; }
}

/* ─── Small mobile (≤ 480px) ─────────────────────────────────────────────────── */

@media (max-width: 480px) {
  .section { padding-block: 48px; }

  /* Nav: stack logo above links */
  .nav__inner { flex-direction: column; gap: 0.5rem; height: auto; padding-block: 0.75rem; }
  .nav__logo { font-size: 0.95rem; gap: 0.4rem; }
  .nav__logo svg { width: 16px; height: 16px; }
  .nav__links { gap: 0.9rem; font-size: 0.82rem; }

  /* Bump nav height to accommodate two rows */
  .nav { height: auto; }
  html { scroll-padding-top: 100px; }

  /* Hero */
  .hero { padding-top: 100px; min-height: auto; padding-block: 3rem; }
  .hero__headline { font-size: clamp(1.8rem, 8vw, 2.6rem); }
  .hero__cta { flex-direction: column; }
  .btn { width: 100%; justify-content: center; }

  /* Resume */
  .resume__skills-grid { grid-template-columns: 1fr; }

  /* Contact */
  .contact__links { flex-direction: column; gap: 1rem; }

  /* Expertise grid: 1 col */
  .expertise__grid { grid-template-columns: 1fr; }
}
