@font-face {
  font-family: 'Futura';
  src: url('images/futura.ttc') format('truetype');
  font-weight: normal;
  font-style: normal;
}

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

:root {
  --off-white: #efede9;
  --chrome: #1f1f21;
  --black: #000000;
  --white: #ffffff;
  --text: #1a1a1a;
  --muted: #7d7d7d;
  --mat: clamp(22px, 2.6vw, 36px);
  --wb: 4px;
  --frame-max: min(684px, 58vw);
  --frame-inner-ratio: 1.79;
  --card-top-pad: clamp(38px, 5vh, 72px);
  --card-side-pad: clamp(24px, 4vw, 48px);
  --bottom-nav-space: 174px;
  --gallery-nav-gap: 22px;
  --bottom-nav-offset: clamp(74px, 9vh, 102px);
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--chrome);
  font-family: 'Futura', 'Century Gothic', sans-serif;
  color: var(--text);
  font-size: 13px;
  letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
}

a {
  color: inherit;
}

#landing {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  background: #000;
  transition: opacity 0.55s ease;
}

#landing.out {
  opacity: 0;
  pointer-events: none;
}

.l-bg {
  position: absolute;
  inset: 0;
  background: url('images/bg.jpg') center/cover no-repeat;
  filter: blur(18px);
  transform: scale(1.08);
}

.l-card {
  position: relative;
  width: 260px;
  height: clamp(377px, 45vh, 486px);
  background: #000;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: clamp(44px, 5.6vh, 62px) clamp(24px, 2vw, 32px) clamp(32px, 4.4vh, 42px);
  text-align: center;
}

.l-card h1 {
  width: 100%;
  font-size: clamp(35px, 1vw, 20px);
  line-height: 0.94;
  margin-bottom: 10px;
  white-space: nowrap;
  font-weight: 400;
  letter-spacing: 2px;
}

.l-card h1,
.l-location,
.l-links,
.l-footer {
  width: 100%;
}

.l-location {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: clamp(14px, 1vw, 20px);
  line-height: 1;
  white-space: nowrap;
}

.l-line {
  width: clamp(36px, 3vw, 58px);
  height: 1px;
  background: currentColor;
  opacity: 0.9;
  flex: 0 0 auto;
}

.l-links {
  width: 100%;
  margin-top: auto;
  margin-bottom: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.l-links a {
  width: 100%;
  font-size: clamp(14px, 1.05vw, 20px);
  text-decoration: none;
  cursor: pointer;
  line-height: 1.18;
}

.l-links a:first-child {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-align: left;
}

.l-links a:last-child {
  text-align: right;
}

.l-footer {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: clamp(14px, 1vw, 19px);
  line-height: 1;
  white-space: nowrap;
}

.l-footer::before {
  content: '';
  order: 2;
  width: clamp(24px, 2vw, 34px);
  height: 1px;
  background: currentColor;
}

.l-email { order: 1; }
.l-copy { order: 3; }

#site {
  position: fixed;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}

#site.visible {
  opacity: 1;
  pointer-events: all;
}

#page-label {
  position: absolute;
  top: 12px;
  left: 18px;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
  pointer-events: none;
  z-index: 5;
}

#menu-toggle {
  position: absolute;
  top: 18px;
  right: 22px;
  z-index: 30;
  width: 34px;
  height: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
}

#menu-toggle span {
  display: block;
  height: 1px;
  width: 100%;
  background: var(--text);
}

#menu-toggle:hover,
#menu-close:hover {
  opacity: 0.45;
}

#site-menu {
  position: absolute;
  inset: 0;
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
}

#site-menu.visible {
  opacity: 1;
  pointer-events: all;
}

#site-menu-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
}

#site-menu-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(420px, 100%);
  height: 100%;
  padding: clamp(78px, 10vh, 110px) clamp(28px, 4vw, 48px);
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

#menu-close {
  position: absolute;
  top: 18px;
  right: 22px;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
}

#site-menu-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
}

.site-menu-link {
  text-decoration: none;
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.site-menu-link:hover,
.site-menu-link.active {
  text-decoration: underline;
  text-underline-offset: 4px;
}

#main-card {
  position: fixed;
  inset: 0;
  background: var(--off-white);
}

#gallery-view,
#about-view {
  position: absolute;
  inset: 0;
}

#gallery-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: var(--card-top-pad) var(--card-side-pad) 0;
  transition: opacity 0.28s ease;
}

#gallery-view.hidden {
  opacity: 0;
  pointer-events: none;
}

#photo-frame {
  background: var(--black);
  padding: var(--mat);
  width: 100%;
  max-width: var(--frame-max);
  flex: 0 0 auto;
}

