/* =====================================================================
   Ember · Kazbo UI
   A warm, near-black gallery style: quiet surfaces, white pill actions,
   hairline edges, one hot accent, and soft expo-out motion.
   Style study: details.so (design language only; our own code, fonts
   and accent). Link this file, add class="ember" to <html>, done.
   ===================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Instrument+Sans:wght@400..700&family=Newsreader:opsz,wght@6..72,400..600&display=swap");

.ember {
  /* surfaces: warm near-black, each step a little lighter */
  --e-surface-0: hsl(0 0% 0%);
  --e-surface-1: hsl(20 14% 4%);
  --e-surface-2: hsl(20 5% 12%);
  --e-surface-3: hsl(20 5% 17%);
  --e-surface-4: hsl(20 5% 25%);
  --e-floating: hsl(20 9% 6%);
  --e-surface-2-hover: color-mix(in srgb, var(--e-surface-2) 94%, var(--e-text-2));
  --e-inverted-hover: color-mix(in srgb, var(--e-text-1) 88%, var(--e-surface-1));
  --e-backdrop: rgb(0 0 0 / .6);

  /* text: three levels, nothing in between */
  --e-text-1: hsl(30 8% 96%);
  --e-text-2: hsl(25 4% 64%);
  --e-text-3: hsl(24 3% 50%);

  /* edges */
  --e-border-1: hsl(30 6% 15%);
  --e-border-2: hsl(30 6% 21%);

  /* one accent (Kaz's orange) */
  --e-accent: #f94101;
  --e-accent-10: rgb(249 65 1 / .12);
  --e-accent-50: rgb(249 65 1 / .5);
  --e-on-accent: #fff;
  --e-focus: var(--e-accent);

  /* shape */
  --e-radius-xxs: 8px;
  --e-radius-xs: 18px;
  --e-radius-sm: 24px;
  --e-radius-md: 28px;
  --e-radius-pill: 999px;

  /* hairline depth: a 1px edge plus a whisper of drop */
  --e-shadow: 0 8px 12px hsl(0 0% 0% / .04), 0 0 1px hsl(0 0% 29%);
  --e-shadow-2: 0 4px 4px hsl(0 0% 0% / 0), 0 0 1px hsl(0 0% 100% / .43);
  --e-shadow-pop: 0 18px 40px -12px hsl(0 0% 0% / .7), 0 0 1px hsl(0 0% 100% / .35);

  /* motion */
  --e-ease-out-cubic: cubic-bezier(.215, .61, .355, 1);
  --e-ease-out-quart: cubic-bezier(.165, .84, .44, 1);
  --e-ease-out-quint: cubic-bezier(.23, 1, .32, 1);
  --e-ease-out-expo: cubic-bezier(.19, 1, .22, 1);
  --e-ease-in-out-cubic: cubic-bezier(.645, .045, .355, 1);
  --e-ease-sheet: cubic-bezier(.32, .72, 0, 1);
  --e-ease-glide: cubic-bezier(.2, 1, .25, 1);

  /* type */
  --e-font-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --e-font-display: "Newsreader", "Iowan Old Style", Georgia, serif;
  --e-font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --e-weight: 500;

  color-scheme: dark;
  color: var(--e-text-1);
  background: var(--e-surface-1);
  font: var(--e-weight) 16px/1.5 var(--e-font-body);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
.ember *, .ember *::before, .ember *::after { box-sizing: border-box; }
.ember :focus-visible { outline: 2px solid var(--e-focus); outline-offset: 2px; }

/* ---------- Type ---------- */
.e-display {
  margin: 0;
  font: 500 clamp(38px, 5.2vw, 60px)/1.04 var(--e-font-display);
  font-optical-sizing: auto;
  letter-spacing: -.015em;
  text-wrap: balance;
}
.e-title { margin: 0; font: 500 28px/1.15 var(--e-font-display); letter-spacing: -.01em; }
.e-lead { margin: 0; font-size: clamp(17px, 1.6vw, 20px); line-height: 1.45; color: var(--e-text-2); text-wrap: pretty; }
.e-body { font-size: 16px; line-height: 1.5; }
.e-small { font-size: 14px; line-height: 1.5; color: var(--e-text-2); }
.e-muted { color: var(--e-text-2); }
.e-faint { color: var(--e-text-3); }
.e-kicker { font: 600 12px/1 var(--e-font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--e-text-3); }

