/* =========================================================
   文枢 · 公文范文库
   A warm, paper-toned archive for official documents
   ========================================================= */

:root {
  --paper: #f1e8d9;
  --paper-soft: #f6efe3;
  --paper-bright: #fbf6ec;
  --paper-white: #fffdf8;
  --paper-deep: #e7dac6;
  --ink: #2b211a;
  --ink-soft: #4e4034;
  --ink-muted: #7d6b5c;
  --ink-faint: #9d8b79;
  --line: rgba(72, 52, 36, 0.14);
  --line-strong: rgba(72, 52, 36, 0.26);
  --red: #a43b2c;
  --red-deep: #7e291e;
  --red-soft: rgba(164, 59, 44, 0.1);
  --gold: #b18a55;
  --green: #526b58;
  --serif: "Source Han Serif SC", "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "Source Han Sans SC", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --shadow-sm: 0 2px 10px rgba(61, 42, 27, 0.05);
  --shadow-md: 0 18px 44px rgba(61, 42, 27, 0.1);
  --shadow-lg: 0 34px 80px rgba(44, 29, 18, 0.18);
  --header-h: 76px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 22px);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(1100px 720px at 88% -12%, rgba(190, 148, 95, 0.2), transparent 62%),
    radial-gradient(820px 620px at -12% 28%, rgba(164, 59, 44, 0.06), transparent 66%),
    linear-gradient(180deg, #f4ecdf 0%, var(--paper) 46%, #eee3d2 100%);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.16;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.78' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

body.modal-open {
  overflow: hidden;
}

::selection {
  color: var(--paper-white);
  background: var(--red);
}

img,
svg {
  display: block;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 12000;
  padding: 10px 18px;
  background: var(--ink);
  color: var(--paper-white);
  font-size: 13px;
  transform: translateY(-150%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* =========================================================
   Header
   ========================================================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(243, 236, 223, 0.82);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.site-header.is-scrolled {
  background: rgba(246, 239, 227, 0.94);
  border-bottom-color: var(--line);
  box-shadow: 0 10px 30px rgba(61, 42, 27, 0.06);
}

.header__inner {
  width: min(1240px, 100%);
  height: 100%;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  gap: 34px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.brand__seal {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #f8efe0;
  background: var(--red);
  border-radius: 5px;
  box-shadow: inset 0 0 0 1px rgba(255, 248, 236, 0.28), 0 5px 14px rgba(164, 59, 44, 0.25);
  font-family: var(--serif);
  font-size: 25px;
  line-height: 1;
  transform: rotate(-2deg);
}

.brand__seal--sm {
  width: 34px;
  height: 34px;
  font-size: 20px;
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand__text strong {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.brand__text em {
  margin-top: 4px;
  color: var(--ink-muted);
  font-size: 9px;
  font-style: normal;
  letter-spacing: 0.32em;
}

.nav {
  display: flex;
  align-items: center;
  gap: 28px;
  flex: 0 0 auto;
}

.nav__link {
  position: relative;
  padding: 8px 0;
  color: var(--ink-soft);
  font-size: 13px;
  letter-spacing: 0.1em;
  transition: color 0.2s ease;
}

.nav__link::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--red);
  opacity: 0;
  transform: translateX(-50%) scale(0.4);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.nav__link:hover,
.nav__link.is-active {
  color: var(--ink);
}

.nav__link:hover::after,
.nav__link.is-active::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.header-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  width: min(300px, 26vw);
  height: 40px;
  margin-left: auto;
  padding: 0 12px;
  background: rgba(255, 252, 245, 0.56);
  border: 1px solid var(--line);
  border-radius: 3px;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.header-search:focus-within {
  background: var(--paper-white);
  border-color: var(--line-strong);
  box-shadow: 0 6px 20px rgba(61, 42, 27, 0.06);
}

.header-search > .icon {
  width: 16px;
  height: 16px;
  color: var(--ink-faint);
}

.header-search input {
  width: 100%;
  min-width: 0;
  padding: 0;
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 12.5px;
}

.header-search input::placeholder {
  color: var(--ink-faint);
}

.header-search input::-webkit-search-cancel-button {
  display: none;
}

.search-kbd {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--ink-faint);
  border: 1px solid var(--line);
  border-radius: 3px;
  font-family: var(--sans);
  font-size: 10px;
  line-height: 1;
}

.search-clear {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  color: var(--ink-muted);
  background: transparent;
  border: 0;
  border-radius: 50%;
}

.search-clear:hover {
  color: var(--red);
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 0 0 auto;
}

.header__link {
  color: var(--ink-muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  transition: color 0.2s ease;
}

.header__link:hover {
  color: var(--red);
}

/* =========================================================
   Buttons
   ========================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  white-space: nowrap;
  transition: background 0.24s ease, color 0.24s ease, border-color 0.24s ease, transform 0.24s var(--ease), box-shadow 0.24s ease;
}

.btn .icon {
  width: 16px;
  height: 16px;
}

.btn--sm {
  height: 38px;
  padding: 0 15px;
  font-size: 12px;
}

.btn--lg {
  height: 52px;
  padding: 0 26px;
  font-size: 13px;
}

.btn--ink {
  color: #f8f0e2;
  background: var(--ink);
  border-color: var(--ink);
  box-shadow: 0 8px 22px rgba(43, 33, 26, 0.14);
}

.btn--ink:hover {
  background: var(--red);
  border-color: var(--red);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(164, 59, 44, 0.22);
}

.btn--line {
  color: var(--ink);
  border-color: var(--line-strong);
  background: transparent;
}

.btn--line:hover {
  color: var(--red);
  border-color: var(--red);
  background: rgba(255, 253, 248, 0.55);
  transform: translateY(-2px);
}

.btn--ghost {
  color: var(--ink-muted);
  border-color: transparent;
}

.btn--ghost:hover {
  color: var(--ink);
  background: rgba(72, 52, 36, 0.05);
}

.btn--paper {
  color: var(--ink);
  background: var(--paper-bright);
  border-color: var(--paper-bright);
}

.btn--paper:hover {
  background: var(--paper-white);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.2);
}

.btn--danger-ghost {
  color: var(--red);
  border-color: rgba(164, 59, 44, 0.26);
  background: transparent;
}

.btn--danger-ghost:hover,
.btn--danger-ghost.is-confirming {
  color: var(--paper-white);
  background: var(--red);
  border-color: var(--red);
}

.btn[disabled] {
  cursor: wait;
  opacity: 0.6;
  transform: none !important;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  color: var(--ink-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 50%;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.icon-btn:hover {
  color: var(--ink);
  background: rgba(72, 52, 36, 0.06);
  border-color: var(--line);
}

.text-btn {
  padding: 2px 0;
  color: var(--red);
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(164, 59, 44, 0.35);
  font-size: 12px;
}

/* =========================================================
   Shared type
   ========================================================= */

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

.eyebrow__line {
  width: 26px;
  height: 1px;
  background: var(--red);
}

.eyebrow--light {
  color: rgba(248, 240, 226, 0.6);
}

.eyebrow--light .eyebrow__line {
  background: rgba(248, 240, 226, 0.45);
}

.section {
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 96px 32px;
}

.section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 42px;
}

.section__title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(34px, 4vw, 48px);
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: 0.04em;
}

.section__intro {
  max-width: 390px;
  margin: 0 0 5px;
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.95;
}

/* =========================================================
   Hero
   ========================================================= */

.hero {
  position: relative;
  padding-top: 26px;
}

.hero__inner {
  width: min(1240px, 100%);
  min-height: 610px;
  margin: 0 auto;
  padding: 66px 32px 54px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  align-items: center;
  gap: clamp(32px, 5vw, 76px);
}

.hero__copy {
  position: relative;
  z-index: 2;
  padding-bottom: 10px;
}

.hero__title {
  margin: 0 0 28px;
  font-family: var(--serif);
  font-size: clamp(52px, 6.4vw, 82px);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: 0.045em;
}

.hero__title span {
  position: relative;
  color: var(--red);
}

.hero__title span::after {
  content: "";
  position: absolute;
  right: -4px;
  bottom: 2px;
  left: 0;
  height: 9px;
  background: linear-gradient(90deg, rgba(164, 59, 44, 0.16), rgba(164, 59, 44, 0.02));
  transform: skewX(-8deg);
  z-index: -1;
}

.hero__desc {
  max-width: 520px;
  margin: 0 0 34px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 2.05;
  letter-spacing: 0.02em;
}

.hero__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hero__stats {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin: 46px 0 0;
  padding: 22px 0 0;
  border-top: 1px solid var(--line);
  max-width: 490px;
}

.hero__stats div {
  flex: 1;
  padding-right: 18px;
}

.hero__stats div + div {
  padding-left: 26px;
  border-left: 1px solid var(--line);
}

.hero__stats dt {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 600;
  line-height: 1.1;
}

.hero__stats dd {
  margin: 6px 0 0;
  color: var(--ink-muted);
  font-size: 10px;
  letter-spacing: 0.13em;
}

.hero__art {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 470px;
}

.archive {
  position: relative;
  width: 398px;
  height: 474px;
  perspective: 1200px;
}

.archive__sheet {
  position: absolute;
  inset: 20px 16px 12px;
  background: #e8dac5;
  border: 1px solid rgba(91, 66, 44, 0.13);
  box-shadow: 0 16px 34px rgba(60, 40, 24, 0.08);
}

.archive__sheet--a {
  transform: rotate(4.5deg) translate(9px, 8px);
}

.archive__sheet--b {
  transform: rotate(2.2deg) translate(3px, 3px);
  background: #efe3d0;
}

.archive__paper {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 30px 28px 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.35), transparent 42%),
    repeating-linear-gradient(0deg, transparent 0, transparent 27px, rgba(91, 66, 44, 0.025) 28px),
    var(--paper-white);
  border: 1px solid rgba(91, 66, 44, 0.16);
  box-shadow: 0 26px 60px rgba(60, 40, 24, 0.16), 0 2px 0 rgba(255, 255, 255, 0.6) inset;
  transform: rotate(-1.2deg);
}

.archive__paper::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 34px;
  height: 34px;
  background: linear-gradient(225deg, var(--paper) 50%, #dfd1bd 50.5%, #f7efe2 52%);
  box-shadow: -2px 2px 5px rgba(60, 40, 24, 0.08);
}

.archive__top {
  display: flex;
  justify-content: space-between;
  padding-right: 30px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-strong);
  color: var(--ink-muted);
  font-size: 9px;
  letter-spacing: 0.24em;
}

