/* What every page but the editor shares, on top of app.css (build_nav.py writes the markup, js/site.js runs it):
   the menu along the top, and the feature cards (the home page's grid and the "more to make" strip on the others). */

/* ---------------------------------------------------------------- the menu along the top */

/* on a computer: a row of pills in the header, between the logo and the language button */
.site-nav {
  position: relative; display: flex; align-items: center; gap: 2px; flex: none; padding: 4px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.5); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.9);
}
.sn {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px 6px 10px; border-radius: 999px; color: var(--ink);
  font-size: 14.5px; line-height: 1.35; white-space: nowrap; text-decoration: none; transition: background 0.12s, box-shadow 0.12s;
}
.sn .mi { width: 19px; height: 19px; color: var(--sn, var(--deep)); }   /* each page's colour, as in the editor's ⋯ menu */
.sn[data-nav="cards"] { --sn: #e0699a; }
.sn[data-nav="wallpapers"] { --sn: #7a68d6; }
.sn[data-nav="paperdog"] { --sn: #2f9a68; }
.sn[data-nav="about"] { --sn: var(--muted); }
.sn:hover { background: rgba(255, 255, 255, 0.92); }
.sn[aria-current="page"] { position: relative; z-index: 0; color: var(--deep); }
.sn[aria-current="page"], .sn[aria-current="page"]:hover { background: none; box-shadow: none; }
.sn-ink {   /* this page's pill: its own element under the icon and words */
  position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: #fff; box-shadow: 0 0 0 1.5px var(--sky-2), 0 3px 10px rgba(44, 132, 198, 0.16);
}

/* narrower: its own row under the logo, scrolling sideways if it has to (site.js starts it at this page's item) */
@media (max-width: 960px) {
  .site-nav {
    order: 3; flex: 1 0 100%; gap: 6px; margin: 2px -16px 0; padding: 4px 16px 9px; border-radius: 0; background: none; box-shadow: none;
    overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
    -webkit-mask: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent);
    mask: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent);
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .sn { flex: none; padding: 5px 12px 5px 9px; background: rgba(255, 255, 255, 0.62); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.9); }
}
@media (max-width: 600px) {
  .sn { font-size: 14px; }
  .sn .mi { width: 17px; height: 17px; }
}

/* ---------------------------------------------------------------- the feature cards */

.ft-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; margin-top: 34px; text-align: left; }
.ft {
  position: relative; display: flex; flex-direction: column; min-width: 0; border-radius: 26px; background: #fff; color: var(--ink);
  text-decoration: none; box-shadow: 0 0 0 2px var(--sky-2), 0 12px 30px rgba(44, 132, 198, 0.14);
  transition: transform 0.3s cubic-bezier(0.3, 1.5, 0.5, 1), box-shadow 0.2s;
}
.ft:hover, .ft:focus-visible { transform: translateY(-4px); box-shadow: 0 0 0 2px var(--blue), 0 18px 40px rgba(44, 132, 198, 0.24); }

/* its picture: the site's dotted sky with a glow in the feature's colour, and its things fanned out on it like the
   link previews. Items are placed in cqh (build_nav.item), so they keep their arrangement in a wider picture. */
