/* Rojas Photography: dark, matching reyrojas.com */
:root {
  --bg: #0b0b0c;
  --bg-2: #151517;        /* photo placeholders */
  --ink: #ededee;
  --muted: #8b8b92;
  --line: rgba(255, 255, 255, .09);
  --accent: #ff7a59;      /* warm, same as the Photography link on reyrojas.com */
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --row: 260px;           /* height the photo rows aim for */
  --radius: 10px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
:root { padding-block: env(safe-area-inset-top, 0px) env(safe-area-inset-bottom, 0px); }
body {
  background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 1rem; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* a faint light from the top left, so the black isn't flat */
  background-image: radial-gradient(1200px 700px at 12% -10%, rgba(255, 255, 255, .05), transparent 60%);
  background-repeat: no-repeat;
}
img { max-width: 100%; display: block; height: auto; }
a { color: inherit; text-decoration: none; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 4px; }
h1, h2 { font-weight: 500; line-height: 1; text-wrap: balance; margin: 0; }
p { margin: 0; }
[hidden] { display: none !important; }

.wrap {
  max-width: 1480px; margin-inline: auto;
  padding-left: max(24px, env(safe-area-inset-left, 0px));
  padding-right: max(24px, env(safe-area-inset-right, 0px));
}
.label, .eyebrow { font-family: var(--mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* Header */
.site-head { padding-block: 24px; }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px 32px; flex-wrap: wrap; }
.wordmark { font-weight: 500; font-size: 1.05rem; letter-spacing: -.01em; white-space: nowrap; }
.wordmark span { color: var(--muted); font-weight: 400; }
/* the logo: the tile mark from reyrojas.com (orange lens top right), sized like the one on rojasconsulting.co */
.wordmark .mark { display: inline-block; height: 1.09em; width: auto; vertical-align: -.2em; margin-right: .36em; }
.wordmark .mark rect { fill: var(--ink); }
.wordmark .mark .lens { fill: var(--accent); }
.nav { display: flex; gap: 4px; font-size: .92rem; }
.nav a { color: var(--muted); padding: 6px 14px; border-radius: 999px; border: 1px solid transparent; transition: color 150ms ease, border-color 150ms ease, background-color 150ms ease; }
.nav a[aria-current="page"] { color: var(--ink); border-color: var(--line); background: rgba(255, 255, 255, .04); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 10px; font: 500 .92rem var(--sans); padding: 10px 18px; border-radius: 999px; background: var(--ink); color: var(--bg); cursor: pointer; transition: transform 160ms var(--ease-out), background-color 150ms ease; }
.btn .size { font-family: var(--mono); font-size: .72rem; opacity: .6; }

/* Album list */
.intro { padding-block: clamp(32px, 7vh, 88px) clamp(36px, 6vh, 64px); }
.intro .wrap { display: grid; gap: 18px; }
.intro h1 { font-size: clamp(2.75rem, 1.6rem + 5vw, 6rem); letter-spacing: -.045em; line-height: .95; }
.intro .lede { font-size: 1.05rem; color: var(--muted); max-width: 46ch; text-wrap: pretty; }
.album-list { padding-block: 0 96px; }
.albums { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 44px 20px; }
.album-card { display: grid; gap: 14px; align-content: start; transition: transform 160ms var(--ease-out); }
.album-card .cover { display: block; border-radius: var(--radius); overflow: hidden; background: var(--bg-2); }
.album-card img { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; transition: transform 500ms var(--ease-out), opacity 400ms ease; }
.card-text { display: grid; gap: 6px; }
.album-card h2 { font-size: 1.3rem; letter-spacing: -.02em; line-height: 1.2; transition: color 200ms ease; }
.empty { color: var(--muted); border-top: 1px solid var(--line); padding-top: 20px; }

/* One album */
.album-head { padding-block: clamp(16px, 4vh, 48px) 32px; }
.album-head .wrap { display: grid; gap: 16px; }
.back { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); justify-self: start; padding-block: 6px; transition: color 150ms ease; }
.back svg { width: 14px; height: 14px; }
.album-head h1 { font-size: clamp(2.25rem, 1.4rem + 3.6vw, 4.5rem); letter-spacing: -.04em; }
.album-meta { display: flex; align-items: center; gap: 12px 24px; flex-wrap: wrap; padding-top: 4px; }
.album-photos { padding-block: 0 96px; }

/* Photos in justified rows, kept in order: each tile grows in proportion to its
   shape, so every row fills the width and photos are barely cropped. */
.tiles { display: flex; flex-wrap: wrap; gap: 8px; }
.tiles::after { content: ""; flex-grow: 999999; }   /* stops the last row from stretching */
.tile { flex: var(--r) 1 calc(var(--r) * var(--row)); display: block; background: var(--bg-2); border-radius: 6px; overflow: hidden; cursor: zoom-in; transition: transform 160ms var(--ease-out); }
.tile img { width: 100%; height: 100%; aspect-ratio: var(--r); object-fit: cover; transition: opacity 400ms ease; }

.site-foot { border-top: 1px solid var(--line); padding-block: 28px; }
.site-foot .wrap { display: flex; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.site-foot a { transition: color 150ms ease; }

/* Photo viewer */
dialog.lb { border: 0; padding: 0; margin: 0; width: 100%; height: 100%; max-width: none; max-height: none; background: rgba(5, 5, 6, .985); color: var(--ink); }
dialog.lb { opacity: 1; transition: opacity 200ms ease; overscroll-behavior: contain; }
dialog.lb.closing { opacity: 0; transition-duration: 160ms; }
@starting-style { dialog.lb[open] { opacity: 0; } }
dialog.lb::backdrop { background: transparent; }
.lb-inner { height: 100%; display: grid; grid-template-rows: auto 1fr; padding: max(14px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(14px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); gap: 10px; }
.lb-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-family: var(--mono); font-size: .75rem; letter-spacing: .08em; color: var(--muted); }
.lb-actions { display: flex; gap: 10px; align-items: center; }
.lb-stage { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 0; touch-action: pan-y pinch-zoom; }
.lb-stage img { max-height: calc(100dvh - 92px); max-width: 100%; margin: auto; object-fit: contain; border-radius: 4px; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; -webkit-touch-callout: none; }
.lb button { background: rgba(255, 255, 255, .04); border: 1px solid var(--line); color: var(--ink); border-radius: 999px; width: 46px; height: 46px; cursor: pointer; display: grid; place-items: center; padding: 0; transition: transform 120ms var(--ease-out), background-color 150ms ease, border-color 150ms ease; }
.lb .dl { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 18px 0 16px; border-radius: 999px; background: var(--ink); color: var(--bg); font: 500 .9rem var(--sans); letter-spacing: 0; transition: transform 120ms var(--ease-out), background-color 150ms ease; }

/* Entrance: once per page, a short rise in reading order (photos just fade in) */
.rise { animation: rise 600ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 60ms); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

@media (max-width: 700px) {
  :root { --row: 92px; }   /* two photos per row on phones */
  .tiles { gap: 4px; }
  .tile { border-radius: 4px; }
  .site-head { padding-block: 18px; }
  .site-head .wrap { flex-wrap: nowrap; }
  .nav a { padding: 6px 12px; }
}
@media (max-width: 430px) {
  .site-head .wrap { column-gap: 12px; }   /* room for "Rojas Photography" beside the menu on most phones */
  .nav a { padding-inline: 10px; }
}
@media (max-width: 370px) {
  .wordmark span { display: none; }   /* only the smallest phones: keeps the menu on the same line */
}
@media (max-width: 520px) {
  .lb-stage { grid-template-columns: minmax(0, 1fr); }
  .lb-stage .prev, .lb-stage .next { display: none; }
}

/* ---- Feel: phones, presses, loading ---- */
a, button { touch-action: manipulation; }
button, .btn, .lb .dl, .nav a { user-select: none; -webkit-user-select: none; }

.btn:active, .lb .dl:active { transform: scale(0.97); }
.album-card:active { transform: scale(0.99); }
.tile:active { transform: scale(0.985); }
.lb button:active { transform: scale(0.94); }

/* Photos fade in over their placeholder as they arrive */
img.fade { opacity: 0; transition: opacity 400ms ease; }
img.fade.loaded { opacity: 1; }

/* Hover effects only for a mouse; on phones they would stick after a tap */
@media (hover: hover) and (pointer: fine) {
  .nav a:hover { color: var(--ink); }
  .back:hover, .site-foot a:hover { color: var(--ink); }
  .btn:hover, .lb .dl:hover { background: var(--accent); }
  .album-card:hover img { transform: scale(1.03); }
  .album-card:hover h2 { color: var(--accent); }
  .tile:hover img { opacity: .85; }
  .lb button:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .2); }
}

/* Reduce motion: keep the fades, drop anything that moves or shrinks */
@media (prefers-reduced-motion: reduce) {
  @keyframes rise { from { opacity: 0; } }
  .btn:active, .lb .dl:active, .album-card:active, .tile:active, .lb button:active { transform: none; }
  .album-card:hover img { transform: none; }
}
