/* Black-and-white manga art direction layered over the shared site system. */
:root,
:root[data-theme="dark"] {
  --manga-paper: #eeeae0;
  --manga-paper-deep: #d8d3c7;
  --manga-ink: #080808;
  --manga-soft-ink: #242424;
  --manga-gray: #77746d;
  --manga-red: #c4142d;
  --color-bg: var(--manga-paper);
  --color-surface: #f5f2e9;
  --color-surface-2: #e6e1d6;
  --color-text: var(--manga-ink);
  --color-muted: #615f59;
  --color-border: rgba(8, 8, 8, 0.26);
  --color-border-strong: rgba(8, 8, 8, 0.86);
  --color-accent: var(--manga-red);
  --color-accent-contrast: #ffffff;
  --color-overlay: rgba(0, 0, 0, 0.78);
  --color-topbar: rgba(8, 8, 8, 0.94);
  --color-input: rgba(8, 8, 8, 0.055);
  --bg: var(--manga-paper);
  --bg-deep: var(--manga-paper);
  --panel: #f5f2e9;
  --panel2: #e6e1d6;
  --text: var(--manga-ink);
  --muted: #615f59;
  --accent: var(--manga-red);
  --border: var(--manga-ink);
  --ring: 0 0 0 3px rgba(196, 20, 45, 0.2);
  --shadow-sm: 5px 5px 0 rgba(8, 8, 8, 0.9);
  --shadow-md: 9px 9px 0 rgba(8, 8, 8, 0.95);
  --shadow-lg: 14px 14px 0 rgba(8, 8, 8, 0.96);
}

html {
  background: var(--manga-paper);
}

body {
  color: var(--manga-ink);
  background-color: var(--manga-paper);
  background-image: radial-gradient(
      circle at 1px 1px,
      rgba(8, 8, 8, 0.075) 0.8px,
      transparent 0.9px
    );
  background-size: 5px 5px;
}