/* ---------- Buttons ---------- */
.e-btn {
  --h: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--h);
  padding: 0 16px;
  border: 0;
  border-radius: var(--e-radius-pill);
  background: var(--e-surface-2);
  color: var(--e-text-1);
  font: 500 16px/1 var(--e-font-body);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .2s var(--e-ease-out-quart), box-shadow .2s var(--e-ease-out-quart), transform .15s ease;
}
.e-btn:hover { background: var(--e-surface-2-hover); }
.e-btn:active { transform: scale(.97); }
.e-btn--primary { background: var(--e-text-1); color: var(--e-surface-1); }
.e-btn--primary:hover { background: var(--e-inverted-hover); }
.e-btn--ghost { background: transparent; box-shadow: inset 0 0 0 1px var(--e-border-2); }
.e-btn--ghost:hover { background: var(--e-surface-2); }
.e-btn--accent { background: var(--e-accent); color: var(--e-on-accent); }
.e-btn--accent:hover { background: color-mix(in srgb, var(--e-accent) 88%, white); }
.e-btn--sm { --h: 32px; padding: 0 12px; font-size: 15px; }
.e-btn--lg { --h: 48px; padding: 0 22px; font-size: 17px; }
.e-btn svg { width: 16px; height: 16px; flex: none; }
.e-btn .e-chev { transition: transform .3s var(--e-ease-out-cubic); }
.e-btn:hover .e-chev { transform: translateX(2px); }
.e-btn[disabled] { opacity: .45; pointer-events: none; }
.e-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--e-text-1);
  cursor: pointer;
  transition: background-color .2s var(--e-ease-out-quart), transform .15s ease;
}
.e-icon-btn:hover { background: var(--e-surface-2); }
.e-icon-btn:active { transform: scale(.94); }
.e-icon-btn svg { width: 20px; height: 20px; }
.e-icon-btn--ring { box-shadow: var(--e-shadow-2); background: rgb(0 0 0 / .25); backdrop-filter: blur(6px); }

/* ---------- Nav tabs ---------- */
.e-tabs { display: flex; align-items: center; gap: 2px; margin: 0; padding: 0; list-style: none; }
.e-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--e-radius-pill);
  background: transparent;
  color: var(--e-text-2);
  font: 500 17px/1 var(--e-font-body);
  text-decoration: none;
  cursor: pointer;
  transition: color .2s ease-out, background-color .2s var(--e-ease-out-quart);
}
.e-tab:hover { color: var(--e-text-1); }
.e-tab[aria-current="page"], .e-tab[aria-selected="true"] { background: var(--e-surface-2); color: var(--e-text-1); }

/* ---------- Badges & tags ---------- */
.e-live {
  display: inline-flex;
  align-items: center;
  padding: 3px 5px;
  border-radius: 6px;
  background: var(--e-accent-10);
  color: var(--e-accent);
  font: 600 11px/1 var(--e-font-body);
  letter-spacing: .02em;
  text-transform: uppercase;
}
.e-live--dot::before { content: ""; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: currentColor; animation: e-pulse 1.6s ease-in-out infinite; }
@keyframes e-pulse { 50% { opacity: .3; } }
.e-tags { display: inline-flex; }
.e-tag {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 11px;
  border-radius: var(--e-radius-pill);
  background: var(--e-surface-3);
  color: var(--e-text-2);
  font: 600 12px/1 var(--e-font-body);
  letter-spacing: .02em;
  text-transform: uppercase;
  white-space: nowrap;
}
.e-tag--line { background: transparent; box-shadow: inset 0 0 0 1px var(--e-border-2); }
.e-tags .e-tag + .e-tag { margin-left: -1px; }
.e-tag--accent { background: var(--e-accent-10); color: var(--e-accent); }

