@import url("horde-tokens.css");

html {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--text-body);
  color: var(--text);
  background: var(--bg);
  line-height: var(--leading-body);
  font-feature-settings: "kern" 1, "liga" 1;
}

*:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

button:focus-visible,
a:focus-visible {
  border-radius: 4px;
}

@supports (height: 100dvh) {
  body {
    min-height: 100dvh;
  }
}

/*
 * Hero art: always preserve aspect ratio (never stretch).
 * - Default: cover + focal point for desktop / landscape.
 * - Portrait phones: height-first scaling (auto 100%) so tall screens keep vertical
 *   composition of the artwork instead of only zooming to width.
 * - Near-square: cover with a centered focal point tuned for 1:1-ish frames.
 */
.page-bg {
  --hero-art: url("../assets/hero-horde-peons.jpg");
  position: fixed;
  inset: 0;
  z-index: 0;
  background-color: var(--bg);
  background-image: var(--hero-art);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center 36%;
  pointer-events: none;
  transform: translateZ(0);
}

/* Square-ish viewports (tablets, foldables, 1:1 windows) — balanced crop */
@media (min-aspect-ratio: 0.92) and (max-aspect-ratio: 1.08) {
  .page-bg {
    background-size: cover;
    background-position: center 40%;
  }
}

/* Tall portrait: scale by height so the illustration stays framed; crop sides, not top/bottom */
@media (max-width: 900px) and (orientation: portrait) and (max-aspect-ratio: 0.92) {
  .page-bg {
    background-size: auto 100%;
    background-position: center 34%;
  }
}

/* Short landscape phones / small landscape windows — favor middle of the frame */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 520px) {
  .page-bg {
    background-size: cover;
    background-position: center 42%;
  }
}

a {
  color: var(--horde-bright);
  text-decoration: none;
  text-underline-offset: 0.2em;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

a:hover {
  border-bottom-color: rgba(62, 232, 163, 0.45);
}

a.btn {
  border-bottom: none;
  text-decoration: none;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--horde);
  color: var(--text);
  border-radius: 8px;
  z-index: 100;
}

.skip-link:focus {
  left: 0.5rem;
}

/* Top bar (default: below hero) */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem clamp(1rem, 4vw, 2rem);
  background: rgba(7, 10, 9, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* Light bar over hero — minimal tint so art stays visible */
.site-header--on-hero {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  background: linear-gradient(
    to bottom,
    rgba(7, 10, 9, 0.22) 0%,
    rgba(7, 10, 9, 0.06) 55%,
    transparent 100%
  );
  backdrop-filter: blur(6px) saturate(120%);
  -webkit-backdrop-filter: blur(6px) saturate(120%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  border: none;
}

.brand:hover {
  color: var(--horde-bright);
}

.site-header--on-hero .brand {
  color: var(--text);
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.45);
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--glass-edge);
}

.nav-links {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  max-width: min(100%, 72vw);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0.2rem 0;
  mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 12px), transparent);
}

.nav-links::-webkit-scrollbar {
  display: none;
}

.nav-links a {
  flex: 0 0 auto;
  border: none;
  color: var(--text-secondary);
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.2);
}

.nav-links a:hover {
  color: var(--horde-bright);
  background: rgba(62, 232, 163, 0.1);
}

.site-header--on-hero .nav-links a {
  background: rgba(0, 0, 0, 0.28);
  color: rgba(248, 252, 250, 0.92);
}

.site-header--on-hero .nav-links a:hover {
  background: rgba(62, 232, 163, 0.14);
  color: var(--horde-bright);
}

@media (min-width: 900px) {
  .nav-links {
    max-width: none;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    overflow: visible;
    mask-image: none;
    padding: 0;
  }

  .nav-links a {
    background: transparent;
    padding: 0.35rem 0.5rem;
  }

  .nav-links a:hover {
    background: transparent;
  }

  .site-header--on-hero .nav-links a {
    background: transparent;
    color: rgba(248, 252, 250, 0.9);
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.35);
  }

  .site-header--on-hero .nav-links a:hover {
    background: transparent;
    color: var(--horde-bright);
  }
}

.nav-links a:focus-visible {
  border-radius: var(--radius-pill);
}

@media (min-width: 900px) {
  .nav-links a:focus-visible {
    border-radius: 6px;
  }
}

/* Showcase: hero stacks above fixed .page-bg */
.showcase {
  position: relative;
  z-index: 1;
}

.hero-showcase {
  position: relative;
  min-height: min(92vh, 960px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  background: transparent;
}

@supports (height: 100dvh) {
  .hero-showcase {
    min-height: min(92dvh, 960px);
  }
}

/* Light wash: keep upper/mid hero clear; darken only near the fold */
.hero-showcase__veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    transparent 0%,
    transparent 42%,
    rgba(7, 10, 9, 0.08) 72%,
    rgba(7, 10, 9, 0.28) 100%
  );
}

