html,
body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  background: #000;
  font-size: 12px;
  text-align: justify;
  color: #fff;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
}

body,
textarea {
  font-family: courier, "Courier New", monospace;
}

a {
  color: #fff;
  position: relative;
  z-index: 1;
  transition: 0.3s;
}

a:hover {
  color: #fff;
  text-decoration: underline;
  filter: drop-shadow(0 0 2px black);
  letter-spacing: 2px;
  font-weight: bold;
}

.screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 407px;
  padding: 45px;
  color: #fff;
  position: relative;
  z-index: 1;
  transition: 0.3s;
}

.logo {
  display: block;
  width: 437px;
  color: #fff;
  text-align: center;
  text-decoration: none;
  font-size: 58px;
  font-weight: 700;
  line-height: 0.9;
  transition: 1.4s;
  filter: drop-shadow(2px 0 4px #4f4f4f);
}

.logo span {
  font-family: courier, "Courier New", monospace;
}

.logo:hover {
  filter: drop-shadow(2px 0 13px #004aa3);
  transition: 1.4s;
  letter-spacing: 1px;
  text-decoration: none;
}

.oneko-anchor {
  display: inline-block;
}

.logo i {
  font-family: Georgia, serif;
  font-weight: normal;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 1;
}

nav {
  display: flex;
  text-align: justify;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 1;
  flex-wrap: wrap;
}

nav a {
  margin-right: 20px;
  text-decoration: underline 0.1px;
  text-decoration-style: dotted;
  color: #fff;
  transition: 0.3s;
}

nav a:hover {
  color: #fff;
  text-decoration: underline;
  filter: drop-shadow(0 0 2px black);
}

main {
  margin-top: 30px;
  position: relative;
  z-index: 1;
  transition: 0.3s;
  width: 100%;
}

p.subtitle {
  margin-top: -3px;
  max-width: 500px;
  transition: 0.7s;
}

p.subtitle:hover {
  letter-spacing: 0.7px;
  filter: drop-shadow(0 0 7px rgb(29, 121, 146));
}

p.subtitle span {
  transition: 0.6s;
  font-family: Georgia, serif;
  font-weight: 800;
}

p.subtitle span:hover {
  letter-spacing: 3px;
  text-decoration: underline 0.1px;
  color: #fff;
  text-decoration-style: wavy;
  font-size: 12px;
  filter: drop-shadow(1px 0 3px white);
}

section {
  display: none;
  transition: 0.3s;
}

section:target {
  position: relative;
  z-index: 1;
  display: block;
  transition: 0.3s;
  max-height: 240px;
  overflow: auto;
  overflow-x: hidden;
}

body:has(section:target) #home {
  display: none;
  transition: 0.3s;
}

body:not(:has(section:target)) #home {
  display: block;
  transition: 0.3s;
}

#anime:target {
  overflow-x: visible;
  padding-inline: 18px;
}

section p,
section li {
  transition: 0.7s;
}

section p:hover,
section li:hover {
  letter-spacing: 0.7px;
  transition: 0.7s;
  filter: drop-shadow(0 0 7px rgb(29, 121, 146));
}

section b {
  transition: 0.7s;
  font-family: Georgia, serif;
  filter: drop-shadow(1px 0 0 black);
}

section b:hover {
  color: white;
  filter: drop-shadow(1px 0 0 white);
  font-size: 14px;
  text-decoration: underline 0.1px;
  text-decoration-style: wavy;
  letter-spacing: 2px;
}

ul {
  margin: 0;
  padding-left: 18px;
}

li {
  margin-bottom: 12px;
}

.date {
  font-family: Georgia, serif;
  text-decoration: underline 0.1px;
  text-decoration-style: wavy;
}

.diary-list {
  display: grid;
  gap: 14px;
}

.diary-entry {
  border-top: 1px dotted rgba(255, 255, 255, 0.45);
  padding-top: 10px;
  transition: 0.7s;
}

.diary-entry:hover {
  letter-spacing: 0.4px;
  filter: drop-shadow(0 0 7px rgb(29, 121, 146));
}

.entry-excerpt {
  color: rgba(255, 255, 255, 0.78);
}

.section-more {
  margin: 12px 0 0;
  text-align: right;
}

/* Full diary archive on diary.html: no scroll cap, entries stack freely. */
.diary-archive {
  margin-top: 16px;
}

.anime-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.anime-card {
  transition: 0.7s;
}

.anime-card:hover {
  letter-spacing: 0.4px;
  filter: drop-shadow(0 0 7px rgb(29, 121, 146));
}