body::before {
  opacity: 0.24;
  background-image: repeating-linear-gradient(
      103deg,
      transparent 0,
      transparent 92px,
      rgba(0, 0, 0, 0.05) 93px,
      transparent 95px
    ),
    radial-gradient(circle at 52% 38%, transparent 0 32%, rgba(0, 0, 0, 0.08) 82%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 34;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 110px rgba(0, 0, 0, 0.12);
}

.manga-frame {
  position: fixed;
  inset: 10px;
  z-index: 35;
  pointer-events: none;
  mix-blend-mode: difference;
}

.manga-frame span {
  position: absolute;
  width: 26px;
  height: 26px;
  border-color: #ffffff;
  border-style: solid;
}

.manga-frame span:nth-child(1) {
  left: 0;
  top: 0;
  border-width: 2px 0 0 2px;
}

.manga-frame span:nth-child(2) {
  right: 0;
  top: 0;
  border-width: 2px 2px 0 0;
}

.manga-frame span:nth-child(3) {
  left: 0;
  bottom: 0;
  border-width: 0 0 2px 2px;
}

.manga-frame span:nth-child(4) {
  right: 0;
  bottom: 0;
  border-width: 0 2px 2px 0;
}

.topbar {
  color: #ffffff;
  background: rgba(8, 8, 8, 0.94);
  border-bottom: 4px solid #ffffff;
  box-shadow: 0 5px 0 var(--manga-ink);
  backdrop-filter: blur(12px);
}

.topbar::after {
  bottom: -4px;
  height: 4px;
  background: linear-gradient(
    90deg,
    #ffffff 0 46%,
    var(--manga-red) 46% 55%,
    #ffffff 55% 100%
  );
  box-shadow: none;
}

.topbar-inner {
  padding-block: 13px;
}

.home-link {
  border: 2px solid #ffffff;
  border-radius: 0;
  background: var(--manga-ink);
  box-shadow: 4px 4px 0 rgba(255, 255, 255, 0.28);
}

.home-link:hover,
.home-link:focus-visible {
  border-color: #ffffff;
  background: #ffffff;
  box-shadow: 4px 4px 0 var(--manga-red);
}

.home-logo {
  filter: saturate(1.16) drop-shadow(0 0 5px rgba(255, 196, 36, 0.54));
}

.home-link:hover .home-logo,
.home-link:focus-visible .home-logo {
  filter: saturate(1.25) drop-shadow(0 0 8px rgba(255, 174, 20, 0.72));
}

.topbar-link {
  color: #ffffff;
  background: transparent;
  border: 2px solid #ffffff;
  border-radius: 0;
  box-shadow: 4px 4px 0 rgba(255, 255, 255, 0.22);
}

.topbar-link::before {
  content: "目次";
  margin-right: 7px;
  color: #bcbcbc;
  font: 700 0.65rem/1 "Noto Sans JP", sans-serif;
  letter-spacing: 0.16em;
}

.topbar-link:hover,
.topbar-link:focus-visible {
  color: var(--manga-ink);
  background: #ffffff;
  border-color: #ffffff;
  box-shadow: 4px 4px 0 var(--manga-red);
}

.hero {
  position: relative;
  padding: 68px 0 76px;
  overflow: hidden;
  color: #ffffff;
  background: var(--manga-ink);
  border-bottom: 8px solid var(--manga-ink);
}

.hero::before {
  content: "";
  position: absolute;
  inset: -20%;
  opacity: 0.22;
  background: repeating-conic-gradient(
    from 236deg at 50% 44%,
    transparent 0deg 2.2deg,
    rgba(255, 255, 255, 0.14) 2.3deg 2.5deg,
    transparent 2.6deg 6deg
  );
  transform: rotate(-2deg);
  pointer-events: none;
}

.hero::after {
  content: "RYLOGIX MANGA // 001";
  position: absolute;
  right: max(3vw, 20px);
  bottom: 17px;
  color: rgba(255, 255, 255, 0.44);
  font: 500 0.58rem/1 "Inter", sans-serif;
  letter-spacing: 0.24em;
}

.hero-inner {
  position: relative;
  z-index: 1;
}

.manga-side-note {
  position: absolute;
  left: clamp(-70px, -4.8vw, -34px);
  top: 92px;
  z-index: 4;
  padding: 17px 10px 15px;
  color: #ffffff;
  background: rgba(8, 8, 8, 0.78);
  border: 1px solid rgba(255, 55, 83, 0.72);
  box-shadow: 0 0 5px rgba(255, 32, 67, 0.85),
    0 0 18px rgba(255, 24, 61, 0.5),
    inset 0 0 12px rgba(255, 28, 63, 0.16);
  font: 700 clamp(0.96rem, 1.25vw, 1.24rem)/1.12 "Noto Sans JP", sans-serif;
  letter-spacing: 0.18em;
  text-shadow: 0 0 2px #ffffff, 0 0 7px #ff3455,
    0 0 16px #ff173f, 0 0 30px rgba(255, 14, 54, 0.9);
  writing-mode: vertical-rl;
  animation: neon-breathe 3.8s ease-in-out infinite;
}

.discord-card {
  color: var(--manga-ink);
  background: var(--manga-paper);
  border: 3px solid #ffffff;
  border-radius: 0;
  box-shadow: 7px 7px 0 rgba(255, 255, 255, 0.22),
    11px 11px 0 var(--manga-red);
}

.discord-card::after {
  content: "STATUS";
  position: absolute;
  right: 0;
  top: 0;
  padding: 3px 7px;
  color: #ffffff;
  background: var(--manga-ink);
  font: 700 0.52rem/1 "Inter", sans-serif;
  letter-spacing: 0.15em;
  opacity: 1;
}

.discord-card:hover,
.discord-card:focus-visible {
  border-color: #ffffff;
  box-shadow: 7px 7px 0 #ffffff, 12px 12px 0 var(--manga-red);
}

.discord-avatar {
  border: 2px solid var(--manga-ink);
  filter: saturate(1.12) contrast(1.05);
  box-shadow: 3px 3px 0 var(--manga-ink);
}

.discord-card:hover .discord-avatar,
.discord-card:focus-visible .discord-avatar {
  filter: saturate(1.22) contrast(1.08);
}

.discord-activity,
.discord-card .activity-name,
.discord-card .activity-details,
.discord-card .activity-state,
.discord-card .activity-elapsed {
  color: var(--manga-ink);
}

.hero-card {
  isolation: isolate;
  min-height: 410px;
  padding: 54px 58px 44px;
  overflow: hidden;
  color: var(--manga-ink);
  background: var(--manga-paper);
  border: 4px solid #ffffff;
  border-radius: 0;
  box-shadow: 12px 12px 0 #b9b4a9, 18px 18px 0 #ffffff;
}

.hero-card::before {
  display: block;
  inset: 0;
  z-index: -2;
  opacity: 0.4;
  background: radial-gradient(circle at 1px 1px, rgba(8, 8, 8, 0.18) 1px, transparent 1.3px),
    linear-gradient(112deg, transparent 0 47%, rgba(8, 8, 8, 0.07) 47.2% 48%, transparent 48.2%);
  background-size: 7px 7px, auto;
}

.hero-card::after {
  display: block;
  inset: 12px;
  z-index: -1;
  border: 2px solid var(--manga-ink);
  border-radius: 0;
  background: radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.88), transparent 55%);
  opacity: 1;
}

