* { box-sizing: border-box; }

html {
  color-scheme: dark;
  -webkit-tap-highlight-color: rgba(200, 16, 46, 0.2);
  scrollbar-width: thin;
  scrollbar-color: var(--color-red) var(--color-bg-panel);
}
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-red-a45); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-red); }

body {
  margin: 0;
  background-color: var(--color-bg-base);
  color: var(--color-white);
  font-family: var(--font-body);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 { font-family: var(--font-heading); font-weight: 700; margin: 0; }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); font-family: var(--font-body); font-weight: 300; }
h4 { font-size: var(--fs-h4); font-family: var(--font-body); font-weight: 300; }
h5 { font-size: var(--fs-h5); font-family: var(--font-body); font-weight: 300; }
p { margin: 0; }

.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: var(--z-modal);
  padding: 10px 16px;
  background: var(--color-red);
  color: var(--color-white);
  border-radius: var(--radius-sm);
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

:focus-visible { outline: 2px solid var(--color-red-bright); outline-offset: 2px; }
#page-background {
  position: fixed;
  inset: 0;
  z-index: var(--z-bg);
  background-size: cover;
  background-position: center;
  pointer-events: none;
  filter: grayscale(0.6);
}
#page-background::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--color-red);
  mix-blend-mode: color;
  opacity: 0.45;
}
#page-background::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 70% 40%, rgba(11, 9, 9, 0) 0%, rgba(11, 9, 9, 0.85) 75%),
    linear-gradient(to top, rgba(11, 9, 9, 0.95) 0%, rgba(11, 9, 9, 0) 55%);
}
.page-darken {
  position: fixed;
  inset: 0;
  z-index: var(--z-bg);
  background: rgba(8, 6, 6, 0.55);
  pointer-events: none;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 200ms var(--ease), border-color 200ms var(--ease), color 200ms var(--ease), box-shadow 200ms var(--ease), transform 120ms var(--ease);
}
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--color-red); border-color: var(--color-red); color: var(--color-white); }
.btn-primary:hover { background: var(--color-red-bright); border-color: var(--color-red-bright); box-shadow: 0 8px 24px var(--color-red-a45); }

.btn-secondary { background: transparent; border-color: var(--color-line-strong); color: var(--color-white); }
.btn-secondary:hover { border-color: var(--color-white); background: rgba(246, 242, 241, 0.06); }

.btn-ghost { background: rgba(19, 16, 16, 0.72); border-color: var(--color-line); color: var(--color-white); }
.btn-ghost:hover { border-color: var(--color-red-a45); background: var(--color-red-a12); }

.btn-lg { min-height: 52px; padding: 0 30px; font-size: 15px; }

.btn.is-disabled,
.btn.is-disabled:hover {
  cursor: not-allowed;
  color: var(--color-text-faint);
  background: rgba(19, 16, 16, 0.6);
  border-color: var(--color-line);
  border-style: dashed;
  box-shadow: none;
  transform: none;
}
.soon-tag {
  padding: 2px 6px;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--color-red-bright);
  background: var(--color-red-a12);
  border-radius: 2px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--color-white);
  background: rgba(19, 16, 16, 0.72);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 200ms var(--ease), border-color 200ms var(--ease);
}
.icon-btn:hover:not(:disabled) { border-color: var(--color-red); background: var(--color-red-a12); }
.icon-btn:disabled { opacity: 0.35; cursor: default; }

.text-link {
  padding: 0;
  font: inherit;
  color: var(--color-white);
  background: none;
  border: 0;
  text-decoration: underline;
  text-decoration-color: var(--color-red);
  text-underline-offset: 3px;
  cursor: pointer;
}
.text-link:hover { color: var(--color-red-bright); }
.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: var(--z-sidebar);
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  background: var(--color-bg-panel);
  box-shadow: 12px 0 40px rgba(0, 0, 0, 0.55);
}

