/* ==================================================
   Astrolaabh · Design Library
   Self-contained: tokens + hero + category tabs +
   design-card grid + shared footer.
   ================================================== */
:root {
  --bone: #f1efe8;
  --paper: #f6f4ec;
  --ink-dark: #20251a;
  --ink: #ece7da;
  --gold: #a1793a;
  --gold-bright: #c9a24b;
  --sage: #5b634a;
  --madder: #b23a2a;
  --hair: rgba(32, 37, 26, 0.12);
  --hair-gold: rgba(161, 121, 58, 0.28);
  --bg-deep: #20251a;
  --bg-deeper: #1b2016;
  /* Sesbania's @font-face is declared in site-nav.css, which this page
     already loads — the display face costs no further loading. */
  --font-display: "Sesbania", "Cormorant Garamond", Georgia, serif;
  --font-ui: "Geist", "Outfit", -apple-system, "Segoe UI", sans-serif;
  --font-deva: "Noto Sans Devanagari", var(--font-ui);

  /* Type: seven steps, in place of the dozen ad-hoc sizes this page grew.
     Every font-size in the file resolves to one of these. */
  --t-micro: 0.6875rem;   /* eyebrows, meta, counts — always caps + tracked */
  --t-meta: 0.8125rem;    /* tags, small labels */
  --t-body: 0.9375rem;    /* card story */
  --t-lede: 1.0625rem;    /* hero lede */
  --t-name: 1.375rem;     /* card name */
  --t-head: 2rem;         /* section headings */
  --t-display: clamp(3rem, 6.5vw, 5.5rem);
  --track-caps: 0.28em;

  /* Space: a 4px grid, in place of one-off margins */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4rem;
  --s-9: 6rem;
  --s-10: 8rem;

  --pad-x: clamp(1.25rem, 5vw, 4.5rem);
  --nav-h: 74px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bone);
  color: var(--ink-dark);
  font-family: var(--font-ui);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }

/* ============ Reveal-on-scroll ============ */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.85s ease, transform 0.95s var(--ease);
  transition-delay: var(--reveal-delay, 0s);
}
[data-reveal].in { opacity: 1; transform: none; }

/* ============ Cinematic video hero ============ */
.dl-hero {
  position: relative;
  min-height: clamp(460px, 64vh, 680px);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(3rem, 8vh, 6rem) var(--pad-x);
}
.dl-hero-video {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.dl-hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  /* One directional wash, not two stacked ones: weighted to the foot where the
     lede sits, near-clear across the middle so the jewellery stays visible.
     Sesbania carries the title without the extra darkening Georgia needed. */
  background: linear-gradient(
    180deg,
    rgba(10, 12, 7, 0.42) 0%,
    rgba(10, 12, 7, 0.3) 34%,
    rgba(10, 12, 7, 0.34) 58%,
    rgba(10, 12, 7, 0.58) 100%
  );
}
.dl-hero-inner { position: relative; z-index: 2; max-width: 880px; }
.dl-eyebrow {
  font-family: var(--font-ui);
  font-size: var(--t-micro);
  font-weight: 500;
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--gold-bright);
  margin: 0 0 1.2rem;
  text-shadow: 0 1px 12px rgba(8, 10, 5, 0.5);
}
.dl-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--t-display);
  line-height: 0.98;
  color: var(--bone);
  margin: 0;
  text-shadow: 0 2px 34px rgba(8, 10, 5, 0.6);
}
.dl-lede {
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: var(--t-lede);
  line-height: 1.7;
  color: rgba(246, 244, 236, 0.95);
  max-width: 52ch;
  margin: 1.5rem auto 0;
  text-shadow: 0 1px 3px rgba(8, 10, 5, 0.55), 0 2px 22px rgba(8, 10, 5, 0.7);
}
/* breathing scroll cue */
/* category tabs: sticky under the nav */
.dl-tabs {
  position: sticky;
  top: var(--nav-h);
  z-index: 40;
  background: rgba(246, 244, 236, 0.9);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  backdrop-filter: blur(14px) saturate(1.1);
  border-bottom: 1px solid var(--hair);
}
.dl-tabs-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.75rem, 2vw, 1.5rem);
  padding: 0.75rem var(--pad-x);
  flex-wrap: wrap;
}
.dl-tabs-list {
  display: inline-flex;
  align-items: center;
  gap: clamp(1.25rem, 3.4vw, 3rem);
}
/* search field: quiet pill with icon */
.dl-search {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 40px;
  padding: 0 0.55rem 0 0.95rem;
  border: 1px solid var(--hair);
  border-radius: 999px;
  background: rgba(246, 244, 236, 0.6);
  min-width: min(280px, 60vw);
  transition: border-color 0.25s ease, background 0.25s ease;
}
.dl-search:focus-within { border-color: var(--gold); background: var(--paper); }
.dl-search > i { font-size: 1rem; color: var(--gold); flex: none; }
.dl-search input {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  outline: none;
  font-family: var(--font-ui);
  font-weight: 300;
  font-size: var(--t-body);
  color: var(--ink-dark);
}
.dl-search input::placeholder { color: rgba(32, 37, 26, 0.45); }
.dl-search-clear {
  flex: none;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: rgba(32, 37, 26, 0.06);
  color: rgba(32, 37, 26, 0.55);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: var(--t-micro);
  transition: background 0.2s ease, color 0.2s ease;
}
.dl-search-clear:hover { background: rgba(161, 121, 58, 0.14); color: var(--gold); }
.dl-count {
  max-width: 1400px;
  margin: 0 auto clamp(1.25rem, 3vh, 2rem);
  font-family: var(--font-ui);
  font-size: var(--t-micro);
  font-weight: 500;
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: rgba(32, 37, 26, 0.5);
}
.dl-count b { color: var(--ink-dark); font-weight: 500; }
.dl-count[hidden] { display: none; }
/* A category is a name, set in the house's own label style, with a gold rule
   drawn under the live one — not a pill lifting off a track. */
