/* Precious Not Perfect Photography: shared stylesheet.
   Sections: fonts, tokens, base, buttons, motion. Page-specific rules go below. */

/* ---- Fonts (self-hosted latin subsets; each file is variable across the weights listed) ---- */
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url('../fonts/source-serif-4-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Hanken Grotesk';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('../fonts/hanken-grotesk-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Mrs Saint Delafield';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/mrs-saint-delafield-latin.woff2') format('woff2');
}

/* ---- Design tokens (values from docs/design/source, see ADR 0003) ---- */
:root {
  /* Color */
  --charcoal: #262E33;
  --charcoal-soft: #3B444A;
  --white: #FFFFFF;
  --copper: #A5603F;
  --copper-dark: #8E4D32;
  --copper-darker: #6F3B26;
  --copper-focus: #B8693F; /* focus ring on light surfaces */
  --copper-light: #D08C68; /* focus ring on dark surfaces */
  --copper-pale: #E7B497;  /* nav hover on dark surfaces */
  --text-secondary: #5C646B;
  --text-muted: #8A939A;
  --border: #D9DDE0;
  --surface-soft: #F5F6F7;
  --error: #A4262C;

  /* Type */
  --font-serif: 'Source Serif 4', Georgia, serif;
  --font-sans: 'Hanken Grotesk', 'Helvetica Neue', Helvetica, sans-serif;
  --font-script: 'Mrs Saint Delafield', 'Snell Roundhand', cursive;

  /* Spacing: 8px scale */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 40px;
  --space-6: 48px;
  --space-8: 64px;
  --space-10: 80px;

  /* Layout */
  --gutter: 20px;
  --max-width: 1400px;

  /* Corners */
  --radius-control: 2px;
  --radius-card: 4px;
}
@media (min-width: 600px) {
  :root { --gutter: 32px; }
}
@media (min-width: 1100px) {
  :root { --gutter: 64px; }
}

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--white);
  color: var(--charcoal);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
}
h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.2;
}
p { margin: 0; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--copper-dark); }
a:hover { color: var(--copper-darker); }

:focus-visible { outline: 2px solid var(--copper-focus); outline-offset: 3px; }
.on-dark :focus-visible { outline-color: var(--copper-light); }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

/* Script accent: only for "Your moments are ready." */
.script-accent { font-family: var(--font-script); font-weight: 400; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 15px 28px;
  border: 1.5px solid transparent;
  border-radius: var(--radius-control);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }

.btn-copper { background: var(--copper); color: var(--white); }
.btn-copper:hover { background: var(--copper-dark); color: var(--white); }

.btn-charcoal { background: var(--charcoal); color: var(--white); }
.btn-charcoal:hover { background: var(--charcoal-soft); color: var(--white); }

.btn-outline-light { background: transparent; border-color: var(--white); color: var(--white); }
.btn-outline-light:hover { background: var(--white); color: var(--charcoal); }

/* ---- Motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---- Homepage ---- */

/* Header (shared by the public pages). Below 1100px: logo + toggle, nav opens as a stacked list.
   The nav is open by default and the toggle hidden; js-class.js adds .js to <html>, which collapses
   the nav behind the toggle, so without JavaScript the links stay reachable. */
.site-header { background: var(--charcoal); }
.site-header-bar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
  height: 76px; padding: 0 12px 0 var(--space-2);
}
.site-logo { display: block; line-height: 0; flex: 0 1 auto; min-width: 0; }
.site-logo img { width: 240px; max-width: 100%; height: auto; }
.nav-toggle {
  display: none; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 48px; height: 48px; padding: 0; border: 0; background: transparent;
  color: var(--white); cursor: pointer;
}
.nav-toggle .icon-close, .is-open .nav-toggle .icon-open { display: none; }
.is-open .nav-toggle .icon-close { display: block; }
.site-nav {
  display: flex; flex-direction: column; padding: 8px var(--gutter) 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}
