.theme-dumby { --tone: #a43922; --poster: #edd0bb; --poster-ink: #78341e; --poster-line: #a4392220; }
.theme-page {
  --cyan: #21c6e5;
  --magenta: #ef529c;
  --yellow: #ffd53f;
  --black: #19171c;
  --tone: #00677d;
  --poster: var(--black);
  --poster-ink: #fdfbf6;
  --poster-line: #ffffff26;
  --process-inks: linear-gradient(90deg, var(--cyan) 0 25%, var(--magenta) 25% 50%, var(--yellow) 50% 75%, var(--black) 75%);
}
.theme-metro { --tone: #006475; --poster: #07171b; --poster-ink: #5eebff; --poster-line: #5eebff25; }
.theme-skein { --tone: #0f4fc4; --poster: #f2e6ca; --poster-ink: #233d76; --poster-line: #0f4fc424; }
.theme-plumb { --tone: #086d61; --poster: #0a192f; --poster-ink: #64ffda; --poster-line: #64ffda30; }
.theme-flow { --tone: #5b3687; --poster: #e8dff0; --poster-ink: #52317b; --poster-line: #7243a726; }

.meta { font-family: ui-monospace, Consolas, monospace; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; }
.catalog-intro { padding-block: clamp(3rem, 7vw, 6rem) clamp(2.3rem, 5vw, 4.1rem); }
.catalog-intro h1 { font-size: clamp(2.9rem, 7.1vw, 6.7rem); text-wrap: initial; }
.catalog-intro .intro { max-width: 51ch; margin-bottom: 0; }
.catalog { padding-bottom: 2.35rem; }
.catalog-bar { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 1.15rem 0; border-top: 1px solid var(--line); }
.catalog-bar h2 { font-size: clamp(1.55rem, 3vw, 2.15rem); letter-spacing: -0.045em; }
.catalog-bar .meta { color: var(--muted); white-space: nowrap; }
.catalog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.app-card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 0.65rem; background: #fffcf5; text-decoration: none; transition: border-color 160ms, box-shadow 160ms; }
.app-card:hover { border-color: var(--tone); box-shadow: 0 4px 0 color-mix(in srgb, var(--tone) 16%, transparent); }
.card-art, .app-visual { position: relative; overflow: hidden; background-color: var(--poster); color: var(--poster-ink); }
.card-art { display: grid; place-items: center; min-height: 10rem; padding: 2.5rem 1rem 1.5rem; border-bottom: 1px solid var(--line); }
.card-art .meta { position: absolute; inset: 0.85rem auto auto 1rem; }
.card-art img { display: block; width: 4.8rem; height: 4.8rem; border: 1px solid var(--poster-line); border-radius: 24%; box-shadow: 0 0.22rem 0.65rem #0001; }
.theme-plumb .card-art, .theme-plumb .app-visual, .theme-flow .app-visual {
  background-image: linear-gradient(var(--poster-line) 1px, transparent 1px), linear-gradient(90deg, var(--poster-line) 1px, transparent 1px);
  background-size: 1.65rem 1.65rem;
}
.theme-dumby .card-art, .theme-flow .card-art, .theme-metro .card-art {
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}
.theme-dumby .card-art { background-image: url("/assets/patterns/dumby-plates.svg"); }
.theme-skein .card-art, .theme-skein .app-visual {
  background-image: url("/assets/patterns/skeinvault-weave.svg");
  background-position: center;
  background-size: 5.5rem;
}
.app-card.theme-flow { --tone: #4128bf; --poster: #ece4f3; --poster-ink: #2d1938; --poster-line: #5738e52b; }
.theme-flow .card-art { background-image: url("/assets/patterns/clearflow-waves.svg"); }
.theme-metro .card-art {
  background-image: url("/assets/patterns/metrognome-metronome.svg"),
    linear-gradient(155deg, transparent 68%, #79502d 68% 68.3%, #271609 68.3%);
}
.theme-page .card-art, .theme-page .app-visual { background-image: repeating-linear-gradient(0deg, transparent 0 1.6rem, var(--poster-line) 1.6rem calc(1.6rem + 1px)); }
.theme-page .app-visual::after {
  content: "";
  position: absolute;
  right: 1rem;
  bottom: 0.9rem;
  width: 4rem;
  height: 0.45rem;
  border: 1px solid #ffffff70;
  background: var(--process-inks);
  pointer-events: none;
}
.page-crop-frame {
  position: absolute;
  top: calc(50% + 0.5rem);
  left: 50%;
  width: 9.5rem;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.page-crop-cyan { stroke: var(--cyan); }
.page-crop-magenta { stroke: var(--magenta); }
.page-crop-yellow { stroke: var(--yellow); }
.page-crop-outline { stroke: var(--poster-ink); stroke-width: 6; }
.page-crop-black { stroke: var(--black); }
.theme-metro .app-visual {
  background-image: repeating-linear-gradient(90deg, transparent 0 2rem, var(--poster-line) 2rem calc(2rem + 1px)),
    linear-gradient(155deg, transparent 0 var(--woodshop-split, 68%), #79502d var(--woodshop-split, 68%) calc(var(--woodshop-split, 68%) + 0.3%), #271609 0);
}
.card-copy { position: relative; flex: 1; padding: 1.15rem 3rem 1.2rem 1.05rem; }
.card-copy h3 { font-size: 1.45rem; }
.card-copy p { margin: 0.4rem 0 0; color: var(--muted); font-size: 0.95rem; line-height: 1.5; }
.card-arrow { position: absolute; top: 1.1rem; right: 1.05rem; color: var(--tone); font-size: 1.4rem; line-height: 1; }

.app-page { color: var(--ink); background: var(--paper); }
.app-page.theme-page { --paper: #f4f1ea; --ink: var(--black); --muted: #59535c; --line: #d2cdd3; --accent: var(--tone); }
.app-page.theme-metro { --paper: #030a0c; --ink: #e8fbff; --muted: #a8cbd1; --line: #28505b; --accent: #5eebff; }
.app-page.theme-skein { --paper: #f6efde; --ink: #281a31; --muted: #5d4d5e; --line: #d5c7a8; --accent: var(--tone); }
.app-page.theme-plumb { --paper: #0a192f; --ink: #edfaff; --muted: #a9c3d2; --line: #2e4a5c; --accent: #64ffda; --poster: #112743; }
.app-page.theme-flow { --paper: #f2ebf7; --ink: #2d2241; --muted: #5d4b72; --line: #cfc0e0; --accent: var(--tone); }
.app-page.theme-page .app-heading { font-family: Georgia, serif; font-weight: 600; letter-spacing: -0.06em; }
.app-page.theme-skein .app-heading { font-family: Georgia, serif; font-weight: 500; letter-spacing: -0.065em; }
.app-page.theme-plumb .app-heading, .app-page.theme-metro .app-heading { font-family: ui-monospace, Consolas, monospace; letter-spacing: -0.08em; }
.app-hero { display: grid; grid-template-columns: 1.02fr 0.98fr; align-items: center; gap: clamp(2rem, 6vw, 5rem); padding-block: clamp(2.8rem, 6vw, 5rem); }
.app-heading { font-size: clamp(3rem, 6.25vw, 6.3rem); }
.app-heading span { color: var(--accent); }
.app-kicker { color: var(--accent); }
.app-meta { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.app-meta span { padding: 0.35rem 0.65rem; border: 1px solid var(--line); border-radius: 0.28rem; font-size: 0.75rem; font-weight: 670; }
.app-visual { display: grid; place-items: center; margin: 0; padding: 3.3rem 1.25rem 3.15rem; min-height: 19rem; border: 1px solid var(--line); border-radius: 0.65rem; }
.app-visual > figcaption { position: absolute; top: 0.95rem; left: 1rem; right: 1rem; display: flex; justify-content: space-between; gap: 0.75rem; }
.app-screen { display: block; width: min(73%, 15.9rem); height: auto; border: 0.38rem solid #242831; border-radius: 1.45rem; box-shadow: 0 0.8rem 1.75rem #0003; }
.app-picture { display: grid; justify-items: center; width: 100%; border-radius: 0.55rem; }
.app-visual--split { --woodshop-split: 47%; gap: 1rem; padding: 2.8rem 1.15rem 1.2rem; }
.display-split {
  --split-position: 46.5%;
  --split-left: calc(var(--split-position) + 10.5%);
  --split-right: calc(var(--split-position) - 10.5%);
  --split-thumb-size: 2.75rem;
  position: relative;
  display: grid;
  width: min(72%, 17rem);
  border: 0.35rem solid #26343b;
  border-radius: 1.45rem;
  overflow: hidden;
  box-shadow: 0 0.8rem 1.75rem #0007;
}
.display-split > * { grid-area: 1 / 1; }
.display-split img { display: block; width: 100%; height: auto; }
.display-split img + img { clip-path: polygon(0 var(--split-left), 100% var(--split-right), 100% 100%, 0 100%); }
.display-split::after {
  content: "";
  grid-area: 1 / 1;
  clip-path: polygon(0 calc(var(--split-left) - 0.15%), 100% calc(var(--split-right) - 0.15%),
    100% calc(var(--split-right) + 0.15%), 0 calc(var(--split-left) + 0.15%));
  background: linear-gradient(90deg, #5eebff, #e2b777);
  pointer-events: none;
}
.display-slider {
  position: absolute;
  z-index: 1;
  inset: 0 auto 0 50%;
  transform: translateX(-50%);
  width: var(--split-thumb-size);
  height: 100%;
  margin: 0;
  appearance: none;
  writing-mode: vertical-lr;
  direction: rtl;
  background: transparent;
  cursor: ns-resize;
  touch-action: none;
}
.display-slider::-webkit-slider-thumb {
  appearance: none;
  width: var(--split-thumb-size);
  height: var(--split-thumb-size);
  border: 2px solid #e8fbff;
  border-radius: 50%;
  background: #07171b url("/assets/metrognome-split-arrows.svg") center / 1.25rem no-repeat;
  box-shadow: 0 2px 8px #000b;
}
.display-slider::-moz-range-thumb {
  width: calc(var(--split-thumb-size) - 4px);
  height: calc(var(--split-thumb-size) - 4px);
  border: 2px solid #e8fbff;
  border-radius: 50%;
  background: #07171b url("/assets/metrognome-split-arrows.svg") center / 1.25rem no-repeat;
  box-shadow: 0 2px 8px #000b;
}
.display-slider:focus-visible { outline: none; }
.display-slider:focus-visible::-webkit-slider-thumb { outline: 2px solid #5eebff; outline-offset: 2px; }
.display-slider:focus-visible::-moz-range-thumb { outline: 2px solid #5eebff; outline-offset: 2px; }
.display-hint { margin: -0.2rem 0 0; color: var(--ink); font-size: 0.85rem; text-align: center; }
.display-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.55rem; }
.display-links a {
  padding: 0.42rem 0.65rem;
  border: 1px solid #5eebff62;
  border-radius: 0.35rem;
  background: #07171b;
  font-size: 0.8rem;
  font-weight: 700;
}
.display-links a span { margin-left: 0.22rem; color: var(--muted); font-size: 0.68rem; }
.display-links a + a { border-color: #bd864f; background: #271609; color: #ffd293; }
.app-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); align-items: start; gap: 1rem; margin-top: 2rem; }
.app-gallery figure { display: grid; justify-items: center; align-content: center; gap: 1rem; height: 100%; margin: 0; padding: 1.25rem; border: 1px solid var(--line); border-radius: 0.6rem; background: var(--poster); color: var(--poster-ink); }
.app-gallery img { display: block; width: auto; height: auto; max-width: 100%; max-height: 21rem; border-radius: 0.5rem; }
.app-gallery--screens img { max-height: 29rem; }
.theme-flow .app-gallery img { max-height: 25rem; }
.app-gallery figcaption { font-size: 0.88rem; font-weight: 650; }
.app-release { display: flex; align-items: start; gap: clamp(1rem, 4vw, 3.2rem); justify-content: space-between; padding: clamp(1.4rem, 5vw, 2.8rem); border: 1px solid var(--line); border-radius: 0.65rem; background: color-mix(in srgb, var(--paper), var(--accent) 7%); }
.app-release h2 { font-size: clamp(1.8rem, 3vw, 3rem); }
.app-release p { max-width: 49ch; margin-bottom: 0; color: var(--muted); line-height: 1.6; }
.app-release > a { white-space: nowrap; font-size: 0.9rem; font-weight: 700; }

.theme-page .app-meta span { border-color: transparent; background: #8de4f4; }
.theme-page .app-meta span + span { background: #ffd3e7; color: #4f1031; }
.theme-page .steps article { border-top: 4px solid var(--cyan); }
.theme-page .steps article:nth-child(2) { border-color: var(--magenta); }
.theme-page .steps article:nth-child(3) { border-color: var(--yellow); }
.theme-page .app-release { background: #ffe48a; border-color: #e6ca6d; }

@media (max-width: 53rem) {
  .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-hero { gap: 1.45rem; }
}

@media (max-width: 42rem) {
  .app-hero { grid-template-columns: 1fr; gap: 2.35rem; }
  .app-visual > figcaption { font-size: 0.6rem; }
  .app-release { flex-direction: column; }
}

@media (max-width: 32rem) {
  .catalog-grid { grid-template-columns: 1fr; }
  .card-art { min-height: 8.3rem; }
}
