/* ======================================================
   THE FEATHER & FANG — FLAT LORE HUB
   Old forum / soft archive / low-stim edition
   ====================================================== */

:root {
  --bg: #1f2122;
  --bg2: #26292b;
  --ink: #f2f2f2;
  --muted: #cfc8be;
  --panel: #2a2d2f;
  --panel2: #242729;
  --frame: #434648;
  --frame2: #5a5f62;
  --accent1: #6ea57d;
  --accent2: #7a92bf;
  --accent3: #b77777;
  --rose: #c09aa4;

  --title: "Autour One", system-ui, sans-serif;
  --head: "Imprima", Verdana, sans-serif;
  --body: "Inder", system-ui, sans-serif;
  --mono: "Reddit Mono", ui-monospace, monospace;

  --max: 1260px;
  --pad: clamp(14px, 2vw, 22px);
  --line: 1px solid var(--frame);
  --line-soft: 1px solid rgba(90, 95, 98, 0.62);
  --corner: 2px;
  --focus: 0 0 0 2px rgba(122, 146, 191, 0.5);
}

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

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  background-image:
    linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px);
  background-size: 38px 38px;
  color: var(--ink);
  font: 16px/1.4 var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--ink);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:visited {
  color: #d2c4d0;
}

a:hover,
a:focus-visible {
  color: var(--muted);
  text-decoration-thickness: 2px;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.skip-link {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 100;
  transform: translateY(-160%);
  padding: 0.55rem 0.75rem;
  border: 2px solid var(--accent2);
  background: var(--panel);
  color: var(--ink);
  font-family: var(--mono);
}

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

.site-head,
.tab-strip,
.site-shell,
.site-foot {
  width: min(var(--max), calc(100% - 28px));
  margin-inline: auto;
}

.site-head {
  margin-top: 26px;
  border: var(--line);
  background: var(--panel);
}

.head-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 0.42fr);
  gap: 0;
}

.brand-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: var(--pad);
  border-right: var(--line);
}

.site-mark {
  width: 112px;
  height: 112px;
  object-fit: cover;
  border: var(--line-soft);
  background: var(--panel2);
}

.kicker,
.section-label {
  margin: 0 0 0.35rem;
  color: var(--muted);
  font: 600 0.78rem/1.2 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.55rem;
  font-family: var(--title);
  font-size: clamp(2.1rem, 5vw, 4rem);
  line-height: 1.02;
  letter-spacing: 0.02em;
}

h2 {
  margin-bottom: 0.5rem;
  font-family: var(--title);
  font-size: clamp(1.35rem, 2.4vw, 2.15rem);
  line-height: 1.1;
}

h3 {
  margin-bottom: 0.45rem;
  font-family: var(--head);
  font-size: 1.2rem;
  letter-spacing: 0.02em;
}

.tagline {
  max-width: 74ch;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.03rem;
}

.notice-board {
  padding: var(--pad);
  background: var(--panel2);
}

.notice-board h2 {
  font-family: var(--head);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.notice-board p {
  margin-bottom: 0.55rem;
  color: var(--muted);
}

.notice-board p:last-of-type {
  margin-bottom: 0.75rem;
}

.tab-strip {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 14px;
  border: var(--line);
  background: var(--panel2);
}

.tab-button {
  min-height: 42px;
  padding: 0.65rem 0.9rem;
  border: 0;
  border-right: var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: 600 0.86rem/1.2 var(--mono);
  text-decoration-line: underline;
  text-underline-offset: 0.2em;
}

.tab-button:last-child {
  border-right: 0;
}

.tab-button:hover,
.tab-button:focus-visible {
  background: #303537;
}

.tab-button[aria-selected="true"] {
  background: #24302a;
  color: var(--ink);
  box-shadow: inset 0 -3px 0 var(--accent1);
}

.site-shell {
  margin-top: 14px;
  border: var(--line);
  background: var(--panel);
}

.tab-panel {
  padding: var(--pad);
}

.tab-panel[hidden] {
  display: none !important;
}

.section-heading {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: var(--line-soft);
}

.section-heading p:last-child {
  max-width: 78ch;
  margin-bottom: 0;
  color: var(--muted);
}

.section-heading.compact {
  margin-bottom: 10px;
}

.front-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.43fr);
  gap: 16px;
  align-items: start;
}

.front-intro,
.spotlight-box,
.thread-board,
.archive-tools,
.folder-card,
.vault-card,
.record-list a,
.timeline-table,
.shelf-grid article {
  border: var(--line-soft);
  background: var(--panel2);
}

.front-intro,
.spotlight-box,
.thread-board {
  padding: var(--pad);
}

.front-intro p {
  color: var(--muted);
}