.ink-sun {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: -1;
  width: min(450px, 78vw);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(8, 8, 8, 0.18);
  border-radius: 50%;
  opacity: 0.42;
}

.ink-sun::before,
.ink-sun::after,
.ink-sun span {
  content: "";
  position: absolute;
  border-radius: 50%;
}

.ink-sun::before {
  inset: 10%;
  border: 2px dashed rgba(8, 8, 8, 0.28);
}

.ink-sun::after {
  inset: 27%;
  border: 2px solid rgba(8, 8, 8, 0.18);
  box-shadow: none;
}

.ink-sun span,
.ink-sun span:nth-child(2),
.ink-sun span:nth-child(3) {
  width: 8px;
  height: 8px;
  background: var(--manga-ink);
  box-shadow: none;
}

.ink-sun span:nth-child(1) {
  left: calc(50% - 4px);
  top: -4px;
}

.ink-sun span:nth-child(2) {
  right: 8%;
  bottom: 18%;
}

.ink-sun span:nth-child(3) {
  left: 8%;
  bottom: 18%;
}

.hero-chapter {
  position: absolute;
  left: 20px;
  top: 20px;
  z-index: 3;
  display: grid;
  min-width: 62px;
  border: 2px solid var(--manga-ink);
  background: var(--manga-paper);
  box-shadow: 4px 4px 0 var(--manga-ink);
  text-align: center;
  transform: rotate(-2deg);
}

.hero-chapter span {
  padding: 4px 8px;
  color: #ffffff;
  background: var(--manga-ink);
  font: 700 0.62rem/1 "Noto Sans JP", sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-chapter strong {
  padding: 4px 8px 2px;
  font: 400 1.55rem/1 "Bebas Neue", sans-serif;
  letter-spacing: 0.08em;
}

.hanko-stamp {
  position: absolute;
  right: 26px;
  top: 24px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 3px double var(--manga-red);
  color: var(--manga-red);
  font: 700 0.9rem/1 "Noto Sans JP", sans-serif;
  transform: rotate(9deg);
  opacity: 0.86;
}

.hero-text {
  z-index: 2;
}

.eyebrow {
  color: #373631;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.eyebrow span {
  border: 2px solid var(--manga-ink);
  color: #ffffff;
  background: var(--manga-ink);
  box-shadow: none;
  font-family: "Noto Sans JP", sans-serif;
}

.hero-text h1 {
  margin: 7px 0 13px;
  color: var(--manga-ink);
  font-family: "Bebas Neue", "Impact", sans-serif;
  font-size: clamp(4.5rem, 11vw, 7.3rem);
  line-height: 0.83;
  letter-spacing: 0.035em;
  text-shadow: 4px 4px 0 rgba(196, 20, 45, 0.2);
}

.tagline {
  max-width: 58ch;
  color: #34332f;
  font-size: 0.96rem;
  font-weight: 500;
}

.hero-actions {
  margin-top: 8px;
}

#contact-button,
#support-button {
  min-width: 138px;
  border: 2px solid var(--manga-ink);
  border-radius: 0;
  font-weight: 700;
  box-shadow: 4px 4px 0 var(--manga-ink);
}

