:root{
  --bg:#070A12;
  --text:#EAF0FF;
  --muted: rgba(234,240,255,.72);
  --muted2: rgba(234,240,255,.55);

  --panel: rgba(255,255,255,.06);
  --panel2: rgba(255,255,255,.08);
  --border: rgba(255,255,255,.12);

  --shadow: 0 20px 60px rgba(0,0,0,.55);
  --radius: 18px;
  --radius2: 14px;

  --max: 1180px;

  --grad: linear-gradient(135deg, rgba(90,160,255,.70), rgba(255,120,180,.55));
  --grad2: linear-gradient(135deg, rgba(90,160,255,.55), rgba(255,120,180,.40));
}

*{ box-sizing:border-box; }
html, body{ height:100%; }
body{
  margin:0;
  color:var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Thai", Arial, sans-serif;
  background:
    radial-gradient(900px 520px at 20% 10%, rgba(90,160,255,.22), transparent 60%),
    radial-gradient(900px 520px at 85% 20%, rgba(255,120,180,.14), transparent 62%),
    radial-gradient(900px 520px at 45% 95%, rgba(140,255,210,.10), transparent 60%),
    var(--bg);
  overflow-x:hidden;
}

a{ color:inherit; text-decoration:none; }
.container{ max-width:var(--max); margin:0 auto; padding:0 18px; }

.topbar{
  position:sticky;
  top:0;
  z-index:50;
  backdrop-filter: blur(12px);
  background: linear-gradient(to bottom, rgba(7,10,18,.75), rgba(7,10,18,.35));
  border-bottom:1px solid rgba(255,255,255,.08);
}
.topbar__inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 0;
}
.brand{
  display:flex;
  align-items:center;
  gap:12px;
  min-width: 200px;
}
.brand__mark{
  width:38px;
  height:38px;
  border-radius:12px;
  background:
    radial-gradient(18px 18px at 30% 30%, rgba(255,255,255,.55), transparent 60%),
    var(--grad);
  border:1px solid rgba(255,255,255,.18);
  box-shadow: 0 10px 26px rgba(0,0,0,.35);
}
.brand__text{
  display:flex;
  flex-direction:column;
  line-height:1.2;
}
.brand__text strong{ font-size:14px; letter-spacing:.3px; }
.brand__text span{ font-size:12px; color:var(--muted2); }

.actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.search input{
  width:min(380px, 52vw);
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color:var(--text);
  outline:none;
}
.search input::placeholder{ color: rgba(234,240,255,.45); }

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.08);
  color:var(--text);
  cursor:pointer;
  user-select:none;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
  white-space:nowrap;
}
.btn:hover{
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.22);
  transform: translateY(-1px);
}
.btn--primary{
  background: var(--grad2);
  border-color: rgba(255,255,255,.18);
}
.btn--primary:hover{
  background: var(--grad);
}
.btn--ghost{
  background: rgba(255,255,255,.06);
}

/* Hero */
.hero{ padding:34px 0 18px; }
.hero__grid{
  display:grid;
  gap:16px;
  grid-template-columns: 1fr;
}
@media (min-width: 980px){
  .hero__grid{ grid-template-columns: 1.2fr .8fr; }
}

.hero__card{
  border-radius: var(--radius);
  border:1px solid rgba(255,255,255,.10);
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.04));
  box-shadow: var(--shadow);
  overflow:hidden;
  padding:18px;
}

.pill{
  display:inline-flex;
  gap:8px;
  align-items:center;
  font-size:12px;
  color: rgba(234,240,255,.75);
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  padding:6px 10px;
  border-radius:999px;
}
.dot{
  width:8px; height:8px; border-radius:999px;
  background: rgba(140,255,210,.9);
  box-shadow: 0 0 18px rgba(140,255,210,.55);
}

.hero h1{
  margin:12px 0 6px;
  font-size: clamp(24px, 3.6vw, 38px);
  letter-spacing:.2px;
}
.lead{
  margin:0;
  color: var(--muted);
  font-size:14px;
  line-height:1.65;
  max-width: 62ch;
}
.hero__cta{
  margin-top:14px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

/* Stats */
.stats{
  margin-top:16px;
  display:grid;
  gap:10px;
  grid-template-columns: repeat(3, minmax(0,1fr));
}
.stat{
  border-radius: 14px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  padding:12px;
}
.stat__k{ font-weight:700; letter-spacing:.2px; }
.stat__v{ color: var(--muted2); font-size:12px; margin-top:4px; }

/* Preview */
.hero__preview{ padding:14px; }
.preview{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px;
}
.preview__caption{
  margin-top:10px;
  color: var(--muted2);
  font-size:12px;
  line-height:1.5;
}
.mini{
  border-radius: 14px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  aspect-ratio: 4 / 3;
  position:relative;
}
.mini img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  filter:saturate(1.08) contrast(1.02);
  transform: scale(1.02);
}
.mini::after{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(to top, rgba(0,0,0,.35), transparent 60%);
  pointer-events:none;
}

