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

:root {
  --black: #0a0a0a;
  --white: #ffffff;
  --orange: #ff5500;
  --pad: 25px;
  --col: calc((100vw - 2 * var(--pad)) / 3);
}

html, body {
  width: 100%; height: 100%;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1;
  overflow: hidden;
}

/* ── NAV ── */
.site-nav {
  position: absolute;
  top: var(--pad);
  left: var(--pad);
  right: var(--pad);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  z-index: 100;
}
.site-nav a {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 1rem;
  text-decoration: underline;
  background: none; border: none;
  color: inherit;
  display: inline-block;
  cursor: pointer;
}
.nav-home   { grid-column: 1; justify-self: start; }
.nav-tattoo { grid-column: 2; justify-self: start; }
.nav-col3   { grid-column: 3; display: flex; justify-content: space-between; }
.nav-hidden { visibility: hidden; pointer-events: none; }

/* ── HOME ── */
body.page-home {
  background: var(--white);
  color: var(--black);
}

#home-text {
  position: absolute;
  top: calc(var(--pad) + 50px);
  left: var(--pad);
  width: var(--col);
  pointer-events: none;
  z-index: 50;
}
#home-text p { margin-bottom: 14px; }
#home-text a {
  pointer-events: all;
  font-style: italic;
  color: var(--black);
  cursor: pointer;
  text-decoration: none;
}
#home-text a.download-link {
  font-style: normal;
  font-weight: normal;
  text-decoration: underline;
}

#click-hint {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 50;
  color: #999;
  pointer-events: none;
  transition: opacity 0.5s;
  white-space: nowrap;
}

.home-img {
  position: absolute;
  max-height: 250px;
  max-width: 250px;
  width: auto;
  height: auto;
  cursor: grab;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: all;
  display: block;
}
.home-img.dragging { cursor: grabbing; }
body.page-home.dragging-active { user-select: none; }

/* ── TATTOO ── */
body.page-tattoo {
  background: var(--black);
  color: var(--white);
}

#tattoo-text-left {
  position: absolute;
  top: calc(var(--pad) + 50px);
  left: var(--pad);
  width: var(--col);
  z-index: 10;
}
#tattoo-text-left a {
  font-style: normal;
  color: var(--white);
  text-decoration: underline;
  cursor: pointer;
}

#tattoo-text-right {
  position: absolute;
  top: calc(var(--pad) + 50px);
  left: calc(var(--pad) + 2 * var(--col));
  width: calc(var(--col) - 30px);
  z-index: 10;
}

#orange-dot {
  position: absolute;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--orange);
  right: calc(var(--pad) + 12px - 8px);
  top: calc(var(--pad) + 50px + 4px - 8px);
  cursor: grab;
  user-select: none;
  -webkit-user-drag: none;
  z-index: 2;
}
#orange-dot.dragging { cursor: grabbing; }

.gallery-wrap {
  position: absolute;
  left: 0; right: 0;
  bottom: 0;
  top: calc(var(--pad) + 50px + 53px);
  display: flex;
  flex-direction: column;
  gap: 0;
  z-index: 10;
}

.gallery-track-wrap {
  flex: 1;
  overflow: hidden;
  position: relative;
}
.gallery-track-wrap + .gallery-track-wrap {
  margin-top: 20px;
}

.gallery-track {
  display: flex;
  gap: 16px;
  padding: 20px var(--pad);
  height: 100%;
  align-items: center;
  will-change: transform;
}

.gallery-track img {
  height: min(250px, calc((100vh - var(--pad) * 2 - 53px) / 2 - 60px));
  width: auto;
  display: block;
  flex-shrink: 0;
  cursor: pointer;
}

/* no blue tap/selection box on touch screens */
.gallery-track, .gallery-track img, #lightbox, #lightbox img {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  outline: none;
}

/* ── LIGHTBOX ── */
#lightbox {
  display: none;
  position: fixed; inset: 0;
  z-index: 1000;
  background: #000000;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