.sidebar-head {
  position: relative;
  padding: 28px 24px 20px;
  text-align: center;
}
.sidebar-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--color-white);
}
.logo-img { display: block; width: auto; max-width: 180px; height: auto; max-height: 120px; object-fit: contain; }
.logo-text { font-family: var(--font-heading); font-weight: 700; font-size: 24px; }
.logo-tag {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.sidebar-close { position: absolute; top: 16px; right: 16px; display: none; }

.chapters {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 12px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--color-line-strong) transparent;
}
.chapters::-webkit-scrollbar-thumb { background: var(--color-line-strong); }
.chapters ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.chapter-link {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 14px;
  color: var(--color-text-muted);
  font-size: 14px;
  font-weight: 400;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background-color 200ms var(--ease), color 200ms var(--ease);
}
.chapter-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chapter-link:hover { color: var(--color-white); background: rgba(246, 242, 241, 0.04); }
.chapter-link[aria-current] {
  color: var(--color-white);
  font-weight: 500;
  background: var(--color-red-a12);
  box-shadow: 0 0 0 1px var(--color-red-a24), 0 0 18px rgba(200, 16, 46, 0.12);
}

.sidebar-foot {
  display: grid;
  gap: 6px;
  padding: 16px 24px 20px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-text-faint);
  border-top: 1px solid var(--color-line);
}
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-backdrop);
  background: rgba(5, 3, 3, 0.65);
}
.sidebar-backdrop[hidden] { display: none; }

.stage {
  position: fixed;
  top: 0;
  bottom: 0;
  left: var(--sidebar-w);
  right: 0;
  z-index: var(--z-main);
}

.topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-topbar);
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 0 var(--gutter);
  background: linear-gradient(to bottom, rgba(11, 9, 9, 0.92) 0%, rgba(11, 9, 9, 0.6) 60%, rgba(11, 9, 9, 0) 100%);
}
.menu-btn { display: none; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.sections {
  position: absolute;
  inset: 0;
  overflow: hidden;
  outline: none;
}
.sections-track {
  height: 100%;
  transition: transform var(--dur-section) var(--ease);
  will-change: transform;
}
.no-anim .sections-track,
.no-anim .sec-inner > * { transition: none !important; }

.section {
  position: relative;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-padding-top: calc(var(--topbar-h) + 8px);
  display: flex;
  flex-direction: column;
  padding: calc(var(--topbar-h) + 8px) var(--gutter) var(--gutter);
  container-type: inline-size;
  scrollbar-width: thin;
}
.sec-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--content-max);
  margin: auto;
}
.sec-inner > * {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 600ms var(--ease), transform 600ms var(--ease);
}
.section.is-active .sec-inner > * { opacity: 1; transform: none; }
.section.is-active .sec-inner > *:nth-child(2) { transition-delay: 120ms; }
.section.is-active .sec-inner > *:nth-child(3) { transition-delay: 220ms; }

