/* The Perfume Atlas — /perfumes/
   Elegant, feminine, Tufte-restrained: the bottles are the data-ink; chrome stays quiet.
   Display type: Cormorant Garamond. Body: the site serif. Palette: cream + dusty rose. */

:root {
  --cream: #faf8f3;
  --ink: #38332e;
  --ink-soft: #6f685e;
  --ink-faint: #7d7461;   /* ~4.2:1 on cream — readable secondary text, still quiet */
  --rose: #b8757d;
  --rose-deep: #9a565f;
  --line: #e7ded0;
  --line-soft: #efe9dc;
  --panel: rgba(250, 248, 243, 0.92);
  --shadow: 0 6px 28px rgba(80, 60, 50, 0.13);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--cream); }

#app { position: fixed; inset: 0; }

/* visually hidden but available to screen readers / keyboard focus */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sr-only:focus { position: fixed; top: 10px; left: 10px; width: auto; height: auto; margin: 0;
  clip: auto; z-index: 20; background: #fff; color: var(--rose-deep); padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 8px; }
#atlas { position: absolute; inset: 0; display: block; cursor: grab; touch-action: none; }
#atlas.dragging { cursor: grabbing; }
#atlas.pointing { cursor: pointer; }

/* ---------- top-left heads-up panel ---------- */
#hud {
  position: absolute; top: 26px; left: 26px; width: 312px; max-width: calc(100vw - 52px);
  max-height: calc(100vh - 52px); overflow-y: auto; overscroll-behavior: contain;
  padding: 22px 22px 18px; z-index: 5;
  background: var(--panel); -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
  color: var(--ink);
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}
#hud::-webkit-scrollbar { width: 7px; }
#hud::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

#hud h1 {
  font-family: "Cormorant Garamond", Cormorant, Garamond, serif;
  font-weight: 500; font-size: 33px; line-height: 1.02; letter-spacing: .2px;
  margin: 0 0 2px; color: var(--ink);
}
#hud h1 .the { display: block; font-size: 14px; letter-spacing: .32em; text-transform: uppercase;
  color: var(--rose); font-family: "Iowan Old Style", Palatino, serif; margin-bottom: 5px; }
#hud .lede { font-size: 13.5px; line-height: 1.5; color: var(--ink-soft); margin: 8px 0 0; }
#hud .lede b { color: var(--ink); font-weight: 600; }

.sec-label { font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--ink-faint); margin: 18px 0 8px; }

/* search */
#search-wrap { position: relative; margin-top: 16px; }
#search {
  width: 100%; font-family: inherit; font-size: 14px; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 9px;
  padding: 9px 12px 9px 32px; outline: none;
}
#search:focus { border-color: var(--rose); box-shadow: 0 0 0 3px rgba(184, 117, 125, .12); }
#search::placeholder { color: var(--ink-faint); }
#search-wrap .mag { position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--ink-faint); font-size: 14px; pointer-events: none; }
#results { position: absolute; top: calc(100% + 5px); left: 0; right: 0; z-index: 8;
  background: #fff; border: 1px solid var(--line); border-radius: 9px; box-shadow: var(--shadow);
  max-height: 280px; overflow-y: auto; }
#results:empty { display: none; }
#results .r { display: flex; gap: 9px; align-items: center; padding: 7px 10px; cursor: pointer;
  border-bottom: 1px solid var(--line-soft); }
#results .r:last-child { border-bottom: none; }
#results .r:hover, #results .r.active { background: #f3ece0; }
#results .r .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
#results .r .nm { font-size: 13px; color: var(--ink); line-height: 1.15; }
#results .r .br { font-size: 11px; color: var(--ink-faint); }

/* legend of scent families */
#legend { margin-top: 4px; }
#legend .fam { display: flex; align-items: baseline; gap: 9px; padding: 4px 6px; margin: 0 -6px;
  border-radius: 7px; cursor: pointer; width: calc(100% + 12px); text-align: left;
  background: none; border: none; font: inherit; color: inherit; }
#legend .fam:hover { background: #f1e9dc; }
#legend .fam[aria-pressed="true"] { background: #eae2d3; }
#legend .fam:focus-visible { outline: 2px solid var(--rose); outline-offset: -1px; }
#legend .fam.dim { opacity: .34; }
#legend .fam .sw { width: 11px; height: 11px; border-radius: 50%; flex: none; transform: translateY(1px); }
#legend .fam .nm { font-size: 13px; color: var(--ink); line-height: 1.25; flex: 1 1 auto; }
#legend .fam .ct { font-size: 10.5px; color: var(--ink-faint); flex: none; }