.anime-card span {
  display: block;
  color: rgba(255, 255, 255, 0.78);
}

.anime-card .anime-jp {
  margin: 2px 0 4px;
  color: rgba(255, 255, 255, 0.58);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 11px;
  letter-spacing: 0;
}

.anime-cover-wrap {
  --pointer-x: 22%;
  --pointer-y: 14%;
  --rotate-x: 7deg;
  --rotate-y: -18deg;
  --shine-x: 180%;
  --shine-y: 0%;
  position: relative;
  aspect-ratio: 2 / 3;
  margin-bottom: 7px;
  border: 1px dotted rgba(255, 255, 255, 0.58);
  overflow: hidden;
  transform: translate3d(0, 0, 0.01px);
  transform-style: preserve-3d;
  transition:
    transform 0.35s ease,
    box-shadow 0.35s ease,
    filter 0.35s ease;
  box-shadow:
    0 10px 20px -10px black,
    0 0 0 rgba(255, 255, 255, 0);
}

.anime-cover-wrap::before,
.anime-cover-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.anime-cover-wrap::before {
  z-index: 2;
  background:
    linear-gradient(
      115deg,
      transparent 0%,
      rgba(255, 255, 255, 0.08) 24%,
      rgba(255, 255, 255, 0.65) 38%,
      rgba(127, 138, 236, 0.34) 45%,
      transparent 62%
    ),
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.12) 0 1px,
      transparent 1px 6px
    );
  mix-blend-mode: color-dodge;
  background-size: 220% 220%, 12px 12px;
  background-position: var(--shine-x) var(--shine-y), 0 0;
}

.anime-cover-wrap::after {
  z-index: 3;
  background:
    radial-gradient(
      farthest-corner circle at var(--pointer-x) var(--pointer-y),
      rgba(255, 255, 255, 0.75) 0%,
      rgba(255, 255, 255, 0.28) 20%,
      rgba(0, 0, 0, 0.45) 76%
    );
  mix-blend-mode: overlay;
}

.anime-card:hover .anime-cover-wrap {
  transform: perspective(650px) rotateX(var(--rotate-x)) rotateY(var(--rotate-y)) translateY(-8px) scale(1.04);
  box-shadow:
    0 0 3px 1px rgba(255, 255, 255, 0.72),
    0 0 16px 2px rgba(29, 121, 146, 0.72),
    0 18px 28px -12px black;
  filter: saturate(1.12) contrast(1.1);
}

.anime-card:hover .anime-cover-wrap::before,
.anime-card:hover .anime-cover-wrap::after {
  opacity: 1;
}

.anime-card:hover .anime-cover-wrap::before {
  animation: foil-sweep 1.6s linear infinite;
}

.anime-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  filter: grayscale(0.2) contrast(1.08);
}

.lyrics-list {
  display: grid;
  gap: 14px;
}

.lyrics-entry {
  border-top: 1px dotted rgba(255, 255, 255, 0.45);
  padding-top: 10px;
}

.lyrics-entry p {
  margin: 8px 0 0;
  padding-left: 10px;
  border-left: 1px dotted rgba(255, 255, 255, 0.4);
  color: rgba(255, 255, 255, 0.82);
}

footer {
  margin-top: 30px;
  font-size: 12px;
  position: relative;
  z-index: 1;
  transition: 0.7s;
  height: 27px;
  overflow-y: scroll;
  width: 100%;
}

footer:hover,
p#footer-text:hover {
  letter-spacing: 0.2px;
}

p#footer-text {
  margin: 28px 0 0;
  transition: 0.3s;
}

::selection {
  background: #7f8aec3d;
  color: #ececec;
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
  border: 1px dotted rgba(255, 255, 255, 0.42);
  border-radius: 0;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.46);
}

::-webkit-scrollbar-corner {
  background: transparent;
}

.not-found-screen {
  text-align: center;
}

.broken-logo {
  animation: broken-logo 0.32s steps(2, end) infinite;
}

.not-found-page .subtitle {
  text-align: center;
}

@keyframes broken-logo {
  0%,
  100% {
    transform: translateX(0);
    text-shadow: 2px 0 #fff, -2px 0 #004aa3;
  }

  50% {
    transform: translateX(2px);
    text-shadow: -2px 0 #d00000, 2px 0 #fff;
  }
}

