/* ============================================================
   有限会社ライジング | Animations & Subpage Visual Layer
   - Hero title char animation
   - Subpage page-header
   - AOS fallback (works without JavaScript)
   - Pagetop button
   - Mobile nav
   ============================================================ */

/* ---------- Hero title char-by-char animation ---------- */
.hero-title .hero-line span {
  display: inline-block;
  opacity: 0;
  transform: translateY(40px);
  animation: heroCharIn 0.9s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
}
.hero-title .hero-line:nth-child(1) span:nth-child(1) { animation-delay: 0.5s; }
.hero-title .hero-line:nth-child(1) span:nth-child(2) { animation-delay: 0.6s; }
.hero-title .hero-line:nth-child(1) span:nth-child(3) { animation-delay: 0.7s; }
.hero-title .hero-line:nth-child(1) span:nth-child(4) { animation-delay: 0.8s; }
.hero-title .hero-line:nth-child(1) span:nth-child(5) { animation-delay: 0.9s; }
.hero-title .hero-line:nth-child(2) span:nth-child(1) { animation-delay: 1.1s; }
.hero-title .hero-line:nth-child(2) span:nth-child(2) { animation-delay: 1.2s; }
.hero-title .hero-line:nth-child(2) span:nth-child(3) { animation-delay: 1.3s; }
.hero-title .hero-line:nth-child(2) span:nth-child(4) { animation-delay: 1.4s; }
@keyframes heroCharIn {
  to { opacity: 1; transform: translateY(0); }
}

.hero-tag, .hero-sub, .hero-cta {
  opacity: 0;
  animation: heroFadeIn 1s ease-out forwards;
}
.hero-tag { animation-delay: 0.2s; }
.hero-sub { animation-delay: 1.7s; }
.hero-cta { animation-delay: 2.0s; }
@keyframes heroFadeIn { to { opacity: 1; } }

/* ---------- Subpage page-header ---------- */
.subpage .page-header {
  position: relative;
  height: 360px;
  min-height: 280px;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.subpage .page-header-bg {
  position: absolute; inset: 0;
}
.subpage .page-header-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(10,40,86,0.55), rgba(6,26,58,0.75));
  z-index: 1;
}
.subpage .page-header-content {
  position: relative; z-index: 2;
  text-align: center;
  color: #fff;
  padding: 0 24px;
}
.subpage .page-header-en {
  font-family: 'Playfair Display', 'Inter', sans-serif;
  font-size: 14px;
  letter-spacing: 0.4em;
  color: #F4B942;
  margin-bottom: 12px;
  opacity: 0;
  animation: pageHeaderUp 0.7s ease-out 0.1s forwards;
}
.subpage .page-header-title {
  font-family: 'Shippori Mincho B1', serif;
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 800;
  margin-bottom: 16px;
  color: #fff;
  opacity: 0;
  animation: pageHeaderUp 0.8s ease-out 0.3s forwards;
}
.subpage .page-header-lead {
  font-size: clamp(13px, 1.6vw, 16px);
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.9);
  opacity: 0;
  animation: pageHeaderUp 0.9s ease-out 0.6s forwards;
}
@keyframes pageHeaderUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- AOS Fallback (works WITHOUT AOS library) ---------- */
[data-aos] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
[data-aos].aos-animate,
.no-aos [data-aos] {
  opacity: 1;
  transform: translateY(0);
}
/* Hard fallback: 4秒後に強制表示 (AOSが読み込めなくても見える) */
@keyframes aosForceShow {
  to { opacity: 1; transform: translateY(0); }
}
[data-aos]:not(.aos-init):not(.aos-animate) {
  animation: aosForceShow 0.6s ease-out 4s forwards;
}

