:root {
  --bg: #090b0f;
  --panel: #10141a;
  --panel-raised: #171c23;
  --line: #29303a;
  --line-soft: #1c222b;
  --ink: #f2f1eb;
  --muted: #8f98a5;
  --orange: #ff5b36;
  --orange-pale: #ffb29e;
  --acid: #c7f36a;
  --mono: "DM Mono", monospace;
  --display: "Fraunces", serif;
  --max: 1500px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 92% 3%, rgba(255, 91, 54, 0.13), transparent 27rem),
    radial-gradient(circle at 8% 45%, rgba(199, 243, 106, 0.05), transparent 32rem),
    var(--bg);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.6;
}

body.modal-open {
  overflow: hidden;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.noise {
  position: fixed;
  z-index: 10;
  inset: 0;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
}

.site-header {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(calc(100% - 48px), var(--max));
  margin: 0 auto;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  color: var(--bg);
  background: var(--orange);
  font-weight: 500;
  letter-spacing: -0.08em;
}

.brand-copy {
  display: grid;
  line-height: 1.25;
}

.brand-copy strong {
  font-family: var(--display);
  font-size: 18px;
}

.brand-copy small {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 30px;
}

.header-nav a {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 160ms ease;
}

.header-nav a:hover {
  color: var(--ink);
}

.header-nav .source-link {
  color: var(--orange-pale);
}

main {
  width: min(calc(100% - 48px), var(--max));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.5fr);
  gap: clamp(50px, 9vw, 150px);
  min-height: 650px;
  padding: clamp(90px, 13vh, 150px) 0 100px;
  align-items: end;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 9px;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 0 5px rgba(199, 243, 106, 0.08);
}

.hero h1,
.catalogue-heading h2,
.standards h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.055em;
  line-height: 0.92;
}

.hero h1 {
  max-width: 900px;
  font-size: clamp(64px, 10.5vw, 164px);
}

.hero h1 em {
  color: var(--orange);
  font-weight: 600;
}

.hero-summary {
  max-width: 660px;
  margin: 34px 0 0;
  color: #b8bec7;
  font-size: clamp(15px, 1.5vw, 19px);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 40px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-decoration: none;
  text-transform: uppercase;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.button:hover {
  transform: translateY(-2px);
  border-color: #566171;
}

.button-primary {
  border-color: var(--orange);
  color: #090b0f;
  background: var(--orange);
}

.button-primary:hover {
  border-color: #ff795c;
  background: #ff795c;
}

.button-quiet {
  background: rgba(255, 255, 255, 0.025);
}

.hero-index {
  border-top: 1px solid var(--line);
}

.index-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 19px 0;
  border-bottom: 1px solid var(--line-soft);
}

.index-row span {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.index-row strong {
  color: var(--ink);
  font-size: 17px;
  font-weight: 400;
  text-align: right;
}

.catalogue-shell {
  padding: 100px 0 120px;
  border-top: 1px solid var(--line);
}

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

.catalogue-heading h2,
.standards h2 {
  font-size: clamp(52px, 7vw, 100px);
}

#result-count {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) repeat(3, minmax(150px, 0.75fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--line);
}

.filter-bar label {
  position: relative;
  display: grid;
  gap: 7px;
  padding: 14px 16px 12px;
  background: var(--panel);
}

.filter-bar label > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.filter-bar input,
.filter-bar select {
  width: 100%;
  min-width: 0;
  padding: 0 32px 0 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.filter-bar select {
  padding-right: 0;
}

.filter-bar option {
  color: var(--ink);
  background: var(--panel-raised);
}

.search-field kbd {
  position: absolute;
  right: 16px;
  bottom: 13px;
  min-width: 24px;
  padding: 1px 5px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--panel-raised);
  font-family: var(--mono);
  font-size: 10px;
  text-align: center;
}

