  :root {
    --bg: #eef0f3;
    --ink: #1b2230;
    --muted: #6b7385;
    --accent: #3b5bdb;
    --card: #ffffff;
    --gap: 16px;
    --radius: 14px;
  }
  @media (prefers-color-scheme: dark) {
    :root { --bg: #12151c; --ink: #eef0f5; --muted: #9aa3b5; --accent: #7c93ff; --card: #1c212c; }
  }
  * { box-sizing: border-box; margin: 0; }
  body {
    font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
    background: var(--bg); color: var(--ink);
    line-height: 1.5; -webkit-font-smoothing: antialiased;
  }
  header { max-width: 1200px; margin: 0 auto; padding: 56px 24px 24px; }
  h1 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; }
  header p { color: var(--muted); margin-top: 12px; max-width: 46ch; }

  .filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
  .filters button {
    font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer;
    padding: 9px 18px; border-radius: 999px;
    border: 1.5px solid color-mix(in srgb, var(--ink) 18%, transparent);
    background: transparent; color: var(--ink); transition: .2s;
  }
  .filters button:hover { border-color: var(--accent); color: var(--accent); }
  .filters button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }

  main { max-width: 1200px; margin: 0 auto; padding: 8px 24px 80px; }
  .grid { columns: 4 240px; column-gap: var(--gap); }
  .item {
    break-inside: avoid; margin-bottom: var(--gap); position: relative;
    border-radius: var(--radius); overflow: hidden; background: var(--card);
    cursor: zoom-in; border: 0; padding: 0; display: block; width: 100%;
    box-shadow: 0 1px 2px rgba(20,30,60,.08), 0 8px 24px -12px rgba(20,30,60,.25);
  }
  .item img { display: block; width: 100%; height: auto; transition: transform .5s ease; }
  .item:hover img { transform: scale(1.05); }
  .item .cap {
    position: absolute; inset: auto 0 0 0; padding: 36px 16px 14px; text-align: left;
    background: linear-gradient(transparent, rgba(8,12,24,.75)); color: #fff;
    opacity: 0; transform: translateY(8px); transition: .25s;
  }
  .item:hover .cap, .item:focus-visible .cap { opacity: 1; transform: none; }
  .cap strong { display: block; font-size: .98rem; }
  .cap span { font-size: .8rem; opacity: .8; }
  .item:focus-visible, .filters button:focus-visible, .lb button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
  .item.hide { display: none; }

  /* Lightbox */
.lb {
    top: 100px;
    position: fixed;
    inset: 0;
    z-index: 50;
    display: none;
    background: rgba(6,9,18,.92);
    backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 24px;
}
  .lb.open { display: flex; animation: fade .25s ease; }
  @keyframes fade { from { opacity: 0; } }
  .lb figure { max-width: min(1100px, 100%); text-align: center; }
  .lb img { margin-top:100px; max-width: 100%; max-height: 76vh; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
  .lb figcaption { color: #fff; margin-top: 16px; }
  .lb figcaption small { display: block; color: #aab2c5; margin-top: 2px; }
  .lb button {
    position: absolute; background: rgba(255,255,255,.12); color: #fff; border: 0;
    width: 48px; height: 48px; border-radius: 50%; font-size: 1.4rem; cursor: pointer; transition: .2s;
  }
  .lb button:hover { background: rgba(255,255,255,.28); }
  .lb .close { top: 120px; right: 20px; }
  .lb .prev { left: 20px; top: 50%; }
  .lb .next { right: 20px; top: 50%; }
  @media (max-width: 600px) { .lb .prev, .lb .next { top: auto; bottom: 24px; } .lb .prev { left: 24px; } .lb .next { right: 24px; } }
  @media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
