* {
  box-sizing: border-box;
}

:root {
  --bg: #050505;
  --bg-soft: #0a0a0a;
  --ink: #f5f5f5;
  --ink-soft: #d6d6d6;
  --muted: #a3a3a3;
  --faint: #787878;
  --surface: #121212;
  --surface-dark: #050505;
  --surface-dark-soft: #181818;
  --line: rgba(255, 255, 255, 0.13);
  --line-strong: rgba(255, 255, 255, 0.28);
  --line-invert: rgba(255, 255, 255, 0.16);
  --text-invert: #f7f7f7;
  --text-invert-soft: #c9c9c9;
  --button-bg: #f5f5f5;
  --button-bg-hover: #dcdcdc;
  --button-text: #070707;
  --radius: 8px;
  --radius-sm: 6px;
  --container: 1180px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.32);
  --shadow-card: 0 22px 54px rgba(0, 0, 0, 0.48);
  --motion-fast: 0.18s ease;
  --font-body:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Noto Sans SC",
    "Microsoft YaHei",
    sans-serif;
  --font-display:
    "Noto Serif SC",
    "Source Han Serif SC",
    "Songti SC",
    STSong,
    SimSun,
    serif;
}

html {
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    var(--bg);
  background-size: 48px 48px;
  font-family: var(--font-body);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.home {
  background: var(--surface-dark);
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--button-text);
  background: var(--button-bg);
  transform: translateY(-140%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: fixed;
  top: 14px;
  left: 50%;
  z-index: 30;
  width: min(var(--container), calc(100% - 32px));
  transform: translateX(-50%);
}

.nav-panel {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 8px;
  border: 1px solid var(--line-invert);
  border-radius: var(--radius);
  color: var(--text-invert);
  background: rgba(10, 10, 10, 0.78);
  box-shadow: 0 16px 58px rgba(0, 0, 0, 0.3);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.brand-link,
.nav-links,
.nav-actions {
  display: flex;
  align-items: center;
}

.brand-link {
  gap: 10px;
  min-width: 0;
  padding: 0 8px;
  font-weight: 700;
}

.brand-mark {
  width: 34px;
  height: 34px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-sm);
  background: #000000;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-name {
  overflow: hidden;
  font-size: 15px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-links {
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line-invert);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
}

.nav-link {
  min-height: 34px;
  padding: 6px 14px;
  border-radius: 999px;
  color: rgb(190, 190, 190);
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link[aria-current="page"] {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.nav-actions {
  gap: 8px;
}

.nav-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 13px;
  border-radius: var(--radius-sm);
  color: var(--button-text);
  background: var(--button-bg);
  font-size: 14px;
  font-weight: 750;
  white-space: nowrap;
  transition: transform var(--motion-fast), background var(--motion-fast);
}

.nav-action:hover {
  background: var(--button-bg-hover);
  transform: translateY(-2px);
}

.hero-archive {
  position: relative;
  min-height: 74svh;
  overflow: hidden;
  color: var(--text-invert);
  background: #050505;
}

.hero-archive::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.52) 46%, rgba(0, 0, 0, 0.22) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.8)),
    url("./assets/rovan-library-cover.png") center / cover no-repeat;
  content: "";
  filter: grayscale(1) contrast(1.08);
}

.hero-archive::after {
  position: absolute;
  inset: auto 0 0;
  z-index: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.72), transparent);
  content: "";
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  align-items: end;
  width: min(var(--container), calc(100% - 40px));
  min-height: 74svh;
  margin: 0 auto;
  padding: 118px 0 56px;
}

.hero-copy {
  max-width: 760px;
}

