/* Index page of the published examples, matching the S++ blog palette */

:root {
  --bg: #0e141b;
  --card: #151e28;
  --card-hover: #1a2532;
  --border: #263241;
  --text: #e6edf3;
  --muted: #9aa7b4;
  --accent: #4eb4da;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(60rem 30rem at 15% -10%, #4eb4da14, transparent 70%),
    var(--bg);
  color: var(--text);
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
    Georgia, serif;
  line-height: 1.6;
}

.wrap {
  width: 100%;
  max-width: 56rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* header.wrap and main.wrap, to win over the side padding of .wrap */
header.wrap {
  padding-top: 3.5rem;
  padding-bottom: 2.5rem;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--accent);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.subtitle {
  max-width: 38rem;
  margin: 1.2rem 0 0;
  color: var(--muted);
  font-size: 1.15rem;
}

main.wrap {
  flex: 1;
  padding-bottom: 4rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.25rem 1.35rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.card:hover {
  background: var(--card-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.card h2 {
  margin: 0 0 0.4rem;
  font-size: 1.2rem;
  font-weight: 500;
}

/* The whole card opens the notebook */
.card h2 a {
  color: var(--text);
  text-decoration: none;
}

.card h2 a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.card p {
  flex: 1;
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.card .links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}

.card .open {
  color: var(--accent);
  font-weight: 600;
}

/* Above the card-wide link, so it stays clickable on its own */
.card .source {
  position: relative;
  z-index: 1;
  color: var(--muted);
  text-decoration: none;
}

.card .source:hover {
  color: var(--text);
}

footer {
  padding: 1.5rem 0 2rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

footer a {
  color: var(--accent);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}
