/* WPAI Themes gallery — self-contained, no external fonts or CDNs. */
:root {
  --bg: #0b0d12;
  --bg-soft: #11141c;
  --panel: #161a24;
  --panel-2: #1c212d;
  --line: #262c3a;
  --ink: #eef1f7;
  --ink-dim: #9aa3b5;
  --ink-faint: #69728a;
  --accent: #ffb347;       /* warm amber */
  --accent-2: #7c8cff;     /* periwinkle */
  --radius: 14px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "Consolas", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(124,140,255,.10), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(255,179,71,.08), transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
.wrap { width: min(1180px, 92vw); margin-inline: auto; }

/* Header */
.site { position: sticky; top: 0; z-index: 20; backdrop-filter: blur(10px);
  background: rgba(11,13,18,.72); border-bottom: 1px solid var(--line); }
.site__inner { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 700; letter-spacing: .2px; }
.brand__mark { color: var(--accent); transform: translateY(-1px); }
.site__nav { display: flex; gap: 1.4rem; font-size: .92rem; color: var(--ink-dim); }
.site__nav a:hover { color: var(--ink); }

/* Hero */
.hero { padding: clamp(3rem, 9vw, 6rem) 0 2.4rem; }
.hero__title { font-family: var(--serif); font-weight: 700; line-height: 1.08;
  font-size: clamp(2.1rem, 6vw, 3.7rem); margin: 0 0 1.1rem; letter-spacing: -.5px; }
.hero__title em { color: var(--accent); font-style: italic; }
.hero__lead { max-width: 60ch; color: var(--ink-dim); font-size: clamp(1rem, 2.4vw, 1.18rem); margin: 0; }
.hero__lead strong { color: var(--ink); font-weight: 600; }
.hero__stats { margin-top: 1.6rem; font-family: var(--mono); font-size: .85rem; color: var(--ink-faint); }

/* Toolbar */
.toolbar { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center;
  justify-content: space-between; margin: 1rem 0 1.2rem; }
.tabs { display: inline-flex; background: var(--panel); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px; }
.tab { border: 0; background: transparent; color: var(--ink-dim); font: inherit; font-weight: 600;
  padding: .5rem 1.15rem; border-radius: 999px; cursor: pointer; transition: .15s; }
.tab.is-active { background: var(--accent); color: #1a1205; }
.tab:not(.is-active):hover { color: var(--ink); }
.search { background: var(--panel); border: 1px solid var(--line); color: var(--ink);
  border-radius: 999px; padding: .6rem 1.1rem; font: inherit; min-width: 230px; outline: none; }
.search:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(124,140,255,.18); }

/* Tag chips */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.8rem; }
.chip { background: var(--panel); border: 1px solid var(--line); color: var(--ink-dim);
  font-size: .8rem; padding: .32rem .8rem; border-radius: 999px; cursor: pointer; transition: .15s; }
.chip:hover { color: var(--ink); border-color: var(--ink-faint); }
.chip.is-active { background: var(--accent-2); border-color: var(--accent-2); color: #0b0d12; font-weight: 600; }

/* Grid + cards */
.grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }

/* Category sections */
#grid { display: block; padding-bottom: 4rem; }
.cat { margin-bottom: 2.6rem; }
.cat__head { display: flex; align-items: baseline; gap: .7rem; margin: 0 0 1.15rem;
  padding-bottom: .55rem; border-bottom: 1px solid var(--line); }
.cat__title { font-family: var(--serif); font-size: 1.4rem; margin: 0; letter-spacing: -.01em; }
.cat__count { font-family: var(--mono); font-size: .78rem; color: var(--ink-faint);
  border: 1px solid var(--line); border-radius: 999px; padding: .08rem .55rem; }
.card { background: linear-gradient(180deg, var(--panel), var(--bg-soft));
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .3s cubic-bezier(.2,.7,.2,1), border-color .3s, box-shadow .3s; }
.card:hover { border-color: #3a4a6b;
  box-shadow: 0 26px 60px -30px rgba(0,0,0,.85), 0 0 0 1px rgba(124,140,255,.12); }
