/* =====================================================
   PostMeld Design – styles.css
   Dark theme · CSS Grid layout · Widget demo styles
   ===================================================== */

/* ---- Design tokens ---- */
:root {
  --bg:             #0a0a0a;
  --surface-1:      #111111;
  --surface-2:      #1a1a1a;
  --surface-3:      #242424;
  --border:         rgba(255, 255, 255, 0.08);
  --text-primary:   #f0f0f0;
  --text-secondary: #a0a0a0;
  --text-muted:     #555;
  --accent:         #7c3aed;
  --accent-2:       #06b6d4;
  --accent-glow:    rgba(124, 58, 237, 0.35);
  --font:           'Space Grotesk', -apple-system, BlinkMacSystemFont,
                    'Segoe UI', Roboto, sans-serif;
  --header-h:       64px;
  --section-gap:    6rem;
  --card-radius:    14px;
}

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

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) var(--surface-2);
}

body {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

img, svg { display: block; max-width: 100%; }
ul[role="list"] { list-style: none; }

/* =====================================================
   HEADER / NAV
   ===================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-nav {
  max-width: 1200px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #fff 0%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

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

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--text-primary);
}

/* =====================================================
   HERO
   ===================================================== */

.hero {
  position: relative;
  min-height: calc(100svh - var(--header-h));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.5rem;
  overflow: hidden;
  text-align: center;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(124, 58, 237, 0.25) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(6, 182, 212, 0.12) 0%, transparent 60%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
  animation: heroFadeUp 0.8s ease both;
}

@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 1rem;
}

.hero-title {
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #fff 30%, var(--accent-2) 70%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1.25rem;
}

.hero-tagline {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--text-secondary);
  max-width: 540px;
  margin: 0 auto 2.5rem;
}

.cta-btn {
  display: inline-block;
  padding: 0.85rem 2rem;
  border-radius: 50px;
  background: linear-gradient(135deg, var(--accent), #4f46e5);
  color: #fff;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 24px rgba(124, 58, 237, 0.4);
}

.cta-btn:hover,
.cta-btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(124, 58, 237, 0.55);
  outline: none;
}

/* =====================================================
   SHARED SECTION LAYOUT
   ===================================================== */

.catalog-section,
.about-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--section-gap) 1.5rem;
}

.catalog-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* =====================================================
   FILTER BAR
   ===================================================== */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 2.5rem;
}

.filter-chip {
  padding: 0.45rem 1.1rem;
  border-radius: 50px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.filter-chip:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.filter-chip:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.filter-chip.active,
.filter-chip[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 14px var(--accent-glow);
}

/* =====================================================
   WIDGET GRID
   ===================================================== */

.widget-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

/* ---- Widget Card ---- */

.widget-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.widget-card:hover {
  transform: translateY(-3px);
  border-color: rgba(124, 58, 237, 0.4);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.widget-card.hidden {
  display: none;
}

.widget-demo {
  flex: 1;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  background: var(--surface-2);
}

.widget-meta {
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-top: 1px solid var(--border);
}

.widget-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.widget-tag {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--accent-2);
  white-space: nowrap;
}

.no-results {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
  font-size: 1rem;
}

/* =====================================================
   WIDGET DEMOS
   ===================================================== */

/* ---- 1: Gradient Button ---- */

.demo-btn-gradient {
  padding: 0.7rem 1.8rem;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #7c3aed, #06b6d4);
  background-size: 200% 200%;
  background-position: left center;
  color: #fff;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-position 0.4s ease, transform 0.2s;
}

.demo-btn-gradient:hover {
  background-position: right center;
  transform: scale(1.04);
}

/* ---- 2: Neon Glow Button ---- */

.demo-btn-neon {
  padding: 0.7rem 1.8rem;
  border-radius: 8px;
  background: transparent;
  color: #0ff;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid #0ff;
  text-shadow: 0 0 8px #0ff;
  box-shadow: 0 0 12px rgba(0, 255, 255, 0.3), inset 0 0 12px rgba(0, 255, 255, 0.05);
  transition: box-shadow 0.25s, text-shadow 0.25s;
  letter-spacing: 0.05em;
}

.demo-btn-neon:hover {
  box-shadow: 0 0 24px rgba(0, 255, 255, 0.6), 0 0 48px rgba(0, 255, 255, 0.2),
    inset 0 0 24px rgba(0, 255, 255, 0.1);
  text-shadow: 0 0 16px #0ff;
}

/* ---- 3: Ripple Button ---- */

.demo-btn-ripple {
  position: relative;
  overflow: hidden;
  padding: 0.7rem 1.8rem;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.demo-btn-ripple:hover {
  background: #6d28d9;
}

.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transform: scale(0);
  animation: rippleAnim 0.55s linear;
  pointer-events: none;
}

@keyframes rippleAnim {
  to { transform: scale(4); opacity: 0; }
}

/* ---- 4: Floating Label Input ---- */

.demo-float-wrap {
  position: relative;
  width: 200px;
}

.demo-float-input {
  width: 100%;
  padding: 1.1rem 0.9rem 0.35rem;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: var(--surface-3);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.demo-float-input:focus {
  border-color: var(--accent);
}

.demo-float-label {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.95rem;
  color: var(--text-muted);
  pointer-events: none;
  transition: top 0.2s, font-size 0.2s, color 0.2s, transform 0.2s;
}

.demo-float-input:focus + .demo-float-label,
.demo-float-input:not(:placeholder-shown) + .demo-float-label {
  top: 0.45rem;
  transform: none;
  font-size: 0.72rem;
  color: var(--accent-2);
}

/* ---- 5: Animated Underline Input ---- */

.demo-underline-wrap {
  position: relative;
  width: 200px;
}

.demo-underline-input {
  width: 100%;
  padding: 0.5rem 0;
  border: none;
  border-bottom: 2px solid rgba(255, 255, 255, 0.15);
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 1rem;
  outline: none;
}

.demo-underline-bar {
  display: block;
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.3s ease;
}

.demo-underline-input:focus ~ .demo-underline-bar {
  width: 100%;
}

/* ---- 6: Loading Spinner ---- */

.demo-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(124, 58, 237, 0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---- 7: Pulse Dot ---- */

.demo-pulse {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #22c55e;
  position: relative;
}

.demo-pulse::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.35);
  animation: pulse 1.4s ease-out infinite;
}

@keyframes pulse {
  0%   { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(2);   opacity: 0; }
}

/* ---- 8: Bouncing Dots ---- */

.demo-bounce-dots {
  display: flex;
  gap: 8px;
  align-items: center;
}

.demo-bounce-dots span {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-2);
  animation: bounce 1s ease-in-out infinite both;
}