.active-filter-row {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.filter-chip {
  padding: 5px 8px;
  border: 1px solid var(--line);
  color: var(--orange-pale);
  background: rgba(255, 91, 54, 0.04);
  font-size: 10px;
}

.text-button {
  padding: 5px 0;
  border: 0;
  color: var(--muted);
  background: none;
  cursor: pointer;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.text-button:hover {
  color: var(--ink);
}

.catalogue-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}

.model-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: var(--panel);
  cursor: pointer;
  animation: card-in 420ms both;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}

.model-card:hover .card-cover img {
  transform: scale(1.035);
}

.model-card:hover .card-arrow {
  color: var(--orange);
  transform: translate(3px, -3px);
}

.card-cover {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 91, 54, 0.22), transparent 55%),
    linear-gradient(315deg, rgba(199, 243, 106, 0.08), transparent 48%),
    #191f27;
}

.card-cover::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(to top, rgba(9, 11, 15, 0.7), transparent 45%);
  pointer-events: none;
}

.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.cover-fallback {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: rgba(242, 241, 235, 0.12);
  font-family: var(--display);
  font-size: 90px;
}

.card-index {
  position: absolute;
  z-index: 2;
  top: 14px;
  left: 14px;
  padding: 4px 7px;
  color: #d9dde2;
  background: rgba(9, 11, 15, 0.72);
  backdrop-filter: blur(12px);
  font-size: 9px;
}

.card-format {
  position: absolute;
  z-index: 2;
  right: 14px;
  bottom: 14px;
  color: var(--acid);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.card-body {
  min-height: 160px;
  padding: 20px;
}

.card-creator {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.card-title-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.card-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(21px, 2vw, 29px);
  line-height: 1.05;
}

.card-arrow {
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  transition: color 160ms ease, transform 160ms ease;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 13px;
  margin-top: 19px;
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}

.empty-state {
  padding: 100px 20px;
  border: 1px solid var(--line);
  text-align: center;
}

.empty-state > span {
  color: var(--orange);
  font-size: 11px;
}

.empty-state h3 {
  margin: 14px 0 4px;
  font-family: var(--display);
  font-size: 36px;
}

.empty-state p {
  margin: 0 0 24px;
  color: var(--muted);
}

.standards {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(50px, 10vw, 160px);
  padding: 120px 0;
  border-top: 1px solid var(--line);
}

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

.standards-grid article {
  min-height: 220px;
  padding: 28px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.standards-grid article:nth-child(even) {
  border-right: 1px solid var(--line);
}

.standards-grid article:nth-last-child(-n + 2) {
  border-bottom: 1px solid var(--line);
}

.standards-grid span {
  color: var(--orange);
  font-size: 10px;
}

.standards-grid h3 {
  margin: 48px 0 8px;
  font-family: var(--display);
  font-size: 23px;
}

.standards-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.site-footer {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 40px;
  width: min(calc(100% - 48px), var(--max));
  margin: 0 auto;
  padding: 46px 0 30px;
  border-top: 1px solid var(--line);
}

.site-footer strong {
  font-family: var(--display);
  font-size: 20px;
}

.site-footer p {
  max-width: 620px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.footer-links {
  display: flex;
  justify-content: end;
  gap: 24px;
}

.footer-links a {
  color: var(--muted);
  font-size: 10px;
  text-decoration: none;
  text-transform: uppercase;
}

.footer-links a:hover {
  color: var(--ink);
}

.footer-legal {
  grid-column: 1 / -1;
  padding-top: 22px;
  border-top: 1px solid var(--line-soft);
}

.model-dialog {
  width: min(1120px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--panel);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.7);
}

.model-dialog::backdrop {
  background: rgba(3, 4, 6, 0.86);
  backdrop-filter: blur(8px);
}

.dialog-close {
  position: sticky;
  z-index: 5;
  top: 14px;
  float: right;
  width: 42px;
  height: 42px;
  margin: 14px 14px -56px 0;
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(9, 11, 15, 0.86);
  cursor: pointer;
  font-size: 24px;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(0, 1.18fr);
}

.detail-cover {
  min-height: 700px;
  background:
    linear-gradient(135deg, rgba(255, 91, 54, 0.2), transparent),
    #191f27;
}

.detail-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-copy {
  padding: clamp(44px, 7vw, 90px) clamp(30px, 6vw, 75px);
}

.detail-copy h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(46px, 6vw, 82px);
  line-height: 0.96;
  letter-spacing: -0.04em;
}

.detail-byline {
  margin: 16px 0 30px;
  color: var(--orange-pale);
  font-size: 11px;
  text-transform: uppercase;
}

.detail-description {
  color: #b4bbc5;
  white-space: pre-line;
}

.detail-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin: 34px 0;
  background: var(--line);
}