/* Short bridge into main — transition only at the bottom edge */
.hero-showcase__bridge {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: min(22vh, 160px);
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(7, 10, 9, 0.35) 70%,
    var(--bg) 100%
  );
}

.hero-showcase__content {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: min(1120px, 100%);
  margin: 0 auto;
  padding: 5rem clamp(1.25rem, 4vw, 2rem) clamp(2rem, 4vw, 2.75rem);
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* Wide screens: park copy on the right so the illustration reads on the left */
@media (min-width: 900px) {
  .hero-showcase__content {
    align-items: flex-end;
  }
}

.hero-showcase__panel {
  width: 100%;
  max-width: 38rem;
}

@media (min-width: 900px) {
  .hero-showcase__panel {
    margin-inline-start: auto;
    max-width: min(28rem, 42vw);
  }
}

@media (max-width: 720px) {
  .hero-showcase {
    min-height: min(88vh, 820px);
  }

  .hero-showcase__veil {
    background: linear-gradient(
      180deg,
      transparent 0%,
      transparent 28%,
      rgba(7, 10, 9, 0.12) 100%
    );
  }

  .hero-showcase__bridge {
    height: min(28vh, 180px);
  }

  .hero-showcase__content {
    align-items: stretch;
  }

  .hero-showcase__panel {
    max-width: none;
    margin-inline-start: 0;
  }
}

@media (max-width: 720px) {
  @supports (height: 100dvh) {
    .hero-showcase {
      min-height: min(88dvh, 820px);
    }
  }
}

/* Hero: Plus Jakarta Sans for copy; Instrument Serif on accent; mono for labels/code */
.hero-showcase {
  color: #f4fbf7;
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/*
 * Card stays light overall; a bottom-heavy scrim (this panel only) boosts contrast
 * for lede + CTAs on bright areas of the artwork without fogging the full hero.
 */
.hero-showcase .hero-showcase__panel.glass {
  background:
    linear-gradient(
      to top,
      rgba(7, 10, 9, 0.78) 0%,
      rgba(7, 10, 9, 0.38) 32%,
      rgba(7, 10, 9, 0.1) 58%,
      transparent 78%
    ),
    rgba(7, 10, 9, 0.14);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px) saturate(125%);
  -webkit-backdrop-filter: blur(10px) saturate(125%);
}

.hero-showcase__intro {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.25rem;
  margin-bottom: 0.75rem;
}

.hero-showcase__mascots {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.4rem;
}

.hero-showcase__intro-text {
  flex: 1 1 12rem;
  min-width: 0;
}

.hero-showcase__chibi {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.45));
}

.hero-showcase .badge {
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.04em;
  background: rgba(0, 0, 0, 0.38);
  border-color: rgba(45, 212, 138, 0.55);
  color: #8ff3c9;
}

.hero-showcase h1 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
  margin: 0.5rem 0 0;
  font-size: unset;
  font-weight: unset;
  letter-spacing: normal;
  line-height: 1.12;
  color: #f4fbf7;
  text-shadow:
    0 2px 24px rgba(0, 0, 0, 0.75),
    0 1px 3px rgba(0, 0, 0, 0.95);
}

.hero-showcase .hero-title__wordmark {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: clamp(1.6rem, 4vw, 2.65rem);
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.hero-showcase h1 .accent {
  font-family: var(--font-flair);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.35rem, 3.2vw, 2.15rem);
  color: #f2e088;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.65);
}

.hero-showcase .lede {
  font-family: var(--font-sans);
  font-size: clamp(1rem, 1.05rem + 0.2vw, 1.08rem);
  font-weight: 400;
  margin-top: 1.1rem;
  color: rgba(248, 252, 250, 0.96);
  line-height: 1.72;
  max-width: 46rem;
  letter-spacing: 0.008em;
}

.hero-showcase .lede strong {
  color: #fff;
  font-weight: 700;
}

.hero-showcase .whisper {
  font-family: var(--font-sans);
  font-size: 1.02rem;
  font-weight: 400;
  font-style: normal;
  margin-top: 1rem;
  color: rgba(240, 248, 244, 0.88);
  line-height: 1.65;
  max-width: 42rem;
}

.hero-showcase .whisper em {
  font-family: var(--font-flair);
  font-style: italic;
  font-weight: 400;
  color: rgba(255, 250, 230, 0.96);
}

.hero-showcase .whisper__label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  font-style: normal;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(143, 243, 201, 0.95);
  margin-right: 0.35rem;
}

.hero-showcase .whisper code {
  font-family: var(--font-mono);
  font-weight: 500;
  background: rgba(0, 0, 0, 0.4);
  padding: 0.15em 0.45em;
  border-radius: 6px;
  font-size: 0.82em;
  color: #c6ffe6;
  border: 1px solid rgba(45, 212, 138, 0.45);
}

.hero-showcase .btn--ghost {
  color: #f4fbf7;
  background: rgba(0, 0, 0, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.32);
}

