/* Hermione's Library — Common Styles */

:root {
  --bg: #f5f0e8;
  --bg-white: #fffcf5;
  --bg-dark: #1c1917;
  --ink: #1c1917;
  --ink-secondary: #57534e;
  --ink-light: #a8a29e;
  --maroon: #7c2d12;
  --maroon-light: #fce7da;
  --gold: #b45309;
  --gold-bg: #fef3c7;
  --cream: #fef7ed;
  --border: #d6d3ce;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== Particles ===== */
.particles { position: fixed; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.particle { position: absolute; width: 3px; height: 3px; background: #d4a853; border-radius: 50%; opacity: 0; animation: drift linear infinite; }
@keyframes drift {
  0% { opacity: 0; transform: translateY(100vh) translateX(0); }
  15% { opacity: 0.3; }
  85% { opacity: 0.12; }
  100% { opacity: 0; transform: translateY(-20px) translateX(30px); }
}
.particle:nth-child(1) { left: 8%; animation-duration: 20s; animation-delay: 0s; width: 2px; height: 2px; }
.particle:nth-child(2) { left: 25%; animation-duration: 26s; animation-delay: 5s; }
.particle:nth-child(3) { left: 48%; animation-duration: 22s; animation-delay: 9s; width: 2px; height: 2px; }
.particle:nth-child(4) { left: 68%; animation-duration: 28s; animation-delay: 3s; width: 2.5px; height: 2.5px; }
.particle:nth-child(5) { left: 85%; animation-duration: 24s; animation-delay: 7s; }

.wrapper { position: relative; z-index: 1; }

/* ===== Top Bar ===== */
.topbar {
  background: var(--bg-dark);
  color: #d6d3ce;
  text-align: center;
  padding: 10px 2rem;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: -0.01em;
}
.topbar a { color: var(--gold); text-decoration: none; font-weight: 600; }
.topbar a:hover { text-decoration: underline; }

/* ===== Header ===== */
header {
  background: var(--bg-white);
  border-bottom: 2px solid var(--ink);
}
.header-brand {
  max-width: 1080px;
  margin: 0 auto;
  text-align: center;
  padding: 36px 2rem 22px;
  border-bottom: 1px solid var(--border);
}
.masthead {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: 42px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.masthead a { color: inherit; text-decoration: none; }
.masthead-sub {
  font-size: 13px;
  color: var(--ink-light);
  margin-top: 8px;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-weight: 400;
}

/* ===== Navigation ===== */
.header-nav {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
}
.header-nav a {
  color: var(--ink-secondary);
  text-decoration: none;
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: all 0.15s;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}
.header-nav a:hover { color: var(--maroon); }
.header-nav a.active {
  color: var(--maroon);
  border-bottom-color: var(--maroon);
}
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--ink);
  cursor: pointer;
  padding: 12px 2rem;
  width: 100%;
  text-align: right;
}

/* ===== Footer ===== */
footer {
  background: var(--bg-white);
  border-top: 2px solid var(--ink);
  padding: 28px 2rem;
  text-align: center;
  font-size: 13px;
  color: var(--ink-light);
  font-weight: 400;
}
footer a { color: var(--ink-secondary); text-decoration: none; }

/* ===== Responsive — Mobile ===== */
@media (max-width: 768px) {
  .masthead { font-size: 30px; }
  .nav-toggle { display: block; }
  .header-nav {
    display: none;
    flex-direction: column;
    padding: 0;
  }
  .header-nav.open { display: flex; }
  .header-nav a {
    padding: 14px 2rem;
    font-size: 15px;
    border-bottom: 1px solid var(--border);
    border-left: none;
    margin-bottom: 0;
  }
  .header-nav a:last-child { border-bottom: none; }
}
