/*
 * Fitrang public footer (footer.fr-foot). One footer for every public page: the home page, /install,
 * the blog, /food and /exercise. Its HTML comes from scripts/site_footer.py and links this file itself.
 *
 * Colours: the content pages (public/site.css) name their tokens --bg --fg --muted-fg, the Vite pages
 * (src/index.css) --background --foreground --muted-foreground; both flip for dark mode (prefers-color-scheme
 * on the content pages, html.dark on the home and install pages). The --fr-* tokens below read whichever
 * the page has, so the footer follows the page's theme with no extra rules.
 * Motion: transform, opacity, colour and background only; prefers-reduced-motion turns it all off.
 */
.fr-foot {
  --fr-bg: var(--bg, var(--background, #fdfdf7));
  --fr-fg: var(--fg, var(--foreground, #17132b));
  --fr-muted: var(--muted-fg, var(--muted-foreground, #5f5b78));
  --fr-card: var(--card, #ffffff);
  --fr-line: var(--border, #dedbeb);
  --fr-accent: var(--primary, #6d3bff);
  --fr-ring: var(--ring, #6d3bff);
  --fr-ease: cubic-bezier(.22, 1, .36, 1);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin-top: auto;
  padding: 3rem 0 calc(1.5rem + env(safe-area-inset-bottom));
  background: var(--fr-bg);
  background: linear-gradient(180deg, color-mix(in oklab, var(--fr-card) 70%, var(--fr-bg)), var(--fr-bg) 70%);
  color: var(--fr-muted);
  font-family: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: .9375rem;
  line-height: 1.5;
  text-align: left;
}
/* the top edge: a violet-to-acid hairline with a soft glow under it */
.fr-foot::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, #6d3bff 25%, #eaff2f 55%, #6d3bff 80%, transparent);
  opacity: .9;
}
.fr-foot::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: -9rem;
  left: 50%;
  width: min(60rem, 140%);
  height: 14rem;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, color-mix(in oklab, #6d3bff 22%, transparent), transparent);
  pointer-events: none;
}
.fr-foot *, .fr-foot *::before, .fr-foot *::after { box-sizing: border-box; }
.fr-foot p, .fr-foot ul, .fr-foot li { margin: 0; padding: 0; }
.fr-foot ul { list-style: none; }
.fr-foot li::marker { content: none; }
.fr-foot a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.fr-foot a:focus-visible, .fr-foot .fr-badge:focus-visible { outline: 2px solid var(--fr-ring); outline-offset: 3px; border-radius: 10px; }
.fr-foot svg { display: block; flex: none; }

.fr-in { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: 16px; }
@media (min-width: 640px) { .fr-in { padding-inline: 24px; } }

/* ---- layout: one column on phones, brand + app then links on tablets, three across on desktop ---- */
.fr-top { display: grid; gap: 2rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .fr-top { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .fr-cols { grid-column: 1 / -1; } }
@media (min-width: 1000px) { .fr-top { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1.6fr); gap: 2.5rem; } .fr-cols { grid-column: auto; } }

.fr-h { color: var(--fr-fg); font-weight: 800; font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: .5rem !important; }

/* brand */
.fr-logo { display: inline-flex; align-items: center; gap: .6rem; min-height: 44px; color: var(--fr-fg) !important; font-weight: 800; font-stretch: 90%; font-size: 1.6rem; letter-spacing: -.01em; }
.fr-logo img { display: block; width: 40px; height: 40px; border-radius: 10px; transition: transform .5s var(--fr-ease); }
.fr-logo:hover img { transform: rotate(-8deg) scale(1.06); }
.fr-tag { margin-top: .5rem !important; color: var(--fr-fg); font-weight: 700; font-stretch: 90%; font-size: 1.125rem; }
.fr-sub { margin-top: .35rem !important; max-width: 34ch; }

/* store-style badges */
.fr-badges { display: flex; flex-wrap: wrap; gap: .625rem; }
.fr-badge {
  display: inline-flex; align-items: center; gap: .6rem;
  min-height: 48px; padding: .4rem 1rem .4rem .8rem; border-radius: 12px;
  background: var(--fr-fg); color: var(--fr-bg) !important; border: 1px solid var(--fr-fg);
  box-shadow: 0 1px 0 rgb(0 0 0 / .04);
  transition: transform .25s var(--fr-ease), box-shadow .25s var(--fr-ease);
}
.fr-badge .fr-ico { width: 24px; height: 24px; }
.fr-badge-t { display: grid; line-height: 1.1; }
.fr-badge-t small { font-size: .6875rem; font-weight: 500; color: inherit; opacity: .8; }
.fr-badge-t b { font-size: 1rem; font-weight: 700; font-stretch: 95%; color: inherit; }
a.fr-badge:hover, a.fr-badge:focus-visible { transform: translateY(-2px); box-shadow: 0 12px 24px -12px color-mix(in oklab, var(--fr-accent) 70%, transparent); }
.fr-badge.is-soon { background: transparent; color: var(--fr-muted) !important; border: 1px dashed var(--fr-line); box-shadow: none; }

/* link columns */
.fr-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem 1rem; }
@media (min-width: 640px) { .fr-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.fr-cols a { display: inline-flex; align-items: center; min-height: 44px; color: var(--fr-muted); transition: color .2s; }
.fr-cols a span {
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat;
  padding-bottom: 2px;
  transition: background-size .3s var(--fr-ease);
}
.fr-cols a:hover, .fr-cols a:focus-visible { color: var(--fr-fg); }
.fr-cols a:hover span, .fr-cols a:focus-visible span { background-size: 100% 2px; }

/* follow row */
.fr-follow { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-top: 2.25rem; padding-top: 1.5rem; border-top: 1px solid var(--fr-line); }
.fr-follow .fr-h { margin-bottom: 0 !important; }
.fr-social { display: flex; flex-wrap: wrap; gap: .5rem; }
.fr-s {
  --brand: var(--fr-fg); --brand-fg: #ffffff;
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  color: var(--fr-fg) !important; background: var(--fr-card); border: 1px solid var(--fr-line);
  transition: transform .25s var(--fr-ease), background-color .25s, color .25s, border-color .25s, box-shadow .25s;
}
.fr-s .fr-ico { width: 20px; height: 20px; }
.fr-s:hover, .fr-s:focus-visible {
  transform: translateY(-3px);
  background: var(--brand); color: var(--brand-fg) !important; border-color: transparent;
  box-shadow: 0 10px 20px -10px var(--brand);
}
.fr-s:focus-visible { outline-offset: 3px; border-radius: 50%; }
.fr-s-instagram { --brand: #d6249f; }
.fr-s-instagram:hover, .fr-s-instagram:focus-visible { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }
.fr-s-facebook { --brand: #0866ff; }
.fr-s-youtube { --brand: #ff0000; }
.fr-s-x, .fr-s-threads { --brand: var(--fr-fg); --brand-fg: var(--fr-bg); }
.fr-s-bluesky { --brand: #1185fe; }
.fr-s-pinterest { --brand: #e60023; }

/* bottom bar */
.fr-bottom { display: grid; gap: .35rem; margin-top: 1.5rem; }
.fr-bottom p:first-child { color: var(--fr-fg); font-weight: 600; font-size: .875rem; }
.fr-fine { font-size: .8125rem; max-width: 80ch; }

@media (prefers-reduced-motion: reduce) {
  .fr-foot *, .fr-foot *::before, .fr-foot *::after { transition: none !important; animation: none !important; }
  .fr-s:hover, .fr-s:focus-visible, a.fr-badge:hover, a.fr-badge:focus-visible, .fr-logo:hover img { transform: none; }
}
@media print { .fr-foot { display: none !important; } }
