:root {
  color-scheme: dark;
  --page: #141416;
  --panel: #1b1b1e;
  --panel-deep: #18181b;
  --line: #323033;
  --text: #f7f2ed;
  --muted: #b7afb0;
  --accent: #ffab64;
  --accent-light: #ffc994;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  min-width: 280px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--page);
  background-image: linear-gradient(#141416 0, #141416e6 17rem, #141416 54rem), url("./assets/wallpaper01.jpg");
  background-position: center top;
  background-size: auto, max(100vw, 76rem) auto;
  background-repeat: no-repeat;
  color: var(--text);
  font: 1rem/1.55 var(--sans);
}

a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }

:focus-visible {
  outline: 2px solid var(--accent-light);
  outline-offset: 4px;
}

.sr-only, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link:focus {
  position: fixed;
  z-index: 5;
  top: 1rem;
  left: 1rem;
  padding: .6rem 1rem;
  border-radius: .35rem;
  background: var(--accent);
  color: var(--page);
}

.shell { width: min(100% - 5rem, 76rem); margin-inline: auto; }
.site-header { border-bottom: 1px solid #30282a; background: #171618; }

.header-inner, .header-nav, .brand, .footer-inner {
  display: flex;
  align-items: center;
}

.header-inner { min-height: 4.375rem; justify-content: space-between; gap: 1rem; }
.brand { gap: .6rem; font-size: 1.5rem; font-weight: 800; letter-spacing: -.075rem; white-space: nowrap; }
.brand img { object-fit: contain; }
.brand-accent { color: var(--accent); }
.header-nav { gap: 1.8rem; font-size: .9rem; font-weight: 600; }
.nav-catalog { color: var(--muted); }
.nav-catalog:hover, .footer-link:hover { color: var(--accent-light); }

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: .55rem;
  min-height: 2.8rem;
  padding: .58rem 1.05rem;
  border: 1px solid transparent;
  border-radius: .45rem;
  font-size: .9rem;
  font-weight: 720;
  text-align: center;
  transition: color .15s, background-color .15s, border-color .15s;
}