.sec-head { position: relative; }
.sec-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-red-bright);
}
.sec-eyebrow::before { content: ''; width: 24px; height: 1px; background: currentColor; }
.sec-title { color: var(--color-white); line-height: 1.2; text-wrap: balance; }
.sec-desc {
  max-width: 46ch;
  margin-top: 16px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text-muted);
  text-wrap: pretty;
}
.feature-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100%;
  max-width: var(--media-max);
  margin: 0 auto;
}
.feature-layout .sec-head { flex-shrink: 0; }
.feature-layout .sec-eyebrow { margin-bottom: 6px; }
.feature-layout .sec-desc { max-width: 90ch; margin-top: 6px; }
.media-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  container-type: size;
}
.media-frame.media-frame--img { padding: 6px; }
.media-zoom {
  position: relative;
  display: block;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  border-radius: var(--radius-sm);
}
.media-zoom img {
  display: block;
  width: auto;
  height: auto;
  max-width: calc(var(--stage-w, 100cqw) - 14px);
  max-height: calc(var(--stage-h, 100cqh) - 14px);
  border-radius: var(--radius-sm);
}
.media-zoom img:not([src]) { width: calc(var(--stage-w, 100cqw) - 14px); aspect-ratio: 16 / 9; background: var(--color-bg-raised); }
.zoom-hint {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-white);
  background: rgba(11, 9, 9, 0.78);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 200ms var(--ease), transform 200ms var(--ease);
  pointer-events: none;
}
.media-zoom:hover .zoom-hint,
.media-zoom:focus-visible .zoom-hint { opacity: 1; transform: none; }
@media (hover: none) {
  .zoom-hint { opacity: 1; transform: none; }
}
.feature-grid {
  display: grid;
  grid-template-columns: minmax(240px, 340px) minmax(0, 1fr);
  gap: var(--section-gap);
  align-items: center;
}
@container (min-width: 1400px) {
  .section .npc-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@container (max-width: 760px) {
  .feature-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .sec-desc { max-width: 60ch; }
}

.media-frame {
  position: relative;
  margin: 0;
  padding: 10px;
  background: rgba(19, 16, 16, 0.86);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  box-shadow: var(--container-glow), var(--red-glow);
}
.media-frame::before,
.media-frame::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  pointer-events: none;
}
.media-frame::before { top: -1px; left: -1px; border-top: 2px solid var(--color-red); border-left: 2px solid var(--color-red); border-top-left-radius: var(--radius-md); }
.media-frame::after { bottom: -1px; right: -1px; border-bottom: 2px solid var(--color-red); border-right: 2px solid var(--color-red); border-bottom-right-radius: var(--radius-md); }
.media-frame > img {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100dvh - var(--topbar-h) - 2 * var(--gutter) - 40px);
  object-fit: contain;
  border-radius: var(--radius-sm);
}
.media-frame > img:not([src]) { aspect-ratio: 16 / 9; background: var(--color-bg-raised); }
.hero-media { position: absolute; inset: 0; z-index: 0; }
.hero-img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.hero-img:not([src]) { visibility: hidden; }
.hero-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(11, 9, 9, 0.94) 0%, rgba(11, 9, 9, 0.7) 40%, rgba(11, 9, 9, 0.15) 100%),
    linear-gradient(to top, rgba(11, 9, 9, 0.9) 0%, rgba(11, 9, 9, 0) 40%);
}
.hero-inner .sec-desc { max-width: 52ch; font-size: 17px; color: var(--color-white); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.scroll-hint {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 48px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.scroll-hint-line { position: relative; width: 40px; height: 1px; background: var(--color-line-strong); overflow: hidden; }
.scroll-hint-line::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--color-red-bright);
  animation: hint 2.2s var(--ease) infinite;
}
@keyframes hint { 0% { transform: translateX(-100%); } 60%, 100% { transform: translateX(100%); } }
.section--closing::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 55%, rgba(200, 16, 46, 0.22) 0%, rgba(200, 16, 46, 0) 60%);
  pointer-events: none;
}
.closing-inner { text-align: center; }
.closing-inner .sec-eyebrow { justify-content: center; }
.closing-inner .sec-eyebrow::after { content: ''; width: 24px; height: 1px; background: currentColor; }
.closing-inner .sec-desc { margin-inline: auto; }
.closing-inner .cta-row { justify-content: center; }
.npc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: clamp(14px, 2.5vw, 24px);
  background-size: cover;
  background-position: center;
}
.npc-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 12px 16px;
  color: inherit;
  font-family: inherit;
  text-align: center;
  background: rgba(27, 21, 21, 0.88);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 200ms var(--ease), background-color 200ms var(--ease), transform 200ms var(--ease), box-shadow 200ms var(--ease);
}
.npc-card:hover,
.npc-card:focus-visible {
  border-color: var(--color-red);
  background: rgba(74, 10, 19, 0.55);
  box-shadow: 0 10px 28px rgba(200, 16, 46, 0.2);
  transform: translateY(-3px);
}
.npc-card img { display: block; width: auto; max-width: 100%; height: 100px; margin-bottom: 6px; object-fit: contain; }
.npc-card img:not([src]) { width: 80px; }
.npc-name { font-family: var(--font-heading); font-weight: 700; font-size: 16px; color: var(--color-white); }
.npc-sub { font-size: 13px; color: var(--color-text-muted); }
.modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(5, 3, 3, 0.84);
}
.modal[hidden] { display: none; }
.modal-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: fit-content;
  max-width: min(90vw, 640px);
  max-height: 90dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(24px, 4vw, 40px);
  text-align: center;
  background: var(--color-bg-panel);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  box-shadow: var(--container-glow), var(--red-glow);
}
.modal-close { position: absolute; top: 12px; right: 12px; }

