:root {
  --bg: #f7f7f4;
  --ink: #292928;
  --muted: #85837d;
  --hairline: #dedcd5;
  --panel: #ffffff;
  --focus: #1a5fd0;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --page-gutter: clamp(8px, 3vw, 24px);
  --container-sm: 720px;
  --container-md: 960px;
  --container-lg: 1200px;
  --container-xl: 1480px;
  --sidebar-width: clamp(180px, 16vw, 260px);
  --sidebar: var(--sidebar-width);
  --header-height: 56px;
  --touch-target: 44px;
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-card: 6px;
  --grid-gap-sm: 10px;
  --grid-gap-md: 16px;
  --grid-gap-lg: 24px;
  --z-nav: 40;
  --z-drawer: 100;
  --z-modal: 140;
  --z-toast: 200;
  --gap: 16px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  color: var(--ink);
  background: var(--bg);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.35;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  margin: 0;
}

img {
  display: block;
  max-width: 100%;
}

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

button {
  font: inherit;
}

.responsive-grid {
  --grid-min: 260px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--grid-min)), 1fr));
  gap: var(--grid-gap-md);
}

.stack {
  --stack-gap: var(--space-4);
  display: grid;
  gap: var(--stack-gap);
}

.section-card {
  padding: var(--space-4);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  background: var(--panel);
}

.action-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

.mobile-drawer {
  overflow: auto;
  max-height: 100dvh;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 50;
  padding: 8px 10px;
  color: var(--panel);
  background: var(--ink);
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 10;
  display: flex;
  width: var(--sidebar);
  padding: 24px 20px;
  background: var(--bg);
  flex-direction: column;
  gap: 76px;
}

.sidebar__top {
  display: grid;
  gap: 44px;
}

.brand {
  display: block;
  width: min(160px, 100%);
}

.brand__logo {
  width: 100%;
  height: auto;
}

.info-link {
  display: inline-flex;
  min-height: var(--touch-target);
  width: max-content;
  padding: 0;
  border: 0;
  color: #595751;
  background: transparent;
  cursor: pointer;
  align-items: center;
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  font-weight: 700;
}