.hero-showcase .btn--ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.45);
}

.hero-showcase .btn {
  font-family: var(--font-ui);
  letter-spacing: 0.02em;
}

@media (max-width: 640px) {
  .hero-showcase__mascots {
    display: none;
  }

  .hero-showcase__intro {
    margin-bottom: 0.35rem;
  }
}

@media (max-width: 560px) {
  .hero-showcase h1 {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }
}

.glass {
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.panel {
  padding: clamp(1.35rem, 3.5vw, 2rem);
}

.hero-showcase .panel {
  padding: clamp(1.25rem, 3vw, 1.75rem);
}

.badge {
  font-family: var(--font-mono);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--horde-bright);
  border: 1px solid rgba(45, 212, 138, 0.35);
  background: rgba(31, 111, 74, 0.35);
}

.badge img {
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 6px;
  object-fit: cover;
}

h1 {
  margin: 0.75rem 0 0;
  font-size: clamp(2rem, 4.5vw, 3.15rem);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.03em;
}

h1 .accent {
  font-family: var(--font-flair);
  font-style: italic;
  font-weight: 400;
  color: var(--gold);
}

.lede {
  margin: 1rem 0 0;
  max-width: 52ch;
  font-size: 1.08rem;
  color: var(--muted);
}

.whisper {
  margin: 0.5rem 0 0;
  font-size: 0.92rem;
  font-style: italic;
  color: rgba(233, 242, 237, 0.45);
}

.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.btn {
  font-family: var(--font-ui);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.2rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  transition:
    filter 0.15s ease,
    border-color 0.15s ease,
    background-color 0.15s ease,
    transform 0.15s ease;
}

.btn--primary {
  color: #061a12;
  background: linear-gradient(180deg, #4cf0b0, #1f9f66);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset;
}

.btn--primary:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.btn--primary:active {
  transform: translateY(0);
}

.btn--ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border);
}

.btn--ghost:hover {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.08);
}

.btn:focus-visible {
  box-shadow: var(--focus-ring);
}

/* Main column — readable measure, soft top edge into hero */
main {
  position: relative;
  z-index: 1;
  max-width: 44rem;
  margin: 0 auto;
  padding: 2.25rem clamp(1.25rem, 4vw, 2rem) 4rem;
  background: var(--bg);
  border-top: 1px solid var(--border);
  border-radius: 20px 20px 0 0;
  box-shadow: var(--shadow-md);
}

.repo-list {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.repo-list__item {
  margin: 0;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.repo-list__item + .repo-list__item {
  margin-top: 0.5rem;
}

.repo-list__item:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.repo-list__item a {
  font-weight: 600;
  border-bottom: none;
}

.repo-list__item a:hover {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.repo-list__status {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0.35rem 0 0;
}

.repo-list__loading,
.repo-list__empty {
  margin: 0;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.55;
}

.repo-list__domains {
  opacity: 0.88;
  font-size: 0.95em;
}

.section {
  margin-top: 2.75rem;
  scroll-margin-top: 5.5rem;
}

.section:first-of-type {
  margin-top: 0.5rem;
}

.section__label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin: 0 0 0.45rem;
}

.section h2 {
  font-family: var(--font-sans);
  margin: 0 0 0.85rem;
  font-size: clamp(1.28rem, 2.5vw, 1.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: var(--leading-tight);
}

.section p,
.section li {
  font-family: var(--font-sans);
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: var(--leading-body);
}

.section ul {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
}

.section ol {
  margin: 0.5rem 0 0;
  padding-left: 1.35rem;
}

.section li {
  margin: 0.35rem 0;
}

main code,
.section code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  font-weight: 500;
  padding: 0.12em 0.45em;
  border-radius: 6px;
  background: var(--horde-muted);
  border: 1px solid rgba(62, 232, 163, 0.28);
  color: var(--text);
}

.grid-2 {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.card {
  padding: 1.15rem 1.25rem;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.card:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.card h3 {
  font-family: var(--font-ui);
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text);
}

.card p {
  margin: 0;
  font-size: 0.94rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* Minicon strip */
.minicon-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
  margin-top: 1rem;
}

.minicon-strip figure {
  margin: 0;
  text-align: center;
  width: 88px;
}

.minicon-strip img {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.25);
}

.minicon-strip figcaption {
  font-family: var(--font-mono);
  margin-top: 0.35rem;
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(233, 242, 237, 0.45);
}

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  margin: 2rem 0;
}

.site-footer {
  position: relative;
  z-index: 1;
  font-family: var(--font-sans);
  padding: 2.25rem clamp(1.25rem, 4vw, 2rem) 3rem;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.65;
  max-width: 44rem;
  margin: 0 auto;
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.site-footer p {
  margin: 0 0 0.85rem;
}

.site-footer p:last-child {
  margin-bottom: 0;
}

.site-footer em {
  font-family: var(--font-flair);
  font-style: italic;
  color: rgba(233, 242, 237, 0.65);
}