#contact-button {
  color: #ffffff;
  background: var(--manga-ink);
}

#support-button {
  color: var(--manga-ink);
  background: var(--manga-paper);
}

#contact-button:hover,
#contact-button:focus-visible,
#support-button:hover,
#support-button:focus-visible {
  color: #ffffff;
  background: var(--manga-red);
  border-color: var(--manga-ink);
  box-shadow: 6px 6px 0 var(--manga-ink);
}

.manga-marquee {
  display: flex;
  width: min(720px, 112%);
  margin-top: 30px;
  padding: 8px 14px;
  gap: 0;
  overflow: hidden;
  color: #ffffff;
  background: var(--manga-ink);
  border-block: 2px solid var(--manga-ink);
  box-shadow: 5px 5px 0 var(--manga-red);
  font: 400 0.82rem/1 "Bebas Neue", sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  transform: rotate(-1deg);
}

.manga-marquee span {
  display: inline-flex;
  align-items: center;
}

.manga-marquee span:nth-child(odd) {
  font-family: "Noto Sans JP", "Bebas Neue", sans-serif;
  font-weight: 700;
}

.manga-marquee span:not(:last-child)::after {
  content: "✦";
  margin: 0 12px;
  color: var(--manga-red);
  font-size: 0.65rem;
}

.links,
.projects {
  position: relative;
  padding-block: 68px;
  color: var(--manga-ink);
  background: var(--manga-paper);
}

.links::before,
.projects::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.2;
  background-image: radial-gradient(circle at 1px 1px, rgba(0, 0, 0, 0.17) 1px, transparent 1.2px);
  background-size: 8px 8px;
  mask-image: linear-gradient(90deg, #000, transparent 34%, transparent 70%, #000);
  pointer-events: none;
}

.links > .container,
.projects > .container {
  position: relative;
  z-index: 1;
}

.section-title {
  margin: 10px 0 30px;
  padding-bottom: 8px;
  border-bottom: 4px solid var(--manga-ink);
}

.section-kicker {
  top: -13px;
  color: var(--manga-red);
  font-weight: 800;
}

.section-title h2 {
  color: var(--manga-ink);
  font-size: clamp(3rem, 7vw, 5rem);
  line-height: 0.82;
}

.underline {
  height: 10px;
  border: 2px solid var(--manga-ink);
  background: repeating-linear-gradient(
    135deg,
    var(--manga-ink) 0 5px,
    transparent 5px 9px
  );
  box-shadow: none;
}

.links-grid,
.projects-grid {
  gap: 22px;
  counter-reset: manga-panel;
}

.link-card,
.project-card {
  --panel-mark: var(--manga-red);
  counter-increment: manga-panel;
  color: var(--manga-ink);
  background: #f6f2e8;
  border: 3px solid var(--manga-ink);
  border-radius: 0;
  box-shadow: 7px 7px 0 var(--manga-ink);
  transition: transform 180ms ease, box-shadow 180ms ease,
    background-color 180ms ease, color 180ms ease;
}

.link-card:nth-child(even) {
  color: #ffffff;
  background: var(--manga-ink);
  border-color: var(--manga-ink);
  box-shadow: 7px 7px 0 #7e7a72;
}

.link-card::before,
.project-card::before {
  display: block;
  width: 7px;
  background: var(--manga-ink);
  box-shadow: none;
  opacity: 1;
}