.random-artifact {
  display: inline-flex;
  min-height: var(--touch-target);
  width: 100%;
  max-width: none;
  padding: 8px 9px;
  border: 1px solid #11100d;
  color: var(--ink);
  background: #f6efd9;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.8),
    inset 0 -2px 0 rgb(0 0 0 / 0.12),
    1px 1px 0 #11100d;
  cursor: pointer;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: "Courier New", Courier, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.05;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  transition: background-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.random-artifact::before {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  border: 1px solid #11100d;
  border-radius: 50%;
  background: #11100d;
  box-shadow: 0 0 0 2px rgb(17 16 13 / 0.08);
  flex: 0 0 auto;
  animation: chaos-dot 1.35s steps(2, end) infinite;
}

.random-artifact::after {
  content: "\21af";
  display: block;
  flex: 0 0 auto;
  font-size: 13px;
  line-height: 1;
}

.random-artifact:hover {
  background: #fff6dc;
  box-shadow:
    inset 0 2px 0 rgb(255 255 255 / 0.68),
    inset 0 -1px 0 rgb(0 0 0 / 0.2),
    1px 1px 0 #11100d;
  transform: translate(1px, 1px);
}

.random-artifact:active {
  box-shadow:
    inset 0 2px 3px rgb(0 0 0 / 0.18),
    0 0 0 #11100d;
  transform: translate(1px, 1px);
}

@keyframes chaos-dot {
  0%,
  46% {
    opacity: 1;
  }

  47%,
  100% {
    opacity: 0.32;
  }
}

.category-nav {
  display: grid;
  gap: 12px;
}

.nav-label {
  margin-bottom: 2px;
  color: #aaa7a0;
  font-family: "Courier New", Courier, monospace;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.category-link {
  position: relative;
  display: inline-flex;
  min-height: var(--touch-target);
  width: max-content;
  padding-left: 14px;
  align-items: center;
  color: #55534e;
  font-family: "Courier New", Courier, monospace;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
}

.category-link::before {
  position: absolute;
  top: 0.58em;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ebe9e3;
  content: "";
}

.category-link:hover,
.category-link.is-active {
  color: var(--ink);
}

.category-link.is-active::before {
  background: var(--ink);
}

.content {
  width: auto;
  margin-left: var(--sidebar);
  padding: 18px 18px 56px 0;
}

.gallery {
  column-count: 4;
  column-gap: var(--gap);
}

.gallery__item {
  display: inline-block;
  width: 100%;
  margin: 0 0 var(--gap);
  break-inside: avoid;
}

.gallery__button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
}

.gallery__frame {
  position: relative;
  display: block;
  overflow: hidden;
  min-height: 180px;
  background: #e2e0d8;
}

.gallery__frame::after {
  position: absolute;
  inset: 0;
  background: rgb(255 255 255 / 0.08);
  opacity: 0;
  transition: opacity 160ms ease;
  content: "";
}

.gallery__image {
  width: 100%;
  height: auto;
  background: #e2e0d8;
}

.gallery__caption {
  position: absolute;
  right: auto;
  bottom: 10px;
  left: 10px;
  z-index: 1;
  max-width: calc(100% - 20px);
  padding: 4px 6px;
  color: var(--ink);
  background: rgb(255 255 255 / 0.84);
  font-family: "Courier New", Courier, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.2;
  opacity: 0;
  transform: translateY(4px);
  text-transform: uppercase;
  transition: opacity 180ms ease, transform 180ms ease;
}

.visually-hidden {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  margin: -1px;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.gallery__button:hover .gallery__image,
.gallery__button:focus-visible .gallery__image {
  opacity: 0.86;
}

.gallery__button:hover .gallery__frame::after,
.gallery__button:focus-visible .gallery__frame::after,
.gallery__button:hover .gallery__caption,
.gallery__button:focus-visible .gallery__caption {
  opacity: 1;
  transform: translateY(0);
}

.info-drawer[hidden] {
  display: none;
}

.info-drawer {
  position: fixed;
  inset: 0;
  z-index: 90;
}

.info-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgb(247 247 244 / 0.62);
}

.info-panel {
  position: fixed;
  top: 24px;
  left: calc(var(--sidebar) + 18px);
  z-index: 1;
  overflow: auto;
  max-width: 520px;
  max-height: calc(100vh - 48px);
  padding: 18px 18px 20px;
  border: 1px solid var(--hairline);
  color: var(--ink);
  background: rgb(255 255 255 / 0.94);
  box-shadow: 0 18px 60px rgb(0 0 0 / 0.08);
  font-family: "Courier New", Courier, monospace;
}

.info-panel h1 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.info-panel__kicker {
  margin: 0 0 18px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.info-panel p {
  margin: 0 0 12px;
  color: #5c5a54;
  font-size: 13px;
}

.info-panel p:last-of-type {
  margin-bottom: 0;
}

.info-panel__note {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--hairline);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.info-panel__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: var(--touch-target);
  height: var(--touch-target);
  padding: 0;
  border: 1px solid var(--hairline);
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 18px;
  line-height: 1;
}

.lightbox[hidden] {
  display: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  color: var(--panel);
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgb(14 14 13 / 0.88);
}

.lightbox__dialog {
  position: relative;
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(34px, 4vw, 42px) clamp(18px, 5vw, 76px);
  grid-template-columns: minmax(44px, 72px) minmax(0, 1fr) minmax(44px, 72px);
  align-items: center;
  gap: 20px;
}

.lightbox__stage {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  align-items: center;
  gap: 18px;
}

.lightbox__figure {
  display: grid;
  min-width: 0;
  max-height: calc(100vh - 84px);
  margin: 0;
  justify-items: center;
  gap: 12px;
}

.lightbox__figure img {
  max-width: 100%;
  max-height: calc(100vh - 132px);
  object-fit: contain;
  box-shadow: 0 16px 52px rgb(0 0 0 / 0.32);
}

.lightbox__figure figcaption {
  max-width: 720px;
  color: #f1f0ea;
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
}

.lightbox__button {
  min-width: 0;
  min-height: var(--touch-target);
  padding: 10px 12px;
  border: 1px solid rgb(255 255 255 / 0.34);
  color: var(--panel);
  background: rgb(0 0 0 / 0.18);
  cursor: pointer;
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.lightbox__button:hover {
  background: rgb(255 255 255 / 0.14);
}

.lightbox__button--close {
  position: absolute;
  top: 18px;
  right: 18px;
}

.artifact-panel {
  overflow: auto;
  width: 100%;
  max-height: calc(100vh - 132px);
  padding: 14px;
  border: 1px solid #c9c6bc;
  color: #252522;
  background: #f4f2ea;
  box-shadow: 0 12px 34px rgb(0 0 0 / 0.22);
  font-family: "Courier New", Courier, monospace;
}

.artifact-record__eyebrow {
  margin: 0 0 8px;
  color: #77736a;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.artifact-panel h2 {
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #d7d3c8;
  font-size: 16px;
  line-height: 1.1;
  text-transform: uppercase;
}

.artifact-record {
  display: grid;
  margin: 0;
  gap: 10px;
}

.artifact-record__field {
  display: grid;
  padding-bottom: 10px;
  border-bottom: 1px solid #d7d3c8;
  gap: 4px;
}

.artifact-record__field dt {
  color: #77736a;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.artifact-record__field dd {
  margin: 0;
  color: #292928;
  font-size: 12px;
  line-height: 1.4;
}

.artifact-related {
  margin-top: 14px;
}

.artifact-related h3 {
  margin: 0 0 8px;
  color: #77736a;
  font-size: 10px;
  text-transform: uppercase;
}

.artifact-related__list {
  display: grid;
  gap: 7px;
}

.artifact-related__button {
  display: grid;
  width: 100%;
  min-height: 42px;
  padding: 6px;
  border: 1px solid #d0ccc0;
  color: #292928;
  background: transparent;
  cursor: pointer;
  font-family: "Courier New", Courier, monospace;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-align: left;
  text-transform: uppercase;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.artifact-related__button:hover {
  background: #e7e4d9;
}

.artifact-related__button img {
  width: 34px;
  height: 34px;
  object-fit: cover;
  background: #dedbd0;
}

@media (max-width: 1500px) {
  .gallery {
    column-count: 3;
  }
}

@media (max-width: 1050px) {
  .gallery {
    column-count: 2;
  }
}

@media (min-width: 701px) and (max-width: 900px) {
  .sidebar {
    gap: 58px;
  }

  .brand {
    width: 150px;
  }

  .category-link {
    font-size: 14px;
  }
}

@media (max-width: 1023px) {
  .site-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    display: block;
    width: 100%;
    min-height: 0;
    padding: 18px 14px 0;
    border-bottom: 0;
    gap: 0;
  }

  .sidebar__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
  }

  .brand {
    width: 142px;
    max-width: 48vw;
  }

  .category-nav {
    display: flex;
    overflow-x: auto;
    margin: 18px -14px 0;
    padding: 0 14px 12px;
    border-bottom: 1px solid rgb(0 0 0 / 0.12);
    gap: 14px;
    scrollbar-width: none;
  }

  .category-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-label {
    display: none;
  }

  .category-link {
    flex: 0 0 auto;
    padding-left: 10px;
    font-size: 12px;
    letter-spacing: 0.04em;
    white-space: nowrap;
  }

  .content {
    width: 100%;
    margin-left: 0;
    padding: 14px 8px 40px;
  }

  .info-panel {
    right: 14px;
    left: 14px;
    max-width: none;
  }
}

@media (max-width: 700px) {
  :root {
    --gap: 22px;
  }

  .site-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    display: block;
    width: 100%;
    min-height: 0;
    padding: 18px 14px 0;
    border-bottom: 0;
    gap: 0;
  }

  .sidebar__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
  }

  .brand {
    width: 142px;
    max-width: 48vw;
  }

  .category-nav {
    display: flex;
    overflow-x: auto;
    margin: 18px -14px 0;
    padding: 0 14px 12px;
    border-bottom: 1px solid rgb(0 0 0 / 0.12);
    gap: 14px;
    scrollbar-width: none;
  }

  .category-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-label {
    display: none;
  }

  .category-link {
    flex: 0 0 auto;
    padding-left: 10px;
    font-size: 12px;
    letter-spacing: 0.04em;
    white-space: nowrap;
  }

  .content {
    width: 100%;
    margin-left: 0;
    padding: 14px 8px 40px;
  }

  .gallery {
    display: block;
    column-count: 1;
  }

  .gallery__item {
    margin-bottom: var(--gap);
  }

  .gallery__frame {
    overflow: visible;
    min-height: 0;
    background: transparent;
  }

  .gallery__frame::after {
    display: none;
  }

  .gallery__button:hover .gallery__image,
  .gallery__button:focus-visible .gallery__image {
    opacity: 1;
  }

  .gallery__caption {
    position: static;
    display: block;
    max-width: none;
    padding: 8px 10px 0;
    color: var(--ink);
    background: transparent;
    font-size: 11px;
    line-height: 1.35;
    letter-spacing: 0.04em;
    opacity: 1;
    transform: none;
  }

  .info-panel {
    top: 82px;
    right: 14px;
    left: 14px;
    max-width: none;
  }

  .lightbox__dialog {
    padding: 56px 12px 22px;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "stage stage"
      "prev next";
    align-items: start;
    gap: 10px;
  }

  .lightbox__stage {
    overflow: auto;
    max-height: calc(100vh - 122px);
    grid-area: stage;
    grid-template-columns: 1fr;
    align-items: start;
  }

  .lightbox__figure {
    max-height: none;
    grid-area: auto;
  }

  .lightbox__figure img {
    max-height: 62vh;
  }

  .artifact-panel {
    max-height: none;
  }

  .lightbox__button--prev {
    grid-area: prev;
  }

  .lightbox__button--next {
    grid-area: next;
  }
}

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