.archive__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 10px 0 0;
  flex: 1;
}

.archive__item {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 8px 4px;
  border-bottom: 1px dotted rgba(72, 52, 36, 0.11);
}

.archive__item:nth-child(3n + 2) {
  border-left: 1px dotted rgba(72, 52, 36, 0.11);
  border-right: 1px dotted rgba(72, 52, 36, 0.11);
  padding-left: 9px;
}

.archive__item:nth-child(3n) {
  padding-left: 9px;
}

.archive__item-no {
  color: var(--red);
  font-family: var(--serif);
  font-size: 8px;
  opacity: 0.75;
}

.archive__item-name {
  font-family: var(--serif);
  font-size: 13.5px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.archive__foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.archive__mark {
  color: var(--ink-faint);
  font-family: var(--serif);
  font-size: 10px;
  letter-spacing: 0.34em;
  writing-mode: vertical-rl;
  line-height: 1.6;
  height: 58px;
}

.archive__seal {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  color: var(--red);
  border: 2px solid var(--red);
  border-radius: 5px;
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.08em;
  text-align: center;
  opacity: 0.86;
  transform: rotate(4deg);
}

.archive__tab {
  position: absolute;
  top: 94px;
  right: -30px;
  padding: 14px 8px;
  color: var(--paper-bright);
  background: var(--red);
  font-family: var(--serif);
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: 0.18em;
  writing-mode: vertical-rl;
  box-shadow: 4px 6px 16px rgba(164, 59, 44, 0.24);
}

.archive__note {
  position: absolute;
  bottom: -34px;
  left: 8px;
  color: var(--ink-faint);
  font-size: 9px;
  letter-spacing: 0.14em;
}

.hero__stamp {
  position: absolute;
  right: 0;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 92px;
  height: 92px;
  color: rgba(164, 59, 44, 0.64);
  border: 2px solid rgba(164, 59, 44, 0.32);
  border-radius: 50%;
  transform: rotate(9deg);
  text-align: center;
}

.hero__stamp::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(164, 59, 44, 0.22);
  border-radius: 50%;
}

