:root {
  --paper: #ede9e5;
  --bar-paper: 243, 240, 237;
  --ink: #323432;
  --muted: #73736e;
  --line: rgba(50,52,50,.18);
  --humor: #c05634;
  --women: #9b4d78;
  --leader: #6c7e24;
  --victim: #745faa;
  --creator: #008265;
  --resistor: #893c44;
  --myth: #0079a5;
  /* Major-second type scale (1.125), centered on a 10px label size. */
  --type-2xs: 8px;
  --type-xs: 9px;
  --type-sm: 10px;
  --type-label: 11px;
  --type-caption: 13px;
  --type-ui: 14px;
  --type-body: 16px;
  --type-body-lg: 18px;
  --type-title-sm: 20px;
  --type-title-md: 23px;
  --type-title-lg: 26px;
  --type-title-xl: 29px;
  --type-title-2xl: 32px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: "source-sans-3-variable", sans-serif; font-weight: 400; }
button, a { font: inherit; }
button { color: inherit; }
img { max-width: 100%; }

.masthead { position: fixed; z-index: 20; inset: 0 0 auto; height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(20px, 4vw, 64px); border-bottom: 1px solid var(--line); background: rgba(var(--bar-paper), .88); backdrop-filter: blur(14px); }
.wordmark { font-family: "cormorant-garamond", serif; font-size: clamp(var(--type-title-md), 2.2vw, var(--type-title-2xl)); font-weight: 500; line-height: 1; color: var(--ink); text-decoration: none; }
.about-toggle { display: grid; border: 0; background: none; text-transform: uppercase; letter-spacing: .13em; font-size: var(--type-label); cursor: pointer; }
.about-toggle span { grid-area: 1 / 1; transition: opacity .2s ease; }
.about-toggle .close-label,
.about-toggle.show-close .about-label { opacity: 0; }
.about-toggle.show-close .close-label { opacity: 1; }

main { padding-top: 68px; }
.hero { position: relative; isolation: isolate; min-height: 69vh; overflow: hidden; padding: clamp(80px, 12vw, 170px) clamp(20px, 4vw, 64px) 58px; display: grid; grid-template-columns: minmax(80px, 1fr) minmax(0, 2.25fr) minmax(110px, 1fr); align-items: end; border-bottom: 1px solid var(--line); opacity: 1; transition: opacity .95s cubic-bezier(.16, 1, .3, 1); }
.hero.is-exiting { opacity: 0; }
.hero::before { content: ""; position: absolute; z-index: -1; inset: 0; opacity: 0; background-position: 80% 19%; background-size: cover; background-repeat: no-repeat; }
.hero::before { background-image: url("assets/czech-flag-zizkov.jpg"); }
.hero.slideshow-ready::before { animation: hero-flag-fade-in 1s ease-in-out forwards; }
body.modal-open .hero.slideshow-ready::before { animation-play-state: paused; }
@keyframes hero-flag-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.hero-index { align-self: start; color: inherit; opacity: .65; font-size: var(--type-label); letter-spacing: .15em; }
.eyebrow { margin: 0 0 18px; font-size: var(--type-sm); text-transform: uppercase; letter-spacing: .18em; font-weight: 600; }
.hero-eyebrow { font-size: var(--type-label); }
h1, h2 { font-family: "cormorant-garamond", Georgia, serif; font-weight: 400; font-style: normal; }
h2 { font-weight: 500; }
h1 { margin: 0; max-width: 100%; font-size: clamp(54px, 13vw, 196px); line-height: .82; letter-spacing: -.045em; transform: translateX(-9px); }
.dek { max-width: none; margin: 34px 0 0 8px; display: flex; flex-wrap: wrap; column-gap: .28em; font-family: "source-sans-3-variable", sans-serif; font-size: clamp(var(--type-body-lg), 2vw, var(--type-title-xl)); font-weight: 330; line-height: 1.25; }
.dek span { flex: none; white-space: nowrap; }
.hero-note { align-self: end; justify-self: end; display: grid; gap: 7px; text-align: right; font-size: var(--type-label); text-transform: uppercase; letter-spacing: .12em; }