/* --- Operator Log Entry Badge --- */
/* A tiny system-status link pinned to the sidebar base. */
.op-status-badge {
  display: block;
  margin-top: auto;
  color: #5e5c57;
  font-family: "Courier New", Courier, monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 200ms ease;
  cursor: pointer;
  line-height: 1;
}

.op-status-badge::before {
  content: "? ";
  color: #3a3935;
  font-size: 7px;
  transition: color 200ms ease;
}

.op-status-badge:hover {
  color: #b89f00;
  text-decoration: none;
}

.op-status-badge:hover::before {
  color: #b89f00;
}

@media (max-width: 700px) {
  .op-status-badge {
    display: none;
  }
}

/* --- Global Coming Soon Popup --- */
.coming-soon-popup[hidden] {
  display: none;
}

.coming-soon-popup {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: grid;
  padding: 18px;
  background: rgb(17 16 14 / 0.18);
  place-items: center;
}

.coming-soon-popup__card {
  position: relative;
  display: grid;
  overflow: hidden;
  width: min(760px, 100%);
  min-height: 370px;
  border: 2px solid #11100e;
  color: #11100e;
  background: #f8f4ea;
  box-shadow: 0 20px 50px rgb(0 0 0 / 0.18);
  grid-template-columns: minmax(190px, 270px) minmax(0, 1fr);
  align-items: end;
}