.dl-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: var(--t-micro);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  line-height: 1.3;
  color: rgba(32, 37, 26, 0.55);
  padding: var(--s-1) 0 var(--s-3);
  white-space: nowrap;
  transition: color 0.3s ease;
}
/* the row carried icons; the names carry themselves */
.dl-tab i { display: none; }
/* how many designs sit behind the name, set small and ahead of it so the
   names still line up as a row of names */
.dl-tab-n {
  margin-right: var(--s-2);
  font-size: 0.625rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  color: rgba(32, 37, 26, 0.38);
  transition: color 0.3s ease;
}
.dl-tab:hover .dl-tab-n { color: rgba(32, 37, 26, 0.55); }
.dl-tab.is-active .dl-tab-n { color: var(--gold); }
.dl-tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transition: transform 0.4s var(--ease);
}
.dl-tab:hover { color: rgba(32, 37, 26, 0.85); }
.dl-tab:focus-visible { outline: 2px solid var(--hair-gold); outline-offset: 4px; }
.dl-tab.is-active { color: var(--ink-dark); }
.dl-tab.is-active::after { transform: scaleX(1); }

/* ============ Grid ============ */
.dl-results {
  max-width: 1400px;
  margin: 0 auto;
  padding: clamp(2rem, 4vh, 3rem) var(--pad-x) clamp(3.5rem, 8vh, 6rem);
}
/* Three up, not four: at 1600px four columns give each piece a ~340px cell,
   three give ~440px. For objects this detailed, presence beats density. */
