/* ROBERTO: a light, simple portfolio. Centered name, a small menu, then photos in tight rows. */
@property --r { syntax: "<length>"; inherits: false; initial-value: 0px; }
:root {
  --bg: #ffffff; --ink: #111111; --muted: #7b7b78; --line: #e8e8e5; --ph: #f0f0ee;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --pad: clamp(14px, 2.2vw, 30px); --g: 5px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 300 14px/1.6 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Header: the name, centered, with the menu under it. It stays at the top while you scroll. */
.top { position: sticky; top: 0; z-index: 30; text-align: center; padding: 16px var(--pad) 12px; background: rgba(255, 255, 255, 0.94); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.brand { display: inline-block; font-weight: 500; font-size: 1.5rem; line-height: 1; letter-spacing: 0.34em; padding-left: 0.34em; color: var(--ink); }
.menu { display: flex; gap: clamp(14px, 2.6vw, 34px); margin-top: 13px; overflow-x: auto; scrollbar-width: none; }
.menu::-webkit-scrollbar { display: none; }
.menu a:first-child { margin-left: auto; }
.menu a:last-child { margin-right: auto; }
.menu a { flex: none; font-size: 12.5px; letter-spacing: 0.06em; color: var(--muted); padding: 4px 0; border-bottom: 1px solid transparent; transition: color 0.2s, border-color 0.2s; }
.menu a:hover { color: var(--ink); }
.menu a[aria-current="true"] { color: var(--ink); border-bottom-color: var(--ink); }

/* Gallery: every row is the same height and fills the width, like a contact sheet. */
.gal { padding: 4px var(--pad) 0; min-height: 60vh; }
.row { display: flex; gap: var(--g); margin-bottom: var(--g); }
.tile { flex: none; display: block; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; }
.ph { display: block; overflow: hidden; background: var(--ph); }
.ph img { width: 100%; height: 100%; object-fit: cover; color: transparent; opacity: 0; transition: opacity 0.45s; }
.ph img.in { opacity: 1; }
.tile:hover .ph img.in { opacity: 0.9; }
.cap { display: block; padding: 7px 0 4px; font-size: 12px; letter-spacing: 0.06em; color: var(--muted); }
.crumb { display: flex; justify-content: center; align-items: baseline; gap: 18px; padding: 14px var(--pad) 6px; font-size: 12.5px; letter-spacing: 0.06em; }
.crumb[hidden] { display: none; }
.crumb button { background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; }
.crumb button:hover { color: var(--ink); }
.crumb span { color: var(--ink); }

/* About */
.about { display: grid; grid-template-columns: minmax(0, 250px) minmax(0, 520px); justify-content: center; align-items: start; gap: clamp(24px, 5vw, 64px); margin-top: clamp(40px, 6vw, 80px); padding: clamp(48px, 8vw, 110px) var(--pad); border-top: 1px solid var(--line); scroll-margin-top: 92px; }
.about__img img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; background: var(--ph); }
.about h2 { margin: 0 0 18px; font-weight: 500; font-size: 12.5px; letter-spacing: 0.06em; color: var(--muted); }
.about p { margin: 0 0 1em; color: #55554f; }
.about .lead { font-size: clamp(1.2rem, 2vw, 1.6rem); line-height: 1.4; font-weight: 300; color: var(--ink); letter-spacing: -0.01em; }
.about .small { font-size: 12.5px; letter-spacing: 0.04em; color: var(--muted); }
.foot { text-align: center; color: var(--muted); font-size: 12px; letter-spacing: 0.08em; padding: 18px var(--pad) 34px; }

/* Viewer: white, one photo at a time. */
.lb { border: 0; padding: 0; width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; background: #fff; color: var(--ink); }
.lb[open] { display: grid; grid-template-columns: 76px minmax(0, 1fr) 76px; grid-template-rows: auto minmax(0, 1fr) 24px; animation: fade 0.25s both; }
.lb::backdrop { background: #fff; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.lb__bar { grid-column: 1 / -1; display: flex; gap: 20px; align-items: center; padding: 16px var(--pad); font-size: 12.5px; letter-spacing: 0.06em; color: var(--muted); }
.lb__bar #lbCount { margin-left: auto; }
.lb__btn { background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; transition: color 0.2s; }
.lb__btn:hover { color: var(--ink); }
.lb__bar .lb__btn { font-size: 12.5px; letter-spacing: 0.06em; }
.lb__nav { font-size: 1.6rem; }
.lb__fig { margin: 0; min-width: 0; min-height: 0; display: grid; place-items: center; }
.lb__fig img { max-width: 100%; max-height: calc(100vh - 90px); max-height: calc(100dvh - 90px); width: auto; height: auto; object-fit: contain; }

@media (max-width: 760px) {
  :root { --g: 3px; }
  .brand { font-size: 1.3rem; letter-spacing: 0.28em; padding-left: 0.28em; }
  .menu { gap: 20px; }
  .about { grid-template-columns: 1fr; }
  .about__img { max-width: 240px; }
  .lb[open] { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr) auto; }
  .lb__fig { padding: 0 var(--pad); }
  .lb__nav { position: absolute; bottom: 14px; padding: 8px 18px; background: rgba(255, 255, 255, 0.85); }
  .lb__prev { left: 8px; } .lb__next { right: 8px; }
}
@media (prefers-reduced-motion: reduce) { .lb[open] { animation: none; } .ph img, .menu a { transition: none; } }