.hero__stamp span {
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1;
}

.hero__stamp small {
  margin-top: 4px;
  font-size: 8px;
  letter-spacing: 0.16em;
}

.hero__foot {
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 0 32px 26px;
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--ink-faint);
  font-size: 9px;
  letter-spacing: 0.2em;
}

.hero__foot-line {
  flex: 1;
  height: 1px;
  background: var(--line);
}

.hero__foot-quote {
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.16em;
}

/* =========================================================
   Categories
   ========================================================= */

.section--categories {
  padding-top: 86px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: rgba(255, 250, 241, 0.18);
}

.category {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 174px;
  padding: 21px 20px 17px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
  transition: background 0.28s ease, color 0.28s ease;
}

.category:nth-child(5n) {
  border-right: 0;
}

.category:nth-last-child(-n + 5) {
  border-bottom: 0;
}

.category::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.36s var(--ease);
}

.category:hover {
  background: rgba(255, 252, 245, 0.74);
}

.category:hover::before,
.category.is-active::before {
  transform: scaleX(1);
}

.category.is-active {
  color: var(--paper-bright);
  background: var(--ink);
}

.category.is-active::before {
  background: var(--red);
}

.category__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: auto;
}

.category__no {
  color: var(--ink-faint);
  font-family: var(--serif);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.category__count {
  color: var(--ink-faint);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.category__name {
  display: block;
  margin: 22px 0 7px;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.08em;
}

.category__desc {
  display: block;
  color: var(--ink-muted);
  font-size: 10.5px;
  line-height: 1.65;
  letter-spacing: 0.02em;
}

.category__arrow {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 14px;
  height: 14px;
  opacity: 0;
  transform: translate(-4px, 4px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.category:hover .category__arrow {
  opacity: 0.6;
  transform: translate(0, 0);
}

.category.is-active .category__no,
.category.is-active .category__count,
.category.is-active .category__desc {
  color: rgba(248, 240, 226, 0.56);
}

.category.is-active .category__arrow {
  opacity: 0.7;
  transform: translate(0, 0);
}

/* =========================================================
   Upload band
   ========================================================= */

.upload-band {
  position: relative;
  margin: 10px 0;
  overflow: hidden;
  color: var(--paper-bright);
  background:
    radial-gradient(800px 500px at 88% 10%, rgba(164, 59, 44, 0.2), transparent 60%),
    linear-gradient(120deg, #2c2119, #38281e 55%, #2a1f18);
}

.upload-band::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.7'/%3E%3C/svg%3E");
  pointer-events: none;
}

.upload-band__inner {
  position: relative;
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 62px 32px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 40px;
}

.upload-band__glyph {
  position: absolute;
  right: 140px;
  top: 50%;
  color: rgba(248, 240, 226, 0.035);
  font-family: var(--serif);
  font-size: 300px;
  line-height: 1;
  transform: translateY(-50%) rotate(-4deg);
  pointer-events: none;
  user-select: none;
}

.upload-band__copy {
  position: relative;
  z-index: 1;
}

.upload-band__copy h2 {
  margin: 0 0 16px;
  font-family: var(--serif);
  font-size: clamp(31px, 3.6vw, 46px);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.045em;
}

.upload-band__copy > p:last-child {
  max-width: 480px;
  margin: 0;
  color: rgba(248, 240, 226, 0.55);
  font-size: 12.5px;
  line-height: 1.9;
}

.upload-band .btn--paper {
  position: relative;
  z-index: 1;
}

.upload-band__meta {
  position: absolute;
  right: 32px;
  bottom: 22px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: rgba(248, 240, 226, 0.34);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.upload-band__meta span {
  padding: 2px 5px;
  border: 1px solid rgba(248, 240, 226, 0.14);
}

.upload-band__meta small {
  margin-left: 6px;
  font-size: 8px;
  letter-spacing: 0.08em;
}

/* =========================================================
   Library
   ========================================================= */

.section--library {
  padding-top: 88px;
  padding-bottom: 60px;
}

.library__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 30px;
}

.library__tally {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding-bottom: 4px;
}

.library__tally strong {
  color: var(--red);
  font-family: var(--serif);
  font-size: 54px;
  font-weight: 500;
  line-height: 0.9;
}

.library__tally span {
  color: var(--ink-muted);
  font-size: 10px;
  letter-spacing: 0.14em;
}

.library__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 28px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.filter-slot {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px;
  color: var(--ink-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 2px;
  font-size: 11px;
  letter-spacing: 0.08em;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.filter-chip span {
  color: var(--ink-faint);
  font-family: var(--serif);
  font-size: 9px;
}

.filter-chip:hover {
  color: var(--ink);
  background: rgba(255, 252, 245, 0.6);
}

.filter-chip.is-active {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(255, 252, 245, 0.72);
}

.filter-chip--active {
  color: var(--red);
  background: var(--red-soft);
  border-color: rgba(164, 59, 44, 0.2);
}

.filter-chip--active:hover {
  color: var(--red-deep);
  background: rgba(164, 59, 44, 0.14);
}

.filter-chip--active .icon {
  width: 12px;
  height: 12px;
}

.toolbar__right {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 0 0 auto;
}

.toolbar__hint {
  color: var(--ink-faint);
  font-size: 10px;
  letter-spacing: 0.05em;
}

.sort-select {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.sort-select .icon {
  position: absolute;
  right: 0;
  width: 13px;
  height: 13px;
  color: var(--ink-faint);
  pointer-events: none;
}

.sort-select select {
  height: 30px;
  padding: 0 20px 0 0;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 0;
  outline: 0;
  font-size: 11px;
  letter-spacing: 0.06em;
  appearance: none;
  cursor: pointer;
}

.doc-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.doc-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 296px;
  padding: 24px 24px 18px;
  overflow: hidden;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.5), transparent 46%),
    rgba(255, 250, 241, 0.7);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.34s var(--ease), box-shadow 0.34s ease, border-color 0.3s ease, background 0.3s ease;
}

.doc-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.38s var(--ease);
}

.doc-card::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 22px;
  height: 22px;
  background: linear-gradient(135deg, transparent 48%, var(--paper) 50%);
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
  opacity: 0.8;
}

.doc-card:hover {
  z-index: 1;
  transform: translateY(-6px);
  border-color: var(--line-strong);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.65), transparent 46%),
    var(--paper-white);
  box-shadow: var(--shadow-md);
}