@media (max-width: 1099.98px) {
  .js .nav-toggle { display: flex; }
  .js .site-nav { display: none; }
  .js .is-open .site-nav { display: flex; }
}
.site-nav a {
  color: var(--white); text-decoration: none; font-size: 18px; padding: 14px 0;
  transition: color .2s;
}
.site-nav a:not(.nav-login) { border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.site-nav a:nth-child(4) { border-bottom: 0; }
.site-nav a:hover { color: var(--copper-pale); }
.site-nav .nav-login {
  margin-top: var(--space-2); padding: 14px 20px; text-align: center; font-size: 16px; letter-spacing: 0.06em;
  border: 1.5px solid var(--white); border-radius: var(--radius-control);
  transition: background .2s, color .2s;
}
.site-nav .nav-login:hover { background: var(--white); color: var(--charcoal); }

@media (min-width: 1100px) {
  .site-header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); height: 104px; padding: 0 56px 0 var(--space-5); }
  .site-header-bar { display: contents; }
  .site-logo img { width: 410px; }
  .nav-toggle { display: none; }
  .site-nav { display: flex; flex-direction: row; align-items: center; gap: 36px; padding: 0; border: 0; }
  .site-nav a { padding: 0; font-size: 16px; letter-spacing: 0.04em; }
  .site-nav a:not(.nav-login) { border: 0; }
  .site-nav .nav-login { margin: 0 0 0 var(--space-1); padding: 12px 28px; }
}

/* Hero: image above copy on small screens, overlay layout from 900px. */
.home { container-type: inline-size; }
.hero { background: var(--charcoal); color: var(--white); }
.hero-media { position: relative; height: 340px; overflow: hidden; }
.hero-media img { width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 38% 30%; }
.hero-media::after {
  content: ''; position: absolute; inset: auto 0 0 0; height: 120px;
  background: linear-gradient(180deg, rgba(38, 46, 51, 0) 0%, var(--charcoal) 100%);
}
.hero-tag { padding: 4px var(--gutter) 0; font-size: 12px; letter-spacing: 0.22em; font-weight: 500; }
.hero-copy { display: flex; flex-direction: column; align-items: flex-start; padding: 14px var(--gutter) 44px; }
.hero h1 { font-weight: 700; font-size: 40px; line-height: 1.08; letter-spacing: -0.015em; }
.hero-lede { margin-top: 14px; font-size: 17px; line-height: 1.5; }
.hero-cta { margin-top: 28px; gap: 18px; font-size: 14px; letter-spacing: 0.2em; }

@media (min-width: 900px) {
  .hero { position: relative; display: flex; align-items: center; min-height: 480px; overflow: hidden; }
  .hero-media { position: absolute; top: 0; right: 0; width: 64%; height: 100%; }
  .hero-media img { object-position: 50% 28%; }
  .hero-media::after { content: none; }
  .hero::before {
    content: ''; position: absolute; inset: 0; z-index: 1;
    background: linear-gradient(90deg, #262E33 0%, #262E33 34%, rgba(38, 46, 51, 0.78) 42%, rgba(38, 46, 51, 0.25) 58%, rgba(38, 46, 51, 0) 70%);
  }
  .hero-tag {
    position: absolute; z-index: 2; top: 36px; right: 48px; padding: 0;
    font-size: 13px; letter-spacing: 0.24em;
    color: var(--charcoal); /* dark on the light sky, as in the approved mockup (source has white) */
  }
  .hero-copy { position: relative; z-index: 2; max-width: 820px; padding: 72px 64px; }
  .hero h1 { font-size: clamp(48px, 5.1cqi, 76px); line-height: 1.02; letter-spacing: -0.02em; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.25); }
  .hero-lede { margin-top: 18px; font-size: 22px; letter-spacing: 0.01em; }
  .hero-cta { margin-top: 36px; gap: 22px; font-size: 15px; letter-spacing: 0.22em; padding: 16px 36px; }
}

