:root {
  /* Dark theme (default) */
  --bg: #0e0f12;
  --fg: #eaeaf0;
  --muted: #a6a8b1;
  --accent: #f0a15b; /* warm, restrained highlight */
  --card: #15171c;
  --ring: rgba(240, 161, 91, 0.35);
  --radius: 16px;
  
  /* Theme transition */
  --transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Light theme */
[data-theme="light"] {
  --bg: #ffffff;
  --fg: #1a1b1e;
  --muted: #6b7280;
  --accent: #d97706; /* adjusted for better light mode contrast */
  --card: #f8fafc;
  --ring: rgba(217, 119, 6, 0.35);
}

/* System preference detection */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #ffffff;
    --fg: #1a1b1e;
    --muted: #6b7280;
    --accent: #d97706;
    --card: #f8fafc;
    --ring: rgba(217, 119, 6, 0.35);
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.55 system-ui, -apple-system, Segoe UI, Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: var(--transition);
}

.wrap { width: min(1100px, 92vw); margin: 0 auto; }

.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.2rem 0;
}

.theme-toggle {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.theme-toggle:hover {
  color: var(--fg);
  background: var(--card);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}
.brand {
  font-weight: 700; letter-spacing: 0.2px; text-decoration: none; color: var(--fg);
  transition: var(--transition);
}
.links a {
  color: var(--muted); text-decoration: none; margin-left: 1rem;
  transition: var(--transition);
}
.links a:hover { color: var(--fg); }

.hero {
  padding: 3rem 0 2rem;
}
h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.1; margin: 0 0 0.5rem;
}
h2 {
  font-size: clamp(1.3rem, 3vw, 1.6rem);
  margin: 2.2rem 0 0.6rem;
}
p { margin: 0.5rem 0 0.75rem; }
.muted { color: var(--muted); }

.section { padding: 0.2rem 0 0.8rem; }

.gallery {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.gallery button {
  appearance: none; border: 0; background: transparent; padding: 0; cursor: zoom-in;
  border-radius: var(--radius); overflow: hidden; position: relative;
}
.gallery img {
  width: 100%; height: 220px; object-fit: cover; display: block;
  transform: scale(1.001); transition: transform .25s ease;
}
.gallery button:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}
.gallery button:hover img { transform: scale(1.03); }
.gallery .caption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 10px;
  color: #fff; font-size: 0.9rem; background: linear-gradient(180deg, transparent, rgba(0,0,0,.55));
}

.footer { padding: 3rem 0 4rem; color: var(--muted); }

/* Lightbox */
.lightbox {
  width: min(100vw, 1024px);
  max-height: 90vh;
  border: 0; padding: 0; border-radius: var(--radius);
  background: var(--card);
  color: var(--fg);
  box-shadow: 0 10px 40px rgba(0,0,0,.6);
  transition: var(--transition);
}
.lightbox::backdrop {
  background: rgba(0,0,0,.65);
}
.lightbox img {
  width: 100%;
  max-height: 75vh;
  object-fit: contain;
  background: #000;
}
.lightbox .caption {
  margin: 0; padding: 10px 14px; color: var(--muted);
  transition: var(--transition);
}
.close, .navbtn {
  position: absolute;
  top: 10px; width: 40px; height: 40px;
  border-radius: 999px; border: 0; cursor: pointer;
  background: rgba(20, 22, 27, .75); color: var(--fg);
  font-size: 1.4rem; line-height: 1; display: grid; place-items: center;
  transition: transform .15s ease, background .2s ease;
}
.close { right: 10px; }
.navbtn { top: 50%; transform: translateY(-50%); }
#prev { left: 10px; } #next { right: 60px; }
.close:hover, .navbtn:hover { background: rgba(20,22,27,.95); transform: translateY(-50%) scale(1.03); }
.close:hover { transform: none; }