:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: rgba(15, 23, 42, 0.09);
  --accent: #7c3aed;
  --accent-2: #06b6d4;
  --grad: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 100%);
  --shadow: 0 12px 32px -8px rgba(15, 23, 42, 0.12);
}
[data-theme="dark"] {
  --bg: #09090f;
  --surface: #12121c;
  --surface-2: #1a1a28;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --border: rgba(255, 255, 255, 0.08);
  --accent: #8b5cf6;
  --accent-2: #22d3ee;
  --shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.6);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s ease, color 0.25s ease;
}
a { color: inherit; text-decoration: none; }
.container { width: 94%; max-width: 1680px; margin: 0 auto; }

/* Header */
header {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 70px; gap: 16px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.35rem; font-weight: 800; letter-spacing: -0.03em;
}
.logo-accent {
  background: var(--grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.nav-actions { display: flex; align-items: center; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 15px; border-radius: 11px; font-weight: 600; font-size: 0.9rem;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  cursor: pointer; transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.btn-primary {
  background: var(--grad); color: #fff; border: none;
  box-shadow: 0 6px 20px -4px rgba(139, 92, 246, 0.45);
}
.btn-primary:hover { opacity: 0.94; transform: translateY(-2px); }
.btn.active { background: var(--grad); color: #fff; border-color: transparent; }

/* Cinematic Hero Banner */
.hero-banner {
  position: relative; overflow: hidden;
  min-height: 400px; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 64px 20px;
  background: #09090f;
}
.hero-bg {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0.55; transform: scale(1.03); filter: saturate(1.15);
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(9,9,15,0.55) 0%, rgba(9,9,15,0.75) 60%, var(--bg) 100%);
}
.hero-content {
  position: relative; z-index: 2; max-width: 780px; width: 100%;
}
.hero-badge {
  display: inline-block; padding: 6px 14px; border-radius: 999px;
  background: rgba(139, 92, 246, 0.2); border: 1px solid rgba(139, 92, 246, 0.4);
  color: #e9d5ff; font-size: 0.82rem; font-weight: 600; margin-bottom: 18px;
  backdrop-filter: blur(8px);
}
.hero-content h1 {
  color: #ffffff; font-size: clamp(2rem, 4.2vw, 3.2rem); font-weight: 800;
  letter-spacing: -0.03em; line-height: 1.15; margin-bottom: 14px;
}
.hero-content p {
  color: #cbd5e1; font-size: clamp(1rem, 1.5vw, 1.15rem);
  max-width: 620px; margin: 0 auto 28px;
}
.search-bar {
  max-width: 700px; margin: 0 auto; display: flex; align-items: center;
  background: rgba(255, 255, 255, 0.12); backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 16px;
  padding: 6px 8px 6px 18px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}
.search-bar input {
  flex: 1; background: transparent; border: none; color: #fff;
  font-size: 1.05rem; outline: none; padding: 10px 0;
}
.search-bar input::placeholder { color: #cbd5e1; }

/* Horizontal Visual Categories */
.cat-strip {
  display: flex; gap: 10px; overflow-x: auto; padding: 18px 0 10px;
  scrollbar-width: none; -ms-overflow-style: none;
}
.cat-strip::-webkit-scrollbar { display: none; }
.cat-pill {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: 999px; font-size: 0.88rem; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  cursor: pointer; transition: all 0.2s ease; white-space: nowrap;
}
.cat-pill:hover { border-color: var(--accent-2); transform: translateY(-1px); }
.cat-pill.active {
  background: var(--grad); color: #fff; border-color: transparent;
  box-shadow: 0 6px 18px -4px rgba(6, 182, 212, 0.45);
}

/* Filter Bar */
.filters {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between;
  margin: 10px 0 24px;
}
.filter-group { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filters select {
  padding: 9px 14px; border-radius: 11px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 0.88rem; cursor: pointer;
}

/* Responsive Masonry Gallery */
.masonry {
  column-count: 4; column-gap: 18px; padding-bottom: 56px;
}
@media (max-width: 1280px) { .masonry { column-count: 3; } }
@media (max-width: 860px)  { .masonry { column-count: 2; } }
@media (max-width: 540px)  { .masonry { column-count: 1; } }

.m-card {
  break-inside: avoid; margin-bottom: 18px; position: relative;
  border-radius: 16px; overflow: hidden; background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.m-card:hover { transform: translateY(-4px); }
.m-thumb {
  position: relative; display: block;
  background: repeating-conic-gradient(var(--surface-2) 0% 25%, transparent 0% 50%) 50% / 16px 16px;
}
.m-thumb img {
  width: 100%; height: auto; display: block;
  transition: transform 0.35s ease;
}
.m-card:hover .m-thumb img { transform: scale(1.03); }

.m-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(9,9,15,0.35) 0%, transparent 40%, rgba(9,9,15,0.85) 100%);
  opacity: 0; transition: opacity 0.25s ease;
  display: flex; flex-direction: column; justify-content: space-between; padding: 14px;
  pointer-events: none;
}
.m-card:hover .m-overlay { opacity: 1; }
.m-top-actions { display: flex; justify-content: flex-end; gap: 8px; pointer-events: auto; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.2);
  background: rgba(15, 23, 42, 0.72); backdrop-filter: blur(8px); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  font-size: 1rem; transition: all 0.15s ease;
}
.icon-btn:hover { background: var(--accent); border-color: var(--accent); transform: scale(1.08); }
.icon-btn.active { background: #ef4444; border-color: #ef4444; }
.m-bottom-info { color: #fff; pointer-events: auto; }
.m-title { font-weight: 700; font-size: 0.95rem; margin-bottom: 2px; }
.m-res { font-size: 0.78rem; color: #cbd5e1; }

@media (hover: none) {
  .m-overlay { opacity: 1; background: linear-gradient(180deg, transparent 50%, rgba(9,9,15,0.8) 100%); }
}

/* Detail Page */
.detail-wrap {
  display: grid; grid-template-columns: 1.5fr 1fr; gap: 32px; padding: 36px 0 56px;
}
@media (max-width: 920px) { .detail-wrap { grid-template-columns: 1fr; } }
.detail-preview {
  background: repeating-conic-gradient(var(--surface-2) 0% 25%, transparent 0% 50%) 50% / 20px 20px;
  border-radius: 18px; border: 1px solid var(--border); overflow: hidden;
  display: flex; align-items: center; justify-content: center; max-height: 78vh;
}
.detail-preview img { max-width: 100%; max-height: 78vh; object-fit: contain; display: block; }
.detail-info {
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  padding: 28px; display: flex; flex-direction: column; gap: 18px; height: fit-content;
  box-shadow: var(--shadow);
}
.detail-info h1 { font-size: 1.65rem; font-weight: 800; letter-spacing: -0.02em; }
.specs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; font-size: 0.9rem; }
.spec-box { background: var(--surface-2); padding: 12px 14px; border-radius: 12px; }
.spec-box span { display: block; font-size: 0.75rem; color: var(--text-muted); margin-bottom: 2px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-size: 0.8rem; padding: 5px 12px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border);
}

/* Lightbox */
.modal {
  display: none; position: fixed; inset: 0; z-index: 100;
  background: rgba(5, 5, 10, 0.94); backdrop-filter: blur(8px);
  align-items: center; justify-content: center; padding: 20px;
}
.modal.open { display: flex; }
.modal img { max-width: 95vw; max-height: 92vh; object-fit: contain; border-radius: 10px; }
.modal-close {
  position: absolute; top: 20px; right: 24px; font-size: 2.2rem; color: #fff;
  background: none; border: none; cursor: pointer;
}

/* Footer */
footer {
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 48px 0 28px; margin-top: 24px;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 32px;
}
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-col h4 { font-size: 0.95rem; font-weight: 700; margin-bottom: 12px; }
.footer-col p, .footer-col a {
  display: block; color: var(--text-muted); font-size: 0.88rem; margin-bottom: 8px;
}
.footer-col a:hover { color: var(--accent-2); }
.footer-bottom {
  border-top: 1px solid var(--border); padding-top: 20px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  color: var(--text-muted); font-size: 0.85rem;
}
/* KIRA Images V4 — Approved Redesign (homepage-design.png) */
:root,[data-theme=dark]{
  --bg:#0b0e1a;
  --surface:#141829;
  --surface-2:#1c2238;
  --border:rgba(148,163,218,.16);
  --text:#f8fafc;
  --text-muted:#9ca8c7;
  --accent:#7c5cff;
  --accent-hover:#6a48f5;
  --grad:linear-gradient(135deg,#7c5cff,#5b46e8);
}
[data-theme=light]{
  --bg:#f4f6fb;
  --surface:#ffffff;
  --surface-2:#eef1f8;
  --border:rgba(30,41,59,.12);
  --text:#0f172a;
  --text-muted:#475569;
  --accent:#6540e0;
  --accent-hover:#5532cc;
  --grad:linear-gradient(135deg,#6f4cf0,#4f46e5);
}
body{
  font-family:Inter,"Segoe UI Variable","Segoe UI",system-ui,sans-serif;
  background:var(--bg);
  color:var(--text);
}
.header,.site-header,header{
  background:color-mix(in srgb,var(--bg) 90%,transparent);
  backdrop-filter:blur(12px);
  border-bottom:1px solid var(--border);
}
.logo-accent{background:none;-webkit-text-fill-color:currentColor;color:var(--text);font-weight:800}
.nav .btn-primary,.cat-pill.active,.btn-primary{
  background:var(--grad);
  color:#fff;
  border:none;
  border-radius:10px;
  box-shadow:0 4px 16px rgba(124,92,255,.28);
}
.hero-banner{
  margin:14px auto 0;
  width:96%;
  max-width:1360px;
  min-height:clamp(260px,26vw,380px);
  border-radius:22px;
  justify-content:flex-start;
  text-align:left;
  padding:clamp(26px,4.5vw,68px);
  overflow:hidden;
  border:1px solid rgba(255,255,255,.12);
}
.hero-bg{opacity:1;transform:none;filter:none;object-position:center center}
.hero-overlay{background:linear-gradient(90deg,rgba(8,14,28,.82) 0%,rgba(10,18,34,.45) 48%,rgba(10,18,34,.08) 100%)}
.hero-content h1{
  font-family:inherit;
  font-weight:800;
  letter-spacing:-.04em;
  font-size:clamp(34px,4.6vw,64px);
  line-height:1.05;
  color:#fff;
  margin-bottom:16px;
}
.hero-content p{margin:0 0 18px;color:rgba(255,255,255,.9);max-width:520px}
.search-bar{
  background:#ffffff;
  max-width:520px;
  margin:0;
  border-radius:14px;
  padding:9px 16px;
  gap:12px;
  box-shadow:0 10px 30px rgba(0,0,0,.28);
}
.search-bar svg{flex:none;color:#6c5ce7}
.search-bar input,.search-bar input::placeholder{color:#334155;min-width:0;font-size:15px}
.collection-title{font-size:clamp(22px,2.4vw,32px);font-weight:800;letter-spacing:-.03em;margin:28px 0 14px}

/* Folder cards — folder-tab silhouette */
.folder-section{margin:20px 0 28px}
.folder-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:16px}
.folder-card{
  position:relative;
  overflow:hidden;
  aspect-ratio:16/10.5;
  border:1px solid rgba(148,163,218,.26);
  border-radius:16px;
  background:var(--surface);
  color:#fff;
  cursor:pointer;
  padding:0;
  text-align:left;
  transition:transform .2s ease,border-color .2s ease,box-shadow .2s ease;
}
.folder-card:hover{
  transform:translateY(-3px);
  border-color:rgba(124,92,255,.7);
  box-shadow:0 12px 28px rgba(0,0,0,.35);
}
.folder-card img{width:100%;height:100%;object-fit:cover;display:block;transition:transform .28s ease}
.folder-card:hover img{transform:scale(1.05)}
.folder-empty{display:grid;place-items:center;height:100%;font-size:2.6rem;background:linear-gradient(145deg,#181f38,#111629)}
.folder-label{
  position:absolute;
  bottom:0;left:0;right:0;
  padding:32px 14px 12px;
  background:linear-gradient(to top,rgba(8,11,22,.94) 0%,rgba(8,11,22,.68) 58%,transparent 100%);
  font-weight:700;
  font-size:1.02rem;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}
.folder-label::after{content:"›";font-size:1.25rem;opacity:.85}
#folderBreadcrumb{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:14px;align-items:center}
#loadMore{display:block;margin:24px auto}
#loadMore[hidden]{display:none}

/* Cards, download panel & age dialog */
.m-card{border-radius:14px;overflow:hidden;box-shadow:none;border:1px solid var(--border);background:var(--surface)}
.m-card:focus-within .m-overlay{opacity:1}
.m-thumb,.detail-preview{background:var(--surface-2)}
.detail-preview.transparent,.m-thumb.transparent{background:repeating-conic-gradient(#b8bdc9 0% 25%,#e3e5eb 0% 50%) 50% / 20px 20px}
.detail-info{overflow-wrap:anywhere}.detail-wrap{grid-template-columns:minmax(0,1.5fr) minmax(0,1fr)}
.download-panel{padding:14px;background:var(--surface-2);border:1px solid var(--border);border-radius:14px;margin-top:14px}
.download-panel[hidden]{display:none}
.download-heading{display:flex;align-items:center;justify-content:space-between;gap:8px}
#downloadChoices{display:grid;gap:6px;margin:10px 0}
.download-panel input{width:100%;max-width:180px;padding:8px;border:1px solid var(--border);border-radius:8px;background:var(--surface);color:var(--text)}
#customDimensions{display:block;margin:8px 0}
.mini-related{display:flex;gap:8px;overflow-x:auto;margin-top:8px;padding-bottom:5px}
.mini-related .m-card{flex:0 0 74px;margin:0}
.mini-related img{width:74px;height:64px;object-fit:cover}
.age-dialog{max-width:min(90vw,450px);border:1px solid rgba(124,92,255,.45);border-radius:16px;padding:24px;background:#141a30;color:#fff}
.age-dialog::backdrop{background:rgba(6,9,20,.88)}
.age-dialog button{margin:6px}
:focus-visible,.folder-card:focus-visible{outline:3px solid #a594ff;outline-offset:2px}
@media(hover:none){.m-overlay{opacity:1}}
@media(max-width:920px){.detail-wrap{grid-template-columns:minmax(0,1fr)}}
@media(max-width:600px){
  .hero-banner{width:94%;min-height:250px;margin-top:10px;padding:22px 16px;border-radius:18px}
  .hero-bg{object-position:68% center}
  .hero-content h1{font-size:32px}
  .folder-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .folder-label{font-size:.86rem;padding:22px 10px 10px}
  .nav{flex-wrap:wrap;height:auto;min-height:60px;gap:8px;padding:8px 0}
  .detail-info{min-width:0;padding:18px}.detail-wrap{gap:12px;padding:18px 0 32px}
  .container{width:94%}.filters,.filter-group{flex-wrap:wrap}
  .masonry{column-count:2;column-gap:9px}.m-card{margin-bottom:9px}
  .download-panel:not([hidden]){position:fixed;z-index:100;bottom:0;left:0;right:0;max-height:75vh;overflow:auto;box-shadow:0 -8px 40px #0006;border-radius:18px 18px 0 0;padding:16px}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
