:root {
  color-scheme: dark;
  --background: #06111f;
  --surface: rgba(8, 24, 41, 0.92);
  --surface-strong: #0a1b2d;
  --ink: #f0fbff;
  --muted: #9cb2c3;
  --cyan: #64e6f5;
  --line: rgba(141, 201, 221, 0.18);
  --line-strong: rgba(141, 201, 221, 0.3);
  --green: #63e994;
  --shadow: 0 26px 70px rgba(0, 5, 14, 0.42);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 78% 0%, rgba(37, 136, 196, 0.12), transparent 34rem),
    linear-gradient(150deg, #06111f 0%, #07182a 54%, #06101c 100%);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

.shell {
  width: min(1410px, calc(100% - 72px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 820;
  letter-spacing: -0.035em;
  text-decoration: none;
}

.brand img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.site-nav {
  display: flex;
  align-items: stretch;
  gap: clamp(16px, 2.2vw, 34px);
  align-self: stretch;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 650;
  text-decoration: none;
  transition: border-color 160ms ease, color 160ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a[aria-current="page"] {
  border-bottom-color: var(--cyan);
  color: var(--ink);
}

.site-nav .star-repo-badge {
  align-self: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(249, 198, 66, 0.48);
  border-radius: 999px;
  color: #fff1b8;
  background: rgba(249, 198, 66, 0.09);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.06);
}

.site-nav .star-repo-badge:hover,
.site-nav .star-repo-badge:focus-visible {
  border-color: rgba(249, 198, 66, 0.82);
  color: #fff8dc;
  background: rgba(249, 198, 66, 0.16);
}

.hero {
  position: relative;
  display: grid;
  min-height: clamp(470px, 48vw, 600px);
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.72fr);
  grid-template-rows: 1fr auto;
  gap: clamp(30px, 4.5vw, 66px);
  align-items: end;
  overflow: hidden;
  margin-top: 16px;
  margin-bottom: 30px;
  padding: clamp(30px, 4.5vw, 60px);
  border: 1px solid rgba(100, 230, 245, 0.24);
  border-radius: 30px;
  background:
    linear-gradient(90deg, rgba(3, 10, 23, 0.98) 0%, rgba(3, 12, 28, 0.9) 36%, rgba(4, 14, 33, 0.36) 68%, rgba(4, 14, 33, 0.06) 100%),
    url("./assets/brand/codex-pets-header.png") 55% center / cover no-repeat;
  box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, 0.05);
}

.hero::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, transparent 54%, rgba(3, 10, 23, 0.68));
  content: "";
  pointer-events: none;
}

.hero-copy,
.hero-stats {
  position: relative;
  z-index: 1;
}

.hero-copy {
  align-self: center;
}

.eyebrow,
.pet-number,
.pet-role {
  margin: 0;
  color: var(--cyan);
  font-size: 0.7rem;
  font-weight: 820;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  text-wrap: balance;
}

h1 {
  max-width: 680px;
  margin: 14px 0 0;
  font-size: clamp(5.2rem, 9.2vw, 8.8rem);
  font-weight: 850;
  line-height: 0.74;
  letter-spacing: -0.085em;
}

.title-main,
.title-accent {
  display: block;
}

.title-main {
  color: var(--ink);
}

