/* Client gallery ("Album"). Navy and cream identity, Bodoni display type.
   The grid is justified rows: JS measures each row and writes the pixel sizes,
   so photos keep their aspect ratio and every row fills the width exactly. */

:root {
  --ink: #1c2a48;
  --cream: #f6f2ea;
  --linen: #efe8d8;
  --greige: #6e6a63;
  --rule: rgba(25, 38, 64, 0.16);
  --shade: #0f1623;
/* The four brand faces, in the roles the guidelines give them:
   Bodoni Moda for the logo and headlines, Libre Franklin for body and labels,
   Cormorant Garamond for the soft note, Courier Prime for captions.
   Album names are not brand headlines, so they take Cormorant, not Bodoni. */
  --font-display: "Bodoni Moda", Didot, Georgia, serif;
  --font-body: "Libre Franklin", Helvetica, Arial, sans-serif;
  --font-note: "Cormorant Garamond", Georgia, serif;
  --font-title: "Cormorant Garamond", Georgia, serif;
  --font-caption: "Courier Prime", "Courier New", monospace;
  /* The site sets secondary text in greige, not a tint of the navy. */
  --quiet: #6e6a63;
  --gutter: clamp(14px, 2.4vw, 34px);
  --gap: 10px;
  --bar-height: 62px;
}

* { box-sizing: border-box; }

/* The same anchor reset the other pages carry inline. Without it the shared
   header renders with browser default underlines here and nowhere else. */
a {
  color: inherit;
  text-decoration: none;
}

/* Several blocks below set display, which would otherwise beat the user-agent
   rule for [hidden] and leave hidden panels on screen. */
[hidden] { display: none !important; }

body.album-body {
  margin: 0;
  font-optical-sizing: auto;
  min-height: 100svh;
  color: var(--ink);
  background: var(--cream);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body.album-body.is-locked-scroll { overflow: hidden; }

button { font: inherit; color: inherit; cursor: pointer; }

/* ------------------------------------------------------------------ index */

/* The header is the site header, so moving between Work, About, Contact and
   Album must not move the logo, the nav or the gutters by a pixel. These rules
   mirror the ones the other pages carry inline. */
.site-header {
  transition: background-color 220ms ease, box-shadow 220ms ease;
}

.site-header.is-scrolled {
  background: rgba(246, 242, 234, 0.99) !important;
  box-shadow: 0 12px 34px rgba(11, 20, 38, 0.16) !important;
  backdrop-filter: blur(12px) !important;
}

.nav-link { position: relative; }

.nav-link::after {
  position: absolute;
  right: 0;
  bottom: -5px;
  left: 0;
  height: 1px;
  background: currentColor;
  content: "";
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 180ms ease;
}

.nav-link:hover::after,
.nav-link:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
}

.header-cta { transition: opacity 180ms ease; }
.header-cta:hover,
.header-cta:focus-visible { opacity: 0.6; }

@media (max-width: 900px) {
  .site-header { grid-template-columns: 1fr auto !important; }
  .site-nav { display: none !important; }
}

.album-index {
  min-height: 100svh;
  /* The same gutter as the rest of the site, so the wordmark and the grid line
     up with the content on every other page. */
  padding: 0 clamp(18px, 3.6vw, 58px) clamp(70px, 10vw, 140px);
  background: var(--cream);
}

.album-index[hidden] { display: none; }

.album-index-title {
  margin: clamp(104px, 11vw, 150px) 0 clamp(44px, 7vw, 86px);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(3.6rem, 9.5vw, 8.4rem);
  line-height: 0.84;
  letter-spacing: -0.05em;
}

.album-index-title em {
  font-family: var(--font-note);
  font-weight: 400;
  letter-spacing: -0.01em;
}

.album-index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 370px), 1fr));
  gap: clamp(38px, 4.4vw, 68px) clamp(22px, 3vw, 54px);
}

.album-card {
  display: block;
  color: inherit;
  text-align: center;
  text-decoration: none;
}

/* Landscape crops, with room to breathe. Three to two matches the shape the
   camera shoots, so a cover loses the least of its frame. */
.album-card-frame {
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--linen) center / cover no-repeat;
}

.album-card-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.6s ease;
}

.album-card-frame img.is-loaded { opacity: 1; }
.album-card:hover .album-card-frame img.is-loaded { transform: scale(1.03); }

.album-card-lock {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(15, 22, 35, 0.42);
  color: var(--cream);
}

.album-card-lock svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Album names are Cormorant, not Bodoni: Bodoni carries the logo and the
   page headline, and a quieter face keeps the photographs in front. */
.album-card-title {
  margin: 26px 0 9px;
  font-family: var(--font-title);
  font-weight: 400;
  font-size: clamp(1.6rem, 2.3vw, 2.05rem);
  line-height: 1.08;
  letter-spacing: 0.004em;
  text-wrap: balance;
}