.dl-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-9) clamp(var(--s-6), 3vw, var(--s-7));
}
.dl-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 1rem;
  font-family: var(--font-display);
  font-size: var(--t-name);
  color: rgba(32, 37, 26, 0.5);
}
.dl-empty button {
  display: inline-block;
  margin-top: 0.9rem;
  background: none; border: 0; cursor: pointer;
  font-family: var(--font-ui); font-size: var(--t-body);
  color: var(--gold);
  border-bottom: 1px solid var(--gold);
}
.dl-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.dl-card-media {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0;
  overflow: hidden;
  border: 1px solid var(--hair-gold);
  /* One flat ground. The tinted per-card gradient that used to sit here
     fought the photograph's own background and made the grid read patchy. */
  background: var(--bone);
  aspect-ratio: 1 / 1;
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}
.dl-card-media:hover { border-color: rgba(161, 121, 58, 0.5); box-shadow: 0 18px 40px -22px rgba(32, 37, 26, 0.35); }
.dl-card-media:focus-visible { outline: 2px solid rgba(91, 99, 74, 0.55); outline-offset: 2px; }
.dl-card-media img {
  width: 100%;
  height: 100%;
  /* contain, not cover: a photograph shot to the spec (1:1, object at ~72%
     on bone) lands exactly as shot, and a source that misses the spec shows
     whole rather than being cropped through. */
  object-fit: contain;
  padding: var(--s-6);
  transition: transform 0.7s var(--ease);
}
.dl-card:hover .dl-card-media img { transform: scale(1.03); }
/* "View the studies" hint bottom-right */
.dl-studies {
  position: absolute;
  right: 0.85rem;
  bottom: 0.85rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  background: rgba(58, 64, 48, 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(224, 200, 130, 0.28);
  font-family: var(--font-ui);
  font-size: var(--t-micro);
  letter-spacing: 0.04em;
  color: rgba(246, 244, 236, 0.94);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.35s ease, transform 0.35s var(--ease);
}
.dl-studies i { color: var(--gold-bright); }
.dl-card:hover .dl-studies { opacity: 1; transform: none; }

/* The name, in both its scripts — they are the same name, so they sit
   together rather than being separated by a classifier line. */
.dl-card-deva {
  font-family: var(--font-deva);
  font-weight: 400;
  font-size: var(--t-body);
  line-height: 1.4;
  color: var(--gold);
  margin: var(--s-5) 0 var(--s-1);
}
.dl-card-name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--t-name);
  line-height: 1.1;
  color: var(--ink-dark);
  margin: 0;
}
.dl-card-material {
  font-family: var(--font-ui);
  font-weight: 300;
  font-size: var(--t-meta);
  color: rgba(32, 37, 26, 0.6);
  margin: var(--s-2) 0 0;
}
.dl-card-story {
  font-family: var(--font-ui);
  font-weight: 300;
  font-size: var(--t-body);
  line-height: 1.65;
  color: rgba(32, 37, 26, 0.64);
  max-width: 46ch;
  margin: var(--s-3) 0 0;
  /* keep cards compact: clamp the story to three lines */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* classifier and count, demoted to a quiet line on a hairline — the count
   used to be a white pill sitting on the photograph */
.dl-card-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-4);
  margin: var(--s-5) 0 0;
  padding-top: var(--s-3);
  border-top: 1px solid var(--hair);
}
.dl-card-cat,
.dl-card-remain {
  font-family: var(--font-ui);
  font-size: var(--t-micro);
  font-weight: 500;
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  margin: 0;
}
.dl-card-cat { color: rgba(32, 37, 26, 0.5); }
.dl-card-remain { color: var(--gold); white-space: nowrap; }
/* the rare pieces still shout, just without a badge to do it with */
.dl-card-remain.is-scarce { color: var(--madder); }

/* the card's primary action is the landing page's primary button, verbatim:
   .sc-btn + .sc-btn--solid from scrolly.css — the sage photograph fill, the
   gold hairline it needs to hold an edge, and the same lift on hover */
.dl-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  align-self: flex-start;
  margin: var(--s-4) 0 0;
  padding: 0.6rem 1.15rem;
  border: 1px solid rgba(220, 190, 110, 0.5);
  border-radius: 999px;
  background: url("assets/consult-card-bg.jpg") center / cover;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 0.82rem;
  line-height: 1.3;
  letter-spacing: 0.01em;
  color: #ffffff;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(20, 25, 15, 0.18);
  transition: transform 0.25s ease, box-shadow 0.25s ease,
              background 0.25s ease, border-color 0.25s ease;
}
.dl-card-cta i { font-size: 0.85em; transition: transform 0.35s var(--ease); }
.dl-card-cta:hover,
.dl-card-cta:focus-visible {
  transform: translateY(-1px);
  background: linear-gradient(rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0.22)),
              url("assets/consult-card-bg.jpg") center / cover;
  border-color: rgba(220, 190, 110, 0.75);
  box-shadow: 0 8px 20px rgba(20, 25, 15, 0.24);
}
.dl-card-cta:hover i { transform: translateX(4px); }

