:root {
  color-scheme: dark;
  --bg: #090b0d;
  --panel: #11161a;
  --panel-strong: #171d22;
  --text: #e7e0d4;
  --muted: #a9a196;
  --line: #2c3439;
  --accent: #c2a15d;
  --danger: #8e2020;
  --shadow: 0 18px 60px rgba(0, 0, 0, .42);
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", Meiryo, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  letter-spacing: 0;
}

body[data-mode="truth"] {
  --bg: #040404;
  --panel: #0b0b0b;
  --panel-strong: #111;
  --text: #d8d0c7;
  --muted: #8e8580;
  --line: #2a1a1a;
  --accent: #a51f1f;
  filter: saturate(.72) contrast(1.08);
}

button,
input,
select {
  font: inherit;
}

button,
a {
  color: inherit;
}

.siteHeader {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 12px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  background: rgba(9, 11, 13, .88);
  backdrop-filter: blur(14px);
}

body[data-mode="truth"] .siteHeader {
  background: rgba(4, 4, 4, .9);
}

.brand {
  display: inline-flex;
  align-items: center;
  width: 180px;
}

.brand img {
  width: 100%;
  height: auto;
  display: block;
}

.headerNav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.headerNav a,
.headerNav button,
.siteFooter button {
  min-height: 36px;
  border: 1px solid var(--line);
  background: #101417;
  color: var(--text);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
}

.headerNav a:hover,
.headerNav button:hover,
.siteFooter button:hover {
  border-color: var(--accent);
}

.hero {
  position: relative;
  min-height: min(72vh, 720px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.heroImage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .72;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, .12), rgba(0, 0, 0, .8));
}

body[data-mode="truth"] .hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: .22;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 5px 5px;
}

.heroText {
  position: relative;
  z-index: 2;
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 0 clamp(18px, 5vw, 56px) clamp(44px, 8vw, 84px);
}

.heroText p,
.sectionHead p {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
}

.heroText h1 {
  margin: 0;
  max-width: 920px;
  font-size: clamp(2.4rem, 8vw, 7.6rem);
  line-height: .95;
}

.heroText span {
  display: block;
  max-width: 660px;
  margin-top: 18px;
  color: #ddd4c9;
  line-height: 1.9;
}

.postSection,
.collabSection {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(44px, 7vw, 84px) 0;
}

.sectionHead {
  margin-bottom: 24px;
}

.sectionHead h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.postGrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.postCard {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

body[data-mode="truth"] .postCard {
  box-shadow: 0 0 0 1px rgba(142, 32, 32, .12), var(--shadow);
}

.imageButton {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 0;
  border: 0;
  background: #080808;
  cursor: default;
  overflow: hidden;
}

.imageButton[data-action] {
  cursor: pointer;
}

.imageButton img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .28s ease, filter .28s ease;
}

.imageButton[data-action]:hover img {
  transform: scale(1.035);
  filter: brightness(1.12);
}

.figureHotspot {
  position: absolute;
  right: 29%;
  top: 38%;
  width: 22px;
  height: 42px;
  border: 1px solid rgba(194, 161, 93, .85);
  border-radius: 20px;
  background: rgba(194, 161, 93, .12);
  box-shadow: 0 0 24px rgba(194, 161, 93, .28);
}

.postBody {
  padding: 16px;
}

.postMeta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--accent);
  font-size: .76rem;
  font-weight: 700;
}

.postBody h3 {
  min-height: 3.1em;
  margin: 10px 0;
  font-size: 1.08rem;
  line-height: 1.45;
}

.postBody p,
.postBody dd,
.notice li {
  color: var(--muted);
  line-height: 1.75;
}

.postBody p {
  min-height: 5.3em;
  margin: 0 0 14px;
}

.postBody dl {
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.postBody dt {
  color: var(--text);
  font-size: .82rem;
  margin-bottom: 4px;
}

.postBody dd {
  margin: 0;
  font-size: .9rem;
}

.collabSection {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  gap: clamp(22px, 5vw, 54px);
  align-items: start;
}

.formVisual {
  position: sticky;
  top: 96px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
}

.formVisual img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.collabForm {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(18px, 4vw, 34px);
}

.collabForm label {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--text);
}

.collabForm input,
.collabForm select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #080a0c;
  color: var(--text);
  padding: 10px 12px;
}

.notice {
  margin-top: 24px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, .18);
}

body[data-mode="anomaly3"] .notice,
body[data-mode="truth"] .notice {
  border-color: rgba(165, 31, 31, .65);
}

.notice h3 {
  margin: 0 0 10px;
}

.notice ul {
  margin: 0;
  padding-left: 20px;
}

.submitButton {
  width: 100%;
  min-height: 48px;
  margin-top: 18px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #080808;
  font-weight: 700;
  cursor: pointer;
}

body[data-mode="truth"] .submitButton,
body[data-mode="anomaly3"] .submitButton {
  color: #f4eeee;
  background: var(--danger);
}

.siteFooter {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 26px clamp(16px, 4vw, 48px);
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.siteFooter p {
  margin: 0;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, .74);
}

.overlay.isOpen {
  display: grid;
}

.overlayPanel {
  width: min(520px, 100%);
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: #080808;
  padding: 28px;
  box-shadow: var(--shadow);
}

.galleryPanel {
  width: min(1080px, 100%);
  max-height: min(86vh, 820px);
  overflow: auto;
}

.galleryHead {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
}

.galleryHead p {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: .78rem;
  font-weight: 700;
}

.galleryHead h2 {
  margin: 0;
  line-height: 1.35;
  font-size: clamp(1.35rem, 4vw, 2.2rem);
}

.iconButton {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111;
  color: var(--text);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.galleryGrid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.galleryItem {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  overflow: hidden;
  cursor: default;
}

.galleryItem[data-action] {
  cursor: zoom-in;
}

.galleryItem img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform .24s ease, filter .24s ease;
}

.galleryItem[data-action]:hover img {
  transform: scale(1.035);
  filter: brightness(1.12);
}

.galleryItem span:not(.figureHotspot) {
  min-height: 3.2em;
  padding: 0 10px 10px;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.55;
  text-align: left;
}

.overlayPanel p {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: .82rem;
  font-weight: 700;
}

.overlayPanel h2 {
  margin: 0 0 22px;
  line-height: 1.55;
  font-size: clamp(1.4rem, 5vw, 2rem);
}

.overlayPanel button {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #080808;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 980px) {
  .postGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .galleryGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .collabSection {
    grid-template-columns: 1fr;
  }

  .formVisual {
    position: static;
  }
}

@media (max-width: 640px) {
  .siteHeader,
  .siteFooter {
    align-items: stretch;
    flex-direction: column;
  }

  .brand {
    width: 150px;
  }

  .headerNav {
    justify-content: flex-start;
  }

  .headerNav a,
  .headerNav button {
    flex: 1 1 calc(50% - 8px);
  }

  .postGrid {
    grid-template-columns: 1fr;
  }

  .galleryGrid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 620px;
  }
}