#npc-modal-portrait { width: auto; max-width: 100%; height: clamp(130px, 35vw, 180px); flex-shrink: 0; object-fit: contain; display: block; }
#npc-modal-icerik { width: auto; max-width: 100%; height: clamp(320px, 80vw, 480px); object-fit: contain; display: block; border-radius: var(--radius-sm); }
#npc-modal-name { flex-shrink: 0; font-family: var(--font-heading); font-weight: 700; font-size: clamp(18px, 3vw, var(--fs-h3)); }
#npc-modal-desc, #credit-modal-desc { flex-shrink: 0; font-size: 14px; color: var(--color-text-muted); }
#credit-modal-panel { max-width: min(90vw, 480px); }
#credit-modal-logo { width: clamp(80px, 20vw, 120px); height: auto; object-fit: contain; }
#credit-modal-title { font-family: var(--font-heading); font-weight: 700; }
.lightbox { padding: 0; background: rgba(5, 3, 3, 0.94); }
.lightbox-panel {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px clamp(16px, 6vw, 88px) 24px;
}
.lightbox-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 100%;
  max-height: 100%;
}
#lightbox-img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100dvh - 64px - 24px - 44px);
  border-radius: var(--radius-sm);
  box-shadow: var(--container-glow), var(--red-glow);
  cursor: zoom-out;
}
.lightbox-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  color: var(--color-white);
}
.lightbox-count { font-variant-numeric: tabular-nums; color: var(--color-text-muted); }
.lightbox-close { position: absolute; top: 12px; right: 12px; }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); }
.lightbox-prev { left: clamp(8px, 2vw, 24px); }
.lightbox-next { right: clamp(8px, 2vw, 24px); }
@media (max-width: 767px) {
  .lightbox-panel { padding: 64px 12px 72px; }
  .lightbox-nav { top: auto; bottom: 16px; transform: none; }
  .lightbox-prev { left: calc(50% - 52px); }
  .lightbox-next { right: calc(50% - 52px); }
  #lightbox-img { max-height: calc(100dvh - 64px - 72px - 44px); }
}
.error-page {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  text-align: center;
}
.error-code {
  font-family: var(--font-heading);
  font-size: clamp(64px, 12vw, 128px);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px var(--color-red);
}
@media (max-width: 1279px) {
  .topbar-btn { position: relative; }
  .topbar-btn:not(.btn-primary) { width: 44px; padding: 0; }
  .topbar-btn:not(.btn-primary) .btn-label,
  .topbar-btn .soon-tag { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media (max-width: 1023px) {
  .sidebar {
    width: min(86vw, 320px);
    transform: translateX(-100%);
    transition: transform 320ms var(--ease);
    box-shadow: none;
  }
  .sidebar.is-open { transform: none; box-shadow: 12px 0 40px rgba(0, 0, 0, 0.6); }
  .sidebar-close { display: inline-flex; }
  .stage { left: 0; }
  .menu-btn { display: inline-flex; }
  .topbar { justify-content: space-between; }


}

@media (max-width: 768px) {
  .hero-media::after { background: rgba(11, 9, 9, 0.72); }
  .hero-inner { text-align: center; }
  .hero-inner .sec-eyebrow, .hero-inner .cta-row, .hero-inner .scroll-hint { justify-content: center; }
  .hero-inner .sec-desc { margin-inline: auto; }
}

@media (max-width: 480px) {
  .topbar { gap: 6px; }
  .topbar-actions { gap: 6px; }
  .menu-btn, .topbar-btn:not(.btn-primary) { width: 40px; min-height: 40px; height: 40px; }
  .topbar-btn.btn-primary { min-height: 40px; padding: 0 12px; }
  .topbar-btn.btn-primary .icon { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .sections-track, .sidebar, .sec-inner > * { transition: none !important; }
  .scroll-hint-line::after { animation: none; }
}
