/* ===== Style 2 · Unified Violet ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #f3f0f8;
  --bg-deep: #e9e4f2;
  --surface: #ffffff;
  --paper: #ffffff;
  --line: #d5cce6;
  --image-well: #ffffff;
  --image-well-border: #d5cce6;
  --ink: #2a2140;
  --ink-soft: #4a4160;
  --muted: #736b88;
  --accent: #6d28d9;
  --accent-deep: #5b21b6;
  --accent-soft: rgba(109, 40, 217, 0.12);
  --aqua: var(--accent);
  --aqua-deep: var(--accent-deep);
  --aqua-soft: var(--accent-soft);

  --color-bg: var(--bg);
  --color-surface: var(--surface);
  --color-ink: var(--ink);
  --color-ink-soft: var(--ink-soft);
  --color-muted: var(--muted);
  --color-border: var(--line);
  --color-border-strong: #c4b8d9;
  --color-accent: var(--accent);

  --affiliate-height: 32px;
  --topbar-height: 58px;
  --font-display: "Syne", "Trebuchet MS", sans-serif;
  --font-sans: "IBM Plex Sans", "Segoe UI", sans-serif;
  --radius: 18px;
  --transition: 0.2s ease;
}

html {
  overflow-x: clip;
  background: var(--bg);
  scrollbar-gutter: stable;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  padding-top: var(--affiliate-height);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

.affiliate-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 400;
  height: var(--affiliate-height);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  background: var(--bg-deep);
  border-bottom: 1px solid var(--line);
}

.affiliate-bar p {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.topbar {
  position: sticky;
  top: var(--affiliate-height);
  z-index: 300;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: 860px;
  margin: 0 auto;
  min-height: var(--topbar-height);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-logo img {
  height: 50px;
  width: auto;
  display: block;
  /* filter: brightness(0); */
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar-link {
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  border-radius: 999px;
}

.topbar-link:hover,
.topbar-link.is-active {
  color: #fff;
  background: var(--accent);
}

.topbar-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  cursor: pointer;
}

.topbar-toggle span {
  display: block;
  width: 14px;
  height: 1.5px;
  margin: 3px auto;
  background: var(--ink);
  border-radius: 2px;
}

.topbar-toggle.active span:nth-child(1) {
  transform: translateY(4.5px) rotate(45deg);
}

.topbar-toggle.active span:nth-child(2) {
  opacity: 0;
}

.topbar-toggle.active span:nth-child(3) {
  transform: translateY(-4.5px) rotate(-45deg);
}

.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(42, 39, 36, 0.35);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.nav-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.nav-drawer {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(280px, 82vw);
  z-index: 510;
  background: var(--surface);
  border-right: 1px solid var(--line);
  box-shadow: 4px 0 24px rgba(42, 39, 36, 0.08);
  transform: translate3d(-100%, 0, 0);
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.28s ease, visibility 0.28s ease;
  flex-direction: column;
  padding-top: env(safe-area-inset-top, 0);
}

.nav-drawer.open {
  transform: translate3d(0, 0, 0);
  visibility: visible;
  pointer-events: auto;
}

.nav-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 18px;
  border-bottom: 1px solid var(--line);
}

.nav-drawer-title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.nav-drawer-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: var(--bg-deep);
  color: var(--ink);
  font-size: 20px;
  cursor: pointer;
}

.nav-drawer-links {
  display: flex;
  flex-direction: column;
  padding: 12px;
  gap: 6px;
}

.nav-drawer-links a {
  display: block;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  border-radius: 12px;
}

.nav-drawer-links a:hover {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.footer {
  margin-top: auto;
  background: var(--bg-deep);
  border-top: 1px solid var(--line);
}

.footer-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 28px 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  font-size: 12px;
  color: var(--muted);
}

.footer-divider {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  align-self: center;
}

.footer-link {
  color: var(--accent-deep);
  font-weight: 600;
}

.footer-link:hover {
  color: var(--ink);
}

@media (max-width: 768px) {
  .topbar-nav {
    display: none;
  }

  .topbar-toggle {
    display: flex;
  }

  .nav-overlay {
    display: block;
  }

  .nav-drawer {
    display: flex;
  }

  .footer-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
  }

  .footer-divider {
    display: none;
  }
}

@media (min-width: 769px) {
  .nav-overlay,
  .nav-drawer {
    display: none !important;
  }
}

html.nav-open {
  overflow: hidden;
}

body.nav-open {
  touch-action: none;
}
