:root {
  --red: #e60000;
  --red-dark: #a90000;
  --yellow: #ffd700;
  --white: #fff;
  --black: #000;
  --dark: #080808;
  --panel: #101010;
  --muted: #9a9a9a;
  --line: rgba(255, 255, 255, 0.12);
  --font-display: "Bebas Neue", "Impact", sans-serif;
  --font-en: "Oswald", sans-serif;
  --font-jp: "Noto Sans JP", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: hidden;
  color: var(--white);
  background: var(--dark);
  font-family: var(--font-jp);
}
body.is-locked { overflow: hidden; }
a { color: inherit; }
button, input { font: inherit; }
button { color: inherit; }

.noise {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.025;
  background-image: repeating-linear-gradient(-62deg, transparent 0 4px, #fff 4px 5px);
}

.diary-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 90;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 62px;
  padding: 0 clamp(20px, 5vw, 76px);
  border-bottom: 3px solid var(--red);
  background: rgba(0, 0, 0, 0.96);
  backdrop-filter: blur(8px);
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 12px;
  color: var(--white);
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.09em;
  text-decoration: none;
  text-transform: uppercase;
}
.brand > span:last-child > span {
  margin-left: 4px;
  color: var(--red);
  font-family: var(--font-jp);
  font-size: 13px;
  font-weight: 900;
}
.brand-mark {
  display: flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: var(--red);
  clip-path: polygon(12% 0, 88% 0, 100% 12%, 100% 88%, 88% 100%, 12% 100%, 0 88%, 0 12%);
}
.brand-mark i { display: block; width: 3px; background: var(--white); }
.brand-mark i:nth-child(1) { height: 8px; }
.brand-mark i:nth-child(2) { height: 17px; }
.brand-mark i:nth-child(3) { height: 11px; }
.header-title {
  color: var(--muted);
  font-family: var(--font-en);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.24em;
}
.back-link {
  justify-self: end;
  padding: 7px 14px;
  border: 1px solid rgba(255, 215, 0, 0.5);
  color: var(--yellow);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  transition: 150ms ease;
}
.back-link:hover { color: var(--black); background: var(--yellow); }

.diary-hero {
  position: relative;
  display: grid;
  min-height: 610px;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.78fr);
  align-items: center;
  overflow: hidden;
  padding: 120px clamp(24px, 8vw, 128px) 70px;
  background:
    linear-gradient(112deg, transparent 0 54%, rgba(230, 0, 0, 0.11) 54% 72%, transparent 72%),
    repeating-linear-gradient(-18deg, transparent 0 46px, rgba(255, 255, 255, 0.025) 46px 47px),
    var(--black);
}
.diary-hero::after {
  position: absolute;
  right: -8vw;
  bottom: -120px;
  width: 55vw;
  height: 190px;
  content: "JOURNAL";
  color: rgba(255, 255, 255, 0.035);
  font-family: var(--font-display);
  font-size: clamp(130px, 19vw, 280px);
  line-height: 1;
  letter-spacing: 0.04em;
  transform: rotate(-9deg);
}
.hero-copy { position: relative; z-index: 2; max-width: 760px; }
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 24px;
  color: var(--yellow);
  font-family: var(--font-en);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.22em;
}
.eyebrow span { width: 40px; height: 3px; background: var(--red); transform: skewX(-24deg); }
h1 {
  margin: 0;
  font-size: clamp(62px, 9vw, 126px);
  font-weight: 900;
  line-height: 0.94;
  letter-spacing: -0.065em;
}
h1 span { color: var(--red); text-shadow: 5px 5px 0 var(--white); }
.hero-lead {
  margin: 34px 0 0;
  color: #d0d0d0;
  font-size: clamp(14px, 1.3vw, 17px);
  font-weight: 500;
  line-height: 2;
}
.hero-stats { display: flex; gap: clamp(28px, 5vw, 72px); margin: 40px 0 0; }
.hero-stats div { position: relative; }
.hero-stats div + div::before {
  position: absolute;
  left: calc(clamp(28px, 5vw, 72px) / -2);
  top: 5px;
  width: 1px;
  height: 48px;
  content: "";
  background: var(--line);
}
.hero-stats dt { font-family: var(--font-display); font-size: 34px; letter-spacing: 0.06em; }
.hero-stats dd { margin: -4px 0 0; color: var(--muted); font-family: var(--font-en); font-size: 10px; font-weight: 700; letter-spacing: 0.2em; }
.hero-portrait { position: relative; z-index: 2; justify-self: center; width: min(34vw, 430px); }
.portrait-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 5px solid var(--white);
  background: #171717;
  clip-path: polygon(7% 0, 100% 0, 100% 91%, 92% 100%, 0 100%, 0 8%);
  transform: rotate(2deg);
}
.portrait-frame::after { position: absolute; inset: 0; content: ""; box-shadow: inset 0 -110px 90px rgba(0,0,0,.55); }
.portrait-frame img { width: 100%; height: 100%; object-fit: cover; object-position: center top; filter: saturate(.8) contrast(1.08); }
.portrait-label {
  position: absolute;
  right: -18px;
  bottom: 28px;
  z-index: 2;
  padding: 8px 18px;
  color: var(--black);
  background: var(--yellow);
  font-family: var(--font-en);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .18em;
  transform: rotate(-3deg);
}
.portrait-line { position: absolute; z-index: -1; height: 12px; background: var(--red); transform: rotate(-12deg); }
.portrait-line--one { top: 24%; left: -22%; width: 76%; }
.portrait-line--two { right: -15%; bottom: 16%; width: 60%; height: 5px; background: var(--yellow); }