/* ---------- Search with rotating suggestions ---------- */
.e-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(100%, 400px);
  height: 48px;
  padding: 0 18px;
  border-radius: var(--e-radius-pill);
  background: var(--e-surface-2);
  color: var(--e-text-2);
  transition: background-color .2s var(--e-ease-out-quart), box-shadow .2s var(--e-ease-out-quart);
}
.e-search:hover { background: var(--e-surface-2-hover); }
.e-search:focus-within { box-shadow: inset 0 0 0 1px var(--e-border-2); }
.e-search svg { width: 20px; height: 20px; flex: none; color: var(--e-text-1); }
.e-search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--e-text-1);
  font: 500 17px/1 var(--e-font-body);
}
.e-search .e-hint { position: absolute; left: 48px; right: 18px; pointer-events: none; font-size: 17px; white-space: nowrap; overflow: hidden; }
.e-search .e-hint b { display: inline-block; font-weight: 500; color: var(--e-text-2); transition: opacity .3s ease-out, transform .45s var(--e-ease-out-expo), filter .3s ease-out; }
.e-search .e-hint b.is-out { opacity: 0; transform: translateY(-6px); filter: blur(4px); }
.e-search .e-hint b.is-in { opacity: 0; transform: translateY(6px); filter: blur(4px); transition: none; }
.e-search input:not(:placeholder-shown) + .e-hint { visibility: hidden; }

/* ---------- Filter chips ---------- */
.e-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-mask: linear-gradient(90deg, #000 calc(100% - 32px), transparent);
  mask: linear-gradient(90deg, #000 calc(100% - 32px), transparent);
}
.e-chips::-webkit-scrollbar { display: none; }
.e-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 11px;
  border: 0;
  border-radius: var(--e-radius-pill);
  background: var(--e-surface-2);
  color: var(--e-text-1);
  font: 500 16px/1 var(--e-font-body);
  cursor: pointer;
  transition: background-color .2s var(--e-ease-out-quart), color .2s ease-out, transform .15s ease;
}
.e-chip:hover { background: var(--e-surface-2-hover); }
.e-chip:active { transform: scale(.96); }
.e-chip[aria-pressed="true"] { background: var(--e-text-1); color: var(--e-surface-1); }

/* ---------- Select / action menu ---------- */
.e-select { position: relative; display: inline-block; }
.e-select > .e-btn .e-caret { transition: transform .25s var(--e-ease-out-cubic); }
.e-select.is-open > .e-btn .e-caret { transform: rotate(180deg); }
.e-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  margin: 0;
  padding: 6px;
  list-style: none;
  border-radius: var(--e-radius-xs);
  background: var(--e-floating);
  box-shadow: var(--e-shadow-pop);
  opacity: 0;
  transform: translateY(-4px) scale(.97);
  transform-origin: top right;
  pointer-events: none;
  transition: opacity .18s var(--e-ease-out-cubic), transform .18s var(--e-ease-out-cubic);
}
.e-select.is-open .e-menu { opacity: 1; transform: none; pointer-events: auto; }
.e-menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--e-text-1);
  font: 500 15px/1 var(--e-font-body);
  text-align: left;
  cursor: pointer;
}
.e-menu button:hover, .e-menu button:focus-visible { background: var(--e-surface-3); outline: 0; }
.e-menu button[aria-checked="true"]::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--e-accent); }

/* ---------- Avatar stack ---------- */
.e-crowd { display: inline-flex; align-items: center; gap: 12px; color: var(--e-text-2); font-size: 17px; }
.e-avatars { display: inline-flex; }
.e-avatars > * {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-left: -8px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--e-surface-3);
  box-shadow: 0 0 0 2px var(--e-surface-1);
  color: var(--e-text-1);
  font: 600 10px/1 var(--e-font-body);
  letter-spacing: -.02em;
  object-fit: cover;
}
.e-avatars > :first-child { margin-left: 0; }

