:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #07090d;
  --panel: rgba(10, 12, 17, 0.72);
  --panel-2: #23242b;
  --line: rgba(245, 241, 236, 0.12);
  --text: #f5f1ec;
  --muted: #a8a3a0;
  --accent: #ff8c5f;
  --accent-2: #7ac7b7;
  --warning: #f1c978;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(90deg, rgba(7, 9, 13, 0.15), rgba(7, 9, 13, 0.72) 74%),
    linear-gradient(180deg, rgba(7, 9, 13, 0.03), rgba(7, 9, 13, 0.76)),
    var(--bg);
  color: var(--text);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.46;
  background-image:
    linear-gradient(rgba(245, 241, 236, 0.048) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 241, 236, 0.04) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 82%);
}

button,
input,
.copy {
  font: inherit;
}

button {
  border: 0;
}

.page {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(44px, 8vh, 86px) 0 54px;
  display: grid;
  gap: 28px;
}

.hero {
  display: grid;
  gap: 18px;
}

.eyebrow {
  margin: 0;
  color: rgba(245, 241, 236, 0.62);
  font-size: 0.78rem;
  font-weight: 790;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(3.6rem, 10vw, 8.2rem);
  font-weight: 850;
  line-height: 0.86;
  letter-spacing: 0;
}

.description {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.12rem, 2.4vw, 1.58rem);
  line-height: 1.42;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-link {
  min-height: 38px;
  color: var(--text);
  background: rgba(13, 14, 18, 0.72);
}

.catalog {
  display: grid;
  gap: 14px;
}

.toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: auto minmax(240px, 1fr);
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  background: rgba(7, 9, 13, 0.9);
  backdrop-filter: blur(14px);
}

.tabs {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(112px, 1fr));
  gap: 8px;
  min-width: 0;
}

.tab,
.copy {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 14, 18, 0.86);
  color: var(--text);
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.tab:hover,
.tab:focus-visible,
.copy:hover,
.copy:focus-visible {
  border-color: rgba(255, 140, 95, 0.5);
  color: var(--accent);
  outline: none;
}

.tab.is-active {
  border-color: rgba(255, 140, 95, 0.72);
  background: rgba(255, 140, 95, 0.14);
  color: var(--text);
}

.search {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 14, 18, 0.86);
}

.search span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.search input {
  width: 100%;
  min-width: 0;
  height: 42px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.summary {
  color: var(--muted);
  font-size: 0.93rem;
  min-height: 24px;
}

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

.card {
  display: grid;
  gap: 13px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(245, 241, 236, 0.055), rgba(245, 241, 236, 0.016)),
    var(--panel);
  box-shadow: 0 24px 78px rgba(0, 0, 0, 0.22);
}

.card.is-clickable {
  cursor: pointer;
  transition:
    border-color 160ms ease,
    transform 160ms ease,
    background 160ms ease;
}

.card.is-clickable:hover,
.card.is-clickable:focus-visible {
  border-color: rgba(255, 140, 95, 0.52);
  transform: translateY(-2px);
  outline: none;
}

.preview-shell {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(245, 241, 236, 0.12);
  border-radius: 8px;
  background: #0d0f14;
}

.layout-shot {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  image-rendering: crisp-edges;
}

.building-mark {
  position: relative;
  min-height: 148px;
  overflow: hidden;
  padding: 18px;
  border: 1px solid rgba(245, 241, 236, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 140, 95, 0.14), transparent 42%),
    linear-gradient(90deg, rgba(122, 199, 183, 0.13), transparent 54%),
    #0d0f14;
}

.building-mark-grid {
  position: absolute;
  inset: 0;
  opacity: 0.32;
  background-image:
    linear-gradient(rgba(245, 241, 236, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 241, 236, 0.06) 1px, transparent 1px);
  background-size: 24px 24px;
}

.building-mark-shadow {
  position: absolute;
  left: 50%;
  bottom: 30px;
  width: 132px;
  height: 20px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.34);
}

.building-mark-roof {
  position: absolute;
  left: 50%;
  bottom: 82px;
  width: 112px;
  height: 38px;
  transform: translateX(-50%);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background: #8f5865;
}

