.page-home {
  --home-dark: #1b1b1b;
  --home-dark-2: #252525;
  --home-glass: rgba(245, 245, 245, 0.08);
  --home-glass-border: rgba(255, 255, 255, 0.2);
  --home-guide-bg: linear-gradient(135deg, #3F51B5 0%, #009688 100%);
  --home-purple: #7B1FA2;
  background: var(--bg);
  color: var(--ink);
}

.page-home .home-masthead {
  position: relative;
  min-height: 290px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, #1f1f1f 0%, #313131 100%);
  border-bottom: 6px solid var(--accent);
  color: var(--ink-invert);
}

.page-home .home-masthead__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.28;
  z-index: 0;
}

.page-home .home-masthead__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  align-items: flex-start;
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.page-home .home-masthead__title {
  margin: 0.15rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4.6vw, 3rem);
  line-height: 1.15;
  letter-spacing: 0.01em;
}

.page-home .home-masthead__summary {
  margin: 0.6rem 0 0;
  font-size: 1rem;
  font-family: var(--font-mono);
  color: rgba(255, 255, 255, 0.72);
  letter-spacing: 0.04em;
}

.page-home .home-masthead__cta {
  align-self: flex-start;
}

.page-home .home-section {
  scroll-margin-top: 78px;
  padding: clamp(2.4rem, 5vw, 4rem) 0;
}

.page-home .home-section .section-desc {
  max-width: 64ch;
  line-height: 1.7;
}

.page-home .home-section--browse {
  background: transparent;
  color: var(--ink-invert);
}

.page-home .home-section--browse .eyebrow,
.page-home .home-section--browse .section-desc {
  color: rgba(255, 255, 255, 0.72);
}

.page-home .home-tiles {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  margin-top: 1.4rem;
}

.page-home .home-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 158px;
  padding: 1.1rem 1.2rem;
  border-radius: 6px;
  color: var(--ink-invert);
  text-decoration: none;
  overflow: hidden;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.3);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.page-home .home-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.07) 0, rgba(255, 255, 255, 0.07) 2px, transparent 2px, transparent 9px);
  pointer-events: none;
}

