/* ============================================================
   site-footer.css: the ONE footer, on every page
   ============================================================
   The home/adults footer (painted garden, wordmark, tagline, link row,
   EN|JP, social, legal line), written into every page by split-locales from
   SITE_FOOTER in scripts/site-facts.mjs. Moved here from styles.css
   (2026-11-01, scrapbook plan ruling 1) so the legal-shell pages (legal.css)
   carry it without loading styles.css.

   Self-contained on purpose: legal.css does not define styles.css's design
   tokens, so the values are literal (they are styles.css's token values) and
   everything is scoped under .section-footer so nothing leaks onto a page.
   split-locales stamps the <link> with this file's content hash: edit freely,
   regenerate, and the ?v= follows. */

.section-footer {
  position: relative;
  min-height: 480px;
  display: flex;
  align-items: flex-end;
  box-shadow: inset 0 60px 80px rgba(13, 26, 66, 0.55);
  overflow: hidden;
  color: rgba(255,255,255,0.85);
  /* The page's own type and line-height must not reshape the footer:
     legal.css sets body line-height 1.8, styles.css 1.6. */
  font-family: 'Nunito', 'M PLUS Rounded 1c', sans-serif;
  font-size: 1rem;
  line-height: 1.6;
}

/* Painted garden. A lazy <img> rather than a CSS background, so the 170 KB
   painting loads only when the footer comes near on every page, with or
   without the page's JavaScript. */
.section-footer .footer-garden {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.section-footer .footer-garden img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

/* Deep gradient overlay: darkens the bottom so text reads cleanly */
.section-footer .footer-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(10, 8, 28, 0.15) 0%,
    rgba(10, 8, 28, 0.65) 50%,
    rgba(10, 8, 28, 0.92) 100%
  );
  z-index: 1;
}

/* Star field above the overlay (the .star-field recipe from styles.css). */
.section-footer .footer-stars {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}
.section-footer .footer-stars::before,
.section-footer .footer-stars::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 10% 15%, rgba(255,255,255,0.50) 0%, transparent 100%),
    radial-gradient(1px 1px at 25% 40%, rgba(245,166,35,0.45) 0%, transparent 100%),
    radial-gradient(2px 2px at 40% 10%, rgba(255,255,255,0.35) 0%, transparent 100%),
    radial-gradient(1px 1px at 55% 65%, rgba(255,255,255,0.40) 0%, transparent 100%),
    radial-gradient(1px 1px at 68% 25%, rgba(245,166,35,0.35) 0%, transparent 100%),
    radial-gradient(2px 2px at 78% 50%, rgba(255,255,255,0.30) 0%, transparent 100%),
    radial-gradient(1px 1px at 85% 80%, rgba(245,166,35,0.40) 0%, transparent 100%),
    radial-gradient(1px 1px at 92% 35%, rgba(255,255,255,0.45) 0%, transparent 100%),
    radial-gradient(1px 1px at 15% 75%, rgba(255,255,255,0.30) 0%, transparent 100%),
    radial-gradient(2px 2px at 48% 85%, rgba(245,166,35,0.25) 0%, transparent 100%);
}
.section-footer .footer-stars::after {
  background-image:
    radial-gradient(1px 1px at 5%  55%, rgba(255,255,255,0.25) 0%, transparent 100%),
    radial-gradient(1px 1px at 32% 20%, rgba(245,166,35,0.30) 0%, transparent 100%),
    radial-gradient(1px 1px at 60% 45%, rgba(255,255,255,0.35) 0%, transparent 100%),
    radial-gradient(2px 2px at 75% 15%, rgba(255,255,255,0.20) 0%, transparent 100%),
    radial-gradient(1px 1px at 90% 70%, rgba(245,166,35,0.35) 0%, transparent 100%);
}

/* All content sits above the layers */
.section-footer .footer-content {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 128px 80px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 24px;
}

.section-footer .footer-logo {
  display: inline-block;
  text-decoration: none;
}
.section-footer .footer-logo-img {
  height: 42px;
  width: auto;
  display: block;
}
/* Gold wordmark: glows on hover. */
.section-footer .footer-logo-img--gold {
  filter: drop-shadow(0 0 32px rgba(245,166,35,0.35));
  transition: filter 200ms cubic-bezier(0.23, 1, 0.32, 1), transform 200ms cubic-bezier(0.23, 1, 0.32, 1);
}
.section-footer .footer-logo:hover .footer-logo-img--gold {
  filter: drop-shadow(0 0 48px rgba(245,166,35,0.55));
  transform: scale(1.03);
}

.section-footer .footer-tagline {
  font-size: 1.25rem;
  text-wrap: balance;
  color: rgba(255,255,255,0.65);
  margin: 0;
}

/* Link rows. SITE_FOOTER groups the links into deliberate rows and a dot sits
   only BETWEEN two links of a row, so no row starts or ends with one. Each
   link + its dot is one unbreakable item; the dot hangs out of flow in the
   gap, so every row centres on its words. */