@media (max-width: 560px) {
  body {
    align-items: flex-start;
  }

  .screen {
    width: calc(100% - 32px);
    padding: 36px 16px;
  }

  .logo {
    width: 100%;
    font-size: 42px;
  }

  nav {
    gap: 8px 14px;
  }

  nav a {
    margin-right: 0;
  }
}

body.essay-page {
  text-align: left;
}

.essay-screen {
  width: 460px;
  padding: 48px;
  color: white;
  position: relative;
  z-index: 1;
  transition: 0.3s;
}

.essay-header,
.essay-main,
.essay-footer {
  position: relative;
  z-index: 1;
}

.essay-header {
  text-align: center;
}

.essay-header a {
  margin-right: 8px;
  text-decoration: none;
  font-size: 14px;
}

.essay-header hr {
  filter: drop-shadow(0 0 2px white);
  border: 0;
  border-top: 1px dotted white;
  margin: 12px 0 0;
}

.essay-main {
  margin-top: 10px;
  text-align: center;
}

.essay-section {
  display: block;
  height: 488px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-inline: 70px;
  text-align: justify;
}

/* Diary entries are short compared to the long-form essays, so let them
   shrink to their content instead of always filling the fixed essay height. */
.diary-page-section {
  height: auto;
  max-height: 488px;
}

.essay-section h1 {
  font-size: 50px;
  line-height: 0.94;
  margin: 0 0 16px;
  padding: 0;
  text-align: center;
  transition: 0.7s;
}

.essay-section h1:hover {
  filter: drop-shadow(0 0 2px rgb(80, 80, 80));
  letter-spacing: 1px;
}

.essay-section h1 span {
  display: block;
  font-family: Georgia, serif;
  font-style: italic;
  font-weight: normal;
}

.essay-section p {
  transition: 0.7s;
}

.essay-section p:hover {
  letter-spacing: 0.2px;
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.45));
}

.essay-note,
.quote,
.center-line,
.essay-footer {
  text-align: center;
}

.quote {
  font-family: Georgia, serif;
  font-style: italic;
}

.glitter {
  animation: glitter 1.8s steps(2, end) infinite;
  color: white;
  font-family: Georgia, serif;
  text-decoration: underline 0.5px;
  text-decoration-style: wavy;
}

.sparkle,
.ghost,
.slow-wave,
.shake,
.fade-pulse,
.red-flicker,
.scan,
.ruby,
.redacted {
  display: inline-block;
  position: relative;
  font-family: Georgia, serif;
}

.sparkle {
  animation: sparkle 2.4s linear infinite;
}

.sparkle::before,
.sparkle::after {
  content: "*";
  position: absolute;
  top: -0.7em;
  font-family: courier, "Courier New", monospace;
  font-size: 10px;
  opacity: 0;
  animation: star-blink 1.6s steps(2, end) infinite;
}

.sparkle::before {
  left: -0.8em;
}

.sparkle::after {
  right: -0.9em;
  animation-delay: 0.6s;
}

.ghost {
  animation: ghost-drift 4.5s ease-in-out infinite;
  color: rgba(255, 255, 255, 0.78);
  text-shadow: 7px 0 1px rgba(255, 255, 255, 0.12);
}

.slow-wave {
  animation: slow-wave 3.8s ease-in-out infinite;
  text-decoration: underline 0.5px;
  text-decoration-style: wavy;
}

.shake {
  animation: shake 0.18s steps(2, end) infinite;
  color: #fff;
  text-shadow: 1px 0 #d00000, -1px 0 #004aa3;
}

.fade-pulse {
  animation: fade-pulse 3.2s ease-in-out infinite;
}

.red-flicker {
  animation: red-flicker 1.1s steps(2, end) infinite;
  color: #fff;
}

.scan {
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 2px,
      rgba(255, 255, 255, 0.38) 2px,
      rgba(255, 255, 255, 0.38) 3px
    );
  animation: scan-jitter 0.9s steps(2, end) infinite;
  padding-inline: 2px;
}

.ruby {
  animation: ruby-burn 2s ease-in-out infinite;
  color: #ffd5dc;
}

.redacted {
  padding: 0 4px;
  color: transparent;
  background:
    repeating-linear-gradient(
      90deg,
      #fff 0,
      #fff 3px,
      #111 3px,
      #111 7px
    );
  border: 1px dotted rgba(255, 255, 255, 0.45);
  text-shadow: none;
  animation: redacted-noise 0.45s steps(2, end) infinite;
}

.redacted::after {
  content: "classified";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(0, 0, 0, 0.82);
  font-family: courier, "Courier New", monospace;
  font-size: 9px;
  letter-spacing: 0;
}

