:root {
  --bg: gainsboro;
  --text: #111;
  --muted: #666;
  --nav-w: 180px;
  --subnav-w: 160px;
  --lb-edge: 28px;

  --font: "Pretendard Variable", Pretendard, -apple-system, Arial, sans-serif;
}

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

*:not(#lbClose):not(#lbPrev):not(#lbNext) {
  cursor: default !important;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  letter-spacing: 0.01rem;
  min-height: 100dvh;
}

/* ── HEADER (mobile only) ─────────────────────────────────────────────────── */
#mobileHeader {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--bg);
  justify-content: space-between;
  align-items: baseline;
  padding: 18px 28px 14px;
}

.site-title {
  font-size: 1rem;
  font-weight: 400;
  cursor: pointer;
}

.menu-toggle {
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 400;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
}

/* ── LAYOUT ───────────────────────────────────────────────────────────────── */
.layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.layout-inner {
  display: flex;
  flex: 1;
}

/* ── DESKTOP NAV ──────────────────────────────────────────────────────────── */
#desktopNav {
  width: var(--nav-w);
  min-width: var(--nav-w);
  padding: 60px 0 60px 60px;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 50;
}

#desktopSubNav {
  display: none;
  margin-top: 0;
  padding-top: 0;
  position: fixed;
  top: 0;
  left: var(--nav-w);
  width: var(--subnav-w);
  height: 100vh;
  padding: 124px 0 60px 20px;
  overflow-y: auto;
  z-index: 49;
}

#desktopSubNav.visible {
  display: block;
}

nav a,
#desktopSubNav a {
  display: block;
  font-size: 1rem;
  line-height: 1.55;
  font-weight: 400;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s;
}

nav a:hover,
.site-title:hover,
#desktopSubNav a:hover {
  color: var(--muted);
}

nav a.active,
#desktopSubNav a.active {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.nav-group {
  margin-bottom: 20px;
}

/* ── MAIN CONTENT ─────────────────────────────────────────────────────────── */
main {
  margin-left: calc(var(--nav-w) + 100px);
  width: calc(95vw - var(--nav-w) - 100px - 40px);
  padding: 124px 40px 60px 0;
  min-width: 0;
  transition: margin-left 0.2s, width 0.2s;
}

main.subnav-open {
  margin-left: calc(var(--nav-w) + var(--subnav-w) + 45px);
  width: calc(95vw - var(--nav-w) - var(--subnav-w) - 45px - 40px);
}

.section {
  display: none;
}

.section.active {
  display: block;
}

/* ── TEXT ─────────────────────────────────────────────────────────────────── */
.text-block {
  max-width: 80vw;
  margin-bottom: 32px;
}

.text-block p {
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.65;
  margin-bottom: 12px;
}

/* ── IMAGES ───────────────────────────────────────────────────────────────── */
img {
  display: block;
}

.image__container {
  width: 100%;
  background: var(--bg);
  overflow: hidden;
}

.image__container img {
  width: 100%;
  height: auto;
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
}

.image__container img.loaded {
  opacity: 1;
}

.image__caption {
  font-size: 12px;
  color: var(--muted);
  line-height: 2rem;
}

.image-grid .img-wrap,
.image-single {
  border: 1.2px solid transparent;  
}

.image-grid {
  columns: 3;
  column-gap: 50px;
}

.image-grid .img-wrap {
  break-inside: avoid;
  margin-bottom: 50px;
}

.image-single {
  width: 100%;
  margin-bottom: 12px;
  cursor: pointer;
}

.image-grid.bower {
  columns: 2; 
  column-gap: 40px;       
}

.image-grid.bower .img-wrap {
  margin-bottom: 40px;  
}

/* ── FOOTER ───────────────────────────────────────────────────────────────── */
footer {
  padding: 38px 32px 40px 40px;
  font-size: 0.8rem;
  color: var(--text);
  transition: padding-left 0.2s;
}

footer.subnav-open {
  padding-left: 40px;
}

/* ── LIGHTBOX ─────────────────────────────────────────────────────────────── */
#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  background: var(--bg);
  flex-direction: column;
}

#lightbox.open {
  display: flex;
}

.lb-header {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  padding: 18px var(--lb-edge) 14px;
  flex-shrink: 0;
}

.lb-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  padding: 60px;
  margin: -60px;
  line-height: 1;
}

