/* ══════════════════════════════════════════════════════════════════
   Domainless shared chrome — liquid-glass shell.
   Top bar (#dl-chrome-bar) is the inter-site ecosystem header.
   Bottom nav (#dl-bottom-nav) is the per-site (intra-site) tab bar.
   Visually unified: same glass material, same gold accent (#c8a86e),
   same mono microtype on labels, same gradient hairline borders.
   Aesthetic mirrors jandgstudios.fun.
   ══════════════════════════════════════════════════════════════════ */

:root {
  --dlc-accent: #c8a86e;
  --dlc-accent-2: #e6cb87;
  --dlc-accent-tint: rgba(200, 168, 110, 0.14);
  --dlc-accent-glow: rgba(200, 168, 110, 0.22);
  /* Smoky pastel grey luxury glass — locked dark identity across themes.
     Layered so the chrome bars carry their own "smoky grey" presence
     regardless of what the page beneath is doing (per-site dark variance
     or future light themes). The dark backdrop layer (~62% rgba) keeps
     contrast consistent; the smoky grey tint on top (rgba 218,214,226 @
     7-10%) is what reads as the luxury glass material. Strengthened
     backdrop-filter (see #dl-chrome-bar / #dl-bottom-nav rules) carries
     the haze. — 2026-05-10 brand refresh, "Smoke & Gold". */
  --dlc-bg-glass:
    linear-gradient(rgba(218, 214, 226, 0.07), rgba(218, 214, 226, 0.07)),
    rgba(20, 20, 28, 0.62);
  --dlc-bg-glass-soft:
    linear-gradient(rgba(218, 214, 226, 0.06), rgba(218, 214, 226, 0.06)),
    rgba(20, 20, 28, 0.55);
  --dlc-bg-solid: rgba(14, 14, 18, 0.96);
  --dlc-border: rgba(255, 255, 255, 0.08);
  --dlc-border-strong: rgba(200, 168, 110, 0.24);
  --dlc-text: #f0eef8; /* brighter default text */
  --dlc-text-bright: #ffffff;
  --dlc-text-dim: #c4c2d0; /* lifted from #b0aec0 for contrast */
  /* Top bar (#dl-chrome-bar) and bottom nav (#dl-bottom-nav) are
     intentionally the EXACT same height so neither dominates the
     page. To make divergence impossible, both heights derive from
     a single source-of-truth variable: change --dlc-bar-shared and
     both bars resize together. Do NOT replace either of the two
     vars below with a literal px value — that re-introduces the
     drift bug we keep hitting (last caught 2026-05-07).
     44 px = Apple HIG tap-target floor; "compact but tappable". */
  --dlc-bar-shared: 44px;
  --dlc-bar-h: var(--dlc-bar-shared);
  --dlc-bn-h: var(--dlc-bar-shared);
  --dlc-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --dlc-sans:
    "DM Sans", "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
    system-ui, sans-serif;
}

/* Push page content down by the bar height. */
html.dl-chrome-present body {
  padding-top: var(--dlc-bar-h) !important;
}

/* ── Theme escape hatch ───────────────────────────────────────────
   Apply class="dl-no-theme" to any subtree that must stay readable
   regardless of which theme the user picked on domainless.fun. The
   ecosystem's themable vars (--bg, --card, --text, --bright, --dim,
   --accent, --border) are reset to fixed neutral defaults inside
   the subtree, so cascade-derived colors snap back to a known-good
   palette. Use on: code-editor textareas + previews + consoles,
   audio waveform widgets, video player chrome, financial / KYC
   forms, anywhere legibility outranks aesthetics.

   The chrome surfaces themselves (--dlc-* namespace) are NOT reset
   — the top bar / bottom nav / dropdown still follow theme so the
   shell stays consistent. Only site-defined surfaces flip back. */
.dl-no-theme {
  --bg: #0e0e14;
  --card: #16161e;
  --text: #c0c0cc;
  --bright: #f0f0f6;
  --dim: #7a7a88;
  --accent: #c8a86e;
  --border: rgba(255, 255, 255, 0.06);
}

/* ── Top bar (inter-site header) ──────────────────────────────────── */
#dl-chrome-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--dlc-bar-h);
  z-index: 10000;
  background: var(--dlc-bg-glass);
  backdrop-filter: blur(32px) saturate(160%) brightness(104%);
  -webkit-backdrop-filter: blur(32px) saturate(160%) brightness(104%);
  /* Single faint hairline — no gradient, no gold.  Restraint
     reads as luxury at this scale. */
  border-bottom: 1px solid var(--dlc-border);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.025) inset,
    0 4px 16px -8px rgba(0, 0, 0, 0.35);
  font-family: var(--dlc-sans);
  font-size: 14px;
  color: var(--dlc-text);
  -webkit-font-smoothing: antialiased;
}