/* Portfolio intro */
.intro { padding: clamp(40px, 3.2cqi, 48px) clamp(20px, 3.4cqi, 48px); }
.intro-inner { max-width: var(--max-width); margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 40px 32px; }
.intro-copy { flex: 1 1 340px; min-width: 0; padding-left: clamp(0px, 1.2cqi, 16px); }
.intro h2 { font-weight: 700; font-size: clamp(34px, 3.6cqi, 52px); line-height: 1.06; letter-spacing: -0.02em; }
.rule { width: 80px; height: 3px; background: var(--copper); margin: 28px 0 24px; }
.intro-copy p { font-size: clamp(17px, 1.4cqi, 20px); line-height: 1.5; color: var(--charcoal-soft); }
.tiles { flex: 2.3 1 600px; min-width: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: var(--space-2); }
.tile { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); text-decoration: none; }
.tile-img { width: 100%; aspect-ratio: 3 / 2; overflow: hidden; background: var(--surface-soft); }
.tile-img img { width: 100%; height: 100%; max-width: none; object-fit: cover; transition: transform .4s ease; }
.tile:hover .tile-img img { transform: scale(1.03); }
.tile-cap { font-size: 14px; letter-spacing: 0.28em; font-weight: 500; color: var(--charcoal); transition: color .2s; }
.tile:hover .tile-cap { color: var(--copper-dark); }
.tile-line { width: 56px; height: 2px; background: var(--copper); margin-top: -6px; }

/* Client band */
.client-band { background: var(--charcoal); color: var(--white); padding: clamp(36px, 2.8cqi, 40px) clamp(20px, 3.4cqi, 56px); }
.client-band-inner { max-width: var(--max-width); margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 28px 40px; }
.client-band-copy { display: flex; flex-direction: column; min-width: 0; }
.client-band .script-accent { margin-bottom: -10px; font-size: clamp(38px, 3.4cqi, 50px); line-height: 1.1; color: var(--copper-light); }
.client-band h2 { padding-left: clamp(0px, 2.6cqi, 38px); font-weight: 700; font-size: clamp(32px, 3.5cqi, 52px); line-height: 1.1; letter-spacing: -0.015em; }
.band-cta { gap: 22px; letter-spacing: 0.2em; padding: 16px 26px; }

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

/* ---- Client portal: sign-in and recovery (docs/design/source/components/Portal.dc.html) ---- */
[hidden] { display: none !important; }

.portal-header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px 20px;
  background: var(--charcoal);
}
.portal-header a { display: block; line-height: 0; }
.portal-header img { width: clamp(240px, 23vw, 340px); height: auto; }

/* Form and photo split the page; the photo wraps below the form when narrow. */
.portal-main { display: flex; flex-wrap: wrap; align-items: stretch; }
.portal-form-pane {
  flex: 1 1 440px;
  min-width: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: clamp(40px, 5vw, 80px) clamp(20px, 5vw, 72px);
}
.portal-form-wrap { width: 100%; max-width: 400px; }
.portal-photo {
  flex: 1 1 440px;
  min-width: 0;
  min-height: clamp(240px, 52vw, 760px);
  position: relative;
  overflow: hidden;
  background: #E9DDD2;
}
.portal-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
}

.portal-title {
  font-weight: 700;
  font-size: clamp(36px, 3.4vw, 50px);
  line-height: 1.06;
  letter-spacing: -0.02em;
}
.portal-title:focus { outline: none; }
.portal-lede { margin-top: 14px; color: var(--text-secondary); line-height: 1.5; }
.portal-lede-strong { color: var(--charcoal-soft); font-size: 17px; line-height: 1.55; }
.portal-status { margin-top: 12px; color: var(--text-secondary); font-size: 15px; }
.portal-icon {
  width: 56px;
  height: 56px;
  margin-bottom: 24px;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--copper);
  display: flex;
  align-items: center;
  justify-content: center;
}

.portal-alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 24px;
  padding: 14px 16px;
  background: #FBF1F0;
  border: 1px solid #E6BDB8;
  border-radius: var(--radius-card);
  color: #8A1F1F;
  font-size: 15px;
  line-height: 1.45;
}
.portal-alert svg { flex: none; margin-top: 1px; }

