:root {
  --paper: #f5f0e6;
  --paper-deep: #ebe2d2;
  --ink: #25221d;
  --muted: #756d61;
  --line: #d5cbbb;
  --accent: #9b4d2f;
  --accent-dark: #743721;
  --card: #fffdf8;
  --shadow: 0 10px 30px rgba(53, 43, 29, .08);
  --radius: 14px;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 10%, rgba(155, 77, 47, .06), transparent 28rem),
    var(--paper);
  font-family: var(--sans);
  line-height: 1.6;
}

button, input, select { font: inherit; }

button, a, select, input { -webkit-tap-highlight-color: transparent; }

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(245, 240, 230, .92);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner {
  width: min(1180px, calc(100% - 32px));
  min-height: 72px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 20px;
}

.brand strong, .brand small { display: block; }
.brand strong { font-family: var(--serif); font-size: 1.05rem; }
.brand small { color: var(--muted); font-size: .72rem; letter-spacing: .04em; }

.menu-button {
  display: none;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 8px 14px;
}

.layout {
  width: min(1180px, calc(100% - 32px));
  margin: auto;
  padding: 62px 0 80px;
}

.intro { max-width: 760px; margin-bottom: 34px; }

.eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: .75rem;
  font-weight: 700;
  margin: 0 0 8px;
}

h1, h2, h3 {
  font-family: var(--serif);
  line-height: 1.15;
}

h1 {
  font-size: clamp(2.7rem, 7vw, 5rem);
  font-weight: 500;
  letter-spacing: -.04em;
  margin: 0 0 16px;
}

.intro-text {
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 650px;
  margin: 0;
}

.controls {
  display: grid;
  grid-template-columns: minmax(240px, 2fr) minmax(180px, 1fr) minmax(180px, 1fr);
  gap: 12px;
  padding: 18px;
  background: rgba(255, 253, 248, .7);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 18px;
}

.control label {
  display: block;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 0 0 6px;
}

.control input, .control select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card);
  color: var(--ink);
  padding: 8px 11px;
  outline: none;
}

.control input:focus, .control select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(155, 77, 47, .12);
}

.results-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 34px;
  margin: 0 2px 12px;
  color: var(--muted);
  font-size: .85rem;
}

.reset-button {
  border: 0;
  background: none;
  color: var(--accent);
  cursor: pointer;
  font-weight: 700;
  padding: 5px;
}

.concept-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.concept-card {
  appearance: none;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: inherit;
  padding: 22px;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(53, 43, 29, .02);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.concept-card:hover {
  transform: translateY(-2px);
  border-color: #b9aa96;
  box-shadow: var(--shadow);
}

.card-kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: .78rem;
  margin-bottom: 9px;
}

.card-kicker::before {
  content: "";
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
}

.concept-card h2 {
  margin: 0 0 10px;
  font-size: 1.45rem;
  font-weight: 500;
}

.excerpt {
  color: #5d564c;
  font-size: .92rem;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.comment-badge {
  display: inline-block;
  margin-top: 14px;
  color: var(--accent-dark);
  background: #f2e5dc;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: .72rem;
  font-weight: 700;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.page-button {
  min-width: 40px;
  min-height: 40px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 8px;
  cursor: pointer;
}

.page-button[aria-current="page"] {
  color: white;
  background: var(--accent);
  border-color: var(--accent);
}

.page-button:disabled { opacity: .45; cursor: default; }

.detail {
  max-width: 820px;
  margin: 0 auto;
}

.back-button {
  border: 0;
  background: none;
  color: var(--accent);
  padding: 4px 0 22px;
  cursor: pointer;
  font-weight: 700;
}

.detail-sheet {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(22px, 5vw, 52px);
  box-shadow: var(--shadow);
}

.detail-meta {
  color: var(--muted);
  font-size: .85rem;
  margin-bottom: 10px;
}

.detail-sheet h1 {
  font-size: clamp(2.1rem, 6vw, 4rem);
  margin-bottom: 28px;
}

.description {
  font-family: var(--serif);
  font-size: 1.08rem;
  line-height: 1.82;
}

.description p { margin: 0 0 1.2em; }

.comments {
  margin-top: 42px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.comments h2 { font-size: 1.5rem; }

.comment {
  border-left: 3px solid var(--paper-deep);
  padding: 0 0 0 16px;
  margin: 22px 0;
}

.comment-author {
  font-size: .78rem;
  color: var(--accent);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.comment p {
  font-family: var(--serif);
  margin: 5px 0 0;
}

.empty-state {
  text-align: center;
  padding: 70px 20px;
  color: var(--muted);
}

.empty-icon { font-size: 2.2rem; color: var(--accent); }

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 34px;
  display: flex;
  justify-content: space-between;
  font-size: .78rem;
}

.concept-gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 24px 0;
}

.concept-image {
  width: 100%;
  display: block;
  border-radius: 14px;
  object-fit: cover;
  background: #111;
  box-shadow: 0 4px 18px rgba(0,0,0,0.12);
}

[hidden] { display: none !important; }

@media (max-width: 760px) {
  .header-inner, .layout, .site-footer {
    width: min(100% - 22px, 620px);
  }

  .header-inner { min-height: 64px; }
  .menu-button { display: block; }

  .layout { padding: 40px 0 60px; }
  .intro { margin-bottom: 24px; }

  .controls {
    display: none;
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .controls.is-open { display: grid; }

  .concept-list { grid-template-columns: 1fr; }

  .concept-card { padding: 18px; }
  .concept-card h2 { font-size: 1.3rem; }

  .detail-sheet { padding: 22px; }
  .description { font-size: 1rem; line-height: 1.72; }

  .site-footer { display: block; }
  .site-footer span { display: block; margin-top: 4px; }

  .concept-gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}
