/*
 * Michikaki landing page. One stylesheet, no web fonts, no third-party requests.
 * The palette comes from the app icon (terracotta and cream) and from the game's own
 * look: a warm paper daytime and a lamp-lit night. Headings use the Japanese mincho
 * faces the Mac and iPad already have, with Georgia as the fallback. No script.
 */
:root {
  color-scheme: light dark;
  --paper: #f7f0e4;
  --glow: #f6dcaa;
  --card: #fffaf1;
  --ink: #2b211b;
  --ink-soft: #5a4a3e;
  --terra: #cc543c;
  --terra-ink: #9f3a24;
  --pill: #9a3822;
  --pill-ink: #fdf6ea;
  --line: #e7d9c4;
  --tile: #fbf4e6;
  --frame: #2b211b;
  --band: #f1e6d3;
  --shadow: 0 1px 2px rgba(43, 33, 27, 0.08), 0 12px 30px rgba(43, 33, 27, 0.1);
  --serif: 'Hiragino Mincho ProN', 'Yu Mincho', 'Noto Serif JP', 'Hiragino Serif', Georgia, 'Times New Roman', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --paper: #1a1930;
    --glow: #4b3320;
    --card: #24223d;
    --ink: #f4ece0;
    --ink-soft: #cbbfb1;
    --terra: #e0664a;
    --terra-ink: #f2a58b;
    --pill: #c0503a;
    --pill-ink: #ffffff;
    --line: #3a3757;
    --tile: #f4ebdb;
    --frame: #0f0e1d;
    --band: #201e37;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 30px rgba(0, 0, 0, 0.35);
  }
}

:root[data-theme='dark'] {
  --paper: #1a1930;
  --glow: #4b3320;
  --card: #24223d;
  --ink: #f4ece0;
  --ink-soft: #cbbfb1;
  --terra: #e0664a;
  --terra-ink: #f2a58b;
  --pill: #c0503a;
  --pill-ink: #ffffff;
  --line: #3a3757;
  --tile: #f4ebdb;
  --frame: #0f0e1d;
  --band: #201e37;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 30px rgba(0, 0, 0, 0.35);
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--terra-ink);
  text-underline-offset: 0.18em;
}

:focus-visible {
  outline: 3px solid var(--terra-ink);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

.skip {
  position: absolute;
  left: 12px;
  top: -64px;
  z-index: 10;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
}

.skip:focus {
  top: 12px;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--serif);
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.7rem, 4.6vw, 2.4rem);
}

h3 {
  font-size: 1.3rem;
  margin-bottom: 6px;
}

p {
  margin: 0 0 12px;
}

.lead {
  color: var(--ink-soft);
  font-size: clamp(1.05rem, 2.2vw, 1.2rem);
  text-wrap: pretty;
}

/* ---- top bar ---------------------------------------------------------- */
.top {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 90%, transparent);
}

.bar {
  display: flex;
  align-items: center;
  min-height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  box-shadow: 0 0 0 1px var(--line);
}

.brand b {
  display: block;
  font-family: var(--serif);
  font-size: 1.1rem;
  line-height: 1.2;
}

.brand small {
  display: block;
  color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1.2;
}

/* ---- hero ------------------------------------------------------------- */
.hero {
  padding: 36px 0 56px;
  background: radial-gradient(120% 80% at 80% 0%, var(--glow), transparent 60%);
}

.hero-grid {
  display: grid;
  gap: 32px;
  align-items: center;
}

.pill {
  display: inline-block;
  margin: 0 0 18px;
  padding: 7px 16px 8px;
  border-radius: 999px;
  background: var(--pill);
  color: var(--pill-ink);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(2.1rem, 5.4vw + 0.4rem, 3.7rem);
  font-weight: 700;
}

h1 em {
  color: var(--terra-ink);
  font-style: normal;
}

.hero .lead {
  margin: 18px 0 14px;
}

.meta {
  margin: 0 0 22px;
  color: var(--ink-soft);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.status {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--terra);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.status p {
  margin: 0;
  font-size: 0.98rem;
}

/* Tan on a lit relief: the lamp light falls from above, the ground takes the shadow. */
.stage {
  position: relative;
  width: min(100%, 400px);
  aspect-ratio: 1;
  margin: 0 auto;
  background: radial-gradient(circle at 46% 38%, var(--glow) 0%, transparent 66%);
}

.stage .tan {
  position: absolute;
  left: 50%;
  bottom: 9%;
  width: 84%;
  transform: translateX(-50%);
  filter: drop-shadow(-6px 10px 10px rgba(43, 33, 27, 0.22));
  animation: breathe 6s ease-in-out infinite alternate;
}

.stage::after {
  content: '';
  position: absolute;
  left: 14%;
  right: 14%;
  bottom: 3%;
  height: 9%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(43, 33, 27, 0.28), transparent 70%);
  pointer-events: none;
}