.detail-fact {
  min-width: 0;
  padding: 14px;
  background: var(--panel-raised);
}

.detail-fact span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.detail-fact strong,
.detail-fact a {
  overflow-wrap: anywhere;
  font-size: 11px;
  font-weight: 400;
}

.detail-files {
  margin-top: 38px;
}

.viewer-section {
  margin-top: 38px;
}

.viewer-section h3 {
  font-family: var(--display);
  font-size: 27px;
}

.model-viewer {
  width: 100%;
  height: min(58vh, 520px);
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 35%, #313943, #13171d 68%);
  --poster-color: transparent;
  --progress-bar-color: var(--orange);
}

.detail-files h3 {
  font-family: var(--display);
  font-size: 27px;
}

.download-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  padding: 17px 0;
  border-top: 1px solid var(--line);
  align-items: center;
}

.download-name {
  overflow-wrap: anywhere;
}

.download-name strong {
  display: block;
  font-size: 11px;
}

.download-name small {
  color: var(--muted);
  font-size: 9px;
}

.download-button {
  padding: 8px 11px;
  border: 1px solid var(--orange);
  color: var(--orange-pale);
  font-size: 9px;
  text-decoration: none;
  text-transform: uppercase;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 30px;
}

.tag-list span {
  padding: 5px 8px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
}

.age-gate {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  padding: 22px;
  place-items: center;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 91, 54, 0.18), transparent 28rem),
    rgba(5, 6, 9, 0.97);
}

.age-gate[hidden] {
  display: none;
}

.age-panel {
  width: min(560px, 100%);
  padding: clamp(30px, 6vw, 64px);
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 20px 20px 0 rgba(255, 91, 54, 0.08);
}

.age-number {
  display: block;
  margin-bottom: 50px;
  color: var(--orange);
  font-family: var(--display);
  font-size: 68px;
  line-height: 1;
}

.age-panel h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 54px;
  line-height: 1;
}

.age-panel > p:not(.eyebrow) {
  margin: 22px 0 30px;
  color: #b7bec8;
}

.age-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.age-panel small {
  display: block;
  margin-top: 20px;
  color: var(--muted);
  font-size: 9px;
}

.noscript {
  position: fixed;
  z-index: 200;
  inset: 20px;
  display: grid;
  place-items: center;
  border: 1px solid var(--orange);
  color: var(--ink);
  background: var(--bg);
}

@media (max-width: 1080px) {
  .catalogue-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .filter-bar {
    grid-template-columns: 1.5fr 1fr;
  }

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

@media (max-width: 760px) {
  .site-header,
  main,
  .site-footer {
    width: min(calc(100% - 28px), var(--max));
  }

  .site-header {
    padding: 18px 0;
  }

  .header-nav a:not(.source-link) {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 90px 0 70px;
  }

  .hero h1 {
    font-size: clamp(58px, 21vw, 100px);
  }

  .catalogue-shell {
    padding: 74px 0 90px;
  }

  .catalogue-heading {
    align-items: start;
    flex-direction: column;
  }

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

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

  .card-body {
    min-height: 148px;
    padding: 15px;
  }

  .card-title {
    font-size: 21px;
  }

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

  .detail-cover {
    min-height: 0;
    aspect-ratio: 4 / 3;
  }

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

  .standards-grid article {
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .standards-grid article:last-child {
    border-bottom: 1px solid var(--line);
  }

  .footer-links {
    justify-content: start;
  }
}

@media (max-width: 480px) {
  .brand-copy small {
    display: none;
  }

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

  .card-cover {
    aspect-ratio: 16 / 11;
  }

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

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

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