:root {
  --bg: #ffffff;
  --fg: #0a0a0a;
  --muted: #6b6b6b;
  --border: #e6e6e6;
  --card: #ffffff;
  --secondary: #f4f4f4;
  --secondary-fg: #0a0a0a;
  --primary: #0a0a0a;
  --primary-fg: #ffffff;
  --accent: #d97706;
  --shadow-card: 0 1px 2px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.04);
  --radius: 12px;
}
.dark {
  --bg: #0b0b0d;
  --fg: #f4f4f5;
  --muted: #9aa0a6;
  --border: #232327;
  --card: #141417;
  --secondary: #1b1b1f;
  --secondary-fg: #f4f4f5;
  --primary: #f4f4f5;
  --primary-fg: #0a0a0a;
  --accent: #fbbf24;
  --shadow-card: 0 1px 2px rgba(0,0,0,0.4), 0 8px 24px rgba(0,0,0,0.35);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s ease, color .3s ease;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
em { font-family: 'Instrument Serif', serif; font-style: italic; color: var(--muted); font-weight: 400; }
.page { position: relative; min-height: 100vh; }
.container { position: relative; max-width: 56rem; margin: 0 auto; padding: 2.5rem 1.5rem; }
@media (min-width: 640px) { .container { padding: 3.5rem 2rem; } }

.grid-bg {
  position: absolute; inset: 0 0 auto 0; height: 520px;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.4), transparent);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.4), transparent);
  pointer-events: none;
}

/* nav */
.nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5rem; }
.brand { display: inline-flex; align-items: center; gap: .5rem; font-family: 'Instrument Serif', serif; font-size: 1.125rem; font-weight: 600; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 1.75rem; height: 1.75rem; border-radius: 6px; background: var(--primary); color: var(--primary-fg); font-family: 'JetBrains Mono', monospace; font-size: .75rem; }
.nav-links { display: none; align-items: center; gap: 1.75rem; font-size: .875rem; color: var(--muted); }
@media (min-width: 640px) { .nav-links { display: flex; } }
.nav-links a { transition: color .2s; }
.nav-links a:hover { color: var(--fg); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; padding: .375rem; border-radius: 999px; border: 1px solid var(--border); background: var(--card); color: var(--muted); cursor: pointer; transition: color .2s; }
.icon-btn:hover { color: var(--fg); }
.icon { width: 1rem; height: 1rem; }
.icon-sm { width: 1rem; height: 1rem; }
.hidden { display: none; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: .5rem; padding: .625rem 1.25rem; border-radius: 999px; font-size: .875rem; font-weight: 500; transition: all .2s; cursor: pointer; border: 1px solid transparent; }
.btn-sm { padding: .375rem .875rem; font-size: .75rem; }
.btn-primary { background: var(--primary); color: var(--primary-fg); }
.btn-primary:hover { opacity: .85; }
.btn-outline { background: var(--card); color: var(--fg); border-color: var(--border); }
.btn-outline:hover { background: var(--secondary); }

/* hero */
.hero { display: grid; gap: 2.5rem; margin-bottom: 7rem; }
@media (min-width: 640px) { .hero { grid-template-columns: 3fr 2fr; align-items: center; } }
.status-chip { display: inline-flex; align-items: center; gap: .5rem; padding: .25rem .75rem; border-radius: 999px; border: 1px solid var(--border); background: var(--card); font-size: .75rem; color: var(--muted); margin-bottom: 1.5rem; }
.pulse { position: relative; display: inline-flex; width: .375rem; height: .375rem; }
.pulse span { position: absolute; inset: 0; border-radius: 999px; background: #10b981; }
.pulse span:first-child { animation: ping 1.5s cubic-bezier(0,0,0.2,1) infinite; opacity: .6; }
@keyframes ping { 75%, 100% { transform: scale(2); opacity: 0; } }
h1 { font-family: 'Instrument Serif', serif; font-size: 2.5rem; line-height: 1.05; font-weight: 500; letter-spacing: -0.02em; margin: 0; }
@media (min-width: 640px) { h1 { font-size: 3rem; } }
.lead { max-width: 36rem; margin: 1.5rem 0 0; color: var(--muted); font-size: 1rem; line-height: 1.65; }
.cta-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.hero-photo .photo-frame { position: relative; aspect-ratio: 3/4; width: 100%; max-width: 260px; margin: 0 auto; border-radius: 1rem; overflow: hidden; border: 1px solid var(--border); background: var(--card); box-shadow: var(--shadow-card); }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* sections */
.section { margin-bottom: 7rem; }
.eyebrow { font-family: 'JetBrains Mono', monospace; font-size: .75rem; text-transform: uppercase; letter-spacing: 0.18em; color: var(--muted); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 2rem; }
h2 { font-family: 'Instrument Serif', serif; font-size: 1.875rem; font-weight: 500; margin: 0; }
h2.big { line-height: 1.15; }

.chip-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.25rem; }
.chip { display: inline-flex; align-items: center; gap: .5rem; padding: .35rem .75rem; border-radius: 8px; border: 1px solid var(--border); background: var(--card); font-size: .75rem; font-weight: 500; color: rgba(0,0,0,0.8); transition: border-color .2s, transform .15s; }
.chip:hover { border-color: rgba(0,0,0,0.2); transform: translateY(-1px); }
.dark .chip { color: rgba(255,255,255,0.8); }
.dark .chip:hover { border-color: rgba(255,255,255,0.2); }
.chip-logo { width: 18px; height: 18px; object-fit: contain; flex-shrink: 0; }
.dark .chip-logo[src*="nextjs"] { filter: invert(1); }
.dark .chip-logo[src*="github"] { filter: invert(1); }