.card__shot { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden;
  background: #0e1118; border-bottom: 1px solid var(--line); }
.card__shot img { width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .35s ease; }
.card:hover .card__shot img { transform: scale(1.04); }
.chrome { position: absolute; top: 10px; left: 12px; z-index: 2; display: flex; gap: 5px; }
.chrome i { width: 9px; height: 9px; border-radius: 50%; background: #3a4258; }
.chrome i:nth-child(1){ background:#ff5f57 } .chrome i:nth-child(2){ background:#febc2e } .chrome i:nth-child(3){ background:#28c840 }
.card__preview-hint { position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(8,10,15,.55); color: #fff; font-weight: 700; letter-spacing: .3px;
  opacity: 0; transition: .2s; backdrop-filter: blur(2px); }
.card__shot:hover .card__preview-hint { opacity: 1; }
.card__body { padding: 1.05rem 1.15rem .4rem; flex: 1; }
.card__head { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; }
.card__name { font-family: var(--serif); font-size: 1.28rem; margin: 0; }
.card__ver { font-family: var(--mono); font-size: .72rem; color: var(--ink-faint);
  border: 1px solid var(--line); padding: .1rem .45rem; border-radius: 6px; white-space: nowrap; }
.card__desc { color: var(--ink-dim); font-size: .92rem; margin: .5rem 0 .8rem; }
.card__tags { display: flex; flex-wrap: wrap; gap: .35rem; }
.card__tags span { font-size: .72rem; color: var(--ink-faint); background: var(--panel-2);
  border: 1px solid var(--line); padding: .12rem .5rem; border-radius: 6px; }
.card__actions { display: flex; gap: .6rem; padding: 1rem 1.15rem 1.2rem; }
.btn { flex: 1; text-align: center; padding: .62rem .9rem; border-radius: 9px; font-weight: 600;
  font-size: .9rem; cursor: pointer; transition: .15s; border: 1px solid transparent; }
.btn--solid { background: var(--accent); color: #1a1205; }
.btn--solid:hover { filter: brightness(1.08); }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--accent-2); color: #fff; }

.empty { text-align: center; color: var(--ink-faint); padding: 4rem 0; }

/* Footer */
.site-foot { border-top: 1px solid var(--line); padding: 2.4rem 0 3rem; margin-top: 2rem;
  color: var(--ink-dim); font-size: .9rem; }
.site-foot a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.site-foot .muted { color: var(--ink-faint); margin-top: .4rem; }

@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .search { min-width: 0; }
}

/* ============================ Motion ============================ */
:root { --ease: cubic-bezier(.2, .7, .2, 1); }

/* Slowly drifting aurora glow behind the hero */
.hero { position: relative; isolation: isolate; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -30% -10% -10%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(38% 48% at 22% 32%, rgba(124, 140, 255, .22), transparent 60%),
    radial-gradient(34% 44% at 82% 18%, rgba(255, 179, 71, .16), transparent 55%);
  animation: hero-drift 22s ease-in-out infinite alternate;
}
@keyframes hero-drift {
  from { transform: translate3d(-2%, 0, 0) scale(1); }
  to   { transform: translate3d(3%, 2%, 0) scale(1.12); }
}

/* Hero entrance on load */
.js .hero__title { animation: rise-in .8s var(--ease) both; }
.js .hero__lead  { animation: rise-in .8s var(--ease) .1s both; }
.js .hero__stats { animation: rise-in .8s var(--ease) .2s both; }
@keyframes rise-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* Card scroll-reveal (cards are JS-rendered, so always under .js) */
.js .card.reveal { opacity: 0; transform: translateY(26px);
  transition: opacity .6s var(--ease), transform .6s var(--ease), border-color .3s, box-shadow .3s;
  transition-delay: calc(var(--i, 0) * 55ms); }
.js .card.reveal.is-in { opacity: 1; transform: translateY(0); }
.js .card.reveal.is-in:hover { transform: translateY(-6px); transition-delay: 0s; }

/* Sheen sweep across the screenshot on hover */
.card__shot::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(115deg, transparent 32%, rgba(255, 255, 255, .12) 48%, transparent 62%);
  transform: translateX(-130%); transition: transform .8s var(--ease); }
.card:hover .card__shot::after { transform: translateX(130%); }
.card__preview-hint { z-index: 4; }

/* Micro-interactions */
.btn { transition: transform .15s var(--ease), filter .15s, box-shadow .2s, background .2s, border-color .2s, color .2s; }
.btn--solid:hover { box-shadow: 0 10px 26px -10px var(--accent); }
.btn:active { transform: translateY(1px); }
.chip { transition: transform .18s var(--ease), background .15s, border-color .15s, color .15s; }
.chip:hover { transform: translateY(-1px); }
.stat { color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 700; }
.brand__mark { display: inline-block; transition: transform .45s var(--ease); }
.brand:hover .brand__mark { transform: rotate(90deg); }

/* Honor reduced-motion: cut all of it */
@media (prefers-reduced-motion: reduce) {
  .hero::before { animation: none; }
  .js .hero__title, .js .hero__lead, .js .hero__stats { animation: none; }
  .js .card.reveal, .js .card.reveal.is-in { opacity: 1 !important; transform: none !important; transition: none !important; }
  .js .card.reveal.is-in:hover { transform: none !important; }
  .card__shot::after { display: none; }
  html { scroll-behavior: auto; }
}