.portal-form { display: flex; flex-direction: column; gap: 20px; margin-top: 28px; }
.portal-field { display: flex; flex-direction: column; gap: 8px; }
.portal-field label { font-size: 15px; font-weight: 500; }
.portal-field input {
  width: 100%;
  min-width: 0;
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--text-muted);
  border-radius: 3px;
  background: var(--white);
  color: var(--charcoal);
  font: inherit;
}
.portal-field input:focus { outline: none; border-color: var(--charcoal); box-shadow: 0 0 0 1px var(--charcoal); }
.portal-field input[aria-invalid="true"] { border-color: var(--error); }
.portal-field-error { color: var(--error); font-size: 14px; }
.portal-code { letter-spacing: 0.3em; font-variant-numeric: tabular-nums; }

.portal-password { position: relative; display: flex; }
.portal-password input { padding-right: 52px; }
.portal-eye {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--charcoal-soft);
  cursor: pointer;
}
.eye-slash { display: none; }
.portal-eye.is-showing .eye-slash { display: inline; }

.portal-link { color: var(--copper-dark); text-underline-offset: 3px; font-size: 15px; }
.portal-link:hover { color: var(--copper-darker); }
.portal-link-button { padding: 0; border: 0; background: none; font: inherit; cursor: pointer; text-decoration: underline; }
.portal-forgot { align-self: flex-start; padding: 6px 0; font-size: 14px; }

.portal-btn { width: 100%; height: 54px; margin-top: 8px; padding: 0 28px; font-size: 18px; font-weight: 400; letter-spacing: 0.03em; }
.portal-btn-link { margin-top: 32px; }
.spinner { animation: portal-spin .8s linear infinite; }
@keyframes portal-spin { to { transform: rotate(360deg); } }

.portal-divider {
  display: flex;
  justify-content: center;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.portal-divider .portal-link { padding: 8px 4px; }

/* ---- Placeholder pages ---- */
.placeholder { padding: var(--space-8) var(--gutter); }
.placeholder h1 { font-weight: 700; font-size: 40px; line-height: 1.08; letter-spacing: -0.015em; }
.placeholder p { margin-top: var(--space-2); color: var(--text-secondary); }
.placeholder section { margin-top: var(--space-4); }
.placeholder h2 { font-size: 28px; }
.placeholder-back { margin-top: var(--space-4); }

/* ---- Client portal: sessions ---- */
/* Compact portal header (sessions, gallery): logo left, nav right. */
.portal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: clamp(14px, 1.6vw, 22px) clamp(16px, 3.4vw, 48px);
  background: var(--charcoal);
}
.portal-bar-logo { display: block; flex: 0 1 auto; min-width: 0; line-height: 0; }
.portal-bar-logo img { width: clamp(170px, 23vw, 330px); }
.portal-nav { display: flex; align-items: center; gap: clamp(8px, 2.4vw, 36px); flex: none; }
.portal-nav-link {
  position: relative;
  padding: 12px 4px;
  min-height: 44px;
  border: 0;
  background: none;
  color: var(--white);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}
.portal-nav-link:hover { color: var(--copper-pale); }
.portal-nav-link[aria-current="page"]::after {
  content: '';
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 6px;
  height: 2px;
  background: var(--copper-light);
}

.sessions-main { padding: clamp(32px, 3.4vw, 56px) clamp(20px, 3.4vw, 48px) clamp(48px, 4.4vw, 72px); }
.sessions-inner { max-width: var(--max-width); margin: 0 auto; }
.sessions-title { font-weight: 700; font-size: clamp(32px, 3.5vw, 52px); line-height: 1.1; letter-spacing: -0.02em; }
.sessions-lede { margin-top: 8px; color: var(--charcoal-soft); font-size: clamp(18px, 1.5vw, 22px); }

