/* ============ NAV ============ */
/* Background + blur live on the OUTER header so both rows (brand row +
   section pills row) share one continuous glass panel — putting them
   on each row separately produces a visible seam where the two
   different translucencies/blur radii meet. */
.nav{
  position:sticky; top:0; z-index:50;
  background:rgba(7,12,9,.74);
  backdrop-filter:saturate(140%) blur(16px);
  -webkit-backdrop-filter:saturate(140%) blur(16px);
  border-bottom:1px solid var(--line);
  transition:transform .28s cubic-bezier(.2,.7,.2,1), opacity .28s ease;
}
.nav.nav-off{ transform:translateY(-100%); opacity:0; pointer-events:none; }
.nav.nav-always{ transform:none; opacity:1; pointer-events:auto; }
.nav-inner{
  display:flex; align-items:center; gap:24px;
  height:66px;
}
.brand{ display:flex; align-items:center; gap:12px; }
.brand-mark{
  width:38px; height:38px; border-radius:6px; flex:none;
  display:grid; place-items:center;
  background:linear-gradient(150deg,#1a261e,#0a0f0b);
  border:1px solid var(--line-2);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.06);
}
.brand-name{ font-weight:800; font-size:18px; letter-spacing:-.01em; line-height:1; }
.brand-sub{ font-family:var(--mono); font-size:10.5px; letter-spacing:.16em; color:var(--green-ink); text-transform:uppercase; margin-top:3px; white-space:nowrap; }
.nav-spacer{ flex:1; }
.nav-links{ display:flex; align-items:center; gap:6px; }
.nav-link{
  display:inline-flex; align-items:center; gap:8px;
  padding:9px 14px; border-radius:5px; font-size:14px; font-weight:600; color:var(--tx-dim);
  transition:.18s ease; white-space:nowrap;
}
.nav-link:hover{ color:var(--tx); background:var(--panel); }
.nav-link svg{ opacity:.8; }
.nav-cta{
  color:#06251a; background:linear-gradient(180deg,var(--green),var(--green-2));
  box-shadow:0 0 0 1px rgba(70,224,123,.4), 0 10px 26px -8px var(--glow);
}
.nav-cta:hover{ color:#06251a; background:linear-gradient(180deg,#6fdba8,var(--green)); transform:translateY(-1px); }

/* Compact search trigger inside the sticky nav — read-only "input"
   look that opens the modal on click. Sits between the brand and the
   nav-links group; flex-shrinks gracefully on narrow viewports. */
.nav-search{
  appearance:none; cursor:pointer;
  display:inline-flex; align-items:center; gap:8px;
  height:36px; padding:0 14px; min-width:0;
  background:var(--panel); border:1px solid var(--line); border-radius:6px;
  color:var(--tx-faint); font:inherit; font-size:13px;
  transition:.18s ease;
}
.nav-search:hover, .nav-search:focus-visible{
  border-color:rgba(70,224,123,.5);
  box-shadow:0 0 0 3px var(--green-soft);
  color:var(--tx-dim);
  outline:none;
}
.nav-search svg{ flex:none; opacity:.85; }
.nav-search-text{
  flex:1; min-width:0;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  text-align:left;
}
@media (max-width:880px){
  /* Shrink to just the icon when the nav-links group still shows. */
  .nav-search{ padding:0 10px; }
  .nav-search-text{ display:none; }
}

/* ============ INTRO BANNER ============ */
.intro{ padding:32px 0 96px; }
.intro-grid{
  display:flex; align-items:center; gap:56px;
  perspective:1600px;
}
.intro-inner{ margin:0; text-align:left; flex:1 1 0; min-width:0; }
.intro-visual{
  flex:0 1 560px; max-width:40%;
  transform-style:preserve-3d;
  padding-right: 28px;
}
.intro-visual img{
  width:100%; display:block;
  border-radius:12px;
  border:1px solid var(--line-2);
  box-shadow:
    0 40px 80px -28px rgba(0,0,0,.7),
    0 16px 40px -16px rgba(0,0,0,.55),
    0 0 0 1px rgba(255,255,255,.04) inset;
  transform: rotateY(-16deg) rotateX(-2deg) rotateZ(-1deg);
  transform-origin:center;
  transition: transform .4s cubic-bezier(.2,.7,.2,1);
}
.intro-visual:hover img{
  transform: rotateY(-10deg) rotateX(-5deg) rotateZ(-1deg) translateY(-4px);
}
@media (max-width:1100px){
  .intro-grid{ gap:32px; }
  .intro-visual{ flex-basis:440px; }
}
@media (max-width:880px){
  .intro-grid{ flex-direction:column; align-items:stretch; gap:28px; }
  .intro-visual{ flex-basis:auto; max-width:100%; padding-right:0; }
  .intro-visual img{ transform:none; }
}
.intro-brand{ display:flex; align-items:center; gap:18px; margin-bottom:20px; }
.intro-brand .brand-mark{
  width:72px; height:72px; border-radius:10px; flex:none;
  display:grid; place-items:center;
  background:linear-gradient(150deg,#1a261e,#0a0f0b);
  border:1px solid var(--line-2);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.06);
}
.intro-brand .brand-name{ font-weight:800; font-size:36px; letter-spacing:-.02em; line-height:1.05; }
.intro-brand .brand-sub{ font-family:var(--sans); font-size:22px; letter-spacing:.04em; color:var(--green-ink); text-transform:none; margin-top:8px; white-space:nowrap; font-weight:600; }
.intro-p {
  font-size:16px; line-height:1.7; color:var(--tx-dim);
  margin:0 0 8px; max-width:90%;
}
.intro-p b{ color:var(--tx); font-weight:700; }
.intro-h{ font-size:22px; font-weight:700; color:var(--green-ink); letter-spacing:.02em; margin:18px 0 8px; }
.intro-p a{ color:var(--green-ink); text-decoration:underline; text-underline-offset:3px; }
.intro-p a:hover{ text-decoration-thickness:2px; }
.intro-actions{
  display:flex; gap:10px; flex-wrap:wrap;
  margin-top:18px;
}
@media (max-width:640px){
  /* Hide the entire nav (incl. "开始智能编程" CTA) on phones — the same
     CTA is already rendered in the intro section below the header. */
  .nav-links{ display:none; }
  .nav-cta{ padding:8px 12px; font-size:13px; }
  .nav .wrap{ padding:0 24px; }
  .wrap{ padding:0; }
  .intro-actions .intro-gh{ display:none; }
  .intro-p{ max-width:none; }
  .intro{ padding:24px 0 32px; }
  .intro-brand{ gap:14px; margin-bottom:14px; }
  .intro-brand .brand-mark{ width:56px; height:56px; }
  .intro-brand .brand-name{ font-size:28px; }
  .intro-brand .brand-sub{ font-size:18px; }
}

/* ============ HERO / FEATURED ============ */
.hero-head{ display:flex; align-items:flex-end; justify-content:space-between; margin-bottom:18px; gap:20px; }
.hero-title{ font-size:30px; font-weight:800; letter-spacing:-.02em; margin:6px 0 0; display:flex; align-items:center; gap:12px; }
.flame{ filter:drop-shadow(0 0 14px rgba(255,150,60,.5)); }

.feat{ display:flex; flex-direction:column; gap:18px; }
.feat-main{ display:grid; grid-template-columns:1fr 340px; gap:18px; align-items:stretch; }
@media (max-width:1100px){ .feat-main{ grid-template-columns:1fr; } }

.stage{
  position:relative; border-radius:var(--r-lg); overflow:hidden;
  border:1px solid var(--line); background:var(--panel);
  aspect-ratio:16/8; box-shadow:var(--shadow);
}
.stage-slide{ position:absolute; inset:0; opacity:0; transition:opacity .6s ease; }
.stage-slide.on{ opacity:1; }
.stage img, .stage-thumb img{ -webkit-user-drag:none; user-select:none; pointer-events:none; }
.stage-slide .stage-img{
  position:absolute; inset:0; width:100%; height:100%; object-fit:cover;
  opacity:0; transition:opacity .55s ease;
}
.stage-slide .stage-img.on{ opacity:1; }

.stage-grad{ position:absolute; left:0; right:0; bottom:0; height:120px; background:linear-gradient(0deg, rgba(6,11,8,.78) 0%, rgba(6,11,8,0) 100%); pointer-events:none; }

/* thumbnails strip inside stage (wide only) */
.stage-thumbs{
  position:absolute; left:0; right:0; bottom:14px; z-index:3;
  display:flex; justify-content:center; gap:10px; padding:0 18px;
  pointer-events:none;
}
.stage-thumb{
  pointer-events:auto;
  width:68px; height:40px; border-radius:4px; overflow:hidden;
  border:1px solid rgba(255,255,255,.22); background:rgba(0,0,0,.4);
  cursor:pointer; padding:0;
  transition:border-color .18s ease, transform .18s ease, box-shadow .18s ease, opacity .18s ease;
  opacity:.72;
}
.stage-thumb img{ width:100%; height:100%; object-fit:cover; display:block; }
.stage-thumb:hover{ opacity:1; transform:translateY(-2px); }
.stage-thumb.on{
  opacity:1;
  border-color:rgba(70,224,123,.85);
  box-shadow:0 0 0 1px rgba(70,224,123,.45), 0 10px 22px -12px var(--glow);
}
@media (max-width:1100px){ .stage-thumbs, .stage-grad{ display:none; } }

/* info panel (replaces old right column) */
.stage-info{
  display:flex; flex-direction:column;
  border-radius:var(--r-lg); border:1px solid var(--line);
  background:var(--panel); padding:22px 22px 20px;
  box-shadow:var(--shadow); min-width:0;
}
.stage-name{ font-size:24px; font-weight:800; letter-spacing:-.02em; margin:0 0 6px; color:var(--tx); word-break:break-word; }
.stage-author{ color:var(--tx-faint); font-size:13px; margin-bottom:12px; }
.stage-desc{ color:var(--tx-dim); font-size:14px; line-height:1.65; margin:0 0 16px; display:-webkit-box; -webkit-line-clamp:6; -webkit-box-orient:vertical; overflow:hidden; }
.stage-info .tagrow{ margin-bottom:18px; }
.stage-visit{ align-self:flex-start; margin-top:auto; }
@media (max-width:1100px){
  .stage-info{ padding:18px; }
  .stage-name{ font-size:20px; }
  .stage-desc{ -webkit-line-clamp:4; }
}

.tagrow{ display:flex; flex-wrap:wrap; gap:7px; }
.tag{
  font-size:12px; font-weight:600; color:var(--tx-dim);
  padding:4px 10px; border-radius:4px; background:var(--fill);
  border:1px solid var(--line); backdrop-filter:blur(4px);
}

.btn{
  display:inline-flex; align-items:center; gap:8px; font-weight:700; font-size:14px;
  padding:12px 20px; border-radius:6px; transition:.18s ease; white-space:nowrap;
}
.btn-play{ color:#06251a; background:linear-gradient(180deg,var(--green),var(--green-2)); box-shadow:0 0 0 1px rgba(70,224,123,.35), 0 12px 28px -12px var(--glow); }
.btn-play:hover{ transform:translateY(-2px); box-shadow:0 0 0 1px rgba(70,224,123,.5), 0 18px 34px -12px var(--glow); color:#06251a; }
.btn-ghost{ color:var(--tx); background:var(--fill); border:1px solid var(--line-2); }
.btn-ghost:hover{ background:var(--fill-2); transform:translateY(-2px); }

/* featured queue (full-width row below the stage) */
.queue{ display:flex; flex-direction:row; gap:10px; overflow-x:auto; padding-bottom:6px; }
.q-item{
  display:flex; gap:12px; align-items:center; padding:9px; border-radius:7px;
  border:1px solid transparent; background:var(--panel); cursor:pointer;
  transition:.2s cubic-bezier(.2,.7,.2,1); position:relative; overflow:hidden; text-align:left;
  flex:1 1 240px; min-width:240px;
}
.q-item:hover{ background:var(--panel-2); border-color:var(--line-2); }
.q-item.on{ background:var(--elev); border-color:rgba(70,224,123,.5); box-shadow:0 0 0 1px rgba(70,224,123,.22), 0 14px 30px -18px var(--glow); }
.q-thumb{ width:108px; height:60px; border-radius:5px; overflow:hidden; flex:none; background:var(--bg-2); }
.q-thumb img{ width:100%; height:100%; object-fit:cover; }
.q-meta{ min-width:0; }
.q-rank{ font-family:var(--mono); font-size:11px; color:var(--green-ink); font-weight:700; }
.q-name{ font-weight:700; font-size:14px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-top:1px; }
.q-author{ font-size:12px; color:var(--tx-faint); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.q-prog{ position:absolute; left:0; bottom:0; height:2px; background:var(--blue); width:0; }
.q-item.on .q-prog{ background:var(--green); }

/* ============ FILTER BAR ============ */
/* Header for the all-projects section: kicker on the left, search box
   floated to the right on the same baseline. */
.ap-header{
  display:flex; align-items:center; justify-content:space-between;
  gap:14px; flex-wrap:wrap;
}
.ap-header .search{ margin-left:auto; }
@media (max-width:820px){
  .ap-header .search{ width:100%; }
}
/* "今天上线" 区域的计数胶囊 — 跟 kicker 同行右侧。色调延用 green-soft
   让它跟 featured/all kicker 视觉一致，不抢镜。 */
.today-count{
  margin-left:auto;
  font-size:12px;
  color:var(--tx-faint);
  padding:3px 10px;
  border-radius:999px;
  background:var(--green-soft);
  border:1px solid var(--line);
}
/* all-projects: full-width catalog grid with pagination below. */
.all-projects{
  display:grid;
  grid-template-columns:1fr;
  gap:18px;
  align-items:start;
  margin-top:20px;
}
.all-projects .toolbar{
  flex-direction:column;
  align-items:stretch;
  gap:12px;
  margin:0;
  position:sticky;
  /* Sticky header is two rows (brand 66px + section pills ~48px);
     128px clears both with a small breathing gap. */
  top:128px;
}
.all-projects .tb-spacer{ display:none; }
.all-projects .seg{ width:100%; }
.all-projects .search{ width:100%; min-width:0; }
@media (max-width:820px){
  .all-projects .toolbar{ position:static; flex-direction:row; flex-wrap:wrap; }
  .all-projects .seg{ flex-direction:row; flex-wrap:wrap; min-width:0; }
}
.toolbar{ display:flex; align-items:flex-start; gap:14px; margin:20px 0 24px; flex-wrap:wrap; }
/* .seg renders the category filter as a vertical list so a long list
   doesn't get pushed off-screen or wrap awkwardly across multiple lines. */
.seg{
  display:flex; flex-direction:column; align-items:stretch; gap:4px;
  background:var(--panel); padding:4px; border-radius:6px;
  border:1px solid var(--line); min-width:108px;
}
.seg button{
  display:flex; justify-content:space-between; align-items:center; gap:8px;
  padding:8px 10px; border-radius:5px;
  font-size:13px; font-weight:600; color:var(--tx-dim); transition:.18s ease;
  text-align:left;
}
.seg button:hover{ color:var(--tx); }
.seg button.on{ color:var(--tx); background:var(--elev); box-shadow:inset 0 1px 0 rgba(255,255,255,.06); }
.seg .count{ font-family:var(--mono); font-size:11px; color:var(--tx-faint); }
.seg button.on .count{ color:var(--green-ink); }
.tb-spacer{ flex:1; }
.search{ display:flex; align-items:center; gap:9px; background:var(--panel); border:1px solid var(--line); border-radius:6px; padding:0 14px; height:42px; min-width:220px; transition:.18s ease; }
.search > span{ display:inline-flex; align-items:center; line-height:0; }
.search svg{ display:block; }
.search:focus-within{ border-color:rgba(70,224,123,.5); box-shadow:0 0 0 3px var(--green-soft); }
.search input{ background:none; border:none; outline:none; color:var(--tx); font-size:14px; width:100%; font-family:var(--sans); }
.search input::placeholder{ color:var(--tx-faint); }

/* ============ GRID / CARD ============ */
.grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:18px; }
@media (max-width:1100px){ .grid{ grid-template-columns:repeat(3,1fr); } }
@media (max-width:820px){ .grid{ grid-template-columns:repeat(2,1fr); } }
@media (max-width:540px){ .grid{ grid-template-columns:1fr; } }

.card{
  position:relative; border-radius:var(--r); overflow:hidden; cursor:pointer;
  min-height:260px;
  background:var(--panel); border:1px solid var(--line);
  transition:transform .28s cubic-bezier(.2,.7,.2,1), box-shadow .28s ease, border-color .28s ease;
  will-change:transform;
}
.card:hover{ transform:translateY(-6px); border-color:var(--line-2); box-shadow:var(--shadow-lg); }
.card-media{ position:relative; aspect-ratio:16/8; overflow:hidden; background:var(--bg-2); }
.card-media img{ width:100%; height:100%; object-fit:cover; transition:transform .5s cubic-bezier(.2,.7,.2,1); }
.card:hover .card-media img{ transform:scale(1.07); }
.card-rank{
  position:absolute; top:10px; left:10px; z-index:2;
  font-family:var(--mono); font-weight:700; font-size:12px; color:#eef3ee;
  background:rgba(6,11,8,.62); border:1px solid var(--line-2); backdrop-filter:blur(6px);
  padding:4px 9px; border-radius:4px;
}
.card-rank b{ color:var(--green); }
.card-cat{
  position:absolute; top:10px; left:10px; z-index:2; font-size:11.5px; font-weight:700;
  padding:4px 10px; border-radius:4px;
}
.cat-1{ color:#06140c; background:rgba(70,224,123,.92);  border:1px solid rgba(70,224,123,.7); }
.cat-2{ color:#3a0c1a; background:rgba(242,132,158,.9);  border:1px solid rgba(242,132,158,.7); }
.cat-3{ color:#0c1b32; background:rgba(120,180,240,.92); border:1px solid rgba(120,180,240,.7); }
.cat-4{ color:#2a1d04; background:rgba(240,200,90,.92);  border:1px solid rgba(240,200,90,.7); }

.card-shade{ position:absolute; inset:0; background:linear-gradient(0deg, rgba(6,11,8,.88), rgba(6,11,8,0) 55%); opacity:.0; transition:opacity .3s; }
.card:hover .card-shade{ opacity:1; }

/* Visits badge — bottom-right of the cover image. Stays visible without
   hover (eye icon + count), gradient backdrop keeps it legible on light
   covers. Pointer-events:none so it doesn't intercept the card's link. */
.card-visits{
  position:absolute; right:8px; bottom:8px; z-index:2;
  display:inline-flex; align-items:center; gap:5px;
  padding:3px 8px; border-radius:999px;
  font-size:11.5px; font-weight:600; color:#e5edf5;
  background:rgba(6,11,8,.62);
  border:1px solid rgba(255,255,255,.12);
  backdrop-filter:blur(4px);
  pointer-events:none;
  transition:opacity .25s;
}
.card-visits svg{ opacity:.85; }
/* Fade slightly when hover-reveal kicks in so the play button takes
   visual priority. */
.card:hover .card-visits{ opacity:.55; }

.card-reveal{
  position:absolute; left:0; right:0; bottom:0; padding:14px; z-index:3;
  transform:translateY(12px); opacity:0; transition:.3s cubic-bezier(.2,.7,.2,1);
}
.card:hover .card-reveal{ transform:none; opacity:1; }
.card-reveal .btn-play{ width:100%; justify-content:center; padding:10px; }

.card-body{ padding:14px 15px 16px; }
/* Wide screens: headline is a transparent wrapper (title stacked above
   author, same as before it existed); desc only shows in narrow list
   mode. */
.card-headline{ display:contents; }
.card-desc{ display:none; }
.card-name{
  font-size:16px; font-weight:700; letter-spacing:-.01em; margin:0 0 4px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.card-author{
  font-size:12.5px; color:var(--tx-faint); display:block;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.dot{ width:3px; height:3px; border-radius:50%; background:var(--tx-faint); }
.card-tags{ display:flex; flex-wrap:wrap; gap:6px; margin-top:11px; }
.card-tags .tag{ background:var(--fill); padding:3px 9px; font-size:11px; }

/* Narrow screens: cards flip to a compact 96px list row —
   [ pic 40% (≤240px) | title 作者:author / desc(ellipsis) ]
   No category badge / visits / tags in list mode.
   NOTE: must stay AFTER the base .card-* rules above — media queries
   don't add specificity, so source order decides who wins. */
@media (max-width:1100px){
  .grid{ grid-template-columns:1fr; gap:8px; }
  .card{ display:flex; flex-direction:row; height:96px; min-height:0; border-radius:8px; }
  .card:hover{ transform:none; box-shadow:none; }
  .card-media{ width:40%; max-width:240px; flex:none; height:100%; aspect-ratio:auto; }
  /* card-visits stays — the corner badge on the pic is wanted in list
     mode too; only the category badge / hover overlay / tags go. */
  .card-cat, .card-reveal, .card-shade, .card-tags{ display:none; }
  .card-body{
    flex:1; min-width:0; padding:8px 18px;
    display:flex; flex-direction:column; justify-content:center; gap:4px;
  }
  /* Title wins: the name never shrinks (only ellipsizes past full
     width); when the author no longer fits it wraps to a second line
     that the 20px max-height clips away entirely. */
  .card-headline{
    display:flex; flex-wrap:wrap; align-items:baseline; gap:8px;
    min-width:0; max-height:20px; overflow:hidden;
  }
  .card-name{
    font-size:14px; margin:0; line-height:20px;
    flex-shrink:0; max-width:100%;
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  }
  /* margin-left:auto = flex 版的 float:right，作者推到行尾 */
  .card-author{ font-size:11.5px; flex:none; margin-left:auto; }
  .card-desc{
    display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2;
    margin:0; font-size:12px; line-height:1.45; color:var(--tx-faint);
    overflow:hidden;
  }
}

/* stagger-in for filtered grid */
.card-anim{ animation:pop .5s cubic-bezier(.2,.7,.2,1) both; }
@keyframes pop{ from{ opacity:0; transform:translateY(18px) scale(.98); } to{ opacity:1; transform:none; } }

.empty{ grid-column:1/-1; text-align:center; padding:60px 0; color:var(--tx-faint); font-family:var(--mono); }

/* ============ COMMUNITY ============ */
.community{ margin:72px 0 0; }
.comm-panel{
  position:relative; overflow:hidden; border-radius:var(--r-lg); border:1px solid var(--line);
  background:linear-gradient(160deg,var(--panel-2),var(--bg-2));
  padding:40px; box-shadow:var(--shadow);
}
.comm-grid{ display:grid; grid-template-columns:1.1fr 1.3fr; gap:40px; align-items:center; }
@media (max-width:820px){ .comm-grid{ grid-template-columns:1fr; gap:28px; } }
.comm-title{ font-size:26px; font-weight:800; letter-spacing:-.02em; margin:10px 0 12px; }
.comm-text{ color:var(--tx-dim); font-size:14.5px; line-height:1.7; margin-bottom:22px; }
.qr-row{ display:grid; grid-template-columns:repeat(3,1fr); gap:14px; }
.qr-card{
  display:block; color:inherit; text-decoration:none;
  background:var(--panel); border:1px solid var(--line); border-radius:7px; padding:12px;
  text-align:center; transition:.22s ease;
  touch-action:manipulation;
  -webkit-tap-highlight-color:rgba(70,224,123,.18);
}
.qr-card-link{ cursor:pointer; }
.qr-card .qrimg, .qr-card .qrimg img, .qr-card .qrlabel{ pointer-events:none; }
@media (hover:hover){
  .qr-card:hover{ transform:translateY(-4px); border-color:var(--line-2); box-shadow:var(--shadow); }
}
.qr-card .qrimg{ aspect-ratio:1; border-radius:5px; overflow:hidden; background:#fff; margin-bottom:10px; }
.qr-card .qrimg img{ width:100%; height:100%; object-fit:contain; }
.qr-card .qrlabel{ font-size:13px; font-weight:600; color:var(--tx-dim); }

/* ============ FOOTER ============ */
.footer{ visibility: hidden; margin-top:54px; border-top:1px solid var(--line); }
.footer-inner{ display:flex; align-items:center; justify-content:space-between; padding:26px 0; gap:18px; flex-wrap:wrap; }
.footer .muted{ color:var(--tx-faint); font-size:13px; }
.footer .mono{ font-family:var(--mono); font-size:12px; color:var(--tx-faint); }
.footer .mono b{ color:var(--green-ink); }
.foot-links{ display:flex; gap:18px; }
.foot-links a{ color:var(--tx-dim); font-size:13px; }
.foot-links a:hover{ color:var(--tx); }

/* ============================================================
   Natural-language search — hero trigger + modal
   ============================================================ */

/* SearchHero: read-only-looking trigger that opens the modal. Centered,
   full width up to 936px as the page's primary CTA above Featured.
   Hover/focus rings pick up the accent so it reads as interactive. */
.search-hero{
  width:100%; max-width:936px; margin:24px auto 72px;
  display:flex; align-items:center; gap:12px;
  background:var(--panel); border:1px solid var(--line); border-radius:10px;
  padding:14px 18px; cursor:pointer; transition:.18s ease;
}
.search-hero:hover, .search-hero:focus-visible{
  border-color:rgba(70,224,123,.5);
  box-shadow:0 0 0 4px var(--green-soft);
  outline:none;
}
.search-hero-placeholder{ flex:1; color:var(--tx-dim); font-size:15px; }
.search-hero-hint{
  font-size:11px; color:var(--tx-faint);
  padding:3px 8px; border-radius:4px;
  background:rgba(255,255,255,.04); border:1px solid var(--line);
}
@media (max-width:820px){
  .search-hero{ padding:12px 14px; }
  .search-hero-hint{ display:none; }
}

[hidden]{
  display:none !important;
}

/* Modal backdrop covers the viewport with a faint blur so the result
   list reads clearly without the page content showing through too
   strong. Click-on-backdrop closes; the modal itself stops propagation. */
.modal-backdrop{
  position:fixed; inset:0; z-index:1000;
  background:rgba(0,0,0,.55);
  -webkit-backdrop-filter:blur(4px); backdrop-filter:blur(4px);
  display:flex; align-items:flex-start; justify-content:center;
  padding-top:6vh;
  animation:modal-fade .18s ease-out;
}
.modal-backdrop[hidden]{
  display:none;
}
@keyframes modal-fade{ from{opacity:0} to{opacity:1} }

.search-modal{
  width:80%; max-width:880px; max-height:84vh;
  display:flex; flex-direction:column;
  background:var(--bg-2); border:1px solid var(--line-2); border-radius:14px;
  box-shadow:0 24px 64px rgba(0,0,0,.5);
  overflow:hidden;
}
.search-modal-head{
  display:flex; align-items:center; gap:10px;
  padding:14px 18px; border-bottom:1px solid var(--line);
}
.search-modal-input{
  flex:1; background:transparent; border:0; outline:none;
  color:var(--tx); font-size:17px; padding:6px 4px;
  /* inputs don't inherit the page font by default */
  font-family:var(--sans);
}
.search-modal-input::placeholder{ color:var(--tx-faint); }
.search-modal-close{
  background:transparent; border:0; color:var(--tx-dim);
  width:28px; height:28px; border-radius:4px; cursor:pointer; font-size:14px;
}
.search-modal-close:hover{ background:rgba(255,255,255,.06); color:var(--tx); }

.search-modal-body{
  overflow-y:auto; padding:8px 0;
  flex:1; min-height:160px;
}
.search-state{
  padding:24px 22px; color:var(--tx-faint);
  font-family:var(--mono); font-size:13px;
  text-align:center;
}
.search-err{ color:#f28890; }

.search-results{ display:flex; flex-direction:column; }
.search-result{
  display:flex; align-items:center; gap:14px;
  padding:10px 18px;
  color:var(--tx); border-bottom:1px solid rgba(255,255,255,.04);
  transition:background .12s ease;
}
.search-result:hover{ background:rgba(255,255,255,.04); }
.search-result img,
.search-result-thumb-empty{
  width:72px; height:46px; object-fit:cover; border-radius:5px; flex-shrink:0;
  background:var(--fill);
}
.search-result-meta{ display:flex; flex-direction:column; gap:2px; min-width:0; }
.search-result-title{
  font-size:14.5px; font-weight:600;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.search-result-author{ font-size:12px; color:var(--tx-faint); }

/* Conversion banner pinned to the modal bottom. Always green-tinted
   so it stays visually distinct from the result rows. */
.search-banner{
  display:flex; align-items:center; justify-content:space-between;
  gap:12px; padding:14px 18px;
  border-top:1px solid var(--line);
  background:linear-gradient(90deg, var(--green-soft), transparent 70%);
  color:var(--tx); font-size:14px;
}
.search-banner:hover{ background:linear-gradient(90deg, var(--green-soft), rgba(70,224,123,.06)); }
.search-banner-hint{ color:var(--tx-dim); margin-left:6px; }
.search-banner-cta{
  display:inline-flex; align-items:center; gap:6px;
  color:var(--green-ink); font-weight:600; white-space:nowrap;
}

@media (max-width:820px){
  .search-modal{ width:94%; max-height:90vh; }
  .modal-backdrop{ padding-top:4vh; }
}

/* ============================================================
   Hot search tags + tall hero + expandable grid
   ============================================================ */

/* SearchHero grows to two rows: input-looking row + hot tags row. */
.search-hero-tall{
  flex-direction:column; align-items:stretch; gap:10px;
  padding:16px 18px 12px;
}
.search-hero-row{
  display:flex; align-items:center; gap:12px;
}

.hot-tags{
  display:flex; align-items:center; gap:8px;
  /* Single row only: pills that don't fit are clipped, never wrapped. */
  flex-wrap:nowrap; overflow:hidden;
  min-height:24px;
}
.hot-tags-label{
  font-size:12px; color:var(--tx-faint); flex:none;
}
.hot-tag{
  appearance:none; cursor:pointer;
  /* flex:none + nowrap: a pill either fits whole or gets clipped by
     the single-row .hot-tags container — never squeezed mid-text. */
  flex:none; white-space:nowrap;
  padding:3px 10px; border-radius:999px;
  background:rgba(255,255,255,.04); border:1px solid var(--line);
  color:var(--tx-dim); font-size:12px; line-height:1.4;
  transition:.15s ease;
}
.hot-tag:hover{
  color:var(--green-ink); border-color:rgba(70,224,123,.45);
  background:var(--green-soft);
}
/* Compact variant inside the search modal — denser padding, border
   only below so it visually attaches to the input row. */
.hot-tags-compact{
  padding:10px 18px;
  border-bottom:1px solid var(--line);
}

/* Full-width dark expand/collapse button under a capped grid. */
.expand-btn{
  appearance:none; cursor:pointer;
  display:block; width:100%;
  margin-top:14px; padding:12px 0;
  background:var(--panel); border:1px solid var(--line); border-radius:8px;
  color:var(--tx-dim); font-size:13.5px; font-weight:600;
  transition:.18s ease;
}
.expand-btn:hover{
  color:var(--tx);
  border-color:var(--line-2);
  background:rgba(255,255,255,.05);
}

/* ============================================================
   Section nav — sticky anchor strip under the main nav
   ============================================================ */
/* Second row inside the merged sticky header (.nav). No own background
   or blur — the outer .nav paints one continuous glass panel for both
   rows (separate backgrounds caused a visible seam). The bottom border
   also lives on .nav. */
.section-nav{}
.section-nav-inner{
  display:flex; align-items:center; gap:6px;
  padding:8px 0;
  overflow-x:auto;
  scrollbar-width:none;
}
.section-nav-inner::-webkit-scrollbar{ display:none; }
.section-nav-item{
  flex:none;
  padding:6px 14px; border-radius:999px;
  font-size:14px; font-weight:600; color:var(--tx-dim);
  white-space:nowrap; transition:.15s ease;
}
.section-nav-item:hover{ color:var(--tx); background:var(--panel); }
.section-nav-sep{
  flex:none; width:1px; height:16px; align-self:center;
  background:var(--line); margin:0 4px;
}
.section-nav-item.on{
  color:var(--green-ink);
  background:var(--green-soft);
}

/* Anchor targets need clearance for nav (66px) + section-nav (~44px)
   so scrollIntoView doesn't tuck the heading under the sticky chrome. */
#sec-featured, #sec-today, #sec-categories, #sec-sites{
  scroll-margin-top:122px;
}
[id^="subcat-"]{
  scroll-margin-top:96px;
}

/* Small blurb under an L1 grid-area title (admin-configured). */
.section-desc{
  margin:6px 0 0;
  font-size:13.5px; line-height:1.6;
  color:var(--tx-faint);
  max-width:640px;
}

.category-section{ margin-top:72px; }
.category-card-grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:18px;
}
.category-card{
  display:block;
  position:relative;
  min-height:148px;
  padding:18px;
  border-radius:var(--r);
  border:1px solid var(--line);
  background:linear-gradient(160deg,var(--panel),var(--bg-2));
  color:var(--tx);
  text-decoration:none;
  overflow:hidden;
  transition:transform .22s cubic-bezier(.2,.7,.2,1), border-color .22s ease, box-shadow .22s ease;
}
.category-card:visited{
  color:var(--tx);
}
.category-card:hover{
  transform:translateY(-4px);
  border-color:var(--line-2);
  box-shadow:var(--shadow);
}
.category-card-count{
  display:inline-flex;
  color:var(--green-ink);
  font-family:var(--mono);
  font-size:11px;
  font-weight:700;
  margin-bottom:18px;
}
.category-card h3{
  margin:0 0 8px;
  font-size:20px;
  line-height:1.2;
  letter-spacing:0;
}
.category-card p{
  margin:0;
  color:var(--tx-faint);
  font-size:13.5px;
  line-height:1.6;
  display:-webkit-box;
  -webkit-line-clamp:3;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
@media (max-width:1100px){
  .category-card-grid{ grid-template-columns:repeat(2,1fr); }
}
@media (max-width:540px){
  .category-card-grid{ grid-template-columns:1fr; }
}

.intro-subpage{
  padding:108px 0;
}
.intro-inner-subpage{
  max-width:820px;
}
.subpage-title{
  margin:6px 0 14px;
  font-size:42px;
  line-height:1.08;
  font-weight:800;
  letter-spacing:0;
}
.breadcrumbs{
  display:flex;
  align-items:center;
  gap:8px;
  margin:20px 0 8px;
  color:var(--tx-faint);
  font-size:13px;
}
.breadcrumbs a{
  color:var(--tx-dim);
}
.breadcrumbs a:hover{
  color:var(--green-ink);
}
.breadcrumb-sep{
  color:var(--line-2);
}
.category-listing-section + .category-listing-section{
  margin-top:72px;
}
.site-detail{
  padding:28px 0 0;
}
.site-detail-intro{
  margin-bottom:24px;
}
.site-title-row{
  display:flex;
  align-items:flex-start;
}
.site-title-row .subpage-title{
  margin-bottom:0;
}
.site-meta-row{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:10px;
  margin-top:20px;
  color:var(--tx-dim);
  font-size:13.5px;
  line-height:1.4;
}
.site-meta-row span{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:7px 10px;
  border:1px solid var(--line);
  border-radius:999px;
  background:var(--panel);
}
.site-meta-row b{
  color:var(--tx-faint);
  font-weight:700;
}
.site-detail-actions{
  display:flex;
  margin-top:18px;
}
.site-detail-gallery{
  margin-top:24px;
}
.site-detail-gallery .kicker{
  margin-bottom:12px;
}
.site-detail-cover{
  position:relative;
  height:600px;
  border:1px solid var(--line);
  border-radius:var(--r-lg);
  background:var(--bg-2);
  box-shadow:var(--shadow);
  overflow:hidden;
  cursor:pointer;
}
.site-detail-img{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  opacity:0;
  transition:opacity .35s ease;
}
.site-detail-img.on{
  opacity:1;
}
.site-detail-grad{
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  height:118px;
  background:linear-gradient(0deg, rgba(6,11,8,.78), rgba(6,11,8,0));
  pointer-events:none;
}
.site-detail-thumbs{
  position:absolute;
  left:0;
  right:0;
  bottom:16px;
  z-index:3;
  display:flex;
  justify-content:center;
  gap:10px;
  padding:8px 18px;
  overflow-x:auto;
  scrollbar-width:none;
}
.site-detail-thumbs::-webkit-scrollbar{ display:none; }
.site-detail-thumb{
  width:76px;
  height:44px;
  flex:none;
  padding:0;
  border:1px solid rgba(255,255,255,.22);
  border-radius:5px;
  background:rgba(0,0,0,.42);
  overflow:hidden;
  opacity:.72;
  cursor:pointer;
  transition:border-color .18s ease, opacity .18s ease, transform .18s ease, box-shadow .18s ease;
}
.site-detail-thumb:hover{
  opacity:1;
  transform:translateY(-2px);
}
.site-detail-thumb.on{
  opacity:1;
  border-color:rgba(70,224,123,.85);
  box-shadow:0 0 0 1px rgba(70,224,123,.45), 0 10px 22px -12px var(--glow);
}
.site-detail-thumb img{
  width:100%;
  height:100%;
  display:block;
  object-fit:cover;
}
.site-detail-desc-grid{
  display:grid;
  grid-template-columns:minmax(0,70%) minmax(260px,1fr);
  gap:24px;
  align-items:start;
  margin-top:24px;
}
.site-detail-desc{
  color:var(--tx-dim);
  font-size:16px;
  line-height:1.75;
}
.site-detail-desc .kicker{
  margin-bottom:10px;
}
.site-detail-desc p{
  margin:0;
}
.site-rating{
  justify-self:stretch;
  padding:18px;
  border:1px solid var(--line);
  border-radius:8px;
  background:var(--panel);
  box-shadow:var(--shadow);
}
.site-rating-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin-bottom:14px;
  font-size:13px;
  color:var(--tx-faint);
}
.site-rating-head strong{
  color:var(--green-ink);
  font-family:var(--mono);
  font-size:22px;
  line-height:1;
}
.site-rating-stars{
  display:flex;
  gap:4px;
}
.site-rating-stars button{
  appearance:none;
  cursor:pointer;
  width:32px;
  height:32px;
  border:0;
  border-radius:6px;
  background:transparent;
  color:var(--tx-faint);
  font-size:24px;
  line-height:1;
  transition:color .15s ease, background .15s ease, transform .15s ease;
}
.site-rating-stars button:hover,
.site-rating-stars button.on{
  color:var(--green-ink);
  background:var(--green-soft);
}
.site-rating-stars button:hover{
  transform:translateY(-1px);
}
.site-rating-stars button:disabled{
  cursor:not-allowed;
  opacity:.78;
}
.site-rating-stars button:disabled:hover{
  transform:none;
}
.site-rating-note{
  margin-top:12px;
  color:var(--tx-faint);
  font-size:12px;
}
.site-rating-user{
  margin-top:6px;
  color:var(--green-ink);
  font-family:var(--mono);
  font-size:12px;
}
@media (max-width:900px){
  .subpage-title{ font-size:32px; }
  .site-detail-cover{ height:320px; }
  .site-detail-desc-grid{ grid-template-columns:1fr; }
}

html.fonts-loading body{
  opacity:0;
  pointer-events:none;
}
html.fonts-loading body,
html.fonts-ready body{
  transition:opacity .28s ease;
}
html.fonts-ready body{
  opacity:1;
}

.ssr-pager{
  grid-column:1;
  align-self:start;
  justify-self:end;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  margin:0;
}
.ssr-pager-btn,
.ssr-pager-num{
  appearance:none;
  cursor:pointer;
  min-width:32px;
  height:32px;
  padding:0 10px;
  border:1px solid var(--line);
  border-radius:8px;
  background:var(--panel);
  color:var(--tx-dim);
  font-size:13.5px;
  font-weight:600;
  transition:.18s ease;
}
.ssr-pager-btn:hover:not(:disabled),
.ssr-pager-num:hover{
  color:var(--tx);
  border-color:var(--line-2);
  background:rgba(255,255,255,.05);
}
.ssr-pager-num.on{
  color:var(--green-ink);
  border-color:rgba(70,224,123,.45);
  background:var(--green-soft);
}
.ssr-pager-btn:disabled{
  cursor:not-allowed;
  opacity:.45;
}
[data-ssr-page-grid].ssr-page-switched .card-anim{
  animation:none;
}
@media (max-width:1100px){
  .ssr-pager{
    justify-content:flex-end;
  }
}
@media (max-width:820px){
  .ssr-pager{
    grid-column:1;
    margin:6px 0;
  }
}