.quick-lines {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.quick-lines a,
.thread-list a,
.record-list a {
  display: grid;
  gap: 0.2rem;
  padding: 10px 12px;
  border: var(--line-soft);
  background: var(--panel);
  color: var(--ink);
}

.quick-lines span,
.thread-list span,
.record-list span {
  color: var(--muted);
}

.quick-lines strong,
.thread-list b,
.record-list b {
  font-family: var(--head);
  font-size: 1.06rem;
}

.spotlight-list {
  display: grid;
  gap: 8px;
}

.spotlight-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: var(--line-soft);
  background: var(--panel);
}

.spotlight-card img {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border: var(--line-soft);
}

.spotlight-card strong,
.spotlight-card small {
  display: block;
}

.spotlight-card small {
  margin-top: 0.15rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
}

.thread-board {
  margin-top: 16px;
}

.thread-list {
  display: grid;
  gap: 8px;
}

.thread-list a {
  grid-template-columns: minmax(160px, 0.24fr) minmax(0, 1fr) minmax(150px, 0.22fr);
  align-items: start;
}

.thread-list small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
}

.archive-tools {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
}

.search-label {
  color: var(--muted);
  font: 600 0.8rem/1.2 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.archive-search {
  width: 100%;
  min-height: 42px;
  padding: 0.6rem 0.7rem;
  border: var(--line-soft);
  background: var(--panel);
  color: var(--ink);
}

.archive-search::placeholder {
  color: #a8a19a;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-button {
  min-height: 36px;
  padding: 0.45rem 0.65rem;
  border: var(--line-soft);
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font: 600 0.8rem/1.2 var(--mono);
  text-decoration-line: underline;
  text-underline-offset: 0.2em;
}

.filter-button:hover,
.filter-button:focus-visible,
.filter-button.is-active {
  background: #303537;
  border-color: var(--accent2);
}

.folder-grid,
.vault-grid,
.shelf-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.folder-card,
.vault-card,
.shelf-grid article {
  position: relative;
  padding: 16px 14px 14px;
}

.folder-tab {
  position: absolute;
  top: 0;
  right: 0;
  padding: 0.32rem 0.55rem;
  border-left: var(--line-soft);
  border-bottom: var(--line-soft);
  background: var(--panel);
  color: var(--muted);
  font: 600 0.72rem/1.2 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.folder-card p,
.vault-card p,
.shelf-grid p {
  color: var(--muted);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0.75rem 0;
}

.meta-row span {
  display: inline-flex;
  padding: 0.25rem 0.45rem;
  border: var(--line-soft);
  color: var(--muted);
  font: 500 0.75rem/1.2 var(--mono);
}

.empty-note {
  margin: 1rem 0 0;
  padding: 12px;
  border: var(--line-soft);
  background: var(--panel2);
  color: var(--muted);
}

.record-list {
  display: grid;
  gap: 8px;
}

.record-list a {
  grid-template-columns: minmax(190px, 0.26fr) minmax(0, 1fr);
}

.timeline-table {
  display: grid;
}

.timeline-table div {
  display: grid;
  grid-template-columns: minmax(180px, 0.24fr) minmax(0, 1fr) 90px;
  gap: 12px;
  padding: 12px;
  border-bottom: var(--line-soft);
}

.timeline-table div:last-child {
  border-bottom: 0;
}

.timeline-table span {
  color: var(--muted);
}

.site-foot {
  margin-top: 14px;
  margin-bottom: 40px;
  padding: 14px;
  border: var(--line);
  background: var(--panel2);
  color: var(--muted);
  text-align: center;
}

.site-foot p {
  margin: 0.2rem 0;
}

.to-top {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  min-height: 38px;
  padding: 0.45rem 0.75rem;
  border: var(--line-soft);
  background: var(--panel2);
  color: var(--ink);
  cursor: pointer;
  font: 600 0.8rem/1.2 var(--mono);
  text-decoration-line: underline;
  transition: opacity 160ms ease, transform 160ms ease;
}

.to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

@media (max-width: 1020px) {
  .head-inner,
  .front-grid {
    grid-template-columns: 1fr;
  }

  .brand-card {
    border-right: 0;
    border-bottom: var(--line);
  }

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

  .thread-list a,
  .record-list a,
  .timeline-table div {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 15px;
  }

  .site-head,
  .tab-strip,
  .site-shell,
  .site-foot {
    width: min(100% - 14px, var(--max));
  }

  .brand-card {
    grid-template-columns: 1fr;
  }

  .site-mark {
    width: 86px;
    height: 86px;
  }

  .tab-strip {
    position: static;
  }

  .tab-button {
    flex: 1 1 48%;
    border-bottom: var(--line);
  }

  .folder-grid,
  .vault-grid,
  .shelf-grid {
    grid-template-columns: 1fr;
  }

  .spotlight-card {
    grid-template-columns: 48px 1fr;
  }

  .spotlight-card img {
    width: 48px;
    height: 48px;
  }
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