.doc-card:hover::before {
  transform: scaleX(1);
}

.doc-card:focus-visible {
  outline-offset: 4px;
}

.doc-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
}

.doc-card__kind {
  color: var(--red);
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.16em;
}

.doc-card__flags {
  display: flex;
  align-items: center;
  gap: 6px;
}

.doc-card__sample,
.doc-card__ext {
  padding: 2px 6px;
  color: var(--ink-faint);
  border: 1px solid var(--line);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.doc-card__sample {
  color: var(--red);
  border-color: rgba(164, 59, 44, 0.24);
}

.doc-card__title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 0 11px;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.55;
  letter-spacing: 0.02em;
}

.doc-card__excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 0 16px;
  color: var(--ink-muted);
  font-size: 11.5px;
  line-height: 1.85;
}

.doc-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: auto;
  margin-bottom: 16px;
}

.doc-tag {
  padding: 2px 7px;
  color: var(--ink-muted);
  background: rgba(72, 52, 36, 0.045);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.doc-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.doc-card__foot span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.doc-card__foot .icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  color: var(--ink-muted);
  transition: color 0.2s ease, transform 0.2s ease;
}

.doc-card:hover .doc-card__foot .icon {
  color: var(--red);
  transform: translate(2px, -2px);
}

.skeleton-card {
  min-height: 296px;
  padding: 24px;
  border: 1px solid var(--line);
  background: rgba(255, 250, 241, 0.4);
}

.skeleton-line {
  height: 9px;
  margin-bottom: 12px;
  background: linear-gradient(90deg, rgba(72, 52, 36, 0.06), rgba(72, 52, 36, 0.12), rgba(72, 52, 36, 0.06));
  background-size: 200% 100%;
  animation: shimmer 1.5s linear infinite;
}

