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

:root {
  --bg: #0a0a0a;
  --bg-surface: #141414;
  --text: #e0e0e0;
  --text-muted: #888;
  --border: #222;
  --font: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --max-width: 1400px;
  /* Frame */
  --frame-color: #4a4a4a;
  --frame-width: 3px;
  --mat-color: #f5f2ee;
  --mat-inner: #e8e4df;
}

html {
  font-size: 16px;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow: hidden;
}

/* --- Header --- */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: center;
}

.header-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.logo {
  display: block;
  height: 28px;
  width: auto;
}

.location {
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* --- Gallery Viewer --- */
.gallery-viewer {
  position: fixed;
  inset: 0;
  top: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  user-select: none;
}

/* --- Photo Frame --- */
.frame {
  position: relative;
  background: var(--mat-color);
  border: var(--frame-width) solid var(--frame-color);
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,0.08),
    0 4px 24px rgba(0,0,0,0.5),
    0 1px 4px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 90vw;
  max-height: calc(100vh - 120px);
  transition: opacity 0.3s ease;
}

/* Landscape mat: more space top/bottom, less on sides */
.frame.landscape {
  padding: 72px 56px 88px;
}

/* Portrait mat: more space left/right, less on top/bottom */
.frame.portrait {
  padding: 56px 76px 84px;
}

/* Square mat */
.frame.square {
  padding: 64px 64px 84px;
}

/* Inner bevel around the photo */
.frame-inner {
  position: relative;
  border: 1px solid var(--mat-inner);
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,0.05),
    2px 3px 12px rgba(0,0,0,0.25),
    1px 1px 4px rgba(0,0,0,0.15);
  line-height: 0;
}

.frame-inner img {
  display: block;
  max-width: calc(90vw - 100px);
  max-height: calc(100vh - 310px);
  width: auto;
  height: auto;
  object-fit: contain;
}

/* --- Watermark --- */
.watermark {
  position: absolute;
  left: 50%;
  transform: translate(-50%, 50%);
  height: auto;
  opacity: 0.5;
  pointer-events: none;
  display: block;
}

.frame.landscape .watermark {
  bottom: 44px;
}

.frame.portrait .watermark {
  bottom: 42px;
}

.frame.square .watermark {
  bottom: 42px;
}

/* --- Navigation Arrows --- */
.gallery-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 2rem;
  cursor: pointer;
  padding: 1.5rem 1rem;
  opacity: 0.5;
  transition: opacity 0.2s, color 0.2s;
  font-weight: 200;
}

.gallery-nav:hover {
  opacity: 1;
  color: #fff;
}

.gallery-prev {
  left: 0.5rem;
}

.gallery-next {
  right: 0.5rem;
}

/* --- Copyright --- */
.copyright {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  padding: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  opacity: 0.6;
  z-index: 50;
}

/* --- Transition --- */
.frame.fade-out {
  opacity: 0;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  nav {
    padding: 1rem 1.5rem;
  }

  .gallery-viewer {
    padding: 1rem;
  }

  .frame.landscape {
    padding: 40px 32px 54px;
  }

  .frame.portrait {
    padding: 32px 44px 52px;
  }

  .frame.square {
    padding: 36px 36px 52px;
  }

  .frame-inner img {
    max-width: calc(100vw - 100px);
    max-height: calc(100vh - 270px);
  }

  .frame.landscape .watermark { bottom: 27px; }
  .frame.portrait .watermark { bottom: 26px; }
  .frame.square .watermark { bottom: 26px; }

  .gallery-nav {
    font-size: 1.5rem;
    padding: 1rem 0.5rem;
  }
}

@media (max-width: 480px) {
  .logo {
    height: 22px;
  }

  .frame.landscape {
    padding: 28px 22px 42px;
  }

  .frame.portrait {
    padding: 22px 32px 40px;
  }

  .frame.square {
    padding: 26px 26px 40px;
  }

  .frame.landscape .watermark { bottom: 21px; }
  .frame.portrait .watermark { bottom: 20px; }
  .frame.square .watermark { bottom: 20px; }

  .frame-inner img {
    max-width: calc(100vw - 70px);
    max-height: calc(100vh - 250px);
  }
}
