/* Shared paper, stars, navigation, ornaments, and social components.
   Load after base.css; opt in with body.site-page and .paper-sheet. */

html:has(.site-page) {
  overflow-x: clip; background: #000;
}

.site-page {
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --brass: #b7925e; --paper: #201820; --text: #f2e9d7; --muted: #c3b4ad; --site-rule: #e5cfb32b; color: var(--text); background: #000;
}

.site-page::before {
  display: block;
  inset: 0;
  transform: none;
  filter: none;
  background: #000;
}

.paper-sheet {
  background:
    linear-gradient(#d8afc012 1px, transparent 1px),
    linear-gradient(90deg, #d8afc012 1px, transparent 1px),
    linear-gradient(#d8afc008 1px, transparent 1px),
    linear-gradient(90deg, #d8afc008 1px, transparent 1px),
    #201820;
  background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px;
  background-position: -1px -1px;
}

.paper-sheet {
  width: 100%;
  position: relative;
  z-index: 1;
  --page-padding: clamp(20px, 5vw, 56px);
  max-width: 920px;
  min-height: 100vh;
  margin-inline: auto;
  padding: 0 var(--page-padding) 36px;
  border-radius: 0;
  overflow: clip;
}

.site-page a:focus-visible, .site-page button:focus-visible {
  outline: 2px solid #eed397; outline-offset: 5px;
}

.skip-link {
  position: absolute; top: -80px; padding: 12px; background: #201820; z-index: 20;
}

.skip-link:focus {
  top: 12px;
}

.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 24px 0; border-bottom: 0;
}

.site-wordmark {
  display: flex; gap: 10px; align-items: center; font: bold 23px Georgia, serif; text-decoration: none;
}

.site-wordmark img {
  width: 62px; filter: invert(1);
}

.site-wordmark span {
  color: #c6a4a8; margin-left: -8px; font-weight: normal;
}

.site-nav {
  display: flex; gap: 30px;
}

.site-nav a {
  font-size: 13px; text-decoration: none; color: var(--muted); padding: 12px 0;
}

.site-nav a:hover {
  color: var(--text);
}

.social-panel {
  display: flex; justify-content: center; border-top: 0; padding-top: 28px; margin-top: 48px;
}

.social-links {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 22px; font-size: 12px;
}

.social-links a {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none; min-height: 44px;
}

.social-links a:hover {
  color: #d78c98;
}

.social-links i {
  font-size: 19px;
}

.social-links img {
  width: 20px; height: 20px; object-fit: contain;
}

.social-links {
  gap: clamp(18px, 3vw, 22px);
}

@media (prefers-reduced-motion: reduce) {
.site-page *, .site-page *::before, .site-page *::after {
  transition: none !important; animation: none !important;
}
}

.site-header, .social-panel {
  position: relative;
  border-top: 0;
  border-bottom: 0;
}

.site-header {
  padding-bottom: 40px;
}

.site-header::after {
  content: '';
  position: absolute;
  left: 50%;
  width: calc(100% + 2 * var(--page-padding));
  height: 48px;
  background:
    url('/images/decor/header-ornament.svg?v=vector') center / 480px 48px no-repeat,
    linear-gradient(var(--brass), var(--brass)) left center / max(0px, calc(50% - 238px)) 1.6px no-repeat,
    linear-gradient(var(--brass), var(--brass)) right center / max(0px, calc(50% - 238px)) 1.6px no-repeat;
  pointer-events: none;
}

.site-header::after {
  bottom: 0;
  transform: translate(-50%, 50%);
}

.social-panel {
  padding-top: 24px; margin-top: 8px;
}

.site-header::after {
  bottom: 8px;
}

@media (max-width: 720px) {
.site-nav {
  gap: 20px;
}
}

@media (max-width: 760px) {
.site-header {
  flex-wrap: nowrap; gap: 10px; padding: 18px 0 28px;
}

.site-wordmark {
  font-size: 21px;
}

.site-wordmark img {
  width: 48px;
}

.site-nav {
  width: auto; display: flex; gap: 4px; text-align: center;
}

.site-nav a span {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

.site-nav a {
  min-width: 36px; min-height: 44px;
}
}

.paper-sheet {
  mask-image: url('/images/decor/paper-edge-left.svg'), linear-gradient(#000, #000), url('/images/decor/paper-edge-right.svg');
  mask-size: 8px 80px, calc(100% - 16px) 100%, 8px 80px;
  mask-position: left top, center top, right top;
  mask-repeat: repeat-y, no-repeat, repeat-y;
}

.social-links .fa-youtube {
  color: #ff0033;
}

.social-links .fa-discord {
  color: #5865f2;
}

.social-links .fa-instagram {
  background: radial-gradient(circle at 28% 105%, #feda75 0%, #fa7e1e 30%, #d62976 55%, #962fbf 78%, #4f5bd5 100%);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.nintendo-social {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
}

.nintendo-social > i {
  color: #e60012;
}

.switch-friend-code {
  display: block; margin-top: 4px; font: 11px monospace; color: var(--muted);
}

.social-links .switch-logo {
  width: 20px; height: 20px; object-fit: contain;
}

.social-panel {
  flex-direction: column; align-items: center; width: fit-content; max-width: 100%; margin-inline: auto; padding: 32px 44px 24px;
}

.corner-ornaments {
  position: absolute; inset: 0 0 auto; height: 70px; pointer-events: none;
}

.corner-ornaments span {
  position: absolute; top: 0; left: 0; width: 88px; height: 88px; background: url('/images/decor/social-corner.svg?v=reference-image-4') top left / contain no-repeat; transform: scaleX(-1);
}

.corner-ornaments span:last-child {
  left: auto; right: 0; transform: none;
}

@media (max-width: 920px) {
.paper-sheet {
  mask-image: none;
}
}

.star-sky {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
}

.twinkle-layer {
  position: absolute; inset: 0; pointer-events: none; background-repeat: repeat; background-attachment: fixed; animation: star-twinkle 5.3s ease-in-out infinite;
}

.stars-1 {
  background-image: url('/images/decor/stars-1.svg'); animation-delay: -1.7s;
}

.stars-2 {
  background-image: url('/images/decor/stars-2.svg'); animation-duration: 8.1s; animation-delay: -5.2s;
}

.stars-3 {
  background-image: url('/images/decor/stars-3.svg'); animation-duration: 6.7s; animation-delay: -3.6s;
}

@keyframes star-twinkle {
0%, 100% { opacity: .3; }
  38% { opacity: 1; }
  65% { opacity: .6; }
}

.site-page {
  cursor: url('/images/decor/ufo-cursor.svg') 16 16, auto;
}

.paper-sheet {
  cursor: auto;
}

/* Regular content pages can use this spacing without the home hero. */
.page-content { padding-block: 48px 24px; line-height: 1.7; }
.page-content > * + * { margin-top: 20px; }

.site-page .page-content h1, .site-page .page-content h2, .site-page .page-content h3 {
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-weight: normal;
}

/* Menu marks share a fixed size so labels stay aligned. */
.site-nav a { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.site-nav .nav-icon { width: 18px; height: 18px; object-fit: contain; flex: 0 0 18px; }
.site-nav .nav-icon-bat { filter: invert(1); }

@media (max-width: 400px) {
  .site-wordmark { font-size: 17px; gap: 7px; white-space: nowrap; }
  .site-wordmark img { width: 32px; }
  .site-nav { gap: 0; }
  .site-nav a { min-width: 28px; }
  .site-header { gap: 6px; }
}

.site-nav .nav-icon-moth {
  width: 24px; height: 24px; flex-basis: 24px;
  filter: drop-shadow(1px 0 0 #000) drop-shadow(-1px 0 0 #000) drop-shadow(0 1px 0 #000) drop-shadow(0 -1px 0 #000);
}

/* Keep the original snail photo, with a brighter, softer icon treatment. */
.site-nav .nav-icon-snail { width: 22px; height: 22px; flex-basis: 22px; filter: brightness(1.55) contrast(.8) saturate(.85) drop-shadow(1px 0 0 #000) drop-shadow(-1px 0 0 #000) drop-shadow(0 1px 0 #000) drop-shadow(0 -1px 0 #000); }

.site-wordmark { flex-shrink: 0; white-space: nowrap; }
.site-nav { flex-wrap: nowrap; }

/* Native disclosure keeps Creations keyboard-accessible in the shared navigation. */
.nav-dropdown { position: relative; }
.nav-dropdown summary { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 12px 0; color: var(--muted); font-size: 13px; cursor: pointer; list-style: none; }
.nav-dropdown summary::-webkit-details-marker { display: none; }
.nav-dropdown summary::after { display: none; }
.nav-dropdown[open] summary, .nav-dropdown summary:hover { color: var(--text); }
.nav-dropdown-links { position: absolute; top: calc(100% + 5px); left: -16px; min-width: 175px; padding: 8px; background: #201820; border: 1px solid #b7925e66; border-radius: 10px; box-shadow: 0 8px 24px #0006; z-index: 30; }
.site-nav .nav-dropdown-links a { display: block; white-space: nowrap; padding: 11px 12px; border-radius: 5px; }
.site-nav .nav-dropdown-links a:hover, .site-nav .nav-dropdown-links a:focus-visible { background: #b7925e1c; }
@media (max-width: 760px) {
 .nav-dropdown summary { min-width: 36px; min-height: 44px; box-sizing: border-box; }
 .nav-dropdown summary span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
 .nav-dropdown summary::after { display: none; }
 .nav-dropdown-links { left: auto; right: -20px; }
}
@media (max-width: 400px) { .nav-dropdown summary { min-width: 28px; } }

/* Align the disclosure control exactly like neighboring navigation links. */
.site-nav { align-items: center; }
.nav-dropdown { display: flex; align-items: center; }
.nav-dropdown summary { display: flex; font-family: inherit; line-height: inherit; }

/* Use identical control metrics for links and the dropdown trigger. */
.site-nav > a,
.site-nav > .nav-dropdown > summary {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 48px;
  padding-block: 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: normal;
  line-height: 18px;
}
.site-nav > .nav-dropdown { margin: 0; padding: 0; }
@media (max-width: 760px) {
  .site-nav > a, .site-nav > .nav-dropdown > summary { height: 44px; }
}

.nav-dropdown summary > .nav-icon { transform: translateY(-1px); }