.wavy {
  font-family: Georgia, serif;
  text-decoration: underline 0.5px;
  text-decoration-style: wavy;
  filter: drop-shadow(0 0 2px white);
}

.old-marquee {
  border-top: 1px dotted rgba(255, 255, 255, 0.5);
  border-bottom: 1px dotted rgba(255, 255, 255, 0.5);
  color: rgba(255, 255, 255, 0.8);
  margin: 18px 0;
  padding: 5px 0;
}

.dialogue {
  font-family: Georgia, serif;
  text-align: center;
}

.essay-footer {
  margin-top: 20px;
  font-size: 12px;
  transition: 0.7s;
}

/* Prev / archive / next row in diary entry footers. */
.entry-nav {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}

.entry-nav-prev {
  text-align: left;
}

.entry-nav-next {
  text-align: right;
}

.entry-nav-empty {
  color: rgba(255, 255, 255, 0.35);
}

@keyframes glitter {
  0%,
  100% {
    text-shadow:
      1px 0 0 #fff,
      -1px 0 4px #7f8aec,
      0 0 8px rgba(255, 255, 255, 0.35);
  }

  50% {
    text-shadow:
      -1px 0 0 #fff,
      1px 0 5px #d00000,
      0 0 11px rgba(255, 255, 255, 0.7);
  }
}

@keyframes sparkle {
  0%,
  100% {
    text-shadow: 0 0 2px #fff, 0 0 7px rgba(255, 255, 255, 0.2);
  }

  50% {
    text-shadow: 0 0 1px #fff, 0 0 10px rgba(127, 138, 236, 0.85);
  }
}

@keyframes star-blink {
  0%,
  100% {
    opacity: 0;
    transform: translateY(0);
  }

  50% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

@keyframes ghost-drift {
  0%,
  100% {
    transform: translateX(0);
    opacity: 0.72;
  }

  50% {
    transform: translateX(3px);
    opacity: 1;
  }
}

@keyframes slow-wave {
  0%,
  100% {
    transform: translateY(0) skewX(0deg);
  }

  50% {
    transform: translateY(-1px) skewX(-5deg);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translate(0, 0);
  }

  25% {
    transform: translate(1px, -1px);
  }

  50% {
    transform: translate(-1px, 1px);
  }

  75% {
    transform: translate(1px, 1px);
  }
}

@keyframes fade-pulse {
  0%,
  100% {
    opacity: 1;
    filter: blur(0);
  }

  50% {
    opacity: 0.35;
    filter: blur(0.6px);
  }
}

@keyframes red-flicker {
  0%,
  100% {
    text-shadow: 1px 0 0 #d00000, 0 0 8px rgba(208, 0, 0, 0.1);
  }

  50% {
    text-shadow: -1px 0 0 #d00000, 0 0 14px rgba(208, 0, 0, 0.85);
  }
}

@keyframes scan-jitter {
  0%,
  100% {
    transform: translateX(0);
  }

  50% {
    transform: translateX(1px);
  }
}

@keyframes ruby-burn {
  0%,
  100% {
    text-shadow: 0 0 2px #fff, 0 0 8px rgba(208, 0, 0, 0.42);
  }

  50% {
    text-shadow: 0 0 4px #fff, 0 0 16px rgba(208, 0, 0, 0.95);
  }
}

@keyframes redacted-noise {
  0%,
  100% {
    filter: invert(0);
    transform: translateX(0);
  }

  50% {
    filter: invert(1);
    transform: translateX(1px);
  }
}

@keyframes foil-sweep {
  0% {
    background-position: 180% 0%, 0 0;
  }

  100% {
    background-position: -80% 100%, 24px 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .glitter,
  .sparkle,
  .sparkle::before,
  .sparkle::after,
  .ghost,
  .slow-wave,
  .shake,
  .fade-pulse,
  .red-flicker,
  .scan,
  .ruby,
  .redacted,
  .anime-card:hover .anime-cover-wrap::before {
    animation: none;
  }

  .anime-card:hover .anime-cover-wrap {
    transform: none;
  }
}

@media (max-width: 620px) {
  .essay-screen {
    width: calc(100% - 32px);
    padding: 36px 16px;
  }

  .essay-section {
    padding-inline: 14px;
    height: 68vh;
  }

  .diary-page-section {
    height: auto;
    max-height: 68vh;
  }

  .essay-section h1 {
    font-size: 36px;
  }

  .entry-nav {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  .entry-nav-prev,
  .entry-nav-next {
    text-align: center;
  }
}
