/* NihongoKu Landing Page v2 — Elevated Japanese Craft
   Airbnb-style Segmented Auto-Hide Header, Parallax Carousel + Crest,
   Zigzag 6-Step Roadmap, Interactive Motion Cards, Character Bubble, 2-Col FAQ, Deep Navy Footer */

:root {
  --gold: #0891b2;
  --gold-soft: rgba(6, 182, 212, 0.12);
  --sakura-tint: #f1f5f9;
  --navy-deep: #0f172a;
}
:root[data-theme="dark"] {
  --sakura-tint: #0f172a;
  --navy-deep: #070b14;
}

.lp-body {
  background: var(--bg);
  color: var(--ink);
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

/* 1. AUTO-HIDE STICKY HEADER WITH GLASSMORPHISM & SEGMENTED PILL */
.lp-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  border-bottom: 1px solid rgba(226, 232, 240, 0.7);
  box-shadow: 0 4px 18px -10px rgba(15, 23, 42, 0.14);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
:root[data-theme="dark"] .lp-header {
  background: rgba(15, 23, 42, 0.72);
  border-bottom-color: rgba(39, 52, 73, 0.75);
}
.lp-desktop-only { display: none !important; }
@media (min-width: 920px) {
  .lp-desktop-only { display: inline-flex !important; }
}
.lp-header.is-hidden {
  transform: translateY(-105%);
}
.lp-header-inner {
  max-width: 1180px;
  margin: 0 auto;
  height: 70px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.lp-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
.lp-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.lp-brand-jp {
  font: 800 12px/1 "M PLUS Rounded 1c", sans-serif;
  color: var(--red);
  letter-spacing: 0.04em;
}
.lp-brand-name {
  font: 800 18px/1.1 "M PLUS Rounded 1c", sans-serif;
  color: var(--ai);
}
:root[data-theme="dark"] .lp-brand-name { color: #edf1f7; }

/* Clean Desktop Nav Links + Upward-Arrow Speech Bubble Popovers (No Oval Pill) */
.lp-pill-nav {
  display: none;
  align-items: center;
  gap: 8px;
}
@media (min-width: 920px) {
  .lp-pill-nav { display: flex; }
  .lp-menu-btn { display: none !important; }
}
.lp-pill-item {
  position: relative;
}
.lp-pill-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  transition: background 0.16s ease, color 0.16s ease;
}
.lp-pill-trigger:hover, .lp-pill-item:focus-within .lp-pill-trigger {
  background: var(--soft);
  color: var(--red);
}
.lp-pill-trigger svg { transition: transform 0.2s ease; }
.lp-pill-item:hover .lp-pill-trigger svg,
.lp-pill-item:focus-within .lp-pill-trigger svg { transform: rotate(180deg); }

/* Speech-Bubble Popover with Upward Arrow (▲) */
.lp-popover {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  width: 440px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 20px 44px -14px rgba(15, 23, 42, 0.24);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  z-index: 80;
}
.lp-popover::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  width: 14px;
  height: 14px;
  background: var(--surface);
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
  transform: translateX(-50%) rotate(45deg);
}
.lp-popover.sm { width: 340px; }
.lp-pill-item:hover .lp-popover,
.lp-pill-item:focus-within .lp-popover,
.lp-pill-item.open .lp-popover {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Animated Hero Logo N (Stroke draw + gentle orb float) */
@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes orbPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.18); opacity: 0.85; }
}
@keyframes drawN {
  0% { stroke-dashoffset: 720; }
  100% { stroke-dashoffset: 0; }
}
.hero-logo-anim {
  animation: logoFloat 4.2s ease-in-out infinite;
}
.hero-logo-anim .n-stroke {
  stroke-dasharray: 720;
  stroke-dashoffset: 0;
  animation: drawN 1.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.hero-logo-anim .n-orb {
  transform-origin: 352px 150px;
  animation: orbPulse 2.8s ease-in-out infinite;
}

.lp-drop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.lp-drop-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}
.lp-drop-item:hover {
  background: var(--soft);
  border-color: var(--line);
}
.lp-drop-ic {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--ai-soft);
  color: var(--ai);
  display: grid;
  place-items: center;
  font: 800 16px "M PLUS Rounded 1c", sans-serif;
  flex: none;
}
:root[data-theme="dark"] .lp-drop-ic { color: #a9ccf5; }

.lp-search-res {
  max-height: 240px;
  overflow-y: auto;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.lp-search-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13px;
}
.lp-search-row:hover { background: var(--soft); }

/* Header Theme / Menu Icon Buttons on light header */
.lp-hdr-btn {
  min-width: 40px;
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.12s;
}
.lp-hdr-btn:hover { background: var(--soft); }
.lp-hdr-btn:active { transform: scale(0.95); }

/* Mobile Drawer */
.lp-mobile-drawer {
  display: none;
  background: var(--surface);
  color: var(--ink);
  border-top: 1px solid var(--line);
  padding: 12px 18px 18px;
}
.lp-mobile-drawer.open { display: block; }
.lp-mobile-drawer a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 15px;
}
.lp-mobile-drawer a:hover { background: var(--soft); }

