:root {
  --ink: #071c22;
  --panel: #0e3038;
  --line: color-mix(in oklab, #9fd0c8 18%, transparent);
  --foam: #eef6f7;
  --mist: #9fb8bc;
  --amber: #e0a04a;
  --amber-hot: #f0b45c;
  --agave: #2f6b55;
  --font-display: "Syne", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;
  --radius: 0.75rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--foam);
  background-color: var(--ink);
  background-image:
    radial-gradient(ellipse 90% 60% at 80% -10%, color-mix(in oklab, var(--amber) 22%, transparent), transparent 55%),
    radial-gradient(ellipse 70% 50% at 10% 20%, color-mix(in oklab, var(--agave) 28%, transparent), transparent 50%),
    linear-gradient(180deg, #06161b 0%, var(--ink) 40%, #0a242c 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

button {
  font: inherit;
  cursor: pointer;
}

.hero {
  position: relative;
  isolation: isolate;
  min-height: 78svh;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__fallback {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, #1a5c5c, #071c22);
}

.hero__shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(7, 28, 34, 0.4), rgba(7, 28, 34, 0.65) 45%, #071c22);
}

.hero::after {
  content: "";
  position: absolute;
  inset: -20%;
  z-index: 2;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.hero__inner {
  position: relative;
  z-index: 3;
  width: min(64rem, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 5rem 0 3.5rem;
}

.brand {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--amber);
  margin: 0;
  animation: rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
  margin: 0.75rem 0 0;
  max-width: 16ch;
  animation: rise 1s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
}

.hero__lead,
.hero__meta {
  max-width: 36rem;
  color: var(--mist);
  line-height: 1.6;
  animation: rise 1s cubic-bezier(0.22, 1, 0.36, 1) 0.24s both;
}

.hero__lead {
  margin: 1rem 0 0;
  font-size: clamp(1rem, 2.2vw, 1.125rem);
}

.hero__meta {
  margin: 1rem 0 0;
  font-size: 0.875rem;
  color: color-mix(in oklab, var(--foam) 80%, transparent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 0.75rem;
  border: 1px solid transparent;
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn--amber {
  background: var(--amber);
  color: var(--ink);
}

.btn--amber:hover:not(:disabled) {
  background: var(--amber-hot);
}

.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--foam);
}

.btn--ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.05);
}

.hero__cta {
  margin-top: 2rem;
  animation: rise 1s cubic-bezier(0.22, 1, 0.36, 1) 0.28s both;
}

.gallery {
  width: min(72rem, calc(100% - 2rem));
  margin: 0 auto;
  padding: 3rem 0 4rem;
}

.gallery__head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 1.875rem);
  margin: 0;
}

.gallery__head p {
  margin: 0.35rem 0 0;
  color: var(--mist);
  font-size: 0.875rem;
}

.toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  margin-top: 1.5rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: color-mix(in oklab, var(--ink) 85%, transparent);
  backdrop-filter: blur(12px);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
  justify-content: space-between;
}

.toolbar__select {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.875rem;
  cursor: pointer;
  user-select: none;
}

.toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.toolbar__error {
  width: 100%;
  margin: 0;
  color: #fca5a5;
  font-size: 0.875rem;
}

.grid {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
  }
}

@media (min-width: 1024px) {
  .grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.card {
  position: relative;
  overflow: hidden;
  border-radius: 0.85rem;
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--line);
  animation: rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.card.is-selected {
  box-shadow: inset 0 0 0 2px var(--amber);
}

.card__open {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  aspect-ratio: 4 / 5;
  position: relative;
  overflow: hidden;
}

.card__open img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.card:hover .card__open img {
  transform: scale(1.03);
}

.card__open::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent 45%);
  pointer-events: none;
}

.card__name {
  position: absolute;
  left: 0.5rem;
  right: 2.5rem;
  bottom: 0.5rem;
  z-index: 1;
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: rgba(255, 255, 255, 0.9);
}

.card__controls {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
  display: flex;
  gap: 0.35rem;
}

.icon-btn {
  border: 0;
  border-radius: 0.55rem;
  padding: 0.45rem;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  backdrop-filter: blur(6px);
  line-height: 0;
}

.icon-btn:hover {
  background: rgba(0, 0, 0, 0.7);
}

.icon-btn.is-on {
  background: var(--amber);
  color: var(--ink);
}

.icon-btn svg {
  width: 1rem;
  height: 1rem;
  display: block;
}

.empty,
.status {
  margin-top: 2rem;
  padding: 3rem 1.5rem;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 1rem;
  background: color-mix(in oklab, var(--panel) 60%, transparent);
}

.empty h3,
.status h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin: 0;
}

.empty p,
.status p {
  margin: 0.75rem auto 0;
  max-width: 28rem;
  color: var(--mist);
  font-size: 0.9rem;
  line-height: 1.55;
}

.empty code,
.status code,
.site-footer code {
  border-radius: 0.35rem;
  background: rgba(0, 0, 0, 0.3);
  color: var(--amber);
  padding: 0.1rem 0.4rem;
  font-size: 0.85em;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 1.25rem;
  text-align: center;
  color: var(--mist);
  font-size: 0.875rem;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
}

.lightbox.is-open {
  display: flex;
}

.lightbox__panel {
  width: min(64rem, 100%);
}

.lightbox__panel img {
  max-height: 80vh;
  width: auto;
  max-width: 100%;
  margin: 0 auto;
  border-radius: 0.6rem;
  object-fit: contain;
}

.lightbox__bar {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
}

.spin {
  width: 1rem;
  height: 1rem;
  border: 2px solid color-mix(in oklab, var(--foam) 25%, transparent);
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