.eyebrow,
.section-kicker,
.meta-label {
  margin: 0;
  color: var(--faint);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-archive .eyebrow {
  color: #dedede;
}

.hero-title,
.page-title,
.section-title,
.card-title {
  margin: 0;
  letter-spacing: 0;
}

.hero-title {
  max-width: 9ch;
  margin-top: 14px;
  font-family: var(--font-display);
  font-size: 78px;
  font-weight: 700;
  line-height: 1.08;
}

.hero-desc {
  max-width: 680px;
  margin: 24px 0 0;
  color: var(--text-invert-soft);
  font-size: 18px;
  line-height: 1.82;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.primary-link,
.secondary-link,
.text-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 800;
}

.primary-link {
  padding: 8px 17px;
  color: var(--button-text);
  background: var(--button-bg);
}

.primary-link:hover {
  background: var(--button-bg-hover);
}

.secondary-link {
  padding: 8px 17px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.secondary-link:hover {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.12);
}

.text-link {
  min-height: 32px;
  justify-content: flex-start;
  color: var(--ink);
}

.text-link:hover {
  color: #ffffff;
}

.content-band .primary-link {
  border: 1px solid var(--button-bg);
  color: var(--button-text);
  background: var(--button-bg);
}

.content-band .primary-link:hover {
  background: var(--button-bg-hover);
}

.content-band.dark .text-link {
  color: #ffffff;
}

.content-band.dark .text-link:hover {
  color: #d8d8d8;
}

.content-band {
  background: var(--bg-soft);
}

.content-band.dark {
  color: var(--text-invert);
  background: #070707;
}

.content-shell {
  width: min(var(--container), calc(100% - 40px));
  margin: 0 auto;
  padding: 58px 0;
}

.section-head {
  display: flex;
  gap: 24px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-title {
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  line-height: 1.16;
}

.section-desc {
  max-width: 660px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.content-band.dark .section-desc {
  color: var(--text-invert-soft);
}

.card-grid,
.resource-grid,
.stat-grid {
  display: grid;
  gap: 16px;
}

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

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

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

.entry-card,
.resource-card,
.stat-card,
.asset-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.entry-card,
.resource-card,
.asset-panel {
  transition:
    border-color var(--motion-fast),
    box-shadow var(--motion-fast),
    transform var(--motion-fast);
}

.entry-card:hover,
.resource-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-card);
  transform: translateY(-4px);
}

.entry-card {
  position: relative;
  display: flex;
  min-height: 300px;
  flex-direction: column;
  padding: 24px;
  overflow: hidden;
}

.entry-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: rgba(255, 255, 255, 0.72);
  content: "";
}

.entry-index {
  color: var(--faint);
  font-size: 13px;
  font-weight: 850;
}

.entry-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  margin-top: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: #ffffff;
  background: var(--surface-dark);
}

.entry-icon img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.card-title {
  margin-top: 28px;
  font-size: 24px;
  font-weight: 760;
  line-height: 1.22;
}

.card-desc {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.055);
  font-size: 13px;
  font-weight: 700;
}

.entry-card .text-link {
  margin-top: auto;
}

.stat-card {
  min-height: 128px;
  padding: 18px;
}

.stat-value {
  display: block;
  margin-top: 12px;
  color: var(--ink);
  font-size: 28px;
  font-weight: 820;
  line-height: 1;
}

.stat-card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.page-masthead {
  padding: 126px 0 54px;
  color: var(--text-invert);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, #101010 0%, #050505 100%);
  background-size: 42px 42px, 42px 42px, auto;
  border-bottom: 1px solid var(--line-invert);
}

.page-masthead.media-masthead {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(135deg, #101010 0%, #050505 58%, #151515 100%);
  background-size: 42px 42px, 42px 42px, auto;
}

.page-masthead.wiki-masthead {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(135deg, #101010 0%, #050505 58%, #151515 100%);
  background-size: 42px 42px, 42px 42px, auto;
}

.masthead-shell {
  width: min(var(--container), calc(100% - 40px));
  margin: 0 auto;
}

.page-title {
  max-width: 760px;
  margin-top: 12px;
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 700;
  line-height: 1.12;
}

.page-desc {
  max-width: 760px;
  margin: 18px 0 0;
  color: var(--text-invert-soft);
  font-size: 17px;
  line-height: 1.8;
}

.masthead-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.masthead-meta .chip {
  border-color: var(--line-invert);
  color: var(--text-invert);
  background: rgba(255, 255, 255, 0.075);
}

.resource-card {
  position: relative;
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr);
  gap: 22px;
  min-height: 210px;
  padding: 22px;
  overflow: hidden;
}

.resource-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 104px;
  height: 104px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #171717;
}

.resource-preview.dark {
  background: #070707;
}

.resource-preview img {
  width: 74px;
  height: 74px;
  object-fit: contain;
}

.resource-preview.wide img {
  width: 92px;
  height: 92px;
  filter: grayscale(1);
}

.resource-body {
  min-width: 0;
}