.album-card-meta {
  margin: 0;
  font-family: var(--font-caption);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--greige);
}

.album-index-empty {
  margin: 0;
  max-width: 44ch;
  color: var(--quiet);
  font-size: 0.98rem;
  line-height: 1.65;
}

/* ------------------------------------------------------------------ cover *//* ------------------------------------------------------------------ cover */

.album-cover {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: calc(var(--gutter) * 2) var(--gutter);
  overflow: hidden;
  background: var(--linen);
}

.album-cover-media {
  position: absolute;
  inset: 0;
  background-position: var(--cover-focus, center);
  background-size: cover;
  background-repeat: no-repeat;
  transform: scale(1.02);
}

.album-cover-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(15, 22, 35, 0.34), rgba(15, 22, 35, 0.52));
}

/* No cover photo to sit over, so the page carries the navy itself and the
   scrim comes off: over the linen it only turned the screen grey. */
.album-cover.is-coverless { background: var(--ink); }
.album-cover.is-coverless .album-cover-scrim { display: none; }

.album-cover-inner {
  position: relative;
  text-align: center;
  color: var(--cream);
  max-width: 780px;
}

/* Each of the three lines takes the face the guidelines give its job: a
   Franklin label, a Cormorant title, a Courier caption. */
.album-cover-client {
  margin: 0 0 20px;
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  opacity: 0.84;
}

.album-cover-date {
  margin: 24px 0 0;
  font-family: var(--font-caption);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.82;
}

.album-cover-title {
  margin: 0;
  font-family: var(--font-title);
  font-weight: 300;
  font-size: clamp(3.6rem, 9.4vw, 8.2rem);
  line-height: 0.96;
  letter-spacing: 0.002em;
  text-wrap: balance;
}

.album-cover-enter {
  margin-top: 40px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: none;
  border: 0;
  padding: 6px 10px;
  color: var(--cream);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.album-cover-enter svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  animation: album-nudge 2.4s ease-in-out infinite;
}

@keyframes album-nudge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

/* ------------------------------------------------------------------- gate */

.album-gate {
  margin: 34px auto 0;
  display: grid;
  gap: 12px;
  max-width: 320px;
  text-align: left;
}

.album-gate-label,
.album-pin-label {
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.album-gate-input,
.album-pin-input,
.album-note-input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid rgba(246, 242, 234, 0.42);
  border-radius: 2px;
  background: rgba(15, 22, 35, 0.28);
  color: var(--cream);
  font-family: inherit;
  font-size: 15px;
}

.album-gate-input:focus-visible,
.album-pin-input:focus-visible,
.album-note-input:focus-visible {
  outline: 2px solid var(--cream);
  outline-offset: 2px;
}

.album-gate-submit,
.album-sheet-submit {
  padding: 14px 20px;
  border: 0;
  border-radius: 2px;
  background: var(--cream);
  color: var(--ink);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.album-gate-error,
.album-sheet-error {
  margin: 0;
  font-size: 13px;
  color: #e4b3a3;
}

/* --------------------------------------------------------------------- bar */

.album-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--bar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 var(--gutter);
  background: rgba(246, 242, 234, 0.92);
  backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--rule);
}

.album-bar-title {
  border: 0;
  background: none;
  padding: 0;
  font-family: var(--font-title);
  font-weight: 500;
  font-size: clamp(1.25rem, 2.3vw, 1.6rem);
  line-height: 1;
  letter-spacing: 0.006em;
  text-align: left;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.album-bar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.album-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: none;
  transition: background 0.18s ease;
}

.album-icon:hover { background: rgba(28, 42, 72, 0.08); }

.album-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.album-icon.is-on svg { fill: currentColor; stroke: currentColor; }

.album-icon-light { color: var(--cream); }
.album-icon-light:hover { background: rgba(246, 242, 234, 0.14); }

.album-icon-count {
  position: absolute;
  top: 3px;
  right: 2px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--ink);
  color: var(--cream);
  font-size: 10px;
  font-weight: 500;
}

/* -------------------------------------------------------------------- sets */

.album-main { padding: 0 var(--gutter) 60px; }

.album-sets {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  padding: 26px 0 22px;
}

.album-set {
  border: 0;
  background: none;
  padding: 2px 0;
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--greige);
  border-bottom: 1px solid transparent;
}

.album-set.is-active { color: var(--ink); border-bottom-color: var(--ink); }

/* -------------------------------------------------------------------- grid */

.album-grid { padding-top: 22px; }

.album-row {
  display: flex;
  gap: var(--gap);
  margin-bottom: var(--gap);
  /* Rows off screen are skipped entirely, which keeps a 900 photo gallery
     scrolling at full speed on a phone. */
  content-visibility: auto;
}

.album-tile {
  position: relative;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  overflow: hidden;
  background-color: var(--linen);
  background-size: cover;
  background-position: center;
  cursor: zoom-in;
}