.coming-soon-popup__image {
  width: 100%;
  height: 100%;
  max-height: 370px;
  object-fit: contain;
  object-position: bottom center;
  align-self: end;
}

.coming-soon-popup__body {
  position: relative;
  min-width: 0;
  padding: 50px 46px 42px 36px;
  align-self: stretch;
}

.coming-soon-popup__close {
  position: absolute;
  top: 16px;
  right: 14px;
  width: var(--touch-target);
  height: var(--touch-target);
  padding: 0;
  border: 0;
  color: #11100e;
  background: #ffd43c;
  cursor: pointer;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1;
  text-align: center;
}

.coming-soon-popup__logo {
  display: block;
  width: min(250px, 100%);
  height: auto;
  margin: 0 0 20px;
}

.coming-soon-popup h2 {
  margin: 0 0 30px;
  font-family: "Courier New", Courier, monospace;
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
}

.coming-soon-popup__copy {
  max-width: 440px;
  margin: 0;
  font-family: "Courier New", Courier, monospace;
  font-size: clamp(18px, 2.7vw, 24px);
  line-height: 1.36;
}

.coming-soon-popup__copy a {
  text-decoration: underline;
  text-underline-offset: 4px;
}

@media (max-width: 700px) {
  .coming-soon-popup {
    padding: 12px;
  }

  .coming-soon-popup__card {
    min-height: 0;
    grid-template-columns: 1fr;
  }

  .coming-soon-popup__image {
    max-height: 240px;
    object-position: bottom left;
  }

  .coming-soon-popup__body {
    padding: 18px 18px 24px;
  }

  .coming-soon-popup__logo {
    margin-bottom: 14px;
  }

  .coming-soon-popup h2 {
    margin-bottom: 18px;
  }
}


/* --- Junk Drawer Sidebar Module --- */
.junk-drawer-module {
  display: block;
  margin-top: 18px;
  position: relative;
  background: #eceadd;
  border: 1px solid #d4d1c4;
  padding: 12px 10px;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-shadow: 0 4px 0 #d4d1c4, inset 0 1px 2px rgba(255,255,255,0.6);
  border-radius: 2px;
}

.junk-drawer-module:hover {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #c2bfae, inset 0 1px 2px rgba(255,255,255,0.8);
  background: #f1f0e6;
}