/* Filters */
.filters{
  padding: 6px 0 6px;
}
.filters__inner{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:14px;
  flex-wrap:wrap;
}
.filters__left h2{
  margin:0;
  font-size:16px;
  letter-spacing:.3px;
}
.filters__left p{
  margin:6px 0 0;
  color: var(--muted2);
  font-size:12px;
}
.tagbar{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
}
.tag{
  border-radius: 999px;
  padding:8px 10px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: rgba(234,240,255,.88);
  font-size:12px;
  cursor:pointer;
  user-select:none;
  transition: background .12s ease, border-color .12s ease, transform .12s ease;
}
.tag:hover{
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.22);
  transform: translateY(-1px);
}
.tag[aria-pressed="true"]{
  background: rgba(255,255,255,.14);
  border-color: rgba(255,255,255,.30);
}

/* Gallery grid */
.grid{
  margin-top:12px;
  display:grid;
  gap:12px;
  grid-template-columns: repeat(2, minmax(0,1fr));
}
@media (min-width: 640px){
  .grid{ grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (min-width: 980px){
  .grid{ grid-template-columns: repeat(4, minmax(0,1fr)); }
}

.card{
  position:relative;
  border-radius: var(--radius2);
  overflow:hidden;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  cursor:pointer;
  transform: translateZ(0);
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.card:hover{
  transform: translateY(-2px);
  border-color: rgba(255,255,255,.18);
  background: rgba(255,255,255,.07);
}
.thumb{
  width:100%;
  aspect-ratio: 4/3;
  object-fit:cover;
  display:block;
  transition: transform .25s ease, filter .25s ease;
  filter: saturate(1.06) contrast(1.02);
}
.card:hover .thumb{
  transform: scale(1.04);
  filter: saturate(1.12) contrast(1.05);
}
.overlay{
  position:absolute;
  inset:0;
  background: linear-gradient(to top, rgba(0,0,0,.55), transparent 55%);
  opacity:.9;
  pointer-events:none;
}
.caption{
  position:absolute;
  left:12px;
  right:12px;
  bottom:10px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  pointer-events:none;
}
.cap-title{
  font-size:12px;
  color: rgba(234,240,255,.90);
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
  max-width: 75%;
}
.cap-pill{
  font-size:12px;
  color: rgba(234,240,255,.88);
  border:1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.38);
  padding:6px 10px;
  border-radius:999px;
  backdrop-filter: blur(10px);
  white-space:nowrap;
}

.empty{
  margin-top:12px;
  padding:18px 12px;
  border-radius: 14px;
  border:1px dashed rgba(255,255,255,.16);
  color: var(--muted2);
  text-align:center;
}

/* Footer */
.footer{ padding:22px 0 30px; }
.footer__inner{ color: var(--muted2); font-size:12px; }
.footer__line{
  height:1px;
  width:100%;
  background: rgba(255,255,255,.08);
  margin:18px 0 14px;
}

/* Lightbox */
.lb{
  position:fixed;
  inset:0;
  display:none;
  place-items:center;
  background:rgba(0,0,0,.80);
  padding:18px;
  z-index:1000;
}
.lb[open]{ display:grid; }
.lb__inner{
  width:min(1180px, 100%);
  border-radius: var(--radius);
  overflow:hidden;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(17,24,39,.88);
  box-shadow: var(--shadow);
}
.lb__top{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border-bottom:1px solid rgba(255,255,255,.08);
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.03));
}
.lb__title{
  color: var(--muted);
  font-size:13px;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
}
.lb__img{
  width:100%;
  max-height: 80vh;
  object-fit: contain;
  display:block;
  background:#050712;
}
.lb__hint{
  padding:10px 12px 14px;
  color: var(--muted2);
  font-size:12px;
  border-top:1px solid rgba(255,255,255,.08);
}
code{ color: rgba(234,240,255,.9); }
