/* Layout: a manga volume. Paper and ink, the title over speed lines, photos in
   thick-bordered panels that keep their own shape, and one black spread.
   It is a single look on purpose, so it does not switch with dark mode. */
:root {
  --paper: #f3f2ee;
  --ink: #0c0c0c;
  --gray: #55524c;
  --night-gray: #a9a69e;

  --display: "Dela Gothic One", "Arial Black", Impact, sans-serif;
  --body: "Zen Kaku Gothic New", "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(16px, 3vw, 40px);
  --gap: 12px;
  --row: 270px;
  --section: clamp(56px, 7vw, 96px);
  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; }
html:has(.lightbox[open]) { overflow: hidden; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 500 1rem/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }
a { color: inherit; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.wrap {
  max-width: 1320px;
  margin: 0 auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

.heading {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(34px, 4.4vw, 60px);
  line-height: 1;
  text-transform: uppercase;
}

/* Narration box: the rectangle manga uses for captions. */
.box {
  margin: 0;
  padding: 6px 10px;
  background: var(--paper);
  border: 3px solid var(--ink);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.8125rem;
  line-height: 1.3;
}

/* Shown only while the placeholder photos are up. */
.sample-note {
  margin: 14px 0 0;
  padding: 7px 12px;
  border: 3px solid var(--ink);
  font-weight: 700;
  font-size: 0.8125rem;
}

/* Header */
.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 24px;
  padding-top: 14px;
  border-bottom: 4px solid var(--ink);
}
.kicker {
  margin: 0;
  font-family: var(--display);
  font-size: 0.8125rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 26px;
}
.nav a {
  padding-block: 12px;
  font-weight: 900;
  font-size: 0.875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
}
.nav a:hover { text-decoration: underline 3px; text-underline-offset: 6px; }

/* Title over speed lines */
.title-block {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: clamp(12px, 2vw, 24px);
  padding-block: clamp(28px, 4vw, 56px) clamp(18px, 2vw, 28px);
  overflow: hidden;
}
.focus-lines {
  position: absolute;
  inset: 0;
  background: repeating-conic-gradient(from 0deg at 62% 58%, var(--ink) 0deg 0.45deg, transparent 0.45deg 3.2deg);
  -webkit-mask-image: radial-gradient(ellipse 70% 90% at 62% 58%, transparent 38%, #000 82%);
  mask-image: radial-gradient(ellipse 70% 90% at 62% 58%, transparent 38%, #000 82%);
  opacity: 0.3;
  pointer-events: none;
}
.wordmark-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  container-type: inline-size;
}
.wordmark {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: calc(100cqi / var(--fit, 9));
  line-height: 0.92;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  white-space: nowrap;
}
.wordmark .line { display: block; }
.wordmark .line > span { display: inline-block; }
.wordmark .outline {
  color: var(--paper);
  -webkit-text-stroke: 0.022em var(--ink);
  paint-order: stroke fill;
}
.byline {
  position: relative;
  flex: none;
  margin: 0;
  padding: 10px 4px;
  background: var(--paper);
  writing-mode: vertical-rl;
  font-family: var(--display);
  font-size: 0.9375rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}
/* On phones the byline lies flat under the title. */
@media (max-width: 640px) {
  .title-block {
    flex-direction: column;
    align-items: stretch;
  }
  .wordmark-wrap { flex: none; }
  .byline {
    align-self: flex-start;
    padding: 2px 6px 2px 0;
    writing-mode: horizontal-tb;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
  }
}

/* Panels: ink around the photo, shown as a 4px frame. */
.panel {
  position: relative;
  margin: 0;
  padding: 4px;
  background: var(--ink);
}
.panel a {
  display: block;
  height: 100%;
}
.panel img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--tone, #ccc);
}
.panel-light { background: var(--paper); }

/* Opening splash */
.splash {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
}
.splash-main {
  flex: 2 1 520px;
  height: clamp(380px, 46vw, 640px);
}
.splash-single .splash-main { flex-basis: 100%; }
.splash-main .panel {
  height: 100%;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 44px));
}
.splash-main .panel a {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 44px));
}
.splash-side {
  flex: 1 1 260px;
  height: clamp(380px, 46vw, 640px);
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}
.splash-side .panel {
  flex: 1 1 0;
  min-height: 0;
}
.box-top {
  position: absolute;
  top: 18px;
  left: 18px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.box-bottom {
  position: absolute;
  right: 16px;
  bottom: 16px;
}

/* Chapters and the gallery */
.chapters { margin-top: var(--section); }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
}
.count {
  margin: 0;
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.filters button {
  padding: 11px 15px;
  border: 3px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font: 900 0.875rem/1.2 var(--body);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}
.filters button:hover { background: rgb(12 12 12 / 0.08); }
.filters button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}

.grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}
/* Keeps a short last row at its natural height instead of stretching it. */
.grid::after {
  content: "";
  flex: 10000 1 0;
}

.tile {
  position: relative;
  flex: var(--ar) 1 calc(var(--ar) * var(--row));
  min-width: 0;
  padding: 4px;
  background: var(--ink);
}
.tile a {
  display: block;
  overflow: hidden;
}
.tile img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: var(--ar);
  object-fit: cover;
  background: var(--tone, #ccc);
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.cut-top,
.cut-top a { clip-path: polygon(0 22px, 100% 0, 100% 100%, 0 100%); }
.cut-bottom,
.cut-bottom a { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 22px)); }

