/* Portfolio site styles: mobile-first, system fonts, no external requests. */
:root {
  --bg: #ffffff;
  --surface: #f6f7f9;
  --text: #0f172a;
  --muted: #5b6475;
  --border: #e3e6eb;
  --accent: #2563eb;
  --accent-text: #ffffff;
  --radius: 14px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120;
    --surface: #131b2e;
    --text: #e6eaf2;
    --muted: #9aa4b8;
    --border: #233049;
    --accent: #60a5fa;
    --accent-text: #0b1120;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: clamp(1.8rem, 6vw, 2.6rem); }
h2 { font-size: 1.4rem; margin-bottom: 1rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 .75rem; }
.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }

.topbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar .wrap { display: flex; align-items: center; gap: 1rem; min-height: 56px; }
.brand { font-weight: 700; color: var(--text); text-decoration: none; white-space: nowrap; }
.topbar nav { display: flex; gap: 1rem; overflow-x: auto; margin-left: auto; scrollbar-width: none; }
.topbar nav::-webkit-scrollbar { display: none; }
.topbar nav a { color: var(--muted); text-decoration: none; font-size: .95rem; padding: .5rem 0; white-space: nowrap; }
.topbar nav a:hover { color: var(--text); }

.hero { display: grid; gap: 1.25rem; padding: 2.5rem 0 1.5rem; }
.avatar { width: 128px; height: 128px; border-radius: 50%; object-fit: cover; border: 3px solid var(--surface); }
.avatar-fallback { display: grid; place-items: center; background: var(--surface); color: var(--muted); font-size: 2.4rem; font-weight: 700; }
.role { font-size: 1.15rem; font-weight: 600; color: var(--accent); margin-bottom: .25rem; }
.intro { font-size: 1.1rem; max-width: 60ch; margin-top: .75rem; }

.section { padding: 2rem 0; border-top: 1px solid var(--border); }
.section > p { max-width: 70ch; }

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

.projects { display: grid; gap: 1rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.card-media img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.card-body { padding: 1rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.card-body p { margin: 0; }
.card-links { display: flex; gap: 1rem; margin-top: auto !important; padding-top: .25rem; font-weight: 600; }

.gallery { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; }
.gallery li { display: flex; flex-direction: column; gap: .25rem; }
.gallery-item { display: block; border-radius: 10px; overflow: hidden; background: var(--surface); }
.gallery-item img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.caption { font-size: .85rem; color: var(--muted); }

.contact { display: flex; flex-wrap: wrap; gap: .75rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  padding: .6rem 1.1rem; border-radius: 10px; font-weight: 600; text-decoration: none;
  background: var(--accent); color: var(--accent-text); border: 1px solid var(--accent);
  overflow-wrap: anywhere;
}
.btn-outline { background: transparent; color: var(--accent); }

.footer { border-top: 1px solid var(--border); padding: 1.5rem 0; color: var(--muted); font-size: .9rem; margin-top: 2rem; }

dialog#lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; }
dialog#lightbox::backdrop { background: rgba(0, 0, 0, .88); }
dialog#lightbox img { max-width: 96vw; max-height: 84vh; width: auto; margin: 0 auto; border-radius: 6px; }
.lightbox-caption { color: #fff; text-align: center; margin: .5rem 0 0; }
.lightbox-close { position: fixed; top: 8px; right: 12px; font-size: 2.2rem; line-height: 1; background: none; border: 0; color: #fff; cursor: pointer; width: 48px; height: 48px; }

@media (min-width: 720px) {
  .hero { grid-template-columns: auto 1fr; align-items: center; gap: 2rem; padding: 4rem 0 2.5rem; }
  .avatar { width: 160px; height: 160px; }
  .projects { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
  .gallery { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .75rem; }
}