.sessions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(520px, 100%), 1fr));
  gap: clamp(16px, 1.7vw, 24px);
  margin: var(--space-4) 0 0;
  padding: 0;
  list-style: none;
}

.session-card {
  position: relative;
  display: block;
  height: clamp(220px, 23vw, 340px);
  border-radius: 6px;
  overflow: hidden;
  background: var(--charcoal);
  color: var(--white);
  text-decoration: none;
}
.session-card:hover { color: var(--white); }
.session-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 40%;
  transition: transform .45s ease;
}
.session-card:hover img { transform: scale(1.03); }
.session-card-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 25, 28, 0) 40%, rgba(20, 25, 28, .78) 100%);
}
.session-card-text {
  position: absolute;
  left: clamp(18px, 1.8vw, 28px);
  right: clamp(16px, 1.6vw, 24px);
  bottom: clamp(16px, 1.6vw, 24px);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 16px;
}
.session-card-title { font-weight: 700; font-size: clamp(24px, 2.2vw, 32px); text-shadow: 0 1px 10px rgba(0, 0, 0, .35); }
.session-card-count { margin-top: 6px; font-size: 15px; line-height: 1.4; }
.session-card-cta {
  padding: 11px 20px;
  border-radius: 3px;
  background: var(--copper);
  font-weight: 500;
  transition: background .2s;
}
.session-card:hover .session-card-cta { background: var(--copper-dark); }

.session-skeleton {
  position: relative;
  height: clamp(220px, 23vw, 340px);
  border-radius: 6px;
  background: #F0F1F3;
  animation: sessions-pulse 1.4s ease-in-out infinite;
}
.session-skeleton span { position: absolute; left: 24px; bottom: 24px; width: 90px; height: 14px; border-radius: 3px; background: #E1E4E7; }
.session-skeleton span:first-child { bottom: 48px; width: 200px; max-width: 70%; height: 22px; }
@keyframes sessions-pulse { 50% { opacity: .55; } }

.sessions-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: var(--space-4);
  padding: clamp(48px, 6vw, 88px) var(--space-3);
  border: 1px solid var(--border);
  border-radius: 6px;
  text-align: center;
}
.sessions-panel h2 { font-weight: 700; font-size: clamp(26px, 2.2vw, 32px); }
.sessions-panel p { max-width: 420px; color: var(--charcoal-soft); font-size: 17px; line-height: 1.5; }
.sessions-panel-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin-bottom: 8px;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--copper);
}
.sessions-retry { margin-top: 12px; height: 50px; padding: 0 32px; font-size: 17px; font-weight: 400; letter-spacing: 0.03em; }

@media (prefers-reduced-motion: reduce) {
  .session-skeleton { animation: none; }
  .session-card img { transition: none; }
  .session-card:hover img { transform: none; }
}

/* ---- Client portal: gallery ---- */
.gallery-cover {
  position: relative;
  height: clamp(260px, 26vw, 380px);
  overflow: hidden;
  background: var(--charcoal);
  color: var(--white);
}
.gallery-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; }
.gallery-cover-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 25, 28, .35) 0%, rgba(20, 25, 28, 0) 28%, rgba(20, 25, 28, 0) 45%, rgba(20, 25, 28, .8) 100%);
}
.gallery-back {
  position: absolute;
  top: 12px;
  left: clamp(8px, 2.8vw, 40px);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 3px;
  color: var(--white);
  font-size: 15px;
  text-decoration: none;
}
.gallery-back:hover { color: var(--copper-pale); }
.gallery-cover :focus-visible { outline-color: var(--copper-light); }
.gallery-cover-text {
  position: absolute;
  left: clamp(20px, 3.4vw, 48px);
  right: clamp(20px, 3.4vw, 48px);
  bottom: clamp(20px, 2.4vw, 36px);
}
.gallery-title {
  font-weight: 700;
  font-size: clamp(32px, 3.6vw, 54px);
  line-height: 1.08;
  letter-spacing: -0.015em;
  text-shadow: 0 1px 14px rgba(0, 0, 0, .35);
}
.gallery-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin-top: 10px;
  font-size: clamp(15px, 1.25vw, 18px);
}
.gallery-private { display: inline-flex; align-items: center; gap: 6px; }
.gallery-private svg { color: var(--copper-pale); }

