@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400;600&family=Inter:wght@400;500;600&display=swap');

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

body {
  background: #fafaf8;
  font-family: 'Inter', sans-serif;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
}

/* ── Title bar ── */
#title-bar {
  position: fixed;
  top: 24px;
  left: 32px;
  z-index: 10;
  pointer-events: none;
}
#title-bar h1 {
  font-family: 'Caveat', cursive;
  font-size: 32px;
  font-weight: 600;
  color: #333;
  margin-bottom: 0;
}
#title-bar .subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: #aaa;
  letter-spacing: 0.5px;
  display: block;
  margin-top: -2px;
  margin-bottom: 6px;
}
#title-bar p {
  font-size: 11px;
  color: #bbb;
  margin-top: 0;
}

/* ── Graph ── */
#graph-container {
  width: 100vw;
  height: 100vh;
  transition: width 0.4s ease;
}
#graph-container.shifted {
  width: 50vw;
}
#graph {
  width: 100%;
  height: 100%;
}

/* ── Nodes ── */
.node-group { cursor: pointer; }
.node-star {
  stroke-width: 1.8;
  stroke-linejoin: round;
  filter: drop-shadow(2px 3px 4px rgba(0,0,0,0.06));
  transition: opacity 0.3s;
}
.node-label {
  font-family: 'Caveat', cursive;
  font-size: 17px;
  font-weight: 600;
  fill: #333;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
  transition: opacity 0.3s;
}
.node-family {
  font-family: 'Inter', sans-serif;
  font-size: 9px;
  fill: #888;
  text-anchor: middle;
  pointer-events: none;
  transition: opacity 0.3s;
}

/* ── Edges ── */
.link-line {
  fill: none;
  stroke: #ccc;
  stroke-width: 1.4;
  transition: opacity 0.3s, stroke 0.3s;
}
.link-label {
  font-family: 'Caveat', cursive;
  font-size: 11px;
  fill: #aaa;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

/* ── Hover dim/highlight ── */
.dimmed .node-star,
.dimmed .node-label,
.dimmed .node-family { opacity: 0.12; }
.dimmed .link-line { opacity: 0.06; }
.highlighted .node-star { opacity: 1; stroke-width: 2.5; }
.highlighted .node-label,
.highlighted .node-family { opacity: 1; }
.highlighted .link-line { opacity: 1; stroke: #888; stroke-width: 2; }
.highlighted .link-label { opacity: 1; }

/* ── Panel ── */
.panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 50vw;
  max-width: 720px;
  height: 100vh;
  background: #fff;
  border-left: 1px solid #e8e8e8;
  overflow-y: auto;
  z-index: 20;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 48px 40px 60px;
}
.panel.open {
  transform: translateX(0);
}
.panel.hidden {
  pointer-events: none;
}

#panel-close {
  position: sticky;
  top: 0;
  float: right;
  background: none;
  border: none;
  font-size: 28px;
  color: #999;
  cursor: pointer;
  line-height: 1;
  z-index: 21;
}
#panel-close:hover { color: #333; }

/* ── Panel content ── */
.panel-header { margin-bottom: 28px; }
.panel-header h2 {
  font-family: 'Caveat', cursive;
  font-size: 36px;
  font-weight: 600;
  color: #222;
  margin-bottom: 4px;
}
.panel-header .tagline {
  font-size: 14px;
  color: #777;
  margin-bottom: 12px;
}
.panel-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.panel-tag {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  background: #f0f0f0;
  color: #666;
}
.panel-tag.family-tag {
  font-weight: 600;
}

/* ── Mood board carousel ── */
.mood-grid {
  display: flex;
  gap: 10px;
  margin: 24px 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
}
.mood-grid img {
  flex: 0 0 auto;
  width: 180px;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: 10px;
  background: #f0ede8;
  scroll-snap-align: start;
}
.mood-grid::-webkit-scrollbar { height: 4px; }
.mood-grid::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

/* ── Key elements ── */
.key-elements { margin: 24px 0; }
.key-elements h3 {
  font-family: 'Caveat', cursive;
  font-size: 22px;
  color: #333;
  margin-bottom: 10px;
}
.key-elements ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.key-elements li {
  font-size: 13px;
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px dashed #ccc;
  color: #555;
}

