
:root {
  --ink: #1c1915;
  --paper: #f4efe6;
  --paper-2: #ebe4d6;
  --cedar: #8b3e1a;
  --clay: #b85c38;
  --moss: #3f5a3a;
  --pine: #2c4a3a;
  --gold: #c4a574;
  --muted: #6e665b;
  --line: rgba(28, 25, 21, 0.14);
  --shadow: 0 18px 40px rgba(28, 25, 21, 0.08);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(196,165,116,0.18), transparent 50%),
    var(--paper);
  font-family: "Iowan Old Style", "Palatino Linotype", "Songti SC", "Noto Serif SC", Georgia, serif;
  line-height: 1.65;
  min-height: 100vh;
}
a { color: var(--cedar); text-decoration: none; }
a:hover { color: var(--clay); text-decoration: underline; }
img, svg { max-width: 100%; height: auto; display: block; }
.wrap { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }

.nav {
  position: sticky; top: 0; z-index: 20;
  background: rgba(244, 239, 230, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; gap: 16px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 600; letter-spacing: 0.12em; text-decoration: none; }
.logo img { width: 28px; height: 28px; }
.logo:hover { text-decoration: none; color: var(--ink); }
.nav-links { display: flex; gap: 22px; font-size: 0.95rem; }
.nav-links a { color: var(--ink); }

.hero { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center; padding: 48px 0 24px; }
.kicker { color: var(--cedar); letter-spacing: 0.22em; font-size: 0.78rem; text-transform: uppercase; margin-bottom: 10px; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.15; margin: 0 0 12px; font-weight: 600; letter-spacing: 0.08em; }
.hero-en { margin: 0 0 18px; color: var(--muted); letter-spacing: 0.18em; }
.lede { font-size: 1.08rem; max-width: 40rem; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 22px 0 18px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--ink); padding: 8px 16px; border-radius: 999px;
  color: var(--ink); background: transparent; cursor: pointer; font: inherit;
}
.btn:hover { background: var(--ink); color: var(--paper); text-decoration: none; }
.btn.primary { background: var(--cedar); color: var(--paper); border-color: var(--cedar); }
.btn.primary:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.hero-visual { border: 1px solid var(--line); background: var(--paper-2); box-shadow: var(--shadow); }
.hero-visual img { width: 100%; }
.stats { display: flex; gap: 28px; flex-wrap: wrap; padding-bottom: 8px; }
.stat b { display: block; font-size: 1.4rem; }
.stat span { color: var(--muted); font-size: 0.9rem; }

.section { padding: 28px 0 10px; }
.section h2 { font-size: 1.6rem; margin: 0 0 8px; letter-spacing: 0.08em; }
.section .sub { color: var(--muted); margin: 0 0 20px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 8px 0 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: transparent; color: var(--ink);
  border-radius: 999px; padding: 5px 12px; font: inherit; cursor: pointer;
}
.chip[aria-pressed="true"], .chip:hover { border-color: var(--cedar); color: var(--cedar); }
.search {
  flex: 1; min-width: 200px;
  border: 1px solid var(--line); background: #fffdf8; color: var(--ink);
  padding: 8px 12px; font: inherit; border-radius: 8px;
}
.search:focus { outline: 2px solid var(--gold); border-color: var(--gold); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.card {
  border: 1px solid var(--line); background: #fffdf8; display: flex; flex-direction: column;
  min-height: 100%;
}
.thumb {
  aspect-ratio: 1 / 0.86; overflow: hidden; background:
    linear-gradient(45deg, #efe8da 25%, transparent 25%),
    linear-gradient(-45deg, #efe8da 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #efe8da 75%),
    linear-gradient(-45deg, transparent 75%, #efe8da 75%);
  background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  display: flex; align-items: center; justify-content: center; cursor: zoom-in;
}
.thumb img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.meta { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.meta h3 { margin: 0; font-size: 1.02rem; letter-spacing: 0.04em; }
.meta .en { color: var(--muted); font-size: 0.86rem; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 0.8rem; }
.actions { display: flex; gap: 8px; margin-top: auto; padding-top: 6px; }
.actions button, .actions a {
  font: inherit; font-size: 0.85rem; border: 1px solid var(--line);
  background: transparent; color: var(--ink); padding: 4px 8px; border-radius: 6px; cursor: pointer;
}
.actions button:hover, .actions a:hover { border-color: var(--cedar); color: var(--cedar); text-decoration: none; }
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 999px;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.toast.show { opacity: 1; }

.empty { text-align: center; padding: 30px 0 50px; color: var(--muted); display: none; }
.empty.show { display: block; }

.about-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 28px; }
.panel { border: 1px solid var(--line); padding: 20px 22px; background: #fffdf8; }
.panel ul { margin: 8px 0 0; padding-left: 1.1em; }

.lightbox {
  position: fixed; inset: 0; background: rgba(18,17,15,0.78);
  display: none; align-items: center; justify-content: center; z-index: 40; padding: 24px;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: min(960px, 100%); max-height: 86vh; background: var(--paper); }
.lightbox button {
  position: absolute; top: 16px; right: 16px; border: 0; background: var(--paper); color: var(--ink);
  width: 40px; height: 40px; border-radius: 50%; font: inherit; cursor: pointer;
}

footer { border-top: 1px solid var(--line); margin-top: 48px; padding: 28px 0 40px; color: var(--muted); font-size: 0.92rem; }
.foot-grid { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

@media (max-width: 800px) {
  .hero, .about-grid { grid-template-columns: 1fr; }
  .nav-links { gap: 12px; font-size: 0.88rem; }
}
