/* Base theme tokens */
:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --text: #0a0a0a;
  --muted: #6b7280; /* gray-500 */
  --border: #e5e7eb; /* gray-200 */
  --surface: #f8fafc; /* slate-50 */
  --accent: #111827; /* gray-900 */
  --accent-contrast: #ffffff;
  --ring: 32, 32, 32; /* rgb for focus ring */
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 24px rgba(0,0,0,.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0c0e;
    --text: #e6e7eb;
    --muted: #9aa0aa;
    --border: #1b1f24;
    --surface: #0f1115;
    --accent: #e6e7eb;
    --accent-contrast: #0b0c0e;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
    --ring: 230, 231, 235;
  }
}

/* Manual override via data-theme on <html> */
html[data-theme="light"] {
  --bg: #ffffff;
  --text: #0a0a0a;
  --muted: #6b7280;
  --border: #e5e7eb;
  --surface: #f8fafc;
  --accent: #111827;
  --accent-contrast: #ffffff;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 24px rgba(0,0,0,.06);
  --ring: 32, 32, 32;
}
html[data-theme="dark"] {
  --bg: #0b0c0e;
  --text: #e6e7eb;
  --muted: #9aa0aa;
  --border: #1b1f24;
  --surface: #0f1115;
  --accent: #e6e7eb;
  --accent-contrast: #0b0c0e;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
  --ring: 230, 231, 235;
}

/* Reset / base */
*,
*::before,
*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Noto Sans, Ubuntu, Cantarell, Helvetica Neue, Arial, "Apple Color Emoji","Segoe UI Emoji";
  line-height: 1.6;
  letter-spacing: 0.2px;
}
img, svg, video, canvas { max-width: 100%; height: auto; }
:focus-visible {
  outline: 2px solid rgba(var(--ring), .6);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Typography */
h1, h2, h3 {
  line-height: 1.15;
  margin: 0 0 0.6em 0;
  font-weight: 700;
}
h1 { font-size: clamp(2.2rem, 3.5vw + 1rem, 4rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.4rem, 1.5vw + 1rem, 2rem); }
h3 { font-size: clamp(1.05rem, 1vw + .9rem, 1.35rem); }
p { margin: 0 0 1em 0; color: var(--text); }
.eyebrow { text-transform: uppercase; letter-spacing: .18em; font-size: .78rem; color: var(--muted); margin-bottom: .6rem; }
.subhead { color: var(--muted); font-size: clamp(1rem, .8vw + 1rem, 1.25rem); }

/* Layout helpers */
.container {
  width: min(100% - 2rem, 64rem);
  margin-inline: auto;
}
.section {
  padding: clamp(3rem, 6vw, 5.5rem) 0;
}
.site-main { display: block; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.2) blur(8px);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  color: inherit;
  font-weight: 600;
  letter-spacing: .2px;
}
.brand-mark {
  width: 28px; height: 28px;
  display: inline-grid; place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-size: .9rem;
}
.brand-text { font-size: .98rem; }

.nav-list {
  display: none;
  list-style: none;
  padding: 0; margin: 0;
  gap: 1rem;
}
@media (min-width: 720px) {
  .nav-list { display: flex; }
}
.nav-list a {
  color: var(--muted);
  text-decoration: none;
  padding: .4rem .6rem;
  border-radius: 8px;
}
.nav-list a:hover { color: var(--text); background: var(--surface); }

.icon-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: inherit;
  border-radius: 50%;
  width: 40px; height: 40px;
  display: inline-grid; place-items: center;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.icon { transform: translateY(1px); }

/* Hero */
.hero { padding-top: clamp(3rem, 8vw, 7rem); }
.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}
@media (max-width: 768px) {
  .hero-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .hero-image {
    order: -1;
  }
}
.hero-text {
  display: flex;
  flex-direction: column;
}
.hero-image {
  display: flex;
  justify-content: flex-end;
}
.hero-image img {
  width: 100%;
  max-width: 400px;
  height: auto;
  border-radius: 50%;
  box-shadow: var(--shadow);
  object-fit: cover;
  aspect-ratio: 1;
}
@media (max-width: 768px) {
  .hero-image {
    justify-content: center;
  }
  .hero-image img {
    max-width: 280px;
  }
}
.actions { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.25rem; }
.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  padding: .65rem .9rem;
  border-radius: 999px;
  transition: transform .2s ease, background .2s ease;
}
.btn:hover { background: color-mix(in oklab, var(--surface), var(--bg) 60%); transform: translateY(-1px); }
.btn.primary {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: transparent;
}
.btn.primary:hover { transform: translateY(-1px); filter: brightness(1.05); }

/* About */
.chips {
  display: flex; flex-wrap: wrap; gap: .5rem;
  list-style: none; padding: 0; margin: 1rem 0 0 0;
}
.chips li {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: .38rem .6rem;
  border-radius: 999px;
  font-size: .85rem;
  color: var(--muted);
}

/* Projects grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.card {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, color-mix(in oklab, var(--surface), transparent 10%) 0%, var(--surface) 100%);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: .6rem;
  transition: transform .18s ease, box-shadow .18s ease;
  overflow: hidden;
}
.card p {
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  flex: 1;
}
.card:hover { transform: translateY(-2px); }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
}
.card-github {
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  transition: color .2s ease, transform .2s ease;
  flex-shrink: 0;
}
.card-github:hover {
  color: var(--text);
  transform: translateY(-1px);
}
.card-github svg {
  display: block;
}
.card-footer {
  margin-top: auto;
  padding-top: .5rem;
}
.tags { 
  list-style: none; 
  padding: 0; 
  margin: 0; 
  display: inline-flex; 
  gap: .4rem; 
  flex-wrap: wrap;
}
.tags li {
  font-size: .75rem; 
  color: var(--muted);
  border: 1px dashed var(--border);
  padding: .2rem .5rem; 
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}
.card-actions { margin-top: auto; display: flex; gap: .8rem; }
.link {
  color: var(--text);
  text-underline-offset: 3px;
}
.link:hover { text-decoration: underline; }

/* Experience */
.timeline {
  list-style: none; padding: 0; margin: 1rem 0 0 0;
  display: grid; gap: 1rem;
}
.timeline li {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1rem;
  align-items: start;
}
@media (max-width: 640px) {
  .timeline li { grid-template-columns: 1fr; }
}
.time { color: var(--muted); font-size: .95rem; padding-top: .2rem; }
.item h3 { margin: 0 0 .25rem 0; }
.item .company { color: var(--muted); font-size: .9rem; margin: 0 0 .5rem 0; font-weight: 500; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  color: var(--muted);
}

/* A11y / misc */
.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  width: 1px; height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  left: 1rem; top: 1rem; width: auto; height: auto;
  background: var(--accent);
  color: var(--accent-contrast);
  padding: .5rem .75rem; border-radius: 8px;
  z-index: 100;
}
.icon-link {
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: .5rem .7rem;
  border-radius: 999px;
}
.icon-link:hover { color: var(--text); }

/* Reveal on scroll */
@media (prefers-reduced-motion: no-preference) {
  .section-reveal { opacity: 0; transform: translateY(12px); transition: opacity .6s ease, transform .6s ease; }
  .section-reveal.revealed { opacity: 1; transform: none; }
}




