/* ==========================================================================
   Best Academy — site styles
   Rebrand here: every colour, font and radius lives in :root below.
   ========================================================================== */

:root {
  /* Brand palette, sampled from the Best Academy logo (yellow / blue B / red A) */
  --brand-yellow: #fbee50;
  --brand-blue: #4294f7;
  --brand-red: #e83b2d;
  --brand-blue-ink: #1d64c4;  /* blue dark enough for white text (AA) */
  --bg: #faf6f0;            /* warm off-white page background */
  --bg-elev: #fffdf9;       /* cards, panels */
  --bg-tint: #f3ece2;       /* subtle section tint */
  --ink: #1f2a44;           /* primary text, deep ink-navy */
  --ink-soft: #46506a;      /* secondary text */
  --muted: #5d6578;         /* small print (passes WCAG AA on --bg) */
  --line: #e6ddd0;          /* hairlines, borders */
  --accent: #e83b2d;        /* brand red, decorative only */
  --accent-ink: #c0281b;    /* red dark enough for text and focus rings */
  --gold: #e3b81e;
  --sky: #7cc4f2;

  /* Book colours (only light blue and pink are confirmed) */
  --book-lightblue: #9fd3ef;
  --book-pink: #f5b8c6;
  --book-neutral: #d9d2c7;
  /* TODO: the real cover colours of books 1–6 (ask Pete). Each falls back
     to neutral until it is set. */
  --book-1: var(--book-neutral);
  --book-2: var(--book-neutral);
  --book-3: var(--book-neutral);
  --book-4: var(--book-neutral);
  --book-5: var(--book-neutral);
  --book-6: var(--book-neutral);

  /* Background dot colours, read by background.js */
  --dot-1: #4294f7;
  --dot-2: #e83b2d;
  --dot-3: #e3b81e;
  --dot-4: #7cc4f2;

  /* Type */
  --font-display: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Hiragino Sans", "Noto Sans JP", sans-serif;
  --font-body: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;

  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(31, 42, 68, 0.04), 0 12px 32px -12px rgba(31, 42, 68, 0.14);
  --container: 1120px;
  --gutter: 16px;
  --header-h: 64px;
}

@media (min-width: 768px) {
  :root { --gutter: 32px; --header-h: 76px; }
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 8px);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  /* Static gradient: always painted first, and the only background when
     WebGL is unavailable or motion is reduced. */
  background-image:
    radial-gradient(60vmax 50vmax at 85% 10%, rgba(66, 148, 247, 0.12), transparent 70%),
    radial-gradient(55vmax 45vmax at 10% 90%, rgba(251, 238, 80, 0.22), transparent 70%),
    radial-gradient(40vmax 40vmax at 50% 50%, rgba(232, 59, 45, 0.05), transparent 70%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.9;
  letter-spacing: 0.04em;
  -webkit-font-smoothing: antialiased;
}
html[lang="en"] body { letter-spacing: 0.005em; line-height: 1.7; }

img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--accent-ink); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: 0.06em;
  margin: 0 0 0.6em;
  font-feature-settings: "palt";
  /* Natural Japanese line breaks at phrase boundaries (Chrome 119+) */
  /* Japanese headings break only at <wbr> phrase marks or punctuation */
  word-break: keep-all;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
html[lang="en"] h1, html[lang="en"] h2, html[lang="en"] h3 { letter-spacing: 0; line-height: 1.2; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 8px; top: -100px; z-index: 100;
  background: var(--ink); color: #fff; padding: 8px 16px; border-radius: 8px; text-decoration: none;
}
.skip-link:focus { top: 8px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }

/* Placeholder marker: anything the client still has to confirm */
.tbc {
  font-family: var(--font-body);
  font-size: 0.85em;
  color: var(--accent-ink);
  background: rgba(232, 59, 45, 0.08);
  border: 1px dashed rgba(192, 40, 27, 0.5);
  border-radius: 6px;
  padding: 0 0.4em;
  letter-spacing: 0;
  white-space: nowrap;
}
.todo {
  display: block;
  margin: 0.5em 0;
  padding: 0.6em 0.9em;
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--accent-ink);
  background: rgba(232, 59, 45, 0.06);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
}

/* Language blocks used on long pages (legal). Short copy uses i18n.js. */
html:not([lang="en"]) [data-lang="en"],
html[lang="en"] [data-lang="ja"] { display: none !important; }

/* --------------------------------------------------------------------------
   Animated background layers
   -------------------------------------------------------------------------- */
.bg-layer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100lvh;
  pointer-events: none;
  z-index: -1;
}
#bg-canvas { opacity: 0; transition: opacity 1.4s ease; }
html.bg-ready #bg-canvas { opacity: 1; }
html.no-webgl .bg-layer { display: none; }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: rgba(250, 246, 240, 0.82);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); box-shadow: 0 6px 20px -16px rgba(31, 42, 68, 0.3); }
.header-inner { height: 100%; display: flex; align-items: center; gap: 16px; }

