:root {
  --maxw: 960px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial,
    sans-serif;
  line-height: 1.55;
  background: #0f1115;
  color: #eaeaea;
}

.controls {
  position: sticky;
  top: 0;
  z-index: 999;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  background: #161923cc;
  border-bottom: 1px solid #2a2f3a;
  backdrop-filter: blur(6px);
}

.controls label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.controls input[type="number"] {
  width: 6rem;
}

.controls button {
  cursor: pointer;
}

main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px;
}

section.section {
  border: 1px solid #2a2f3a;
  border-radius: 12px;
  padding: 16px;
  margin: 14px 0;
  background: #151922;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

/* The magic */
.use-cv section.section {
  content-visibility: auto;
  /* Reserve space to avoid layout jumps before first reveal */
  contain-intrinsic-size: auto 700px;
}

section.section h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

section.section p {
  margin: 0 0 12px;
  opacity: 0.9;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.card {
  height: 120px;
  border-radius: 10px;
  overflow: hidden;
  background: radial-gradient(120% 120% at 0% 0%, #263046, transparent 60%),
    radial-gradient(120% 120% at 100% 0%, #2a3a4a, transparent 60%),
    radial-gradient(120% 120% at 0% 100%, #28344a, transparent 60%),
    radial-gradient(120% 120% at 100% 100%, #2c2f45, transparent 60%),
    linear-gradient(135deg, #1c2230, #1a1f2b);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 2px 8px rgba(0, 0, 0, 0.35), 0 12px 28px rgba(0, 0, 0, 0.35);
  /* A little extra paint/compositing cost */
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.5));
}

.card .noise {
  display: block;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.035) 0 2px,
    transparent 2px 4px
  );
  mix-blend-mode: overlay;
  opacity: 0.7;
}

.hint {
  opacity: 0.75;
  font-size: 14px;
}

.spacer {
  height: 1px;
}
