/* よろず留学 — shared custom styles
   Tailwind (CDN) handles utilities; this file holds effects the design system
   describes that aren't expressible as plain utility classes. */

/* Smooth in-page scrolling, offset for the sticky header */
html {
  scroll-behavior: smooth;
}
:target {
  scroll-margin-top: 96px;
}

/* Brand wordmark "よろず留学" — soft handwritten style (Klee One) */
.font-brand {
  font-family: 'Klee One', 'Zen Kaku Gothic New', sans-serif;
  letter-spacing: 0.04em;
  font-weight: 600 !important;  /* Klee One ships 400/600 only — avoid faux-bold */
}

/* Material Symbols default weight */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  user-select: none;
}
.material-symbols-outlined[data-weight="fill"],
.material-symbols-outlined.fill {
  font-variation-settings: 'FILL' 1;
}

/* Image / hero gradient overlays (DESIGN.md: text legibility over photos) */
.image-overlay {
  background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.4) 100%);
}
.image-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.4) 0%, transparent 50%);
  border-radius: inherit;
}
.hero-overlay {
  background: linear-gradient(to right, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.2) 100%);
}

/* Ambient hover (DESIGN.md: 1.02x scale + soft Global Blue shadow) */
.ambient-hover {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.ambient-hover:hover {
  transform: scale(1.02);
  box-shadow: 0 20px 40px -10px rgba(0, 63, 156, 0.18);
}

/* Floating decorative image (contact hero) */
@keyframes float {
  0%   { transform: translateY(0px); }
  50%  { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}
.animate-float {
  animation: float 6s ease-in-out infinite;
}

/* ---------- Hero auto-rotating carousel ---------- */
.hero-slide {
  opacity: 0;
  transition: opacity 1.2s ease;
  will-change: opacity;
}
.hero-slide.is-active {
  opacity: 1;
}

/* Auto-scrolling coverflow filmstrip: 7 cards visible, centre card enlarges */
.hero-carousel {
  width: 100%;
  height: 184px;          /* tall enough for the centre card to scale up */
  overflow: hidden;       /* clip horizontally; vertical fits within height */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}
.hero-track {
  display: flex;
  height: 100%;
  align-items: center;
  width: max-content;
  will-change: transform;
}
.hero-card {
  flex: 0 0 auto;
  box-sizing: border-box;
  padding: 0 6px;
  height: 100%;
  display: flex;
  align-items: center;
}
.hero-card-inner {
  position: relative;
  width: 100%;
  height: 104px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.35);
  transform: scale(1);
  transform-origin: center center;
  transition: border-color 0.25s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.4);
}
.hero-card-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}
.hero-card-grad {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, transparent 60%);
}
.hero-card-label {
  position: absolute;
  bottom: 6px;
  left: 8px;
  right: 8px;
  z-index: 2;
  color: #fff;
  font-family: 'Plus Jakarta Sans', 'Noto Sans JP', sans-serif;
  font-weight: 600;
  font-size: 11px;
  line-height: 1.2;
  text-align: left;
  opacity: 0;
  transition: opacity 0.3s ease;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}
.hero-card.is-center {
  z-index: 10;
}
.hero-card.is-center .hero-card-inner {
  border-color: #fb7800;  /* Inspiration Orange */
  box-shadow: 0 18px 44px -12px rgba(0, 0, 0, 0.6);
}
.hero-card.is-center .hero-card-label {
  opacity: 1;
}

/* ---------- Mobile navigation menu ---------- */
.mobile-menu {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.35s ease, opacity 0.25s ease;
}
.mobile-menu.open {
  max-height: 480px;
  opacity: 1;
}

/* ---------- FAQ accordion ---------- */
.faq-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

/* ---------- Form: success toast & inline errors ---------- */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(160%);
  z-index: 80;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.toast.show {
  transform: translateX(-50%) translateY(0);
}

.field-error {
  border-color: #ba1a1a !important;
}
.error-text {
  color: #ba1a1a;
  font-size: 13px;
  line-height: 18px;
  margin-top: 4px;
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .animate-float { animation: none; }
  .ambient-hover, .mobile-menu, .faq-panel, .toast { transition: none; }
  .hero-slide { transition: opacity 0.2s ease; }
  .hero-card-inner { transition: none; }
}

/* ============================================================
   Sakura loading screen — a cherry tree pops in and petals
   flutter down, then the overlay fades to reveal the page.
   ============================================================ */
html.loading,
html.loading body { overflow: hidden; }

.sakura-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 10%, #fff7fa 0%, #ffeef4 45%, #fdf3ec 100%);
  transition: opacity 0.9s ease, visibility 0.9s ease;
}
.sakura-loader.done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.sakura-scene {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  text-align: center;
}

.sakura-tree {
  width: min(68vw, 320px);
  height: auto;
  transform-origin: 50% 100%;
  animation: sakuraTreeIn 1s cubic-bezier(0.18, 0.9, 0.3, 1.25) both;
  filter: drop-shadow(0 16px 22px rgba(180, 90, 130, 0.2));
}
.sakura-canopy {
  transform-origin: 50% 62%;
  animation: sakuraCanopyPuff 1.1s cubic-bezier(0.2, 0.8, 0.2, 1.2) both;
  animation-delay: 0.22s;
}