#foot { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line-soft);
  font-size: 11.5px; line-height: 1.55; color: var(--ink-faint); }
#foot a { color: var(--rose-deep); text-decoration: none; border-bottom: 1px solid transparent; }
#foot a:hover { border-bottom-color: var(--rose-deep); }

/* reset / re-centre button */
#reset { position: absolute; bottom: 22px; right: 22px; z-index: 5;
  font-family: "Iowan Old Style", Palatino, serif; font-size: 12px; letter-spacing: .04em;
  color: var(--ink-soft); background: var(--panel); border: 1px solid var(--line);
  border-radius: 20px; padding: 7px 15px; cursor: pointer; box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
#reset:hover { color: var(--ink); border-color: var(--rose); }

#hint { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 4;
  font-family: "Iowan Old Style", Palatino, serif; font-size: 12px; color: var(--ink-faint);
  letter-spacing: .03em; pointer-events: none; transition: opacity .6s; text-align: center; }

/* ---------- hover / selection card ---------- */
#tip {
  position: absolute; z-index: 9; width: 234px; pointer-events: none;
  background: #fffdf8; border: 1px solid var(--line); border-radius: 13px;
  box-shadow: var(--shadow); overflow: hidden; opacity: 0; transition: opacity .12s;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}
#tip.show { opacity: 1; }
#tip.pinned { pointer-events: auto; }
#tip .hero { display: flex; gap: 12px; padding: 13px 14px 11px; }
#tip .shot { width: 64px; height: 84px; flex: none; border-radius: 7px; border: 1px solid var(--line);
  background: #fff center/contain no-repeat; }
#tip .meta { min-width: 0; flex: 1 1 auto; }
#tip .nm { font-family: "Cormorant Garamond", Garamond, serif; font-weight: 600;
  font-size: 19px; line-height: 1.08; color: var(--ink); margin-bottom: 2px; }
#tip .br { font-size: 11.5px; letter-spacing: .04em; color: var(--ink-soft); }
#tip .stat { font-size: 11.5px; color: var(--ink-faint); margin-top: 6px; }
#tip .stat .star { color: var(--rose); }
#tip .famtag { display: inline-flex; align-items: center; gap: 5px; margin-top: 7px;
  font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
#tip .famtag .sw { width: 8px; height: 8px; border-radius: 50%; }
#tip .notes { padding: 0 14px 12px; }
#tip .notes .lab { font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 5px; }
#tip .notes .n { display: inline-block; font-size: 11px; color: var(--ink);
  background: #f3ece0; border-radius: 11px; padding: 2px 8px; margin: 0 4px 4px 0; }
#tip .twins { border-top: 1px solid var(--line-soft); padding: 11px 14px 13px; }
#tip .twins .lab { font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 7px; }
#tip .twin { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; cursor: pointer; }
#tip .twin:hover .tn { color: var(--rose-deep); }
#tip .twin .ts { width: 30px; height: 38px; flex: none; border-radius: 4px; border: 1px solid var(--line);
  background: #fff center/contain no-repeat; }
#tip .twin .tw { min-width: 0; flex: 1 1 auto; }
#tip .twin .tn { font-size: 12px; color: var(--ink); line-height: 1.1; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
#tip .twin .tb { font-size: 10px; color: var(--ink-faint); }
#tip .twin .bar { height: 3px; border-radius: 2px; background: var(--line); margin-top: 3px; }
#tip .twin .bar i { display: block; height: 100%; border-radius: 2px; background: var(--rose); }
#tip .open { display: block; text-align: center; font-size: 11px; letter-spacing: .04em;
  color: var(--rose-deep); text-decoration: none; padding: 9px; border-top: 1px solid var(--line-soft); }
#tip .open:hover { background: #f9f2e8; }

/* progressive disclosure: the families/facts collapse on small screens so the map is the hero */
#hud-toggle { display: none; }
@media (max-width: 640px) {
  #hud { top: 10px; left: 10px; right: 10px; width: auto; max-height: calc(100vh - 20px); padding: 15px; }
  #hud h1 { font-size: 26px; }
  #hud .lede { font-size: 12.5px; }
  #reset { bottom: 12px; right: 12px; padding: 6px 12px; }
  #hint { display: none; }
  #hud-toggle {
    display: block; width: 100%; margin-top: 12px; font-family: inherit; font-size: 12px;
    letter-spacing: .12em; text-transform: uppercase; color: var(--rose-deep);
    background: none; border: 1px solid var(--line); border-radius: 8px; padding: 7px; cursor: pointer;
  }
  #hud-toggle:hover { background: #f3ece0; }
  #hud.collapsed #hud-more { display: none; }
}