/* projects */
.grid-2 { display: grid; gap: 1rem; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.card { display: flex; flex-direction: column; justify-content: space-between; padding: 1.5rem; border-radius: var(--radius); border: 1px solid var(--border); background: var(--card); box-shadow: var(--shadow-card); transition: transform .25s ease, border-color .25s ease; }
.card:hover { transform: translateY(-2px); border-color: rgba(0,0,0,0.2); }
.dark .card:hover { border-color: rgba(255,255,255,0.2); }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem; }
.card-tag { font-family: 'JetBrains Mono', monospace; font-size: .75rem; color: var(--muted); }
.card h3 { font-family: 'Instrument Serif', serif; font-size: 1.25rem; font-weight: 500; line-height: 1.3; margin: 0; }
.card p { font-size: .875rem; line-height: 1.6; color: var(--muted); margin: .5rem 0 0; }
.card-stack { display: flex; flex-wrap: wrap; gap: .375rem; margin-top: 1.25rem; }
.stack-pill { padding: .125rem .5rem; border-radius: 6px; background: var(--secondary); color: var(--secondary-fg); font-size: 11px; font-family: 'JetBrains Mono', monospace; }

/* about */
.about { display: grid; gap: 3rem; }
@media (min-width: 640px) { .about { grid-template-columns: 2fr 3fr; } }
.about-right { display: flex; flex-direction: column; gap: 1rem; font-size: .875rem; line-height: 1.65; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; padding-top: .5rem; }
.stat-card { border-radius: var(--radius); border: 1px solid var(--border); background: var(--card); padding: 1rem; }
.stat-n { font-family: 'Instrument Serif', serif; font-size: 1.5rem; font-weight: 500; color: var(--fg); }
.stat-l { margin-top: .25rem; font-size: .75rem; color: var(--muted); }

/* quote */
.quote { margin: 0; padding: 2rem; border-radius: 1rem; border: 1px solid var(--border); background: var(--card); box-shadow: var(--shadow-card); }
@media (min-width: 640px) { .quote { padding: 2.5rem; } }
.quote svg { color: var(--accent); }
.quote blockquote { margin: 1rem 0 0; font-family: 'Instrument Serif', serif; font-size: 1.5rem; line-height: 1.3; font-weight: 500; }
.quote figcaption { margin-top: 1.25rem; font-size: .875rem; color: var(--muted); }
.strong { color: var(--fg); font-weight: 500; }

/* contact */
.contact { margin-bottom: 4rem; border-radius: 1rem; border: 1px solid var(--border); background: color-mix(in srgb, var(--secondary) 60%, transparent); padding: 2rem; }
@media (min-width: 640px) { .contact { padding: 3rem; } }
.contact-inner { max-width: 36rem; }
.contact h2 { margin-top: .25rem; }
.contact p { margin-top: .75rem; font-size: .875rem; line-height: 1.65; color: var(--muted); }
.location { display: inline-flex; align-items: center; gap: .5rem; margin-top: 1.25rem; font-size: .875rem; color: var(--muted); }
.contact-links { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.5rem; }

/* footer */
.footer { display: flex; flex-direction: column; gap: .75rem; align-items: flex-start; justify-content: space-between; padding-top: 1.5rem; border-top: 1px solid var(--border); font-size: .75rem; color: var(--muted); }
@media (min-width: 640px) { .footer { flex-direction: row; align-items: center; } }
.mono { font-family: 'JetBrains Mono', monospace; }

/* animation */
.float-up { opacity: 0; transform: translateY(8px); animation: floatUp .6s ease forwards; }
@keyframes floatUp { to { opacity: 1; transform: translateY(0); } }
