/* Ryohei Yamazaki — portfolio
   One font, white background, no decoration. The photographs are the design. */

:root {
  --ink: #111;
  --muted: #6b6b6b;
  --rule: #e6e6e6;
  --bg: #fff;
  --gutter: 16px;
  --row: 300px;          /* grid row height, desktop */
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; height: auto; }

/* ---------- header ---------- */
.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding: 28px var(--gutter) 20px;
  border-bottom: 1px solid var(--rule);
}
.name {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.site-header nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}
.site-header nav a {
  font-size: 13px;
  letter-spacing: .04em;
  color: var(--muted);
}
.site-header nav a:hover { color: var(--ink); }

/* ---------- content ---------- */
main { padding: 0 var(--gutter) 40px; }

.tagline {
  margin: 28px 0 8px;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: .02em;
}

.gallery { padding: 36px 0 8px; }
.gallery h2,
.text h2 {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.intro {
  margin: 0 0 18px;
  max-width: 60ch;
  font-size: 13px;
  color: var(--muted);
}

/* Justified rows: every thumbnail shares one height, keeps its own aspect ratio,
   and sequence is preserved left to right. No cropping. */
.grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.grid figure { margin: 0; }
.grid a { display: block; height: var(--row); }
.grid img {
  height: 100%;
  width: auto;
  background: #f2f2f2;
}
.grid a:hover img { opacity: .92; }
.grid figcaption { display: none; }   /* captions live in the viewer; text stays in the HTML for search */

.text { padding: 40px 0 0; max-width: 60ch; }
.text p { margin: 0 0 12px; }
.headshot { width: 160px; margin: 16px 0 0; }
.email { font-weight: 600; }

/* ---------- footer (on every screen) ---------- */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  padding: 20px var(--gutter) 28px;
  border-top: 1px solid var(--rule);
  font-size: 12px;
  color: var(--muted);
}

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: #0f0f0f;
  color: #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox[hidden] { display: none; }
.lb-figure {
  margin: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 56px 60px;
}
.lb-img {
  max-width: 100%;
  max-height: calc(100vh - 130px);
  width: auto;
  height: auto;
  object-fit: contain;
  transition: opacity .12s;
}
.lb-img.loading { opacity: .35; }
.lb-figure figcaption {
  margin-top: 12px;
  font-size: 13px;
  color: #bbb;
  text-align: center;
  max-width: 70ch;
}
.lb-count { color: #888; margin-right: 12px; }

.lightbox button {
  position: absolute;
  background: none;
  border: 0;
  color: #fff;
  font: 40px/1 -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  cursor: pointer;
  padding: 12px 18px;
  opacity: .55;
}
.lightbox button:hover, .lightbox button:focus-visible { opacity: 1; outline: none; }
.lb-close { top: 8px; right: 10px; font-size: 32px; }
.lb-prev { left: 4px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 4px; top: 50%; transform: translateY(-50%); }
.lb-contact {
  position: absolute;
  left: 16px;
  bottom: 12px;
  font-size: 11px;
  color: #777;
}
.lb-contact a { color: #777; }

body.lb-open { overflow: hidden; }

/* ---------- phone ---------- */
@media (max-width: 600px) {
  :root { --row: 150px; }
  .site-header { padding-top: 22px; }
  .name { font-size: 15px; }
  .grid { gap: 6px; }
  .lb-figure { padding: 44px 8px 56px; }
  .lb-img { max-height: calc(100vh - 140px); }
  .lightbox .lb-prev, .lightbox .lb-next { padding: 12px 8px; font-size: 34px; }
  .lb-contact { display: none; }
}

@media (min-width: 1400px) {
  :root { --row: 360px; --gutter: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  .lb-img { transition: none; }
}