.page-home .home-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.page-home .home-tile--z1 {
  background: linear-gradient(135deg, var(--zone-1) 0%, #b73310 100%);
}

.page-home .home-tile--z2 {
  background: linear-gradient(135deg, var(--zone-2) 0%, #d39a00 100%);
  color: #252100;
}

.page-home .home-tile--z2 .home-tile__tags,
.page-home .home-tile--z2 .home-tile__arrow {
  color: rgba(37, 33, 0, 0.78);
}

.page-home .home-tile--z3 {
  background: linear-gradient(135deg, var(--zone-3) 0%, #283593 100%);
}

.page-home .home-tile--z4 {
  background: linear-gradient(135deg, var(--zone-4) 0%, #00695c 100%);
}

.page-home .home-tile--z5 {
  background: linear-gradient(135deg, var(--zone-5) 0%, #6a1b9a 100%);
}

.page-home .home-tile--z6 {
  background: linear-gradient(135deg, var(--zone-6) 0%, #c2185b 100%);
}

.page-home .home-tile__label {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.page-home .home-tile__count {
  position: relative;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.page-home .home-tile__tags {
  position: relative;
  z-index: 1;
  font-size: 0.78rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.85);
}

.page-home .home-tile__arrow {
  position: absolute;
  right: 0.8rem;
  top: 0.8rem;
  z-index: 1;
  font-size: 1.25rem;
  opacity: 0.75;
}

.page-home .home-section--latest {
  background: var(--surface);
  color: var(--ink);
}

.page-home .home-section--latest .section-title {
  color: var(--ink);
}

.page-home .chapter-link {
  color: var(--accent);
  font-weight: 700;
  text-underline-offset: 3px;
}

.page-home .toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
}

.page-home .sort-options,
.page-home .view-toggle {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.2rem;
  background: rgba(33, 33, 33, 0.08);
  border-radius: 4px;
}

.page-home .option {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 3px;
  color: #555;
  cursor: default;
}

.page-home .option.is-active {
  background: var(--accent);
  color: var(--ink-invert);
}

.page-home .home-latest__intro-img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 1.4rem 0 1.2rem;
  box-shadow: var(--shadow);
}

.page-home .home-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.page-home .home-card {
  display: flex;
  flex-direction: column;
  background: var(--surface-bright);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.page-home .home-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.16);
}

.page-home .home-card__media {
  position: relative;
  height: 104px;
  background-color: #d7d7d7;
  background-image: repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.14) 0, rgba(255, 255, 255, 0.14) 2px, transparent 2px, transparent 9px);
  flex: 0 0 auto;
}

.page-home .home-card--t1 .home-card__media {
  background-color: var(--zone-1);
}

.page-home .home-card--t2 .home-card__media {
  background-color: var(--zone-2);
}

.page-home .home-card--t3 .home-card__media {
  background-color: var(--zone-3);
}

.page-home .home-card--t4 .home-card__media {
  background-color: var(--zone-4);
}

.page-home .home-card--t5 .home-card__media {
  background-color: var(--zone-5);
}

.page-home .home-card--t6 .home-card__media {
  background-color: var(--zone-6);
}

.page-home .home-card__media .badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
}

.page-home .home-card__type {
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
  padding: 0.25rem 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  background: rgba(0, 0, 0, 0.3);
  border-radius: 3px;
}

.page-home .home-card__body {
  padding: 0.9rem 1rem 1rem;
}

.page-home .home-card__title {
  margin: 0 0 0.3rem;
  font-family: var(--font-display);
  font-size: 1rem;
  line-height: 1.4;
  color: var(--ink);
}

.page-home .home-card__meta {
  margin: 0 0 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #666;
}

.page-home .home-card__tags {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.page-home .home-section--hot {
  background: var(--home-dark);
  color: var(--ink-invert);
}

.page-home .home-section--hot .section-title,
.page-home .home-section--hot .eyebrow {
  color: var(--ink-invert);
}

.page-home .home-section--hot .section-desc {
  color: rgba(255, 255, 255, 0.7);
}

.page-home .home-hot {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.2rem;
  margin-top: 1.4rem;
}

.page-home .home-popular {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}

.page-home .home-popular__row {
  display: grid;
  grid-template-columns: 2.1rem 1fr auto;
  grid-template-areas:
    "index main value"
    "index tag tag";
  row-gap: 0.35rem;
  column-gap: 0.6rem;
  align-items: center;
  padding: 0.8rem 0.9rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
}

.page-home .home-popular__index {
  grid-area: index;
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
}

.page-home .home-popular__main {
  grid-area: main;
  min-width: 0;
}

.page-home .home-popular__name {
  display: block;
  font-weight: 700;
  color: var(--ink-invert);
  text-decoration: none;
  line-height: 1.4;
  font-size: 0.95rem;
}

.page-home .home-popular__name:hover {
  color: var(--accent);
}

.page-home .home-popular__metric {
  display: block;
  height: 8px;
  margin-top: 0.3rem;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 4px;
  overflow: hidden;
}

.page-home .home-popular__metric .metric-bar {
  display: block;
  height: 100%;
  width: var(--value);
  background: linear-gradient(90deg, var(--accent) 0%, #ff9100 100%);
}

.page-home .home-popular__value {
  grid-area: value;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--progress);
}

.page-home .home-popular__row .tag {
  grid-area: tag;
  justify-self: start;
}

.page-home .home-hot__media {
  margin: 0;
}

.page-home .home-hot__media img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.page-home .home-section--index {
  background: var(--home-dark-2);
  color: var(--ink-invert);
}

.page-home .home-section--index .section-title,
.page-home .home-section--index .eyebrow {
  color: var(--ink-invert);
}

.page-home .home-section--index .section-desc {
  color: rgba(255, 255, 255, 0.7);
}

.page-home .home-index__layout {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin-bottom: 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.page-home .home-indexbar {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1rem;
  border: 1px solid var(--home-glass-border);
  background: var(--home-glass);
  border-radius: 8px;
  margin-bottom: 0.8rem;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.page-home .home-indexbar__label {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--progress);
}

.page-home .home-indexbar__cells {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.page-home .home-index-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1rem;
  height: 2.1rem;
  padding: 0 0.4rem;
  border-radius: 4px;
  border: 1px solid var(--home-glass-border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink-invert);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-decoration: none;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.page-home .home-index-cell:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--ink-invert);
}

.page-home .home-section--tags {
  background: #ececec;
  color: var(--ink);
}

.page-home .home-section--tags .section-title {
  color: var(--ink);
}

.page-home .home-tagcloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 1.2rem;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  margin-top: 1.2rem;
}

.page-home .home-tag {
  font-size: 0.85rem;
  padding: 0.4rem 0.9rem;
  text-decoration: none;
  border: 1px solid rgba(33, 33, 33, 0.06);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.page-home .home-tag:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
}

.page-home .home-tag--lg {
  font-size: 1.05rem;
  font-weight: 700;
  padding: 0.55rem 1.2rem;
}

.page-home .home-tag--md {
  font-size: 0.9rem;
  padding: 0.45rem 1rem;
}

.page-home .home-tag--sm {
  font-size: 0.76rem;
}

.page-home .tag-color-purple {
  --tag-color-bg: var(--home-purple);
  background: var(--home-purple);
  color: #fff;
}

.page-home .home-section--guide {
  background: var(--home-guide-bg);
  color: var(--ink-invert);
}

.page-home .home-section--guide .section-title,
.page-home .home-section--guide .eyebrow {
  color: var(--ink-invert);
}

.page-home .home-section--guide .section-desc {
  color: rgba(255, 255, 255, 0.82);
}

.page-home .home-guide {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1.4rem;
}

.page-home .home-guide__card {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 1.4rem;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.page-home .home-guide__step {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
}

.page-home .home-guide__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--ink-invert);
}

