:root {
  --bg: #070707;
  --surface: #101010;
  --ink: #f2f2f2;
  --muted: #9a9a9a;
  --line: #2a2a2a;
  --max-width: 86rem;
  --glow-base: none;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
  background: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Sans", sans-serif;
}

.site-curtain {
  position: fixed;
  inset: 0;
  z-index: 50000;
  background: var(--bg);
  pointer-events: none;
  transition: opacity 1.4s ease;
}

body.is-ready .site-curtain {
  opacity: 0;
}

.grain-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("grain.gif");
  opacity: 0.1;
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 12000;
}

@media (pointer: fine) and (min-width: 48.001rem) {
  .grain-overlay {
    opacity: 0.08;
    mask-image: radial-gradient(
      circle var(--halo-radius, 0px) at var(--halo-x, 50%) var(--halo-y, 50%),
      rgba(0, 0, 0, 0.06) 0%,
      rgba(0, 0, 0, 0.06) 45%,
      black 80%
    );
  }
}

body.secret-active {
  overflow: hidden;
}

body.secret-active .site-header,
body.secret-active .site-main,
body.secret-active .site-footer {
  display: none;
}

body.secret-active .grain-overlay {
  display: none;
}

a {
  color: inherit;
}

body :is(p, a, button, .site-name, .site-tagline, .gallery-label, .lang-sep) {
  text-shadow: var(--glow-base);
  transition: text-shadow 170ms ease, color 170ms ease;
}

.cursor-prox-glow {
  will-change: text-shadow;
}

.site-header,
.site-main,
.site-footer {
  width: min(100% - 2rem, var(--max-width));
  margin-inline: auto;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 0 1rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.84rem;
  letter-spacing: 0.04em;
}

.site-name {
  text-decoration: none;
  font-family: "IBM Plex Mono", "M PLUS 1 Code", monospace;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: #ffffff;
  text-shadow: 0 0 18px rgba(255, 255, 255, 0.18);
}

.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  font-family: "IBM Plex Mono", "M PLUS 1 Code", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}

.lang-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  padding: 0.1rem 0.18rem;
}

.lang-button.is-active {
  color: var(--ink);
}

.lang-sep {
  color: var(--line);
}

.site-main {
  padding: 1.1rem 0 2.2rem;
}

.site-tagline {
  margin: 0 0 2rem;
  color: var(--muted);
  font-family: "IBM Plex Mono", "M PLUS 1 Code", monospace;
  font-size: 0.74rem;
  letter-spacing: 0.10em;
}

.site-coords {
  font-family: "IBM Plex Mono", "M PLUS 1 Code", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  white-space: nowrap;
}


.secret-gallery-view {
  position: fixed;
  inset: 0;
  z-index: 8000;
  background: #050505;
  padding: 1.2rem;
}

.secret-head {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.7rem;
}

.secret-exit {
  border: 1px solid var(--line);
  background: rgba(8, 8, 8, 0.94);
  color: var(--ink);
  font: inherit;
  font-size: 0.75rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 0.5rem 0.75rem;
}

.secret-content {
  height: calc(100vh - 4rem);
  overflow: auto;
}

.gallery-list {
  display: grid;
  gap: 5rem;
  grid-template-columns: 1fr;
  position: relative;
  padding-inline: 1.5rem;
}

.gallery-stage {
  position: relative;
}

.gallery-veil {
  position: fixed;
  inset: 0;
  z-index: 11000;
  pointer-events: none;
  background: radial-gradient(
    circle var(--halo-radius, 0px) at var(--halo-x, 50%) var(--halo-y, 50%),
    transparent 0%,
    transparent 55%,
    rgba(7, 7, 7, 0.09) 72%,
    rgba(7, 7, 7, 0.21) 90%,
    rgba(7, 7, 7, 0.25) 100%
  );
}

body:not(.is-ready) .gallery-veil {
  opacity: 0;
}