/* Floating Kana Snow Canvas */
#kanaSnowCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
  opacity: 0.42;
}

/* 2. PARALLAX HERO CAROUSEL + JAPANESE CREST */
.lp-hero {
  position: relative;
  margin-top: 70px;
  min-height: clamp(500px, 78svh, 650px);
  overflow: hidden;
  background: var(--navy-deep);
  color: #fff;
  display: flex;
  align-items: center;
}
.lp-slides { position: absolute; inset: 0; z-index: 1; }
.lp-slide {
  position: absolute;
  inset: -12% 0;
  opacity: 0;
  transition: opacity 0.85s ease;
  will-change: transform, opacity;
}
.lp-slide.active { opacity: 1; }
.lp-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.45) saturate(1.1);
}
.lp-hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(108deg, rgba(15, 23, 42, 0.84) 0%, rgba(15, 23, 42, 0.56) 56%, rgba(8, 145, 178, 0.22) 100%);
}
.lp-hero-grid {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 18px 72px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: center;
}
@media (min-width: 860px) {
  .lp-hero-grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr); }
}
.lp-hero-jp-kicker {
  font: 800 15px/1.2 "M PLUS Rounded 1c", sans-serif;
  color: #f6c453;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.lp-hero-title {
  font: 800 clamp(28px, 4.4vw, 46px)/1.12 "M PLUS Rounded 1c", sans-serif;
  margin: 8px 0 12px;
  color: #fff;
}
.lp-hero-sub {
  font-size: clamp(15px, 1.9vw, 17px);
  color: #dbe6f5;
  max-width: 54ch;
  margin: 0 0 22px;
}

/* Circular Seigaiha-bordered Emblem Crest */
.lp-crest-wrap {
  display: none;
  justify-content: center;
}
@media (min-width: 860px) {
  .lp-crest-wrap { display: flex; }
}
.lp-crest {
  width: 215px;
  height: 215px;
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.76);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 20px 44px rgba(15, 23, 42, 0.26);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  color: #0f172a;
}

