:root {
  --paper: #f7f7f3;
  --ink: #242421;
  --muted: #6b6d66;
  --line: #deded6;
  --soft: #eeeee8;
  --blue: #5c768c;
  --moss: #68745a;
  --amber: #b8793d;
  --critical: #9e4e3f;
  --white: #ffffff;
  --shadow: 0 24px 70px rgba(36, 36, 33, 0.11);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(20px, 5vw, 64px);
  border-bottom: 1px solid rgba(36, 36, 33, 0.08);
  background: rgba(247, 247, 243, 0.86);
  backdrop-filter: blur(18px);
}

.brand,
nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  font-weight: 800;
  font-size: 18px;
}

.mark {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--moss));
  box-shadow: inset -3px -3px 0 rgba(255, 255, 255, 0.42);
}

nav a,
footer a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

nav a:hover,
footer a:hover {
  color: var(--ink);
}

main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.hero {
  min-height: calc(100vh - 74px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 460px);
  gap: clamp(30px, 7vw, 86px);
  align-items: center;
  padding: 60px 0 76px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 22px;
  font-size: clamp(48px, 7vw, 92px);
  line-height: 0.94;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1;
  letter-spacing: 0;
}

.lede,
.section-head p,
.asset-sheet p {
  max-width: 660px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.62;
}

.command {
  width: min(100%, 560px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 34px;
  padding: 8px 8px 8px 18px;
  border: 1px solid var(--line);
  background: var(--white);
  box-shadow: var(--shadow);
}

code {
  overflow: hidden;
  color: #30342f;
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

button {
  min-height: 38px;
  border: 0;
  padding: 0 16px;
  background: var(--ink);
  color: var(--white);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(92, 118, 140, 0.45);
  outline-offset: 4px;
}

.hero-pet {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 480px;
  padding: 34px 28px 88px;
  background:
    linear-gradient(90deg, rgba(36, 36, 33, 0.07) 1px, transparent 1px),
    linear-gradient(180deg, rgba(36, 36, 33, 0.07) 1px, transparent 1px),
    #eeeeea;
  background-size: 34px 34px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero-pets {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.hero-pet-chip {
  min-height: 150px;
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: end;
  justify-items: center;
  gap: 10px;
  padding: 16px 12px 12px;
  border: 1px solid rgba(36, 36, 33, 0.12);
  background: rgba(255, 255, 255, 0.72);
}

.hero-pet-chip:first-child {
  grid-row: span 2;
}

.hero-pet-chip img {
  width: min(100%, 150px);
  max-height: 150px;
  object-fit: contain;
  image-rendering: auto;
}

.hero-pet-chip:first-child img {
  width: min(100%, 210px);
  max-height: 250px;
}

.hero-pet-chip span {
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
}

.pet-note {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 22px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid rgba(36, 36, 33, 0.12);
  color: var(--muted);
  font-size: 14px;
}

.pet-note strong {
  color: var(--ink);
  font-size: 17px;
}

.section {
  padding: 54px 0;
  border-top: 1px solid var(--line);
}

.section-head {
  margin-bottom: 26px;
}

.registry-summary {
  max-width: 720px;
  margin-top: -6px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.filter-bar button {
  min-height: 34px;
  border: 1px solid var(--line);
  padding: 0 12px;
  background: var(--white);
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.filter-bar button.active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--white);
}

.filter-bar span {
  margin-left: 6px;
  color: inherit;
  opacity: 0.72;
}

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

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

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

.pet-card {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--white);
}

.pet-card img {
  width: 112px;
  height: 112px;
  object-fit: contain;
  background: var(--soft);
}

.pet-card h3 {
  margin: 0 0 6px;
  font-size: 24px;
}

.pet-card p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.45;
}

.pet-license {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.pet-license span,
.pet-license a {
  padding: 5px 8px;
  background: var(--soft);
}

.pet-license a {
  color: var(--blue);
}

.pet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 12px;
}

.pet-actions button {
  min-height: 30px;
  border: 1px solid var(--line);
  padding: 0 10px;
  background: var(--white);
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.pet-actions button:hover {
  border-color: rgba(92, 118, 140, 0.55);
  color: var(--blue);
}

.pet-behavior {
  display: grid;
  gap: 7px;
  margin: 0 0 12px;
}

.pet-behavior div {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  background: var(--soft);
}

.pet-behavior strong {
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.pet-behavior span {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.38;
}

.license-chip.ready {
  background: rgba(104, 116, 90, 0.14);
  color: var(--moss);
}

.license-chip.restricted {
  background: rgba(158, 78, 63, 0.12);
  color: var(--critical);
}

.source-card,
.candidate-card {
  display: grid;
  gap: 16px;
  align-content: space-between;
  min-height: 184px;
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--white);
}

.source-card h3,
.candidate-card h3 {
  margin: 0 0 8px;
  font-size: 22px;
}

.source-card p,
.candidate-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.46;
}

.source-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.source-meta span {
  padding: 5px 8px;
  background: var(--soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tags span {
  padding: 5px 8px;
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(320px, 1.2fr);
  gap: clamp(28px, 6vw, 70px);
}

.behavior-rail {
  display: grid;
  gap: 10px;
}

.behavior-rule {
  display: grid;
  grid-template-columns: 78px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--white);
}

.event-map {
  display: grid;
  gap: 8px;
}

.event-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 120px 92px;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--white);
}

.event-name,
.event-animation {
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 13px;
  font-weight: 750;
}

.event-animation {
  color: var(--blue);
}

.tone {
  padding: 6px 9px;
  text-align: center;
  color: var(--white);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.tone.neutral {
  background: #777970;
}

.tone.working,
.tone.done {
  background: var(--moss);
}

.tone.attention,
.tone.warning,
.tone.care,
.tone.system {
  background: var(--amber);
}

.tone.critical {
  background: var(--critical);
}

.trigger {
  color: var(--blue);
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 13px;
  font-weight: 800;
}

.behavior-rule h3 {
  margin: 0 0 4px;
  font-size: 18px;
}

.behavior-rule p {
  margin: 0;
  color: var(--muted);
  line-height: 1.42;
}

.mode {
  min-width: 68px;
  padding: 7px 10px;
  text-align: center;
  color: var(--white);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.mode.soft {
  background: var(--blue);
}

.mode.medium {
  background: var(--moss);
}

.mode.hard {
  background: var(--critical);
}

.mode.focus,
.mode.default {
  background: var(--blue);
}

.mode.rest {
  background: var(--moss);
}

.asset-sheet {
  display: grid;
  grid-template-columns: minmax(280px, 0.78fr) minmax(320px, 1.22fr);
  gap: clamp(24px, 5vw, 54px);
  align-items: start;
}

.asset-sheet img {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--white);
}

footer {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 26px 0 42px;
  border-top: 1px solid var(--line);
}

footer span {
  margin-right: auto;
  font-weight: 850;
}

@media (max-width: 820px) {
  .topbar,
  nav,
  footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero,
  .split,
  .asset-sheet {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 42px;
  }

  .hero-pet {
    min-height: 380px;
  }

  .hero-pets {
    grid-template-columns: 1fr 1fr;
  }

  .command,
  .pet-card,
  .behavior-rule,
  .event-row {
    grid-template-columns: 1fr;
  }

  .command {
    align-items: stretch;
    flex-direction: column;
  }

  code {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}