.gallery-toolbar { padding: 0 clamp(20px, 3.4vw, 48px); border-bottom: 1px solid var(--border); }
.gallery-toolbar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 10px 0;
}
.gallery-tabs { display: flex; gap: clamp(12px, 2vw, 28px); }
.gallery-tab {
  position: relative;
  min-height: 48px;
  padding: 12px 6px;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}
.gallery-tab[aria-pressed="true"] { color: var(--charcoal); }
.gallery-tab[aria-pressed="true"]::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 2px;
  background: var(--copper);
}

.gallery-body { max-width: calc(var(--max-width) + 2 * clamp(20px, 3.4vw, 48px)); margin: 0 auto; padding: clamp(16px, 1.7vw, 24px) clamp(20px, 3.4vw, 48px) 0; }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(10px, 1.1vw, 16px);
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 768px) {
  .gallery-grid { grid-template-columns: repeat(4, 1fr); }
}
.photo-item { position: relative; }
.photo-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 0;
  border: 0;
  border-radius: 2px;
  overflow: hidden;
  background: var(--surface-soft);
  cursor: zoom-in;
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
/* Positioned container for the favorite heart button (#22). */
.photo-heart-slot { position: absolute; top: 2px; right: 2px; width: 44px; height: 44px; }

.photo-skeleton {
  aspect-ratio: 4 / 3;
  border-radius: 2px;
  background: #F0F1F3;
  animation: sessions-pulse 1.4s ease-in-out infinite;
}
.gallery-cover-skeleton { height: clamp(260px, 26vw, 380px); background: #F0F1F3; animation: sessions-pulse 1.4s ease-in-out infinite; }

.gallery-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: clamp(56px, 7vw, 112px) var(--space-3);
  text-align: center;
}
.gallery-panel h1 { font-weight: 700; font-size: clamp(30px, 3vw, 44px); line-height: 1.12; }
.gallery-panel p { max-width: 460px; color: var(--charcoal-soft); font-size: 17px; line-height: 1.5; }
.gallery-panel .sessions-retry { margin-top: 12px; }
.gallery-panel-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.gallery-btn-outline { border-color: var(--charcoal); color: var(--charcoal); }
.gallery-btn-outline:hover { background: var(--surface-soft); color: var(--charcoal); }

.gallery-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: clamp(28px, 3vw, 40px) clamp(20px, 3.4vw, 48px) 0;
  padding: 20px 0 28px;
  border-top: 1px solid var(--border);
  color: var(--charcoal-soft);
  font-size: 14px;
}

@media (prefers-reduced-motion: reduce) {
  .photo-skeleton, .gallery-cover-skeleton { animation: none; }
}

/* Admin shell (#13). Functional only; no approved design yet. */
.admin-header { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); padding: var(--space-2) var(--space-3); color: var(--white); }
.admin-header .site-logo img { display: block; height: 40px; width: auto; }
.admin-header .site-nav { display: flex; flex-direction: row; flex: 1; gap: var(--space-3); padding: 0; border: 0; }
.admin-header .site-nav a { padding: 0; border: 0; }
.admin-user { margin: 0; font-family: var(--font-sans); font-size: 14px; }
.admin-main { max-width: 960px; margin: 0 auto; padding: var(--space-4) var(--space-3); font-family: var(--font-sans); }
.admin-main h1, .admin-main h2 { font-family: var(--font-serif); color: var(--charcoal); }
.admin-main section { margin-top: var(--space-4); padding-top: var(--space-2); border-top: 1px solid var(--border); }