.skeleton-line--sm {
  width: 28%;
}

.skeleton-line--lg {
  width: 88%;
  height: 20px;
  margin-top: 22px;
}

.skeleton-line--md {
  width: 66%;
}

.empty {
  padding: 82px 20px 76px;
  border: 1px dashed var(--line-strong);
  text-align: center;
}

.empty__seal {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 20px;
  color: var(--ink-faint);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  font-family: var(--serif);
  font-size: 25px;
  transform: rotate(-3deg);
}

.empty h3 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.empty p {
  margin: 0 0 24px;
  color: var(--ink-muted);
  font-size: 12px;
}

.empty__actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* =========================================================
   About
   ========================================================= */

.section--about {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
  gap: clamp(40px, 7vw, 100px);
  padding-top: 90px;
  padding-bottom: 100px;
  border-top: 1px solid var(--line);
}

.about__intro {
  display: flex;
  flex-direction: column;
  height: auto;
}

.about__intro .section__title {
  margin-bottom: 0;
}

.about-points {
  display: flex;
  flex-direction: column;
}

.about-point {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  column-gap: 18px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
}

.about-point:first-child {
  padding-top: 4px;
  border-top: 0;
}

.about-point__no {
  color: var(--red);
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.about-point h3 {
  margin: 0 0 7px;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.about-point p {
  grid-column: 2;
  max-width: 460px;
  margin: 0;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.9;
}

.about__note {
  grid-column: 1 / -1;
  margin: 16px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.8;
  letter-spacing: 0.03em;
}

.about__contact {
  align-self: flex-end;
  max-width: 370px;
  margin: 30px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 11px;
  line-height: 2;
  letter-spacing: 0.04em;
  text-align: right;
}

.about__contact-cta,
.about__contact a {
  white-space: nowrap;
}

.about__contact a {
  color: var(--red);
  text-decoration: none;
  border-bottom: 1px solid rgba(164, 59, 44, 0.35);
  padding-bottom: 1px;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.about__contact a:hover {
  color: var(--ink);
  border-color: var(--ink);
}

/* =========================================================
   Footer
   ========================================================= */

.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(238, 228, 212, 0.5);
}

.footer__inner {
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 42px 32px;
  display: flex;
  align-items: center;
  gap: 30px;
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.footer__brand div {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.footer__brand strong {
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: 0.16em;
}

.footer__brand span:last-child {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 8px;
  letter-spacing: 0.2em;
}

.footer__quote {
  margin: 0 auto;
  color: var(--ink-faint);
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.18em;
}

.footer__meta {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--ink-faint);
  font-size: 9px;
  letter-spacing: 0.06em;
}

.footer__meta span + span {
  position: relative;
  padding-left: 16px;
}

.footer__meta span + span::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--line-strong);
  transform: translateY(-50%);
}

.made-by {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  flex: 0 0 auto;
  margin-left: 12px;
  padding-left: 18px;
  border-left: 1px solid rgba(94, 65, 41, 0.18);
}

.made-by__label {
  grid-column: 1;
  grid-row: 1;
  color: var(--ink-muted);
  font-size: 8px;
  line-height: 1;
  letter-spacing: 0.32em;
}

.made-by__name {
  grid-column: 1;
  grid-row: 2;
  margin-top: 4px;
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(164, 59, 44, 0.3);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 13px;
  font-style: italic;
  line-height: 1;
  letter-spacing: 0.14em;
}

.made-by__seal {
  grid-column: 2;
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(164, 59, 44, 0.55);
  box-shadow: inset 0 0 0 2px rgba(164, 59, 44, 0.06);
  color: var(--red);
  font-family: var(--serif);
  font-size: 12px;
  line-height: 1;
  transform: rotate(3deg);
}

/* =========================================================
   Modals
   ========================================================= */

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal.is-open {
  visibility: visible;
  opacity: 1;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30, 21, 15, 0.56);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.modal__dialog {
  position: relative;
  width: min(820px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.36), transparent 40%),
    var(--paper-soft);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: var(--shadow-lg);
  transform: translateY(18px) scale(0.985);
  transition: transform 0.32s var(--ease);
}

.modal.is-open .modal__dialog {
  transform: translateY(0) scale(1);
}

.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 34px 22px;
  border-bottom: 1px solid var(--line);
}

.modal__eyebrow {
  margin: 0 0 7px;
  color: var(--red);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.24em;
}

.modal__head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.upload-form {
  padding: 24px 34px 28px;
}

/* Dropzone */

.dropzone {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 142px;
  margin-bottom: 24px;
  padding: 22px;
  overflow: hidden;
  border: 1px dashed var(--line-strong);
  background: rgba(255, 252, 245, 0.42);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.dropzone:hover,
.dropzone.is-dragging {
  border-color: var(--red);
  background: rgba(255, 252, 245, 0.78);
}

.dropzone__idle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.dropzone__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 4px;
  color: var(--red);
  border: 1px solid rgba(164, 59, 44, 0.22);
  border-radius: 50%;
  background: var(--red-soft);
}

.dropzone__icon .icon {
  width: 18px;
  height: 18px;
}

