.frame.gilt,
.frame.walnut,
.frame.steel,
.frame.carbon,
.frame.circuit,
.frame.bezel,
.frame.monitor,
.frame.chalk,
.frame.polaroid,
.frame.paper {
  --wall-shadow: 1px 2px 2px #322a2529, 4px 7px 10px #322a251c, 12px 19px 28px #322a2510;
}

.frame:is(.gilt, .walnut, .steel, .carbon, .circuit, .bezel, .monitor, .chalk, .polaroid, .paper) > .mat {
  padding: var(--mat-inset);
}

.frame:is(.gilt, .walnut, .steel, .carbon, .circuit, .bezel, .monitor, .chalk, .polaroid, .paper)::before,
.frame:is(.gilt, .walnut, .steel, .carbon, .circuit, .bezel, .monitor, .chalk, .polaroid, .paper)::after,
.frame:is(.gilt, .walnut, .steel, .carbon, .circuit, .bezel, .monitor, .chalk, .polaroid, .paper) > .mat::before,
.frame:is(.gilt, .walnut, .steel, .carbon, .circuit, .bezel, .monitor, .chalk, .polaroid, .paper) > .mat::after {
  pointer-events: none;
}

.frame.gilt {
  --mat-inset: 12px;
  padding: 14px;
  border: 1px solid #806338;
  background: linear-gradient(135deg, #ead29a, #b68b43 24%, #d9b76e 48%, #a67a37 76%, #c39c54);
  box-shadow: inset 1px 1px 0 #f8e4b5, inset -1px -1px 0 #755127, inset 3px 3px 0 #d8b975, inset -3px -3px 0 #9b7335, var(--wall-shadow);
}

.frame.gilt::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid #8d672f;
  box-shadow: 0 0 0 1px #f0d699b3, inset 1px 1px 1px #f6dda6, inset -1px -1px 1px #8b622c;
}