/* ---------- Section head ---------- */
.section-head { text-align: center; margin-bottom: 60px; }
.section-num {
  display: inline-block;
  font-family: 'Playfair Display', serif;
  font-size: 14px;
  letter-spacing: 0.3em;
  color: #F4B942;
  margin-bottom: 8px;
}
.section-en {
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: 14px;
  letter-spacing: 0.4em;
  color: #999;
  margin-bottom: 12px;
  text-transform: uppercase;
}
.section-title {
  font-family: 'Shippori Mincho B1', serif;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  color: #0A2856;
  margin-bottom: 18px;
}
.section-lead {
  font-size: clamp(14px, 1.6vw, 16px);
  line-height: 1.95;
  color: #555;
  max-width: 720px;
  margin: 0 auto;
}
.section-head.light .section-num,
.section-head.light .section-en { color: rgba(255,255,255,0.7); }
.section-head.light .section-title { color: #fff; }
.section-head.light .section-lead { color: rgba(255,255,255,0.85); }

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  background: #f5f5f7;
  padding: 14px 0;
  font-size: 13px;
}
.breadcrumb ol { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0; flex-wrap: wrap; }
.breadcrumb li { color: #555; }
.breadcrumb li:not(:last-child)::after { content: '›'; margin-left: 8px; color: #aaa; }
.breadcrumb a { color: #0A2856; text-decoration: none; }
.breadcrumb a:hover { color: #E63946; }

/* ---------- Page CTA ---------- */
.page-cta {
  padding: clamp(80px, 12vh, 140px) 0;
  background: linear-gradient(135deg, #0A2856, #1E4380);
  color: #fff;
  text-align: center;
}
.page-cta h2 {
  font-family: 'Shippori Mincho B1', serif;
  font-size: clamp(24px, 3.5vw, 36px);
  margin-bottom: 16px;
}
.page-cta p {
  margin-bottom: 32px;
  color: rgba(255,255,255,0.85);
}
.page-cta .cta-buttons {
  display: flex; gap: 16px; justify-content: center; flex-wrap: wrap;
}

/* ---------- Btn ---------- */
.btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn-primary {
  background: linear-gradient(90deg, #E63946, #F4B942);
  color: #fff;
  box-shadow: 0 8px 24px rgba(230,57,70,0.25);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(230,57,70,0.35); }
.btn-ghost {
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255,255,255,0.5);
}
.btn-ghost:hover { background: rgba(255,255,255,0.1); }

/* ---------- Pagetop button ---------- */
.pagetop {
  position: fixed; bottom: 24px; right: 24px;
  width: 48px; height: 48px;
  background: #0A2856;
  color: #fff;
  border-radius: 50%;
  display: grid; place-items: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 100;
}
.pagetop.show { opacity: 1; pointer-events: auto; }
.pagetop:hover { transform: translateY(-4px); }
.pagetop svg { width: 22px; height: 22px; }

/* ---------- Mobile Nav ---------- */
@media (max-width: 900px) {
  .nav { display: none; position: fixed; top: 0; right: 0; width: 80%; max-width: 320px; height: 100vh; background: #0A2856; padding: 80px 24px 24px; z-index: 200; transform: translateX(100%); transition: transform 0.4s; }
  .nav.open { display: block; transform: translateX(0); }
  .nav ul { flex-direction: column; gap: 0; }
  .nav li { border-bottom: 1px solid rgba(255,255,255,0.1); }
  .nav a { display: block; padding: 18px 8px; color: #fff; }
  .hamburger { display: flex; flex-direction: column; gap: 5px; width: 28px; height: 22px; justify-content: center; background: transparent; border: none; cursor: pointer; z-index: 210; position: relative; }
  .hamburger span { display: block; height: 2px; background: #1a1a1a; transition: transform 0.3s, opacity 0.3s; }
  .hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); background: #fff; }
  .hamburger.active span:nth-child(2) { opacity: 0; }
  .hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); background: #fff; }
}
@media (min-width: 901px) { .hamburger { display: none; } }

/* ---------- Body states ---------- */
body.menu-open { overflow: hidden; }
body.large-text { font-size: 1.1em; }
body.dark { background: #061A3A; color: #e8e8e8; }
