:root {
  --indigo: #1d2a44;
  --vat: #141d31;
  --cotton: #e4e2da;
  --faded: #8593ad;
  --ground: var(--indigo);
  --ink: var(--cotton);
  --soft: var(--faded);
}
@media (prefers-color-scheme: light) {
  :root {
    --ground: var(--cotton);
    --ink: var(--indigo);
    --soft: #56637d;
  }
}

* { box-sizing: border-box; }

/* Below ~420px wide, shrink everything together (all sizes are rem) so the tagline stays on
   one line and the text keeps the height the 合わせ道 image is sized to. */
html { background: var(--ground); font-size: min(100%, 3.8vw); }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(1.5rem, 6vh, 4rem) 1rem;
  background: var(--ground);
  color: var(--ink);
  font-family: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-size: 1.125rem;
  line-height: 1.7;
}

p { margin: 0 0 1rem; text-wrap: pretty; }

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
a:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

.name {
  margin: 0 0 0.75rem;
  font-weight: 600;
  font-size: 2.25rem;
  line-height: 1.2;
}

/* ---- Home ---- */

.home {
  display: grid;
  grid-template-columns: auto minmax(0, max-content);
  align-items: center;
  align-content: center;
  justify-content: center;
  gap: clamp(1.25rem, 4vw, 3rem);
}

/* 合わせ道 is Shippori Mincho SemiBold outlined to SVG (viewBox 908 × 4063), sized to the
   height of the text beside it: name 2.7 + 0.75 margin, tagline 1.9125 + 1.5 gap,
   six steps × 1.9125 = 18.3375rem. Both sides are explicit; Safari won't derive them. */
.mark { margin: 0; }
.mark svg {
  display: block;
  height: 18.3375rem;
  width: calc(18.3375rem * 908 / 4063);
}

.steps {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  counter-reset: step;
}
.steps li { counter-increment: step; }
.steps li::before {
  content: counter(step);
  display: inline-block;
  width: 1.5em;
  color: var(--soft);
}

/* The Kata link sits in its own row in the text column, under the steps, so it doesn't change
   the height 合わせ道 is sized to. */
.more { grid-column: 2; margin: 0; }

/* .about and .maxims span both columns under 合わせ道 and the steps. contain: inline-size
   keeps their long lines from widening the columns; they fill the combined width and wrap. */
.about,
.maxims {
  grid-column: 1 / -1;
  contain: inline-size;
  margin: 0;
}

/* Maxims: unlabelled, one per paragraph. A 〜 (wave dash) in the step numbers' colour sits
   centred above each; the second content line hides it from screen readers. */
.maxims p { margin: 0 0 1rem; }
.maxims p:last-child { margin-bottom: 0; }
.maxims p::before {
  content: "〜";
  content: "〜" / "";
  display: block;
  text-align: center;
  font-weight: 600;
  -webkit-text-stroke: 0.06em currentColor;
  color: var(--soft);
}

/* ---- Kata ---- */

.kata-page {
  max-width: 26rem;
  margin: 0 auto;
}

.back { color: var(--soft); margin-bottom: 1.5rem; }

/* A group (Standing kata, …) holds kata; each kata is a name (h3) and, once written, a short
   description (p) under it. */
.kata-group { margin-top: 1.5rem; }
.kata-group h2 {
  margin: 0 0 1.25rem;
  font-weight: 600;
  font-size: 1.375rem;
  line-height: 1.3;
}
.kata { margin-bottom: 0.75rem; }
.kata h3 {
  margin: 0;
  font-weight: 600;
  font-size: 1.125rem;
  line-height: 1.5;
}
.kata p { margin: 0; }

/* Traced from Jim's drawing with potrace: one filled path, so it takes the text colour. */
.illustration { margin: 0 0 1.5rem; }
.illustration svg {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 879 / 769;
}