.junk-drawer-module:active {
  transform: translateY(4px);
  box-shadow: 0 0 0 transparent;
}

.junk-drawer-module__face {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.junk-drawer-module__handle {
  width: 28px;
  height: 5px;
  background: #d4d1c4;
  border-radius: 3px;
  box-shadow: inset 0 -1px 1px rgba(0,0,0,0.1);
}

.junk-drawer-module__label {
  font-family: "Courier New", Courier, monospace;
  font-size: 11px;
  font-weight: 700;
  color: #6d6b63;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: color 0.2s;
}

.junk-drawer-module:hover .junk-drawer-module__label {
  color: var(--ink);
}

.junk-drawer-module.is-active .junk-drawer-module__label {
  color: var(--ink);
}

.junk-drawer-header {
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--hairline);
}

.junk-drawer-header h1 {
  margin: 0 0 12px;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0;
}

.junk-drawer-header p {
  max-width: 600px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

.tools-grid {
  display: grid;
  margin-top: 32px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 20px;
}

.tool-card {
  display: block;
  padding: 24px;
  border: 1px solid var(--hairline);
  color: inherit;
  background: var(--panel);
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgb(0 0 0 / 0.06);
}

.tool-card__main {
  display: grid;
  color: inherit;
  text-decoration: none;
  gap: 10px;
}

.tool-card__logo {
  width: 112px;
  height: 112px;
  margin-bottom: 6px;
  border: 1px solid #11100d;
  background: #000;
  object-fit: cover;
}

.tool-card h2 {
  margin: 0 0 8px;
  color: var(--ink);
  font-family: "Courier New", Courier, monospace;
  font-size: 16px;
  text-transform: uppercase;
}

.tool-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.tool-card p.tool-card__credit {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--hairline);
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.tool-card__credit a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 700px) {
  .junk-drawer-module {
    margin-top: 0;
    margin-left: 14px;
    padding: 8px 12px;
    box-shadow: 0 3px 0 #d4d1c4;
    flex-shrink: 0;
  }
  .junk-drawer-module:hover {
    transform: translateY(1px);
    box-shadow: 0 2px 0 #c2bfae;
  }
  .junk-drawer-module:active {
    transform: translateY(3px);
    box-shadow: 0 0 0 transparent;
  }
  .junk-drawer-module__handle {
    display: none;
  }
}

.mobile-menu-toggle,
.mobile-category-toggle,
.mobile-nav-sheet {
  display: none;
}

