:root {
  color-scheme: dark;
  --ink: #f8f4ea;
  --ink-soft: #d8d0c1;
  --muted: #9aa8aa;
  --night: #0d1111;
  --forest: #10241f;
  --clay: #b95b43;
  --teal: #2b9aa5;
  --sun: #d9b55f;
  --cream: #f0e8d8;
  --cream-2: #fff8e9;
  --line: rgba(255, 255, 255, 0.15);
  --line-dark: rgba(19, 22, 23, 0.16);
  --shadow: 0 34px 100px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--ink);
  background:
    linear-gradient(122deg, rgba(185, 91, 67, 0.22), transparent 28%),
    linear-gradient(238deg, rgba(43, 154, 165, 0.2), transparent 32%),
    linear-gradient(180deg, #1a1c1c 0%, var(--forest) 54%, #0a0f0f 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0 52%, rgba(255, 255, 255, 0.06) 52% 52.3%, transparent 52.3% 100%),
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 100% 100%, 58px 58px, 58px 58px;
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.82) 45%, transparent 100%);
}

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

a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

button {
  font: inherit;
}

.topbar {
  width: min(1420px, calc(100% - 40px));
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #12211e;
  font-size: 0.86rem;
  font-weight: 950;
  border-radius: 50%;
  background:
    linear-gradient(135deg, var(--cream) 0 48%, var(--teal) 48% 70%, var(--clay) 70% 100%);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
}

.brand-copy {
  display: grid;
  gap: 3px;
}

.brand-copy strong,
.brand-copy small {
  display: block;
  line-height: 1;
}

.brand-copy strong {
  color: var(--ink);
  font-size: 1rem;
  letter-spacing: 0;
}

.brand-copy small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.topnav {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  backdrop-filter: blur(16px);
}

.topnav a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 900;
  border-radius: 999px;
}

.topnav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  text-decoration: none;
}

.atlas {
  width: min(1420px, calc(100% - 40px));
  min-height: calc(100vh - 76px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(300px, 0.34fr) minmax(740px, 1fr);
  gap: 24px;
  align-items: stretch;
  padding: 16px 0 34px;
}

.intro-panel {
  position: relative;
  min-height: 720px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.035)),
    rgba(10, 15, 14, 0.42);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.2);
}

.intro-panel::after {
  position: absolute;
  right: -20px;
  bottom: -48px;
  content: "5";
  color: rgba(255, 255, 255, 0.05);
  font-size: 18rem;
  font-weight: 950;
  line-height: 0.8;
  pointer-events: none;
}

.kicker {
  margin: 0 0 16px;
  color: var(--sun);
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #fffaf1;
  font-size: clamp(3.2rem, 6vw, 6.2rem);
  line-height: 0.86;
  letter-spacing: 0;
}

h1 span {
  display: block;
}

h1 span:nth-child(2) {
  color: transparent;
  -webkit-text-stroke: 1.3px rgba(255, 250, 241, 0.72);
  text-stroke: 1.3px rgba(255, 250, 241, 0.72);
}

.lead {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 24px 0 0;
  color: var(--ink-soft);
  font-size: 0.98rem;
  line-height: 1.72;
}

.featured-meta {
  position: relative;
  z-index: 1;
  width: 100%;
  margin-top: 30px;
  display: grid;
  grid-template-columns: 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.featured-meta div {
  min-width: 0;
  padding: 15px 14px;
  border-bottom: 1px solid var(--line);
}

.featured-meta div:last-child {
  border-bottom: 0;
}

.featured-meta span,
.featured-meta strong {
  display: block;
  overflow-wrap: anywhere;
}

.featured-meta span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.featured-meta strong {
  margin-top: 6px;
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.2;
}

.viewer-shell {
  min-height: 720px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #141719;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 248, 234, 0.98), rgba(233, 226, 214, 0.98)),
    var(--cream);
  box-shadow: var(--shadow);
}

.viewer-toolbar {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line-dark);
  background: rgba(255, 248, 234, 0.9);
}