.about-panel { display: grid; grid-template-rows: 0fr; overflow: hidden; border-bottom: 1px solid var(--line); background: #dbd6d1; scroll-margin-top: 68px; transition: grid-template-rows .45s cubic-bezier(.22,.7,.2,1); }
.about-panel[hidden] { display: none; }
.about-panel.is-open { grid-template-rows: 1fr; }
.about-panel-inner { min-height: 0; overflow: hidden; display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(40px, 8vw, 140px); padding: 0 clamp(20px, 9vw, 150px); opacity: 0; transform: translateY(-24px); transition: padding .45s cubic-bezier(.22,.7,.2,1), opacity .3s ease, transform .45s cubic-bezier(.22,.7,.2,1); }
.about-panel.is-open .about-panel-inner { padding-top: 56px; padding-bottom: 56px; opacity: 1; transform: none; }
.about-panel p { margin: 0; max-width: 760px; line-height: 1.7; }
.about-panel .eyebrow { margin-bottom: 28px; }
.about-panel-inner > p { padding-top: 54px; }
.about-panel-inner > div > p:last-child { font-family: "cormorant-garamond", serif; font-size: clamp(22px, 3vw, 38px); line-height: 1.35; }
.about-panel-inner > .about-photo-credit { grid-column: 1 / -1; padding-top: 0; color: var(--muted); font-size: var(--type-label); line-height: 1.45; }

.filter-bar { --filter-bar-height: 57px; position: sticky; z-index: 10; top: 68px; height: var(--filter-bar-height); display: flex; overflow-x: auto; padding: 0 clamp(20px, 4vw, 64px); border-bottom: 1px solid var(--line); background: rgba(var(--bar-paper), .94); backdrop-filter: blur(14px); scrollbar-width: none; scroll-padding-inline: clamp(20px, 4vw, 64px); overscroll-behavior-inline: contain; }
.filter-bar::-webkit-scrollbar { display: none; }
.filter-label { flex: 0 0 auto; align-self: center; margin-right: 32px; color: var(--muted); font-size: var(--type-sm); font-weight: 400; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; }
.filter { flex: 0 0 auto; align-items: center; display: flex; padding: 1px 22px 0 0; margin-right: 24px; border: 0; border-bottom: 2px solid transparent; background: none; font-size: var(--type-caption); font-weight: 600; text-transform: none; letter-spacing: .04em; cursor: pointer; color: var(--muted); transition: color .2s ease, opacity .2s ease; }
.filter span { margin-left: 6px; font-size: inherit; vertical-align: baseline; }
.filter.active, .filter.in-view { color: var(--ink); }
.filter-bar.has-current .filter[data-filter="all"] { color: var(--muted); }
.filter-indicator { position: absolute; bottom: 0; left: 0; height: 2px; background: var(--ink); pointer-events: none; transition: transform .32s cubic-bezier(.22,.7,.2,1), width .32s cubic-bezier(.22,.7,.2,1), opacity .15s ease; }

.collection { padding-bottom: 80px; opacity: 1; transition: opacity .2s ease; }
.collection.is-transitioning { opacity: 0; }
.collection.is-filtered .category-section { min-height: calc(100vh - 125px); }
.load-error { padding: 80px clamp(20px, 4vw, 64px); color: var(--muted); }
.category-section { display: grid; grid-template-columns: minmax(170px, 1fr) minmax(0, 5fr); gap: clamp(28px, 4vw, 64px); padding: 70px clamp(20px, 4vw, 64px); border-bottom: 1px solid var(--line); scroll-margin-top: 125px; }
.category-section[data-category="resistor"] { column-gap: clamp(44px, 5vw, 80px); }
.category-intro { position: sticky; top: 148px; align-self: start; }
.category-number { display: block; margin-bottom: 22px; font-size: var(--type-sm); letter-spacing: .16em; }
.category-intro h2 { margin: 0; font-size: clamp(43px, 5vw, 76px); line-height: .9; letter-spacing: -.02em; color: var(--accent); }
.category-intro p { max-width: 220px; margin: 26px 0 0; color: var(--muted); font-size: var(--type-ui); line-height: 1.65; }
.cards { min-width: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 52px clamp(16px, 1.8vw, 26px); }
.card { min-width: 0; cursor: pointer; }
.card button { display: block; width: 100%; padding: 0; text-align: left; border: 0; background: none; cursor: pointer; }
.image-wrap { position: relative; aspect-ratio: 1; overflow: hidden; background: #d8d0c8; }
.view-label { position: absolute; inset: auto 10px 10px auto; padding: 6px 8px; opacity: 0; transform: translateY(5px); background: var(--paper); font-size: var(--type-xs); line-height: 1; text-transform: uppercase; letter-spacing: .12em; transition: .25s ease; }
.view-plus { display: inline-block; margin-left: 1px; font-size: var(--type-ui); font-weight: 200; line-height: 0; vertical-align: -1.5px; }
.card img { display: block; width: 100%; height: 100%; object-fit: cover; filter: saturate(.88); transition: transform .5s cubic-bezier(.2,.7,.2,1), filter .3s; }
.card:hover img { transform: scale(1.035); filter: saturate(1); }
.card:hover .view-label { opacity: 1; transform: none; }
.card-title { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; justify-content: space-between; min-height: 42px; margin-top: 12px; padding-top: 9px; border-top: 2px solid var(--accent); font-size: var(--type-label); line-height: 1.4; }
.card-title > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.card-index { color: var(--muted); font-size: var(--type-xs); }
.card-gender { grid-column: 1 / -1; margin-top: 1px; color: var(--muted); font-size: var(--type-xs); text-transform: uppercase; letter-spacing: .09em; }
.category-section[hidden] { display: none; }

footer { display: flex; justify-content: space-between; padding: 34px clamp(20px, 4vw, 64px); font-size: var(--type-sm); text-transform: uppercase; letter-spacing: .13em; }
footer p { display: grid; gap: 9px; margin: 0; }
footer a { color: inherit; text-decoration: none; }
.footer-copyright { text-transform: none; letter-spacing: normal; }
.footer-links { display: flex; gap: clamp(20px, 4vw, 54px); }

.lightbox { position: fixed; z-index: 50; inset: 0; padding: 28px; opacity: 0; transition: opacity .3s ease; }
.lightbox:not([hidden]) { display: grid; place-items: center; }
.lightbox.is-open { opacity: 1; }
.lightbox-backdrop { position: absolute; inset: 0; border: 0; background: rgba(38,38,36,0); cursor: zoom-out; transition: background-color .3s ease; }
.lightbox.is-open .lightbox-backdrop { background: rgb(from var(--paper) calc(r - 77) calc(g - 86) calc(b - 82) / 50%); }
.lightbox-card { position: relative; min-width: 0; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(240px, .7fr); width: min(1210px, 100%, 138.462vh); max-height: 90vh; overflow: hidden; touch-action: pan-y; opacity: 0; transform: translateY(24px) scale(.985); outline: 0; background: var(--paper); box-shadow: 0 22px 110px 14px rgba(38,38,36,.055); transition: opacity .3s ease, transform .4s cubic-bezier(.22,.7,.2,1); }
.lightbox.is-open .lightbox-card { opacity: 1; transform: none; }
.close { position: absolute; z-index: 2; top: 16px; right: 16px; display: inline-flex; align-items: center; gap: 5px; padding: 8px 10px; border: 0; background: var(--paper); cursor: pointer; font-size: var(--type-sm); text-transform: uppercase; letter-spacing: .12em; }
.close span { font-size: var(--type-ui); font-weight: 200; line-height: .6; transform: translateY(-1px); }
.detail-image-wrap { position: relative; width: 100%; min-width: 0; min-height: 0; aspect-ratio: 1; align-self: center; overflow: hidden; background: var(--paper); }
.detail-image-wrap img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; opacity: 1; transition: opacity 1s ease; }
#detailImageIncoming { opacity: 0; pointer-events: none; }
.detail-image-wrap.is-crossfading #detailImage { opacity: 0; }
.detail-image-wrap.is-crossfading #detailImageIncoming { opacity: 1; }
.detail-image-wrap.is-resetting img { transition: none; }
.detail-gallery-dots { position: absolute; z-index: 1; right: 16px; bottom: 16px; display: flex; gap: 8px; }
.detail-gallery-dots[hidden] { display: none; }
.detail-gallery-dots button { width: 9px; height: 9px; padding: 0; border: 1px solid currentColor; border-radius: 50%; color: #fff; background: transparent; opacity: .48; cursor: pointer; transition: opacity .18s ease, transform .18s ease; }
.detail-gallery-dots button:hover { transform: scale(1.2); }
.detail-gallery-dots button[aria-current="true"] { opacity: 1; }
.lightbox-card.is-changing .detail-image-wrap img { opacity: 0; transition-duration: .18s; }
.detail-copy { min-height: 0; max-height: 90vh; overflow-y: auto; display: flex; flex-direction: column; padding: clamp(58px, 7vh, 72px) clamp(24px, 3vw, 56px) clamp(22px, 3vh, 30px); }
.detail-copy h2 { margin: 0 0 28px; font-size: clamp(19px, 3.2vw, 43px); line-height: 1; overflow-wrap: normal; word-break: normal; hyphens: none; text-wrap: balance; }
.detail-copy h2, #detailDescription { opacity: 1; transition: opacity .28s ease; }
#detailDescription { transition: opacity .34s ease-out .14s; }
.lightbox-card.is-changing .detail-copy h2,
.lightbox-card.is-changing #detailDescription { opacity: 0; }
.lightbox-card.is-changing #detailDescription { transition: opacity .18s ease; }
.detail-copy > p:not(.eyebrow), #detailDescription { color: var(--muted); font-size: var(--type-caption); line-height: 1.65; }
#detailDescription p { margin: 0 0 1em; white-space: pre-line; }
#detailDescription .detail-credit { font-size: var(--type-sm); line-height: 1.5; }
#detailDescription a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.detail-nav { position: relative; margin-top: auto; padding-top: 40px; display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 10px; border-top: 1px solid var(--line); }
.detail-nav button { padding: 0; border: 0; background: none; cursor: pointer; font-size: var(--type-sm); text-transform: uppercase; letter-spacing: .1em; }
.detail-nav button:first-child { justify-self: start; }
.detail-nav button:last-child { text-align: right; }
.detail-nav span { position: absolute; top: 40px; left: 50%; transform: translateX(-50%); font-size: var(--type-sm); color: var(--muted); font-variant-numeric: tabular-nums; }
body.modal-open { overflow: hidden; }
body > .masthead, body > main, body > footer { filter: blur(0); opacity: 1; transition: filter .3s ease, opacity .3s ease; }
body.modal-effect > .masthead, body.modal-effect > main, body.modal-effect > footer { filter: blur(7px); opacity: .1; }

.about-toggle,
.filter,
.filter-label,
.close,
.detail-nav button,
.footer-links,
.hero-index,
.hero-note,
.category-number,
.card-index,
.detail-nav span {
  font-family: "instrument-sans-variable", sans-serif;
}

@media (min-width: 841px) {
  .dek { margin-left: 0; font-size: clamp(var(--type-body-lg), 1.7vw, var(--type-title-lg)); }
  .hero {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    column-gap: clamp(16px, 1.8vw, 26px);
  }
  .hero-copy { grid-column: 2 / span 3; }
  .hero-note { grid-column: 5; }
  .category-section,
  .category-section[data-category="resistor"] {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 52px clamp(16px, 1.8vw, 26px);
  }
  .category-intro { container-type: inline-size; }
  .category-intro h2 { font-size: clamp(32px, 21cqi, 54px); }
  .category-intro h2 { transform: translateX(-3px); }
  .cards { grid-column: span 4; }
}
@media (max-width: 1180px) {
  .hero { grid-template-columns: minmax(70px, .65fr) minmax(0, 2.6fr) minmax(105px, .8fr); }
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 841px) and (max-width: 1180px) {
  .hero::before { background-position: 100% 19%; }
  .hero { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hero-copy { grid-column: 2 / span 2; }
  .hero-note { grid-column: 4; }
  .category-section,
  .category-section[data-category="resistor"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cards { grid-column: span 3; }
}
@media (min-width: 841px) and (max-width: 1280px) {
  .filter-bar { padding-inline: clamp(20px, 4vw, 64px); }
  .filter {
    flex: 1 1 auto;
    min-width: 0;
    margin-right: clamp(8px, 1.25vw, 16px);
    padding-right: clamp(4px, .75vw, 10px);
    font-size: clamp(var(--type-sm), 1vw, var(--type-caption));
    white-space: nowrap;
  }
  .filter:last-of-type { margin-right: 0; padding-right: 0; }
  .filter span { margin-left: clamp(3px, .4vw, 5px); }
}
@media (max-width: 840px) {
  .hero { min-height: 580px; grid-template-columns: 1fr; align-content: end; }
  .hero-index { margin-bottom: 80px; }.hero-note { display: none; }
  .category-section { grid-template-columns: 1fr; padding-top: 50px; }
  .category-intro { position: static; display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, .9fr); gap: 32px; align-items: end; }
  .category-intro p { margin: 0; }.cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .about-panel-inner { grid-template-columns: 1fr; }
  .about-panel-inner > p { padding-top: 0; }
  .lightbox-card { grid-template-columns: 1fr; }.detail-image-wrap { min-height: 0; aspect-ratio: 1; }
}
@media (min-width: 561px) and (max-width: 1100px) {
  .lightbox-card { grid-template-columns: minmax(0, 1.3fr) minmax(260px, .7fr); }
  .detail-image-wrap { min-height: 0; aspect-ratio: 1; }
  .detail-image-wrap img { width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; object-fit: cover; }
}
@media (min-width: 561px) and (max-width: 1266px), (min-width: 561px) and (max-height: 874px) {
  .lightbox { padding-inline: 42px; }
}
@media (min-width: 841px) and (max-width: 1512px) {
  .lightbox {
    --modal-y-margin: clamp(36px, 5vh, 52px);
    padding-block: var(--modal-y-margin);
  }
  .lightbox-card {
    width: min(1140px, 84vw, 128vh);
    max-height: calc(100dvh - (2 * var(--modal-y-margin)));
  }
  .detail-copy { max-height: 100%; }
}
@media (max-width: 560px) {
  .masthead { height: 60px; }
  main { padding-top: 60px; }
  .about-panel { scroll-margin-top: 60px; }
  .filter-bar { top: 60px; }
  .hero { min-height: 510px; padding-bottom: 42px; }
  .hero-index { margin-bottom: 62px; }
  .dek { margin: 24px 0 0; }
  .collection.is-filtered .category-section { min-height: calc(100vh - 117px); }
  .category-section { padding-top: 44px; padding-bottom: 54px; scroll-margin-top: 117px; }
  .category-intro { grid-template-columns: 1fr; gap: 0; }
  .category-intro p { margin-top: 20px; }
  .cards { grid-template-columns: 1fr; gap: 42px; }
  .card-title { min-height: 0; }
  .lightbox { padding: 10px; }
  .lightbox-card { width: 100%; max-height: calc(100vh - 20px); }
  .detail-copy { padding: 58px 24px 24px; }
  .detail-copy h2 { font-size: clamp(var(--type-title-md), 8vw, var(--type-title-2xl)); }
  .detail-nav { padding-top: 40px; }
  .detail-nav span { top: 40px; }
  .detail-nav button:last-child { justify-self: end; }
}
@media (orientation: landscape) and (max-height: 560px) {
  .lightbox { padding: 10px; }
  .lightbox-card {
    grid-template-columns: minmax(0, 1fr) minmax(240px, .72fr);
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
  }
  .detail-image-wrap { width: min(100%, calc(100dvh - 20px)); min-height: 0; aspect-ratio: 1; }
  .detail-image-wrap img { width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; object-fit: cover; }
  .detail-copy { padding: 54px 24px 18px; }
  .detail-copy h2 { margin-bottom: 16px; font-size: clamp(var(--type-title-sm), 3.5vw, var(--type-title-xl)); }
  .detail-nav { padding-top: 26px; }
  .detail-nav span { top: 26px; }
}
@media (max-width: 560px), (orientation: landscape) and (max-height: 560px) {
  .lightbox-card { box-shadow: 0 0 42px rgba(38,38,36,.11); }
}
@media (min-width: 2000px) {
  .lightbox { padding: 72px 48px 80px; }
  .lightbox-card {
    grid-template-columns: minmax(0, 1.3fr) minmax(240px, .7fr);
    width: min(3077px, calc(100vw - 96px), calc((100dvh - 152px) * 1.53846));
    max-height: calc(100dvh - 152px);
  }
  .detail-image-wrap { width: 100%; max-width: 2000px; min-height: 0; aspect-ratio: 1; }
  .detail-copy { max-height: calc(100dvh - 152px); }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } .hero.slideshow-ready::before { opacity: 1; } }