.demo-bounce-dots span:nth-child(1) { animation-delay: 0s; }
.demo-bounce-dots span:nth-child(2) { animation-delay: 0.16s; }
.demo-bounce-dots span:nth-child(3) { animation-delay: 0.32s; }

@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40%           { transform: translateY(-16px); }
}

/* ---- 9: Gradient Text Title ---- */

.demo-gradient-title {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #7c3aed, #06b6d4, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% auto;
  animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
  0%   { background-position: 0% center; }
  50%  { background-position: 100% center; }
  100% { background-position: 0% center; }
}

/* ---- 10: Typewriter Title ---- */

.demo-typewriter {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent-2);
  font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid var(--accent-2);
  width: 0;
/* steps() count must match the character length of the text in the HTML (13 = "Hello, World!") */
  animation:
    typing 2.5s steps(13, end) infinite alternate,
    blink  0.7s step-end infinite;
}

@keyframes typing {
  from { width: 0; }
  to   { width: 13ch; }
}

@keyframes blink {
  from, to { border-color: transparent; }
  50%      { border-color: var(--accent-2); }
}

/* ---- 11: Horizontal Scroll Snap ---- */

.demo-hscroll {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  padding-bottom: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}

.demo-hscroll::-webkit-scrollbar { height: 4px; }
.demo-hscroll::-webkit-scrollbar-track { background: transparent; }
.demo-hscroll::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 4px; }

.demo-hscroll-item {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  scroll-snap-align: start;
}

/* ---- 12: Custom Scrollbar ---- */

.demo-custom-scrollbar {
  height: 120px;
  overflow-y: auto;
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) var(--surface-3);
}

.demo-custom-scrollbar::-webkit-scrollbar { width: 6px; }
.demo-custom-scrollbar::-webkit-scrollbar-track { background: var(--surface-3); border-radius: 3px; }
.demo-custom-scrollbar::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }
.demo-custom-scrollbar::-webkit-scrollbar-thumb:hover { background: #6d28d9; }

.demo-custom-scrollbar p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border);
}

/* ---- 13: Glass Card ---- */

.demo-dark-bg {
  background: linear-gradient(135deg, #1a0533, #0c1a33);
}

.demo-glass-card {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  width: 200px;
}

.demo-glass-card h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: #fff;
}

.demo-glass-card p {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.4;
}

.demo-glass-card code {
  font-family: ui-monospace, monospace;
  font-size: 0.75em;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
}

/* ---- 14: Neumorphic Card ---- */

.demo-neu-bg {
  background: #1e1e2e;
}

.demo-neu-card {
  background: #1e1e2e;
  border-radius: 16px;
  padding: 1.5rem 2rem;
  box-shadow:
    6px  6px 12px rgba(0, 0, 0, 0.45),
    -6px -6px 12px rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.demo-neu-icon {
  font-size: 1.8rem;
  color: var(--accent-2);
}

.demo-neu-card p {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* =====================================================
   ABOUT SECTION
   ===================================================== */

.about-section {
  border-top: 1px solid var(--border);
  text-align: center;
}

.about-content {
  max-width: 600px;
  margin: 0 auto;
}

.about-section h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.about-section p {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

/* =====================================================
   SITE FOOTER
   ===================================================== */

.site-footer {
  text-align: center;
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 600px) {
  .nav-links {
    gap: 1rem;
  }

  .nav-links a {
    font-size: 0.8rem;
  }

  .widget-grid {
    grid-template-columns: 1fr;
  }

  .filter-chip {
    font-size: 0.8rem;
    padding: 0.4rem 0.9rem;
  }
}

@media (min-width: 601px) and (max-width: 900px) {
  .widget-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1200px) {
  .widget-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