.viewer-status,
.viewer-actions,
.source-link,
.step-button {
  display: inline-flex;
  align-items: center;
}

.viewer-status {
  min-width: 0;
  gap: 10px;
  color: #4e5a5e;
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.viewer-status span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #20b874;
  box-shadow: 0 0 0 6px rgba(32, 184, 116, 0.14);
}

.viewer-actions {
  gap: 8px;
  flex: 0 0 auto;
}

.step-button,
.source-link {
  min-height: 34px;
  justify-content: center;
  color: #17201d;
  font-size: 0.76rem;
  font-weight: 950;
  white-space: nowrap;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.56);
}

.step-button {
  padding: 0 12px;
  cursor: pointer;
}

.source-link {
  padding: 0 13px;
}

.step-button:hover,
.source-link:hover {
  text-decoration: none;
  background: #fff;
}

.model-count {
  min-width: 54px;
  color: #697276;
  font-size: 0.72rem;
  font-weight: 950;
  text-align: center;
}

.workbench {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(250px, 0.32fr) minmax(480px, 1fr);
  flex: 1;
}

.model-picker {
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 16px;
  border-right: 1px solid var(--line-dark);
  background:
    linear-gradient(180deg, rgba(20, 23, 25, 0.06), rgba(20, 23, 25, 0)),
    rgba(255, 255, 255, 0.28);
}

.picker-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.picker-heading .kicker {
  margin: 0;
  color: #8d5f18;
}

h2 {
  margin: 0;
  color: #171c1d;
  font-size: 1.35rem;
  line-height: 1;
  letter-spacing: 0;
}

.model-list {
  min-height: 0;
  display: grid;
  gap: 10px;
  overflow: auto;
  padding-right: 2px;
}

.model-card {
  position: relative;
  min-width: 0;
  min-height: 86px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  grid-template-areas:
    "thumb copy"
    "thumb state";
  gap: 4px 12px;
  align-items: center;
  overflow: hidden;
  padding: 12px;
  color: #17201d;
  text-align: left;
  border: 1px solid rgba(20, 22, 24, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.46);
  cursor: pointer;
}

.model-card:hover,
.model-card:focus-visible {
  border-color: rgba(43, 154, 165, 0.52);
  background: rgba(255, 255, 255, 0.7);
  outline: none;
}

.model-card.is-active {
  border-color: rgba(185, 91, 67, 0.56);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(217, 181, 95, 0.24)),
    #fffdf7;
  box-shadow: 0 14px 30px rgba(30, 24, 17, 0.12);
}

.thumb-mark {
  grid-area: thumb;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.76rem;
  font-weight: 950;
  border-radius: 8px;
  background: linear-gradient(145deg, var(--teal), var(--forest));
}