.journal {
  display: grid;
  grid-template-columns: minmax(280px, 350px) minmax(0, 1fr);
  max-width: 1500px;
  min-height: 720px;
  margin: 0 auto;
  padding: 80px clamp(20px, 5vw, 72px) 110px;
  gap: clamp(38px, 6vw, 86px);
}
.journal-index { position: sticky; top: 88px; align-self: start; max-height: calc(100vh - 112px); }
.index-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 18px; }
.index-heading p { margin: 0; font-family: var(--font-display); font-size: 32px; letter-spacing: .08em; }
.index-heading span { color: var(--red); font-family: var(--font-en); font-size: 11px; font-weight: 700; letter-spacing: .16em; }
.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.search-box span { color: var(--red); font-size: 22px; line-height: 1; }
.search-box input { width: 100%; border: 0; outline: 0; color: var(--white); background: transparent; font-size: 13px; }
.search-box input::placeholder { color: #696969; }
.date-list { max-height: calc(100vh - 215px); overflow: auto; scrollbar-width: thin; scrollbar-color: var(--red) #171717; }
.date-button {
  display: grid;
  width: 100%;
  grid-template-columns: 58px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 10px;
  padding: 14px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  background: transparent;
  cursor: pointer;
  transition: 140ms ease;
}
.date-button:hover { background: rgba(255,255,255,.05); }
.date-button.is-active { color: var(--black); background: var(--yellow); transform: translateX(6px); }
.date-button-date { font-family: var(--font-display); font-size: 22px; letter-spacing: .03em; }
.date-button-detail { overflow: hidden; color: #b6b6b6; font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.date-button.is-active .date-button-detail { color: rgba(0,0,0,.68); }
.date-button-count { color: var(--red); font-family: var(--font-en); font-size: 10px; font-weight: 800; text-align: right; }
.date-button.is-active .date-button-count { color: var(--red-dark); }

.journal-content { min-width: 0; }
.day-header { position: relative; margin-bottom: 42px; padding: 6px 0 25px; border-bottom: 4px solid var(--white); }
.day-header::after { position: absolute; right: 0; bottom: -4px; width: 25%; height: 4px; content: ""; background: var(--red); }
.day-stamp { margin: 0 0 4px; color: var(--red); font-family: var(--font-display); font-size: 16px; letter-spacing: .22em; }
.day-header h2 { margin: 0; font-size: clamp(30px, 4vw, 54px); line-height: 1.3; letter-spacing: -.04em; }
.day-summary { margin: 8px 0 0; color: var(--muted); font-size: 12px; font-weight: 600; }
.note-list { position: relative; }
.note-list::before { position: absolute; top: 9px; bottom: 0; left: 22px; width: 1px; content: ""; background: rgba(230,0,0,.45); }
.note {
  position: relative;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 0 22px;
  margin-bottom: 48px;
}
.note-meta { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; }
.note-meta span { display: grid; width: 44px; height: 44px; place-items: center; color: var(--white); background: var(--red); font-family: var(--font-display); font-size: 19px; clip-path: polygon(12% 0, 100% 0, 100% 82%, 82% 100%, 0 100%, 0 12%); }
.note-meta time { color: var(--muted); font-family: var(--font-en); font-size: 9px; font-weight: 700; letter-spacing: .08em; writing-mode: vertical-rl; }
.note-body {
  grid-column: 2;
  margin: 0;
  color: #e5e5e5;
  font-size: 15px;
  font-weight: 500;
  line-height: 2.05;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.note-body a { color: var(--yellow); text-decoration-color: rgba(255,215,0,.5); text-underline-offset: 3px; }
.note-body a:hover { color: var(--white); }
.attachment-grid {
  display: grid;
  grid-column: 2;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}
.attachment-grid--1 { grid-template-columns: minmax(0, 620px); }
.attachment-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.attachment-button, .attachment-grid video {
  min-width: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(255,255,255,.16);
  background: #181818;
}
.attachment-button { position: relative; cursor: zoom-in; }
.attachment-button::after { position: absolute; right: 8px; bottom: 8px; padding: 4px 7px; content: "+"; color: var(--black); background: var(--yellow); font-weight: 900; opacity: 0; transition: opacity 150ms; }
.attachment-button:hover::after { opacity: 1; }
.attachment-button img, .attachment-grid video { width: 100%; height: 100%; object-fit: cover; }
.attachment-button img { transition: transform 250ms ease; }
.attachment-button:hover img { transform: scale(1.025); }

.loading, .empty-state { display: grid; min-height: 420px; place-content: center; text-align: center; }
.loading span { justify-self: center; width: 36px; height: 36px; border: 3px solid #333; border-top-color: var(--red); border-radius: 50%; animation: spin .7s linear infinite; }
.loading p, .empty-state p { color: var(--muted); font-size: 13px; }
.empty-state strong { color: var(--red); font-family: var(--font-display); font-size: 42px; letter-spacing: .1em; }
@keyframes spin { to { transform: rotate(360deg); } }

footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 38px clamp(20px, 5vw, 76px);
  border-top: 3px solid var(--red);
  background: var(--black);
}
footer p { margin: 0; color: var(--muted); font-family: var(--font-en); font-size: 11px; letter-spacing: .2em; }
footer small { justify-self: end; color: #666; font-size: 10px; }

.lightbox { position: fixed; inset: 0; z-index: 200; display: none; place-items: center; padding: 35px; }
.lightbox.is-open { display: grid; }
.lightbox-backdrop { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(0,0,0,.92); cursor: zoom-out; }
.lightbox figure { position: relative; z-index: 1; display: grid; max-width: min(92vw, 1200px); max-height: 90vh; margin: 0; place-items: center; }
.lightbox img { max-width: 100%; max-height: 82vh; object-fit: contain; box-shadow: 0 0 0 1px rgba(255,255,255,.15); }
.lightbox figcaption { margin-top: 10px; color: var(--muted); font-size: 11px; }
.lightbox-close { position: absolute; top: -18px; right: -18px; z-index: 2; display: grid; width: 42px; height: 42px; place-items: center; border: 0; color: var(--black); background: var(--yellow); font-size: 28px; font-weight: 800; cursor: pointer; }

@media (max-width: 900px) {
  .diary-hero { min-height: 560px; grid-template-columns: 1fr minmax(250px, .65fr); padding-inline: 36px; }
  .hero-portrait { width: min(36vw, 340px); opacity: .7; }
  .journal { grid-template-columns: 240px minmax(0, 1fr); gap: 35px; }
  .date-button { grid-template-columns: 52px minmax(0, 1fr) 24px; padding-inline: 8px; }
}

@media (max-width: 680px) {
  .diary-header { grid-template-columns: 1fr auto; height: 58px; padding-inline: 16px; }
  .diary-header .header-title { display: none; }
  .brand { gap: 8px; font-size: 18px; }
  .brand-mark { width: 31px; height: 31px; }
  .back-link { padding: 6px 10px; }
  .diary-hero { display: block; min-height: 600px; padding: 110px 22px 55px; }
  h1 { font-size: clamp(62px, 22vw, 92px); }
  h1 span { display: block; width: max-content; }
  .hero-lead { max-width: 330px; font-size: 13px; }
  .hero-stats { gap: 28px; }
  .hero-stats div + div::before { left: -14px; }
  .hero-stats dt { font-size: 28px; }
  .hero-portrait { position: absolute; right: -42px; bottom: 28px; z-index: 0; width: 260px; opacity: .36; }
  .portrait-label, .portrait-line { display: none; }
  .journal { display: block; padding: 55px 18px 80px; }
  .journal-index { position: relative; top: auto; z-index: 2; max-height: none; margin-bottom: 50px; }
  .date-list { display: flex; max-height: none; gap: 6px; padding: 0 0 8px; overflow-x: auto; }
  .date-button { display: block; min-width: 82px; padding: 10px 9px; border: 1px solid var(--line); text-align: center; }
  .date-button.is-active { transform: none; }
  .date-button-detail, .date-button-count { display: none; }
  .date-button-date { font-size: 20px; }
  .day-header { margin-bottom: 32px; }
  .note { grid-template-columns: 38px minmax(0, 1fr); gap: 0 14px; margin-bottom: 42px; }
  .note-list::before { left: 18px; }
  .note-meta span { width: 36px; height: 36px; font-size: 17px; }
  .note-body { font-size: 14px; line-height: 1.95; }
  .attachment-grid, .attachment-grid--3 { grid-template-columns: 1fr; }
  footer { grid-template-columns: 1fr auto; }
  footer p { display: none; }
  footer small { justify-self: end; }
  .lightbox { padding: 16px; }
  .lightbox-close { top: -8px; right: -8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .loading span { animation: none; }
  .attachment-button img { transition: none; }
}
