/* ═══════════════════════════════════════
   StyleAI — Premium Brand Design
   Dark theme + electric violet accent
   Glassmorphism + Bento Grid + Grain Texture
   ═══════════════════════════════════════ */

:root {
  --bg: #0a0a0f;
  --bg-card: rgba(22,22,38,0.7);
  --bg-card-hover: rgba(30,30,50,0.85);
  --accent: #7c3aed;
  --accent-glow: rgba(124,58,237,0.3);
  --accent-light: #a78bfa;
  --text: #e4e4ed;
  --text-dim: #9393a8;
  --text-bright: #fafafa;
  --border: rgba(255,255,255,0.06);
  --border-accent: rgba(124,58,237,0.25);
  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  max-width: 100vw;
}

/* ═══════════ GRAIN OVERLAY ═══════════ */
.s-grain {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.04;
}

/* ═══════════ HEADER ═══════════ */
.s-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  flex-wrap: wrap;
  gap: 12px;
}

.s-logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-bright);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.s-logo:hover { color: var(--accent-light); }

.s-nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.s-nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s;
}

.s-nav a:hover { color: var(--text-bright); }

.s-lang-switch {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.8rem;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.s-lang-switch:focus { outline: 2px solid var(--accent); }

/* ═══════════ HERO ═══════════ */
.s-hero {
  text-align: center;
  padding: 60px 24px 32px;
}

.s-hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--text-bright) 0%, var(--accent-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}

.s-subtitle {
  font-size: 1.1rem;
  color: var(--text-dim);
  max-width: 600px;
  margin: 0 auto;
}

/* ═══════════ BADGES ═══════════ */
.s-herobadges {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 0 24px 32px;
}

.s-badge {
  display: inline-block;
  padding: 6px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent-light);
  backdrop-filter: blur(10px);
}

/* ═══════════ SEARCH ═══════════ */
.s-hero-search {
  max-width: 640px;
  margin: 0 auto 48px;
  padding: 0 24px;
  position: relative;
}

.s-hero-search input {
  width: 100%;
  padding: 16px 24px;
  background: rgba(22,22,38,0.8);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  color: var(--text-bright);
  font-family: var(--font);
  font-size: 1rem;
  backdrop-filter: blur(20px);
  transition: all 0.3s;
}

.s-hero-search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 30px var(--accent-glow);
}

.s-hero-search input::placeholder {
  color: var(--text-dim);
}

.search-results {
  position: absolute;
  top: 100%;
  left: 24px;
  right: 24px;
  background: rgba(18,18,30,0.95);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-top: 8px;
  backdrop-filter: blur(30px);
  z-index: 50;
  max-height: 400px;
  overflow-y: auto;
  display: none;
}

.search-results.active { display: block; }

.search-results a {
  display: block;
  padding: 10px 16px;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  transition: background 0.15s;
}

.search-results a:hover { background: rgba(124,58,237,0.15); }

.search-results a span.cat-tag {
  font-size: 0.7rem;
  color: var(--accent-light);
  margin-left: 8px;
}

/* ═══════════ CATEGORY GRID (BENTO) ═══════════ */
.s-cat-grid {
  padding: 0 24px 48px;
}

.s-cat-grid h2, .s-featured h2 {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--text-bright);
}

.cat-grid-inner {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
}

.cat-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 28px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  backdrop-filter: blur(15px);
  transition: all 0.3s;
  text-align: center;
}

.cat-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}

.cat-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 4px;
}

.cat-count {
  font-size: 0.75rem;
  color: var(--accent-light);
  font-weight: 500;
}

/* ═══════════ STYLE GRID ═══════════ */
.s-featured {
  padding: 0 24px 64px;
}

.style-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  max-width: 1200px;
  margin: 0 auto;
}

.style-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  backdrop-filter: blur(10px);
  transition: all 0.25s;
}

.style-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(124,58,237,0.1);
}

.style-emoji {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.style-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 4px;
}

.style-cat, .style-era {
  font-size: 0.7rem;
  color: var(--text-dim);
}

/* ═══════════ INFO BAR ═══════════ */
.s-info-bar {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 24px;
  max-width: 800px;
  margin: 0 auto 24px;
  justify-content: center;
}

.s-info-bar span {
  font-size: 0.8rem;
  color: var(--text-dim);
  background: var(--bg-card);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

/* ═══════════ CONTENT (7 DIMENSIONS) ═══════════ */
.s-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px 64px;
}

.dim-section {
  margin-bottom: 36px;
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(15px);
  transition: border-color 0.3s;
}

.dim-section:hover {
  border-color: var(--border-accent);
}

.dim-section h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-light);
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}

.dim-section p {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.8;
}

/* Prompt box */
.prompt-box {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  color: var(--accent-light);
  word-break: break-word;
  line-height: 1.8;
}

/* Related styles grid */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.related-card {
  display: block;
  padding: 12px 14px;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  font-size: 0.85rem;
  transition: all 0.2s;
}

.related-card:hover {
  border-color: var(--accent);
  color: var(--accent-light);
}

/* ═══════════ CATEGORY LIST PAGE ═══════════ */
.cat-desc {
  text-align: center;
  color: var(--text-dim);
  padding: 0 24px 24px;
  font-size: 0.9rem;
}

.cat-list .style-card {
  text-align: center;
}

/* ═══════════ FOOTER ═══════════ */
.s-footer {
  text-align: center;
  padding: 40px 24px;
  border-top: 1px solid var(--border);
  margin-top: 48px;
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.footer-nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.8rem;
  transition: color 0.2s;
}

.footer-nav a:hover { color: var(--accent-light); }

.footer-copy {
  font-size: 0.7rem;
  color: var(--text-dim);
  opacity: 0.6;
}

/* ═══════════ RESPONSIVE ═══════════ */
@media (max-width: 768px) {
  .s-banner {
    padding: 12px 16px;
    justify-content: center;
    gap: 8px;
  }
  
  .s-nav {
    gap: 12px;
    justify-content: center;
  }
  
  .s-nav a { font-size: 0.8rem; }
  
  .s-hero { padding: 40px 16px 24px; }
  
  .cat-grid-inner {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  .style-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  .dim-section {
    padding: 20px;
    margin-bottom: 20px;
  }
  
  .s-herobadges {
    gap: 8px;
    padding: 0 16px 24px;
  }
  
  .s-badge { font-size: 0.7rem; padding: 4px 12px; }
}

@media (max-width: 480px) {
  .cat-grid-inner { grid-template-columns: 1fr 1fr; }
  .style-grid { grid-template-columns: 1fr 1fr; }
}

/* Homepage articles */
.hp-articles{max-width:800px;margin:48px auto 0;padding:0 24px;text-align:center}
.hp-article{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius-lg);padding:32px 28px;margin-bottom:20px;backdrop-filter:blur(15px);transition:border-color .3s}
.hp-article:hover{border-color:var(--border-accent)}
.hp-article h2{font-family:'Inter',sans-serif;font-size:1.15rem;font-weight:700;color:var(--text-bright);margin-bottom:14px;text-align:center}
.hp-article p{font-size:.88rem;color:var(--text);line-height:1.8;text-align:left;max-width:700px;margin:0 auto}