@media (max-width: 700px) {
  body.mobile-nav-open {
    overflow: hidden;
  }

  .sidebar {
    z-index: var(--z-nav);
    padding: 10px 12px 0;
    border-bottom: 1px solid rgb(0 0 0 / 0.12);
    background: rgb(247 247 244 / 0.97);
    box-shadow: 0 8px 24px rgb(0 0 0 / 0.04);
  }

  .sidebar__top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--touch-target);
    align-items: center;
    gap: 8px;
  }

  .brand {
    grid-column: 1;
    grid-row: 1;
    width: 138px;
    max-width: 58vw;
  }

  .mobile-menu-toggle {
    display: grid;
    grid-column: 2;
    grid-row: 1;
    width: var(--touch-target);
    height: var(--touch-target);
    padding: 0;
    border: 1px solid #c9c6bc;
    color: var(--ink);
    background: #f1f0ea;
    cursor: pointer;
    place-items: center;
    font-family: "Courier New", Courier, monospace;
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
  }

  .sidebar__top > .info-link {
    display: none;
  }

  .sidebar__top > .random-artifact {
    width: 100%;
    max-width: none;
    min-height: var(--touch-target);
    grid-column: 1 / -1;
    justify-content: space-between;
    text-align: center;
  }

  .mobile-category-toggle {
    display: flex;
    width: 100%;
    min-height: var(--touch-target);
    margin-top: 8px;
    padding: 0 10px;
    border: 0;
    border-top: 1px solid rgb(0 0 0 / 0.1);
    border-bottom: 1px solid rgb(0 0 0 / 0.14);
    color: var(--ink);
    background: transparent;
    cursor: pointer;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-family: "Courier New", Courier, monospace;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .mobile-category-toggle span:first-child {
    overflow: hidden;
    min-width: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sidebar > .category-nav,
  .sidebar > .junk-drawer-module {
    display: none;
  }

  .sidebar.is-mobile-compact {
    padding: 6px 10px;
  }

  .sidebar.is-mobile-compact .sidebar__top {
    min-height: var(--touch-target);
  }

  .sidebar.is-mobile-compact .brand {
    width: 112px;
    max-width: 34vw;
  }

  .sidebar.is-mobile-compact .sidebar__top > .random-artifact {
    display: none;
  }

  .sidebar.is-mobile-compact .mobile-category-toggle {
    position: absolute;
    top: 6px;
    right: 60px;
    width: min(132px, 38vw);
    margin-top: 0;
    border: 1px solid #c9c6bc;
    background: #f1f0ea;
    font-size: 11px;
  }

  .mobile-nav-sheet[hidden] {
    display: none;
  }

  .mobile-nav-sheet {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: block;
  }

  .mobile-nav-sheet__backdrop {
    position: absolute;
    inset: 0;
    background: rgb(17 16 14 / 0.34);
  }

  .mobile-nav-sheet__panel {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    max-height: min(86dvh, 620px);
    padding: 14px;
    border-top: 1px solid #c9c6bc;
    background: #f7f7f4;
    box-shadow: 0 -18px 48px rgb(0 0 0 / 0.14);
    gap: 14px;
    font-family: "Courier New", Courier, monospace;
  }

  .mobile-nav-sheet__head {
    display: flex;
    min-height: var(--touch-target);
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #55534e;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .mobile-nav-sheet__close {
    width: var(--touch-target);
    height: var(--touch-target);
    border: 1px solid #c9c6bc;
    color: var(--ink);
    background: #f1f0ea;
    cursor: pointer;
    font-weight: 700;
  }

  .mobile-nav-sheet__actions,
  .mobile-nav-sheet__categories {
    display: grid;
    gap: 8px;
  }

  .mobile-nav-sheet__actions {
    padding-bottom: 12px;
    border-bottom: 1px solid rgb(0 0 0 / 0.1);
  }

  .mobile-nav-sheet__action,
  .mobile-nav-sheet__category {
    display: flex;
    width: 100%;
    max-width: none;
    min-height: var(--touch-target);
    padding: 0 12px;
    border: 1px solid #d4d1c4;
    color: var(--ink);
    background: #f1f0ea;
    cursor: pointer;
    align-items: center;
    justify-content: space-between;
    font-family: "Courier New", Courier, monospace;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-align: left;
    text-transform: uppercase;
  }

  .mobile-nav-sheet__category.is-active,
  .mobile-nav-sheet__category[aria-current] {
    border-color: var(--ink);
    background: var(--ink);
    color: var(--panel);
  }

  .mobile-nav-sheet__category::before {
    display: none;
  }
}

/* ═══════════════════════════════════════════════════════════════
   Gallery Transitions
   Two focused effects: click feedback on the grid, and a smooth
   entrance animation when the lightbox opens or navigates.
   ═══════════════════════════════════════════════════════════════ */

/* ── 1. Gallery click feedback ──────────────────────────────── */
/*    The whole grid dims; the clicked card stays bright.        */

.gallery--flash .gallery__item {
  transition: opacity 80ms ease, filter 80ms ease;
}

.gallery--flash .gallery__item:not(.gallery__item--flash-target) {
  opacity: 0.18;
  filter: blur(0.5px);
}

.gallery__item--flash-target .gallery__frame {
  /* brief brightness flare on the selected card */
  filter: brightness(1.12);
  transition: filter 80ms ease;
}

/* ── 2. Lightbox entrance — first open ──────────────────────── */
/*    Image rises and scales in; artifact panel slides from right */

.lb-img--entering {
  animation: lmtd-img-in 420ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.lb-panel--entering {
  animation: lmtd-panel-in 380ms 130ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes lmtd-img-in {
  from {
    opacity: 0;
    transform: scale(0.93) translateY(14px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes lmtd-panel-in {
  from {
    opacity: 0;
    transform: translateX(22px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ── 3. Lightbox navigation — prev / next ───────────────────── */
/*    Lighter cross-fade + micro-shift instead of the full scale  */

.lb-img--navigating {
  animation: lmtd-img-nav 260ms cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.lb-panel--navigating {
  animation: lmtd-panel-nav 220ms 60ms cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

@keyframes lmtd-img-nav {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes lmtd-panel-nav {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Reduced motion: skip all of the above ──────────────────── */
@media (prefers-reduced-motion: reduce) {
  .lb-img--entering,
  .lb-panel--entering,
  .lb-img--navigating,
  .lb-panel--navigating {
    animation: none;
  }
}