@keyframes breathe {
  to {
    transform: translate(-50%, -6px);
  }
}

@media (min-width: 760px) {
  .hero {
    padding: 64px 0 88px;
  }

  .hero-grid {
    grid-template-columns: 1.1fr 0.9fr;
    gap: clamp(28px, 4vw, 56px);
  }
}

/* ---- sections --------------------------------------------------------- */
.section {
  padding: clamp(56px, 9vw, 96px) 0;
}

.section.band {
  background: var(--band);
  border-block: 1px solid var(--line);
}

.section-head {
  max-width: 40rem;
  margin: 0 0 clamp(26px, 5vw, 40px);
}

.section-head p {
  margin: 12px 0 0;
}

/* the loop */
.steps {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  padding: 24px 22px 22px 70px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--shadow);
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 22px;
  top: 24px;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--pill);
  color: #fff;
  font-weight: 800;
}

.steps p {
  margin: 0;
  color: var(--ink-soft);
}

@media (min-width: 860px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* the three kanji */
.answers {
  display: grid;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.answer {
  padding: 26px 24px 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.tile {
  display: grid;
  place-items: center;
  width: 3.6rem;
  height: 3.6rem;
  margin-bottom: 16px;
  border: 3px solid var(--frame);
  border-radius: 12px;
  background: var(--tile);
  box-shadow: 3px 4px 0 rgba(43, 33, 27, 0.22);
  color: #2b211b;
  font-size: 2rem;
  line-height: 1;
}

.answer p {
  margin: 0;
  color: var(--ink-soft);
}

/* kanji in card headings use a plain sans face, so 一 reads as one stroke */
.kanji {
  font-family: 'Hiragino Sans', 'Yu Gothic', 'Noto Sans JP', system-ui, sans-serif;
}

.too-full {
  width: min(70%, 220px);
  height: auto;
  margin: 16px 0 0;
}

@media (min-width: 860px) {
  .answers {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* stroke order */
.strokes {
  display: grid;
  gap: 24px;
  align-items: start;
}

.strokes-copy p {
  color: var(--ink-soft);
}

.legend {
  display: grid;
  gap: 10px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  color: var(--ink-soft);
}

.legend li {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mark {
  flex: none;
  width: 28px;
  height: 28px;
}

.mark.dot {
  border-radius: 50%;
  border: 3px solid var(--terra);
  background: var(--card);
  box-sizing: border-box;
}

.mark.arrow {
  background: linear-gradient(to right, var(--terra), var(--terra)) left 50% / 18px 3px no-repeat;
  position: relative;
}

.mark.arrow::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  width: 0;
  height: 0;
  transform: translateY(-50%);
  border-left: 9px solid var(--terra);
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}

.note {
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.note p {
  margin: 0;
  color: var(--ink-soft);
}

.note strong {
  color: var(--ink);
}

@media (min-width: 860px) {
  .strokes {
    grid-template-columns: 1.2fr 0.8fr;
    gap: 48px;
  }
}

/* facts */
.facts {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.fact {
  padding: 22px 22px 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.fact p {
  margin: 0;
  color: var(--ink-soft);
}

@media (min-width: 620px) {
  .facts {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* closing */
.closing-wrap {
  padding-top: 0;
}

.closing {
  display: grid;
  gap: 16px;
  justify-items: center;
  padding: 32px 24px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(to bottom, var(--glow), var(--card));
  box-shadow: var(--shadow);
  text-align: center;
}

.closing img.tan {
  width: min(44vw, 170px);
  height: auto;
}

.closing p {
  margin: 0;
  color: var(--ink-soft);
}

@media (min-width: 760px) {
  .closing {
    grid-template-columns: auto 1fr;
    justify-items: start;
    padding: 36px 52px;
    text-align: left;
  }
}

/* ---- footer ----------------------------------------------------------- */
.foot {
  padding: 36px 0 48px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.foot p {
  margin: 0;
}

.foot strong {
  color: var(--ink);
}

/* ---- motion ----------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .stage .tan {
    animation: none;
  }
}