/* Admin clients (#15). */
.admin-main .visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.admin-btn { padding: 12px 20px; font-size: 14px; letter-spacing: 0.1em; }
.admin-btn-sm { padding: 6px 12px; font-size: 13px; letter-spacing: 0.04em; }
.admin-table-wrap { overflow-x: auto; margin-top: var(--space-2); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 15px; text-align: left; }
.admin-table th, .admin-table td { padding: var(--space-1); border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-actions { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.admin-form { max-width: 480px; padding: var(--space-3); border: 1px solid var(--border); margin: var(--space-2) 0; }
.admin-drop { padding: var(--space-2); border: 2px dashed var(--border); }
.admin-drop.is-dragging { border-color: var(--copper); }
.admin-note { color: var(--charcoal-soft); font-size: 14px; }
#client-delete { max-width: 480px; padding: var(--space-3); border: 1px solid var(--border); color: var(--charcoal); font-family: var(--font-sans); }
#client-delete::backdrop { background: rgb(38 46 51 / .6); }
#session-delete-dialog { max-width: 480px; padding: var(--space-3); border: 1px solid var(--border); color: var(--charcoal); font-family: var(--font-sans); }
#session-delete-dialog::backdrop { background: rgb(38 46 51 / .6); }

/* Admin photo organizer (#30). */
.admin-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--space-2); padding: 0; list-style: none; }
.admin-photo-grid li { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-1); border: 1px solid var(--border); }
.admin-photo-grid li.is-cover { border-color: var(--copper); }
.admin-photo-grid li.is-dragging { opacity: .5; }
.admin-favorites-clients { padding: 0; list-style: none; }
.admin-favorites-clients > li { margin-block-end: var(--space-3); }
#favorites-fallback { width: 100%; }
.admin-photo-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--border); }

/* ---- Client portal: favorites ---- */
.photo-heart {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.45));
}
.photo-heart svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.photo-heart[aria-pressed="true"] { color: var(--copper); }
.photo-heart[aria-pressed="true"] svg { fill: currentColor; }
.photo-heart:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }

.favorites-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: clamp(48px, 6vw, 88px) var(--space-3);
  text-align: center;
}
.favorites-empty h2 { font-weight: 700; font-size: clamp(26px, 2.2vw, 32px); }
.favorites-empty p { max-width: 420px; color: var(--charcoal-soft); font-size: 17px; line-height: 1.5; }
.favorites-empty .btn { margin-top: 8px; height: 46px; padding: 0 24px; font-size: 16px; }

/* The design's "status toast": a fixed live region at the bottom of the viewport. */
.status-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 40;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 16px 18px;
  border-radius: 4px;
  background: var(--charcoal);
  color: #fff;
  font-size: 15px;
  line-height: 1.4;
  box-shadow: 0 8px 28px rgba(20, 26, 30, 0.28);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity 0.2s;
}
.status-toast.is-visible { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .status-toast { transition: none; }
}

/* ---- Client portal: viewer ---- */
.viewer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(18, 22, 25, 0.97);
  color: #fff;
}
.viewer[open] { display: flex; flex-direction: column; }
.viewer :focus-visible { outline-color: var(--copper-light); }
body:has(.viewer[open]) { overflow: hidden; }
.viewer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px clamp(8px, 2vw, 24px);
}
.viewer-position { margin: 0; padding-left: 8px; font-size: 15px; letter-spacing: 0.04em; }
.viewer-actions { display: flex; align-items: center; gap: 4px; }
.viewer-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: #fff;
  cursor: pointer;
}
.viewer-btn:hover { background: rgba(255, 255, 255, 0.1); }
.viewer-step { flex: none; height: 64px; }
#viewer-favorite svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
#viewer-favorite[aria-pressed="true"] { color: var(--copper-light); }
#viewer-favorite[aria-pressed="true"] svg { fill: currentColor; }
.viewer-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 clamp(4px, 1.2vw, 16px) 16px;
}
/* The whole photo, letterboxed and never cropped. */
.viewer-photo { flex: 1; min-width: 0; height: 100%; display: flex; align-items: center; justify-content: center; touch-action: pan-y; }
.viewer-photo img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