.title-accent {
  color: transparent;
  background: linear-gradient(90deg, #61e7f5, #87d9ff 52%, #aa8cf5);
  background-clip: text;
  -webkit-background-clip: text;
}

.hero-kicker {
  margin: 38px 0 0;
  color: #e8faff;
  font-size: clamp(1.05rem, 1.7vw, 1.35rem);
  font-weight: 760;
  letter-spacing: -0.02em;
}

.lede {
  max-width: 610px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.hero-stats {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(141, 201, 221, 0.17);
  border-radius: 16px;
  background: rgba(3, 12, 27, 0.72);
  backdrop-filter: blur(12px);
}

.hero-stats div {
  display: flex;
  min-width: 0;
  flex-direction: column-reverse;
  gap: 6px;
  padding: 17px clamp(14px, 2vw, 28px);
  border-left: 1px solid var(--line);
}

.hero-stats div:first-child {
  border-left: 0;
}

.hero-stats dt {
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.3;
}

.hero-stats dd {
  margin: 0;
  color: var(--cyan);
  font-size: clamp(1.5rem, 3vw, 2.15rem);
  font-weight: 790;
  line-height: 1;
}

.catalogue {
  padding-block: 0 72px;
}

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

.pet-card,
.contribution-card {
  --accent: #64e6f5;
  --accent-rgb: 100, 230, 245;
  display: grid;
  min-height: 304px;
  grid-template-columns: minmax(190px, 0.74fr) minmax(320px, 1.26fr);
  overflow: hidden;
  border: 1px solid rgba(var(--accent-rgb), 0.34);
  border-radius: 22px;
  background:
    radial-gradient(circle at 18% 45%, rgba(var(--accent-rgb), 0.13), transparent 17rem),
    linear-gradient(145deg, rgba(var(--accent-rgb), 0.045), rgba(6, 20, 34, 0.96) 68%);
  box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, 0.035);
  transition: border-color 180ms ease, transform 180ms ease;
}

.pet-card {
  position: relative;
}

.pet-card:hover,
.contribution-card:hover {
  border-color: rgba(var(--accent-rgb), 0.58);
  transform: translateY(-2px);
}

.pet-aethercore {
  --accent: #f9c642;
  --accent-rgb: 249, 198, 66;
}

.pet-aethermite {
  --accent: #54e6c3;
  --accent-rgb: 84, 230, 195;
}

.pet-aetherbite {
  --accent: #58aeff;
  --accent-rgb: 88, 174, 255;
}

.pet-calian {
  --accent: #ff8a73;
  --accent-rgb: 255, 138, 115;
}

.pet-scarlet {
  --accent: #d48cff;
  --accent-rgb: 212, 140, 255;
}

.pet-aetherwing {
  --accent: #65e6f4;
  --accent-rgb: 101, 230, 244;
}

.contribution-card {
  --accent: #a78bfa;
  --accent-rgb: 167, 139, 250;

  color: inherit;
  text-decoration: none;
}

.contribution-card:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.78);
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.pet-visual,
.contribution-visual {
  display: grid;
  min-height: 100%;
  place-items: center;
  padding: 20px 16px;
  border-right: 1px solid rgba(var(--accent-rgb), 0.16);
  background: radial-gradient(circle at center, rgba(var(--accent-rgb), 0.16), transparent 62%);
}

.pet-visual img,
.contribution-visual img {
  width: min(196px, 100%);
  height: auto;
  image-rendering: auto;
  filter: drop-shadow(0 18px 26px rgba(var(--accent-rgb), 0.2));
}

.contribution-visual img {
  width: min(154px, 70%);
}

.contribution-kicker {
  margin: 0;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 820;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.invitation-badge {
  display: inline-flex;
  flex: none;
  align-items: center;
  padding: 7px 10px;
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  border-radius: 999px;
  color: #e2d9ff;
  background: rgba(var(--accent-rgb), 0.09);
  font-size: 0.68rem;
  font-weight: 760;
}

.pet-content {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 22px 22px 20px;
}

.pet-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
}

