:root {
  --background: #fcfaf6;
  --foreground: #1c1610;
  --font-serif: "Kalam", "Fraunces", Georgia, serif;
  --font-sans: "Kalam", system-ui, sans-serif;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

body.lightbox-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* View toggle */
.view-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: 9999px;
  border: 1px solid color-mix(in oklab, var(--foreground) 10%, transparent);
  background: color-mix(in oklab, var(--background) 80%, transparent);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
  backdrop-filter: blur(12px);
}

@media (min-width: 640px) {
  .view-toggle {
    top: 1.5rem;
    right: 1.5rem;
  }
}

.view-toggle button {
  appearance: none;
  border: 0;
  background: transparent;
  border-radius: 9999px;
  padding: 0.375rem 1rem;
  font: inherit;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: color-mix(in oklab, var(--foreground) 60%, transparent);
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.view-toggle button:hover {
  color: var(--foreground);
}

.view-toggle button[aria-checked="true"] {
  background: var(--foreground);
  color: var(--background);
}

/* Main gallery */
.gallery-main {
  width: 100%;
  flex: 1;
  padding: 6rem 1rem 6rem;
}

@media (min-width: 640px) {
  .gallery-main {
    padding: 8rem 2rem 6rem;
  }
}

.gallery-grid {
  display: grid;
  width: 100%;
}

.gallery-grid[data-columns="1"] {
  grid-template-columns: repeat(1, minmax(0, 1fr));
  column-gap: 24px;
  row-gap: 32px;
}

.gallery-grid[data-columns="4"] {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 56px;
  row-gap: 72px;
}

.gallery-item {
  position: relative;
  aspect-ratio: 1;
  margin: 0;
  cursor: pointer;
}

.gallery-item__tilt {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
  transition: transform 0.5s ease-out;
}

.gallery-item:hover .gallery-item__tilt {
  transform: rotate(0deg) scale(1) !important;
}

.gallery-item__frame {
  position: relative;
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: color-mix(in oklab, var(--foreground) 3%, transparent);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.06);
}

.gallery-item__frame img {
  height: 100%;
  width: 100%;
  object-fit: cover;
  transition: transform 0.7s ease-out, filter 0.7s ease-out;
}

.gallery-item:hover .gallery-item__frame img {
  transform: scale(1.05);
  filter: brightness(0.75);
}

.gallery-item__label {
  pointer-events: none;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 0.75rem;
  background: linear-gradient(to top left, rgb(0 0 0 / 0.5), transparent 55%);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.gallery-item:hover .gallery-item__label {
  opacity: 1;
}

.gallery-item__label span {
  font-family: var(--font-serif);
  font-size: 0.875rem;
  letter-spacing: 0.025em;
  color: #fff;
  text-shadow: 0 1px 2px rgb(0 0 0 / 0.35);
}

.subheadline-slot {
  display: flex;
  aspect-ratio: 1;
  align-items: center;
  justify-content: center;
}

.subheadline-slot p {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: color-mix(in oklab, var(--foreground) 70%, transparent);
}

@media (min-width: 640px) {
  .subheadline-slot p {
    font-size: 1.875rem;
  }
}

.brand-header {
  margin: 8rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

@media (min-width: 640px) {
  .brand-header {
    margin: 10rem 0;
  }
}

.brand-header h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: 3rem;
  letter-spacing: -0.025em;
  color: var(--foreground);
}

@media (min-width: 640px) {
  .brand-header h1 {
    font-size: 4.5rem;
  }
}

@media (min-width: 768px) {
  .brand-header h1 {
    font-size: 6rem;
  }
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  flex-direction: column;
  background: color-mix(in oklab, var(--background) 95%, transparent);
  backdrop-filter: blur(24px);
  animation: fade-in 0.3s ease;
}

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

.lightbox__close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 9999px;
  background: transparent;
  color: color-mix(in oklab, var(--foreground) 60%, transparent);
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.lightbox__close:hover {
  background: color-mix(in oklab, var(--foreground) 5%, transparent);
  color: var(--foreground);
}

.lightbox__stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.5rem 1rem;
}

@media (min-width: 640px) {
  .lightbox__stage {
    padding: 4rem 4rem 1rem;
  }
}

.lightbox__stage img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  cursor: pointer;
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
  animation: zoom-in 0.5s ease;
}

.lightbox__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-top: 1px solid color-mix(in oklab, var(--foreground) 10%, transparent);
  padding: 1.25rem 2rem;
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: color-mix(in oklab, var(--foreground) 40%, transparent);
}

@media (min-width: 640px) {
  .lightbox__meta {
    padding: 1.25rem 4rem;
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes zoom-in {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* Footer */
.site-footer {
  margin-top: 6rem;
  border-top: 1px solid color-mix(in oklab, var(--foreground) 10%, transparent);
  padding: 2rem 0;
}

.site-footer__inner {
  margin: 0 auto;
  max-width: 72rem;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  padding: 0 1.5rem;
  font-size: 0.75rem;
  letter-spacing: 0.025em;
  color: color-mix(in oklab, var(--foreground) 50%, transparent);
}

.site-footer__ms {
  letter-spacing: 0.3em;
  justify-self: start;
}

.site-footer__center {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-self: center;
}

.site-footer a {
  transition: color 0.2s ease;
}

.site-footer a:hover {
  color: var(--foreground);
}

.site-footer__impressum {
  justify-self: end;
}

.site-footer svg {
  width: 1rem;
  height: 1rem;
  display: block;
}

/* Impressum */
.impressum-main {
  margin: 0 auto;
  width: 100%;
  max-width: 42rem;
  flex: 1;
  padding: 6rem 1.5rem 3rem;
}

@media (min-width: 640px) {
  .impressum-main {
    padding-top: 8rem;
  }
}

.back-link {
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: color-mix(in oklab, var(--foreground) 50%, transparent);
  transition: color 0.2s ease;
}

.back-link:hover {
  color: var(--foreground);
}

.impressum-main h1 {
  margin: 3rem 0 0;
  font-family: var(--font-serif);
  font-weight: 300;
  font-style: italic;
  font-size: 2.25rem;
  color: var(--foreground);
}

@media (min-width: 640px) {
  .impressum-main h1 {
    font-size: 3rem;
  }
}

.impressum-body {
  margin-top: 4rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  font-family: var(--font-serif);
  font-size: 1.125rem;
  line-height: 1.625;
  color: color-mix(in oklab, var(--foreground) 80%, transparent);
}

.impressum-body p {
  margin: 0;
}

.impressum-label {
  margin-bottom: 0.75rem;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: color-mix(in oklab, var(--foreground) 50%, transparent);
}

.impressum-body a {
  text-decoration: underline;
  text-decoration-color: color-mix(in oklab, var(--foreground) 20%, transparent);
  text-underline-offset: 4px;
  transition: text-decoration-color 0.2s ease;
}

.impressum-body a:hover {
  text-decoration-color: var(--foreground);
}

@media (max-width: 480px) {
  .site-footer__inner {
    gap: 0.5rem;
    font-size: 0.65rem;
  }

  .site-footer__center {
    flex-direction: column;
    gap: 0.35rem;
    text-align: center;
  }
}
