/* ===========================
   DigitalDatabase Home (v2)
   File: /assets/css/ddb-home.css
   =========================== */

/* ---------- Theme tokens ---------- */
:root{
  --bg:#0f1115;
  --panel:#141722;
  --muted:#8a90a2;
  --text:#e7ecff;
  --brand:#ff7a1a;
  --brand2:#ffb366;
  --ok:#2ecc71;
  --chip:#1a1f2e;
  --card:#171b26;
  --card2:#1b2130;
  --stroke:#262b3a;

  --radius:14px;
  --shadow:0 10px 30px rgba(0,0,0,.35);

  /* header offset (JS updates this) */
  --nav-offset: 80px;
}

/* ---------- Base / resets ---------- */
*{box-sizing:border-box}
html,body{height:100%}
html{scroll-behavior:smooth;text-size-adjust:100%}
body{
  margin:0;
  color:var(--text);
  background:
    radial-gradient(1200px 600px at 70% -20%, rgba(255,122,26,.15), transparent),
    var(--bg);
  font:400 16px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}
a{color:inherit;text-decoration:none}
img{max-width:100%;height:auto;display:block}
button{font:inherit;color:inherit}
:focus{outline:none}
:focus-visible{outline:2px solid var(--brand); outline-offset:2px; border-radius:8px}
@media (prefers-reduced-motion:reduce){
  *{animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; scroll-behavior:auto !important}
}

/* ---------- Layout helpers ---------- */
.ddb-container{width:min(1200px,92%);margin-inline:auto}
.hide-sm{display:none}
@media (min-width:900px){.hide-sm{display:initial}}

/* ---------- Header / Nav ---------- */
.ddb-header{
  position:sticky; top:0; z-index:1000;
  background:linear-gradient(180deg, rgba(15,17,21,.92), rgba(15,17,21,.65));
  backdrop-filter:blur(8px);
  border-bottom:1px solid var(--stroke);
}
.ddb-nav{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 0}
.ddb-brand{display:flex;align-items:center;gap:10px;font-weight:800;letter-spacing:.2px}
.ddb-brand-dot{width:12px;height:12px;border-radius:50%;background:linear-gradient(135deg, var(--brand), var(--brand2))}
.ddb-links{display:flex;gap:18px}
.ddb-links a{color:var(--muted)}
.ddb-links a:hover{color:#fff}
.ddb-cta{display:flex;gap:10px;align-items:center}
.ddb-btn{
  display:inline-flex;align-items:center;gap:8px;
  border:1px solid var(--stroke);
  padding:.65rem 1rem;border-radius:999px;background:transparent;color:#fff;text-decoration:none
}
.ddb-btn:hover{border-color:#3a4154}
.ddb-primary{
  border:none;
  background:linear-gradient(180deg, var(--brand), var(--brand2));
  color:#111;font-weight:800;
  box-shadow:0 10px 24px rgba(255,122,26,.35)
}
.ddb-menu-btn{
  display:none;border:1px solid var(--stroke);
  background:transparent;color:#fff;border-radius:10px;padding:.5rem .6rem
}
@media (max-width:900px){
  .ddb-links{display:none}
  .ddb-menu-btn{display:inline-flex}
}

/* ---------- Hero ---------- */
.ddb-hero{
  position:relative;
  padding: calc(var(--nav-offset) + 24px) 0 22px;
  overflow: visible;                /* never clip children */
}
.ddb-hero-grid{
  display:grid;
  grid-template-columns: 1fr;       /* SINGLE COLUMN on home => full-width text */
  align-items:start;
  row-gap:24px;
}
.ddb-eyebrow{
  display:inline-flex;gap:8px;align-items:center;
  background:rgba(255,122,26,.12); color:#ffddc2;
  border:1px solid rgba(255,122,26,.25);
  padding:.35rem .6rem;border-radius:999px;font-size:.85rem
}
.ddb-hero h1{
  font-size:clamp(40px,5.8vw,64px);
  line-height:1.08;
  letter-spacing:-.02em;
  margin:10px 0 8px;
  max-width:none;                   /* full width */
}
.ddb-hero p{color:var(--muted);max-width:none;font-size:1.02rem}
.ddb-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px}

/* Search (segmented scope + input) */
.ddb-search{
  display:grid; grid-template-columns: auto 1fr auto;
  gap:10px; align-items:center;
  background:rgba(12,16,22,.85); border:1px solid #252c3f;
  border-radius:var(--radius); padding:8px 8px 8px 10px;
  box-shadow:0 10px 24px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.04);
  margin-top:16px; height:auto;    /* no fixed height */
  position:relative; z-index:5;    /* sits above demo/banners */
}
.ddb-search input{
  width:100%;
  background:#0d121b;
  border:none; outline:none;
  color:#fff;
  font-size:16px; padding:.5rem; border-radius:10px;
  box-shadow:inset 0 0 0 1px #2f3750;
  caret-color:#fff;
}
.ddb-search input::placeholder{color:#c7d1f1}
.ddb-search input:focus{
  outline:none;
  box-shadow:inset 0 0 0 2px rgba(126,194,52,.55), 0 0 0 3px rgba(126,194,52,.18);
}
.ddb-seg{display:flex;background:#0d121b;border:1px solid var(--stroke);border-radius:999px;overflow:hidden}
.ddb-seg button{padding:.45rem .8rem;border:none;background:transparent;color:var(--muted);cursor:pointer;font-weight:600}
.ddb-seg button.active{
  background:#242b3a; color:#fff;
  box-shadow:inset 0 0 0 1px #2f3750
}
#home-search .ddb-btn.ddb-primary{height:38px;padding:.5rem 1rem}

/* Suggest dropdown (high z-index so it never hides) */
.ddb-autocomplete{position:relative}
.ddb-suggest{
  position:absolute; top:100%; left:0; right:0; margin-top:6px;
  background:#121822; border:1px solid #232a3d;
  border-radius:12px; box-shadow:0 12px 30px rgba(0,0,0,.35);
  max-height:320px; overflow:auto; padding:6px; list-style:none; margin:0;
  z-index:99;
}
.ddb-suggest:empty{display:none}
.ddb-suggest li{
  display:flex; align-items:center; gap:10px;
  padding:10px 12px; border-radius:10px; cursor:pointer;
  color:var(--text)
}
.ddb-suggest li:hover,.ddb-suggest li.active{background:rgba(255,255,255,.06)}
.ddb-suggest img{width:32px;height:32px;border-radius:6px;object-fit:cover;flex:0 0 32px}
.ddb-suggest .meta{color:var(--muted);font-size:.9rem}

/* Demo metric card (IN FLOW; never absolute) */
.ddb-demo{
  background:#141b26;
  border:1px solid #21283a;
  border-radius:16px; padding:16px;
  box-shadow:0 10px 26px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.02);
  position:relative; z-index:1;
}
.ddb-chips{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}
.ddb-chip{
  background:var(--chip); border:1px solid var(--stroke);
  color:var(--muted); padding:.4rem .6rem; border-radius:999px; font-size:.85rem
}
.ddb-bar{height:90px;display:flex;gap:6px;align-items:flex-end}
.ddb-bar span{display:block;width:12px;border-radius:4px;background:linear-gradient(180deg, rgba(255,186,120,.95), rgba(255,122,26,.9))}

/* Banner */
.hero-banner{ grid-column:1 / -1; margin-top:14px; }
.hero-banner img{
  width:100%;
  height:300px;
  object-fit:cover;
  border-radius:12px;
}

/* ---------- Sections ---------- */
.ddb-section{padding:32px 0 18px}
.ddb-section h2{font-size:clamp(22px,3.4vw,34px);margin:6px 0 8px}
.ddb-kicker{color:var(--muted)}

/* ---------- Cards Grid (Top-200) ---------- */
.ddb-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px}
@media (max-width:1100px){.ddb-grid{grid-template-columns:repeat(3,1fr)}}
@media (max-width:780px){.ddb-grid{grid-template-columns:repeat(2,1fr)}}
@media (max-width:480px){.ddb-grid{grid-template-columns:1fr}}

