.ata-portfolio {
  --ap-ink: #141613;
  --ap-paper: #f3f1eb;
  --ap-dark: #151814;
  --ap-red: #b82c19;
  --ap-warm: #ff917d;
  --ap-muted: #53584f;
  --ap-rule: #c9c7bb;
  background: var(--ap-paper);
  color: var(--ap-ink);
}
.ata-portfolio [hidden] { display: none !important; }
.ata-portfolio :focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
.ap-wrap { width: min(100%, 1440px); margin-inline: auto; padding-inline: clamp(1rem, 5vw, 4.5rem); }
.ap-hero, .ap-close { background: var(--ap-dark); color: var(--ap-paper); }
.ap-hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 6fr);
  align-items: center;
  gap: clamp(1.5rem, 5vw, 5rem);
  padding-block: clamp(2.5rem, 6vw, 6.5rem);
}
.ap-hero-compact { display: block; }
.ap-kicker {
  margin: 0 0 .9rem;
  font-size: .72rem;
  line-height: 1.6;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ap-red);
}
.ap-hero .ap-kicker, .ap-close .ap-kicker { color: var(--ap-warm); }
.ap-hero h1, .ap-gallery h2, .ap-close h2 {
  margin: 0;
  color: inherit;
  line-height: 1.02;
  font-weight: 800;
  font-kerning: none;
  font-variant-ligatures: none;
  letter-spacing: .025em;
}
.ap-hero h1 { font-size: clamp(2.55rem, 6vw, 5.65rem); }
.ap-hero-compact h1 { font-size: clamp(2.7rem, 6vw, 5.25rem); }
.ap-hero-compact h1 br { display: none; }
.ap-lede { max-width: 36ch; margin: 1.25rem 0 1.65rem; color: #deded4; font-size: clamp(1rem, 1.65vw, 1.22rem); }
.ata-portfolio .ap-button, .ata-portfolio button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: fit-content;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 0;
  padding: .7rem 1rem;
  background: var(--ap-ink);
  color: #fff;
  text-align: left;
  text-decoration: none;
  font: inherit;
  font-size: .875rem;
  font-weight: 700;
  cursor: pointer;
}
.ata-portfolio .ap-button:hover, .ata-portfolio button:hover { background: #353a33; color: #fff; }
.ata-portfolio .ap-hero .ap-button, .ata-portfolio .ap-close .ap-button { background: var(--ap-red); color: #fff; }
.ata-portfolio .ap-hero .ap-button:hover, .ata-portfolio .ap-close .ap-button:hover { background: #9e2616; }
.ata-portfolio .ap-button[aria-disabled="true"] { opacity: .68; cursor: progress; }
.ap-hero-photo, .ap-result { margin: 0; }
.ap-photo-frame { position: relative; display: block; isolation: isolate; overflow: hidden; }
.ap-photo-frame:not([data-photo-state="ready"]) { background: linear-gradient(140deg, #a7aa9d, #cfc5b3 62%, #9f9b8c); }
.ap-photo-frame:not([data-photo-state="ready"])::before {
  content: "";
  position: absolute;
  inset: -20px;
  z-index: -2;
  background: center / cover no-repeat url("home/workshop.webp");
  filter: blur(18px);
  opacity: .62;
}
.ap-photo-preview {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(16px);
  transform: scale(1.14);
  pointer-events: none;
}
.ap-photo-preview:not([src]), .ap-photo-frame[data-photo-state="ready"] > .ap-photo-preview { visibility: hidden; }
.ap-photo-frame[data-photo-state]:not([data-preview-ready]) > .ap-photo-preview,
.ap-photo-frame[data-photo-state="loading"] > .ap-photo-image,
.ap-photo-frame[data-photo-state="error"] > .ap-photo-image { opacity: 0; }
.ap-photo-frame[data-photo-state="error"]::after {
  content: "Photo unavailable";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #151814a0;
  color: #fff;
  font-size: .875rem;
}
.ap-hero-photo .ap-photo-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: center;
}
.ap-hero-photo figcaption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .4rem 1rem;
  padding-top: .7rem;
  color: #dadbd1;
  font-size: .82rem;
}
.ap-gallery { padding-block: clamp(2.5rem, 6vw, 5.5rem); scroll-margin-top: calc(var(--header-h, 56px) + 2.5rem); }
.ap-gallery-head { display: flex; justify-content: space-between; align-items: start; flex-wrap: wrap; gap: 1rem 2rem; margin-bottom: 1.5rem; }
.ap-gallery-head h2, .ap-close h2 { font-size: clamp(2.1rem, 4.5vw, 4.25rem); }
.ap-gallery-head p:not(.ap-kicker) { margin: .75rem 0 0; color: var(--ap-muted); }
.ap-lookup { width: min(100%, 19rem); }
.ap-lookup summary { width: fit-content; margin-inline-start: auto; padding: .7rem 0; cursor: pointer; font-weight: 700; font-size: .9rem; text-decoration: underline; text-underline-offset: .2em; }
.ap-lookup form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .45rem; }
.ap-lookup label, .ap-lookup small { grid-column: 1 / -1; font-size: .85rem; color: var(--ap-muted); }
.ap-lookup input, .ap-share input { min-width: 0; width: 100%; border: 1px solid #8d9087; border-radius: 0; background: #fff; color: var(--ap-ink); padding: .5rem .65rem; font: inherit; }
.ap-share, .ap-viewer-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; }
.ap-gallery .ap-share { margin-bottom: 1rem; }
.ap-share:has(button[hidden]) { display: none; }
.ap-share [role="status"] { font-size: .85rem; }
.ap-share input { flex-basis: 100%; max-width: 34rem; }
.ap-viewer .ap-share:has(input:not([hidden])) { flex-basis: 100%; }
.ap-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(.8rem, 2.15vw, 2rem);
  padding: 0;
  margin: 0;
  list-style: none;
}
.ap-card { min-width: 0; border-bottom: 1px solid var(--ap-rule); }
.ap-card-image .ap-photo-image { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.ap-card-image:hover .ap-enlarge, .ap-card-image:focus-visible .ap-enlarge { background: var(--ap-red); }
.ap-enlarge { position: absolute; bottom: .45rem; right: .45rem; display: grid; place-items: center; width: 1.85rem; height: 1.85rem; background: #151814e8; color: #fff; font: 1.25rem/1 sans-serif; }
.ap-card-caption { display: grid; gap: .1rem; padding: .55rem 0 .75rem; overflow-wrap: anywhere; }
.ap-card-caption p { margin: 0; font-size: 1rem; font-weight: 700; }
.ap-card-caption span, .ap-status { font-size: .82rem; color: var(--ap-muted); }
.ap-pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; justify-content: center; margin-top: 1.7rem; }
.ap-pagination:empty, .ap-status:empty { display: none; }
.ap-status { text-align: center; }
.ata-portfolio .ap-text-link { color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: .2em; }
.ap-message { margin-block: 1.25rem; padding: 1rem; border: 1px solid var(--ap-rule); }
.ap-result { margin-bottom: 1.2rem; }
.ap-result .ap-photo-image, .ap-viewer .ap-photo-image { display: block; width: 100%; height: auto; aspect-ratio: auto 4 / 3; object-fit: contain; }
.ap-result .ap-photo-image { max-height: 75dvh; object-position: left center; }
.ap-result figcaption { display: grid; margin-top: .5rem; color: var(--ap-muted); }
.ap-viewer {
  box-sizing: border-box;
  width: min(1000px, calc(100% - 1.5rem));
  max-height: calc(100dvh - 1.5rem);
  margin: auto;
  padding: clamp(.8rem, 2vw, 1.5rem);
  border: 1px solid #565c52;
  background: var(--ap-dark);
  color: #fff;
}
.ap-viewer[open] { display: grid; gap: .8rem; }
.ap-viewer::backdrop { background: #0a0b0aeb; }
.ap-viewer-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; overflow-wrap: anywhere; }
.ap-viewer-head h2 { margin: 0; font-size: clamp(1rem, 2.3vw, 1.45rem); letter-spacing: -.02em; line-height: 1.25; }
.ata-portfolio .ap-viewer button { border-color: #7e8479; }
.ap-viewer .ap-photo-image { max-height: 70dvh; }
.ap-viewer a { justify-self: start; }
.ap-close .ap-wrap { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1.25rem; padding-block: clamp(2.2rem, 5vw, 4.75rem); }

@media (max-width: 830px) {
  .ap-hero-layout { grid-template-columns: minmax(0, 1fr); }
  .ap-hero-layout:not(.ap-hero-compact) h1 { font-size: clamp(2.55rem, 9.25vw, 4.5rem); }
  .ap-hero h1 br { display: none; }
  .ap-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ap-lookup summary { margin-inline-start: 0; }
}