.page-home .home-guide__text {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.88);
}

.page-home .home-guide__btn {
  align-self: flex-start;
  margin-top: auto;
  border-color: rgba(255, 255, 255, 0.8);
  color: var(--ink-invert);
}

@media (min-width: 640px) {
  .page-home .home-masthead__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .page-home .home-masthead__cta {
    flex: 0 0 auto;
  }

  .page-home .home-tiles {
    grid-template-columns: repeat(2, 1fr);
  }

  .page-home .home-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .page-home .home-hot {
    grid-template-columns: 1fr 0.9fr;
    align-items: center;
  }

  .page-home .home-guide {
    grid-template-columns: repeat(3, 1fr);
  }

  .page-home .home-indexbar {
    flex-direction: row;
    align-items: flex-start;
    gap: 1rem;
  }

  .page-home .home-indexbar__label {
    min-width: 3.4rem;
    padding-top: 0.3rem;
  }
}

@media (min-width: 1024px) {
  .page-home .home-tiles {
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
  }

  .page-home .home-tile {
    min-height: 210px;
    padding: 1.2rem 1rem;
  }

  .page-home .home-tile__tags {
    font-size: 0.72rem;
  }

  .page-home .home-cards {
    grid-template-columns: repeat(4, 1fr);
  }

  .page-home .home-popular__row {
    grid-template-columns: 2.4rem 1fr auto auto;
    grid-template-areas: "index main value tag";
    padding: 1rem 1.1rem;
  }

  .page-home .home-guide {
    gap: 1.4rem;
  }
}

.page-home {
  --value: 1rem;
}
