@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700&family=Source+Serif+4:ital,wght@0,400;0,600;1,400&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --ink: #16241f;
  --mist: #eef5f2;
  --mist-deep: #dbe8e2;
  --deep-blue: #0e2a4d;
  --deep-blue-dark: #081b33;
  --leaf: #4f9d6e;
  --leaf-bright: #74c98f;
  --sprout-gold: #d9a441;
  --radius: 2px;
  --max-w: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(ellipse at 15% 0%, rgba(116, 201, 143, 0.08), transparent 55%),
    radial-gradient(ellipse at 100% 100%, rgba(217, 164, 65, 0.05), transparent 45%),
    var(--deep-blue);
  color: var(--mist);
  font-family: 'Source Serif 4', serif;
  line-height: 1.5;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

a { color: inherit; }

/* ---------- Header / cabinet top ---------- */

.cabinet-header {
  position: relative;
  padding: 5rem 1.5rem 4rem;
  text-align: center;
  background:
    radial-gradient(ellipse at top, rgba(116, 201, 143, 0.14), transparent 60%),
    var(--deep-blue-dark);
  border-bottom: 6px solid var(--leaf);
}

.cabinet-header .eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--leaf-bright);
  margin: 0 0 1rem;
}

.cabinet-header h1 {
  font-family: 'Fraunces', serif;
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: clamp(2.4rem, 5vw, 4rem);
  margin: 0 0 1rem;
  color: var(--mist);
  letter-spacing: -0.01em;
}

.cabinet-header p.sub {
  max-width: 42ch;
  margin: 0 auto;
  color: #c3d6cd;
  font-size: 1.05rem;
}

/* Stamp mark, the signature element */
.stamp {
  position: absolute;
  top: 2.4rem;
  right: 2.4rem;
  width: 92px;
  height: 92px;
  border: 2px dashed var(--sprout-gold);
  border-radius: 50%;
  color: var(--sprout-gold);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transform: rotate(-11deg);
  opacity: 0.85;
  mix-blend-mode: screen;
  background: rgba(217, 164, 65, 0.05);
}

@media (max-width: 640px) {
  .stamp { display: none; }
}

/* ---------- Drawer tabs / category filters ---------- */

.drawer-nav {
  max-width: var(--max-w);
  margin: -1.75rem auto 0;
  padding: 0 1.5rem;
  position: relative;
  z-index: 2;
}

.drawer-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  list-style: none;
  padding: 0;
  margin: 0;
}

.drawer-tabs button {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mist);
  background: var(--deep-blue-dark);
  border: 1px solid var(--leaf);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 0.65rem 1rem 0.55rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.drawer-tabs button:hover { transform: translateY(-2px); }

.drawer-tabs button:focus-visible {
  outline: 2px solid var(--leaf-bright);
  outline-offset: 2px;
}

.drawer-tabs button.active {
  background: var(--leaf);
  color: var(--deep-blue-dark);
  border-color: var(--leaf);
}

.drawer-tabs .count {
  opacity: 0.65;
  margin-left: 0.35em;
  font-size: 0.85em;
}

/* ---------- Catalog list ---------- */

main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 6rem;
}

.catalog-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 1.5rem;
}

.category-section .section-heading {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--mist);
  margin: 0 0 0.7rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--leaf);
}

.link-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.link-item {
  display: block;
  background: var(--mist);
  color: var(--ink);
  text-decoration: none;
  border-radius: var(--radius);
  padding: 0.55rem 0.9rem;
  border-left: 3px solid var(--leaf);
  box-shadow: 0 3px 8px rgba(0,0,0,0.16);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.link-item:hover,
.link-item:focus-visible {
  transform: translateX(3px);
  box-shadow: 0 5px 12px rgba(0,0,0,0.22);
}

.link-item:focus-visible {
  outline: 2px solid var(--leaf-bright);
  outline-offset: 2px;
}

.link-item-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.link-item h3 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 0.98rem;
  margin: 0;
  border-bottom: 1px solid transparent;
}

.link-item .rank {
  color: var(--leaf);
  margin-right: 0.15em;
}

.link-item:hover h3,
.link-item:focus-visible h3 { border-bottom-color: var(--ink); }

.link-item .domain {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.66rem;
  color: var(--deep-blue);
  opacity: 0.75;
}

.link-item p.note {
  font-size: 0.82rem;
  margin: 0.2rem 0 0.35rem;
  color: #33463f;
}

.link-item .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.link-item .tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid var(--leaf);
  color: var(--leaf);
  padding: 0.08rem 0.4rem;
  border-radius: 999px;
  opacity: 0.85;
}

/* ---------- Footer ---------- */

footer {
  text-align: center;
  padding: 2.5rem 1.5rem 3rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: #9fb3ab;
  border-top: 1px solid rgba(217, 164, 65, 0.3);
}