#photo-inner {
  border: var(--wb) solid var(--white);
  overflow: hidden;
  aspect-ratio: var(--frame-inner-ratio);
  background: #000;
}

#photo-inner img,
#photo-inner iframe,
#photo-inner video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

#gallery-nav {
  width: 100%;
  max-width: 480px;
  margin-top: var(--gallery-nav-gap);
  flex: 0 0 auto;
}

.nav-row {
  display: flex;
  align-items: center;
  width: 100%;
}

.nav-bottom-row {
  margin-top: 11px;
}

.nav-word,
.nav-counter,
#gallery-title,
#gallery-plus,
.nav-arrow {
  font-size: 12px;
  line-height: 1;
}

.nav-word,
.nav-counter,
#gallery-title,
#gallery-plus {
  letter-spacing: 0.03em;
}

.nav-button,
.nav-arrow,
#gallery-title,
#gallery-plus {
  cursor: pointer;
  transition: opacity 0.18s ease;
}

.nav-button:hover,
.nav-arrow:hover,
#gallery-title:hover,
#gallery-plus:hover {
  opacity: 0.42;
}

.nav-button.disabled,
.nav-arrow.disabled {
  opacity: 0.18;
  pointer-events: none;
}

.nav-line {
  flex: 1;
  height: 1px;
  background: var(--text);
  margin: 0 14px;
}

.nav-arrow {
  font-size: 22px;
  min-width: 32px;
}

#gallery-title-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  padding: 0 10px;
}

#gallery-title {
  min-width: 0;
  text-align: center;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 700;
}

#gallery-plus {
  flex: 0 0 auto;
  font-size: 17px;
  transform: translateY(-1px);
}

#bottom-nav,
#about-bnav {
  position: absolute;
  left: 50%;
  bottom: var(--bottom-nav-offset);
  transform: translateX(-50%);
  text-align: center;
  width: max-content;
  z-index: 12;
}

#about-bnav {
  opacity: 0;
  pointer-events: none;
}

#about-view.visible ~ #bottom-nav {
  opacity: 0;
  pointer-events: none;
}

#about-view.visible ~ #about-bnav {
  opacity: 1;
  pointer-events: auto;
}

.bnav-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.bnav-row + .bnav-row {
  margin-top: 8px;
}

.bnav-dot {
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  width: 14px;
  text-align: center;
}

.bnav-link {
  font-size: 12px;
  letter-spacing: 0.03em;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.18s ease;
  user-select: none;
}

.bnav-link:hover {
  opacity: 0.45;
}

.bnav-link.active {
  text-decoration: underline;
  text-underline-offset: 3px;
}

#detail-panel {
  position: absolute;
  top: var(--card-top-pad);
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--frame-max);
  bottom: var(--bottom-nav-space);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.34s ease;
  z-index: 10;
}

#detail-panel.visible {
  opacity: 1;
  pointer-events: all;
}

#detail-border {
  width: 100%;
  height: 100%;
  border: 1px solid #7b7b7b;
  background: transparent;
  position: relative;
  overflow: hidden;
}

#detail-back {
  position: absolute;
  top: 22px;
  left: 28px;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  z-index: 3;
  padding: 2px;
}

#detail-scroll {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 62px 36px 26px;
  scrollbar-width: thin;
  scrollbar-color: #c2c2c2 transparent;
}

#detail-scroll::-webkit-scrollbar {
  width: 5px;
}

#detail-scroll::-webkit-scrollbar-thumb {
  background: #cccccc;
  border-radius: 3px;
}

#detail-content {
  max-width: 500px;
}

#detail-content h1 {
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 12px;
}

.d-meta,
.d-links,
.d-essay-sub,
.d-essay-body {
  font-size: clamp(12px, 0.92vw, 15px);
}

.d-meta {
  margin-bottom: 3px;
}

.d-links {
  margin-bottom: 30px;
}

.d-links a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.d-links a:hover,
#detail-back:hover {
  opacity: 0.5;
}

.d-img img {
  display: block;
  width: 100%;
  max-width: 320px;
  ;
  margin-bottom: 9px;
}

.d-caption {
  max-width: 340px;
  font-size: 11px;
  line-height: 1.3;
  font-style: italic;
  margin-bottom: 24px;
}

.d-essay-title {
  font-size: clamp(20px, 1.8vw, 26px);
  line-height: 1.15;
  font-weight: 700;
  margin-bottom: 2px;
}

.d-essay-sub {
  font-size: clamp(14px, 1.2vw, 18px);
  margin-bottom: 12px;
}