.pet-heading h2 {
  margin: 4px 0 0;
  font-size: clamp(1.85rem, 2.5vw, 2.5rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.pet-readme-link {
  color: inherit;
  text-decoration: none;
}

.pet-readme-link::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  border-radius: 22px;
  content: "";
}

.pet-readme-link:focus-visible {
  outline: none;
}

.pet-readme-link:focus-visible::after {
  outline: 3px solid var(--accent);
  outline-offset: -4px;
}

.pet-number,
.pet-role {
  color: var(--accent);
}

.pet-role {
  margin-top: 10px;
}

.status {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid rgba(99, 233, 148, 0.2);
  border-radius: 999px;
  color: #bdf8d0;
  background: rgba(41, 173, 87, 0.08);
  font-size: 0.68rem;
  font-weight: 760;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px rgba(99, 233, 148, 0.9);
}

.pet-description {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.pet-traits {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 11px 0 0;
  padding: 0;
  list-style: none;
}

.pet-traits li {
  padding: 5px 9px;
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  border-radius: 7px;
  color: #cfe2eb;
  background: rgba(var(--accent-rgb), 0.045);
  font-size: 0.67rem;
  font-weight: 690;
}

.card-actions {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
  gap: 10px;
  margin-top: auto;
  padding-top: 16px;
}

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

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 11px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 780;
  text-align: center;
  text-decoration: none;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
}

.button-install {
  color: #03131d;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.78), var(--accent));
  box-shadow: 0 10px 26px rgba(var(--accent-rgb), 0.15);
}

.button-package {
  border-color: rgba(var(--accent-rgb), 0.2);
  color: #d8e7ee;
  background: rgba(255, 255, 255, 0.025);
}

.button-package:hover,
.button-package:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.48);
  background: rgba(var(--accent-rgb), 0.06);
}

.standards {
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(0, 1.45fr);
  gap: clamp(30px, 4vw, 60px);
  margin-bottom: 58px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(8, 26, 44, 0.72);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.03);
}