@media (max-width: 48rem), (pointer: coarse) {
  .grain-overlay {
    display: none;
  }

  .gallery-veil {
    display: none;
  }
}

.gallery-sheet {
  position: relative;
  z-index: 10000;
  background: var(--surface);
  border: 1px solid var(--line);
  animation: card-in 0.55s ease both;
  animation-delay: calc(0.3s + var(--card-index, 0) * 80ms);
}

.gallery-sheet.is-collapsed {
  width: 100%;
}

.gallery-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--line);
}

.gallery-label {
  margin: 0;
  color: var(--muted);
  font-family: "IBM Plex Mono", "M PLUS 1 Code", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gallery-frame {
  position: relative;
  background: #000;
}

.gallery-sheet.is-collapsed .gallery-frame.is-cover-loading::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 10002;
  pointer-events: none;
  background:
    linear-gradient(
      112deg,
      rgba(255, 255, 255, 0.05) 18%,
      rgba(255, 255, 255, 0.14) 38%,
      rgba(255, 255, 255, 0.05) 58%
    ),
    #090909;
  background-size: 240% 100%, 100% 100%;
  animation: cover-skeleton-shimmer 1.35s ease-in-out infinite;
}

.gallery-sheet.is-collapsed .gallery-frame {
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
}

.gallery-sheet.is-collapsed .gallery-frame::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: min(35%, 7rem);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0));
  pointer-events: none;
}

