/* =====================================================
   Tetsuography — Standalone (Stable)
   - Fixed header
   - Real masonry via JS left/top (NO transform layout)
   - Equal spacing (edge gap == internal gap)
   - Hover focus blur
   - Magnifier cursor
   - Lightbox overlay
===================================================== */

:root {
  --bg: #fff;
  --text: #111;

  --nav-gap: 18px;
  --ui-font: "Times New Roman", Times, serif;

  --header-height: clamp(72px, 3vw, 110px);

  --header-edge: var(--header-height);
  --space: var(--header-edge);

  --gap: calc(var(--space) * 2);
  --gap-y: calc(var(--space) * 2);

  --cursor-size: 18px;
  --cursor-size-hover: 28px;
  --hover-scale: 1.045;

  --ease-ui: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-pop: cubic-bezier(0.22, 1.3, 0.36, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--ui-font);
  font-size: 13px;
  line-height: 1.25;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-user-drag: none;
  user-drag: none;
  user-select: none;
}

/* ===============================
   Header
================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  z-index: 1000;
  background: rgba(255,255,255,0);
}

.header-inner {
  height: 100%;
  width: 100%;
  padding-left: var(--header-edge);
  padding-right: var(--header-edge);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  text-decoration: none;
  color: var(--text);
  font-family: var(--ui-font);
  font-size: 13px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
  text-rendering: geometricPrecision;
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--nav-gap);
}

.mobile-menu-toggle,
.mobile-menu {
  display: none;
}

.nav-link {
  text-decoration: none;
  color: var(--text);
  font-family: var(--ui-font);
  font-size: 13px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
  text-rendering: geometricPrecision;
}

.nav-link,
.nav-link:visited,
.nav-link:active {
  color: var(--text);
}

.nav-instagram,
.nav-instagram:active {
  color: var(--text);
  text-decoration: none;
}

.nav-instagram:hover {
  opacity: 0.75;
}

.nav-link.is-active {
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

/* Push content below header */
.page {
  padding-top: var(--header-height);
}

/* ===============================
   Masonry Container
================================ */
.gallery {
  width: 100%;
}

.masonry {
  position: relative;
  width: 100%;
  overflow: visible;
  padding-left: 0;
  padding-right: 0;
  padding-bottom: 120px;
  min-height: 60vh;
}

.container {
  padding-left: var(--header-edge);
  padding-right: var(--header-edge);
  max-width: 1600px;
  margin: 0 auto;
}

/* ===============================
   Masonry Items
================================ */
.masonry-item {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  filter: blur(0px);
  transform: translateY(18px) scale(0.985);
  will-change: opacity, transform, left, top, filter;
  transition:
    opacity 0.95s cubic-bezier(0.22,1,0.36,1),
    transform 0.95s cubic-bezier(0.22,1,0.36,1),
    filter 0.55s cubic-bezier(0.22,1,0.36,1),
    left 0.55s cubic-bezier(0.22,1,0.36,1),
    top 0.55s cubic-bezier(0.22,1,0.36,1),
    box-shadow 0.7s cubic-bezier(0.22,1,0.36,1);
  backface-visibility: hidden;
}

.masonry.no-move .masonry-item {
  transition:
    opacity 0.95s cubic-bezier(0.22,1,0.36,1),
    transform 0.95s cubic-bezier(0.22,1,0.36,1),
    filter 0.55s cubic-bezier(0.22,1,0.36,1),
    box-shadow 0.7s cubic-bezier(0.22,1,0.36,1);
}

.masonry-item.is-loaded {
  opacity: 0;
  transform: translateY(18px) scale(0.985);
}

.masonry-item.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.masonry.is-hovering .masonry-item {
  transition-delay: 0ms !important;
}

.masonry.is-hovering .masonry-item:not(.is-hovered) {
  opacity: 0.34;
  filter: blur(3.2px) saturate(0.88) contrast(1.06);
}

.masonry-item button {
  all: unset;
  display: block;
  width: 100%;
  height: 100%;
  cursor: none;
  overflow: hidden;
  transform: scale(1);
  transform-origin: 50% 50%;
  will-change: transform;
  transition: transform 720ms cubic-bezier(0.22,1.3,0.36,1);
}