/* 3-column grid: logo (left) | service pills (center) | right
   cluster. The pills fade to invisible on scroll but keep their
   layout slot so the right cluster never shifts. */
.dl-chrome-inner {
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}

.dl-chrome-logo,
.dl-chrome-logo-split {
  justify-self: start;
}

.dl-chrome-right {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

/* Logo */
.dl-chrome-logo {
  flex-shrink: 0;
  font-family: var(--dlc-sans);
  font-size: 15px;
  font-weight: 700;
  color: var(--dlc-text-bright);
  text-decoration: none;
  letter-spacing: -0.01em;
  text-transform: none;
  line-height: 1;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background 0.2s ease;
}
.dl-chrome-logo:hover {
  background: var(--dlc-accent-tint);
}
.dl-chrome-logo span {
  background: linear-gradient(180deg, var(--dlc-accent-2), var(--dlc-accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Logo + Beta wrapper. Single flex container so the parent 3-col
   grid (.dl-chrome-inner: 1fr auto 1fr) treats logo+badge as ONE
   column, not two. */
.dl-chrome-brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  min-width: 0;
}

/* Beta badge — sits to the right of the logo on every host except
   search.domainless.fun + /search. Tiny, gold-tinted, pill-shaped,
   uppercase mono. The chrome.v1.js render decides when to emit. */
.dl-chrome-beta {
  flex-shrink: 0;
  margin-left: 4px;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid var(--dlc-accent);
  background: var(--dlc-accent-tint);
  color: var(--dlc-accent);
  font-family: var(--dlc-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
  cursor: help;
  user-select: none;
}

/* Split logo on subdomains: "<sub>.domainless" with each half clickable. */
.dl-chrome-logo-split {
  flex-shrink: 0;
  display: inline-flex;
  align-items: baseline;
  font-family: var(--dlc-sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  line-height: 1;
  padding: 0;
}
.dl-chrome-logo-sub,
.dl-chrome-logo-base {
  text-decoration: none;
  padding: 5px 0;
  border-radius: 5px;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}
.dl-chrome-logo-sub {
  background: linear-gradient(180deg, var(--dlc-accent-2), var(--dlc-accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  padding-left: 8px;
}
.dl-chrome-logo-base {
  color: var(--dlc-text-bright);
  padding-right: 8px;
}
.dl-chrome-logo-sub:hover,
.dl-chrome-logo-base:hover {
  background-color: var(--dlc-accent-tint);
}
.dl-chrome-logo-dot {
  color: var(--dlc-text-dim);
  padding: 0 1px;
  font-weight: 600;
  user-select: none;
}

/* Service switcher pills — center column of the bar grid. Same
   row at all viewports; mono uppercase microtype matches the
   bottom nav.

   Behaviour: the pills fade to invisible when the user scrolls
   past the threshold (html.dl-chrome-condensed) AND the dropdown
   is closed. They "light up" again at scroll-top OR while the
   dropdown is open (html.dl-chrome-tabs-pinned). Layout slot is
   preserved during the fade so the right cluster (avatar + ☰)
   doesn't shift. */
.dl-chrome-tabs {
  justify-self: center;
  display: flex;
  gap: 4px;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  min-width: 0;
  max-width: 100%;
  /* Edge-fade: nav items disappear smoothly under the brand on the left
     and under the avatar/hamburger on the right. Same fade depth both
     sides for symmetry. */
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
  opacity: 1;
  filter: none;
  transition:
    opacity 260ms ease,
    filter 320ms ease,
    transform 320ms cubic-bezier(0.16, 1, 0.3, 1);
  transform: translateY(0);
  will-change: opacity, filter;
}
.dl-chrome-tabs::-webkit-scrollbar {
  display: none;
}

html.dl-chrome-condensed:not(.dl-chrome-tabs-pinned) .dl-chrome-tabs {
  opacity: 0;
  filter: blur(2px);
  transform: translateY(-2px);
  pointer-events: none;
}

/* "Light up" — when pills come back from hidden (scroll-top or
   ☰ click), they briefly glow so the reveal feels like glass
   un-fogging instead of a pop. The glow fades on its own. */
html.dl-chrome-light-up .dl-chrome-tab {
  animation: dl-chrome-light-up 540ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes dl-chrome-light-up {
  0% {
    text-shadow:
      0 0 14px var(--dlc-accent-glow),
      0 0 4px rgba(255, 255, 255, 0.3);
  }
  100% {
    text-shadow: 0 0 0 transparent;
  }
}

.dl-chrome-tab {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border-radius: 14px;
  font-family: var(--dlc-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--dlc-text);
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid transparent;
  transition:
    color 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease;
}
.dl-chrome-tab:hover {
  color: var(--dlc-text-bright);
  background: rgba(255, 255, 255, 0.06);
}
.dl-chrome-tab.active {
  color: var(--dlc-accent);
  background: var(--dlc-accent-tint);
  border-color: rgba(200, 168, 110, 0.28);
}

/* User slot (right side) */
.dl-chrome-user {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.dl-chrome-signin {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 12px;
  border-radius: 12px;
  font-family: var(--dlc-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--dlc-accent);
  text-decoration: none;
  border: 1px solid rgba(200, 168, 110, 0.2);
  background: transparent;
  transition: background 0.2s ease;
}
.dl-chrome-signin:hover {
  background: var(--dlc-accent-tint);
}

.dl-chrome-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  color: var(--dlc-accent);
  font-family: var(--dlc-sans);
  font-size: 11.5px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid rgba(200, 168, 110, 0.45);
  overflow: hidden;
  transition:
    transform 0.15s ease,
    border-color 0.2s ease;
}
.dl-chrome-avatar:hover {
  transform: scale(1.05);
  border-color: var(--dlc-accent);
}
.dl-chrome-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Menu toggle (☰) — anchors the dropdown */
.dl-chrome-menu {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--dlc-border);
  color: var(--dlc-text-dim);
  width: 26px;
  height: 24px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition:
    color 0.15s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}
.dl-chrome-menu:hover {
  color: var(--dlc-text-bright);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}
.dl-chrome-menu svg {
  display: block;
}
html.dl-chrome-collapsed .dl-chrome-menu {
  background: var(--dlc-accent);
  color: #0c0c12;
  border-color: var(--dlc-accent);
}

/* Collapsed state: hide site-specific in-app top headers */
html.dl-chrome-collapsed [data-chrome-hideable] {
  display: none !important;
}

/* ── Top-bar responsive scaling ───────────────────────────────────── */
@media (max-width: 900px) {
  .dl-chrome-inner {
    padding: 0 14px;
    gap: 10px;
  }
}
@media (max-width: 640px) {
  :root {
    /* Both bars shrink together via the shared source-of-truth. */
    --dlc-bar-shared: 40px;
  }
  .dl-chrome-inner {
    padding: 0 10px;
    gap: 6px;
  }
  .dl-chrome-tab {
    height: 22px;
    padding: 0 9px;
    font-size: 10px;
    letter-spacing: 1.2px;
  }
  .dl-chrome-avatar {
    width: 24px;
    height: 24px;
  }
  .dl-chrome-signin {
    height: 22px;
    padding: 0 9px;
    font-size: 10px;
    letter-spacing: 1.2px;
  }
  .dl-chrome-menu {
    width: 24px;
    height: 22px;
  }
}
@media (max-width: 480px) {
  .dl-chrome-inner {
    padding: 0 10px;
  }
  .dl-chrome-logo {
    font-size: 12px;
    padding: 5px 8px;
  }
  .dl-chrome-logo-split {
    font-size: 12px;
  }
  .dl-chrome-logo-sub {
    padding-left: 8px;
  }
  .dl-chrome-logo-base {
    padding-right: 8px;
  }
}
@media (max-width: 380px) {
  .dl-chrome-logo,
  .dl-chrome-logo-split {
    display: none;
  }
}

/* ── Dropdown (inter-site menu) ───────────────────────────────────── */
.dl-chrome-dropdown {
  position: absolute;
  /* Anchored just below the bar — `100%` is the parent (.dl-chrome-
     right) height, which spans the bar's full height since it's
     centered in flex. */
  top: calc(100% + 8px);
  right: 0;
  /* Slightly more opaque than the bar so menu text stays legible
     on busy backgrounds, but still reads as glass. */
  background: rgba(36, 36, 42, 0.78);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  border: 1px solid var(--dlc-border);
  border-radius: 10px;
  list-style: none;
  padding: 5px 0;
  margin: 0;
  min-width: 232px;
  max-width: 300px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  z-index: 10002;
  box-shadow:
    0 18px 48px -16px rgba(0, 0, 0, 0.55),
    0 2px 8px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  display: none;
  font-family: var(--dlc-sans);
  font-size: 12.5px;
  -webkit-font-smoothing: antialiased;
}
.dl-chrome-dropdown.open {
  display: block;
}
.dl-chrome-dropdown-section {
  padding: 10px 16px 4px;
  font-family: var(--dlc-mono);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--dlc-accent);
  pointer-events: none;
  font-weight: 600;
}
.dl-chrome-dropdown-item {
  display: block;
  width: 100%;
  padding: 9px 16px;
  color: var(--dlc-text);
  text-decoration: none;
  background: transparent;
  border: none;
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}
.dl-chrome-dropdown-item:hover,
.dl-chrome-dropdown-item:focus {
  background: var(--dlc-accent-tint);
  color: var(--dlc-text-bright);
  outline: none;
}
.dl-chrome-dropdown-action {
  color: var(--dlc-accent);
}
.dl-chrome-dropdown-separator {
  height: 1px;
  margin: 6px 14px;
  background: rgba(255, 255, 255, 0.06);
  list-style: none;
}

@media (max-width: 640px) {
  .dl-chrome-dropdown {
    /* Full-bleed sheet on phones — anchor just below the bar. */
    top: calc(100% + 8px);
    right: 8px;
    left: 8px;
    min-width: auto;
    max-width: none;
  }
}

/* ══════════════════════════════════════════════════════════════════
   Bottom nav (intra-site tabs) — same glass, same gold, sized
   slightly larger than the top so thumb targets feel right on mobile.
   ══════════════════════════════════════════════════════════════════ */
#dl-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--dlc-bn-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--dlc-bg-glass);
  backdrop-filter: blur(32px) saturate(160%) brightness(104%);
  -webkit-backdrop-filter: blur(32px) saturate(160%) brightness(104%);
  border-top: 1px solid var(--dlc-border);
  box-shadow:
    0 -1px 0 rgba(255, 255, 255, 0.025) inset,
    0 -4px 16px -8px rgba(0, 0, 0, 0.35);
  display: flex;
  justify-content: space-evenly;
  align-items: stretch;
  z-index: 999;
  font-family: var(--dlc-sans);
  overflow-x: auto;
  scrollbar-width: none;
}
#dl-bottom-nav::-webkit-scrollbar {
  display: none;
}
.dl-bn-tab {
  flex: 1 0 auto;
  min-width: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 3px 8px;
  text-decoration: none;
  color: var(--dlc-text);
  font-family: var(--dlc-sans);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  transition: color 150ms ease;
  position: relative;
}
.dl-bn-tab:hover {
  color: var(--dlc-text-bright);
}
.dl-bn-tab.active {
  color: var(--dlc-accent);
}
.dl-bn-tab.active::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 2px;
  background: var(--dlc-accent);
  border-radius: 0 0 2px 2px;
}
.dl-bn-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.dl-bn-label {
  white-space: nowrap;
}
.dl-bn-badge {
  position: absolute;
  top: 6px;
  right: 14px;
  width: 8px;
  height: 8px;
  background: #ff5c5c;
  border-radius: 50%;
  display: none;
  box-shadow: 0 0 8px rgba(255, 92, 92, 0.6);
}
.dl-bn-badge.has-unread {
  display: block;
}
html.dl-bn-present body {
  padding-bottom: calc(
    var(--dlc-bn-h) + env(safe-area-inset-bottom, 0px)
  ) !important;
}

@media (max-width: 480px) {
  /* Heights stay equal at 40px from the @640 breakpoint above —
     do NOT override --dlc-bn-h here, only shrink internal contents. */
  .dl-bn-tab {
    min-width: 48px;
    padding: 2px 4px;
    font-size: 8.5px;
    letter-spacing: 1px;
  }
  .dl-bn-icon {
    width: 16px;
    height: 16px;
  }
}

/* ── Universal footer ─────────────────────────────────────────────── */
#dl-footer {
  border-top: 1px solid transparent;
  border-image: linear-gradient(
      90deg,
      transparent,
      var(--dlc-border),
      transparent
    )
    1;
  padding: 32px 16px 36px;
  text-align: center;
  font-family: var(--dlc-sans);
  font-size: 13px;
  color: var(--dlc-text-dim);
  background: transparent;
  margin-top: 48px;
}
.dl-footer-row {
  line-height: 2;
}
.dl-footer-row a {
  color: var(--dlc-text-dim);
  text-decoration: none;
  transition: color 150ms ease;
}
.dl-footer-row a:hover {
  color: var(--dlc-accent);
}
.dl-footer-tagline {
  font-family: var(--dlc-mono);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--dlc-text-dim);
  margin-top: 8px;
  opacity: 0.6;
}
@media (max-width: 480px) {
  #dl-footer {
    padding: 24px 12px 28px;
    font-size: 12px;
  }
}

/* Reduced motion — kill all chrome transitions / animations. */
@media (prefers-reduced-motion: reduce) {
  .dl-chrome-tabs,
  #dl-chrome-bar,
  #dl-bottom-nav,
  .dl-chrome-tab,
  .dl-bn-tab,
  .dl-chrome-avatar,
  .dl-chrome-signin,
  .dl-chrome-menu {
    transition: none !important;
    animation: none !important;
  }
}