.sakura-brand {
  font-size: clamp(22px, 6vw, 34px);
  color: #b3416b;
  letter-spacing: 0.08em;
  opacity: 0;
  animation: sakuraBrandIn 0.8s ease forwards;
  animation-delay: 0.7s;
}
.sakura-sub {
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.42em;
  color: #cf94ac;
  opacity: 0;
  animation: sakuraBrandIn 0.8s ease forwards;
  animation-delay: 0.95s;
}

.sakura-petals {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

/* Spinning loading indicator, bottom-right */
.sakura-spinner {
  position: absolute;
  right: 24px;
  bottom: 24px;
  z-index: 4;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid rgba(214, 78, 134, 0.18);
  border-top-color: #d6688f;
  border-right-color: #e98cae;
  animation: sakuraSpin 0.8s linear infinite;
}
@keyframes sakuraSpin {
  to { transform: rotate(360deg); }
}
.petal {
  position: absolute;
  top: -12vh;
  width: 14px;
  height: 14px;
  border-radius: 100% 0 100% 0;
  opacity: 0;
  will-change: transform, opacity;
  box-shadow: inset 0 0 4px rgba(255, 255, 255, 0.5);
}

@keyframes sakuraTreeIn {
  0%   { transform: translateY(26px) scale(0.55) rotate(-2deg); opacity: 0; }
  55%  { transform: translateY(0) scale(1.06) rotate(1deg); opacity: 1; }
  75%  { transform: scale(0.98) rotate(0deg); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes sakuraCanopyPuff {
  0%   { transform: scale(0.2); opacity: 0; }
  60%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); }
}
@keyframes sakuraBrandIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
@keyframes petalFall {
  0%   { transform: translate(0, -12vh) rotate(0deg); opacity: 0; }
  8%   { opacity: 1; }
  25%  { transform: translate(38px, 18vh) rotate(110deg); }
  50%  { transform: translate(-28px, 46vh) rotate(220deg); }
  75%  { transform: translate(34px, 74vh) rotate(330deg); }
  100% { transform: translate(-8px, 114vh) rotate(460deg); opacity: 0.5; }
}

@media (prefers-reduced-motion: reduce) {
  .sakura-tree,
  .sakura-canopy,
  .sakura-brand,
  .sakura-sub { animation-duration: 0.01ms !important; animation-delay: 0ms !important; opacity: 1; }
  .petal { display: none; }
  .sakura-spinner { animation-duration: 1.6s; }
}

/* ---------- Credo section (我らの信条) ----------
   印刷物(志カード・信条PDF)と同じ 藍×朱×生成り の世界観。
   サイトの青×オレンジの中で、ここだけ「紙」の空気に変える。 */
.credo-section {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(191, 63, 34, 0.04), transparent 55%),
    #faf7ef; /* 生成り */
  border-top: 1px solid rgba(191, 63, 34, 0.25);
  border-bottom: 1px solid rgba(191, 63, 34, 0.25);
}
.font-credo {
  font-family: 'Zen Old Mincho', 'Klee One', serif;
}
.credo-label {
  font-family: 'Outfit', 'Zen Kaku Gothic New', sans-serif;
  font-size: 12px;
  letter-spacing: 0.35em;
  font-weight: 600;
  color: #bf3f22; /* 朱 */
  margin-bottom: 16px;
}
.credo-title {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #24406b; /* 藍 */
  margin-bottom: 20px;
}
.credo-rule {
  width: 56px;
  height: 2px;
  background: #bf3f22;
  margin: 0 auto 48px;
}
.credo-body p {
  color: #24406b;
  font-size: 15.5px;
  line-height: 2.3;
  margin-bottom: 36px;
}
.credo-body p:last-of-type {
  margin-bottom: 0;
}
.credo-signature {
  font-weight: 700;
  letter-spacing: 0.06em;
}
/* 一行ずつの改行はデスクトップのみ。モバイルは流し組みで読ませる */
.credo-br { display: none; }
@media (min-width: 768px) {
  .credo-br { display: inline; }
  .credo-body p { font-size: 16.5px; }
}
/* 朱の角印(印刷物の落款と同じ「万留学」) */
.credo-seal-wrap {
  display: flex;
  justify-content: center;
  margin-top: 48px;
}
.credo-seal {
  width: 52px;
  height: 52px;
  background: #bf3f22;
  border-radius: 5px;
  color: #faf7ef;
  font-family: 'Zen Old Mincho', serif;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(191, 63, 34, 0.25);
}
/* スクロールで段落がひとつずつ立ち上がる */
.credo-fade {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}
.credo-fade.is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .credo-fade { opacity: 1; transform: none; transition: none; }
}

/* ---------- Credo: ヒーロー直下配置用の折りたたみ ---------- */
/* 第一の責任だけ見せて、第二以降は「つづきを読む」で展開する */
.credo-more {
  max-height: 150px;
  overflow: hidden;
  position: relative;
  transition: max-height 1.2s ease;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 92%);
  mask-image: linear-gradient(to bottom, #000 0%, transparent 92%);
}
.credo-more.is-open {
  max-height: 6000px;
  -webkit-mask-image: none;
  mask-image: none;
}
.credo-expand-wrap {
  margin-top: 12px;
}
.credo-expand-wrap.is-hidden {
  display: none;
}
.credo-expand {
  font-family: 'Outfit', 'Zen Kaku Gothic New', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: #bf3f22;
  background: transparent;
  border: 1px solid #bf3f22;
  border-radius: 9999px;
  padding: 10px 30px;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease;
}
.credo-expand:hover {
  background: #bf3f22;
  color: #faf7ef;
}
