/* ============================================================
   Homepage · Public CDN portal
   Scoped styles for index.php
   ============================================================ */

.home-page {
  min-width: 0;
}

body:has(.home-page) .front-nav {
  position: sticky;
  top: 0;
  max-width: none;
  padding: 13px max(22px, calc((100% - 1180px) / 2));
  background: color-mix(in srgb, var(--bg-base) 88%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.home-page .home-icon {
  display: block;
  flex: 0 0 auto;
}

.home-hero {
  position: relative;
  padding: 62px 22px 48px;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.home-hero {
  background: var(--bg-surface);
}

.home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .45;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 55%, #000 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 55%, #000 100%);
}

.home-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, .78fr);
  gap: 38px;
  align-items: center;
}

.home-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: .09em;
}

.home-kicker .home-icon {
  color: var(--success);
}

.home-copy h1 {
  max-width: 720px;
  margin: 18px 0 18px;
  color: var(--text-primary);
  font-size: clamp(34px, 4.2vw, 52px);
  font-weight: 750;
  line-height: 1.08;
  letter-spacing: -.045em;
}

.home-copy h1 em {
  position: relative;
  z-index: 0;
  color: var(--accent);
  font-style: normal;
  white-space: nowrap;
}

.home-copy h1 em::after {
  content: "";
  position: absolute;
  right: -3px;
  bottom: 3px;
  left: -3px;
  z-index: -1;
  height: 11px;
  border-radius: 3px;
  background: var(--accent-soft);
}

.home-copy > p {
  max-width: 680px;
  color: var(--text-secondary);
  font-size: 14.5px;
  line-height: 1.85;
}

.home-search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 640px;
  height: 52px;
  margin-top: 26px;
  padding: 0 6px 0 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  transition: border-color .18s, box-shadow .18s;
}

.home-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.home-search-icon {
  color: var(--text-muted);
}

.home-search .input {
  flex: 1;
  min-width: 0;
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: 14px;
}

.home-search .input:focus {
  box-shadow: none;
}

.home-search button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: filter .15s, transform .15s;
}

.home-search button:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
}

.home-hot-terms {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 11.5px;
}

.home-hot-terms a {
  color: var(--text-secondary);
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
}

.home-hot-terms a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.home-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.home-actions .btn {
  min-width: 132px;
}

.home-console {
  position: relative;
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.home-console::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  background: var(--accent);
}

.home-console-head,
.home-endpoint,
.home-console-foot {
  display: flex;
  align-items: center;
}

.home-console-head {
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border);
}

.home-console-head > div {
  min-width: 0;
}

.home-console-label,
.home-eyebrow {
  display: block;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
}

.home-console-head strong {
  display: block;
  margin-top: 3px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
}

.home-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 11px;
  font-weight: 600;
}

.home-live i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
}

.home-console-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 14px 0;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 9px;
  overflow: hidden;
}

.home-console-grid > div {
  min-width: 0;
  padding: 13px;
  background: var(--bg-base);
}

.home-console-grid span {
  display: block;
  color: var(--text-muted);
  font-size: 10.5px;
}

.home-console-grid b {
  display: block;
  margin-top: 4px;
  color: var(--text-primary);
  font-size: 19px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-trend {
  margin: 0 0 13px;
  padding: 11px 12px 9px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg-input);
}

.home-trend-head,
.home-trend-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.home-trend-head {
  color: var(--text-muted);
  font-size: 10.5px;
}

.home-trend-head > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.home-trend-head .home-icon {
  color: var(--accent);
}

.home-trend-head b {
  margin-left: auto;
  color: var(--text-secondary);
  font-size: 11px;
  white-space: nowrap;
}

.home-trend svg {
  display: block;
  width: 100%;
  height: 48px;
  margin: 7px 0 3px;
  overflow: visible;
}

.home-trend polyline {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.home-trend-foot {
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 9.5px;
}

.home-endpoint {
  gap: 10px;
  padding: 11px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 9px;
}

.home-endpoint-icon {
  color: var(--accent);
}

.home-endpoint > div {
  flex: 1;
  min-width: 0;
}

.home-endpoint span {
  display: block;
  color: var(--text-muted);
  font-size: 10px;
}

.home-endpoint code {
  display: block;
  overflow: hidden;
  color: var(--text-primary);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-endpoint button,
.home-code-head button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg-hover);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 11px;
  cursor: pointer;
}

.home-endpoint button {
  width: 32px;
  height: 32px;
}

.home-endpoint button:hover,
.home-code-head button:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.home-console-foot {
  gap: 10px 16px;
  flex-wrap: wrap;
  margin-top: 13px;
  color: var(--text-muted);
  font-size: 10.5px;
}