.gallery-sheet.is-expanded .gallery-frame {
  max-height: none;
  overflow: hidden;
  animation: frame-reveal 550ms cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.gallery-sheet.is-collapsing .gallery-frame {
  overflow: hidden;
  animation: frame-hide 380ms ease both;
}

.gallery-cover-image {
  position: relative;
  z-index: 10001;
  pointer-events: none;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  transition: opacity 220ms ease,
              transform 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
              filter 900ms ease;
}

.gallery-sheet:not(.is-in-view) .gallery-cover-image {
  filter: brightness(0.35);
}

.gallery-sheet.is-collapsed:hover .gallery-cover-image {
  transform: scale(1.04);
}

.gallery-frame.is-cover-loading .gallery-cover-image {
  opacity: 0;
}

picflow-gallery {
  position: relative;
  z-index: 10001;
  display: block;
}

.gallery-sheet.is-collapsed picflow-gallery {
  min-height: 0;
  height: 100%;
  pointer-events: none;
}

.gallery-sheet.is-expanded picflow-gallery {
  min-height: 32rem;
}

.enter-button,
.close-button {
  border: 1px solid var(--line);
  background: rgba(9, 9, 9, 0.9);
  color: var(--ink);
  font: inherit;
  font-size: 0.73rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}

.preview-hitarea {
  position: absolute;
  inset: 0;
  z-index: 1;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.enter-button {
  position: absolute;
  left: 0.9rem;
  bottom: 0.9rem;
  z-index: 2;
  padding: 0.55rem 0.85rem;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 250ms ease, transform 250ms ease;
}

.gallery-sheet.is-collapsed:hover .enter-button,
.enter-button:focus-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (hover: none) {
  .enter-button {
    opacity: 1;
    transform: translateY(0);
  }
}

.close-button {
  padding: 0.45rem 0.75rem;
}

.gallery-sheet.is-collapsed .gallery-meta {
  display: none;
}

.gallery-caption {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0;
  padding: 0.6rem 0.9rem 0.7rem;
  color: var(--muted);
  font-family: "IBM Plex Mono", "M PLUS 1 Code", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  transition: color 400ms ease;
}

.gallery-caption::before {
  content: "";
  flex-shrink: 0;
  height: 1px;
  width: 0.6rem;
  background: currentColor;
  transition: width 500ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gallery-sheet.is-collapsed:hover .gallery-caption {
  color: var(--ink);
}

.gallery-sheet.is-collapsed:hover .gallery-caption::before {
  width: 2rem;
}

.gallery-sheet.is-expanded .gallery-caption {
  display: none;
}

.gallery-sheet.is-expanded .enter-button {
  display: none;
}

.gallery-sheet.is-expanded .preview-hitarea {
  display: none;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes cover-skeleton-shimmer {
  from {
    background-position: 100% 0, 0 0;
  }
  to {
    background-position: 0 0, 0 0;
  }
}

@keyframes frame-reveal {
  from { clip-path: inset(0 0 100% 0); }
  to   { clip-path: inset(0 0 0% 0); }
}

@keyframes frame-hide {
  from { clip-path: inset(0 0 0% 0); }
  to   { clip-path: inset(0 0 100% 0); }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-sheet {
    animation: none;
  }
  .gallery-sheet.is-expanded .gallery-frame,
  .gallery-sheet.is-collapsing .gallery-frame {
    animation: none;
  }
  .gallery-sheet:not(.is-in-view) .gallery-cover-image {
    filter: brightness(1);
  }
}

.site-footer {
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.9rem 0 1.6rem;
  color: var(--muted);
  font-family: "IBM Plex Mono", "M PLUS 1 Code", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  text-decoration: none;
}

.footer-texts {
  display: grid;
  gap: 0.36rem;
}

.site-copyright {
  display: block;
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  color: #7a7a7a;
  line-height: 1.35;
}

.footer-icons {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.56rem;
}

.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
  border: 1px solid var(--line);
  border-radius: 0.28rem;
  color: var(--ink);
}

.icon-svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

.icon-fill {
  fill: currentColor;
  stroke: none;
}

.empty-state,
.noscript-note {
  margin: 0;
  padding: 0.8rem 0.9rem;
  border: 1px dashed var(--line);
  color: var(--muted);
  font-size: 0.86rem;
}

@media (max-width: 48rem) {
  .site-header,
  .site-main,
  .site-footer {
    width: min(100% - 1.2rem, var(--max-width));
  }

  .site-header {
    font-size: 0.76rem;
    padding-top: 0.9rem;
  }

  .site-footer {
    align-items: center;
  }

  .footer-texts {
    width: 100%;
  }

  .site-coords {
    display: block;
    margin-top: 0.2rem;
  }

  .footer-icons {
    width: 100%;
    margin-left: 0;
    justify-content: flex-end;
  }

  picflow-gallery {
    min-height: 22rem;
  }

  .gallery-sheet.is-expanded picflow-gallery {
    min-height: 22rem;
  }

}

@media (max-width: 48rem), (pointer: coarse) {
  .mobile-grain-text {
    position: relative;
    display: inline-block;
  }

  .mobile-grain-text::after {
    content: attr(data-grain-text);
    position: absolute;
    inset: 0;
    color: transparent;
    -webkit-text-fill-color: transparent;
    background: url("grain.gif");
    background-repeat: repeat;
    -webkit-background-clip: text;
    background-clip: text;
    opacity: 0.14;
    pointer-events: none;
    white-space: inherit;
  }
}

@media (pointer: fine) and (min-width: 48.001rem) {
  html,
  body,
  body * {
    cursor: none !important;
  }

  #cursor-dot {
    position: fixed;
    left: -100px;
    top: -100px;
    width: 0.48rem;
    height: 0.48rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.94);
    box-shadow:
      0 0 10px rgba(255, 255, 255, 0.45),
      0 0 20px rgba(146, 220, 255, 0.38);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition:
      opacity 120ms ease,
      width 140ms ease,
      height 140ms ease,
      box-shadow 140ms ease,
      background-color 140ms ease;
    z-index: 2147483647;
  }

  #cursor-dot.is-visible {
    opacity: 0.96;
  }

  #cursor-dot.is-strong {
    width: 0.62rem;
    height: 0.62rem;
    background: rgba(255, 255, 255, 0.98);
    box-shadow:
      0 0 14px rgba(255, 255, 255, 0.52),
      0 0 28px rgba(162, 230, 255, 0.46);
  }
}
