:root {
  --bg: #f6f8f6;
  --surface: #ffffff;
  --surface-alt: #eef3f1;
  --text: #14211d;
  --muted: #61706b;
  --line: #d8e1dd;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --amber: #b86b13;
  --berry: #8b2f5b;
  --shadow: 0 20px 50px rgba(17, 33, 29, 0.08);
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(246, 248, 246, 0.95)),
    var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px clamp(18px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  width: 42px;
  aspect-ratio: 1;
  border: 1px solid rgba(15, 118, 110, 0.35);
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent 47%, rgba(15, 118, 110, 0.22) 47% 53%, transparent 53%),
    linear-gradient(0deg, transparent 47%, rgba(184, 107, 19, 0.25) 47% 53%, transparent 53%),
    radial-gradient(circle at 68% 32%, rgba(139, 47, 91, 0.9) 0 12%, transparent 13%),
    radial-gradient(circle at 32% 68%, rgba(15, 118, 110, 0.9) 0 14%, transparent 15%),
    #f8fbfa;
  box-shadow: inset 0 0 0 6px rgba(255, 255, 255, 0.62);
  flex: 0 0 auto;
}

h1,
h2,
h3,
p,
dl {
  margin: 0;
}

h1 {
  font-size: clamp(1.35rem, 2.2vw, 2rem);
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  letter-spacing: 0;
}

h3 {
  font-size: 1rem;
  line-height: 1.3;
  letter-spacing: 0;
}

.eyebrow {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 760;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(86px, 1fr));
  gap: 10px;
  width: min(520px, 48vw);
}

.stats div {
  border-left: 1px solid var(--line);
  padding-left: 16px;
}

.stats dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.stats dd {
  margin: 2px 0 0;
  font-size: 1.08rem;
  font-weight: 780;
}

main {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 26px clamp(18px, 4vw, 48px) 52px;
}

.controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(170px, 220px) minmax(150px, 180px) auto;
  align-items: end;
  gap: 14px;
  padding: 16px 0 18px;
}

.search,
.select-wrap {
  display: grid;
  gap: 7px;
}

.search span,
.select-wrap label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 740;
}

input,
select,
.ghost-button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

input,
select {
  width: 100%;
  padding: 0 13px;
}

input:focus,
select:focus,
button:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.18);
  border-color: var(--accent);
}

.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  color: var(--accent-strong);
  font-weight: 760;
}

.ghost-button:hover {
  border-color: rgba(15, 118, 110, 0.55);
  background: #f9fcfb;
}

.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 22px;
  scrollbar-width: thin;
}

.category-tab {
  min-height: 36px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  padding: 0 14px;
  font-weight: 760;
}

.category-tab[aria-pressed="true"] {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
}

.card-media {
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 0;
  padding: 0;
  color: inherit;
  text-decoration: none;
  background:
    linear-gradient(45deg, rgba(216, 225, 221, 0.45) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(216, 225, 221, 0.45) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(216, 225, 221, 0.45) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(216, 225, 221, 0.45) 75%),
    #f8fbfa;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 720;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  background: var(--surface-alt);
  padding: 0 10px;
  color: var(--accent-strong);
}

.info-card:hover {
  border-color: rgba(15, 118, 110, 0.42);
  transform: translateY(-1px);
}

.gallery {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 30px;
  width: min(1120px, 100%);
  margin: 0 auto;
}

.info-card {
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: inherit;
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.info-card:hover {
  box-shadow: 0 22px 58px rgba(17, 33, 29, 0.12);
}

.card-media {
  min-height: 230px;
  height: min(29vh, 310px);
  border-bottom: 1px solid var(--line);
}

.pdf-preview {
  position: relative;
  isolation: isolate;
}

.pdf-preview iframe {
  position: absolute;
  inset: -1px;
  width: calc(100% + 2px);
  height: calc(100% + 2px);
  border: 0;
  background: #fff;
  pointer-events: none;
  z-index: 2;
}

.pdf-label {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(184, 107, 19, 0.32);
  border-radius: 999px;
  background: rgba(255, 248, 239, 0.92);
  color: var(--amber);
  padding: 0 10px;
  font-size: 0.78rem;
  font-weight: 850;
  box-shadow: 0 8px 20px rgba(17, 33, 29, 0.08);
}

.pdf-fallback {
  display: grid;
  place-items: center;
  width: min(72%, 220px);
  aspect-ratio: 4 / 5;
  border: 1px solid rgba(20, 33, 29, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(#fff 0 0) padding-box,
    linear-gradient(135deg, rgba(15, 118, 110, 0.42), rgba(184, 107, 19, 0.42)) border-box;
  color: var(--text);
  padding: 18px;
  text-align: center;
  box-shadow: 0 18px 32px rgba(17, 33, 29, 0.1);
}

.pdf-fallback span {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  font-size: 0.95rem;
  font-weight: 820;
  line-height: 1.25;
}

.card-copy {
  display: grid;
  gap: 14px;
  padding: 18px 20px 20px;
}

.card-copy h3 {
  font-size: clamp(1.1rem, 1.7vw, 1.45rem);
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.text-button,
.open-note {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  min-height: 36px;
  padding: 0 12px;
  font-weight: 780;
  text-decoration: none;
}

.text-button:hover,
.info-card:hover .open-note {
  background: var(--accent-strong);
}

.file-note {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 260px;
  border: 1px dashed rgba(97, 112, 107, 0.5);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--muted);
  text-align: center;
}

.empty-state[hidden],
.gallery[hidden] {
  display: none;
}

.empty-state strong {
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.9rem;
}

.site-footer {
  display: flex;
  justify-content: center;
  padding: 0 clamp(18px, 4vw, 48px) 34px;
}

.footer-link {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 740;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.footer-link:hover {
  color: var(--accent-strong);
}

.disclaimer-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(12, 19, 17, 0.58);
  backdrop-filter: blur(10px);
}

.disclaimer-modal[hidden] {
  display: none;
}

.disclaimer-card {
  display: grid;
  gap: 16px;
  width: min(680px, 100%);
  border: 1px solid rgba(216, 225, 221, 0.9);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 26px 90px rgba(17, 33, 29, 0.25);
  padding: clamp(22px, 4vw, 34px);
}

.disclaimer-copy {
  display: grid;
  gap: 12px;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.58;
}

.primary-button {
  justify-self: start;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  padding: 0 18px;
  font-weight: 820;
}

.primary-button:hover {
  background: var(--accent-strong);
}

@media (max-width: 920px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .stats {
    width: 100%;
  }

  .controls {
    grid-template-columns: 1fr;
  }

  .gallery {
    gap: 22px;
  }

  .card-media {
    min-height: 200px;
    height: 27vh;
  }
}

@media (max-width: 560px) {
  .topbar {
    position: static;
    padding: 22px 16px;
  }

  main {
    padding: 18px 16px 36px;
  }

  .brand {
    align-items: flex-start;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .stats div {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 10px 0 0;
  }

  .gallery {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .card-media {
    min-height: 170px;
    height: 24vh;
  }

  .card-copy {
    padding: 15px;
  }

}