.button-outline { color: var(--accent-light); border-color: #724b38; background: #261f1e; }
.button-outline:hover { background: #342420; border-color: var(--accent); }
.button-primary { background: var(--accent); color: #24150f; }
.button-primary:hover { background: var(--accent-light); }
.header-submit { min-height: 2.4rem; }

.plus-icon {
  width: .85rem;
  height: .85rem;
  flex: 0 0 auto;
  background: linear-gradient(currentColor,currentColor) center / 2px 100% no-repeat,
              linear-gradient(currentColor,currentColor) center / 100% 2px no-repeat;
}

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 26.5rem;
  margin-top: 1.65rem;
  border: 1px solid #483333;
  border-radius: .85rem;
  background:
    linear-gradient(90deg, #211a1d 0%, #241b1e 28%, #2b2022e8 48%, #3022244f 74%, #20191eb8 100%),
    url("./assets/wallpaper01.jpg") center 43% / cover no-repeat;
}

.hero-copy { position: relative; z-index: 1; width: fit-content; max-width: 65%; padding: 2.65rem 0 2.9rem 3.1rem; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin: 0 0 .9rem;
  color: var(--accent-light);
  font: 600 .84rem/1.4 var(--sans);
  letter-spacing: .09em;
  text-transform: uppercase;
}
.eyebrow span { width: 1.4rem; height: 1px; flex: 0 0 auto; background: var(--accent); }

.hero h1 {
  margin: 0;
  font-size: clamp(2.25rem, 4.5vw, 3.75rem);
  font-weight: 780;
  letter-spacing: -.052em;
  line-height: 1.02;
}

.hero h1 em { display: block; color: var(--accent); font-style: normal; }

.hero-description {
  max-width: 29rem;
  margin: 1.12rem 0 1.48rem;
  color: #ded2d1;
  line-height: 1.55;
}

.hero-art {
  position: absolute;
  inset: 0 0 0 52%;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at 54% 46%, #cb6b363b, transparent 60%);
  pointer-events: none;
}

.board-frame {
  position: relative;
  display: grid;
  place-items: center;
  width: min(70%, 19rem);
  aspect-ratio: 1;
  margin-left: .8rem;
  color: #c37c61;
}

.board-frame::before, .board-frame::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(currentColor,currentColor) left top / 1.5rem 1px no-repeat,
    linear-gradient(currentColor,currentColor) left top / 1px 1.5rem no-repeat,
    linear-gradient(currentColor,currentColor) right bottom / 1.5rem 1px no-repeat,
    linear-gradient(currentColor,currentColor) right bottom / 1px 1.5rem no-repeat;
}

.board-frame::after { transform: scaleX(-1); opacity: .65; }

.board-ring {
  position: absolute;
  inset: 7%;
  border: 1px dashed #cc846280;
  border-radius: 50%;
  background: radial-gradient(circle, #6536282b, #3a252333);
  box-shadow: 0 0 0 1rem #e8a1800b;
}

.chip {
  position: relative;
  display: grid;
  place-items: center;
  width: 47%;
  aspect-ratio: 1;
  transform: rotate(-12deg);
  border: 1px solid #d4825f;
  border-radius: 12%;
  background: linear-gradient(145deg, #59342e, #282125 75%);
  box-shadow: inset 0 0 0 6px #ae68432f, 0 0 45px #ec834596;
}

.chip::before {
  position: absolute;
  top: 9%;
  left: 9%;
  width: 6%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #ffad78;
  box-shadow: 0 0 10px #f0955a;
  content: "";
}

.chip-pins { position: absolute; pointer-events: none; }
.chip-pins-top {
  inset: -11% 12%;
  background: repeating-linear-gradient(90deg, transparent 0 5%, #ec9267 5% 8%, transparent 8% 10%);
  clip-path: polygon(0 0, 100% 0, 100% 9%, 0 9%, 0 91%, 100% 91%, 100% 100%, 0 100%);
}
.chip-pins-side {
  inset: 12% -11%;
  background: repeating-linear-gradient(0deg, transparent 0 5%, #ec9267 5% 8%, transparent 8% 10%);
  clip-path: polygon(0 0, 9% 0, 9% 100%, 91% 100%, 91% 0, 100% 0, 100% 100%, 0 100%);
}

.chip-die {
  display: grid;
  grid-template-columns: 1.3fr .8fr;
  grid-template-rows: 1.2fr .8fr;
  gap: 5%;
  width: 57%;
  padding: 6%;
  aspect-ratio: 1;
  border: 1px solid #e9a882;
  border-radius: 7%;
  background: #322024;
  box-shadow: 0 0 0 4px #d38e6525;
}

.chip-die i { border: 1px solid #df9368; border-radius: 2px; background: linear-gradient(135deg, #b36c52, #753b35); }
.chip-die i:nth-child(2), .chip-die i:nth-child(3) { opacity: .68; }

.catalog { margin: 3rem 0 3.75rem; scroll-margin-top: 1.2rem; }
.catalog-intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem 2rem; margin-bottom: 1.25rem; }
.catalog h2, .contribute h2 { margin: 0; font-size: clamp(1.65rem, 3vw, 2.25rem); letter-spacing: -.045em; line-height: 1.12; }
.catalog-intro p, .contribute-copy p { margin: .55rem 0 0; color: var(--muted); }

.search { position: relative; width: min(100%, 24rem); }
.search input {
  width: 100%;
  min-height: 2.85rem;
  padding: .6rem .9rem .6rem 2.6rem;
  border: 1px solid #434046;
  border-radius: .45rem;
  background: var(--panel);
  color: var(--text);
}
.search input::placeholder, .contribute input::placeholder, .contribute textarea::placeholder { color: #b3abac; }
.search-icon {
  position: absolute;
  top: 50%;
  left: 1rem;
  width: .82rem;
  height: .82rem;
  transform: translateY(-60%);
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  pointer-events: none;
}
.search-icon::after {
  position: absolute;
  right: -.31rem;
  bottom: -.19rem;
  width: .4rem;
  height: 1.5px;
  transform: rotate(48deg);
  background: var(--accent);
  content: "";
}

.catalog-layout { display: grid; grid-template-columns: 14rem minmax(0, 1fr); align-items: start; gap: 1.2rem; }
.filter-panel { padding: .8rem; border: 1px solid var(--line); border-radius: .6rem; background: var(--panel-deep); }
.filter-panel h3 { margin: .24rem .55rem .7rem; color: #ddd1d0; font-size: .9rem; font-weight: 700; }
.filter-panel ul, .file-list { margin: 0; padding: 0; list-style: none; }

.filter-link {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .4rem;
  padding: .43rem .55rem;
  border: 1px solid transparent;
  border-radius: .35rem;
  color: var(--muted);
  font-size: .89rem;
  font-weight: 650;
}
.filter-link:hover { background: #262226; color: var(--text); }
.filter-link[aria-current] { border-color: #684633; background: #30231f; color: var(--accent-light); }
.filter-count { color: #c7b6b4; font: .82rem/1.3 var(--mono); }
.filter-link[aria-current] .filter-count { color: var(--accent-light); }

.results {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: .6rem;
  background: var(--panel);
}

.results-bar {
  min-height: 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .6rem;
  padding: .55rem 1.05rem;
}
.results-bar p { margin: 0; color: var(--muted); font-size: .9rem; font-weight: 660; scroll-margin-top: 1.25rem; }
.text-button { padding: .1rem 0; border: 0; background: none; color: var(--accent-light); font-size: .88rem; }
.text-button:hover { text-decoration: underline; }

.file-columns, .file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 5.25rem 4.55rem;
  align-items: center;
  gap: .8rem;
  padding-inline: 1.05rem;
}

.file-columns {
  border-block: 1px solid var(--line);
  background: #1e1d21;
  padding-block: .55rem;
  color: #bcb1b5;
  font-size: .77rem;
  font-weight: 700;
  letter-spacing: .075em;
  text-transform: uppercase;
}
.file-columns span:last-child { text-align: center; }

.file-group { scroll-margin-top: 1rem; }
.group-title {
  display: flex;
  align-items: baseline;
  gap: .65rem;
  margin: 0;
  padding: .62rem 1.05rem;
  border-bottom: 1px solid var(--line);
  background: #262023;
  color: var(--accent-light);
  font-size: .96rem;
  font-weight: 750;
}
.file-group + .file-group .group-title { border-top: 1px solid var(--line); }
.group-count { color: var(--muted); font-size: .82rem; font-weight: 540; }

.file-row { min-height: 3rem; transition: background-color .15s; }
.file-row + .file-row { border-top: 1px solid #302d32; }
.file-row:hover, .file-row:focus-within { background: #252126; }
.file-name {
  justify-self: start;
  padding: .62rem 0;
  font: .9rem/1.4 var(--mono);
  overflow-wrap: anywhere;
}
.file-name:hover { color: var(--accent-light); text-decoration: underline; text-underline-offset: .2rem; }
.file-type {
  justify-self: start;
  padding: .11rem .38rem;
  border: 1px solid #53454a;
  border-radius: .3rem;
  background: #2a2529;
  color: #ded0d5;
  font: .73rem/1.4 var(--mono);
}
.type-pdf { color: #fac8af; background: #332624; border-color: #64483f; }

.file-download {
  display: grid;
  justify-self: center;
  place-items: center;
  width: 2.55rem;
  min-height: 2.5rem;
  border: 1px solid transparent;
  border-radius: .35rem;
}
.file-download:hover { border-color: #6c4b37; background: #382b25; }
.file-download img { object-fit: contain; }

.pagination, .page-numbers {
  display: flex;
  align-items: center;
  gap: .3rem;
}
.pagination {
  justify-content: center;
  padding: .8rem .65rem;
  border-top: 1px solid var(--line);
}
.page-numbers { justify-content: center; flex-wrap: wrap; }
.page-button {
  display: grid;
  place-items: center;
  min-width: 2.2rem;
  min-height: 2.3rem;
  padding: 0 .3rem;
  border: 1px solid var(--line);
  border-radius: .36rem;
  background: var(--panel-deep);
  color: var(--text);
  font-size: .9rem;
}
.page-button:hover:not(:disabled), .page-button[aria-current="page"] {
  border-color: #724b38;
  background: #30231f;
  color: var(--accent-light);
}
.page-button:disabled { cursor: default; opacity: .48; }
.page-arrow span {
  width: .44rem;
  height: .44rem;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: translateX(-1px) rotate(45deg);
}
#previous-page span { transform: translateX(1px) rotate(-135deg); }
.page-gap { min-width: .9rem; color: var(--muted); text-align: center; }

.empty-state { padding: 1.65rem 1.05rem; border-top: 1px solid var(--line); }
.empty-state p { margin: 0 0 .3rem; color: var(--muted); }
.empty-state strong { color: var(--text); }

.contribute {
  display: grid;
  grid-template-columns: 1fr minmax(0, 1fr);
  gap: 1.65rem 3rem;
  margin-bottom: 3.25rem;
  padding: 2rem 2.25rem;
  border: 1px solid #573e35;
  border-radius: .75rem;
  background:
    linear-gradient(105deg, #291f22 0%, #231d20 53%, #1b1a1d 78%),
    #211b1e;
  scroll-margin-top: 1rem;
}
.contribute-copy img { width: 1.9rem; height: 2.45rem; object-fit: contain; margin-bottom: .8rem; }
.contribute-copy p { max-width: 25rem; }
.contribute label { display: block; margin-bottom: .28rem; color: #e6d8d7; font-size: .88rem; font-weight: 650; }
.contribute label span { color: var(--muted); font-weight: 400; }
.contribute input, .contribute textarea {
  display: block;
  width: 100%;
  min-height: 2.65rem;
  margin-bottom: .85rem;
  padding: .4rem .65rem;
  border: 1px solid #4a4046;
  border-radius: .4rem;
  background: #211e22;
  color: var(--text);
  font-size: .9rem;
}
.contribute textarea { resize: vertical; }
#form-status { margin: .65rem 0 0; color: var(--muted); font-size: .88rem; }
#form-status:empty { margin: 0; }

.site-footer { border-top: 1px solid #342c30; background: #181619; }
.footer-inner { min-height: 5rem; flex-wrap: wrap; gap: .65rem 1.3rem; padding-block: .85rem; }
.footer-brand { font-size: 1.15rem; letter-spacing: -.04rem; }
.footer-inner p { margin: 0; color: var(--muted); font-size: .88rem; }
.footer-link { margin-left: auto; color: var(--muted); font-size: .88rem; }

@media (max-width: 60rem) {
  .shell { width: calc(100% - 3rem); }
  .hero-copy { padding-left: 2rem; max-width: 68%; }
  .hero-art { left: 50%; }
  .catalog-layout { grid-template-columns: 12rem minmax(0, 1fr); gap: 1rem; }
  .file-columns, .file-row { grid-template-columns: minmax(0, 1fr) 4rem 4rem; }
}

@media (max-width: 44rem) {
  .shell { width: calc(100% - 2rem); }
  .header-inner { min-height: 3.7rem; }
  .header-nav { gap: .9rem; }
  .nav-catalog { display: none; }
  .brand { font-size: 1.32rem; }
  .brand img { width: 2.1rem; height: 2.1rem; }
  .hero { min-height: auto; margin-top: 1.05rem; background-position: 62% center; }
  .hero-copy { width: 100%; max-width: none; padding: 1.8rem 1.25rem 1.45rem; }
  .hero h1 { font-size: clamp(2rem, 6.3vw, 3.2rem); }
  .hero-description { max-width: 23rem; margin-block: .95rem 1.15rem; }
  .hero-art { display: none; }
  .catalog { margin-block: 2.35rem 2.65rem; }
  .catalog-intro { align-items: stretch; flex-direction: column; }
  .catalog-layout { grid-template-columns: 1fr; }
  .filter-panel { padding: .6rem; }
  .filter-panel h3 { margin: .15rem .3rem .45rem; }
  .filter-panel ul { display: flex; flex-wrap: wrap; gap: .2rem; }
  .filter-link { gap: .38rem; padding: .3rem .36rem; }
  .file-columns, .file-row { gap: .4rem; }
  .contribute { grid-template-columns: 1fr; gap: 1.15rem; margin-bottom: 2.5rem; padding: 1.15rem; }
}

@media (max-width: 30rem) {
  .header-inner { gap: .45rem; }
  .header-submit { padding-inline: .55rem; font-size: .82rem; }
  .header-submit .plus-icon { display: none; }
  .file-columns, .file-row {
    grid-template-columns: minmax(0, 1fr) 3.15rem 2.25rem;
    padding-inline: .65rem;
  }
  .file-columns span:last-child { font-size: 0; }
  .file-name { font-size: .82rem; }
  .file-download { width: 2.25rem; }
  .group-title, .results-bar { padding-inline: .65rem; }
  .pagination, .page-numbers { gap: .125rem; }
  .pagination { padding-inline: .25rem; }
  .page-button { min-width: 1.62rem; }
  .footer-inner { gap: .35rem .85rem; }
  .footer-inner p { order: 1; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