.section-footer .footer-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.section-footer .footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px 24px;
}
.section-footer .footer-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
.section-footer .footer-link {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  transition: color 200ms cubic-bezier(0.25, 0.1, 0.25, 1);
  /* Tap target: 32px tall (fills the 12px row gap); the negative margin
     keeps the row exactly where it was. */
  padding: 6px 0;
  margin: -6px 0;
}
.section-footer .footer-link:hover { color: #fff; }
.section-footer .footer-sep {
  position: absolute;
  left: 100%;
  width: 24px;
  text-align: center;
  color: rgba(255,255,255,0.25);
  font-size: 0.8rem;
  pointer-events: none;
}

/* Language switch row: the site's dark pill (styles.css "lang-toggle"),
   ported so it looks the same where styles.css is not loaded. */
.section-footer .footer-lang-row {
  display: flex;
  justify-content: center;
}
.section-footer .footer-lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(250,246,239,0.20);
  border-radius: 50%;
  padding: 6px 12px;
  text-shadow: 0 1px 6px rgba(0,0,0,0.6), 0 2px 16px rgba(0,0,0,0.3);
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  font-family: 'Nunito', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1;
  color: rgba(250,246,239,0.50);
}
.section-footer .footer-lang-toggle:hover { background: rgba(0,0,0,0.38); }
.section-footer .footer-lang-toggle .lang-en,
.section-footer .footer-lang-toggle .lang-jp {
  color: rgba(250,246,239,0.50);
  text-decoration: none;
  line-height: 1;
}
.section-footer .footer-lang-toggle .lang-en.active,
.section-footer .footer-lang-toggle .lang-jp.active {
  color: #FAF6EF;
  font-weight: 700;
}
.section-footer .footer-lang-toggle a:hover { color: #FAF6EF; }
.section-footer .footer-lang-toggle .lang-sep { color: rgba(250,246,239,0.30); margin: 0; }
/* Touch target around the two letters, layout unchanged. */
.section-footer .footer-lang-toggle a {
  padding: 12px 8px;
  margin: -12px -8px;
}

.section-footer .footer-divider {
  width: 100%;
  border: none;
  border-top: 1px solid rgba(255,255,255,0.12);
  margin: 0;
}

.section-footer .footer-bottom {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.section-footer .footer-social {
  display: flex;
  gap: 16px;
}
.section-footer .footer-social-link {
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  transition: color 200ms cubic-bezier(0.25, 0.1, 0.25, 1), transform 200ms cubic-bezier(0.25, 0.1, 0.25, 1);
  display: flex;
  align-items: center;
  /* Tap target: 28px around the 20px icon, layout unchanged. */
  padding: 4px;
  margin: -4px;
}
.section-footer .footer-social-link:hover {
  color: #fff;
  transform: translateY(-2px);
}

.section-footer .footer-legal {
  /* award #30: was 0.64rem at 0.3 white (2.66:1) */
  font-size: 0.75rem;
  color: rgba(255,255,255,0.62);
  margin: 0;
}
.section-footer .footer-legal-link {
  color: rgba(255,255,255,0.74);
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
  transition: color 200ms cubic-bezier(0.25, 0.1, 0.25, 1);
}
.section-footer .footer-legal-link:hover { color: rgba(255,255,255,0.8); }

@media (max-width: 1024px) {
  .section-footer .footer-content { padding-left: 48px; padding-right: 48px; }
}
@media (max-width: 768px) {
  .section-footer .footer-content { padding: 96px 24px 40px; }
  .section-footer .footer-bottom { flex-direction: column; align-items: center; }
  .section-footer .footer-logo-img { height: 32px; }
}
@media (max-width: 480px) {
  .section-footer .footer-content { padding-left: 20px; padding-right: 20px; }
  /* Phones: rows may wrap, so no dots at all; ragged-centred words. */
  .section-footer .footer-nav { gap: 10px; }
  .section-footer .footer-row { gap: 10px 20px; }
  .section-footer .footer-sep { display: none; }
}

/* Japanese labels in the brand's JP face on every page (legal.css pages do
   not carry styles.css's .i18n-jp rule for this). */
.section-footer [lang="ja"] { font-family: 'M PLUS Rounded 1c', 'Nunito', sans-serif; }

/* On the legal-shell pages (everything but home and adults) the footer comes
   out of the page's night sky rather than after another painting, so its top
   edge feathers into that sky instead of drawing a hard line across it. Home
   and adults keep the hard edge their painted sections were designed with. */
.section-footer--shell { box-shadow: none; }
.section-footer--shell .footer-garden,
.section-footer--shell .footer-overlay {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 160px);
  mask-image: linear-gradient(to bottom, transparent 0, #000 160px);
}

/* Touch targets (award #31): 44px hit areas from invisible pseudo-elements, so
   nothing changes size or colour; on touch screens the rows open up just
   enough (24px) that neighbouring hit areas never overlap. */
@media (pointer: coarse) {
  .section-footer .footer-nav { gap: 24px; }
  .section-footer .footer-row { row-gap: 24px; }
  .section-footer .footer-social { gap: 24px; }
  .section-footer .footer-bottom { row-gap: 28px; } /* social hit areas clear the legal line */
  .section-footer .footer-link,
  .section-footer .footer-social-link,
  .section-footer .footer-legal-link,
  .section-footer .footer-lang-toggle a,
  .section-footer .footer-logo { position: relative; }
  /* The legal line can wrap on a phone: a 44px line pitch keeps each link's
     44px hit area off the row above and below, and its hit area stops at its
     own words so it never reaches the link beside it. */
  .section-footer .footer-legal { line-height: 44px; }
  .section-footer .footer-link::after,
  .section-footer .footer-legal-link::after,
  .section-footer .footer-logo::after {
    content: '';
    position: absolute;
    left: -8px; right: -8px;
    top: 50%; height: 44px;
    transform: translateY(-50%);
  }
  .section-footer .footer-social-link::after,
  .section-footer .footer-lang-toggle a::after {
    content: '';
    position: absolute;
    left: 50%; top: 50%;
    width: 44px; height: 44px;
    transform: translate(-50%, -50%);
  }
  .section-footer .footer-legal-link::after { left: 0; right: 0; }
}