.dropzone__idle strong {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.dropzone__idle > span:last-child {
  color: var(--ink-faint);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.dropzone__file {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 0 10px;
}

.file-badge {
  display: grid;
  place-items: center;
  width: 46px;
  height: 54px;
  flex: 0 0 auto;
  color: var(--red);
  border: 1px solid rgba(164, 59, 44, 0.26);
  background: var(--red-soft);
  font-family: var(--serif);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.file-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  line-height: 1.5;
}

.file-meta strong {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 13px;
  font-weight: 500;
}

.file-meta small {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 10px;
}

.dropzone__progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: rgba(164, 59, 44, 0.12);
}

.dropzone__progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--red);
  transition: width 0.2s ease;
}

/* Form */

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.field--full {
  grid-column: 1 / -1;
}

.field > span:first-child {
  color: var(--ink-soft);
  font-size: 10.5px;
  letter-spacing: 0.08em;
}

.field > span:first-child i {
  color: var(--red);
  font-style: normal;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 10px 12px;
  color: var(--ink);
  background: rgba(255, 252, 245, 0.68);
  border: 1px solid var(--line);
  border-radius: 2px;
  outline: 0;
  font-size: 12.5px;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.field input {
  height: 41px;
}

.field textarea {
  min-height: 82px;
  line-height: 1.7;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--ink-faint);
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--line-strong);
  background: var(--paper-white);
  box-shadow: 0 0 0 3px rgba(164, 59, 44, 0.06);
}

.field input[type="date"] {
  color-scheme: light;
}

.control-select {
  position: relative;
  display: block;
}

.control-select select {
  height: 41px;
  padding-right: 30px;
  appearance: none;
  cursor: pointer;
}

.control-select .icon {
  position: absolute;
  top: 50%;
  right: 11px;
  width: 13px;
  height: 13px;
  color: var(--ink-faint);
  pointer-events: none;
  transform: translateY(-50%);
}

.modal__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.form-hint {
  margin: 0;
  color: var(--ink-faint);
  font-size: 9.5px;
  line-height: 1.6;
}

.form-hint.is-error {
  color: var(--red);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

/* =========================================================
   Detail modal
   ========================================================= */

.detail-dialog {
  width: min(980px, 100%);
  height: min(880px, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #eee4d4;
}

.detail-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 24px;
  background: rgba(247, 240, 228, 0.94);
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}

.detail-bar__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.detail-bar__cat {
  padding: 3px 9px;
  color: var(--red);
  background: var(--red-soft);
  border: 1px solid rgba(164, 59, 44, 0.18);
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.1em;
}

.detail-bar__id {
  overflow: hidden;
  color: var(--ink-faint);
  font-size: 9px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.detail-bar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.detail-scroll {
  flex: 1;
  overflow: auto;
  padding: 30px;
  scroll-behavior: smooth;
}

.paper {
  position: relative;
  width: min(760px, 100%);
  min-height: 100%;
  margin: 0 auto;
  padding: 58px 68px 54px;
  background:
    linear-gradient(90deg, rgba(72, 52, 36, 0.022) 1px, transparent 1px) 0 0 / 34px 100%,
    linear-gradient(0deg, rgba(72, 52, 36, 0.018) 1px, transparent 1px) 0 0 / 100% 34px,
    var(--paper-white);
  border: 1px solid rgba(72, 52, 36, 0.14);
  box-shadow: 0 20px 50px rgba(61, 42, 27, 0.12);
}

.paper::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--red), rgba(164, 59, 44, 0.18));
  opacity: 0.7;
}

.paper__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 40px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 9px;
  letter-spacing: 0.16em;
}

.paper__top span:last-child {
  color: var(--red);
  letter-spacing: 0.14em;
}

.paper h1 {
  margin: 0 0 20px;
  font-family: var(--serif);
  font-size: clamp(25px, 3.2vw, 34px);
  font-weight: 600;
  line-height: 1.55;
  letter-spacing: 0.04em;
  text-align: center;
}

.paper__meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 0 0 8px;
  color: var(--ink-faint);
  font-size: 9.5px;
  letter-spacing: 0.06em;
}

.paper__meta span {
  position: relative;
}

.paper__meta span + span::before {
  content: "·";
  position: absolute;
  left: -11px;
  color: var(--line-strong);
}

.paper__rule {
  width: 52px;
  height: 1px;
  margin: 26px auto 34px;
  background: var(--red);
  opacity: 0.55;
}

.paper__body {
  color: #2c231c;
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 2.18;
  letter-spacing: 0.035em;
}

.paper__body p {
  margin: 0 0 16px;
  text-align: justify;
  text-indent: 2em;
}

.paper__body p.is-heading {
  margin-top: 6px;
  font-weight: 600;
  text-indent: 2em;
}

.paper__body p.is-heading + p {
  margin-top: 0;
}

.paper__body p.is-signature {
  margin: 6px 0 0;
  text-align: right;
  text-indent: 0;
}

.paper__body p.is-signature + p.is-signature {
  margin-top: 2px;
}

.paper__empty {
  padding: 40px 0;
  color: var(--ink-muted);
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.9;
  text-align: center;
}

.paper__fallback-link {
  display: inline-block;
  margin-top: 10px;
  padding-bottom: 2px;
  color: var(--red);
  border-bottom: 1px solid rgba(164, 59, 44, 0.35);
  font-size: 12px;
}