.album-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.45s ease;
}

.album-tile img.is-loaded { opacity: 1; }

.album-tile-heart {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 22, 35, 0.34);
  color: var(--cream);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.album-tile:hover .album-tile-heart,
.album-tile-heart.is-on { opacity: 1; }

.album-tile-heart svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.album-tile-heart.is-on svg { fill: var(--cream); }

.album-set-heading {
  margin: 34px 0 18px;
  font-family: var(--font-title);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.004em;
}

/* ---------------------------------------------------------------- lightbox */

.album-lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--shade);
  display: grid;
  grid-template-rows: 1fr auto;
}

.album-lightbox[hidden] { display: none; }

.album-lightbox-stage {
  display: grid;
  place-items: center;
  /* A grid item will not shrink below its content size unless its automatic
     minimum is cleared. Without these the photo keeps its full height, the
     max-height below never binds, and the overflow rule crops the bottom off
     every landscape frame on a wide screen. */
  min-height: 0;
  overflow: hidden;
  padding: clamp(10px, 2vw, 30px);
}

.album-lightbox-image {
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.22s ease;
}

.album-lightbox-image.is-loaded { opacity: 1; }

.album-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(246, 242, 234, 0.1);
  color: var(--cream);
}

.album-lightbox-nav:hover { background: rgba(246, 242, 234, 0.2); }
.album-prev { left: clamp(8px, 2vw, 26px); }
.album-next { right: clamp(8px, 2vw, 26px); }

.album-lightbox-nav svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.album-lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px var(--gutter) max(10px, env(safe-area-inset-bottom));
  color: var(--cream);
}

.album-lightbox-count {
  font-family: var(--font-caption);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  opacity: 0.76;
}

.album-lightbox-actions { display: flex; gap: 2px; }

/* ------------------------------------------------------------------ sheets */

.album-sheet {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: var(--gutter);
  background: rgba(15, 22, 35, 0.58);
}

.album-sheet[hidden] { display: none; }

.album-sheet-panel {
  position: relative;
  width: min(430px, 100%);
  max-height: min(84svh, 760px);
  overflow-y: auto;
  padding: 34px 30px 30px;
  border-radius: 4px;
  background: var(--cream);
  color: var(--ink);
}

.album-sheet-panel-wide { width: min(560px, 100%); }

.album-sheet-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: none;
}

.album-sheet-close svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
}

.album-sheet-title {
  margin: 0 0 22px;
  font-family: var(--font-title);
  font-size: clamp(1.75rem, 2.8vw, 2.15rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.004em;
}

.album-pin { display: grid; gap: 12px; }

.album-pin-input {
  border-color: var(--rule);
  background: #fffdf8;
  color: var(--ink);
  letter-spacing: 0.4em;
  font-size: 19px;
  text-align: center;
}

.album-pin .album-sheet-submit {
  background: var(--ink);
  color: var(--cream);
}

.album-sizes { display: grid; gap: 10px; }

.album-size {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 16px 18px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: #fffdf8;
  text-align: left;
  transition: border-color 0.16s ease;
}

.album-size:hover { border-color: var(--ink); }

.album-size-name {
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: -0.005em;
}

.album-size-meta {
  font-family: var(--font-caption);
  font-size: 0.72rem;
  color: var(--greige);
  white-space: nowrap;
}

.album-size-group {
  margin: 6px 0 2px;
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--greige);
}

/* --------------------------------------------------------------- favorites */

.album-favorites-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 8px;
  margin-bottom: 22px;
}

.album-favorite-thumb {
  position: relative;
  aspect-ratio: 1;
  border: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 2px;
  background: var(--linen) center / cover no-repeat;
}

.album-favorites-empty {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--quiet);
  font-size: 0.92rem;
  line-height: 1.6;
}

.album-favorites-send { display: grid; gap: 12px; }

.album-note-input {
  border-color: var(--rule);
  background: #fffdf8;
  color: var(--ink);
  resize: vertical;
}

.album-favorites-send .album-sheet-submit {
  background: var(--ink);
  color: var(--cream);
}

/* ------------------------------------------------------------------ footer */

.album-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 26px var(--gutter) 40px;
  border-top: 1px solid var(--rule);
  font-family: var(--font-caption);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--greige);
}

.album-footer-count { margin: 0; }

.album-footer-mark {
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* ------------------------------------------------------------------- toast */

.album-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 80;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--cream);
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(15, 22, 35, 0.24);
}

.album-toast[hidden] { display: none; }

@media (max-width: 640px) {
  :root { --gap: 6px; --bar-height: 56px; }
  .album-lightbox-nav { display: none; }
  .album-tile-heart { opacity: 1; background: rgba(15, 22, 35, 0.28); }
}

@media (prefers-reduced-motion: reduce) {
  .album-cover-enter svg { animation: none; }
  .album-tile img,
  .album-lightbox-image { transition: none; }
}