/* ---------- Preview card (gallery tile) ---------- */
.e-card { position: relative; display: block; color: inherit; text-decoration: none; }
.e-card-media {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1.28;
  padding: 11%;
  overflow: hidden;
  border-radius: 16px;
  background: var(--e-surface-2);
}
.e-card-media > img, .e-card-media > .e-shot {
  width: 100%;
  height: auto;
  border-radius: var(--e-radius-xxs);
  box-shadow: 0 4px 4px rgb(0 0 0 / .04), 0 0 1px rgb(0 0 0 / .5), 0 30px 60px -30px rgb(0 0 0 / .8);
  transition: transform .62s var(--e-ease-glide), opacity .3s ease-out;
}
.e-card:hover .e-card-media > img, .e-card:hover .e-card-media > .e-shot { transform: translateY(-4px) scale(1.012); }
.e-card-media .e-tags { position: absolute; top: 12px; left: 12px; }
.e-card-media .e-icon-btn { position: absolute; top: 10px; right: 10px; opacity: 0; transform: scale(.9); transition: opacity .2s ease-out, transform .3s var(--e-ease-out-cubic), background-color .2s; }
.e-card:hover .e-card-media .e-icon-btn, .e-card:focus-within .e-card-media .e-icon-btn { opacity: 1; transform: none; }
.e-card-meta { display: flex; align-items: center; gap: 12px; padding: 12px 6px 4px 16px; min-height: 64px; }
.e-card-logo { flex: none; display: grid; place-items: center; width: 36px; height: 36px; overflow: hidden; border-radius: var(--e-radius-xxs); background: var(--e-surface-3); font: 600 12px/1 var(--e-font-body); }
.e-card-logo img { width: 100%; height: 100%; object-fit: cover; }
.e-card-text { flex: 1; min-width: 0; line-height: 1.25; }
.e-card-text b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.e-card-text span { display: block; color: var(--e-text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.e-card-action { opacity: 0; transform: translateY(3px); transition: opacity .2s ease-out, transform .3s var(--e-ease-out-cubic), background-color .2s var(--e-ease-out-quart); }
.e-card:hover .e-card-action, .e-card:focus-within .e-card-action { opacity: 1; transform: none; }
@media (hover: none) { .e-card-action, .e-card-media .e-icon-btn { opacity: 1; transform: none; } }

/* ---------- Header bar ---------- */
.e-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 56px;
  padding: 0 20px;
  background: linear-gradient(var(--e-surface-1) 60%, transparent);
}
.e-header .e-search { position: absolute; left: 50%; transform: translateX(-50%); height: 44px; }
.e-header-end { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.e-divider-v { width: 1px; height: 18px; background: var(--e-border-2); }
.e-logo { display: inline-grid; place-items: center; width: 36px; height: 36px; color: var(--e-text-1); }
.e-logo svg { width: 30px; height: 30px; }
@media (max-width: 1100px) { .e-header .e-search { position: static; transform: none; flex: 1; } .e-header .e-hide-md { display: none; } }

/* ---------- Bottom sheet (mobile menus) ---------- */
.e-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--e-backdrop);
  opacity: 0;
  pointer-events: none;
  transition: opacity .24s ease-out;
}
.e-sheet {
  position: fixed;
  z-index: 51;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 85svh;
  padding: 10px 16px calc(20px + env(safe-area-inset-bottom));
  overflow: auto;
  border-radius: var(--e-radius-md) var(--e-radius-md) 0 0;
  background: var(--e-floating);
  box-shadow: var(--e-shadow-2);
  transform: translateY(100%);
  transition: transform .24s var(--e-ease-out-cubic);
  overscroll-behavior: contain;
}
.e-sheet::before { content: ""; display: block; width: 36px; height: 5px; margin: 0 auto 14px; border-radius: 3px; background: var(--e-surface-4); }
.e-sheet-open .e-sheet-backdrop { opacity: 1; pointer-events: auto; transition-duration: .4s; }
.e-sheet.is-open { transform: none; transition: transform .6s var(--e-ease-sheet); }
@media (min-width: 640px) { .e-sheet { left: 50%; right: auto; width: 560px; margin-left: -280px; } }
.e-sheet-list { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.e-sheet-list a, .e-sheet-list button {
  display: flex;
  align-items: center;
  width: 100%;
  height: 52px;
  padding: 0 14px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--e-text-1);
  font: 500 19px/1 var(--e-font-body);
  text-align: left;
  text-decoration: none;
}
.e-sheet-list a:hover, .e-sheet-list button:hover { background: var(--e-surface-2); }

/* ---------- Panels ---------- */
.e-panel { border-radius: var(--e-radius-xs); background: var(--e-surface-2); box-shadow: var(--e-shadow); }
.e-field {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: var(--e-surface-2);
  box-shadow: inset 0 0 0 1px var(--e-border-1);
  color: var(--e-text-1);
  font: 500 16px/1 var(--e-font-body);
  transition: box-shadow .2s var(--e-ease-out-quart), background-color .2s;
}
.e-field::placeholder { color: var(--e-text-3); }
.e-field:hover { box-shadow: inset 0 0 0 1px var(--e-border-2); }
.e-field:focus { outline: 0; box-shadow: inset 0 0 0 1px var(--e-text-2); }

@media (prefers-reduced-motion: reduce) {
  .ember *, .ember *::before, .ember *::after { transition-duration: .01ms !important; animation: none !important; }
}