.paper__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 54px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.paper__footer .paper__seal {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--red);
  border: 1.5px solid rgba(164, 59, 44, 0.6);
  border-radius: 4px;
  font-family: var(--serif);
  font-size: 10px;
  line-height: 1.3;
  text-align: center;
  opacity: 0.7;
  transform: rotate(-4deg);
}

.pdf-shell {
  border: 1px solid var(--line);
  background: #fff;
}

.pdf-shell__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-bright);
  color: var(--ink-soft);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.pdf-shell__bar a {
  color: var(--red);
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

.pdf-frame {
  display: block;
  width: 100%;
  height: 68vh;
  min-height: 420px;
  background: #fff;
  border: 0;
}

.pdf-pages {
  display: grid;
  gap: 14px;
  padding: 18px;
  background: #e9e2d4;
}

.pdf-page {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
  box-shadow: 0 2px 10px rgba(55, 38, 20, 0.12);
}

.pdf-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: var(--paper-bright);
  color: var(--ink-muted);
  font-size: 11px;
}

.pdf-pager[hidden],
.pdf-pager [hidden] {
  display: none;
}

.pdf-pager .btn {
  min-width: 92px;
}

.detail-loading {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 58px 68px;
  background: var(--paper-white);
  border: 1px solid var(--line);
}

.detail-loading .skeleton-line {
  height: 13px;
}

.detail-loading .skeleton-line:first-child {
  width: 34%;
  height: 8px;
  margin-bottom: 38px;
}

.detail-loading .skeleton-line:nth-child(2) {
  width: 78%;
  height: 28px;
  margin: 0 auto 32px;
}

.detail-loading .skeleton-line:nth-child(3) {
  width: 48%;
  height: 8px;
  margin: 0 auto 42px;
}

.detail-loading .skeleton-line:nth-child(n + 4) {
  width: 100%;
  height: 10px;
}

/* =========================================================
   Toasts
   ========================================================= */

.toast-region {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 9px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(360px, calc(100vw - 48px));
  padding: 12px 16px;
  color: var(--paper-bright);
  background: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 34px rgba(30, 21, 15, 0.24);
  font-size: 12px;
  line-height: 1.5;
  animation: toast-in 0.36s var(--ease) both;
}

.toast.is-leaving {
  animation: toast-out 0.26s ease forwards;
}

.toast .icon {
  width: 15px;
  height: 15px;
  color: #d8b98a;
}

.toast--error {
  background: var(--red-deep);
}

.toast--error .icon {
  color: #f4d9c6;
}

/* =========================================================
   Animations
   ========================================================= */

.reveal {
  opacity: 0;
  animation: reveal-up 0.9s var(--ease) forwards;
  animation-delay: var(--delay, 0ms);
}

@keyframes reveal-up {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 1120px) {
  .header__inner {
    gap: 24px;
    padding: 0 24px;
  }

  .nav {
    gap: 20px;
  }

  .header__link {
    display: none;
  }

  .hero__inner {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 0.84fr);
    gap: 36px;
    padding-inline: 24px;
  }

  .archive {
    width: 356px;
    height: 436px;
  }

  .archive__item-name {
    font-size: 12.5px;
  }

  .category-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .category:nth-child(5n) {
    border-right: 1px solid var(--line);
  }

  .category:nth-child(3n) {
    border-right: 0;
  }

  .category:nth-last-child(-n + 5) {
    border-bottom: 1px solid var(--line);
  }

  .category:nth-last-child(-n + 3) {
    border-bottom: 0;
  }

  .section {
    padding-inline: 24px;
  }

  .doc-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  :root {
    --header-h: 70px;
  }

  .nav {
    display: none;
  }

  .header-search {
    width: auto;
    flex: 1;
    max-width: 360px;
  }

  .hero__inner {
    grid-template-columns: 1fr;
    min-height: 0;
    padding-top: 54px;
    padding-bottom: 66px;
  }

  .hero__copy {
    max-width: 660px;
  }

  .hero__title {
    font-size: clamp(50px, 10vw, 74px);
  }

  .hero__art {
    margin-top: 28px;
    min-height: 450px;
  }

  .hero__stamp {
    right: 12%;
  }

  .hero__foot {
    padding-inline: 24px;
  }

  .section__head {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
  }

  .section__intro {
    max-width: 560px;
  }

  .upload-band__inner {
    grid-template-columns: 1fr;
    gap: 30px;
    padding-inline: 24px;
  }

  .upload-band__inner .btn {
    justify-self: start;
  }

  .upload-band__glyph {
    right: -30px;
  }

  .section--about {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .about__note {
    margin-top: 0;
  }

  .footer__quote {
    display: none;
  }

  .footer__meta {
    margin-left: auto;
  }
}