/* ============ Footer (shared chrome) ============ */
.site-footer {
  background: var(--bg-deep);
  color: var(--ink);
  padding: clamp(4rem, 9vh, 7rem) var(--pad-x) 2rem;
  overflow: hidden;
}
.footer-top {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.3fr 2fr;
  gap: clamp(2.5rem, 6vw, 6rem);
  padding-bottom: clamp(3rem, 6vh, 5rem);
}
.footer-eyebrow {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  letter-spacing: 0.06em;
  color: var(--gold-bright);
  margin-bottom: 1.25rem;
}
.footer-eyebrow em { font-style: italic; }
.footer-cta-line {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.5rem, 2.4vw, 2.125rem);
  line-height: 1.25;
  color: var(--ink);
  max-width: 16ch;
  margin-bottom: 2rem;
}
.footer-news {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 340px;
  border-bottom: 1px solid rgba(236, 231, 218, 0.28);
  padding-bottom: 0.6rem;
  transition: border-color 0.3s ease;
}
.footer-news:focus-within { border-color: var(--gold-bright); }
.footer-news input {
  flex: 1;
  background: none;
  border: 0;
  outline: none;
  color: var(--ink);
  font-family: var(--font-ui);
  font-weight: 300;
  font-size: 0.9375rem;
}
.footer-news input::placeholder { color: rgba(236, 231, 218, 0.45); }
.footer-news button {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(224, 200, 130, 0.4);
  background: none;
  color: var(--gold-bright);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.3s ease, transform 0.3s ease;
}
.footer-news button:hover { background: rgba(220, 185, 104, 0.14); transform: translateX(2px); }
.footer-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
.footer-col h6 {
  font-family: var(--font-ui);
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-bright);
  margin-bottom: 1.25rem;
  font-weight: 500;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 0.85rem; padding: 0; margin: 0; }
.footer-col a {
  font-family: var(--font-ui);
  font-weight: 300;
  font-size: 0.9375rem;
  color: rgba(236, 231, 218, 0.7);
  text-decoration: none;
  position: relative;
  transition: color 0.25s ease, padding-left 0.25s ease;
}
.footer-col a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold-bright);
  transform: translate(-8px, -50%) scale(0);
  transition: transform 0.25s ease;
}
.footer-col a:hover { color: var(--gold-bright); padding-left: 13px; }
.footer-col a:hover::before { transform: translate(0, -50%) scale(1); }
.footer-bottom {
  max-width: 1400px;
  margin: 0 auto;
  padding-top: 2rem;
  border-top: 1px solid rgba(236, 231, 218, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  color: rgba(236, 231, 218, 0.5);
}
.footer-legal { display: flex; gap: 1.5rem; }
.footer-legal a { color: rgba(236, 231, 218, 0.5); text-decoration: none; transition: color 0.25s ease; }
.footer-legal a:hover { color: var(--gold-bright); }
.footer-top-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: 1px solid rgba(236, 231, 218, 0.22);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  color: rgba(236, 231, 218, 0.8);
  font-family: var(--font-ui);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.3s ease, color 0.3s ease;
}
.footer-top-btn:hover { border-color: var(--gold-bright); color: var(--gold-bright); }
.footer-top-btn i { transition: transform 0.3s ease; }
.footer-top-btn:hover i { transform: translateY(-3px); }

