/* The GLP-1 Life Dictionary (/dictionary). Prefix dx-.

   One stylesheet for both chromes: a guest reads it in the marketing layout
   (always light), a member in the app layout (light or dark). Everything around
   the art is built on the theme variables so dark mode just works. The night sky
   band at the top and the share image are art, the same in both themes, in the
   home page's colors: night #07020f / #110521 / #190a2e / #2a1145, lantern gold
   #f6c86e, firefly mint #86f2da. Animations always run. */

.dx {
  --dx-serif: "Newsreader", Georgia, "Times New Roman", serif;
  --dx-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --dx-cream: #f5ede2;
  --dx-lantern: #f6c86e;
  --dx-mint: #86f2da;
}
.dx [hidden] { display: none !important; }
/* In the app the sky band and the page share one column. */
.dx--app { max-width: 920px; margin: 0 auto; }

/* ---- Hero: the night sky band ------------------------------------------------ */
.dx-hero {
  position: relative; overflow: hidden; isolation: isolate; color: #fff;
  background:
    radial-gradient(120% 70% at 50% 118%, rgba(246,200,110,.32) 0%, rgba(162,73,111,.22) 32%, rgba(42,17,69,0) 62%),
    linear-gradient(180deg, #07020f 0%, #110521 38%, #190a2e 70%, #2a1145 100%);
}
.dx-hero--app { border-radius: var(--radius); margin-bottom: 1.25rem; box-shadow: var(--shadow); }
.dx-hero-inner {
  position: relative; z-index: 2; max-width: 920px; margin: 0 auto;
  padding: 3.2rem 16px 2.8rem; text-align: center;
}
.dx-hero--app .dx-hero-inner { padding: 2.2rem 1.25rem 2rem; }
.dx-hero h1 {
  font-family: var(--dx-serif); font-weight: 400; color: #fff; letter-spacing: -.02em;
  font-size: clamp(2.1rem, 6vw, 3.4rem); line-height: 1.05; margin: .55rem 0 .6rem;
}
.dx-hero .dx-word-h1 { font-size: clamp(2.3rem, 8vw, 4rem); margin-top: .35rem; overflow-wrap: anywhere; }
.dx-eyebrow, .dx-crumbs {
  font-family: var(--dx-mono); font-size: .74rem; font-weight: 500; letter-spacing: .14em;
  text-transform: uppercase; color: var(--dx-mint);
}
.dx-crumbs a { color: var(--dx-mint); text-decoration: none; }
.dx-crumbs a:hover { text-decoration: underline; }
.dx-crumbs span { color: rgba(245,237,226,.6); margin: 0 .25rem; }
.dx-lede { color: rgba(245,237,226,.88); font-size: 1.08rem; line-height: 1.5; max-width: 36rem; margin: 0 auto 1.3rem; }
.dx-hero-actions { display: flex; gap: .6rem; justify-content: center; align-items: center; flex-wrap: wrap; }
.dx-count { font-family: var(--dx-mono); font-size: .78rem; color: rgba(245,237,226,.7); letter-spacing: .04em; }

.dx-btn-lantern { background: var(--dx-lantern); color: #24132f; font-weight: 700; }
.dx-btn-lantern:hover { background: #ffd98d; color: #24132f; }
.dx-btn-ghost { background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(245,237,226,.32); }
.dx-btn-ghost:hover { background: rgba(255,255,255,.18); color: #fff; }

.dx-search {
  position: relative; display: flex; gap: .5rem; max-width: 34rem; margin: 0 auto 1rem;
  background: rgba(255,255,255,.08); border: 1px solid rgba(245,237,226,.28); border-radius: 999px;
  padding: .35rem .35rem .35rem 2.6rem;
}
.dx-search:focus-within { border-color: var(--dx-lantern); box-shadow: 0 0 0 3px rgba(246,200,110,.25); }
.dx-search-ic { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: rgba(245,237,226,.7); display: inline-flex; }
.dx-search input {
  flex: 1; min-width: 0; border: 0; background: transparent; color: #fff; font-size: 1rem; padding: .45rem 0;
  box-shadow: none; outline: none;
}
.dx-search input::placeholder { color: rgba(245,237,226,.55); }
.dx-search .btn { border-radius: 999px; }

/* Stars and fireflies (as on the home page and Your story). */
.dx-sky { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.dx-star {
  position: absolute; left: var(--x); top: var(--y); width: var(--s); height: var(--s);
  border-radius: 50%; background: #fff; opacity: .3; animation: dx-twinkle 4.6s ease-in-out var(--d) infinite;
}
.dx-fly {
  position: absolute; left: var(--x); top: var(--y); width: var(--s); height: var(--s);
  border-radius: 50%; background: #e4fff5;
  box-shadow: 0 0 6px 2px rgba(134,242,218,.95), 0 0 22px 7px rgba(110,240,210,.35);
  animation: dx-drift var(--t) ease-in-out var(--d) infinite alternate, dx-blink var(--b) ease-in-out var(--d) infinite;
}
.dx-fly--gold { background: #fff4d6; box-shadow: 0 0 6px 2px rgba(255,214,140,.95), 0 0 22px 7px rgba(246,200,110,.38); }

/* ---- Page body ------------------------------------------------------------------ */
.dx-wrap { max-width: 920px; margin: 0 auto; padding: 2rem 16px 2.5rem; }
.dx--app .dx-wrap { padding: 0 0 1.5rem; max-width: none; }
.dx-section { margin: 0 0 2.2rem; }
.dx-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .8rem; flex-wrap: wrap; }
.dx-section h2, .dx-section-head h2 {
  font-family: var(--dx-serif); font-weight: 500; font-size: 1.6rem; letter-spacing: -.01em; margin: 0; color: var(--ink);
}
.dx-kicker {
  font-family: var(--dx-mono) !important; font-size: .78rem !important; font-weight: 500 !important;
  letter-spacing: .14em; text-transform: uppercase; color: var(--plum) !important; margin: 0 0 .7rem !important;
}
.dx-kicker-date { color: var(--muted); margin-left: .4rem; }
.dx-link { font-size: .92rem; font-weight: 600; }
.dx-list { display: grid; gap: .9rem; margin-bottom: 2rem; }
.dx-empty { text-align: center; padding: 2rem 1.25rem; }
.dx-empty h2 { font-family: var(--dx-serif); font-weight: 500; }

/* ---- A definition ---------------------------------------------------------------- */
.dx-def {
  position: relative; background: var(--card); color: var(--ink); border: 1px solid var(--line);
  border-radius: 16px; padding: 1.15rem 1.25rem 1rem; box-shadow: var(--shadow); min-width: 0;
}
.dx-def:target { border-color: var(--plum); box-shadow: 0 0 0 3px var(--plum-tint), var(--shadow); }
.dx-def--quiet { border-style: dashed; box-shadow: none; }
.dx-def--feature {
  padding: 1.5rem 1.5rem 1.2rem;
  background: linear-gradient(135deg, var(--plum-tint), var(--teal-tint)), var(--card);
}
.dx-def-term { font-family: var(--dx-serif); font-weight: 500; font-size: 1.45rem; letter-spacing: -.01em; margin: 0 0 .45rem; line-height: 1.15; }
.dx-def--feature .dx-def-term { font-size: clamp(1.9rem, 6vw, 2.6rem); }
.dx-def-term a { color: var(--ink); text-decoration: none; }
.dx-def-term a:hover { color: var(--plum); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.dx-rank {
  display: inline-block; font-family: var(--dx-mono); font-size: .74rem; font-weight: 500; color: var(--muted);
  letter-spacing: .08em; margin-bottom: .35rem;
}
.dx-rank::before { content: "#"; }
.dx-def-body { font-size: 1.05rem; line-height: 1.6; margin: 0 0 .6rem; overflow-wrap: anywhere; }
.dx-def--feature .dx-def-body { font-size: 1.15rem; }
.dx-def-ex {
  font-family: var(--dx-serif); font-style: italic; font-size: 1.05rem; line-height: 1.5; color: var(--ink);
  border-left: 3px solid var(--teal); padding: .1rem 0 .1rem .8rem; margin: 0 0 .7rem; overflow-wrap: anywhere; opacity: .88;
}
.dx-def-meta { font-size: .82rem; color: var(--muted); margin: 0 0 .7rem; }
.dx-status { font-size: .86rem; margin: 0 0 .6rem; padding: .45rem .7rem; border-radius: 10px; background: var(--plum-tint); }
.dx-status--warn { background: rgba(217,119,6,.12); }
.dx-status--bad { background: rgba(220,38,38,.1); }

.dx-def-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: .7rem; }
.dx-votes { display: inline-flex; gap: .35rem; margin-right: auto; }
.dx-votes form { margin: 0; }
.dx-vote {
  display: inline-flex; align-items: center; gap: .35rem; min-height: 36px; padding: .3rem .7rem;
  border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink);
  font: inherit; font-size: .88rem; font-weight: 700; cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, transform .15s;
}
a.dx-vote:hover, button.dx-vote:hover { border-color: var(--plum); text-decoration: none; }
.dx-vote.is-static { cursor: default; color: var(--muted); }
.dx-vote:active { transform: scale(.95); }
.dx-vote.is-on[data-dx-dir="up"] { background: var(--teal-tint); border-color: var(--teal); color: var(--ink); }
.dx-vote.is-on[data-dx-dir="down"] { background: var(--plum-tint); border-color: var(--plum); color: var(--ink); }
.dx-vote.is-pop .dx-thumb { animation: dx-pop .35s ease; }
.dx-thumb--down { transform: rotate(180deg); }
.dx-vote-n { font-variant-numeric: tabular-nums; min-width: .7em; text-align: left; }
.dx-act {
  display: inline-flex; align-items: center; gap: .35rem; min-height: 36px; padding: .3rem .7rem;
  border: 0; border-radius: 999px; background: transparent; color: var(--plum);
  font: inherit; font-size: .88rem; font-weight: 700; cursor: pointer; text-decoration: none;
}
.dx-act:hover { background: var(--plum-tint); text-decoration: none; }
.dx-act--quiet { color: var(--muted); font-weight: 600; }
.dx-act.is-static { cursor: default; }
.dx-act.is-static:hover { background: transparent; }
.dx-err { flex-basis: 100%; font-size: .84rem; color: var(--bad); margin: .2rem 0 0; }

.dx-report { position: relative; }
.dx-report > summary { list-style: none; }
.dx-report > summary::-webkit-details-marker { display: none; }
.dx-report-form {
  position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 20; width: min(17rem, 80vw);
  background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 34px rgba(0,0,0,.18); padding: .8rem; display: grid; gap: .4rem;
}
.dx-report-q { margin: 0 0 .1rem; font-weight: 700; font-size: .9rem; }
.dx-radio { display: flex; align-items: center; gap: .45rem; font-size: .88rem; cursor: pointer; }
.dx-radio input { margin: 0; accent-color: var(--plum); }
.dx-report-form input[type="text"] { width: 100%; font-size: .88rem; }

/* ---- Lists of words ---------------------------------------------------------------- */
.dx-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.dx-chip {
  display: inline-block; padding: .45rem .9rem; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font-family: var(--dx-serif); font-size: 1.02rem; text-decoration: none;
  transition: border-color .15s, transform .15s;
}
.dx-chip:hover { border-color: var(--plum); color: var(--plum); text-decoration: none; transform: translateY(-1px); }

.dx-letters { display: flex; flex-wrap: wrap; gap: .3rem; margin: 0 0 1rem; }
.dx-letters a {
  font-family: var(--dx-mono); font-size: .85rem; font-weight: 500; min-width: 2rem; text-align: center;
  padding: .3rem .4rem; border-radius: 8px; background: var(--plum-tint); color: var(--plum); text-decoration: none;
}
.dx-letters a:hover { background: var(--plum); color: #fff; }
.dx-az { columns: 3 13rem; column-gap: 1.6rem; }
.dx-az-group { break-inside: avoid; margin: 0 0 1.1rem; scroll-margin-top: 80px; }
.dx-az-group h3 { font-family: var(--dx-mono); font-size: .8rem; font-weight: 500; letter-spacing: .12em; color: var(--muted); margin: 0 0 .3rem; }
.dx-az-group ul { list-style: none; margin: 0; padding: 0; }
.dx-az-group li { margin: .15rem 0; }
.dx-az-group a { font-family: var(--dx-serif); font-size: 1.05rem; color: var(--ink); }
.dx-az-group a:hover { color: var(--plum); }

.dx-results { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.dx-result {
  display: grid; gap: .25rem; padding: 1rem 1.15rem; border: 1px solid var(--line); border-radius: 14px;
  background: var(--card); color: var(--ink); text-decoration: none;
}
.dx-result:hover { border-color: var(--plum); text-decoration: none; }
.dx-result-term { font-family: var(--dx-serif); font-size: 1.35rem; font-weight: 500; }
.dx-result-body { color: var(--ink); opacity: .85; line-height: 1.5; overflow-wrap: anywhere; }
.dx-result-meta { font-size: .8rem; color: var(--muted); }

/* ---- The closing pitch -------------------------------------------------------------- */
.dx-pitch {
  display: flex; align-items: center; justify-content: space-between; gap: 1.2rem; flex-wrap: wrap;
  margin: 1rem 0 1.4rem; padding: 1.5rem 1.5rem; border-radius: 20px; color: #fff;
  background:
    radial-gradient(90% 120% at 100% 100%, rgba(246,200,110,.22), rgba(42,17,69,0) 60%),
    linear-gradient(135deg, #110521, #2a1145);
}
.dx-pitch h2 { font-family: var(--dx-serif); font-weight: 400; font-size: 1.55rem; color: #fff; margin: 0 0 .35rem; }
.dx-pitch p { margin: 0; color: rgba(245,237,226,.86); max-width: 34rem; line-height: 1.5; }
.dx-pitch-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.dx-pitch--member { color: var(--ink); background: linear-gradient(135deg, var(--plum-tint), var(--teal-tint)), var(--card); border: 1px solid var(--line); }
.dx-pitch--member h2 { color: var(--ink); }
.dx-pitch--member p { color: var(--muted); }
.dx-fine { display: flex; align-items: center; justify-content: center; gap: .35rem; font-size: .82rem; color: var(--muted); text-align: center; margin: 0; }

/* ---- Add a word ------------------------------------------------------------------------ */
.dx-add-grid { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 860px) { .dx-add-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); } }
.dx-form { display: grid; gap: .35rem; }
.dx-form label { font-weight: 700; font-size: .92rem; margin-top: .5rem; }
.dx-form label:first-of-type { margin-top: 0; }
.dx-form input[type="text"], .dx-form textarea { width: 100%; }
.dx-form textarea { resize: vertical; }
.dx-form .btn { justify-self: start; margin-top: .8rem; }
.dx-form-note { font-size: .88rem; margin: 0 0 .5rem; }
.dx-form-note .icon { vertical-align: -2px; margin-right: .2rem; }
.dx-counter { font-size: .78rem; color: var(--muted); justify-self: end; min-height: 1em; }
.dx-counter.is-off { color: var(--bad); }
.dx-check { display: flex !important; gap: .5rem; align-items: flex-start; font-weight: 500 !important; font-size: .9rem !important; cursor: pointer; }
.dx-check input { margin-top: .2rem; accent-color: var(--plum); }
.dx-rules h2 { font-size: 1.05rem; margin: 0 0 .5rem; }
.dx-rules ul { margin: 0 0 .6rem; padding-left: 1.1rem; display: grid; gap: .45rem; font-size: .92rem; line-height: 1.45; }
.dx-rules .muted { font-size: .85rem; margin: 0; }
.dx-mine { margin-top: 1rem; }
.dx-mine h2 { font-size: 1.05rem; margin: 0 0 .5rem; }
.dx-mine ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.dx-mine li { display: flex; flex-wrap: wrap; gap: .3rem .5rem; align-items: baseline; font-size: .9rem; }
.dx-mine li a { font-weight: 700; }
.dx-mine li .muted { flex-basis: 100%; font-size: .85rem; }
.dx-mine-note { flex-basis: 100%; font-size: .82rem; color: var(--bad); }

/* ---- Share window ------------------------------------------------------------------------ */
html.dx-modal-open { overflow: hidden; }
.dx-modal {
  position: fixed; inset: 0; z-index: 4100; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(7,2,15,.62); padding: 0;
}
.dx-modal[hidden] { display: none !important; }
.dx-modal-box {
  width: 100%; max-width: 440px; max-height: 94vh; overflow-y: auto; background: var(--card); color: var(--ink);
  border-radius: 18px 18px 0 0; padding: 1rem 1rem 1.1rem; box-shadow: 0 -10px 40px rgba(0,0,0,.35);
  animation: dx-up .28s cubic-bezier(.2,.8,.2,1) both; min-width: 0;
}
@media (min-width: 640px) { .dx-modal { align-items: center; padding: 1rem; } .dx-modal-box { border-radius: 18px; } }
.dx-modal-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .7rem; }
.dx-modal-head h3 { margin: 0; font-size: 1.05rem; }
.dx-modal-x { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 1.1rem; cursor: pointer; border-radius: 8px; padding: .25rem .5rem; }
.dx-modal-x:hover { background: var(--plum-tint); color: var(--ink); }
.dx-modal-preview {
  display: block; width: 100%; max-height: 52vh; aspect-ratio: 4 / 5; object-fit: contain;
  border-radius: 12px; background: #07020f; margin: 0 auto .8rem;
}
.dx-modal-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.dx-modal-actions .btn { flex: 1 1 8rem; }
.dx-modal-status { font-size: .86rem; color: var(--muted); margin: .6rem 0 0; min-height: 1.2em; }

@media (max-width: 560px) {
  .dx-hero-inner { padding: 2.4rem 16px 2.2rem; }
  .dx-def { padding: 1rem 1rem .9rem; }
  .dx-def--feature { padding: 1.2rem 1.1rem 1rem; }
  .dx-votes { margin-right: 0; flex-basis: 100%; }
  .dx-report-form { right: auto; left: 0; }
  .dx-pitch { padding: 1.25rem 1.1rem; }
  .dx-search { padding-left: 2.4rem; }
  .dx-search .btn { padding-left: .9rem; padding-right: .9rem; }
}

/* ---- Motion ------------------------------------------------------------------------------- */
@keyframes dx-twinkle { 0%, 100% { opacity: .12; } 50% { opacity: .75; } }
@keyframes dx-drift {
  0%   { transform: translate(0, 0); }
  35%  { transform: translate(var(--dx), calc(var(--dy) * -1)); }
  70%  { transform: translate(calc(var(--dx) * -.5), calc(var(--dy) * .6)); }
  100% { transform: translate(calc(var(--dx) * .3), var(--dy)); }
}
@keyframes dx-blink { 0%, 100% { opacity: .1; } 35% { opacity: 1; } 55% { opacity: .85; } 75% { opacity: .25; } }
/* `scale`, not transform, so the down thumb keeps its rotation while it pops. */
@keyframes dx-pop { 0% { scale: 1; } 50% { scale: 1.35; } 100% { scale: 1; } }
@keyframes dx-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