.tile-title {
  position: absolute;
  left: 14px;
  bottom: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.cut-bottom .tile-title {
  top: 14px;
  bottom: auto;
}

@media (hover: hover) {
  .tile:hover img { transform: scale(1.03); }
  .tile:hover .tile-title,
  .tile:focus-within .tile-title { opacity: 1; }
}

@media (max-width: 1100px) { :root { --row: 220px; } }
@media (max-width: 640px) { :root { --row: 240px; } }

/* The black spread */
.spread {
  margin-top: var(--section);
  background: var(--ink);
  color: var(--paper);
}
.spread-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 32px;
  padding-block: clamp(40px, 6vw, 80px);
}
.spread-copy {
  flex: 1 1 320px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
}
.spread-kicker {
  margin: 0;
  font-weight: 900;
  font-size: 0.875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.spread-title {
  max-width: 6ch;
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(48px, 7vw, 104px);
  line-height: 0.92;
  text-transform: uppercase;
}
.spread-link {
  padding-block: 12px;
  color: var(--paper);
  font-weight: 900;
  font-size: 0.9375rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.spread :focus-visible { outline-color: var(--paper); }
.spread-panel {
  flex: 2 1 480px;
  height: clamp(280px, 34vw, 460px);
}

/* The eclipse: a black sun with a pale ring. */
.eclipse {
  display: block;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--ink) 54%, var(--paper) 56%, rgb(243 242 238 / 0.35) 63%, transparent 72%);
}
.eclipse-large {
  width: min(60%, 220px);
  height: auto;
  aspect-ratio: 1;
  background: radial-gradient(circle, var(--ink) 50%, var(--paper) 51% 56%, var(--ink) 57% 61%, transparent 62%);
}

/* About and contact */
.closing {
  display: flex;
  flex-direction: column;
  gap: var(--section);
  padding-top: var(--section);
}

.about {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 24px;
}
.about-art {
  flex: 1 1 280px;
  min-height: 320px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 4px solid var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(var(--ink) 1.1px, transparent 1.5px);
  background-size: 7px 7px;
}
.about-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.about-copy {
  flex: 2 1 420px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}
.about-text {
  max-width: 34ch;
  margin: 0;
  padding: clamp(18px, 2vw, 26px);
  background: var(--paper);
  border: 3px solid var(--ink);
  font-weight: 500;
  font-size: clamp(1.25rem, 1rem + 0.9vw, 1.625rem);
  line-height: 1.45;
  text-wrap: pretty;
}

.contact {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.contact-box {
  flex: 1 1 280px;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  padding: 20px 24px;
  border: 4px solid var(--ink);
  text-decoration: none;
}
.contact-box:hover {
  background: var(--ink);
  color: var(--paper);
}
.contact-kind {
  font-weight: 900;
  font-size: 0.875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.contact-value {
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: var(--display);
  font-size: clamp(1.25rem, 1rem + 0.8vw, 1.625rem);
}

.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: var(--section);
  padding-bottom: 28px;
}
/* The rule above the footer, drawn inside the side gutters. */
.footer::before {
  content: "";
  flex-basis: 100%;
  height: 4px;
  margin-bottom: 6px;
  background: var(--ink);
}
.footer p {
  margin: 0;
  font-weight: 700;
  font-size: 0.875rem;
}
.footer .continued {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(18px, 2vw, 24px);
  text-transform: uppercase;
}

/* Photo viewer */
.lightbox {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  border: 0;
  background: var(--ink);
  color: var(--paper);
}
.lightbox[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.lightbox::backdrop { background: var(--ink); }
.lightbox :focus-visible { outline-color: var(--paper); }

.lb-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 8px 6px 16px;
}
.lb-count {
  margin: 0;
  font-family: var(--display);
  font-size: 0.8125rem;
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
}
.lb-close {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border: 0;
  background: none;
  color: var(--paper);
  font: 900 0.8125rem var(--body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}
.lb-close span { font-size: 1rem; letter-spacing: 0; }

.lb-stage {
  position: relative;
  min-height: 0;
  touch-action: pan-y pinch-zoom;
}
.lb-img {
  position: absolute;
  inset: 0 clamp(0px, 6vw, 88px);
  width: calc(100% - 2 * clamp(0px, 6vw, 88px));
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.lb-step {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  width: clamp(44px, 6vw, 88px);
  height: 120px;
  border: 0;
  background: none;
  color: var(--paper);
  font-size: 1.5rem;
  opacity: 0.6;
  cursor: pointer;
  transition: opacity 0.2s;
}
.lb-step:hover { opacity: 1; }
.lb-prev { left: 0; }
.lb-next { right: 0; }
@media (max-width: 760px) {
  .lb-step { display: none; }
}

.lb-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 24px;
  min-height: 3.5rem;
  padding: 12px 16px 18px;
}
.lb-title {
  margin: 0;
  font-weight: 700;
}
.lb-meta {
  margin: 0;
  color: var(--night-gray);
  font-size: 0.8125rem;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