.standards-intro h2 {
  max-width: 560px;
  margin: 8px 0 0;
  font-size: clamp(1.7rem, 2.8vw, 2.4rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

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

.standards-grid article {
  padding-inline: 24px;
  border-left: 1px solid var(--line);
}

.standards-grid h3 {
  margin: 0;
  color: var(--cyan);
  font-size: 0.95rem;
}

.standards-grid p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.6;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  padding-block: 28px 38px;
  border-top: 1px solid var(--line);
  color: #7890a2;
  font-size: 0.75rem;
}

.site-footer p {
  margin: 0;
}

.site-footer a,
.package-links a,
.text-link {
  color: #c2d6e0;
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible,
.package-links a:hover,
.package-links a:focus-visible,
.text-link:hover,
.text-link:focus-visible {
  color: var(--cyan);
}

.installer-page {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.installer-page .site-header {
  border-bottom-color: var(--line);
}

.installer-page main {
  flex: 1;
}

.installer-page .site-header .text-link {
  font-size: 0.82rem;
}

.installer {
  display: grid;
  min-height: 680px;
  place-items: center;
  padding-block: 66px 92px;
}

.installer-card {
  --accent: #64e6f5;
  --accent-rgb: 100, 230, 245;
  display: grid;
  width: min(900px, 100%);
  grid-template-columns: minmax(280px, 0.86fr) minmax(0, 1.14fr);
  gap: 42px;
  align-items: center;
  padding: 30px;
  border: 1px solid rgba(var(--accent-rgb), 0.32);
  border-radius: 24px;
  background:
    radial-gradient(circle at 16% 46%, rgba(var(--accent-rgb), 0.12), transparent 24rem),
    var(--surface-strong);
  box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, 0.04);
}

.aethercore-theme .installer-card {
  --accent: #f9c642;
  --accent-rgb: 249, 198, 66;
}

.aethermite-theme .installer-card {
  --accent: #54e6c3;
  --accent-rgb: 84, 230, 195;
}

.aetherbite-theme .installer-card {
  --accent: #58aeff;
  --accent-rgb: 88, 174, 255;
}

.calian-theme .installer-card {
  --accent: #ff8a73;
  --accent-rgb: 255, 138, 115;
}

.scarlet-theme .installer-card {
  --accent: #d48cff;
  --accent-rgb: 212, 140, 255;
}

.aetherwing-theme .installer-card {
  --accent: #65e6f4;
  --accent-rgb: 101, 230, 244;
}

.installer-visual {
  display: grid;
  min-height: 390px;
  place-items: center;
  padding: 24px;
  border: 1px solid rgba(var(--accent-rgb), 0.16);
  border-radius: 18px;
  background: radial-gradient(circle at center, rgba(var(--accent-rgb), 0.16), transparent 64%);
}

.installer-visual img {
  width: min(270px, 100%);
  height: auto;
  filter: drop-shadow(0 18px 26px rgba(var(--accent-rgb), 0.24));
}

.installer-copy .eyebrow {
  color: var(--accent);
}

.installer-copy h1 {
  margin: 10px 0 0;
  font-size: clamp(2.8rem, 6vw, 5rem);
  line-height: 0.94;
  letter-spacing: -0.06em;
}

.installer-copy > p:not(.eyebrow, .install-note) {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

.button-wide {
  width: 100%;
  margin-top: 28px;
  color: #03131d;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.78), var(--accent));
}

.install-note {
  margin: 12px 2px 0;
  color: #7890a3;
  font-size: 0.74rem;
  line-height: 1.5;
}

.fallback {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}

.fallback summary {
  cursor: pointer;
  color: #c9dce8;
  font-weight: 700;
}

.fallback ol {
  padding-left: 20px;
  line-height: 1.7;
}

.package-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

@media (max-width: 1160px) {
  .hero {
    min-height: 540px;
    grid-template-columns: minmax(0, 1fr);
    background-position: 58% center;
  }

  .pet-card,
  .contribution-card {
    grid-template-columns: 1fr;
  }

  .pet-visual,
  .contribution-visual {
    min-height: 290px;
    border-right: 0;
    border-bottom: 1px solid rgba(var(--accent-rgb), 0.16);
  }

  .pet-visual img {
    width: 230px;
  }

  .contribution-visual {
    min-height: 230px;
  }

  .standards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 32px, 1410px);
  }

  .site-header {
    min-height: auto;
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding-block: 10px;
  }

  .site-nav {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .site-nav a {
    min-height: 34px;
    font-size: 0.82rem;
    white-space: nowrap;
  }

  .site-nav .star-repo-badge {
    padding-inline: 8px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 34px;
    min-height: 540px;
    margin-top: 12px;
    margin-bottom: 26px;
    padding: 26px 22px 20px;
    border-radius: 22px;
    background:
      linear-gradient(180deg, rgba(3, 10, 23, 0.72) 0%, rgba(3, 10, 23, 0.9) 62%, rgba(3, 10, 23, 0.98) 100%),
      url("./assets/brand/codex-pets-header.png") 70% center / auto 100% no-repeat;
  }

  h1 {
    font-size: clamp(4.5rem, 23vw, 6.5rem);
  }

  .hero-kicker {
    margin-top: 34px;
  }

  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
    border: 1px solid var(--line);
    border-radius: 16px;
  }

  .hero-stats div {
    padding: 16px;
    border-left: 0;
  }

  .hero-stats div:nth-child(even) {
    border-left: 1px solid var(--line);
  }

  .hero-stats div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .pet-grid,
  .standards-grid,
  .installer-card {
    grid-template-columns: 1fr;
  }

  .pet-visual {
    min-height: 260px;
  }

  .contribution-visual {
    min-height: 190px;
  }

  .pet-content {
    padding: 24px 20px 20px;
  }

  .pet-heading {
    align-items: flex-start;
    flex-direction: column-reverse;
    gap: 14px;
  }

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

  .standards {
    padding: 24px 20px;
  }

  .standards-grid article {
    padding: 20px 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .installer {
    padding-block: 42px 64px;
  }

  .installer-card {
    gap: 28px;
    padding: 20px;
  }

  .installer-visual {
    min-height: 300px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
