/* Baka Dojo: the hub at /dojo/. Look and tokens come from the Baka Dojo Skool banner
   (muse-codex tasks/2026-10-17-baka-dojo-banner/banner.html): cream cards with thick ink outlines and
   hard offset shadows, vermilion 道場 stamp, gold MASTERY bar, sunset dojo art. Not the old homepage style. */
:root {
  --ink: #2b2424;
  --paper: #fffbf5;
  --bg: #fcefe0;
  --fg: #2b2424;
  --muted: #6f5f5c;
  --line: rgba(43, 36, 36, 0.16);
  --hard: #2b2424;
  --red: #d8402e;
  --red-deep: #b9301f;
  --gold: #ffc53d;
  --orange: #ff8a5c;
  --coral: #f9c6b4;
  --lav: #d9cffa;
  --mint: #bfeccf;
  --peach: #ffe0b3;
  --track: #4a3d3d;
  --display: "Baloo 2", "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
  --kana: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic", sans-serif;
  --wrap: min(1180px, calc(100% - 40px));
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1f1719; --fg: #fff4e6; --muted: #cdb9b1; --line: rgba(255, 244, 230, 0.16); --hard: #0b0707;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1f1719; --fg: #fff4e6; --muted: #cdb9b1; --line: rgba(255, 244, 230, 0.16); --hard: #0b0707;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--display);
  font-size: 1.05rem;
  line-height: 1.5;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1; font-weight: 800; text-wrap: balance; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }

.skip-link {
  position: fixed; z-index: 100; top: 1rem; left: 1rem; padding: 0.6rem 1rem;
  border-radius: 999px; background: var(--ink); color: var(--paper); font-weight: 700;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* Shared pieces */
.stamp {
  display: inline-grid; place-items: center; flex: none;
  background: var(--red); color: #fff; border: 3px solid var(--ink); border-radius: 12px;
  box-shadow: 3px 4px 0 var(--hard);
  font: 800 1rem/1 var(--kana);
}
.pill {
  display: inline-block; padding: 0.15rem 0.95rem 0.05rem; border-radius: 999px;
  background: var(--coral); color: var(--ink); font-weight: 700; font-size: 0.95rem;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 52px; padding: 0.55rem 1.4rem 0.4rem; border: 3px solid var(--ink); border-radius: 16px;
  background: var(--paper); color: var(--ink); box-shadow: 4px 5px 0 var(--hard);
  font: 800 1.1rem/1 var(--display); text-decoration: none;
  transition: transform 140ms ease, box-shadow 140ms ease;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 7px 0 var(--hard); }
.btn:active { transform: translate(3px, 4px); box-shadow: 1px 1px 0 var(--hard); }
.btn-red { background: var(--red); color: #fff; }
.eyebrow { color: var(--muted); font-size: 0.8rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }

/* Header */
.dojo-header {
  display: flex; width: var(--wrap); min-height: 78px; margin: 0 auto;
  align-items: center; justify-content: space-between; gap: 1rem;
}
.dojo-header .brand {
  display: inline-flex; padding: 4px 10px; border: 3px solid var(--ink); border-radius: 14px;
  background: var(--paper); box-shadow: 3px 4px 0 var(--hard);
}
.dojo-header .brand img { width: 104px; height: auto; mix-blend-mode: multiply; }
.wordmark { display: inline-flex; align-items: center; gap: 0.6rem; font-size: 1.35rem; font-weight: 800; text-decoration: none; }
.wordmark .stamp { width: 40px; height: 40px; font-size: 0.72rem; line-height: 1.05; writing-mode: vertical-rl; transform: rotate(8deg); }
.header-right { display: flex; align-items: center; gap: 1.1rem; }
.home-link { font-weight: 700; font-size: 0.95rem; text-decoration: none; color: var(--muted); }
.home-link:hover { color: var(--fg); }

/* Hero: the banner, made live */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  min-height: clamp(560px, 50vw, 700px);
  border-block: 3px solid var(--ink);
  background: #6b3a3a;
}
.hero-bg { position: absolute; inset: 0; z-index: -3; width: 100%; height: 100%; object-fit: cover; object-position: 70% 50%; }
.hero::before { /* the banner's plum shade on the text side */
  content: ""; position: absolute; inset: 0; z-index: -2;
  background: linear-gradient(90deg, rgba(40, 20, 40, 0.45) 0%, rgba(40, 20, 40, 0.16) 45%, rgba(40, 20, 40, 0) 62%);
}
.hero-inner {
  position: relative; z-index: 1; display: grid; width: var(--wrap); min-height: inherit; margin: 0 auto;
  grid-template-columns: minmax(0, 560px) 1fr; align-items: center; gap: 2rem; padding: 3.5rem 0 3rem;
}
.title-card {
  position: relative; padding: 1.9rem 2.2rem 1.8rem;
  background: var(--paper); color: var(--ink);
  border: 4px solid var(--ink); border-radius: 34px; box-shadow: 10px 12px 0 var(--ink);
  transform: rotate(-2.5deg);
}
.title-card h1 { margin: 0.4rem 0 0; font-size: clamp(4.4rem, 9vw, 8.2rem); line-height: 0.84; letter-spacing: -0.01em; }
.title-card h1 span { display: block; color: var(--red); }
.title-card .tag { margin-top: 0.7rem; font-size: clamp(1.4rem, 2.6vw, 2rem); font-weight: 800; line-height: 1.05; }
.title-card .lede { margin-top: 0.6rem; max-width: 30ch; color: #5f504d; font-weight: 600; line-height: 1.35; }
.title-card .btn { margin-top: 1.3rem; }
.title-card .big-stamp {
  position: absolute; top: -34px; right: -30px; width: 104px; height: 104px;
  border-width: 4px; border-radius: 18px; box-shadow: 5px 6px 0 var(--ink);
  font-size: 2.2rem; line-height: 1.02; letter-spacing: 4px; writing-mode: vertical-rl; transform: rotate(11.5deg);
}

.fighters { position: relative; align-self: stretch; min-height: 380px; }
.burst, .glow { position: absolute; left: 50%; top: 55%; translate: -50% -50%; pointer-events: none; }
.glow { width: 640px; height: 640px; background: radial-gradient(circle, rgba(255, 214, 140, 0.6), rgba(255, 214, 140, 0) 62%); }
.burst {
  width: 1100px; height: 1100px; mix-blend-mode: screen;
  background: repeating-conic-gradient(from 0deg, rgba(255, 240, 210, 0.32) 0deg 1.3deg, rgba(255, 240, 210, 0) 1.6deg 7deg);
  -webkit-mask-image: radial-gradient(circle, transparent 0 180px, #000 270px, #000 380px, transparent 530px);
          mask-image: radial-gradient(circle, transparent 0 180px, #000 270px, #000 380px, transparent 530px);
  animation: spin 90s linear infinite;
}
@keyframes spin { to { rotate: 360deg; } }
.fighter { position: absolute; bottom: 4%; height: auto; filter: drop-shadow(0 6px 0 rgba(43, 36, 36, 0.25)); }
.fighter.kitsune { left: 2%; width: 56%; z-index: 2; }
.fighter.panda { right: 0; bottom: 9%; width: 50%; z-index: 1; }
.ground {
  position: absolute; bottom: 3%; height: 34px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(70, 30, 30, 0.42), rgba(70, 30, 30, 0));
}
.ground.k { left: 8%; width: 44%; }
.ground.p { right: 8%; bottom: 8%; width: 30%; }

.petal {
  position: absolute; top: -20px; z-index: 0; width: 14px; height: 10px; pointer-events: none;
  border-radius: 100% 0 100% 0; background: #ffc6d6; opacity: 0.9;
  animation: fall linear infinite;
}
.petal:nth-of-type(1) { left: 58%; animation-duration: 11s; }
.petal:nth-of-type(2) { left: 70%; animation-duration: 14s; animation-delay: -4s; width: 11px; }
.petal:nth-of-type(3) { left: 84%; animation-duration: 12s; animation-delay: -8s; }
.petal:nth-of-type(4) { left: 93%; animation-duration: 16s; animation-delay: -2s; width: 10px; }
.petal:nth-of-type(5) { left: 47%; animation-duration: 15s; animation-delay: -10s; }
@keyframes fall {
  0% { transform: translate(0, 0) rotate(0); }
  50% { transform: translate(-50px, 340px) rotate(200deg); }
  100% { transform: translate(-120px, 760px) rotate(420deg); }
}

/* Mastery: the banner's game bar, filled from the drills' saved progress */
.mastery-wrap { width: var(--wrap); margin: -2.4rem auto 0; position: relative; z-index: 2; }
.mastery {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.6rem 1rem;
  max-width: 620px; padding: 0.9rem 1.3rem 0.8rem;
  background: var(--ink); color: #fff; border: 3px solid var(--ink); border-radius: 22px;
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.25); transform: rotate(-1.5deg);
}
.mastery .label { color: var(--gold); font-size: 1.15rem; font-weight: 800; letter-spacing: 0.12em; }
.mastery .lv { font-size: 1.25rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.mastery .note { grid-column: 1 / -1; color: #d8c8c2; font-size: 0.9rem; font-weight: 600; }
.xp { height: 26px; border-radius: 999px; background: var(--track); border: 3px solid #6b5b5b; overflow: hidden; }
.xp i {
  display: block; width: 0; height: 100%; min-width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--orange), var(--gold));
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.12), inset 0 4px 0 rgba(255, 255, 255, 0.35);
  transition: width 900ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Training halls */
.hall { width: var(--wrap); margin: 0 auto; padding: 4.5rem 0 0; }
.hall-head { display: flex; align-items: center; gap: 1.2rem; margin-bottom: 2rem; }
.hall-head .stamp { width: 88px; height: 88px; border-radius: 22px; font-size: 3rem; transform: rotate(-5deg); box-shadow: 5px 6px 0 var(--hard); }
.hall-head h2 { font-size: clamp(2.4rem, 5vw, 3.6rem); }
.hall-head p { color: var(--muted); font-weight: 600; margin-top: 0.3rem; }
.section-title { width: var(--wrap); margin: 5rem auto 0; }
.section-title h2 { font-size: clamp(2.6rem, 6vw, 4.4rem); margin-top: 0.4rem; }

.drills { display: grid; margin: 0; padding: 0; list-style: none; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.6rem; }
.drills > li { display: flex; }
.drill {
  position: relative; display: flex; width: 100%; flex-direction: column; overflow: hidden;
  background: var(--paper); color: var(--ink); text-decoration: none;
  border: 3px solid var(--ink); border-radius: 26px; box-shadow: 7px 8px 0 var(--hard);
  transition: transform 160ms ease, box-shadow 160ms ease;
}
a.drill:hover, a.drill:focus-visible { transform: translate(-3px, -4px) rotate(-1deg); box-shadow: 11px 13px 0 var(--hard); }
a.drill:active { transform: translate(4px, 5px); box-shadow: 2px 2px 0 var(--hard); }
a.drill:focus-visible { outline-offset: 5px; }
.drill-band {
  display: flex; align-items: center; justify-content: space-between; gap: 0.6rem;
  padding: 0.75rem 1rem 0.65rem; border-bottom: 3px solid var(--ink); background: var(--band, var(--peach));
  font-weight: 700; font-size: 0.92rem;
}
.drill-band .stamp { padding: 0.22rem 0.7rem 0.12rem; border-radius: 10px; font: 800 0.95rem/1.1 var(--display); box-shadow: 2px 3px 0 var(--ink); transform: rotate(-3deg); }
.drill.coral { --band: var(--coral); }
.drill.gold { --band: #ffe08a; }
.drill.lav { --band: var(--lav); }
.drill.mint { --band: var(--mint); }
.drill.peach { --band: var(--peach); }
.drill-body { display: flex; flex: 1; flex-direction: column; gap: 0.9rem; padding: 1.1rem 1.2rem 1.25rem; }
.drill-kana {
  display: grid; min-height: 132px; place-content: center; padding: 0.6rem;
  border: 3px dashed rgba(43, 36, 36, 0.3); border-radius: 18px; background: #fff;
  font: 800 clamp(1.6rem, 2.4vw, 1.95rem)/1.4 var(--kana); letter-spacing: 0.06em; text-align: center;
}
.drill-title { font-size: 1.5rem; font-weight: 800; line-height: 1.05; }
.drill-meter { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0.7rem; font-size: 0.88rem; font-weight: 700; color: #6f5f5c; font-variant-numeric: tabular-nums; }
.drill-meter .xp { height: 14px; border-width: 2px; }
.drill-go { display: flex; align-items: center; justify-content: space-between; font-weight: 800; font-size: 1.1rem; }
.drill-go i {
  display: grid; width: 40px; height: 40px; place-items: center; font-style: normal;
  border: 3px solid var(--ink); border-radius: 50%; background: var(--red); color: #fff;
  box-shadow: 2px 3px 0 var(--ink); transition: transform 160ms ease;
}
a.drill:hover .drill-go i { transform: translateX(4px); }
.drill.soon {
  align-items: center; justify-content: center; gap: 0.5rem; padding: 1.4rem; text-align: center;
  background: transparent; color: var(--fg); border-style: dashed; border-color: var(--muted); box-shadow: none;
}
.drill.soon img { width: 132px; }
.drill.soon b { font-size: 1.4rem; line-height: 1.1; }
.drill.soon span { color: var(--muted); font-weight: 600; font-size: 0.95rem; }

/* Training rounds */
.rounds { display: grid; width: var(--wrap); margin: 2rem auto 0; padding: 0; list-style: none; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.round {
  position: relative; padding: 1.3rem 1.4rem 1.5rem;
  background: var(--paper); color: var(--ink); border: 3px solid var(--ink); border-radius: 26px; box-shadow: 7px 8px 0 var(--hard);
}
.round:nth-child(2) { transform: rotate(1deg); }
.round:nth-child(odd) { transform: rotate(-1deg); }
.round .num { display: inline-block; padding: 0.15rem 0.8rem 0.05rem; border-radius: 999px; background: var(--ink); color: var(--gold); font-weight: 800; font-size: 0.85rem; letter-spacing: 0.12em; }
.round .jp { display: block; margin: 0.9rem 0 0.2rem; font: 800 2.6rem/1.1 var(--kana); color: var(--red); }
.round h3 { font-size: 1.55rem; margin-top: 0.3rem; }
.round p { margin-top: 0.5rem; color: #5f504d; font-weight: 600; line-height: 1.4; }

/* Closing call to action */
.closing {
  position: relative; display: grid; width: var(--wrap); margin: 6rem auto 0; padding: 2.6rem 2.6rem 2.6rem;
  grid-template-columns: 1fr auto; align-items: center; gap: 1.5rem;
  background: var(--red); color: #fff; border: 4px solid var(--ink); border-radius: 34px; box-shadow: 10px 12px 0 var(--hard);
  overflow: hidden;
}
.closing h2 { font-size: clamp(2.2rem, 5vw, 3.8rem); }
.closing p { margin-top: 0.6rem; font-weight: 600; font-size: 1.1rem; color: #ffe9e2; }
.closing .btn { margin-top: 1.4rem; }
.closing img { width: 230px; margin: -2rem -0.5rem -3.2rem 0; align-self: end; }

/* Footer: the dojo floor */
.dojo-footer { margin-top: 5rem; border-top: 3px solid var(--ink); background: #7b4a32 url("/assets/dojo/floor-strip.webp") center / cover; }
.dojo-footer > div {
  display: flex; flex-wrap: wrap; width: var(--wrap); min-height: 150px; margin: 0 auto; padding: 1.6rem 0;
  align-items: center; justify-content: space-between; gap: 1rem 2rem;
}
.dojo-footer .brand { display: inline-flex; padding: 4px 10px; border: 3px solid var(--ink); border-radius: 14px; background: var(--paper); box-shadow: 3px 4px 0 var(--ink); }
.dojo-footer .brand img { width: 104px; mix-blend-mode: multiply; }
.dojo-footer nav {
  display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; padding: 0.55rem 1.1rem 0.45rem;
  background: rgba(43, 36, 36, 0.82); border-radius: 999px; color: #fff;
}
.dojo-footer nav a { font-weight: 700; font-size: 0.92rem; text-decoration: none; }
.dojo-footer nav a:hover { color: var(--gold); }
.dojo-footer small { width: 100%; color: #fff; font-weight: 600; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); }

/* Tablet */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; padding-top: 2.5rem; gap: 0; }
  .fighters { min-height: 340px; max-width: 520px; width: 100%; margin: 0 auto; }
  .hero::before { background: linear-gradient(180deg, rgba(40, 20, 40, 0.35), rgba(40, 20, 40, 0.05) 55%); }
  .rounds { grid-template-columns: 1fr; max-width: 560px; }
}

/* Phone */
@media (max-width: 620px) {
  :root { --wrap: calc(100% - 32px); }
  body { font-size: 1rem; }
  .dojo-header { min-height: 68px; }
  .dojo-header .brand img { width: 84px; }
  .wordmark { font-size: 1.1rem; }
  .wordmark .stamp { width: 34px; height: 34px; font-size: 0.62rem; }
  .home-link { display: none; }
  .hero { min-height: 0; }
  .hero-bg { object-position: 78% 50%; }
  .hero-inner { padding: 2.2rem 0 1rem; }
  .title-card { padding: 1.4rem 1.4rem 1.4rem; border-radius: 26px; box-shadow: 7px 8px 0 var(--ink); }
  .title-card h1 { font-size: clamp(3.6rem, 21vw, 5rem); }
  .title-card .big-stamp { top: -22px; right: -10px; width: 74px; height: 74px; font-size: 1.55rem; border-radius: 14px; box-shadow: 4px 5px 0 var(--ink); }
  .fighters { min-height: 270px; margin-top: 0.6rem; }
  .burst { width: 760px; height: 760px; }
  .glow { width: 420px; height: 420px; }
  .mastery-wrap { margin-top: -1.6rem; }
  .mastery { grid-template-columns: 1fr auto; padding: 0.8rem 1rem 0.7rem; }
  .mastery .xp { grid-column: 1 / -1; grid-row: 2; }
  .hall { padding-top: 3.5rem; }
  .hall-head { gap: 0.9rem; }
  .hall-head .stamp { width: 66px; height: 66px; font-size: 2.2rem; border-radius: 18px; }
  .drills { grid-template-columns: 1fr; gap: 1.3rem; }
  .drill-kana { min-height: 110px; }
  .closing { grid-template-columns: 1fr; padding: 2rem 1.6rem 0; }
  .closing img { width: 190px; margin: 0 auto -2.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
  .petal { display: none; }
}