.ddb-card{
  background:#141b26;
  border:1px solid #21283a;
  border-radius:16px; overflow:hidden;
  display:flex; flex-direction:column; min-height:100%;
  position:relative;
}
.ddb-cover{aspect-ratio:16/9; object-fit:cover; width:100%; background:#222}
.ddb-badge{
  position:absolute; top:10px; left:10px;
  width:36px; height:36px; display:grid; place-items:center;
  background:linear-gradient(180deg,#9cf28d,#3bd37a);
  color:#0a121a; border-radius:999px;
  font-weight:900; font-size:.95rem;
  border:none; box-shadow:0 6px 14px rgba(0,0,0,.35)
}
.ddb-card-body{
  background:#171f2b;
  border-top:1px solid #21283a;
  border-radius:0 0 16px 16px;
  padding:10px 12px 12px
}
.ddb-title{font-size:.98rem;font-weight:800;margin:0 0 4px}
.ddb-title a{color:#fff}
.ddb-title a:hover{text-decoration:underline}
.ddb-meta{color:var(--muted);font-size:.86rem;margin:0 0 8px}
.ddb-stats{display:flex;gap:10px;font-size:.8rem;color:var(--muted)}
.ddb-stats b{color:#fff}

/* ---------- Featured artists marquee ---------- */
.ddb-superstars-marquee{ padding-top:10px; padding-bottom:0; background:#0b0f17; }
.ddb-superstars-marquee .marquee-viewport{ position:relative; overflow:hidden; }
.ddb-superstars-marquee .track{
  --marquee-speed: 45s;
  display:flex; width:max-content; will-change:transform;
  animation: ddb-marquee var(--marquee-speed) linear infinite;
}
@keyframes ddb-marquee{ to { transform: translateX(-50%); } }
.ddb-superstars-marquee .group{ display:flex; gap:18px; }
.ddb-superstars-marquee .sstar-item{
  flex:0 0 auto; width:120px; text-align:center; text-decoration:none;
  color:#e9eefc; background:transparent; border:none; box-shadow:none; padding:0;
}
.ddb-superstars-marquee .sstar-thumb{
  width:96px; height:96px; border-radius:9999px; object-fit:cover; display:block; margin:0 auto;
  background:#0e1422;
  box-shadow:0 8px 20px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,255,255,.10);
  transition:transform .18s ease, box-shadow .18s ease;
}
.ddb-superstars-marquee .sstar-item:hover .sstar-thumb{
  transform:translateY(-2px);
  box-shadow:0 12px 28px rgba(0,0,0,.55), inset 0 0 0 1px rgba(255,255,255,.15);
}
.ddb-superstars-marquee .sstar-name{
  margin-top:8px; font-weight:800; font-size:.95rem; max-width:120px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  color:#f5f7ff; opacity:1; text-shadow:0 1px 2px rgba(0,0,0,.65);
}
.ddb-superstars-marquee .marquee-viewport:hover .track{ animation-play-state:paused; }
@media (prefers-reduced-motion: reduce){ .ddb-superstars-marquee .track{ animation:none; } }
.ddb-superstars-marquee .track[data-static="1"]{ animation:none; flex-wrap:wrap; gap:18px; }

/* ---------- Artist page bits (kept from your file; scoped to .ap-page) ---------- */
.ap-page{
  --text: clamp(15px, 0.6vw + 13px, 17px);
  --h1: clamp(26px, 3.2vw + 14px, 40px);
  --chip: clamp(11px, 0.3vw + 10px, 13px);
  --pad: clamp(12px, 2vw, 20px);
}
.ap-page .ddb-container{
  width:100%;
  padding-left:var(--pad);
  padding-right:var(--pad);
  max-width:1440px;
  margin-inline:auto;
}
.ap-page .ddb-hero-grid{ display:block; }
.ap-page .bio-wrap{ width:100%; max-width:none; }
.ap-page .tabs-scroller{ display:flex; align-items:center; gap:.5rem; margin:18px 0 6px; }
.ap-page .table-scroller{ overflow:auto; -webkit-overflow-scrolling:touch; }
.ap-page .tab-content table{ width:100%; border-collapse:collapse; }
.ap-page .tab-content thead th{ background:#1d2433; color:#fff; border-color:#2b3346; }
.ap-page .tab-content td, .ap-page .tab-content th{ padding:.6rem; border:1px solid #2b3346; }
.ap-page .btn.pull-right, .ap-page .pull-right, .ap-page .float-right{ float:none !important; }

/* ---------- Mobile tweaks ---------- */
@media (max-width: 768px) {
  /* stack search cleanly, remove fixed height */
  .ddb-search{
    grid-template-columns:1fr;
    grid-auto-rows:auto;
    gap:12px;
    height:auto;
    padding:10px;
  }
  .ddb-search .ddb-seg{ display:grid; grid-template-columns:1fr 1fr; gap:8px; }
  .ddb-search .ddb-seg button{ height:44px; }
  .ddb-search .ddb-autocomplete input{ height:44px; }
  #home-search .ddb-btn, .ddb-search .ddb-btn{
    width:100%; height:44px; display:inline-flex; align-items:center; justify-content:center;
  }

  /* extra spacing between hero blocks */
  .ddb-hero-grid{ row-gap:24px; }
  .ddb-demo{ margin-top: 0; }

  /* banner shows FULL image (no crop) */
  .hero-banner img{
    height:auto;
    object-fit:contain;
  }
}

/* ========= SIMPLE HOME SEARCH (no toggle, no boxed holder) ========= */

/* Hide the old toggle if any markup lingers */
#home-search .ddb-seg{ display:none !important; }

/* Kill the dark “holder” box look and keep just input + button */
#home-search.ddb-search--simple{
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin-top: 14px !important;

  display: grid !important;
  grid-template-columns: 1fr auto !important;
  gap: 10px !important;
  align-items: center !important;
  height: auto !important;
}

/* Input + button sizing */
#home-search.ddb-search--simple .ddb-autocomplete input{
  height: 48px !important;
  border-radius: 12px !important;
}
#home-search.ddb-search--simple .ddb-btn.ddb-primary{
  height: 48px !important;
  padding: 0 18px !important;
  white-space: nowrap;
}

/* Suggest list still anchors just below the input */
#home-search.ddb-search--simple .ddb-suggest{
  top: calc(100% + 6px) !important;
  z-index: 99 !important;
}

/* Remove the old widget entirely if any instance remains */
.home-page .ddb-hero .ddb-demo{ display:none !important; }

/* Mobile: stack if space is tight */
@media (max-width: 480px){
  #home-search.ddb-search--simple{
    grid-template-columns: 1fr !important;
  }
  #home-search.ddb-search--simple .ddb-btn.ddb-primary{
    width: 100% !important;
  }
}