.frame.gilt::after {
  content: "";
  position: absolute;
  inset: 3px;
  background:
    radial-gradient(circle at 50% 50%, #f5dda5 0 1px, #c7a15a 1.5px 2.5px, #89612f 3px, transparent 3.5px) left top / 8px 8px,
    radial-gradient(circle at 50% 50%, #f5dda5 0 1px, #c7a15a 1.5px 2.5px, #89612f 3px, transparent 3.5px) right top / 8px 8px,
    radial-gradient(circle at 50% 50%, #e5c685 0 1px, #b28a46 1.5px 2.5px, #80592c 3px, transparent 3.5px) left bottom / 8px 8px,
    radial-gradient(circle at 50% 50%, #e5c685 0 1px, #b28a46 1.5px 2.5px, #80592c 3px, transparent 3.5px) right bottom / 8px 8px;
  background-repeat: no-repeat;
}

.frame.gilt > .mat {
  background: #f7f3e7;
  box-shadow: 0 0 0 1px #6e4d28, 0 0 0 2px #efd495, 0 0 0 3px #aa803d, inset 1px 1px 3px #55432d24;
}

.frame.walnut {
  --mat-inset: 18px;
  padding: 10px;
  border: 1px solid #3c291f;
  background:
    repeating-linear-gradient(88deg, transparent 0 4px, #c39a6a10 4px 4.8px, #2116101a 4.8px 5.5px, transparent 5.5px 10px),
    linear-gradient(110deg, #61432f, #453024 44%, #644834 75%, #4b3325);
  box-shadow: inset 1px 1px 0 #ad896257, inset -1px -1px 0 #2418119e, var(--wall-shadow);
}

.frame.walnut::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  background:
    linear-gradient(45deg, transparent 47%, #25191185 49% 51%, transparent 53%) left top / 10px 10px,
    linear-gradient(-45deg, transparent 47%, #25191185 49% 51%, transparent 53%) right top / 10px 10px,
    linear-gradient(-45deg, transparent 47%, #25191185 49% 51%, transparent 53%) left bottom / 10px 10px,
    linear-gradient(45deg, transparent 47%, #25191185 49% 51%, transparent 53%) right bottom / 10px 10px;
  background-repeat: no-repeat;
}

.frame.walnut::after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid #bd96602b;
  background:
    repeating-linear-gradient(0deg, #5b402e 0 1px, #5e422f 1px 2px, #604432 2px 4px) left top / 100% 6px,
    repeating-linear-gradient(0deg, #5b402e 0 1px, #5e422f 1px 2px, #604432 2px 4px) left bottom / 100% 6px;
  background-repeat: no-repeat;
  box-shadow: inset 1px 1px 1px #25180e40;
}

.frame.walnut > .mat {
  background: #f7f4ea;
  box-shadow: 0 0 0 1px #baa06a, 0 0 0 2px #2f2018, inset 1px 1px 3px #42332526;
}

.frame.steel {
  --mat-inset: 10px;
  --screw-offset: 4px;
  padding: 8px;
  border: 1px solid #858986;
  background:
    radial-gradient(circle at var(--screw-offset) var(--screw-offset), #cdd0cd 0 .7px, #666d6b 1px 1.4px, #e4e6e2 1.8px 2.2px, #7d8380 2.6px, transparent 3px),
    radial-gradient(circle at calc(100% - var(--screw-offset)) var(--screw-offset), #cdd0cd 0 .7px, #666d6b 1px 1.4px, #e4e6e2 1.8px 2.2px, #7d8380 2.6px, transparent 3px),
    radial-gradient(circle at var(--screw-offset) calc(100% - var(--screw-offset)), #cdd0cd 0 .7px, #666d6b 1px 1.4px, #e4e6e2 1.8px 2.2px, #7d8380 2.6px, transparent 3px),
    radial-gradient(circle at calc(100% - var(--screw-offset)) calc(100% - var(--screw-offset)), #cdd0cd 0 .7px, #666d6b 1px 1.4px, #e4e6e2 1.8px 2.2px, #7d8380 2.6px, transparent 3px),
    repeating-linear-gradient(0deg, #fff3 0 .5px, #39423d0c .5px 1px, transparent 1px 3px),
    linear-gradient(125deg, #dfe2df, #b2b7b3 50%, #d4d7d3 78%, #a6aba7);
  box-shadow: inset 0 1px 0 #ffffffe0, inset 0 -1px 0 #69716b, var(--wall-shadow);
}

.frame.steel > .mat {
  background: #eeeee8;
  box-shadow: 0 0 0 1px #7d847e, inset 1px 1px 2px #322a2529;
}

.frame.carbon {
  --mat-inset: 9px;
  padding: 9px;
  border: 1px solid #1e211f;
  background:
    repeating-linear-gradient(45deg, #ffffff0d 0 1px, transparent 1px 3px, #00000033 3px 4px),
    repeating-linear-gradient(-45deg, #ffffff0a 0 1px, transparent 1px 3px, #00000022 3px 4px),
    linear-gradient(120deg, #303330, #191c1a 52%, #2c302c);
  box-shadow: inset 0 1px 0 #939a9366, inset 0 -1px 0 #101310, var(--wall-shadow);
}

.frame.carbon::before {
  content: "";
  position: absolute;
  inset: 1px;
  border: 1px solid #b8bdb417;
  background: linear-gradient(180deg, #f0f2ed15, transparent 24%);
}

.frame.carbon::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid #9b4c43;
  box-shadow: 0 1px 0 #070b0859;
}

.frame.carbon > .mat {
  background: #272d28;
  box-shadow: inset 1px 1px 2px #080c0a99;
}

.frame.circuit {
  --mat-inset: 10px;
  --pad-offset: 5px;
  padding: 11px;
  border: 1px solid #203c31;
  background:
    radial-gradient(circle at var(--pad-offset) var(--pad-offset), #152d24 0 1px, #d2b875 1.3px 2.5px, #9e8850 2.8px, transparent 3.2px),
    radial-gradient(circle at calc(100% - var(--pad-offset)) var(--pad-offset), #152d24 0 1px, #d2b875 1.3px 2.5px, #9e8850 2.8px, transparent 3.2px),
    radial-gradient(circle at var(--pad-offset) calc(100% - var(--pad-offset)), #152d24 0 1px, #d2b875 1.3px 2.5px, #9e8850 2.8px, transparent 3.2px),
    radial-gradient(circle at calc(100% - var(--pad-offset)) calc(100% - var(--pad-offset)), #152d24 0 1px, #d2b875 1.3px 2.5px, #9e8850 2.8px, transparent 3.2px),
    linear-gradient(125deg, #355a49, #244637 60%, #2d5140);
  box-shadow: inset 0 1px 0 #adc4a64a, inset 0 -1px 0 #102a1f99, var(--wall-shadow);
}

.frame.circuit::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid #e1e8d44a;
}

.frame.circuit::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #c8a76b66;
  clip-path: polygon(15px 4px, calc(100% - 20px) 4px, calc(100% - 14px) 10px, calc(100% - 15px) 11px, calc(100% - 21px) 5px, 15px 5px, 9px 11px, 8px 10px);
}

.frame.circuit > .mat {
  background: #eceee2;
  box-shadow: 0 0 0 1px #132e22, inset 1px 1px 2px #263d2d2e;
}

.frame.bezel {
  --mat-inset: 5px;
  padding: 12px 9px 11px;
  border: 1px solid #151514;
  border-radius: 18px;
  background: linear-gradient(115deg, #4e4e4b, #1c1d1c 28%, #111312 70%, #373a37);
  box-shadow: inset 0 1px 0 #a4a5a080, inset 0 -1px 0 #030704, 1px 2px 2px #322a2540, 4px 7px 10px #322a251c, 12px 19px 28px #322a2510;
}

.frame.bezel::before {
  content: "";
  position: absolute;
  top: 5px;
  left: calc(50% - 1.5px);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #46534f;
  box-shadow: 0 0 0 1px #080d0a, inset 0 1px 1px #a4b5a266;
}

.frame.bezel::after {
  content: "";
  position: absolute;
  top: 34px;
  right: -1px;
  width: 2px;
  height: 25px;
  border-radius: 1px;
  background: linear-gradient(#686b67, #969990 20%, #454a43);
}

.frame.bezel > .mat {
  border-radius: 10px;
  background: #181b19;
  box-shadow: 0 0 0 1px #60695c66, inset 0 0 2px #000a;
}

.frame.bezel .art-image,
.frame.bezel .peek {
  border-radius: 5px;
}

.frame.monitor {
  --mat-inset: 5px;
  padding: 6px 6px 19px;
  border: 1px solid #a7aaa4;
  border-radius: 4px;
  background: linear-gradient(110deg, #e4e4e0, #d6d7d2 62%, #c2c5bd);
  box-shadow: inset 0 1px 0 #ffffffe6, inset 0 -1px 0 #93988f, var(--wall-shadow);
}

.frame.monitor::before {
  content: "";
  position: absolute;
  inset: 1px;
  border: 1px solid #f8faf35c;
  border-bottom-color: #8c95873d;
  border-radius: 3px;
}

.frame.monitor::after {
  content: "";
  position: absolute;
  bottom: 7px;
  left: calc(50% - 1.5px);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #73836a;
  box-shadow: inset 0 1px 1px #48574080, 0 1px 0 #f6faed;
}

.frame.monitor > .mat {
  border-radius: 1px;
  background: #333534;
  box-shadow: 0 0 0 1px #9da19a, inset 1px 1px 2px #050c0799;
}

.frame.chalk {
  --mat-inset: 13px;
  padding: 10px;
  border: 1px solid #aa8c61;
  background:
    repeating-linear-gradient(3deg, transparent 0 3px, #8a673b17 3px 4px, transparent 4px 7px),
    linear-gradient(105deg, #d9c398, #c3a575 48%, #d6bd8d);
  box-shadow: inset 1px 1px 0 #f7e6bc, inset -1px -1px 0 #9a784e, var(--wall-shadow);
}

.frame.chalk::before {
  content: "";
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: -4px;
  height: 6px;
  border: 1px solid #9e7a4f;
  border-radius: 0 0 2px 2px;
  background: linear-gradient(#e5d1a8, #b39363 45%, #a88554);
  box-shadow: 0 2px 2px #322a2526;
}

.frame.chalk::after {
  content: "";
  position: absolute;
  bottom: 1px;
  left: calc(50% - 24px);
  width: 48px;
  height: 3px;
  background:
    linear-gradient(#fffdf0, #d6d7c6) left / 22px 3px,
    linear-gradient(#eadbb0, #c6b68b) right / 15px 3px;
  background-repeat: no-repeat;
  rotate: -2deg;
}

.frame.chalk > .mat {
  background:
    radial-gradient(ellipse at 28% 9%, #b4c2ac26, transparent 65%),
    linear-gradient(130deg, #3d5146, #293e33);
  box-shadow: 0 0 0 1px #735d3c, inset 1px 2px 4px #15291d80;
}

.frame.polaroid {
  --mat-inset: 2px;
  padding: 9px 9px 34px;
  border-radius: 1px;
  background: linear-gradient(110deg, #fffef8, #f3f0e6);
  box-shadow: inset 0 0 0 .5px #8a7d6030, 0 1px 1px #322a2521, 3px 6px 9px #322a251a, 11px 17px 25px #322a2510;
}

.frame.polaroid::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: -7px;
  left: calc(50% - 25px);
  width: 50px;
  height: 17px;
  background: repeating-linear-gradient(90deg, #f4edcc1c 0 2px, transparent 2px 4px), #c7ba8c70;
  box-shadow: inset 0 1px 0 #fdf6db30, 0 1px 1px #6a5c3c0d;
  rotate: -5deg;
}

.frame.polaroid::after {
  content: attr(data-caption);
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 8px;
  height: 16px;
  overflow: hidden;
  color: #696255;
  font: italic 12px/16px Georgia, serif;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.frame.polaroid > .mat {
  background: #e5e4d9;
  box-shadow: inset 0 0 2px #514e3b45;
}

.frame.paper {
  --mat-inset: 10px;
  padding: 4px 4px 6px;
  background: linear-gradient(110deg, #fffdf4, #f3f0e3);
  box-shadow: 0 1px 1px #322a251c, 3px 6px 9px #322a2517, 11px 17px 25px #322a250d;
}

.frame.paper::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: -6px;
  left: calc(50% - 21px);
  width: 42px;
  height: 14px;
  background: #c2a87866;
  box-shadow: inset 0 1px 0 #ffefd22b;
  rotate: 3deg;
}

.frame.paper::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  background: #f3f0e3;
  clip-path: polygon(0 0, 100% 0, 100% 55%, 96% 65%, 92% 45%, 86% 100%, 81% 60%, 76% 85%, 70% 55%, 65% 90%, 58% 60%, 52% 100%, 46% 70%, 39% 90%, 32% 55%, 27% 80%, 22% 60%, 16% 100%, 10% 55%, 5% 80%, 0 60%);
}

.frame.paper > .mat {
  background: transparent;
  box-shadow: none;
}

@media (max-width: 700px) {
  .frame.gilt { --mat-inset: 8px; padding: 10px; }
  .frame.gilt::before { inset: 3px; }
  .frame.gilt::after { inset: 1px; }
  .frame.gilt > .mat { box-shadow: 0 0 0 1px #6e4d28, 0 0 0 2px #efd495, inset 1px 1px 2px #55432d24; }
  .frame.walnut { --mat-inset: 11px; padding: 7px; }
  .frame.walnut::after { inset: 2px; background-size: 100% 4px; }
  .frame.walnut::before { background-size: 7px 7px; }
  .frame.steel { --mat-inset: 6px; --screw-offset: 3px; padding: 6px; }
  .frame.carbon { --mat-inset: 5px; padding: 6px; }
  .frame.carbon::after { inset: 3px; }
  .frame.circuit { --mat-inset: 6px; --pad-offset: 4px; padding: 8px; }
  .frame.circuit::before { inset: 6px; }
  .frame.circuit::after { clip-path: polygon(12px 3px, calc(100% - 16px) 3px, calc(100% - 10px) 9px, calc(100% - 11px) 10px, calc(100% - 17px) 4px, 12px 4px, 7px 9px, 6px 8px); }
  .frame.bezel { --mat-inset: 4px; padding: 10px 6px 8px; border-radius: 15px; }
  .frame.bezel::before { top: 4px; width: 2px; height: 2px; left: calc(50% - 1px); }
  .frame.bezel > .mat { border-radius: 9px; }
  .frame.monitor { --mat-inset: 3px; padding: 4px 4px 14px; }
  .frame.monitor::after { bottom: 5px; width: 2px; height: 2px; left: calc(50% - 1px); }
  .frame.chalk { --mat-inset: 8px; padding: 7px; }
  .frame.chalk::before { left: 5px; right: 5px; height: 5px; bottom: -3px; }
  .frame.chalk::after { bottom: 1px; }
  .frame.polaroid { --mat-inset: 1px; padding: 6px 6px 28px; }
  .frame.polaroid::before { width: 40px; height: 14px; top: -6px; left: calc(50% - 20px); }
  .frame.polaroid::after { bottom: 6px; font-size: 10px; }
  .frame.paper { --mat-inset: 6px; padding: 3px 3px 5px; }
  .frame.paper::before { width: 34px; height: 12px; top: -5px; left: calc(50% - 17px); }
}
