@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=DM+Sans:wght@300;400;500&display=swap');

:root {
  --bg: #f4f1eb;
  --surface: #ffffff;
  --text: #1a1a1a;
  --muted: #888;
  --border: #e0dbd0;
  --box-original: #d0ccc2;
  --box-demo: #1a1a1a;
  --code-bg: #edeae2;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  min-height: 100vh;
}

/* HEADER */
header {
  padding: 64px 48px 48px;
  border-bottom: 1px solid var(--border);
}

header .label {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

header h1 {
  font-family: 'Space Mono', monospace;
  font-size: clamp(32px, 5vw, 64px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 12px;
}


/* GRID */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1px;
  background: var(--border);
  border-top: 1px solid var(--border);
}

/* CARD */
.card {
  background: var(--surface);
  display: flex;
  flex-direction: column;
}

.card.wide {
  grid-column: span 2;
}

/* DEMO AREA — perspective set here so 3D works */
.card-demo {
  height: 160px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 400px;
}

/* Scene wraps both boxes, also needs perspective-origin centred */
.scene {
  position: relative;
  width: 56px;
  height: 56px;
  transform-style: preserve-3d;
}

.box {
  width: 56px;
  height: 56px;
  position: absolute;
  top: 0;
  left: 0;
}

.box.original {
  border: 2px dashed var(--box-original);
  background: transparent;
}

.box.demo {
  background: var(--box-demo);
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* CARD INFO */
.card-info {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card-info h2 {
  font-family: 'Space Mono', monospace;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.card-info p {
  font-size: 14px;
  color: #555;
  line-height: 1.6;
}

.card-info em {
  font-style: italic;
  color: var(--muted);
}

.card-info code {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  background: var(--code-bg);
  padding: 8px 12px;
  display: block;
  color: var(--text);
  border-radius: 4px;
  margin-top: 4px;
  word-break: break-all;
}

/* RESPONSIVE */
@media (max-width: 720px) {
  header {
    padding: 40px 24px 32px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .card.wide {
    grid-column: span 1;
  }
}