.d-essay-body {
  line-height: 1.55;
  max-width: 640px;
  text-wrap: pretty;
}

#about-view {
  background: var(--off-white);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.32s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: var(--card-top-pad) var(--card-side-pad) 0;
}

#about-view.visible {
  opacity: 1;
  pointer-events: all;
}

#about-card {
  width: 100%;
  max-width: var(--frame-max);
  border: 1px solid #8a8a8a;
  padding: 26px 36px 24px;
  background: transparent;
  max-height: calc(100vh - var(--bottom-nav-space) - var(--card-top-pad));
  overflow-y: auto;
}

#about-card img {
  width: 100%;
  max-width: 320px;
  display: block;
  margin-bottom: 14px;
  filter: grayscale(100%);
}

#about-card h2 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.about-para {
  font-size: 12px;
  line-height: 1.8;
  margin-bottom: 13px;
}

.about-para a,
.about-disclaimer a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.about-disclaimer {
  font-size: 10px;
  line-height: 1.6;
  color: #666;
  font-style: italic;
  margin-top: 12px;
}

/* Lightbox styles */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

#lightbox.visible {
  opacity: 1;
  pointer-events: all;
}

#lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
}

#lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 40px;
  color: white;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1001;
}

#lightbox-prev,
#lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 40px;
  color: white;
  background: none;
  border: none;
  cursor: pointer;
  padding: 20px;
  z-index: 1001;
}

#lightbox-prev { left: 20px; }
#lightbox-next { right: 20px; }

#lightbox-prev.disabled,
#lightbox-next.disabled {
  opacity: 0.3;
  pointer-events: none;
}

@media (max-width: 1100px) {
  :root {
    --frame-max: min(620px, 68vw);
    --bottom-nav-space: 162px;
  }
}

@media (max-width: 800px) {
  :root {
    --frame-max: min(92vw, 620px);
    --card-top-pad: 32px;
    --card-side-pad: 18px;
    --bottom-nav-space: 144px;
    --bottom-nav-offset: 56px;
  }

  #gallery-nav {
    max-width: 92vw;
  }

  #detail-scroll {
    padding: 58px 24px 20px;
  }
}

@media (max-width: 600px) {
  html, body {
    overflow: auto;
  }

  .l-bg {
    display: none;
  }

  .l-card {
    width: min(78vw, 290px);
    height: auto;
    min-height: 362px;
    padding: 36px 18px 26px;
  }

  .l-card h1 {
    font-size: 34px;
  }

  .l-location {
    font-size: 13px;
    gap: 6px;
  }

  .l-line {
    width: 28px;
  }

  .l-links {
    gap: 4px;
    margin-top: 86px;
    margin-bottom: 86px;
  }

  .l-links a,
  .l-footer {
    font-size: 13px;
  }

  :root {
    --frame-max: calc(100vw - 32px);
    --bottom-nav-space: 116px;
    --gallery-nav-gap: 16px;
    --bottom-nav-offset: 22px;
  }

  #page-label {
    top: 10px;
    left: 12px;
  }

  /* Hide hamburger on mobile */
  #menu-toggle {
    display: none;
  }

  #menu-close {
    top: 12px;
    right: 16px;
  }

  #gallery-view,
  #about-view {
    padding-left: 16px;
    padding-right: 16px;
  }

  #photo-frame {
    padding: 18px;
  }

  .nav-word,
  .nav-counter,
  #gallery-title,
  #gallery-plus {
    font-size: 11px;
  }

  #gallery-plus {
    font-size: 16px;
  }

  .nav-arrow {
    font-size: 20px;
    min-width: 24px;
  }

  .nav-line {
    margin: 0 8px;
  }

  #bottom-nav,
  #about-bnav {
    bottom: var(--bottom-nav-offset);
  }

  .bnav-link,
  .bnav-dot {
    font-size: 11px;
  }

  #detail-panel {
    top: 24px;
    bottom: 86px;
  }

  #detail-back {
    top: 14px;
    left: 16px;
    font-size: 20px;
  }

  #detail-scroll {
    padding: 44px 16px 16px;
  }

  #detail-content h1 {
    font-size: 18px;
  }

  .d-meta,
  .d-links,
  .d-essay-sub,
  .d-essay-body {
    font-size: 11px;
  }

  .d-essay-title {
    font-size: 16px;
  }

  #about-card {
    padding: 18px 18px 16px;
  }

  /* Lightbox adjustments on mobile */
  #lightbox-prev,
  #lightbox-next {
    font-size: 30px;
    padding: 10px;
  }
  #lightbox-close {
    font-size: 30px;
    top: 10px;
    right: 15px;
  }
}