:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --border: #e6e4ee;
  --text: #15131c;
  --muted: #5d5a6b;
  --accent: #6257e8;
  --tag-bg: #f1f0f6;
  --wip-bg: #fdf1dc;
  --wip-text: #8a5300;
  --hero-wash:
    radial-gradient(ellipse 60% 80% at 85% 10%, rgba(224, 85, 155, 0.22) 0%, transparent 70%),
    radial-gradient(ellipse 70% 90% at 10% 0%, rgba(98, 87, 232, 0.18) 0%, transparent 70%),
    linear-gradient(180deg, #f4f1fb 0%, #f8f2f8 100%);
  --card-shadow: 0 1px 2px rgba(21, 19, 28, 0.05), 0 4px 16px rgba(21, 19, 28, 0.04);
  --tile-base: #ffffff;
  --tile-mix: 14%;
  --tile-rim: rgba(21, 19, 28, 0.06);
  --icon-glow: 0;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0d14;
    --surface: #16151f;
    --border: #262433;
    --text: #f3f2f8;
    --muted: #a19eb2;
    --accent: #9d94ff;
    --tag-bg: #23212f;
    --wip-bg: #3a2c12;
    --wip-text: #f5c26b;
    --hero-wash:
      radial-gradient(ellipse 60% 80% at 85% 10%, rgba(224, 85, 155, 0.28) 0%, transparent 70%),
      radial-gradient(ellipse 70% 90% at 10% 0%, rgba(98, 87, 232, 0.30) 0%, transparent 70%),
      linear-gradient(180deg, #16132a 0%, #1a1222 100%);
    --card-shadow: none;
    --tile-base: #2b2a3a;
    --tile-mix: 30%;
    --tile-rim: rgba(255, 255, 255, 0.14);
    --icon-glow: 1;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Hero */

.hero {
  background: var(--hero-wash);
  clip-path: polygon(0 0, 100% 0, 100% 84%, 24% 100%, 0 92%);
  padding: 72px 16px 120px;
  overflow: hidden;
}

.hero-inner {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.hero-copy { max-width: 560px; }

.eyebrow {
  margin: 0 0 14px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.lede {
  margin: 20px 0 0;
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 460px;
}

.hero-art {
  flex: none;
  width: 380px;
  height: auto;
  margin-right: -20px;
}

/* Content */

.page {
  max-width: 1072px; /* 1040px of content, matching .hero-inner, plus side padding */
  margin: -40px auto 0;
  padding: 0 16px 48px;
  position: relative;
}

.section + .section { margin-top: 56px; }

.section-title {
  margin: 0 0 18px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-note {
  margin: -10px 0 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  /* Always two columns, so every card is the same width in every section. */
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

/* Cards in the same row match heights. */
.grid > li { display: flex; }
.grid > li > .card { flex: 1; }

.card {
  --app: var(--accent);
  --app-2: var(--accent);
  position: relative;
  display: flex;
  gap: 18px;
  align-items: flex-start;
  height: 100%;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

/* App-coloured top edge and corner wash, brought up on hover. */
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--app), var(--app-2));
  opacity: 0.55;
  transition: opacity 0.2s ease;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 80% at 0% 0%, color-mix(in srgb, var(--app) 10%, transparent), transparent 70%);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.card:hover,
.card:focus-visible {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--app) 45%, var(--border));
  box-shadow: 0 10px 30px color-mix(in srgb, var(--app) 18%, transparent);
}

.card:hover::before,
.card:focus-visible::before { opacity: 1; }
.card:hover::after,
.card:focus-visible::after { opacity: 1; }

.card:focus-visible { outline: 2px solid var(--app); outline-offset: 3px; }

/* Icon tile: gives every icon a lighter backing so dark-edged icons
   (like Rusty G6's) stand out on a dark page. */
.tile {
  flex: none;
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 20px;
  background: linear-gradient(145deg,
    color-mix(in srgb, var(--app) var(--tile-mix), var(--tile-base)),
    color-mix(in srgb, var(--app-2) calc(var(--tile-mix) * 0.6), var(--tile-base)));
  box-shadow:
    inset 0 0 0 1px var(--tile-rim),
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 6px 18px color-mix(in srgb, var(--app) calc(var(--icon-glow) * 30%), transparent);
}

.tile img {
  width: 52px;
  height: 52px;
  filter: drop-shadow(0 0 calc(var(--icon-glow) * 6px) color-mix(in srgb, var(--app) 55%, transparent));
}

.card-body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.card-title { font-weight: 600; font-size: 1.12rem; letter-spacing: -0.01em; }

.external { color: var(--muted); font-weight: 400; }

.card-text { color: var(--muted); font-size: 0.95rem; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }

.tags span {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--tag-bg);
  color: var(--muted);
  font-size: 0.75rem;
}

.tags .tag-wip {
  background: var(--wip-bg);
  color: var(--wip-text);
}

/* Support band */

.support {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 64px;
  padding: 28px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background:
    radial-gradient(ellipse 60% 120% at 100% 0%, rgba(224, 85, 155, 0.14), transparent 70%),
    radial-gradient(ellipse 60% 120% at 0% 100%, rgba(98, 87, 232, 0.12), transparent 70%),
    var(--surface);
  overflow: hidden;
}

.support h2 {
  margin: 0 0 6px;
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.support p { margin: 0; color: var(--muted); max-width: 560px; }

.support-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6257e8, #c43991);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 8px 22px rgba(98, 87, 232, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.support-btn:hover,
.support-btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(196, 57, 145, 0.35);
}

.support-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.footer {
  display: flex;
  gap: 8px;
  margin-top: 64px;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer a { color: var(--muted); }
.footer a:hover { color: var(--accent); }

@media (max-width: 760px) {
  .hero { padding: 48px 16px 96px; }
  .hero-art {
    position: absolute;
    right: -90px;
    top: 10px;
    width: 300px;
    opacity: 0.45;
  }
  .hero-inner { position: relative; }
  .hero-copy { position: relative; z-index: 1; }
  .grid { grid-template-columns: 1fr; }
  .support { flex-direction: column; align-items: flex-start; padding: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
  .card:hover { transform: none; }
}