.home-console-foot span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.home-console-foot .home-icon {
  color: var(--text-secondary);
}

.home-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 46px 22px 60px;
}

.home-section {
  margin-top: 44px;
}

.home-section:first-child {
  margin-top: 0;
}

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

.home-section-head h2,
.home-quickstart h2,
.home-cta h2 {
  margin-top: 5px;
  color: var(--text-primary);
  font-size: 21px;
  letter-spacing: -.02em;
}

.home-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-secondary);
  font-size: 12px;
  white-space: nowrap;
}

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

.home-cat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.home-cat {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 13px 12px 15px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}

.home-cat:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -18px var(--accent);
}

.home-cat-icon,
.home-file-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: var(--accent);
  background: var(--accent-soft);
}

.home-cat-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.home-cat-info {
  min-width: 0;
}

.home-cat-info b {
  display: block;
  overflow: hidden;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-cat-info span {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 10.5px;
}

.home-cat-meter {
  position: absolute;
  right: 12px;
  bottom: 8px;
  left: 57px;
  height: 2px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--bg-hover);
}

.home-cat-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

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

.home-columns .home-section {
  margin-top: 44px;
}

.home-list {
  border-top: 1px solid var(--border);
}

.home-list-item {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 12px 2px;
  border-bottom: 1px solid var(--border);
  color: inherit;
  text-decoration: none;
  transition: background .15s, padding .15s;
}

.home-list-item:hover {
  padding-right: 8px;
  padding-left: 8px;
  background: var(--bg-hover);
}

.home-rank {
  width: 24px;
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 11px;
  text-align: center;
}

.home-file-icon {
  width: 30px;
  height: 30px;
  border-radius: 7px;
}

.home-list-body {
  flex: 1;
  min-width: 0;
}

.home-list-body b {
  display: block;
  overflow: hidden;
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-list-body span {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 10.5px;
}

.home-list-extra {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.home-empty {
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
}

.home-quickstart {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, .9fr);
  align-items: center;
  gap: 42px;
  padding: 30px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 14px;
  background: var(--bg-surface);
}

.home-quickstart-copy > p {
  max-width: 580px;
  margin-top: 10px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.75;
}

.home-quickstart-list {
  display: grid;
  gap: 8px;
  margin: 18px 0;
}

.home-quickstart-list > div {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 12px;
}

.home-quickstart-list .home-icon {
  color: var(--success);
}

.home-code {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--bg-input);
}

.home-code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-hover);
}

.home-code-head > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
}

.home-code-head button {
  padding: 5px 8px;
}

.home-code pre {
  margin: 0;
  padding: 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--accent);
  font-size: 11.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-all;
}

.home-code-url {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
}

.home-code-url span {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
}

.home-code-url code {
  min-width: 0;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-cap-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.home-cap {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
}

.home-cap > .home-icon {
  margin-top: 2px;
  color: var(--accent);
}

.home-cap h3 {
  color: var(--text-primary);
  font-size: 13.5px;
  font-weight: 600;
}

.home-cap p {
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 11.5px;
  line-height: 1.7;
}

.home-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 44px;
  padding: 28px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: var(--bg-surface);
}

.home-cta p {
  max-width: 680px;
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 12.5px;
  line-height: 1.75;
}

.home-cta-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
}

@media (max-width: 840px) {
  .home-hero-inner,
  .home-quickstart {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .home-console {
    max-width: 680px;
  }

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

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

@media (max-width: 767px) {
  body:has(.home-page) .front-nav {
    padding: 11px 12px;
  }

  .home-hero {
    padding: 38px 16px 34px;
  }

  .home-copy h1 {
    font-size: 32px;
    letter-spacing: -.035em;
  }

  .home-copy h1 em {
    white-space: normal;
  }

  .home-copy > p {
    font-size: 13px;
  }

  .home-search {
    height: 48px;
  }

  .home-search button span {
    display: none;
  }

  .home-search button {
    width: 38px;
    padding: 0;
  }

  .home-main {
    padding: 34px 16px 46px;
  }

  .home-section {
    margin-top: 34px;
  }

  .home-section-head {
    align-items: flex-start;
  }

  .home-section-head h2,
  .home-quickstart h2,
  .home-cta h2 {
    font-size: 19px;
  }

  .home-cat-grid,
  .home-columns,
  .home-cap-grid {
    grid-template-columns: 1fr;
  }

  .home-columns {
    gap: 0;
  }

  .home-columns .home-section {
    margin-top: 34px;
  }

  .home-quickstart {
    padding: 20px;
  }

  .home-cta {
    align-items: flex-start;
    flex-direction: column;
    padding: 22px;
  }

  .home-cta-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .home-cta-actions .btn {
    flex: 1;
  }
}