.building-mark-body {
  position: absolute;
  left: 50%;
  bottom: 42px;
  width: 98px;
  height: 50px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(245, 241, 236, 0.14);
  border-radius: 8px;
  background: #735f3e;
  box-shadow: inset 0 4px 0 rgba(245, 241, 236, 0.08);
}

.building-mark-window,
.building-mark-door {
  display: block;
  border-radius: 3px;
  background: #f1d98f;
}

.building-mark-window {
  width: 15px;
  height: 14px;
}

.building-mark-door {
  width: 17px;
  height: 28px;
  align-self: flex-end;
  background: #342b25;
}

.building-mark-sign {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 790;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.building-mark.has-thumbnail {
  display: block;
  padding: 0;
}

.building-mark.has-thumbnail img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 148px;
  object-fit: cover;
}

.building-shape-market .building-mark-body {
  background: #7a4e44;
}

.building-shape-market .building-mark-roof,
.building-shape-studio .building-mark-roof {
  background: #ff8c5f;
}

.building-shape-lab .building-mark-body,
.building-shape-factory .building-mark-body {
  background: #4f6868;
}

.building-shape-library .building-mark-body,
.building-shape-school .building-mark-body {
  background: #665f8a;
}

.building-shape-post .building-mark-body,
.building-shape-dock .building-mark-body {
  background: #465d7e;
}

.building-shape-portal .building-mark-roof,
.building-shape-browser .building-mark-roof {
  background: #7ac7b7;
}

.building-shape-campus .building-mark-body {
  background: #536e55;
}

.building-shape-campus .building-mark-roof {
  background: #f2c66d;
}

.meta,
.tags,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 25px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pill.is-accent {
  border-color: rgba(122, 199, 183, 0.36);
  color: var(--accent-2);
}

.card h2 {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.15;
  letter-spacing: 0;
}

.card h2 a {
  color: inherit;
  text-decoration: none;
}

.card h2 a:hover,
.card h2 a:focus-visible {
  color: var(--accent);
  outline: none;
}

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

.copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  text-decoration: none;
}

.empty-card {
  min-height: 180px;
  align-content: center;
}

.catalog.is-detail .toolbar {
  display: none;
}

.back-link {
  width: fit-content;
}

.detail {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(0, 1.18fr);
  gap: 16px;
  align-items: stretch;
}

.detail-heading {
  display: grid;
  align-content: center;
  gap: 14px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(245, 241, 236, 0.055), rgba(245, 241, 236, 0.016)),
    var(--panel);
}

.detail-heading h2 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4.8rem);
  line-height: 0.94;
  letter-spacing: 0;
}

.detail-heading p,
.detail-panel p,
.interface-row p {
  margin: 0;
  color: var(--muted);
  line-height: 1.48;
}

.detail-actions {
  margin-top: 4px;
}

.building-mark.is-large,
.detail-preview {
  min-height: clamp(240px, 34vw, 360px);
}

.detail-preview .layout-shot {
  height: 100%;
}

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

.detail-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(10, 12, 17, 0.64);
}

.detail-panel h3,
.interface-row h4 {
  margin: 0;
  letter-spacing: 0;
}

.detail-panel h3 {
  font-size: 1rem;
  color: var(--accent-2);
}

.interface-row h4 {
  font-size: 0.96rem;
}

.kv {
  display: grid;
  gap: 8px;
  margin: 0;
}

.kv-row {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.kv-row dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.kv-row dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--text);
}

.interface-list {
  display: grid;
  gap: 10px;
}

.interface-row {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(245, 241, 236, 0.1);
  border-radius: 8px;
  background: rgba(13, 14, 18, 0.54);
}

.interface-row code {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 9px;
  overflow-x: auto;
  border: 1px solid rgba(245, 241, 236, 0.1);
  border-radius: 8px;
  color: var(--warning);
  background: rgba(7, 9, 13, 0.68);
}

.inline-link {
  width: fit-content;
  min-height: 34px;
}

@media (max-width: 720px) {
  .toolbar {
    grid-template-columns: 1fr;
  }

  .tabs {
    width: 100%;
  }

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

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