/* ============ Responsive ============ */
/* 3 up, then 2, then 1 — the cells stay generous the whole way down */
@media (max-width: 1180px) {
  .dl-grid { grid-template-columns: repeat(2, 1fr); gap: var(--s-8) var(--s-6); }
}
@media (max-width: 860px) {
  .dl-tabs-inner { justify-content: center; }
  .dl-tabs-list { gap: var(--s-5); }
  .dl-search { min-width: 100%; order: 2; }
}
@media (max-width: 760px) {
  .footer-top { grid-template-columns: 1fr; gap: 2.5rem; }
  .footer-cols { grid-template-columns: 1fr 1fr; gap: 2rem 1.5rem; }
}
@media (max-width: 620px) {
  .dl-grid { grid-template-columns: 1fr; gap: var(--s-8); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  [data-reveal] { opacity: 1; transform: none; }
}
/* ============ Floating search / ask bar (ported from the catalogue) ============ */
.ai-bar {
  position: fixed;
  left: 50%;
  bottom: clamp(1.25rem, 3vh, 2rem);
  transform: translateX(-50%) translateY(140%);
  z-index: 90;
  width: min(340px, calc(100vw - 2.5rem));
  padding: 0.4rem;
  border-radius: 999px;
  background: rgba(34, 32, 27, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  backdrop-filter: blur(16px) saturate(1.1);
  box-shadow:
    0 20px 50px -20px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  opacity: 0;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.7s ease, width 0.55s cubic-bezier(0.16, 1, 0.3, 1),
    border-radius 0.55s ease;
  backface-visibility: hidden;
}
.ai-bar.is-visible {
  transform: translateX(-50%) translateY(0) !important;
  opacity: 1 !important;
}
.ai-bar.expanded {
  width: min(430px, calc(100vw - 2.5rem));
  border-radius: 14px;
  padding: 0.5rem;
}
.ai-pill { display: flex; align-items: center; gap: 0.5rem; }
.ai-chips {
  position: absolute;
  left: 0;
  bottom: calc(100% + 0.6rem);
  min-width: 240px;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.5rem;
  border-radius: 18px;
  background: rgba(34, 32, 27, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  backdrop-filter: blur(16px) saturate(1.1);
  box-shadow: 0 24px 60px -22px rgba(0, 0, 0, 0.6);
  transform-origin: bottom left;
  animation: ai-chips-in 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.ai-chips[hidden] { display: none; }
.ai-menu-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.9);
  font-family: var(--font-ui);
  font-size: 0.9375rem;
  font-weight: 300;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}
.ai-menu-item i { font-size: 1.25rem; color: var(--gold-bright); flex: none; }
.ai-menu-item:hover { background: rgba(220, 185, 104, 0.12); color: var(--gold-bright); }
@keyframes ai-chips-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.ai-add.open { background: rgba(255, 255, 255, 0.16); }
.ai-add.open .icon-ask { display: none; }
.ai-add.open .icon-cue { display: block; }
.ai-add i { transition: transform 0.3s ease; }
.ai-bar.expanded .ai-pill { display: none; }
.ai-suggest { display: none; flex-direction: column; gap: 0.5rem; }
.ai-bar.expanded .ai-suggest { display: flex; }
.ai-bar.searching { border-radius: 16px; }
.ai-bar.searching .ai-suggest {
  display: flex;
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 0.6rem);
  padding: 0.75rem;
  border-radius: 16px;
  background: rgba(34, 32, 27, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  backdrop-filter: blur(16px) saturate(1.1);
  box-shadow: 0 24px 60px -22px rgba(0, 0, 0, 0.6);
  animation: ai-chips-in 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.ai-suggest-head {
  font-family: var(--font-ui);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-bright);
  margin: 0 0 0.6rem 0.15rem;
}
.ai-thumbs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 0.4rem;
}
.ai-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  background: rgba(236, 231, 218, 0.94) center / cover no-repeat;
  border: 1px solid rgba(236, 231, 218, 0.12);
  transition: border-color 0.35s ease, box-shadow 0.35s ease;
}
.ai-thumb:hover {
  border-color: rgba(224, 200, 130, 0.55);
  box-shadow: 0 10px 28px -12px rgba(32, 37, 26, 0.4);
}
.ai-thumb.gem {
  background-size: 68%;
  background-position: center;
  transition: border-color 0.35s ease, box-shadow 0.35s ease,
    background-size 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    background-position 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.ai-thumb.gem:hover { background-size: 52%; background-position: center 22%; }
.ai-thumb-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.1rem 0.5rem 0.6rem;
  background: linear-gradient(to top, rgba(243, 240, 231, 0.96) 55%, rgba(243, 240, 231, 0));
  text-align: center;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.4s ease 0.05s, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.05s;
}
.ai-thumb.gem .ai-thumb-info { background: none; padding-top: 0.4rem; }
.ai-thumb:hover .ai-thumb-info { opacity: 1; transform: none; }
.ai-thumb-info strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.8125rem;
  line-height: 1.15;
  color: var(--ink-dark);
  margin-bottom: 0.15rem;
}
.ai-thumb-info span {
  display: block;
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: 0.625rem;
  letter-spacing: 0.06em;
  color: #a1793a;
}
.ai-actions { display: flex; align-items: center; gap: 0.6rem; }
.ai-action {
  flex: 1;
  text-align: center;
  padding: 0.85rem 1rem;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.92);
  font-family: var(--font-ui);
  font-size: 0.9375rem;
  font-weight: 400;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.16);
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}
.ai-action:hover { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.32); }
.ai-close { flex: none; }
.ai-btn {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.09);
  color: rgba(255, 255, 255, 0.92);
  font-size: 1rem;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.3s ease, border-color 0.3s ease,
    transform 0.3s ease, color 0.3s ease;
}
.ai-btn:hover { background: rgba(255, 255, 255, 0.16); }
.ai-send:hover { transform: translateY(-1px); }
.ai-home, .ai-home:hover, .ai-home:focus { text-decoration: none; }
.ai-home i { text-decoration: none; }
.ai-add .icon-cue { display: none; }
.ai-input-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 0;
}
.ai-input {
  width: 100%;
  background: none;
  border: 0;
  outline: none;
  color: var(--ink);
  font-family: var(--font-ui);
  font-weight: 300;
  font-size: 0.9375rem;
  padding: 0 0.5rem;
}
.ai-ghost {
  position: absolute;
  left: 0.5rem;
  right: 0.5rem;
  color: rgba(236, 231, 218, 0.55);
  font-family: var(--font-ui);
  font-weight: 300;
  font-size: 0.9375rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.ai-input:focus ~ .ai-ghost,
.ai-input:not(:placeholder-shown) ~ .ai-ghost { opacity: 0; }
.ai-input.has-text ~ .ai-ghost { opacity: 0; }
@media (max-width: 560px) {
  .ai-bar { gap: 0.35rem; padding: 0.4rem; }
  .ai-btn { width: 32px; height: 32px; font-size: 0.9375rem; }
}

/* ============ "View the studies" lightbox ============ */
.dl-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 5vh, 3rem) clamp(3.5rem, 8vw, 6rem);
  background: rgba(34, 32, 27, 0.74);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
}
.dl-lightbox[hidden] { display: none; }
.dl-lb-stage {
  position: relative;
  width: min(760px, 100%);
  max-height: 90vh;
  overflow: auto;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(91, 99, 74, 0.06), transparent 60%),
    var(--paper);
  border: 1px solid var(--hair-gold);
  border-radius: 16px;
  box-shadow: 0 50px 100px -40px rgba(0, 0, 0, 0.6);
  padding: clamp(1.75rem, 3.5vw, 3rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  transform: translateY(12px) scale(0.99);
}
.dl-lb-stage.is-in { animation: dl-lb-in 0.5s var(--ease) forwards; }
@keyframes dl-lb-in { to { opacity: 1; transform: none; } }
.dl-lb-head { text-align: center; margin-bottom: 0.5rem; }
.dl-lb-eyebrow {
  font-family: var(--font-ui);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--sage);
  margin: 0 0 0.35rem;
}
.dl-lb-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 1.05;
  color: var(--ink-dark);
  margin: 0;
}
.dl-lb-sheet { width: 100%; max-width: 480px; margin: 0.5rem auto 0; }
.dl-blueprint { width: 100%; height: auto; display: block; }
.dl-bp-label { font-family: var(--font-ui); font-size: 26px; letter-spacing: 8px; fill: rgba(58, 64, 48, 0.85); }
.dl-bp-deva { font-family: "Noto Sans Devanagari", var(--font-display), serif; font-size: 30px; fill: rgba(161, 121, 58, 0.9); }
.dl-bp-note { font-family: var(--font-ui); font-size: 15px; letter-spacing: 4px; fill: rgba(91, 99, 74, 0.5); }
.dl-lb-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--sage);
  text-decoration: none;
  transition: color 0.25s ease, gap 0.25s var(--ease);
}
.dl-lb-cta i { font-size: 0.85em; color: var(--gold); transition: transform 0.25s var(--ease); }
.dl-lb-cta:hover { color: var(--gold); gap: 0.75rem; }
.dl-lb-cta:hover i { transform: translateX(3px); }
/* controls */
.dl-lb-close,
.dl-lb-nav {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(246, 244, 236, 0.35);
  background: rgba(246, 244, 236, 0.1);
  color: var(--paper);
  cursor: pointer;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}
.dl-lb-close { top: clamp(1rem, 3vh, 1.75rem); left: clamp(1rem, 3vw, 1.75rem); width: 44px; height: 44px; font-size: 1.1rem; }
.dl-lb-nav { top: 50%; transform: translateY(-50%); width: 52px; height: 52px; font-size: 1.3rem; }
.dl-lb-prev { left: clamp(0.5rem, 2vw, 1.5rem); }
.dl-lb-next { right: clamp(0.5rem, 2vw, 1.5rem); }
.dl-lb-close:hover,
.dl-lb-nav:hover { background: rgba(246, 244, 236, 0.2); border-color: rgba(224, 200, 130, 0.6); }
.dl-lb-nav:hover { transform: translateY(-50%) scale(1.06); }
@media (max-width: 600px) {
  .dl-lightbox { padding: 1rem; }
  .dl-lb-nav { width: 44px; height: 44px; }
  .dl-lb-prev { left: 0.35rem; }
  .dl-lb-next { right: 0.35rem; }
}
@media (prefers-reduced-motion: reduce) {
  .dl-lb-stage { opacity: 1; transform: none; }
}
