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

body {
  margin: 0;
  font-family: monospace;
  background: #f8f8f8;
  color: #222;
}

/* ---- Nav ---- */
nav {
  font-family: monospace;
  font-size: 0.85em;
  padding: 12px 20px;
  border-bottom: 1px solid #e0e0e0;
}
nav a { color: inherit; text-decoration: none; }
nav a:hover { text-decoration: underline; }

/* ---- Layout ---- */
main {
  max-width: 860px;
  margin: auto;
  padding: 40px 24px 80px;
}

h1 { font-size: 1.6rem; margin: 0 0 8px; }
h2 { font-size: 1rem; margin: 0 0 6px; color: #222; }
p  { margin: 0 0 12px; font-size: 0.85rem; color: #aaa; line-height: 1.5; }
.intro { margin: 8px 0 32px; }

.section {
  margin-top: 56px;
  padding: 28px 24px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
}

/* ---- Filter grid ---- */
.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.filter-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  overflow: hidden;
}

/* The "image" block — colored gradient div */
.filter-block {
  width: 100%;
  height: 160px;
  transition: filter 0.4s ease;
  cursor: pointer;
}

/* Hover: remove the filter to show "before" */
.filter-card:hover .filter-block {
  filter: none !important;
}

/* Individual gradient backgrounds */
.blur-demo {
  background: linear-gradient(135deg, #e84393 0%, #00c8ff 50%, #ffd700 100%);
  filter: blur(8px);
}

.brightness-demo {
  background: linear-gradient(135deg, #ff6b6b 0%, #ffd700 50%, #98ff98 100%);
  filter: brightness(0.3);
}

.contrast-demo {
  background: linear-gradient(135deg, #aaa 0%, #fff 50%, #222 100%);
  filter: contrast(3);
}

.hue-rotate-demo {
  background: linear-gradient(135deg, #e84393 0%, #00c8ff 50%, #ffd700 100%);
  filter: hue-rotate(180deg);
}

.drop-shadow-demo {
  background: linear-gradient(135deg, #222 0%, #555 100%);
  filter: drop-shadow(8px 8px 0 #e84393);
  margin: 16px;
  height: 128px;
  border-radius: 4px;
  width: calc(100% - 32px);
}
/* Override hover specifically — show drop shadow on hover */
.filter-card:hover .drop-shadow-demo {
  filter: drop-shadow(2px 2px 0 #aaa) !important;
}

.combo-demo {
  background: linear-gradient(135deg, #6b9de8 0%, #e8a84e 50%, #7be873 100%);
  filter: contrast(1.4) saturate(1.6) hue-rotate(30deg);
}

/* Info row */
.filter-info {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-name {
  font-size: 0.85rem;
  font-weight: bold;
  color: #222;
}

.filter-info code {
  font-size: 0.72rem;
  color: #aaa;
  word-break: break-word;
}

/* Hover hint */
.filter-card:hover .filter-name::after {
  content: ' (off)';
  color: #aaa;
  font-weight: normal;
}

/* ---- backdrop-filter demo ---- */
.backdrop-demo {
  position: relative;
  height: 180px;
  border-radius: 6px;
  overflow: hidden;
  margin-top: 16px;
}

.backdrop-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 50%, #e84393 0%, transparent 45%),
    radial-gradient(circle at 70% 30%, #00c8ff 0%, transparent 45%),
    radial-gradient(circle at 60% 80%, #ffd700 0%, transparent 40%),
    #111;
}

.backdrop-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70%;
  padding: 16px 20px;
  border-radius: 6px;
  -webkit-backdrop-filter: blur(12px) brightness(1.1);
  backdrop-filter: blur(12px) brightness(1.1);
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  font-size: 0.78rem;
  line-height: 1.6;
  text-align: center;
}

.backdrop-panel p { margin: 4px 0; color: #fff; font-size: 0.78rem; }