#lightbox.open { display: flex; }
#lightbox img {
  max-width: 100vw;
  max-height: 100vh;
  width: auto; height: auto;
  object-fit: contain;
  cursor: default;
  display: block;
}

/* ── CONTACT ── */
body.page-contact {
  background: var(--white);
  color: var(--black);
}
#contact-body {
  position: absolute;
  top: calc(var(--pad) + 50px);
  left: calc(var(--pad) + var(--col));
  width: var(--col);
}
#contact-body p { margin-bottom: 14px; }
#contact-email-btn {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 1rem;
  font-style: normal;
  background: none;
  border: none;
  padding: 0;
  color: var(--black);
  cursor: pointer;
  text-decoration: none;
}

/* ── LEGAL ── */
body.page-legal {
  background: var(--white);
  color: var(--black);
}
#legal-body {
  position: absolute;
  top: calc(var(--pad) + 50px);
  left: var(--pad);
  right: 0;
  bottom: 0;
  overflow-y: scroll;
  padding-bottom: 60px;
}
#legal-body-inner { width: var(--col); }
#legal-body p { margin-bottom: 10px; }
#legal-body .owner { margin-bottom: 24px; }
#legal-body .divider { text-align: center; margin: 10px 0 20px; }
#legal-body h3 { font-size: 1rem; font-weight: 400; margin: 20px 0 6px; }
#legal-body h4 { font-size: 1rem; font-weight: 400; margin: 14px 0 4px; }

/* ══════════════════════════════════════
   MOBILE
══════════════════════════════════════ */
@media (max-width: 768px) {

  html, body {
    overflow: auto;
    height: auto;
    min-height: 100%;
  }

  .site-nav {
    position: relative;
    top: auto; left: auto; right: auto;
    padding: var(--pad) var(--pad) 0;
    display: flex;
    justify-content: space-between;
    margin-bottom: 24px;
  }
  .nav-col3 { display: contents; }

  /* HOME mobile */
  body.page-home { pointer-events: all; }
  #home-text {
    position: relative;
    top: auto; left: auto;
    width: auto;
    padding: 0 var(--pad);
    pointer-events: all;
  }
  #click-hint { display: block; }

  /* TATTOO mobile */
  body.page-tattoo { overflow-x: hidden; }

  #tattoo-text-left {
    position: relative;
    top: auto; left: auto;
    width: auto;
    padding: 0 var(--pad);
    margin-bottom: 14px;
  }
  #tattoo-text-right {
    position: relative;
    top: auto; left: auto;
    width: auto;
    padding: 0 var(--pad);
    margin-bottom: 24px;
  }
  #orange-dot { display: none; }

  .gallery-wrap {
    position: relative;
    top: auto; left: auto; right: auto; bottom: auto;
    display: block;
    overflow: visible;
    height: auto;
  }
  .gallery-track-wrap {
    overflow: hidden;
    height: 33vh;
    height: 33svh; /* each gallery ≈ 1/3 of the screen height */
    margin-bottom: 16px;
    flex: none;
    touch-action: pan-x;
  }
  .gallery-track {
    display: flex;
    gap: 12px;
    padding: 0 var(--pad);
    height: 100%;
    align-items: center;
    will-change: transform;
    transition: none;
  }
  .gallery-track img {
    height: 100%;
    max-height: none;
    width: auto;
    flex-shrink: 0;
    cursor: pointer;
  }

  /* fullscreen image: fit the visible screen, no scrolling/swiping behind it */
  #lightbox { touch-action: none; }
  #lightbox img {
    max-width: 100%;
    max-height: 100vh;
    max-height: 100dvh;
  }

  /* CONTACT mobile */
  #contact-body {
    position: relative;
    top: auto; left: auto;
    width: auto;
    padding: 0 var(--pad);
  }
  #contact-email-btn { text-decoration: underline; }

  /* LEGAL mobile */
  #legal-body {
    position: relative;
    top: auto; left: auto; right: auto; bottom: auto;
    overflow: visible;
    padding: 0 var(--pad) 60px;
  }
  #legal-body-inner { width: auto; }
}