.model-card:nth-child(2) .thumb-mark {
  background: linear-gradient(145deg, var(--clay), #7a2f22);
}

.model-card:nth-child(3) .thumb-mark {
  background: linear-gradient(145deg, var(--sun), #7b5a20);
}

.model-card:nth-child(4) .thumb-mark {
  background: linear-gradient(145deg, #7b8e82, var(--forest));
}

.model-card:nth-child(5) .thumb-mark {
  background: linear-gradient(145deg, var(--teal), var(--clay));
}

.card-copy {
  grid-area: copy;
  min-width: 0;
  display: block;
}

.card-title,
.card-meta,
.card-state {
  display: block;
  overflow-wrap: anywhere;
}

.card-title {
  color: inherit;
  font-size: 0.96rem;
  font-weight: 950;
  line-height: 1.12;
}

.card-meta {
  margin-top: 5px;
  color: #6b7475;
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1.2;
}

.card-state {
  grid-area: state;
  width: fit-content;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  color: #5f6869;
  font-size: 0.66rem;
  font-weight: 950;
  text-transform: uppercase;
  border: 1px solid rgba(20, 22, 24, 0.12);
  border-radius: 999px;
}

.is-active .card-state {
  color: #fff;
  border-color: rgba(185, 91, 67, 0.7);
  background: var(--clay);
}

.viewer-stack {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.viewer-window {
  position: relative;
  min-height: 0;
  flex: 1;
  padding: 10px;
  background:
    linear-gradient(135deg, rgba(43, 154, 165, 0.16), transparent 34%),
    linear-gradient(315deg, rgba(185, 91, 67, 0.14), transparent 38%),
    #ddd5c5;
}

.viewer-window::before,
.viewer-window::after {
  position: absolute;
  z-index: 2;
  content: "";
  pointer-events: none;
}

.viewer-window::before {
  inset: 10px;
  border: 1px solid rgba(255, 255, 255, 0.46);
}

.viewer-window::after {
  left: 10px;
  right: 10px;
  bottom: 10px;
  height: 18%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.2), transparent);
}

.sketchfab-embed-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  min-height: 610px;
  overflow: hidden;
  background: #202427;
}

.sketchfab-embed-wrapper iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 610px;
  border: 0;
  background: #202427;
}

.credit {
  margin: 0;
  padding: 12px 18px;
  color: #657075;
  font-size: 0.78rem;
  line-height: 1.45;
  border-top: 1px solid var(--line-dark);
  background: var(--cream-2);
}

.credit a {
  color: #137084;
  font-weight: 950;
}

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

  .intro-panel {
    min-height: auto;
  }

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

  .featured-meta div {
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .featured-meta div:last-child {
    border-right: 0;
  }

  .viewer-shell {
    height: min(78vh, 820px);
    min-height: 600px;
  }
}

@media (max-width: 780px) {
  .topbar,
  .atlas {
    width: min(100% - 22px, 700px);
  }

  .topbar {
    min-height: auto;
    padding: 14px 0;
    align-items: flex-start;
    flex-direction: column;
  }

  .topnav {
    width: 100%;
    justify-content: space-between;
  }

  .topnav a {
    flex: 1;
    padding: 0 8px;
    font-size: 0.72rem;
  }

  .atlas {
    gap: 16px;
    padding: 0 0 18px;
  }

  .intro-panel {
    padding: 18px;
  }

  .intro-panel::after {
    right: -12px;
    bottom: -34px;
    font-size: 12rem;
  }

  h1 {
    font-size: clamp(3.1rem, 18vw, 5.1rem);
  }

  .lead {
    margin-top: 20px;
    font-size: 0.94rem;
  }

  .featured-meta {
    grid-template-columns: 1fr;
    margin-top: 24px;
  }

  .featured-meta div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .featured-meta div:last-child {
    border-bottom: 0;
  }

  .viewer-shell {
    height: auto;
    min-height: 0;
  }

  .viewer-toolbar {
    min-height: auto;
    align-items: stretch;
    flex-direction: column;
    padding: 12px;
  }

  .viewer-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto 1fr auto;
  }

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

  .model-picker {
    border-right: 0;
    border-bottom: 1px solid var(--line-dark);
  }

  .model-list {
    grid-auto-flow: column;
    grid-auto-columns: minmax(235px, 74%);
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 0 4px;
  }

  .viewer-window {
    min-height: 58vh;
    padding: 7px;
  }

  .viewer-window::before {
    inset: 7px;
  }

  .viewer-window::after {
    left: 7px;
    right: 7px;
    bottom: 7px;
  }

  .sketchfab-embed-wrapper,
  .sketchfab-embed-wrapper iframe {
    min-height: 360px;
  }

  .credit {
    padding: 10px 12px;
    font-size: 0.68rem;
  }
}

@media (max-width: 460px) {
  .viewer-actions {
    grid-template-columns: 1fr auto 1fr;
  }

  .source-link {
    grid-column: 1 / -1;
  }

  .model-list {
    grid-auto-columns: minmax(220px, 86%);
  }
}