.resource-title {
  margin: 0;
  font-size: 23px;
  line-height: 1.25;
}

.resource-desc {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.resource-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 18px;
}

.asset-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(280px, 1fr);
  gap: 28px;
  align-items: center;
  padding: 28px;
}

.asset-copy h2 {
  margin: 8px 0 0;
  font-size: 30px;
  line-height: 1.18;
}

.asset-copy p {
  margin: 12px 0 0;
  color: var(--muted);
}

.asset-showcase {
  display: grid;
  place-items: center;
  min-height: 320px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    #111111;
  background-size: 34px 34px;
}

.asset-showcase img {
  width: min(320px, 70%);
  height: auto;
  filter: drop-shadow(0 24px 28px rgba(0, 0, 0, 0.16));
}

.asset-showcase.cover img {
  width: min(580px, 96%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  filter: grayscale(1) drop-shadow(0 24px 28px rgba(0, 0, 0, 0.12));
}

.detail-list {
  display: grid;
  gap: 0;
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.detail-row {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  border-bottom: 1px solid var(--line);
}

.detail-row span {
  color: var(--muted);
  font-size: 14px;
}

.detail-row strong {
  color: var(--ink);
  font-size: 14px;
  text-align: right;
}

.site-footer {
  color: var(--text-invert-soft);
  background: #050505;
  border-top: 1px solid var(--line-invert);
}

.footer-shell {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1fr);
  gap: 28px;
  width: min(var(--container), calc(100% - 40px));
  margin: 0 auto;
  padding: 38px 0 46px;
}

.footer-brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.footer-brand .brand-mark {
  flex: 0 0 auto;
}

.footer-brand strong {
  display: block;
  color: #ffffff;
  font-size: 16px;
}

.footer-brand span {
  display: block;
  margin-top: 3px;
  color: var(--text-invert-soft);
  font-size: 13px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  align-content: start;
  justify-content: end;
}

.footer-links a {
  color: var(--text-invert-soft);
  font-size: 14px;
  font-weight: 700;
}

.footer-links a:hover {
  color: #ffffff;
}

.footer-note {
  grid-column: 1 / -1;
  margin: 8px 0 0;
  color: #8e938e;
  font-size: 13px;
}

@media (max-width: 900px) {
  .site-header {
    top: 10px;
    width: min(100% - 24px, var(--container));
  }

  .nav-panel {
    flex-wrap: wrap;
  }

  .brand-link {
    flex: 1 1 auto;
  }

  .nav-links {
    order: 3;
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius);
  }

  .nav-actions {
    margin-left: auto;
  }

  .hero-inner {
    width: min(100% - 28px, var(--container));
    padding-top: 142px;
  }

  .hero-title {
    font-size: 54px;
  }

  .content-shell,
  .masthead-shell,
  .footer-shell {
    width: min(100% - 28px, var(--container));
  }

  .card-grid,
  .resource-grid,
  .stat-grid,
  .asset-panel {
    grid-template-columns: 1fr;
  }

  .section-head {
    display: block;
  }

  .section-head .text-link {
    margin-top: 12px;
  }

  .resource-card {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 16px;
  }

  .resource-preview {
    width: 84px;
    height: 84px;
  }

  .resource-preview img,
  .resource-preview.wide img {
    width: 60px;
    height: 60px;
  }

  .footer-shell {
    grid-template-columns: 1fr;
  }

  .footer-links {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .brand-name {
    max-width: 150px;
  }

  .nav-action {
    min-height: 32px;
    padding-inline: 10px;
    font-size: 13px;
  }

  .hero-archive,
  .hero-inner {
    min-height: 76svh;
  }

  .hero-title {
    font-size: 42px;
  }

  .hero-desc,
  .page-desc {
    font-size: 15px;
  }

  .hero-actions,
  .primary-link,
  .secondary-link {
    width: 100%;
  }

  .content-shell {
    padding: 42px 0;
  }

  .section-title {
    font-size: 28px;
  }

  .page-masthead {
    padding-top: 152px;
  }

  .page-title {
    font-size: 38px;
  }

  .entry-card {
    min-height: 260px;
  }

  .resource-card {
    grid-template-columns: 1fr;
  }

  .asset-panel {
    padding: 20px;
  }

  .asset-showcase {
    min-height: 230px;
  }
}