.link-card:nth-child(even)::before {
  background: #ffffff;
}

.link-card::after,
.project-card::after {
  content: "0" counter(manga-panel);
  position: absolute;
  top: 7px;
  right: 9px;
  left: auto;
  z-index: 2;
  width: auto;
  height: auto;
  color: currentColor;
  background: none;
  font: 400 0.72rem/1 "Bebas Neue", sans-serif;
  letter-spacing: 0.12em;
  opacity: 0.34;
  transform: none;
  pointer-events: none;
}

.link-card:hover,
.link-card:focus-visible,
.project-card:hover,
.project-card:focus-visible {
  color: var(--manga-ink);
  background: #ffffff;
  border-color: var(--manga-ink);
  box-shadow: 10px 10px 0 var(--manga-ink),
    inset 0 -5px 0 var(--panel-mark);
  transform: translate(-2px, -2px) rotate(-0.35deg);
}

.link-card:hover::before,
.link-card:focus-visible::before,
.project-card:hover::before,
.project-card:focus-visible::before {
  width: 7px;
  background: var(--panel-mark);
}

.logo-wrap {
  border: 2px solid var(--manga-ink);
  border-radius: 0;
  background: var(--manga-ink);
  box-shadow: 3px 3px 0 #8c887f;
}

.logo-wrap img {
  filter: none;
}

.link-card:nth-child(even) .logo-wrap {
  border-color: #ffffff;
  background: #ffffff;
  box-shadow: 3px 3px 0 #55534e;
}

.link-card:nth-child(even) .logo-wrap img {
  filter: none;
}

.link-card:hover .logo-wrap,
.link-card:focus-visible .logo-wrap {
  border-color: var(--manga-ink);
  background: var(--manga-ink);
}

.link-card:hover .logo-wrap img,
.link-card:focus-visible .logo-wrap img {
  filter: saturate(1.12) contrast(1.04);
}

.link-text h3,
.project-body h3 {
  color: currentColor;
  font-size: 1.45rem;
}

.link-text p,
.project-body p,
.project-category-header p {
  color: currentColor;
  opacity: 0.7;
}

.external-icon,
.logo-fallback {
  color: var(--manga-red);
}

.project-category {
  padding: 20px;
  border-left: 4px solid var(--manga-ink);
}

.project-category-header .project-category-label {
  display: inline-block;
  justify-self: start;
  width: auto;
  padding: 4px 9px 2px;
  color: #ffffff;
  background: var(--manga-ink);
  font-size: 1.4rem;
  opacity: 1;
}

.project-media {
  border: 0;
  border-bottom: 3px solid var(--manga-ink);
  border-radius: 0;
  background: #cbc6ba;
}

.project-media img {
  filter: saturate(1.06) contrast(1.04);
  transition: filter 220ms ease, transform 420ms ease;
}

.project-card:hover .project-media img,
.project-card:focus-visible .project-media img {
  filter: saturate(1.18) contrast(1.08);
  transform: scale(1.025);
}

.project-tag {
  color: var(--manga-ink);
  background: transparent;
  border: 1px solid var(--manga-ink);
  border-radius: 0;
}

.modal-backdrop {
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: grayscale(1) contrast(1.4);
}

.contact-modal-inner {
  color: var(--manga-ink);
  background: var(--manga-paper);
  border: 4px solid #ffffff;
  border-radius: 0;
  box-shadow: 12px 12px 0 var(--manga-red), 18px 18px 0 #ffffff;
}

.contact-modal-inner::before {
  content: "";
  position: absolute;
  inset: 10px;
  z-index: -1;
  border: 2px solid var(--manga-ink);
  pointer-events: none;
}

.contact-modal h2,
.support-modal h2 {
  color: var(--manga-ink);
  font-size: 3.3rem;
}

.modal-close {
  color: #ffffff;
  background: var(--manga-ink);
  border: 2px solid var(--manga-ink);
  border-radius: 0;
}