.lb-close svg,
.lb-arrow svg {
  display: block;
  stroke: currentColor;
  fill: none;
}

.lb-body {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  padding: 20px 0 calc(20px + 47px);
  min-height: 0;
}

.lb-body img {
  flex: 1;
  min-width: 0;
  min-height: 0;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.lb-arrow {
  flex-shrink: 0;
  width: calc(var(--lb-edge) + 20px);
  min-width: calc(var(--lb-edge) + 20px + 33px);
  min-height: 160px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: var(--text);
  align-self: center;
}

/* ── MOBILE NAV OVERLAY ───────────────────────────────────────────────────── */
#mobileNav {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  overflow-y: auto;
  padding: 18px 28px 40px;
}

.mobile-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 40px;
}

#mobileSubNav {
  display: none;
}

#mobileSubNav.open {
  display: block;
}

.mobile-subnav-back {
  display: block;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-bottom: 24px;
  line-height: 1.55;
}

#mobileNavMain.hidden {
  display: none;
}

#mobileNav nav {
  position: static;
  width: auto;
  height: auto;
  padding: 0;
  overflow: visible;
}

#mobileNav nav a {
  line-height: 1.7;
}

/* ── MQ ─────────────────────────────────────────────────────----──────────── */
@media (min-width: 680px) {
  .image-grid .img-wrap:hover,
  .image-single:hover {
    border: 1.2px solid black;
  }

  .lb-arrow:hover, .lb-close:hover { color: var(--muted); }
  .lb-arrow[style*="hidden"] { pointer-events: none; }
}

@media (max-width: 680px) {
  :root {
    --lb-edge: 22px;
  }

  #desktopNav {
    display: none;
  }

  #home .text-block {
    display: none;
  }

  main,
  main.subnav-open {
    width: auto;
    margin-left: 0;
    padding: 80px 28px 40px;
  }

  .image-grid {
    columns: 3;
    column-gap: 10px;
  }

  .image-grid .img-wrap {
    margin-bottom: 10px;
  }

  .image-grid.bower {
    columns: 2;
    column-gap: 20px;       
  }

  .image-grid.bower .img-wrap {
    margin-bottom: 20px;  
  }

  .lb-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    min-width: 0;
    min-height: 0;
    width: auto;
    height: auto;
    padding: 20px; 
    z-index: 510;  
  }

  .lb-arrow.prev {
    left: 0px;
  }

  .lb-arrow.next {
    right: 0px;
  }

  .lb-body {
    position: relative;
    padding: 25px; 
  }

  .lb-body img {
    max-width: 100%;
    max-height: 100%;
    padding: 0 var(--lb-edge);
  }

  footer,
  footer.subnav-open {
    padding: 30px 22px 28px;
  }
}

@media (min-width: 681px) and (max-width: 1112px) {
  :root {
    --nav-w: 170px;
    --subnav-w: 150px;
  }

  .layout {
    min-height: 100dvh;
  }

  #desktopNav {
    padding: 40px 0 40px 32px;
  }

  #desktopNav .site-title {
    margin-bottom: 35px !important;
  }

  #desktopSubNav {
    padding: 99px 0 0 0;
  }

  main {
    margin-left: calc(var(--nav-w) + 25px);
    width: calc(98vw - var(--nav-w) - 25px - 24px);
    padding: 99px 24px 20px 0;
  }

  main.subnav-open {
    margin-left: calc(var(--nav-w) + var(--subnav-w) + 25px);
    width: calc(98vw - var(--nav-w) - var(--subnav-w) - 25px - 40px);
  }

  .image-grid {
    column-gap: 10px;
  }

  .image-grid .img-wrap {
    margin-bottom: 10px;
  }

  .image-grid.bower {
    column-gap: 20px;
  }

  .image-grid.bower .img-wrap {
    margin-bottom: 20px;
  }
}

@media (min-width: 2500px) {
  :root {
    --nav-w: 210px;
  }

  main {
    margin-left: calc(var(--nav-w) + 45px);
    width: calc(90vw - var(--nav-w) - 45px - 60px);
    padding: 124px 60px 60px 60px;
  }

  main.subnav-open {
    margin-left: calc(var(--nav-w) + var(--subnav-w) + 45px);
    width: calc(90vw - var(--nav-w) - var(--subnav-w) - 45px - 60px);
  }

  .image-grid.bower {
    max-width: 70vw; 
    padding-left: 2.5vw;
  }  
}