.wordmark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.wordmark-mark { width: 40px; height: 40px; border-radius: 10px; flex: none; }
@media (min-width: 768px) { .wordmark-mark { width: 44px; height: 44px; } }
.wordmark-text {
  display: flex; flex-direction: column; line-height: 1.15;
  font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; letter-spacing: 0.02em;
}
.wordmark-text small { font-family: var(--font-body); font-weight: 500; font-size: 0.65rem; color: var(--muted); letter-spacing: 0.12em; }

.site-nav { display: none; gap: 28px; }
.site-nav a { text-decoration: none; font-size: 0.9rem; font-weight: 500; color: var(--ink-soft); padding: 6px 0; position: relative; }
.site-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 0.3s ease;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a:hover::after { transform: scaleX(1); }
@media (min-width: 900px) { .site-nav { display: flex; } }

.header-actions { display: flex; align-items: center; gap: 10px; }
.lang-toggle, .app-link {
  font: inherit; font-size: 0.82rem; font-weight: 700; letter-spacing: 0.04em;
  min-height: 40px; padding: 0 14px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; text-decoration: none;
}
.lang-toggle { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.lang-toggle:hover { border-color: var(--ink-soft); }
.lang-toggle svg { width: 16px; height: 16px; }
.app-link { background: var(--ink); color: #fff; border: 1px solid var(--ink); }
.app-link[hidden] { display: none; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px 10px;
  min-height: 52px; padding: 6px 26px; border-radius: 999px;
  /* A label that doesn't fit wraps between its parts, never mid-word */
  word-break: keep-all; text-align: center;
  font: inherit; font-weight: 700; font-size: 0.98rem; letter-spacing: 0.06em; text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.btn svg { width: 18px; height: 18px; transition: transform 0.25s ease; }
.btn-primary { background: var(--brand-blue-ink); color: #fff; box-shadow: 0 10px 24px -12px rgba(29, 100, 196, 0.7); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -12px rgba(29, 100, 196, 0.7); }
.btn-primary:hover svg { transform: translateY(2px); }
.btn-ghost { color: var(--ink); background: rgba(255, 253, 249, 0.7); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--ink-soft); }

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
.section { position: relative; padding: clamp(48px, 6vw, 88px) 0; }
.section-tight { padding: clamp(40px, 5vw, 72px) 0; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.18em; color: var(--accent-ink);
  margin-bottom: 1.2em;
}
.eyebrow::before { content: ""; width: 24px; height: 2px; border-radius: 2px; background: var(--accent); }
html[lang="en"] .eyebrow { letter-spacing: 0.12em; text-transform: uppercase; }

.section-title { font-size: clamp(1.7rem, 1.2rem + 2.4vw, 2.75rem); }
.lead { font-size: clamp(1rem, 0.95rem + 0.3vw, 1.125rem); color: var(--ink-soft); max-width: 34em; }

/* Soft halo so text always sits on clean space above the dot field */
.halo { position: relative; }
.halo::before {
  content: ""; position: absolute; inset: -40px calc(var(--gutter) * -1); z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(250, 246, 240, 0.94) 55%, rgba(250, 246, 240, 0));
}

/* Desktop: alternate the text column so the 3D shape has its own side */
@media (min-width: 900px) {
  .split { display: grid; grid-template-columns: repeat(12, 1fr); gap: 32px; align-items: center; }
  .split > .split-copy { grid-column: 1 / span 6; }
  .split.is-wide > .split-copy { grid-column: 1 / span 8; }
  .split.is-right > .split-copy { grid-column: 7 / span 6; }
}

/* Hero ------------------------------------------------------------------- */
.hero { padding: clamp(32px, 5vw, 56px) 0 clamp(56px, 8vw, 96px); }
.hero-title { font-size: clamp(2.1rem, 1.2rem + 3.2vw, 3.5rem); letter-spacing: 0.05em; margin-bottom: 0.5em; }
html[lang="en"] .hero-title { letter-spacing: -0.01em; }
.hero-copy { max-width: 620px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.scroll-cue {
  position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%);
  display: none; flex-direction: column; align-items: center; gap: 8px;
  font-size: 0.7rem; letter-spacing: 0.2em; color: var(--muted); text-decoration: none; text-transform: uppercase;
}
.scroll-cue span.line { width: 1px; height: 40px; background: linear-gradient(var(--muted), transparent); }


/* Stages (who we teach) -------------------------------------------------- */
.stages { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 10px; }
.stage {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  padding: 14px 18px; border-radius: var(--radius-sm);
  background: rgba(255, 253, 249, 0.86); border: 1px solid var(--line);
}
.stage-name { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.stage-detail { font-size: 0.85rem; color: var(--muted); }

/* Curriculum / level ladder ---------------------------------------------- */
.levels { list-style: none; margin: 24px 0 20px; padding: 0; display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; align-items: end; }
/* Labels get a fixed two-line box so a two-line label (Light Blue) doesn't
   lift its bar above the others. */
.level { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.level-bar {
  width: 100%; border-radius: 8px 8px 4px 4px;
  background: var(--book-neutral);
  height: calc(24px + var(--i) * 10px);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.05);
  transform-origin: bottom;
}
.level[data-book="lightblue"] .level-bar { background: var(--book-lightblue); }
.level[data-book="pink"] .level-bar { background: var(--book-pink); }
.level[data-book="1"] .level-bar { background: var(--book-1); }
.level[data-book="2"] .level-bar { background: var(--book-2); }
.level[data-book="3"] .level-bar { background: var(--book-3); }
.level[data-book="4"] .level-bar { background: var(--book-4); }
.level[data-book="5"] .level-bar { background: var(--book-5); }
.level[data-book="6"] .level-bar { background: var(--book-6); }
.level-label { font-size: 0.72rem; font-weight: 700; color: var(--ink-soft); letter-spacing: 0; text-align: center; line-height: 1.3; min-height: 2.6em; }
.levels-legend { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--muted); margin-top: -12px; margin-bottom: 24px; }

.note-card {
  padding: 18px 20px; border-radius: var(--radius-sm);
  background: rgba(255, 253, 249, 0.9); border: 1px solid var(--line);
  font-size: 0.95rem; margin-bottom: 16px;
}
.note-card strong { font-family: var(--font-display); }
.text-link { color: var(--accent-ink); font-weight: 700; text-underline-offset: 4px; }
.small-print { font-size: 0.85rem; color: var(--muted); }
.ext-icon { display: inline-block; width: 0.9em; height: 0.9em; vertical-align: -0.05em; margin-left: 0.2em; }

/* Branch selector -------------------------------------------------------- */
.branches-head { max-width: 640px; margin-bottom: 40px; }
@media (min-width: 900px) { .branches-head { text-align: center; margin: 0 auto 56px; } .branches-head .lead { margin-inline: auto; } }
.branch-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .branch-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .branch-grid { grid-template-columns: repeat(4, 1fr); gap: 18px; } }

.branch-card {
  position: relative; display: flex; flex-direction: column; height: 100%;
  padding: 20px 20px 18px;
  border-radius: var(--radius); text-decoration: none;
  background: rgba(255, 253, 249, 0.88);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease, border-color 0.35s ease;
  overflow: hidden;
}
.branch-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--card-tone, var(--accent));
}
.branch-card:hover { transform: translateY(-4px); box-shadow: 0 2px 4px rgba(31, 42, 68, 0.05), 0 22px 44px -18px rgba(31, 42, 68, 0.28); border-color: #d8cbb8; }
.branch-num { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.2em; color: var(--muted); }
.branch-name { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; margin: 6px 0 2px; letter-spacing: 0.08em; }
html[lang="en"] .branch-name { letter-spacing: 0; }
.branch-latin { font-size: 0.8rem; color: var(--muted); letter-spacing: 0.14em; text-transform: uppercase; }
.branch-area { font-size: 0.88rem; color: var(--ink-soft); margin-top: 14px; }
.branch-cta {
  margin-top: auto; padding-top: 20px;
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 0.92rem; color: var(--ink);
}
.branch-cta svg { width: 18px; height: 18px; transition: transform 0.3s ease; }
.branch-card:hover .branch-cta svg { transform: translateX(4px); }

/* --------------------------------------------------------------------------
   Inner pages (branch placeholders, legal)
   -------------------------------------------------------------------------- */
.page-hero { padding: 72px 0 32px; }
.page-hero .section-title { margin-bottom: 0.3em; }
@media (min-width: 768px) { .legal-head { padding-inline: 48px; } }
.breadcrumb { font-size: 0.82rem; color: var(--muted); margin-bottom: 20px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb ol { list-style: none; padding: 0; margin: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumb li + li::before { content: "/"; margin-right: 8px; opacity: 0.6; }

.panel {
  background: rgba(255, 253, 249, 0.94);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 22px;
}
@media (min-width: 768px) { .panel { padding: 44px 48px; } }

.coming-soon { text-align: center; padding: 56px 22px; }
.coming-soon .badge {
  display: inline-block; padding: 4px 14px; border-radius: 999px; font-size: 0.8rem; font-weight: 700;
  background: rgba(143, 185, 168, 0.22); color: #2f5d4c; margin-bottom: 18px;
}

.legal { max-width: 820px; margin: 0 auto 96px; }
.legal-head { margin-bottom: 0; }
.page-end { height: 96px; }
.legal h2 { font-size: 1.15rem; margin: 2.2em 0 0.7em; padding-top: 0.2em; }
.legal h2:first-child { margin-top: 0; }
.legal ol, .legal ul { padding-left: 1.4em; margin: 0 0 1em; }
.legal li { margin-bottom: 0.35em; }
.legal-meta { font-size: 0.85rem; color: var(--muted); margin-top: 2.5em; }
.legal-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.legal-table th, .legal-table td { text-align: left; vertical-align: top; padding: 16px 0; border-bottom: 1px solid var(--line); }
.legal-table th { width: 32%; padding-right: 20px; font-weight: 700; color: var(--ink); }
@media (max-width: 640px) {
  .legal-table, .legal-table tbody, .legal-table tr, .legal-table th, .legal-table td { display: block; width: 100%; }
  .legal-table th { border-bottom: 0; padding-bottom: 2px; }
  .legal-table td { padding-top: 2px; }
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer { position: relative; background: var(--ink); color: #e9e6e0; padding: 64px 0 32px; font-size: 0.88rem; }
.site-footer a { color: #e9e6e0; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; text-underline-offset: 4px; }
.footer-grid { display: grid; gap: 40px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1.2fr; } }
.footer-brand .wordmark-text small { color: #a9afbd; }
.footer-lockup { width: 120px; height: auto; border-radius: 16px; margin-bottom: 4px; }
.footer-brand address { font-style: normal; margin-top: 18px; line-height: 1.9; color: #c9ccd4; }
.footer-heading { font-family: var(--font-display); font-size: 0.8rem; letter-spacing: 0.18em; color: #a9afbd; margin: 0 0 14px; font-weight: 700; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-app { margin-top: 24px; }
.footer-app .app-link { background: transparent; border-color: #5a6480; }
.copyright { margin: 48px 0 0; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, 0.12); font-size: 0.78rem; color: #a9afbd; }

/* --------------------------------------------------------------------------
   Entrance animation initial states (only when GSAP will run them)
   -------------------------------------------------------------------------- */
.split-word { display: inline-block; will-change: transform, opacity; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* --------------------------------------------------------------------------
   Hero slogan, gallery, branch photos
   -------------------------------------------------------------------------- */
.hero-slogan {
  display: inline-block; margin: -0.2em 0 1.2em; padding: 2px 12px;
  font-family: var(--font-display); font-weight: 700; font-size: clamp(1rem, 0.9rem + 0.6vw, 1.3rem);
  letter-spacing: 0.02em; color: var(--brand-blue-ink);
  background: linear-gradient(transparent 55%, rgba(251, 238, 80, 0.75) 55%);
}

.gallery-head { max-width: 640px; margin-bottom: 32px; }
.gallery {
  list-style: none; margin: 0; padding: 0 var(--gutter);
  display: grid; grid-auto-flow: column; grid-auto-columns: 72%; gap: 12px;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  margin-inline: calc(var(--gutter) * -1);
}
.gallery::-webkit-scrollbar { display: none; }
.gallery li { scroll-snap-align: center; }
.gallery figure { margin: 0; }
.gallery img {
  width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover;
  border-radius: var(--radius); box-shadow: var(--shadow); background: var(--bg-tint);
}
@media (min-width: 640px) { .gallery { grid-auto-columns: 42%; } }
@media (min-width: 1000px) {
  .gallery { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); overflow: visible; padding: 0; margin: 0; gap: 16px; }
  .gallery img { aspect-ratio: 4 / 3; }
}
.gallery-note { margin-top: 56px; }

.branch-photo { margin: 0 0 24px; }
.branch-photo img { width: 100%; height: auto; border-radius: var(--radius); box-shadow: var(--shadow); }
.branch-contact { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 6px; }
.branch-contact a { color: var(--brand-blue-ink); font-weight: 700; }

/* --------------------------------------------------------------------------
   v2 layout: hero collage, journey, branch badges, contact card
   -------------------------------------------------------------------------- */
.hero-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: 1.05fr 0.95fr; gap: 56px; } }

.hero-facts { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; margin: 28px 0 0; padding: 0; }
.hero-facts li {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 8px 16px; border-radius: 999px;
  background: rgba(255, 253, 249, 0.9); border: 1px solid var(--line);
  font-size: 0.85rem; color: var(--ink-soft);
}
.hero-facts strong { font-family: var(--font-display); font-size: 1.15rem; color: var(--ink); letter-spacing: 0.02em; }

.hero-visual { position: relative; width: 100%; max-width: 560px; margin: 0 auto; aspect-ratio: 1 / 0.95; }
.hero-visual::before {
  content: ""; position: absolute; inset: 8% 4% 4% 10%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(251, 238, 80, 0.75), rgba(251, 238, 80, 0));
  z-index: 0;
}
.hv { position: absolute; margin: 0; border-radius: 26px; overflow: hidden; background: var(--bg-tint);
  border: 6px solid #fff; box-shadow: 0 2px 4px rgba(31, 42, 68, 0.06), 0 24px 48px -20px rgba(31, 42, 68, 0.35); }
.hv img { width: 100%; height: 100%; object-fit: cover; }
.hv-1 { width: 50%; aspect-ratio: 4 / 5; left: 2%; top: 4%; transform: rotate(-4deg); z-index: 2; }
.hv-2 { width: 46%; aspect-ratio: 4 / 5; right: 2%; top: 16%; transform: rotate(3deg); z-index: 1; }
.hv-3 { width: 34%; aspect-ratio: 4 / 5; left: 34%; bottom: 0; transform: rotate(-1deg); z-index: 3; }
.hv-mascot { position: absolute; width: 22%; height: auto; right: 0; top: -4%; transform: rotate(8deg); z-index: 4;
  border-radius: 22%; box-shadow: 0 14px 30px -14px rgba(31, 42, 68, 0.45); }
.hv-bubble {
  position: absolute; right: 22%; top: -6%; z-index: 5;
  font-family: var(--font-display); font-weight: 700; font-size: clamp(0.85rem, 0.7rem + 0.6vw, 1.1rem); letter-spacing: 0;
  background: #fff; color: var(--brand-blue-ink); padding: 8px 14px; border-radius: 16px;
  box-shadow: 0 10px 24px -14px rgba(31, 42, 68, 0.5);
}
.hv-bubble::after { content: ""; position: absolute; right: -6px; bottom: 8px; border: 7px solid transparent; border-left-color: #fff; }
/* Small screens: keep every photo, the mascot and the bubble fully inside
   the container (which already has the 16px gutter). Insets leave room for
   the rotation and the white border. */
@media (max-width: 959px) {
  .hero-visual { max-width: 440px; margin-top: 8px; }
  .hv { border-width: 4px; border-radius: 20px; }
  .hv-1 { left: 4%; top: 10%; width: 48%; transform: rotate(-2.5deg); }
  .hv-2 { right: 4%; top: 20%; width: 44%; transform: rotate(2deg); }
  .hv-3 { left: 34%; bottom: 2%; width: 32%; transform: none; }
  .hv-mascot { right: 3%; top: 0; width: 20%; transform: rotate(5deg); }
  .hv-bubble { right: 26%; top: 2%; }
}

.section-head { max-width: 680px; margin-bottom: 40px; }

.journey { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; position: relative; }
.journey-step {
  position: relative; display: grid; grid-template-columns: 56px 1fr; grid-template-rows: auto auto; column-gap: 16px; align-items: center;
  padding: 16px 18px; border-radius: var(--radius);
  background: rgba(255, 253, 249, 0.92); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.journey-dot {
  grid-row: 1 / span 2; width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center;
  background: #e8f1fd; color: var(--brand-blue-ink);
}
.journey-dot svg { width: 28px; height: 28px; }
.journey-name { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; }
.journey-detail { font-size: 0.82rem; color: var(--muted); }
@media (min-width: 900px) {
  /* One column per item, whatever the count: the homepage has five
     stages, a branch page three or four. The connector line below is
     drawn across the row, so a fixed column count would leave it
     hanging past the last card. */
  .journey { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 16px; }
  .journey::before {
    content: ""; position: absolute; left: 10%; right: 10%; top: 56px; height: 2px; border-radius: 2px;
    background: var(--line);
  }
  .journey-step { grid-template-columns: 1fr; grid-template-rows: auto; justify-items: center; align-content: start; text-align: center; padding: 24px 14px 22px; gap: 8px; }
  .journey-dot { grid-row: auto; width: 64px; height: 64px; }
}

/* Book-like level bars */
.level-bar { position: relative; }
.level-bar::after { content: ""; position: absolute; left: 50%; top: 10px; bottom: 10px; width: 2px; margin-left: -1px; border-radius: 2px; background: rgba(255, 255, 255, 0.55); }

.branch-top { display: flex; align-items: center; justify-content: space-between; }
.branch-badge {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; letter-spacing: 0;
  background: var(--card-tone, var(--accent)); color: #fff; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.1);
}
.branch-card::before { height: 6px; }

.cta-card {
  position: relative; display: grid; gap: 24px; align-items: center;
  padding: 36px 24px; border-radius: 32px;
  background: var(--brand-yellow);
  background-image: radial-gradient(circle at 90% 10%, rgba(255, 255, 255, 0.5), transparent 40%);
  box-shadow: 0 2px 4px rgba(31, 42, 68, 0.06), 0 30px 60px -30px rgba(31, 42, 68, 0.4);
}
.cta-mascot { width: 96px; height: auto; border-radius: 22%; box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.6); }
.cta-copy p { color: #3a3f2a; margin-bottom: 20px; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cta-card .btn-ghost { background: rgba(255, 255, 255, 0.8); border-color: transparent; }
@media (min-width: 768px) {
  .cta-card { grid-template-columns: auto 1fr; padding: 48px 56px; gap: 40px; }
  .cta-mascot { width: 160px; }
}

html[lang="en"] .branch-latin { display: none; }

/* --------------------------------------------------------------------------
   School page (Kawasaki): info cards and timetable
   -------------------------------------------------------------------------- */
.k-info { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
@media (min-width: 800px) { .k-info { grid-template-columns: repeat(3, 1fr); gap: 18px; } }
.k-card { padding: 22px 22px 18px; border-radius: var(--radius); background: rgba(255, 253, 249, 0.94); border: 1px solid var(--line); box-shadow: var(--shadow); }
.k-card p { margin: 0 0 0.6em; }
.k-card-title { font-size: 0.82rem; letter-spacing: 0.16em; color: var(--accent-ink); margin: 0 0 8px; }
html[lang="en"] .k-card-title { text-transform: uppercase; letter-spacing: 0.1em; }

.tt { display: grid; gap: 14px; align-items: start; }
@media (min-width: 700px) { .tt { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .tt { grid-template-columns: repeat(3, 1fr); gap: 18px; } }
.tt-day { padding: 18px 18px 12px; border-radius: var(--radius); background: rgba(255, 253, 249, 0.96); border: 1px solid var(--line); box-shadow: var(--shadow); }
.tt-day.is-empty { box-shadow: none; background: rgba(255, 253, 249, 0.7); }
.tt-day-name { font-size: 1.05rem; margin: 0 0 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.tt-list { list-style: none; margin: 0; padding: 0; }
.tt-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.tt-row:last-child { border-bottom: 0; }
.tt-time { font-variant-numeric: tabular-nums; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap; }
.tt-group { font-size: 0.85rem; font-weight: 500; padding: 3px 10px; border-radius: 999px; text-align: right; color: var(--ink); background: #eef1f6; }
.tt-kindergarten { background: #fdf6c7; }
.tt-elementary { background: #e3eefc; }
.tt-juniorhigh, .tt-highschool { background: #fbe3e0; }
.tt-adults { background: #ece8df; }
.tt-private { background: #e6f3ec; }
.tt-none { color: var(--muted); margin: 0 0 6px; }
.tt-note { margin: 20px 0 0; padding: 14px 18px; border-radius: var(--radius-sm); background: rgba(255, 253, 249, 0.94); border: 1px solid var(--line); font-weight: 500; }
.cta-mail { margin: 12px 0 0; font-size: 0.9rem; color: #3a3f2a; word-break: break-all; }
.branch-photo { margin: 0 0 8px; }
@media (min-width: 560px) { .branch-card { min-height: 200px; padding: 24px 22px 20px; } }
@media (max-width: 559px) { .branch-area { margin-top: 8px; } .branch-cta { padding-top: 14px; } }

/* --------------------------------------------------------------------------
   School page (Gunma): drawn from assets/data/gunma.js
   -------------------------------------------------------------------------- */
.g-page [hidden] { display: none !important; }
.g-page .section-head { margin-bottom: 28px; }
.g-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
@media (min-width: 800px) { .g-points { grid-template-columns: repeat(3, 1fr); gap: 18px; } }
.g-point {
  display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: var(--radius);
  background: rgba(255, 253, 249, 0.92); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.g-point .journey-dot { flex: none; width: 52px; height: 52px; }
.g-point-text { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; line-height: 1.5; }
.g-cur { max-width: 680px; margin: 0; line-height: 1.9; }
.g-partners {
  list-style: none; margin: 0; padding: 6px 22px; max-width: 680px; border-radius: var(--radius);
  background: rgba(255, 253, 249, 0.94); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.g-partner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 16px; padding: 14px 0; border-bottom: 1px dashed var(--line); }
.g-partner:last-child { border-bottom: 0; }
.g-partner-name { font-weight: 700; }
.g-partner-area { font-size: 0.9rem; color: var(--muted); }
.g-playtime { max-width: 680px; margin: 20px 0 0; }
.g-playtime-title { margin: 0 0 4px; font-family: var(--font-display); font-size: 1.05rem; }
.g-playtime p { margin: 0; }
@media (min-width: 800px) { .g-audiences { grid-template-columns: repeat(2, 1fr); } }
.g-address { max-width: 680px; }
.cta-copy .g-contact-label { margin-bottom: 12px; font-weight: 700; letter-spacing: 0.1em; }
.cta-copy .g-fees { margin: 16px 0 0; font-weight: 500; }

/* --------------------------------------------------------------------------
   Branch pages — one template for every school, drawn from
   assets/data/<school>.js by assets/js/branch-page.js.
   Every block here is used by that template only.
   -------------------------------------------------------------------------- */

/* Other schools: one tap to the right school when someone scans the wrong sign */
.school-switcher { position: relative; z-index: 3; background: rgba(243, 236, 226, 0.75); border-bottom: 1px solid var(--line); backdrop-filter: saturate(140%) blur(6px); }
.sw-inner { display: flex; align-items: center; gap: 12px; padding-top: 10px; padding-bottom: 10px; }
.sw-label { flex: none; margin: 0; font-size: 0.72rem; letter-spacing: 0.14em; color: var(--muted); font-weight: 700; }
@media (max-width: 559px) { .sw-label { display: none; } }
.sw-list { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.sw-list::-webkit-scrollbar { display: none; }
.sw-list > li { flex: none; }
.sw-item {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  padding: 7px 14px 7px 7px; border-radius: 999px; text-decoration: none;
  font-size: 0.88rem; font-weight: 500; color: var(--ink);
  background: var(--bg-elev); border: 1px solid var(--line);
}
.sw-item:hover { border-color: var(--ink-soft); }
.sw-item.is-here { background: var(--ink); color: #fff; border-color: var(--ink); }
.sw-badge {
  width: 24px; height: 24px; flex: none; border-radius: 8px;
  display: grid; place-items: center; font-family: var(--font-display);
  font-size: 0.78rem; font-weight: 700; color: #1f2a44;
  background: var(--card-tone, var(--brand-yellow));
}
.sw-ext { font-size: 0.8rem; color: inherit; opacity: 0.7; }

/* Branch hero */
.bh { padding: clamp(28px, 4vw, 48px) 0 clamp(32px, 5vw, 56px); }
.bh-grid { display: grid; gap: 32px; align-items: center; }
@media (min-width: 960px) { .bh-grid { grid-template-columns: 1.05fr 0.95fr; gap: 48px; } }
.bh-copy { max-width: 620px; }
.bh-copy .hero-title { font-size: clamp(2rem, 1.3rem + 2.8vw, 3.1rem); margin-bottom: 0.2em; }
.bh-area { font-family: var(--font-display); font-weight: 700; color: var(--ink-soft); margin: 0 0 0.8em; }
.bh-photos { display: grid; gap: 10px; }
.bh-photo { margin: 0; border-radius: 22px; overflow: hidden; background: var(--bg-tint); box-shadow: var(--shadow); }
.bh-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bh-photos-2, .bh-photos-3 { grid-template-columns: repeat(2, 1fr); }
.bh-photos-2 > :first-child, .bh-photos-3 > :first-child { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
.bh-photos-3 > :nth-child(2), .bh-photos-3 > :nth-child(3) { aspect-ratio: 1 / 1; }
.bh-photos-2 > :nth-child(2) { aspect-ratio: 16 / 9; }
.bh-photos-1 > :first-child { aspect-ratio: 16 / 9; }

/* No photos of this school yet: brand imagery, never another school's room */
.bh-brand {
  position: relative; display: grid; place-items: center; padding: 36px 20px;
  border-radius: 26px; background:
    radial-gradient(120% 100% at 20% 0%, rgba(251, 238, 80, 0.5), transparent 60%),
    radial-gradient(110% 110% at 90% 100%, rgba(66, 148, 247, 0.22), transparent 60%),
    var(--bg-elev);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.bh-mark { width: 44%; max-width: 190px; height: auto; }
.bh-bubble {
  position: absolute; top: 16px; right: 18px; font-family: var(--font-display); font-weight: 700;
  background: #fff; color: var(--brand-blue-ink); padding: 6px 14px; border-radius: 999px;
  box-shadow: var(--shadow); font-size: 0.9rem;
}

/* Quick facts strip */
.qf { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
@media (min-width: 620px) { .qf { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .qf { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 14px; } }
.qf-item {
  display: flex; align-items: flex-start; gap: 12px; min-width: 0;
  padding: 16px 18px; border-radius: var(--radius-sm);
  background: rgba(255, 253, 249, 0.94); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.qf-icon { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--bg-tint); color: var(--brand-blue-ink); }
.qf-icon svg { width: 19px; height: 19px; }
.qf-body { min-width: 0; display: grid; gap: 2px; }
.qf-label { font-size: 0.7rem; letter-spacing: 0.14em; color: var(--muted); font-weight: 700; }
.qf-value { font-weight: 500; line-height: 1.5; overflow-wrap: anywhere; }
.nowrap { white-space: nowrap; }
.qf-part { display: inline-block; max-width: 100%; }
/* Long addresses (VeryBestHoldingsJapan@…) fit the four-column row. */
.qf-link[href^="mailto:"] { font-size: 0.88em; }
.qf-link { color: var(--accent-ink); text-underline-offset: 3px; }

/* Teachers */
.teachers { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
@media (min-width: 700px) { .teachers { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; } }
.teacher-card { padding: 24px 22px; border-radius: var(--radius); background: rgba(255, 253, 249, 0.94); border: 1px solid var(--line); box-shadow: var(--shadow); }
.teacher-photo { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; margin-bottom: 12px; }
.teacher-mark { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--bg-tint); color: var(--brand-blue-ink); margin-bottom: 12px; }
.teacher-mark svg { width: 24px; height: 24px; }
.teacher-name { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; margin: 0 0 4px; }
.teacher-intro { margin: 0; color: var(--ink-soft); }

/* Fees */
.fee-panel { padding: 8px 18px 14px; }
@media (min-width: 768px) { .fee-panel { padding: 14px 28px 20px; } }
.fee-tax { font-size: 0.82rem; color: var(--muted); margin-left: 0.4em; }
.fee-note { display: block; font-size: 0.82rem; color: var(--muted); }

/* FAQ */
.faq { display: grid; gap: 10px; max-width: 820px; }
.faq-item { border-radius: var(--radius-sm); background: rgba(255, 253, 249, 0.94); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; }
.faq-q { cursor: pointer; list-style: none; padding: 16px 48px 16px 18px; font-weight: 700; position: relative; }
.faq-q::-webkit-details-marker { display: none; }
.faq-q::after {
  content: ""; position: absolute; right: 20px; top: 50%; width: 9px; height: 9px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg); transition: transform 0.2s ease;
}
.faq-item[open] .faq-q::after { transform: translateY(-20%) rotate(-135deg); }
.faq-q:focus-visible { outline: 3px solid var(--accent-ink); outline-offset: -3px; }
.faq-a { padding: 0 18px 18px; color: var(--ink-soft); }
.faq-a p { margin: 0; }

/* Access map */
.map-embed { margin-top: 16px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); max-width: 680px; }
.map-embed iframe { display: block; width: 100%; height: 340px; border: 0; }

/* Sticky contact bar — phones only. One tap to call from a scanned sign. */
.sticky-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: none; gap: 8px; padding: 8px var(--gutter);
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 253, 249, 0.96); border-top: 1px solid var(--line);
  backdrop-filter: saturate(140%) blur(8px);
}
.sb-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 13px 16px; border-radius: 999px; text-decoration: none; white-space: nowrap;
  font-weight: 700; font-size: 0.95rem; line-height: 1.2; text-align: center;
}
/* The call button takes only what it needs so the longer email label,
   「メールで問い合わせ」, stays on one line down to 360px. */
.sb-call { flex: 0 0 auto; background: var(--brand-blue-ink); color: #fff; }
.sb-mail { flex: 1 1 auto; min-width: 0; }
@media (max-width: 379px) { .sb-btn { font-size: 0.88rem; padding: 13px 12px; gap: 5px; } }
.sb-mail { background: var(--bg-elev); color: var(--ink); border: 1px solid var(--line); }
.sb-icon { width: 19px; height: 19px; flex: none; display: grid; place-items: center; }
.sb-icon svg { width: 19px; height: 19px; }
@media (max-width: 899px) {
  .sticky-bar { display: flex; }
  body.has-sticky-bar .site-footer { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
}

/* The no-JS fallback should not look broken when it is the only content */
noscript .section-title { margin-bottom: 0.3em; }

/* Homepage: "the school you looked at last" shortcut */
.last-school { display: flex; justify-content: center; padding: 10px var(--gutter) 0; }
.last-school a {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
  padding: 8px 16px; border-radius: 999px; text-decoration: none; font-size: 0.88rem;
  background: var(--bg-elev); border: 1px solid var(--line); color: var(--ink); box-shadow: var(--shadow);
}
.last-school .sw-badge { width: 22px; height: 22px; font-size: 0.72rem; }

/* 404: pick a school instead of a dead end */
.nf-schools { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 10px; max-width: 520px; }
@media (min-width: 560px) { .nf-schools { grid-template-columns: repeat(2, 1fr); } }
.nf-schools a {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px;
  border-radius: var(--radius-sm); text-decoration: none; color: var(--ink);
  background: rgba(255, 253, 249, 0.94); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.nf-schools .sw-badge { width: 28px; height: 28px; }
.nf-school-area { margin-left: auto; font-size: 0.8rem; color: var(--muted); }