.modal-close:hover,
.modal-close:focus-visible {
  color: #ffffff;
  background: var(--manga-red);
}

.contact-modal .contact-field input,
.contact-modal .contact-field textarea {
  color: var(--manga-ink);
  background: rgba(255, 255, 255, 0.55);
  border: 2px solid var(--manga-ink);
  border-radius: 0;
}

.contact-modal .contact-field input:focus,
.contact-modal .contact-field textarea:focus {
  border-color: var(--manga-ink);
  box-shadow: 4px 4px 0 var(--manga-red);
}

.contact-submit,
.contact-modal .btn {
  color: #ffffff;
  background: var(--manga-ink);
  border: 2px solid var(--manga-ink);
  border-radius: 0;
  box-shadow: 4px 4px 0 var(--manga-red);
}

.support-copy,
.contact-modal .contact-note,
.contact-modal .contact-status,
.support-list,
.support-value {
  color: var(--manga-ink);
}

.site-footer {
  position: relative;
  padding-block: 30px;
  color: #ffffff;
  background: var(--manga-ink);
  border-top: 6px solid var(--manga-red);
}

.footer-mark {
  position: absolute;
  right: max(24px, 4vw);
  top: 50%;
  color: rgba(255, 255, 255, 0.42);
  font: 700 0.62rem/1 "Noto Sans JP", sans-serif;
  letter-spacing: 0.18em;
  transform: translateY(-50%);
}

.toast {
  color: #ffffff;
  background: var(--manga-ink);
  border: 2px solid #ffffff;
  border-radius: 0;
  box-shadow: 5px 5px 0 var(--manga-red);
}

::selection {
  color: #ffffff;
  background: var(--manga-red);
}

@keyframes neon-breathe {
  0%,
  100% {
    opacity: 0.86;
    filter: brightness(0.92);
  }
  48% {
    opacity: 1;
    filter: brightness(1.18);
  }
  52% {
    opacity: 0.94;
    filter: brightness(1.02);
  }
  56% {
    opacity: 1;
    filter: brightness(1.2);
  }
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--manga-red);
  outline-offset: 4px;
  box-shadow: none;
}

@media (max-width: 640px) {
  .manga-frame {
    inset: 6px;
  }

  .hero {
    padding: 46px 0 64px;
  }

  .manga-side-note {
    position: relative;
    left: auto;
    top: auto;
    z-index: 2;
    width: max-content;
    max-width: 92vw;
    margin: -12px auto 4px;
    padding: 8px 13px;
    font-size: 0.78rem;
    line-height: 1;
    letter-spacing: 0.16em;
    writing-mode: horizontal-tb;
  }

  .discord-card {
    max-width: 88vw;
    box-shadow: 5px 5px 0 rgba(255, 255, 255, 0.24),
      8px 8px 0 var(--manga-red);
  }

  .hero-card {
    min-height: 420px;
    padding: 68px 24px 38px;
    box-shadow: 8px 8px 0 #b9b4a9, 12px 12px 0 #ffffff;
  }

  .hero-card::after {
    inset: 9px;
  }

  .hero-chapter {
    left: 16px;
    top: 16px;
  }

  .hanko-stamp {
    right: 18px;
    top: 18px;
    width: 43px;
    height: 43px;
  }

  .hero-text h1 {
    font-size: clamp(4.4rem, 22vw, 6rem);
  }

  .tagline {
    font-size: 0.9rem;
  }

  #contact-button,
  #support-button {
    min-width: 124px;
  }

  .manga-marquee {
    width: 120%;
    margin-top: 26px;
    font-size: 0.72rem;
  }

  .links,
  .projects {
    padding-block: 56px;
  }

  .project-category {
    padding: 14px 0 14px 14px;
  }

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

  .project-card {
    width: 100%;
  }

  .link-card,
  .project-card {
    box-shadow: 5px 5px 0 var(--manga-ink);
  }

  .footer-mark {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .manga-side-note {
    animation: none;
  }

  .project-media img {
    transition: none;
  }
}