.lp-carousel-ctrl {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  z-index: 12;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.lp-dots { display: flex; gap: 8px; }
.lp-dot {
  width: 28px;
  height: 44px;
  padding: 19px 0;
  border-radius: 99px;
  border: 0;
  background: rgba(255, 255, 255, 0.35);
  background-clip: content-box;
  transition: width 0.25s, background 0.25s;
}
.lp-dot.active { width: 46px; background: var(--gold); }

/* Sections & Japanese Motifs */
.lp-section {
  position: relative;
  z-index: 10;
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  padding: clamp(38px, 5vw, 68px) 18px;
}
.lp-band-tint {
  position: relative;
  z-index: 10;
  background: var(--sakura-tint);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.lp-section-head {
  margin-bottom: 26px;
  max-width: 64ch;
}
.lp-section-head.center {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}
.lp-jp-tag {
  font: 800 13px/1 "M PLUS Rounded 1c", sans-serif;
  color: var(--red);
  letter-spacing: 0.08em;
  display: inline-block;
  margin-bottom: 6px;
}

/* Tactile Card Lift Micro-Interaction */
.lift-card {
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.lift-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px -16px rgba(23, 32, 46, 0.2);
  border-color: var(--ai);
}
.btn:active { transform: scale(0.97); }

/* 3. INTERACTIVE MOTION "VIDEO" CARDS */
.motion-stage {
  background: linear-gradient(155deg, var(--ai) 0%, #274a77 100%);
  color: #fff;
  border-radius: 16px;
  padding: 20px 16px;
  min-height: 230px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  margin-bottom: 12px;
}
.motion-char {
  font: 800 clamp(54px, 9vw, 76px)/1 "M PLUS Rounded 1c", sans-serif;
  text-align: center;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
}
.motion-char.morph-out { opacity: 0; transform: scale(0.76) translateY(-10px); }
.motion-progress {
  height: 4px;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 12px;
}
.motion-progress > i {
  display: block;
  height: 100%;
  background: var(--gold);
  width: 0%;
  transition: width 0.2s linear;
}
.chat-line {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 9px 12px;
  margin-bottom: 8px;
  font-size: 14px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.chat-line.show { opacity: 1; transform: translateY(0); }
.chat-line.me { background: var(--red); margin-left: 18px; }

/* 4. CHARACTER PNG + INTERACTIVE SPEECH BUBBLE */
.mentor-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: clamp(20px, 3vw, 34px);
  box-shadow: 0 14px 36px -20px rgba(23, 32, 46, 0.16);
}
@media (min-width: 820px) {
  .mentor-wrap { grid-template-columns: 270px minmax(0, 1fr); }
}
.mentor-img-box { display: flex; justify-content: center; align-items: flex-end; }
.mentor-img {
  width: min(250px, 70vw);
  height: auto;
  display: block;
  filter: drop-shadow(0 14px 24px rgba(23, 32, 46, 0.15));
  animation: gentleBob 4.2s ease-in-out infinite;
}
@keyframes gentleBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
.speech-bubble {
  position: relative;
  background: var(--soft);
  border: 2px solid var(--ai);
  border-radius: 18px;
  padding: 18px 20px;
  margin-bottom: 14px;
}
@media (min-width: 820px) {
  .speech-bubble::before {
    content: "";
    position: absolute;
    left: -13px;
    top: 34px;
    width: 20px;
    height: 20px;
    background: var(--soft);
    border-left: 2px solid var(--ai);
    border-bottom: 2px solid var(--ai);
    transform: rotate(45deg);
  }
}

/* 5. ZIGZAG 6-STEP LEARNING ROADMAP TIMELINE */
.roadmap {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 920px;
  margin: 0 auto;
}
.roadmap::before {
  content: "";
  position: absolute;
  left: 21px;
  top: 16px;
  bottom: 16px;
  width: 4px;
  border-radius: 99px;
  background: linear-gradient(180deg, var(--red) 0%, var(--gold) 50%, var(--ai) 100%);
}
.rm-item {
  position: relative;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}
.rm-node {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--red);
  color: var(--red);
  font: 800 18px "M PLUS Rounded 1c", sans-serif;
  display: grid;
  place-items: center;
  z-index: 2;
  box-shadow: 0 4px 12px rgba(215, 38, 61, 0.18);
}
.rm-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
@media (min-width: 820px) {
  .roadmap::before {
    left: 50%;
    transform: translateX(-50%);
  }
  .rm-item {
    grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1fr);
    gap: 20px;
  }
  .rm-item:nth-child(odd) .rm-card { grid-column: 1; grid-row: 1; text-align: right; }
  .rm-item:nth-child(odd) .rm-node { grid-column: 2; grid-row: 1; justify-self: center; }
  .rm-item:nth-child(even) .rm-node { grid-column: 2; grid-row: 1; justify-self: center; border-color: var(--gold); color: var(--gold); }
  .rm-item:nth-child(even) .rm-card { grid-column: 3; grid-row: 1; text-align: left; }
}

/* 6. 2-COLUMN FAQ ACCORDION */
.faq-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}
@media (min-width: 760px) {
  .faq-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 15px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-chev {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--soft);
  color: var(--ai);
  display: grid;
  place-items: center;
  flex: none;
  transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease;
}
.faq-item[open] .faq-chev {
  transform: rotate(180deg);
  background: var(--red);
  color: #fff;
}
.faq-body {
  padding: 0 18px 16px;
  font-size: 14px;
  color: var(--mut);
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

/* 7. DEEP NAVY FOOTER WITH SEIGAIHA MOTIF */
.lp-footer {
  position: relative;
  z-index: 10;
  margin-top: auto;
  background: var(--navy-deep);
  color: #dce6f4;
  padding: 44px 18px 28px;
  border-top: 4px solid var(--gold);
}
.lp-footer a { color: #b8c8df; }
.lp-footer a:hover { color: #fff; }
.lp-footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}
@media (min-width: 780px) {
  .lp-footer-inner { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
}
.lp-footer-bottom {
  max-width: 1180px;
  margin: 28px auto 0;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: #93a7c4;
}

/* 8. FLOATING BOTTOM-RIGHT UTILITIES (Scroll Top + Quick Study FAB) */
.lp-fab-stack {
  position: fixed;
  right: 16px;
  bottom: 18px;
  z-index: 55;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}
.lp-fab {
  min-width: 48px;
  min-height: 48px;
  border-radius: 999px;
  border: 0;
  background: var(--red);
  color: #fff;
  box-shadow: 0 10px 24px -6px rgba(215, 38, 61, 0.55);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  font-weight: 700;
  font-size: 14px;
  transition: transform 0.18s ease, opacity 0.2s ease;
}
.lp-fab:hover { transform: translateY(-2px); background: var(--red-hover); }
.lp-fab.top-btn {
  padding: 0;
  width: 46px;
  height: 46px;
  background: var(--ai);
  box-shadow: 0 8px 20px -6px rgba(20, 37, 61, 0.5);
  opacity: 0;
  pointer-events: none;
}
.lp-fab.top-btn.show { opacity: 1; pointer-events: auto; }

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.reveal.in { opacity: 1; transform: none; }
