:root {
  --cream: #fdf8f1;
  --ink: #2b2118;
  --muted: #7a6a5b;
  --accent: #e2724a;
  --accent-dark: #c75a33;
  --card: #f4e8d9;
  --shadow: 0 18px 40px -24px rgba(60, 40, 20, 0.45);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(1100px 600px at 8% -10%, #ffe9d6 0%, transparent 60%),
    radial-gradient(900px 520px at 108% 0%, #ffe0e6 0%, transparent 55%),
    var(--cream);
}

::selection {
  background: var(--accent);
  color: #fff;
}

.hero {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(48px, 9vw, 104px) clamp(20px, 5vw, 40px) clamp(28px, 4vw, 44px);
  text-align: center;
}

.eyebrow {
  margin: 0 0 14px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-dark);
}

h1 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-size: clamp(2.6rem, 7vw, 5.2rem);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.02em;
}

h1 em {
  color: var(--accent);
  font-style: italic;
}

.lede {
  max-width: 34ch;
  margin: 20px auto 0;
  font-size: clamp(1rem, 1.6vw, 1.12rem);
  line-height: 1.6;
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 24px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 12px 24px -14px rgba(199, 90, 51, 0.9);
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.btn-icon {
  font-size: 1.15em;
  line-height: 1;
  transition: transform 0.5s ease;
}

.btn:active .btn-icon {
  transform: rotate(-180deg);
}

.hint {
  font-size: 0.9rem;
  color: var(--muted);
}

kbd {
  display: inline-block;
  min-width: 1.7em;
  padding: 2px 6px;
  border: 1px solid rgba(60, 40, 20, 0.2);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: #fff;
  font: inherit;
  font-size: 0.82rem;
  text-align: center;
}

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 40px) clamp(56px, 8vw, 96px);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
  gap: clamp(12px, 2vw, 22px);
}

.card {
  position: relative;
  margin: 0;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  cursor: zoom-in;
  isolation: isolate;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, #f4e8d9 20%, #fdf3e5 40%, #f4e8d9 60%);
  background-size: 220% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

.card.is-loaded::before {
  animation: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 0.5s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.3, 1);
}

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

.card:hover img,
.card:focus-visible img {
  transform: scale(1.06);
}

.card:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.card figcaption {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  padding: 44px 16px 14px;
  color: #fff;
  font-size: 0.88rem;
  background: linear-gradient(transparent, rgba(24, 14, 8, 0.72));
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.card:hover figcaption,
.card:focus-visible figcaption {
  opacity: 1;
  transform: none;
}

.card .name {
  font-family: "Iowan Old Style", Georgia, serif;
  font-size: 1.05rem;
  font-style: italic;
}

.card .index {
  font-variant-numeric: tabular-nums;
  opacity: 0.7;
}

.footer {
  padding: 0 20px 40px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

.footer a {
  color: inherit;
  text-decoration-color: rgba(122, 106, 91, 0.5);
  text-underline-offset: 3px;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 48px);
  background: rgba(24, 14, 8, 0.86);
  backdrop-filter: blur(8px);
}

.lightbox[hidden] {
  display: none;
}

.lightbox img {
  max-width: min(92vw, 900px);
  max-height: 86vh;
  border-radius: 26px;
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.8);
  display: block;
}

.lightbox-close {
  position: absolute;
  top: clamp(12px, 3vw, 28px);
  right: clamp(12px, 3vw, 28px);
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.26);
}

.lightbox-close:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

@keyframes shimmer {
  from {
    background-position: 120% 0;
  }
  to {
    background-position: -120% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
