/* Tsuki no Yu shared foundation.
   Loaded before each page's local CSS so page-specific art direction can override it. */

:root {
  --gold: #b8975a;
  --gold2: #d4b07a;
  --gold-deep: #8a6e3a;
  --white: #ffffff;
  --off: rgba(255,255,255,.72);
  --dim: rgba(255,255,255,.45);
  --sumi: #0f0e0c;
  --sumi2: #0a0908;
  --sumi3: #1a1714;
  --washi: #ede4d0;
  --washi2: #e6d8b8;
  --bengala: #704214;
  --ink: #3a2c18;
  --ink2: #1c1208;
  --t: .8s cubic-bezier(.4,0,.2,1);
  --tf: .3s cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
  font-size: 16px;
}
body {
  background: var(--sumi);
  color: var(--white);
  overflow-x: hidden;
  font-family: 'Libre Baskerville', 'Noto Serif TC', 'Noto Serif JP', 'Zen Old Mincho', serif;
  font-weight: 300;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button {
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  font: inherit;
}
::-webkit-scrollbar { width: 2px; height: 2px; }
::-webkit-scrollbar-thumb { background: var(--gold); }

nav#mainNav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 1.5rem 3rem;
  transition: background var(--t), padding var(--t), border-color var(--t), transform var(--t), opacity .45s ease;
}
nav#mainNav.scrolled {
  background: rgba(15,14,12,.92);
  border-bottom: 1px solid rgba(184,151,90,.15);
  backdrop-filter: blur(10px);
  padding-block: 1rem;
}
nav#mainNav.nav-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-110%);
}
.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2.5rem;
  list-style: none;
}
.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  color: rgba(255,255,255,.65);
  font-size: 18px;
  letter-spacing: .32em;
  line-height: 1;
  transition: color .3s ease, opacity .3s ease;
}
.nav-links a:hover,
.nav-links a.active { color: var(--gold); }
.nav-links a[aria-disabled="true"] {
  cursor: default;
  opacity: .62;
  pointer-events: auto;
}
body[data-lang="en"] .nav-links a {
  letter-spacing: .14em;
}
.nav-links .lang-switch a {
  letter-spacing: .16em;
  color: var(--gold);
  font-size: 14px;
}

.corner-logo {
  position: fixed;
  top: .85rem;
  left: 2.25rem;
  z-index: 120;
  opacity: 1;
  transform: translateY(0);
  transition: opacity .45s ease, transform .45s ease;
}
.corner-logo img {
  width: auto;
  height: 148px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}
.corner-logo.logo-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-14px);
}

footer,
.site-footer {
  background: #0a0908;
  border-top: 1px solid rgba(184,151,90,.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 3rem 6rem;
}
.ft-logo {
  color: rgba(255,255,255,.72);
  font-size: .9rem;
  font-weight: 200;
  letter-spacing: .75em;
  margin-bottom: .35rem;
}
.ft-copy {
  color: rgba(255,255,255,.25);
  font-size: .48rem;
  letter-spacing: .32em;
}
.ft-social {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.ft-social-link {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(184,151,90,.45);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.62);
  font-size: .62rem;
  letter-spacing: .12em;
  line-height: 1;
  transition: border-color .3s ease, color .3s ease, background .3s ease, transform .3s ease;
}
.ft-social-link:hover {
  background: rgba(184,151,90,.12);
  border-color: var(--gold);
  color: var(--gold);
  transform: translateY(-2px);
}

@media (max-width: 980px) {
  html { font-size: 15px; }
  nav#mainNav {
    min-height: 56px;
    justify-content: flex-end;
    overflow-x: auto;
    overflow-y: hidden;
    padding: .72rem 1rem;
    background: linear-gradient(to bottom, rgba(15,14,12,.82), rgba(15,14,12,0));
    -webkit-overflow-scrolling: touch;
  }
  nav#mainNav.scrolled { padding-block: .62rem; }
  .nav-links {
    width: max-content;
    min-width: 100%;
    justify-content: flex-end;
    gap: clamp(.85rem, 3.2vw, 1.35rem);
    padding-right: .5rem;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a {
    min-height: 30px;
    white-space: nowrap;
    font-size: .58rem;
    letter-spacing: .14em;
  }
  .corner-logo { top: .55rem; left: 1rem; }
  .corner-logo img { height: 92px; }
  footer,
  .site-footer {
    flex-direction: column;
    padding: 2rem 1.2rem;
    text-align: center;
  }
  .ft-logo { letter-spacing: .45em; line-height: 1.8; }
  .ft-copy { letter-spacing: .18em; line-height: 1.8; }
  .ft-social {
    justify-content: center;
    margin-top: .6rem;
  }
}

@media (max-width: 520px) {
  nav#mainNav { padding-inline: .85rem; }
  .nav-links { gap: .85rem; }
  .nav-links a { font-size: .55rem; letter-spacing: .1em; }
  .corner-logo img { height: 86px; }
}

body[data-lang="en"] .nav-links a,
body[data-lang="en"] .ft-logo,
body[data-lang="en"] .ft-copy,
body[data-lang="en"] .ft-social-link {
  letter-spacing: .08em;
}
