:root {
  --cove-night: #2f3f6e;
  --cove-glow: #fde7a6;
  --cove-card: #ffffff;
  --cove-cream: #fff6e0;
  --cove-dusk: #8a92e2;
  --cove-sky-top: #261a78;
  --cove-water: #058ca7;
  --cove-ink: #2b2d42;
  --cove-muted: #6b6f85;
  --cove-line: #e7e0d0;
  --tint-wall: #ece2dd;
  --cove-royal: #30258c;
  --font-brand: "Grandstander", system-ui, sans-serif;
  --font-display: "Grandstander", system-ui, sans-serif;
  --font-body: "Quicksand", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--cove-sky-top);
}

html.near-bottom {
  background: var(--cove-water);
}

body {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--cove-dusk) url("images/sky-texture.jpg") repeat;
  background-size: 900px;
  color: var(--cove-ink);
  font-family: var(--font-body);
  font-weight: 500;
  line-height: 1.5;
}

.site-header,
main {
  position: relative;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
}

main {
  z-index: 1;
  flex: 1;
}

.sky {
  position: absolute;
  inset: 0 0 auto 0;
  height: max(720px, calc(100vw * 2 / 3));
  background:
    linear-gradient(to bottom, transparent 30%, #4b47b8 52%, #7078d6 78%, var(--cove-dusk) 100%),
    url("images/sky.jpg") center top / cover no-repeat;
  background-blend-mode: color, normal;
  -webkit-mask-image: linear-gradient(to bottom, #000 82%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 82%, transparent 100%);
  pointer-events: none;
}

.sky::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("images/stars-sparkle.svg"), url("images/stars-mid.svg"), url("images/stars-tiny.svg");
  background-position: 60px 30px, 0 0, 0 0;
  -webkit-mask-image:
    radial-gradient(ellipse 300px 100px at calc(50% - 280px) 105px, transparent 55%, #000 100%),
    linear-gradient(to bottom, #000 25%, rgba(0, 0, 0, 0.5) 48%, transparent 72%);
  -webkit-mask-composite: source-in;
  mask-image:
    radial-gradient(ellipse 300px 100px at calc(50% - 280px) 105px, transparent 55%, #000 100%),
    linear-gradient(to bottom, #000 25%, rgba(0, 0, 0, 0.5) 48%, transparent 72%);
  mask-composite: intersect;
}

.sky::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 30%, rgba(40, 32, 120, 0.22) 62%, transparent 85%);
  mix-blend-mode: multiply;
}

.twinkle {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--cove-cream);
  clip-path: polygon(50% 0, 58% 42%, 100% 50%, 58% 58%, 50% 100%, 42% 58%, 0 50%, 42% 42%);
  animation: twinkle 5s ease-in-out infinite;
}

.twinkle:nth-child(odd) {
  width: 8px;
  height: 8px;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.25; transform: scale(0.7); }
  50% { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .twinkle {
    animation: none;
    opacity: 0.7;
  }
}

.cove {
  position: relative;
  height: calc(max(100vw, 700px) * 540 / 1536);
  margin-top: -40px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 12%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 12%);
}

.cove::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: min(0px, calc((100% - 700px) * 0.62));
  width: max(100%, 700px);
  height: 100%;
  background: url("images/cove.jpg") center bottom / 100% auto no-repeat;
}

.site-header {
  padding-top: 48px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  color: var(--cove-night);
  text-decoration: none;
}

.brand-logo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(255, 246, 224, 0.9), 0 0 28px rgba(255, 201, 74, 0.35);
}

.brand-name {
  color: var(--cove-cream);
  font-family: var(--font-brand);
  font-weight: 800;
  font-size: 48px;
  line-height: 1;
}

.tagline {
  margin: 12px 0 0;
  font-size: 20px;
  color: #dfe3fb;
}

.shelf {
  margin-top: 48px;
}

.shelf-intro {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
  margin: 0 0 18px;
}

.shelf-pill {
  margin: 0;
  padding: 3px 14px;
  border-radius: 999px;
  background: var(--cove-royal);
  color: var(--cove-cream);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.shelf-note {
  margin: 0;
  color: var(--cove-night);
  font-size: 17px;
}

.shelf-note a {
  color: var(--cove-royal);
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
}

.shelf-note a:hover {
  text-decoration: underline;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.feature {
  display: block;
  overflow: hidden;
  background: var(--cove-card);
  border: 1px solid var(--cove-line);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(35, 29, 110, 0.12);
  color: inherit;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.feature:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 34px rgba(35, 29, 110, 0.18);
}

.feature-art {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.feature-body {
  padding: 18px 22px 22px;
}

.feature-name {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  color: var(--cove-night);
}

.feature-text {
  margin: 4px 0 0;
  font-size: 18px;
  color: var(--cove-muted);
}

.feature-link {
  display: inline-block;
  margin-top: 10px;
  color: var(--cove-royal);
  font-weight: 700;
  font-size: 17px;
}

.badge {
  display: inline-block;
  padding: 2px 12px;
  border-radius: 999px;
  background: var(--cove-glow);
  color: var(--cove-night);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.shelf-crochet {
  padding: 28px;
  background: rgba(255, 255, 255, 0.3);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 24px;
  box-shadow: 0 10px 30px rgba(35, 29, 110, 0.12);
}

.tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.tile {
  display: flex;
  overflow: hidden;
  background: var(--cove-card);
  border-radius: 16px;
  color: inherit;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(47, 63, 110, 0.12);
}

.tile-art {
  display: flex;
  flex: 0 0 170px;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.tile-art img {
  max-width: 100%;
  max-height: 100%;
}

.tile-art.tile-scene {
  padding: 0;
  overflow: hidden;
}

.tile-art.tile-scene img {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
  object-position: 50% 70%;
}

.tint-wall {
  background: var(--tint-wall);
}

.tile-body {
  align-self: center;
  padding: 14px 18px 18px;
}

.tile-name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--cove-night);
}

.tile-text {
  margin: 4px 0 0;
  color: var(--cove-muted);
  font-size: 17px;
}

.tile-link {
  display: inline-block;
  margin-top: 8px;
  color: var(--cove-royal);
  font-weight: 700;
  font-size: 16px;
}

@media (max-width: 720px) {
  .brand-name {
    font-size: 36px;
  }

  .brand-logo {
    width: 56px;
    height: 56px;
  }

  .twinkle-wide {
    display: none;
  }

  .shelf-crochet {
    padding: 20px 16px;
  }

  .tiles {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .tile-art {
    flex-basis: 104px;
    padding: 12px;
  }

  .tile-art img {
    width: 80px;
  }
}