/* ── Section headings ── */
.panel-section {
  margin: 28px 0;
}
.panel-section h3 {
  font-family: 'Caveat', cursive;
  font-size: 22px;
  color: #333;
  margin-bottom: 10px;
}
.panel-section p,
.panel-section li {
  font-size: 14px;
  color: #555;
  line-height: 1.7;
}
.panel-section ul {
  list-style: disc;
  padding-left: 20px;
}
.panel-section a {
  color: #5a8a8a;
  text-decoration: none;
}
.panel-section a:hover {
  text-decoration: underline;
}

/* ── Brands / Shop the Look ── */
.brand-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.brand-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-radius: 12px;
  background: #f8f6f2;
  border: 1px solid #e8e5df;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
.brand-card:hover {
  background: #f0ede8;
  border-color: #d5d0c8;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.brand-name {
  font-size: 13px;
  font-weight: 600;
  color: #333;
}
.brand-visit {
  font-size: 11px;
  color: #999;
  white-space: nowrap;
}

/* ── Related aesthetics ── */
.related-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.related-chip {
  font-size: 13px;
  padding: 6px 16px;
  border-radius: 20px;
  cursor: pointer;
  border: 1.5px solid #ddd;
  background: #fafaf8;
  color: #444;
  transition: background 0.2s, border-color 0.2s;
}
.related-chip:hover {
  background: #f0ede8;
  border-color: #bbb;
}

/* ── Footer ── */
#footer-bar {
  position: fixed;
  bottom: 20px;
  left: 0;
  width: 100%;
  text-align: center;
  z-index: 10;
  pointer-events: none;
}
#footer-bar p {
  font-family: 'Caveat', cursive;
  font-size: 14px;
  color: #bbb;
}

/* ── Search bar ── */
#search-bar {
  position: fixed;
  top: 24px;
  right: 32px;
  z-index: 15;
  width: 240px;
}
#search-input {
  width: 100%;
  padding: 10px 16px;
  border: 1px solid #ddd;
  border-radius: 24px;
  background: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: #333;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
#search-input:focus {
  border-color: #bbb;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
#search-input::placeholder { color: #bbb; }
#search-results {
  margin-top: 4px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  max-height: 360px;
  overflow-y: auto;
  display: none;
}
#search-results.active { display: block; }
.search-item {
  padding: 10px 16px;
  cursor: pointer;
  font-size: 13px;
  color: #444;
  border-bottom: 1px solid #f4f4f2;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: #fafaf8; }
.search-item .family-hint {
  font-size: 10px;
  color: #aaa;
}
#search-results::-webkit-scrollbar { width: 4px; }
#search-results::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

/* ── A-Z Browse ── */
#browse-toggle {
  position: fixed;
  top: 72px;
  right: 32px;
  z-index: 15;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid #ddd;
  background: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #666;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
#browse-toggle:hover {
  background: #f8f6f2;
  border-color: #bbb;
}
#browse-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: 320px;
  height: 100vh;
  background: #fff;
  border-left: 1px solid #e8e8e8;
  z-index: 25;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}
#browse-menu.open {
  transform: translateX(0);
}
#browse-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #eee;
}
#browse-header span {
  font-family: 'Caveat', cursive;
  font-size: 24px;
  font-weight: 600;
  color: #333;
}
#browse-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #999;
  cursor: pointer;
}
#browse-close:hover { color: #333; }
#browse-letters {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 12px 24px;
  border-bottom: 1px solid #eee;
}
.letter-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: none;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #888;
  cursor: pointer;
  transition: background 0.15s;
}
.letter-btn:hover { background: #f0ede8; }
.letter-btn.active { background: #333; color: #fff; }
.letter-btn.disabled { color: #ddd; cursor: default; }
#browse-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}
.browse-letter-group {
  padding: 8px 24px 4px;
  font-family: 'Caveat', cursive;
  font-size: 20px;
  font-weight: 600;
  color: #bbb;
  position: sticky;
  top: 0;
  background: #fff;
}
.browse-item {
  padding: 8px 24px;
  cursor: pointer;
  font-size: 13px;
  color: #444;
  transition: background 0.15s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.browse-item:hover { background: #fafaf8; }
.browse-item .family-hint {
  font-size: 10px;
  color: #aaa;
}
#browse-list::-webkit-scrollbar { width: 4px; }
#browse-list::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

/* ── Scrollbar ── */
.panel::-webkit-scrollbar { width: 6px; }
.panel::-webkit-scrollbar-thumb { background: #ddd; border-radius: 3px; }