.ft-stage {
  position: relative; display: block; aspect-ratio: 4 / 3; margin: 10px 10px 0; border-radius: 18px; overflow: hidden;
  container-type: size;
  background:
    radial-gradient(circle at 12px 12px, rgba(255, 255, 255, 0.75) 2px, transparent 2.6px) 0 0 / 26px 26px,
    radial-gradient(70% 75% at 58% 42%, var(--glow, #ffd0df), transparent 72%),
    linear-gradient(180deg, #c4e7fc, #eaf7ff 85%);
}
.ft-it {
  position: absolute; left: calc(50% + var(--x) * var(--spread, 1) * 1cqh); top: calc(var(--y) * 1cqh); height: calc(var(--h) * 1cqh);
  transform: translateX(-50%) rotate(calc(var(--r) * var(--turn, 1)));
  transition: left 0.4s cubic-bezier(0.3, 1.4, 0.5, 1), transform 0.4s cubic-bezier(0.3, 1.4, 0.5, 1);
}
.ft:hover .ft-stage, .ft:focus-visible .ft-stage { --spread: 1.1; --turn: 1.4; }   /* they fan out a little more */
.ft-it img { display: block; }
.ft-it .tape { top: -2.6cqh; width: 46%; height: 5.6cqh; margin-left: -23%; }
.ft-cloud { position: absolute; z-index: 2; height: auto; pointer-events: none; }
.ft-cloud.a { left: -7%; bottom: -10%; width: 34%; }
.ft-cloud.b { right: -8%; bottom: -7%; width: 28%; opacity: 0.9; }

/* phones (the reel's frames; .tall: a wallpaper as a lock screen), cards (baked with their shadow), paper */
.ft-phone { aspect-ratio: 9 / 16; padding: 1.3cqh; border-radius: 5.4cqh; background: #fff; box-shadow: 0 1.6cqh 4cqh rgba(20, 70, 120, 0.26); }
.ft-phone.tall { aspect-ratio: 9 / 19.5; container-type: inline-size; }
.ft-phone > img { width: 100%; height: 100%; object-fit: cover; border-radius: 4.2cqh; background: var(--sky-1); }
.ft-phone.tall::before {   /* the camera pill */
  content: ""; position: absolute; z-index: 1; top: 4.6%; left: 50%; width: 27%; height: 3.4%; margin-left: -13.5%; border-radius: 99px; background: #1d2636;
}
.ft-lock {
  position: absolute; left: 0; right: 0; top: 11%; display: flex; flex-direction: column; align-items: center; line-height: 1.1;
  color: var(--clock, #fff); text-shadow: 0 1px 6px var(--clock-glow, rgba(30, 90, 150, 0.35)); pointer-events: none;
}
.ft-lock small { font-size: 5.6cqw; white-space: nowrap; }
.ft-lock b { font-weight: normal; font-size: 23cqw; line-height: 1.05; font-variant-numeric: tabular-nums; }
.ft-card img { height: 100%; width: auto; }
.ft-sheet { aspect-ratio: 339 / 480; border-radius: 0.8cqh; background: #fff; box-shadow: 0 1.2cqh 3cqh rgba(20, 70, 120, 0.2); }
.ft-sheet img { width: 100%; height: 100%; border-radius: 0.8cqh; }
.ft-polaroid {
  aspect-ratio: 0.8; padding: 2.8cqh 2.8cqh 10cqh; border-radius: 1.6cqh; background: #fff;
  box-shadow: 0 0 0 0.4cqh var(--sky-2), 0 1.8cqh 4.4cqh rgba(20, 70, 120, 0.26);
}
.ft-polaroid img { width: 100%; height: 100%; object-fit: cover; border-radius: 0.9cqh; }

/* in season (season.js puts it on <body>), a card that has pictures for it shows those instead of its usual ones */
.ft-set { display: contents; }
.ft-set:not([data-set="base"]), .ft-badge[data-set] { display: none; }
body[data-season="christmas"] .ft-stage[data-sets~="christmas"] .ft-set[data-set="base"],
body[data-season="halloween"] .ft-stage[data-sets~="halloween"] .ft-set[data-set="base"] { display: none; }
body[data-season="christmas"] .ft-set[data-set="christmas"],
body[data-season="halloween"] .ft-set[data-set="halloween"] { display: contents; }
body[data-season="christmas"] .ft-badge[data-set="christmas"] { display: inline-block; }

/* the words */
.ft-text { display: flex; flex-direction: column; gap: 5px; flex: 1; padding: 16px 20px 20px; }
.ft-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.ft-title { font-weight: normal; font-size: 21px; line-height: 1.35; color: var(--deep); }
.ft-badge { padding: 1px 9px; border-radius: 999px; font-size: 12px; line-height: 1.6; letter-spacing: 0.3px; }
.ft-badge.new { background: #ffe1ea; color: #c95c86; }
.ft-badge.xmas { background: #ffe4e4; color: #c63d4b; }
.ft-sub { flex: 1; font-size: 14.5px; line-height: 1.65; color: var(--muted); }
.ft-go { align-self: flex-start; margin-top: 6px; font-size: 15px; color: var(--deep); }
.ft-go::after {   /* app.css's drawn arrow, centred on the words */
  content: ""; display: inline-block; width: 1.15em; height: 1.15em; margin-left: 0.32em; vertical-align: -0.23em; background: currentColor;
  -webkit-mask: var(--ic-go) center / contain no-repeat; mask: var(--ic-go) center / contain no-repeat; transition: translate 0.15s;
}
.ft:hover .ft-go::after, .ft:focus-visible .ft-go::after { translate: 3px 0; }

/* the strip at the end of a page: the other features (build_nav.py), under a Cinnamoroll like the old "go" sections */
.ft-more { text-align: center; }
.ft-more-cinna { display: block; width: 150px; height: auto; margin: 0 auto 4px; filter: drop-shadow(0 10px 14px rgba(44, 132, 198, 0.22)); }
.ft-more .ft-grid:has(> .ft:nth-child(4)) { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }   /* About lists all four */
@media (max-width: 1080px) { .ft-more .ft-grid:has(> .ft:nth-child(4)) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* phones: one per row, the picture beside the words so the list stays short */
@media (max-width: 760px) {
  .ft-grid, .ft-more .ft-grid:has(> .ft:nth-child(4)) { grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 26px; }
  .ft:not(.featured) { flex-direction: row; border-radius: 22px; }
  .ft:not(.featured) .ft-stage { --spread: 0.82; flex: none; width: 40%; aspect-ratio: 1; margin: 8px 0 8px 8px; border-radius: 16px; }
  .ft:not(.featured):hover .ft-stage { --spread: 0.9; }
  .ft:not(.featured) .ft-text { gap: 3px; padding: 12px 14px 12px 14px; justify-content: center; }
  .ft:not(.featured) .ft-title { font-size: 17.5px; }
  .ft:not(.featured) .ft-sub { flex: none; font-size: 13.5px; line-height: 1.55; }
  .ft:not(.featured) .ft-go { margin-top: 4px; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .ft, .ft-it, .ft-go::after { transition: none; }
}
