/* ─────────────────────────────────────────
   Custom Properties
───────────────────────────────────────── */
:root {
  --bg:           #ffffff;
  --bg-alt:       #f8fafc;
  --text:         #0f172a;
  --text-muted:   #64748b;
  --accent:       #2563eb;
  --accent-hover: #1d4ed8;
  --accent-subtle:#eff6ff;
  --border:       #e2e8f0;
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:    0 4px 12px rgba(0,0,0,0.10), 0 2px 6px rgba(0,0,0,0.06);

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  --nav-h:     64px;
  --max-w:     900px;
  --section-y: 56px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

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

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font: inherit; }

/* ─────────────────────────────────────────
   Layout
───────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ─────────────────────────────────────────
   Nav
───────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  z-index: 100;
  transition: border-color 0.3s;
}

.nav.scrolled {
  border-bottom-color: var(--border);
}

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

.nav-logo {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.02em;
}

.nav-logo .cursor {
  color: var(--accent);
  animation: blink 1.2s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-link {
  font-family: var(--font-mono);
  font-size: 0.83rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s;
}

/* ─────────────────────────────────────────
   Hero
───────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-top: var(--nav-h);
}

.hero-inner {
  position: relative;
  z-index: 1;
  padding-top: 40px;
  padding-bottom: 56px;
}

.hero-tag {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--accent);
  margin-bottom: 20px;
  letter-spacing: 0.02em;
}

.hero-name {
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.08;
  color: var(--text);
  margin-bottom: 18px;
}

.hero-sub {
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  color: var(--text-muted);
  font-weight: 400;
  margin-bottom: 14px;
}

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

.hero-location {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 40px;
}

.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  animation: pulse 2.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0   rgba(37, 99, 235, 0.45); }
  50%       { box-shadow: 0 0 0 8px rgba(37, 99, 235, 0);    }
}

.hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Dot-grid background */
.hero-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, #cbd5e1 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.55;
  mask-image: radial-gradient(ellipse 90% 85% at 60% 50%, black 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 85% at 60% 50%, black 20%, transparent 75%);
}

/* ─────────────────────────────────────────
   Buttons
───────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
  cursor: pointer;
  white-space: nowrap;
}

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

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

/* ─────────────────────────────────────────
   Sections
───────────────────────────────────────── */
.section {
  padding: var(--section-y) 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-title {
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin-bottom: 36px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.section-prefix {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--accent);
  font-weight: 500;
}

.section-desc {
  color: var(--text-muted);
  max-width: 560px;
  margin-bottom: 32px;
  font-size: 1.05rem;
  line-height: 1.75;
}

/* ─────────────────────────────────────────
   About
───────────────────────────────────────── */
.about-text p {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 16px;
}

.about-text p:last-child {
  margin-bottom: 0;
}

.about-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ─────────────────────────────────────────
   Headshot
───────────────────────────────────────── */
.about-body {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 40px;
  align-items: start;
}

.about-headshot {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 3px solid var(--border);
  display: block;
}

.about-right {
  display: grid;
  gap: 24px;
}

/* ─────────────────────────────────────────
   Chips / Tags
───────────────────────────────────────── */
.chip {
  display: inline-block;
  padding: 5px 13px;
  border-radius: 20px;
  background: var(--accent-subtle);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  border: 1px solid rgba(37, 99, 235, 0.18);
  white-space: nowrap;
}

.chip.small {
  font-size: 0.71rem;
  padding: 3px 9px;
}

/* ─────────────────────────────────────────
   Projects
───────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}

.project-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  transition: box-shadow 0.2s, transform 0.2s;
  box-shadow: var(--shadow-sm);
}

.project-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.project-card-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.project-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--accent-subtle);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.project-title {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.project-desc {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.72;
  margin-bottom: 16px;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--accent);
  transition: gap 0.2s;
}

.project-link:hover {
  gap: 9px;
}

/* ─────────────────────────────────────────
   Contact
───────────────────────────────────────── */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  box-shadow: var(--shadow-sm);
}

.contact-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.contact-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--accent-subtle);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin-bottom: 3px;
}

.contact-value {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}

/* ─────────────────────────────────────────
   Footer
───────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
}

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

.footer-copy {
  font-size: 0.85rem;
  color: var(--text-muted);
}

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

/* ─────────────────────────────────────────
   Responsive — mobile
───────────────────────────────────────── */
@media (max-width: 640px) {
  :root {
    --section-y: 40px;
  }

  /* Mobile nav drawer */
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    flex-direction: column;
    padding: 16px 24px 24px;
    border-bottom: 1px solid var(--border);
    gap: 4px;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-link {
    padding: 10px 0;
    font-size: 0.95rem;
  }

  .nav-toggle {
    display: flex;
  }

  .about-body {
    grid-template-columns: 1fr;
  }

  .about-headshot {
    width: 120px;
    height: 120px;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}