.masonry-item.is-hovered button {
  transform: scale(var(--hover-scale));
}

.masonry-item.is-hovered {
  z-index: 30;
  box-shadow:
    0 18px 42px rgba(0,0,0,0.10),
    0 6px 14px rgba(0,0,0,0.06);
}

.masonry-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: none;
  transition: none;
  image-rendering: -webkit-optimize-contrast;
}

/* ===============================
   Cursor (Magnifier)
================================ */
.masonry, .masonry * { cursor: none !important; }

.custom-cursor {
  position: fixed;
  width: var(--cursor-size);
  height: var(--cursor-size);
  border-radius: 999px;
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 9999;
  opacity: 0;
  background-repeat: no-repeat;
  background-color: rgba(255,255,255,0.09);
  box-shadow:
    0 2px 6px rgba(0,0,0,0.35),
    inset 0 0 2px rgba(255,255,255,0.25);
  transition:
    width 0.2s cubic-bezier(0.22, 1, 0.36, 1),
    height 0.2s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.3s ease;
}

body.cursor-active .custom-cursor { opacity: 1; }
body.cursor-hover .custom-cursor {
  width: var(--cursor-size-hover);
  height: var(--cursor-size-hover);
}

/* ===============================
   Lightbox
================================ */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.92);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms var(--ease-ui);
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.lightbox,
.lightbox * {
  cursor: none !important;
}

.lightbox-stage img {
  max-width: min(96vw, 1400px);
  max-height: 88vh;
  width: auto;
  height: auto;
  display: block;
  transform: none;
  opacity: 1;
  transition: none;
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  border: none;
  background: transparent;
  cursor: pointer;
  user-select: none;
  z-index: 2100;
}

.lightbox-close {
  top: 16px;
  right: 16px;
  font-size: 24px;
  line-height: 1;
  padding: 10px 12px;
}

.lightbox-nav {
  top: 50%;
  margin-top: -40px;
  font-size: 52px;
  padding: 16px 18px;
}

.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }

.lightbox-close svg,
.lightbox-nav svg {
  width: 28px;
  height: 28px;
  display: block;
}

/* ===============================
   About page
================================ */
.about {
  max-width: 1180px;
  margin: 0 auto;
  padding-top: 52px;
  padding-right: var(--header-edge);
  padding-bottom: 110px;
  padding-left: var(--header-edge);
}

.about-grid {
  display: grid;
  grid-template-columns: 370px 520px;
  column-gap: clamp(32px, 4vw, 58px);
  align-items: start;
  justify-content: center;
}

.about-photo {
  width: 100%;
}

.about-photo img {
  display: block;
  width: 100%;
  max-width: 370px;
  height: auto;
  object-fit: cover;
}

.about-text {
  width: 100%;
  max-width: 120ch;
  margin-top: 8px;
}

.about-text h1 {
  font-family: var(--ui-font);
  font-size: 18px;
  line-height: 1.1;
  font-weight: 400;
  letter-spacing: 0;
  margin: 0 0 18px 0;
}

.about-copy {
  display: grid;
  gap: 24px;
  max-width: 100%;
}

.about-lang-block {
  display: grid;
  gap: 14px;
}

.about-lang-block + .about-lang-block {
  padding-top: 24px;
}

.about-lang-block p,
.about-copy p {
  font-family: var(--ui-font);
  font-size: 12.5px;
  line-height: 1.42;
  letter-spacing: 0;
  margin: 0;
}

.about-copy p.jp {
  line-height: 1.48; /* Safari */
}

/* Chrome renders CJK text slightly taller than Safari */
@supports (-webkit-appearance: none) and (not (-moz-appearance: none)) {
  .about-copy p.jp {
    line-height: 1.44;
  }
}

/* ===============================
   Responsive
================================ */
@media (max-width: 1100px) {
  .about {
    max-width: 100%;
    padding-top: 30px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    row-gap: 28px;
    justify-content: start;
  }

  .about-photo img {
    max-width: 360px;
  }

  .about-text {
    max-width: 640px;
  }

  .about-copy {
    gap: 20px;
  }
}