@media (max-width: 760px) {
  .pdf-pages {
    gap: 9px;
    padding: 9px;
  }

  .pdf-pager {
    padding: 10px 8px;
  }

  .header__inner {
    height: auto;
    min-height: var(--header-h);
    padding: 12px 20px;
    flex-wrap: wrap;
    gap: 10px 16px;
  }

  .brand__seal {
    width: 36px;
    height: 36px;
    font-size: 21px;
  }

  .brand__text strong {
    font-size: 18px;
  }

  .header__actions {
    margin-left: auto;
  }

  .header-search {
    order: 4;
    flex: 1 0 100%;
    width: 100%;
    max-width: none;
  }

  .header-search input {
    font-size: 12px;
  }

  .hero__inner {
    padding: 42px 20px 54px;
  }

  .hero__title {
    margin-bottom: 22px;
    font-size: clamp(44px, 12.8vw, 62px);
  }

  .hero__desc {
    font-size: 14px;
  }

  .hero__stats {
    margin-top: 36px;
  }

  .hero__stats div + div {
    padding-left: 18px;
  }

  .hero__stats dt {
    font-size: 27px;
  }

  .hero__art {
    min-height: 400px;
    transform: scale(0.92);
    transform-origin: center top;
    margin-bottom: -26px;
  }

  .archive {
    width: 330px;
    height: 404px;
  }

  .archive__paper {
    padding: 24px 22px 19px;
  }

  .archive__item {
    padding: 6px 3px;
  }

  .archive__item-name {
    font-size: 11.5px;
  }

  .archive__tab {
    right: -24px;
    padding: 12px 7px;
    font-size: 10px;
  }

  .archive__note {
    display: none;
  }

  .hero__stamp {
    right: 0;
    bottom: -6px;
    width: 78px;
    height: 78px;
  }

  .hero__stamp span {
    font-size: 20px;
  }

  .hero__foot {
    padding: 0 20px 22px;
  }

  .section {
    padding: 70px 20px;
  }

  .section--categories {
    padding-top: 64px;
  }

  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .category:nth-child(3n) {
    border-right: 1px solid var(--line);
  }

  .category:nth-child(2n) {
    border-right: 0;
  }

  .category:nth-last-child(-n + 3) {
    border-bottom: 1px solid var(--line);
  }

  .category:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .category {
    min-height: 154px;
    padding: 18px 16px 15px;
  }

  .category__name {
    font-size: 23px;
  }

  .upload-band__inner {
    padding: 48px 20px 56px;
  }

  .upload-band__meta {
    right: 20px;
    bottom: 16px;
  }

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

  .library__tally strong {
    font-size: 46px;
  }

  .library__toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .toolbar__right {
    width: 100%;
    justify-content: space-between;
  }

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

  .footer__inner {
    padding: 34px 20px;
    flex-wrap: wrap;
    gap: 18px;
  }

  .footer__meta {
    width: 100%;
    margin-left: 0;
    padding-top: 16px;
    border-top: 1px solid var(--line);
  }

  .made-by {
    margin-left: auto;
    padding-left: 0;
    border-left: 0;
  }

  .modal {
    padding: 10px;
  }

  .modal__dialog {
    max-height: calc(100vh - 20px);
  }

  .modal__head {
    padding: 22px 22px 18px;
  }

  .modal__head h2 {
    font-size: 25px;
  }

  .upload-form {
    padding: 20px 22px 0;
  }

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

  .modal__foot {
    position: sticky;
    bottom: 0;
    z-index: 4;
    margin: 18px -22px 0;
    padding: 12px 22px 16px;
    background: linear-gradient(180deg, rgba(251, 246, 236, 0.9), var(--paper-soft) 46%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  .form-hint {
    display: none;
  }

  .form-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .detail-dialog {
    height: calc(100vh - 20px);
  }

  .detail-bar {
    padding: 12px 14px;
    gap: 10px;
    flex-wrap: wrap;
  }

  .detail-bar__id {
    display: none;
  }

  .detail-bar__actions {
    width: 100%;
    justify-content: flex-end;
  }

  .detail-scroll {
    padding: 14px;
  }

  .paper {
    padding: 36px 24px 34px;
  }

  .paper h1 {
    font-size: 23px;
  }

  .paper__body {
    font-size: 14.5px;
    line-height: 2.05;
  }

  .paper__footer {
    margin-top: 38px;
  }

  .detail-loading {
    padding: 36px 24px;
  }

  .toast-region {
    right: 14px;
    bottom: 14px;
  }
}

@media (max-width: 430px) {
  .header__actions .btn span {
    display: none;
  }

  .header__actions .btn {
    width: 38px;
    padding: 0;
  }

  .hero__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .hero__actions .btn {
    width: 100%;
  }

  .hero__stats div {
    padding-right: 10px;
  }

  .hero__stats div + div {
    padding-left: 12px;
  }

  .hero__stats dt {
    font-size: 24px;
  }

  .hero__stats dd {
    font-size: 9px;
    letter-spacing: 0.06em;
  }

  .archive {
    width: 300px;
    height: 380px;
  }

  .archive__paper {
    padding: 21px 18px 16px;
  }

  .archive__item {
    padding: 5px 2px;
  }

  .archive__item-name {
    font-size: 10.5px;
  }

  .archive__tab {
    display: none;
  }

  .category__desc {
    font-size: 10px;
  }

  .upload-band__meta {
    position: static;
    margin-top: 6px;
  }

  .library__tally {
    display: none;
  }

  .filter-chip {
    padding: 0 9px;
  }

  .toolbar__hint {
    display: none;
  }

  .detail-bar__actions .btn {
    flex: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
  }
}