@media (max-width: 720px) {
  .about {
    padding-top: 24px;
    padding-right: 24px;
    padding-bottom: 80px;
    padding-left: 24px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    row-gap: 22px;
  }

  .about-photo img {
    max-width: 100%;
  }

  .about-text {
    max-width: 100%;
  }

  .about-text h1 {
    font-size: 24px;
    margin-bottom: 16px;
  }

  .about-copy {
    gap: 20px;
  }

  .about-lang-block {
    gap: 16px;
  }

  .about-lang-block + .about-lang-block {
    padding-top: 20px;
  }

  .about-copy p {
    font-size: 13px;
    line-height: 1.45;
  }

  .about-copy p.jp {
    line-height: 1.6;
  }

  :root {
    --gap: 10px;
    --gap-y: 10px;
  }

  .header-inner {
    padding-left: 16px;
    padding-right: 16px;
  }

  .nav {
    display: none;
  }

  .mobile-menu-toggle {
    display: inline-flex;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    background: transparent;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    /* sit above the fullscreen menu */
    position: relative;
    z-index: 1002;
  }

  .mobile-menu-toggle span {
    display: block;
    width: 18px;
    height: 1px;
    background: var(--text);
  }

  /* Fullscreen overlay menu */
  .mobile-menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.97);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 220ms ease, transform 220ms ease;
    z-index: 1001;
  }

  .mobile-menu.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .mobile-menu a {
    display: block;
    text-decoration: none;
    color: var(--text);
    font-family: var(--ui-font);
    font-size: 18px;
    line-height: 1;
    padding: 14px 0;
  }

  .container {
    padding-left: 10px;
    padding-right: 10px;
  }

  .masonry {
    padding-bottom: 80px;
  }

  .custom-cursor,
  .ui-lens {
    display: none !important;
  }

  .masonry,
  .masonry *,
  .lightbox,
  .lightbox * {
    cursor: auto !important;
  }

  .masonry.is-hovering .masonry-item:not(.is-hovered) {
    opacity: 1;
    filter: none;
  }

  .masonry-item,
  .masonry-item.is-loaded,
  .masonry-item.is-visible {
    transform: none;
  }

  .masonry-item button {
    transform: none !important;
    transition: none;
  }

  .masonry-item.is-hovered {
    box-shadow: none;
  }

  .lightbox-prev,
  .lightbox-next {
    display: none !important;
  }

  .lightbox-close {
    color: #000;
  }

  .lightbox-stage {
    padding: 20px;
  }

  .lightbox-stage img {
    max-width: 100%;
    max-height: 84vh;
  }
}

/* ===============================
   Mobile landscape — keep mobile UX,
   no cursor/arrows even in landscape
================================ */
@media (max-width: 920px) and (orientation: landscape) {
  .custom-cursor,
  .ui-lens {
    display: none !important;
  }

  .masonry,
  .masonry *,
  .lightbox,
  .lightbox * {
    cursor: auto !important;
  }

  .lightbox-prev,
  .lightbox-next {
    display: none !important;
  }

  .masonry.is-hovering .masonry-item:not(.is-hovered) {
    opacity: 1;
    filter: none;
  }

  .masonry-item button {
    transform: none !important;
    transition: none;
  }

  .masonry-item.is-hovered {
    box-shadow: none;
  }
}

/* ===============================
   UI Lens (magnify X / arrows)
================================ */
.ui-lens {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--cursor-size-hover);
  height: var(--cursor-size-hover);
  border-radius: 999px;
  overflow: hidden;
  pointer-events: none;
  z-index: 10000;
  opacity: 0;
  transform: translate(-50%, -50%);
}

body.ui-lens-on .ui-lens {
  opacity: 1;
}

.ui-lens-inner {
  position: absolute;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  transform-origin: 0 0;
  will-change: transform;
}

.ui-lens-btn {
  position: absolute;
  pointer-events: none;
  transform: none !important;
  margin: 0 !important;
}

.ui-hide-real {
  opacity: 0;
}
