/*
 * "יפנית עם מיה" marketing site. Concept: genkō-yōshi, the red-ruled writing
 * paper Japanese children learn on. The grid is structural (letter tables,
 * the hero square), never decoration. Palette from noren curtains: ai indigo,
 * shu vermilion (the brand red), white paper.
 */

:root {
  --ai: #1e2b4d;
  --ai-deep: #15203b;
  --shu: #c62828;
  --shu-dark: #9e1f1f;
  --paper: #fbfaf7;
  --white: #ffffff;
  --ink: #1b2236;
  --muted: #586074;
  --grid: #e6b3aa;
  --grid-soft: #f6e3df;
  --rule: #e4e0d8;
  --gold: #8a7240;
  --mist: #eef0f5;

  --font-he-display: 'Rubik', 'Assistant', system-ui, sans-serif;
  --font-he: 'Assistant', 'Arial Hebrew', system-ui, sans-serif;
  --font-ja: 'Shippori Mincho B1', 'Noto Serif JP', serif;

  /* Seigaiha (青海波), the wave pattern of Japanese textiles: indigo and paper versions. */
  --seigaiha-ai: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='20'><defs><g id='f'><circle r='20' fill='%231e2b4d'/><circle r='20'/><circle r='15'/><circle r='10'/><circle r='5'/></g></defs><g fill='none' stroke='%23ffffff' stroke-opacity='0.07'><use href='%23f' x='0' y='-10'/><use href='%23f' x='40' y='-10'/><use href='%23f' x='20' y='0'/><use href='%23f' x='0' y='10'/><use href='%23f' x='40' y='10'/><use href='%23f' x='20' y='20'/><use href='%23f' x='0' y='30'/><use href='%23f' x='40' y='30'/></g></svg>");
  --seigaiha-paper: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='20'><defs><g id='f'><circle r='20' fill='%23fbfaf7'/><circle r='20'/><circle r='15'/><circle r='10'/><circle r='5'/></g></defs><g fill='none' stroke='%23c62828' stroke-opacity='0.12'><use href='%23f' x='0' y='-10'/><use href='%23f' x='40' y='-10'/><use href='%23f' x='20' y='0'/><use href='%23f' x='0' y='10'/><use href='%23f' x='40' y='10'/><use href='%23f' x='20' y='20'/><use href='%23f' x='0' y='30'/><use href='%23f' x='40' y='30'/></g></svg>");

  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 6px;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-he);
  font-size: 1.125rem;
  line-height: 1.75;
  direction: rtl;
  text-rendering: optimizeLegibility;
}

img,
svg {
  max-width: 100%;
  display: block;
}

a {
  color: var(--shu-dark);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--shu);
}

:focus-visible {
  outline: 3px solid var(--shu);
  outline-offset: 3px;
  border-radius: 2px;
}

.ja {
  font-family: var(--font-ja);
  direction: ltr;
  unicode-bidi: isolate;
}

/* A term stays in one piece when it fits on a line, and wraps inside itself on a narrow phone. */
.term {
  display: inline-block;
  max-width: 100%;
}

h1 .ja,
h2 .ja {
  white-space: nowrap;
}

/* Anchored headings stop below the sticky header. */
[id] {
  scroll-margin-top: 96px;
}

p .ja,
li .ja,
dd .ja {
  white-space: nowrap;
}

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

.skip {
  position: absolute;
  inset-inline-start: -9999px;
}

.skip:focus {
  inset-inline-start: 16px;
  top: 16px;
  background: var(--white);
  padding: 8px 14px;
  z-index: 10;
}

/* ---------- Header ---------- */

.site-header {
  background: var(--ai);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 72px;
}

.brand {
  display: flex;
  letter-spacing: -0.01em;
  align-items: center;
  gap: 12px;
  color: var(--white);
  text-decoration: none;
  font-family: var(--font-he-display);
  font-weight: 700;
  font-size: 1.35rem;
  white-space: nowrap;
}

.brand:hover {
  color: var(--white);
}

.hanko {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  background: var(--shu);
  color: var(--white);
  border-radius: 7px;
  font-family: var(--font-ja);
  font-weight: 700;
  font-size: 1.35rem;
  line-height: 1;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.25);
}

.nav {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 22px;
}

.nav a {
  color: #dfe4f1;
  text-decoration: none;
  font-size: 1rem;
  padding: 10px 0;
}

.nav a:hover,
.nav a[aria-current='page'] {
  color: var(--white);
  text-decoration: underline;
  text-decoration-color: var(--shu);
  text-decoration-thickness: 2px;
}

.nav-menu {
  display: none;
  margin-inline-start: auto;
}

.nav-menu summary {
  list-style: none;
  cursor: pointer;
  color: var(--white);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
}

.burger,
.burger::before,
.burger::after {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  transition:
    transform 0.18s ease,
    top 0.18s ease;
}

.burger {
  position: relative;
}

.burger::before,
.burger::after {
  content: '';
  position: absolute;
  left: 0;
}

.burger::before {
  top: -7px;
}

.burger::after {
  top: 7px;
}

.nav-menu[open] .burger {
  background: transparent;
}

.nav-menu[open] .burger::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-menu[open] .burger::after {
  top: 0;
  transform: rotate(-45deg);
}

.nav-menu summary::-webkit-details-marker {
  display: none;
}

.nav-menu[open] .nav-sheet {
  position: absolute;
  inset-inline: 0;
  top: 100%;
  background: var(--ai-deep);
  padding: 12px var(--gutter) 20px;
  display: grid;
  gap: 4px;
  z-index: 5;
}

.nav-sheet a {
  color: var(--white);
  text-decoration: none;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 6px 26px;
  border-radius: var(--radius);
  font-family: var(--font-he);
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition:
    transform 0.12s ease,
    background 0.15s ease,
    color 0.15s ease;
}

.btn-quiet:hover {
  background: rgba(127, 127, 127, 0.1);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--shu);
  color: var(--white);
  box-shadow: 0 3px 0 var(--shu-dark);
}

.btn-primary:hover {
  background: #d33030;
  color: var(--white);
}

.btn-quiet {
  color: inherit;
  border-color: currentColor;
  background: transparent;
}

.site-header .btn {
  min-height: 42px;
  padding: 0 18px;
  font-size: 1rem;
}

/* One line, always: a start button that wraps reads as broken. */
.site-header .btn,
.hero-actions .btn,
.closing .btn {
  white-space: nowrap;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  background: var(--ai);
  color: var(--white);
  padding: clamp(40px, 7vw, 88px) 0 clamp(56px, 8vw, 104px);
  overflow: hidden;
  isolation: isolate;
}

/* The waves rise from the bottom of the hero, fading out before the headline. */
.hero::before,
.page-head::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--seigaiha-ai);
  background-size: 48px 24px;
  -webkit-mask-image: linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0.35) 45%, transparent 80%);
  mask-image: linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0.35) 45%, transparent 80%);
}

/* Vertical Japanese (tategaki), the way books and signs are written in Japan. */
.hero-tate {
  position: absolute;
  /* Physical side: logical insets would follow the vertical writing mode. */
  left: clamp(8px, 2vw, 28px);
  top: clamp(24px, 5vw, 56px);
  margin: 0;
  writing-mode: vertical-rl;
  font-family: var(--font-ja);
  font-weight: 700;
  font-size: clamp(1rem, 1.6vw, 1.35rem);
  letter-spacing: 0.35em;
  color: rgba(255, 255, 255, 0.38);
  z-index: -1;
}

.hero .wrap {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
}

.hero h1 {
  font-family: var(--font-he-display);
  font-weight: 800;
  font-size: clamp(2.4rem, 5.2vw, 4.2rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 22px;
}

.hero-lede {
  font-size: clamp(1.15rem, 1.6vw, 1.32rem);
  color: #d8deec;
  max-width: 34em;
  margin: 0 0 32px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  align-items: center;
}

.hero-actions .btn-quiet {
  color: var(--white);
}

/* What "free" means, in three short facts. Each is marked with a maru,
   the circle a Japanese teacher draws next to a correct answer. */
.hero-facts {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
  font-size: 1rem;
  color: #c3cbe0;
}

.hero-facts li {
  display: flex;
  align-items: center;
  gap: 9px;
}

.hero-facts li::before {
  content: '';
  flex: none;
  width: 12px;
  height: 12px;
  border: 2px solid var(--grid);
  border-radius: 50%;
}

/* The writing square: a single genkō cell, drawn large. */
.genko-demo {
  justify-self: center;
  width: min(100%, 380px);
}

.genko-demo figure {
  margin: 0;
}

.genko-cell {
  background: var(--paper);
  border-radius: 4px;
  padding: 14px;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.6);
}

.genko-cell svg {
  width: 100%;
  height: auto;
}

.genko-caption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 16px;
  color: #d8deec;
  font-size: 1rem;
}

.genko-caption .say {
  font-family: var(--font-he-display);
  font-weight: 700;
  font-size: 2rem;
  color: var(--white);
}

.stroke {
  fill: none;
  stroke: var(--shu);
  stroke-width: 4.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stroke-guide {
  fill: none;
  stroke: #e9e4dc;
  stroke-width: 4.2;
  stroke-linecap: round;
}

@media (prefers-reduced-motion: no-preference) {
  .genko-demo .stroke {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    /* "both": hidden until its turn (a round cap would otherwise show as a dot). */
    animation: draw 0.9s ease-in-out both;
    animation-delay: var(--delay);
  }

  .genko-demo .say {
    animation: appear 0.4s ease-out both;
    animation-delay: var(--say-delay, 3s);
  }
}

@keyframes draw {
  from {
    stroke-dashoffset: 1;
    opacity: 0;
  }
  1% {
    opacity: 1;
  }
  to {
    stroke-dashoffset: 0;
    opacity: 1;
  }
}

@keyframes appear {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ---------- Sections ---------- */

.section {
  padding: clamp(56px, 8vw, 104px) 0;
}

.section + .section {
  border-top: 1px solid var(--rule);
}

.section-tint {
  background: var(--white);
}

.section h2 {
  font-family: var(--font-he-display);
  font-weight: 800;
  font-size: clamp(1.9rem, 3.6vw, 2.8rem);
  line-height: 1.15;
  margin: 0 0 18px;
  max-width: 22em;
}

.section-intro {
  color: var(--muted);
  font-size: 1.2rem;
  max-width: 40em;
  margin: 0 0 44px;
}

/* Differentiators: a big character carries each point. */
.points {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px 48px;
}

.point .glyph {
  font-family: var(--font-ja);
  font-size: 3.4rem;
  line-height: 1;
  color: var(--shu);
  margin-bottom: 14px;
}

.point h3 {
  font-family: var(--font-he-display);
  font-size: 1.45rem;
  margin: 0 0 8px;
}

.point p {
  margin: 0;
  color: var(--muted);
}

/* A lesson, step by step: this content is a real sequence. */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  counter-reset: step;
  border-top: 2px solid var(--ai);
}

.steps li {
  counter-increment: step;
  padding: 22px 0 0 24px;
}

/* Steps are counted in kanji numerals: 一 二 三 四. */
.steps li::before {
  content: counter(step);
  display: block;
  font-family: var(--font-ja);
  font-weight: 800;
  font-size: 2.6rem;
  line-height: 1;
  color: var(--shu);
  margin-bottom: 12px;
}

.steps li:nth-child(1)::before {
  content: '一';
}
.steps li:nth-child(2)::before {
  content: '二';
}
.steps li:nth-child(3)::before {
  content: '三';
}
.steps li:nth-child(4)::before {
  content: '四';
}

.steps h3 {
  font-size: 1.2rem;
  margin: 0 0 6px;
}

.steps p {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
}

/* Paths: rows on ruled paper, the character on the start side. */
.paths {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}

.paths li {
  border-bottom: 1px solid var(--rule);
}

.paths a {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 22px 4px;
  color: inherit;
  text-decoration: none;
}

.paths a:hover h3 {
  color: var(--shu);
}

.paths .glyph {
  font-family: var(--font-ja);
  font-size: 3rem;
  line-height: 1;
  color: var(--ai);
  text-align: center;
}

.paths h3 {
  font-family: var(--font-he-display);
  font-size: 1.5rem;
  margin: 0 0 2px;
}

.paths p {
  margin: 0;
  color: var(--muted);
}

.paths .go {
  color: var(--shu-dark);
  font-weight: 700;
  white-space: nowrap;
}

/* Teacher */
.teacher {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: clamp(32px, 6vw, 72px);
  align-items: start;
}

.teacher-mark {
  background: var(--ai);
  color: var(--white);
  border-radius: var(--radius);
  padding: 40px 32px;
  display: grid;
  gap: 18px;
  justify-items: start;
}

.teacher-mark .hanko {
  width: 72px;
  height: 72px;
  font-size: 2.4rem;
  border-radius: 12px;
}

.teacher-mark .facts {
  display: grid;
  gap: 14px;
  margin: 0;
}

.teacher-mark dt {
  font-family: var(--font-he-display);
  font-weight: 800;
  font-size: 2.2rem;
  line-height: 1;
}

.teacher-mark dd {
  margin: 0 0 6px;
  color: #c8d0e3;
}

.teacher .statement {
  margin: 0 0 20px;
  font-family: var(--font-he-display);
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  line-height: 1.4;
  color: var(--ai);
}

/* Pricing: a plain ruled table, not product cards. */
.pricing {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  border: 2px solid var(--ai);
  border-radius: var(--radius);
  background: var(--white);
}

.plan {
  padding: 32px 28px;
}

.plan + .plan {
  border-inline-start: 1px solid var(--rule);
}

.plan h3 {
  font-family: var(--font-he-display);
  font-size: 1.4rem;
  margin: 0 0 6px;
}

.plan .price {
  font-family: var(--font-he-display);
  font-weight: 800;
  font-size: 2.6rem;
  line-height: 1.1;
  color: var(--ai);
  margin: 10px 0 4px;
}

.plan .per {
  color: var(--muted);
  margin: 0 0 18px;
}

.plan ul {
  margin: 0 0 22px;
  padding-inline-start: 1.1em;
  color: var(--ink);
}

.plan.featured {
  background: var(--grid-soft);
}

.plan .tag {
  display: inline-block;
  background: var(--shu);
  color: var(--white);
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 4px;
  padding: 2px 10px;
}

.pricing-note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

/* FAQ */
.faq {
  max-width: 820px;
}

.faq details {
  border-bottom: 1px solid var(--rule);
  padding: 4px 0;
}

.faq summary {
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  font-size: 1.15rem;
  padding: 18px 0 18px 40px;
  position: relative;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: '+';
  position: absolute;
  inset-inline-end: 0;
  top: 12px;
  font-size: 1.6rem;
  color: var(--shu);
  transition: transform 0.15s ease;
}

.faq details[open] summary::after {
  transform: rotate(45deg);
}

.faq details > div {
  padding: 0 0 18px;
  color: var(--ink);
  max-width: 68ch;
}

/* Closing band */
/* Closing band as a noren, the split curtain hung at a shop's entrance:
   a dark rod on top, and the cloth cut into panels at the bottom. */
.closing {
  position: relative;
  background: var(--shu);
  color: var(--white);
  padding: clamp(52px, 7vw, 84px) 0 clamp(64px, 8vw, 100px);
  border-top: 10px solid var(--ai-deep);
}

.closing::after {
  content: '';
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: clamp(30px, 4.5vw, 54px);
  background: repeating-linear-gradient(to left, transparent 0 calc(25% - 3px), var(--paper) calc(25% - 3px) 25%);
  pointer-events: none;
}

.closing .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
}

.closing h2 {
  font-family: var(--font-he-display);
  font-weight: 800;
  font-size: clamp(1.8rem, 3.2vw, 2.5rem);
  margin: 0;
  max-width: 18em;
}

.closing .btn-primary {
  background: var(--white);
  color: var(--shu-dark);
  box-shadow: 0 3px 0 #7d1818;
}

/* ---------- Article ---------- */

.page-head {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: var(--ai);
  color: var(--white);
  padding: clamp(36px, 6vw, 64px) 0 clamp(40px, 5vw, 60px);
}

/* The page's character, large, on the far side: like a shop sign seen through the window. */
.page-glyph {
  position: absolute;
  inset-inline-end: clamp(-20px, 2vw, 40px);
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-ja);
  font-weight: 800;
  font-size: clamp(9rem, 22vw, 17rem);
  line-height: 1;
  color: rgba(255, 255, 255, 0.07);
  z-index: -1;
  pointer-events: none;
}

.crumbs {
  font-size: 0.95rem;
  color: #aeb8d0;
  margin: 0 0 14px;
}

.crumbs a {
  color: #d8deec;
}

.page-head h1 {
  font-family: var(--font-he-display);
  font-weight: 800;
  font-size: clamp(2.1rem, 4.4vw, 3.4rem);
  line-height: 1.12;
  margin: 0 0 14px;
  max-width: 20em;
}

.page-head .lede {
  color: #d8deec;
  font-size: 1.22rem;
  max-width: 40em;
  margin: 0;
}

.page-head .meta {
  margin: 18px 0 0;
  font-size: 0.95rem;
  color: #aeb8d0;
}

.prose {
  max-width: 70ch;
  padding-block: clamp(36px, 6vw, 64px);
}

.prose h2 {
  font-family: var(--font-he-display);
  font-weight: 800;
  font-size: clamp(1.6rem, 2.8vw, 2.1rem);
  line-height: 1.2;
  margin: 2.2em 0 0.5em;
}

.prose h3 {
  font-family: var(--font-he-display);
  font-size: 1.35rem;
  margin: 1.8em 0 0.4em;
}

.prose p,
.prose li {
  line-height: 1.85;
}

.prose ul,
.prose ol {
  padding-inline-start: 1.3em;
}

.prose li + li {
  margin-top: 6px;
}

.prose .ja {
  font-size: 1.12em;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.4em 0;
  font-size: 1.02rem;
}

.prose th,
.prose td {
  text-align: start;
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

.prose th {
  background: var(--mist);
  font-weight: 700;
}

.prose td .ja {
  font-size: 1.25rem;
}

.toc {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin: 0 0 2em;
}

.toc strong {
  display: block;
  margin-bottom: 6px;
}

.toc ol {
  margin: 0;
}

/* The letter chart, drawn as genkō paper: one cell per kana. */
.kana-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-top: 1.5px solid var(--grid);
  border-inline-start: 1.5px solid var(--grid);
  background: var(--white);
  margin: 1.4em 0;
}

.kana-cell {
  border-bottom: 1.5px solid var(--grid);
  border-inline-end: 1.5px solid var(--grid);
  padding: 10px 4px 8px;
  text-align: center;
  position: relative;
  min-height: 116px;
}

.kana-cell::before,
.kana-cell::after {
  content: '';
  position: absolute;
  background: var(--grid-soft);
  z-index: 0;
}

.kana-cell::before {
  top: 8px;
  bottom: 52px;
  inset-inline-start: 50%;
  width: 1px;
}

.kana-cell::after {
  inset-inline: 10px;
  top: 34px;
  height: 1px;
}

.kana-cell .k {
  position: relative;
  z-index: 1;
  display: block;
  font-family: var(--font-ja);
  font-size: 2.3rem;
  line-height: 1.15;
  color: var(--ink);
}

.kana-cell .r {
  display: block;
  direction: ltr;
  font-size: 0.92rem;
  color: var(--muted);
}

.kana-cell .h {
  display: block;
  font-family: var(--font-he-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--shu-dark);
}

.kana-cell.empty {
  background: repeating-linear-gradient(-45deg, transparent 0 8px, var(--grid-soft) 8px 9px);
}

.callout {
  border-inline-start: 4px solid var(--shu);
  background: var(--white);
  padding: 16px 20px;
  margin: 1.6em 0;
}

.callout p {
  margin: 0;
}

.practice {
  background: var(--ai);
  color: var(--white);
  border-radius: var(--radius);
  padding: 26px 28px;
  margin: 2.4em 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px 28px;
  align-items: center;
}

.practice h3 {
  font-family: var(--font-he-display);
  font-size: 1.4rem;
  margin: 0 0 4px;
  color: var(--white);
}

.practice p {
  margin: 0;
  color: #d8deec;
}

.related {
  border-top: 1px solid var(--rule);
  padding-top: 24px;
  margin-top: 3em;
}

.related ul {
  padding-inline-start: 1.1em;
}

/* Blog index */
.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 48px;
}

.post-list li {
  border-bottom: 1px solid var(--rule);
}

.post-list a {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 18px;
  padding: 24px 0;
  color: inherit;
  text-decoration: none;
}

.post-list .glyph {
  font-family: var(--font-ja);
  font-size: 2.6rem;
  line-height: 1;
  color: var(--shu);
  text-align: center;
}

.post-list h2,
.post-list h3 {
  font-family: var(--font-he-display);
  font-size: 1.35rem;
  line-height: 1.3;
  margin: 0 0 6px;
}

.post-list a {
  transition: background 0.15s ease;
}

.post-list a:hover h2,
.post-list a:hover h3 {
  color: var(--shu);
}

.post-list a:hover .glyph {
  color: var(--shu-dark);
}

.post-list p {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
}

/* Syllabus on the course page */
.syllabus {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 48px;
}

.syllabus section {
  border-top: 2px solid var(--ai);
  padding: 18px 0 28px;
}

.syllabus h3 {
  font-family: var(--font-he-display);
  font-size: 1.4rem;
  margin: 0 0 4px;
}

.syllabus .units {
  margin: 10px 0 0;
  padding-inline-start: 1.1em;
  color: var(--ink);
}

.free,
.syllabus .free {
  color: var(--shu-dark);
  font-weight: 700;
  font-size: 0.95rem;
}

/* One practice question, answered on the page. Radio buttons and CSS only:
   the checked answer shows its mark (maru or batsu) and its own explanation. */
.quiz {
  border: 2px solid var(--ai);
  border-radius: var(--radius);
  background: var(--white);
}

.quiz-q {
  margin: 0;
  padding: 20px 24px;
  font-family: var(--font-he-display);
  font-weight: 700;
  font-size: 1.4rem;
  line-height: 1.3;
  border-bottom: 2px solid var(--ai);
}

.quiz-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.quiz label {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  min-height: 68px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
  transition: background 0.15s ease;
}

.quiz label:hover {
  background: var(--paper);
}

.quiz-input:focus-visible + label {
  outline: 3px solid var(--shu);
  outline-offset: -3px;
}

.quiz-ja {
  font-family: var(--font-ja);
  font-weight: 700;
  font-size: 1.55rem;
  line-height: 1.3;
  color: var(--ai);
}

.quiz-he {
  color: var(--muted);
}

/* The answer box: one genkō cell. */
.quiz-mark {
  position: relative;
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--grid);
  border-radius: 3px;
  background: var(--white);
}

.quiz-mark::before,
.quiz-mark::after {
  content: '';
  position: absolute;
  opacity: 0;
}

.is-right:checked + label {
  background: var(--grid-soft);
}

.is-right:checked + label .quiz-mark::after {
  inset: 4px;
  border: 3px solid var(--shu);
  border-radius: 50%;
  opacity: 1;
}

.is-wrong:checked + label .quiz-ja {
  color: var(--muted);
}

.is-wrong:checked + label .quiz-mark::before,
.is-wrong:checked + label .quiz-mark::after {
  top: 4px;
  bottom: 4px;
  left: calc(50% - 1.5px);
  width: 3px;
  border-radius: 2px;
  background: var(--ai);
  opacity: 1;
  transform: rotate(45deg);
}

.is-wrong:checked + label .quiz-mark::after {
  transform: rotate(-45deg);
}

.quiz-result {
  padding: 18px 24px 22px;
  min-height: 7.2em;
}

.quiz-result p {
  margin: 0;
}

.quiz-hint {
  color: var(--muted);
}

.quiz-result > div {
  display: none;
}

.quiz-result .btn {
  margin-top: 16px;
}

.quiz-input:checked ~ .quiz-result .quiz-hint {
  display: none;
}

#quiz-a:checked ~ .quiz-result .quiz-a,
#quiz-b:checked ~ .quiz-result .quiz-b,
#quiz-c:checked ~ .quiz-result .quiz-c {
  display: block;
}

@media (prefers-reduced-motion: no-preference) {
  .is-right:checked + label .quiz-mark::after {
    animation: quiz-maru 0.28s ease-out;
  }

  @keyframes quiz-maru {
    from {
      opacity: 0;
      transform: scale(0.5);
    }
  }
}

/* Conversation sample: the character speaks, you answer. */
.split {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
}

.split .section-intro:last-child {
  margin-bottom: 0;
}

.dialogue {
  margin: 1.4em 0;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 24px 48px -32px rgba(30, 43, 77, 0.45);
}

.dialogue figcaption {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 16px;
  padding: 14px 20px;
  background: var(--ai);
  color: #d8deec;
  font-size: 0.95rem;
}

.dialogue figcaption strong {
  color: var(--white);
  font-family: var(--font-he-display);
  font-size: 1.05rem;
}

.chat {
  display: grid;
  gap: 12px;
  padding: 20px;
  background: var(--seigaiha-paper), var(--paper);
  background-size:
    36px 18px,
    auto;
}

.bubble {
  max-width: 82%;
  padding: 10px 16px 12px;
  border-radius: 16px;
  background: var(--white);
  border: 1px solid var(--rule);
}

.bubble.npc {
  justify-self: start;
  border-start-start-radius: 4px;
}

.bubble.you {
  justify-self: end;
  background: var(--ai);
  border-color: var(--ai);
  color: var(--white);
  border-start-end-radius: 4px;
}

.bubble p {
  margin: 0;
  line-height: 1.5;
}

.bubble .jp {
  font-family: var(--font-ja);
  font-weight: 700;
  font-size: 1.2rem;
  direction: ltr;
  text-align: start;
  unicode-bidi: plaintext;
}

.bubble .sound {
  font-family: var(--font-he-display);
  font-weight: 500;
  color: var(--shu-dark);
  font-size: 0.98rem;
}

.bubble.you .sound {
  color: #ffc9c2;
}

.bubble .mean {
  color: var(--muted);
  font-size: 0.95rem;
}

.bubble.you .mean {
  color: #c8d0e3;
}

/* Kanji drawing themselves inside an article. */
.kanji-demos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 12px;
  margin: 1.4em 0;
}

.kanji-demos figure {
  margin: 0;
  background: var(--white);
  border: 1.5px solid var(--grid);
  padding: 8px;
  text-align: center;
}

.kanji-demos figcaption {
  font-size: 0.85rem;
  color: var(--muted);
}

@media (prefers-reduced-motion: no-preference) {
  .kanji-demos .stroke {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: draw 0.6s ease-in-out both;
    animation-delay: var(--delay);
  }
}

.prose .ja.big {
  font-size: 2rem;
  line-height: 1;
}

/* A year in Japan: a timeline marked by season colors. */
.year,
.prose .year {
  list-style: none;
  margin: 2em 0;
  padding: 0;
  border-inline-start: 3px solid var(--rule);
}

.year li,
.prose .year li {
  margin: 0;
  position: relative;
  padding: 0 0 26px;
  padding-inline-start: 26px;
}

.year li::before {
  content: '';
  position: absolute;
  inset-inline-start: -9px;
  top: 6px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--season, var(--ai));
  box-shadow: 0 0 0 4px var(--paper);
}

.year .spring {
  --season: #e48aa0;
}
.year .summer {
  --season: #2f8f6b;
}
.year .autumn {
  --season: #c8651b;
}
.year .winter {
  --season: #5b74a8;
}

.year .when {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--muted);
}

.year h3 {
  margin: 2px 0 4px;
}

.year h3 .ja {
  color: var(--shu-dark);
  margin-inline-end: 6px;
}

.year p {
  margin: 0;
}

/* Four seasons, four characters. */
.seasons {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 1.5px solid var(--grid);
  background: var(--white);
}

.seasons li + li {
  border-inline-start: 1.5px solid var(--grid);
}

.seasons a {
  display: grid;
  gap: 2px;
  padding: 26px 22px;
  color: inherit;
  text-decoration: none;
  height: 100%;
  transition: background 0.15s ease;
}

.seasons a:hover {
  background: var(--grid-soft);
}

.seasons .k {
  font-family: var(--font-ja);
  font-weight: 800;
  font-size: 4rem;
  line-height: 1.1;
  color: var(--shu);
}

.seasons strong {
  font-family: var(--font-he-display);
  font-size: 1.3rem;
}

.seasons .r {
  color: var(--shu-dark);
  font-family: var(--font-he-display);
}

.seasons .t {
  color: var(--muted);
  font-size: 1rem;
  margin-top: 6px;
}

/* ---------- Footer ---------- */

.site-footer {
  position: relative;
  background: var(--ai-deep);
  color: #aeb8d0;
  padding: 48px 0 32px;
  font-size: 1rem;
}

.site-footer .wrap {
  position: relative;
}

/* 一期一会: "one time, one meeting", from the tea ceremony. */
.footer-motto {
  position: absolute;
  left: var(--gutter);
  top: 0;
  margin: 0;
  writing-mode: vertical-rl;
  font-family: var(--font-ja);
  font-size: 1.4rem;
  letter-spacing: 0.3em;
  color: rgba(255, 255, 255, 0.22);
}

.site-footer .cols {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr;
  gap: 28px;
  padding-inline-end: 48px;
}

.site-footer h2 {
  color: var(--white);
  font-size: 1.05rem;
  margin: 0 0 10px;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.site-footer a {
  color: #d8deec;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--white);
  text-decoration: underline;
}

.site-footer .fine {
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.88rem;
}

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .nav {
    display: none;
  }

  .nav-menu {
    display: block;
  }

  .site-header .wrap {
    position: relative;
  }

  /* On phones the start button stays visible: most searchers arrive on mobile.
     Brand on one side; the button and the menu icon together on the other. */
  .site-header .btn {
    min-height: 40px;
    padding: 0 14px;
    font-size: 0.98rem;
    box-shadow: none;
    margin-inline-start: auto;
  }

  .nav-menu {
    order: 3;
    margin-inline: 0 -10px;
  }

  .site-header .wrap {
    gap: 6px;
    min-height: 64px;
  }

  .brand {
    font-size: 1.15rem;
  }

  .hero .wrap,
  .teacher,
  .split {
    grid-template-columns: 1fr;
  }

  .seasons {
    grid-template-columns: 1fr 1fr;
  }

  .seasons li:nth-child(3) {
    border-inline-start: 0;
  }

  .seasons li:nth-child(n + 3) {
    border-top: 1.5px solid var(--grid);
  }

  .genko-demo {
    width: min(100%, 300px);
    justify-self: start;
  }

  .points {
    grid-template-columns: 1fr;
  }

  .steps {
    grid-template-columns: 1fr 1fr;
  }

  .pricing {
    grid-template-columns: 1fr;
  }

  .plan + .plan {
    border-inline-start: 0;
    border-top: 1px solid var(--rule);
  }

  .post-list,
  .syllabus {
    grid-template-columns: 1fr;
  }

  .site-footer .cols {
    grid-template-columns: 1fr 1fr;
  }

  .site-footer .cols > :first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 1.06rem;
  }

  .hero h1 {
    font-size: clamp(2.1rem, 9vw, 2.6rem);
  }

  .hero-tate {
    display: none;
  }

  /* One row: the start button at its natural size, the second action as a plain link beside it. */
  .hero-actions {
    gap: 4px 20px;
  }

  .hero-actions .btn-primary {
    padding-inline: 30px;
  }

  .hero-actions .btn-quiet {
    border: 0;
    padding: 0 2px;
    min-height: 44px;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 5px;
  }

  .hero-actions .btn-quiet:hover {
    background: none;
  }

  .brand {
    font-size: 1.08rem;
    gap: 9px;
  }

  .site-header .hanko {
    width: 32px;
    height: 32px;
    font-size: 1.15rem;
    border-radius: 6px;
  }

  .section h2 {
    font-size: clamp(1.6rem, 7vw, 2rem);
  }

  .page-head h1 {
    font-size: clamp(1.8rem, 8vw, 2.3rem);
  }

  .brand .name-long {
    display: none;
  }

  .bubble {
    max-width: 92%;
  }

  .chat {
    padding: 14px;
  }

  .seasons .k {
    font-size: 3rem;
  }

  .seasons a {
    padding: 18px 14px;
  }

  .closing .btn {
    padding-inline: 34px;
  }

  .hero-facts {
    flex-direction: column;
    gap: 4px;
  }

  .quiz-q {
    padding: 16px 18px;
    font-size: 1.25rem;
  }

  .quiz label {
    padding-inline: 18px;
    gap: 14px;
    min-height: 64px;
  }

  .quiz-ja {
    font-size: 1.35rem;
  }

  .quiz-result {
    padding: 16px 18px 20px;
  }

  .quiz-result .btn {
    width: 100%;
  }

  .prose table {
    font-size: 0.95rem;
    display: block;
    overflow-x: auto;
  }

  .prose th,
  .prose td {
    padding: 8px 6px;
  }

  /* Four columns of whole sentences do not fit a phone: each phrase stacks into its own block. */
  .prose table.phrases,
  .prose table.sayings {
    overflow-x: visible;
    font-size: 1rem;
    border-top: 1px solid var(--rule);
  }

  .prose table.phrases thead,
  .prose table.sayings thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .prose table.phrases tbody,
  .prose table.phrases tr,
  .prose table.phrases td,
  .prose table.sayings tbody,
  .prose table.sayings tr,
  .prose table.sayings td {
    display: block;
  }

  .prose table.phrases tr,
  .prose table.sayings tr {
    padding: 12px 0;
    border-bottom: 1px solid var(--rule);
  }

  .prose table.phrases td,
  .prose table.sayings td {
    padding: 0;
    border: 0;
  }

  /* The phrase itself is the large line; a Japanese example inside the meaning stays close to its text. */
  .prose table.phrases td:first-child .ja,
  .prose table.sayings td:nth-child(2) .ja {
    font-size: 1.3rem;
    white-space: normal;
  }

  .prose table.phrases td:nth-child(4) .ja {
    font-size: 1.15em;
    white-space: normal;
  }

  /* Romaji and Hebrew pronunciation share one muted line. */
  .prose table.phrases td:nth-child(2),
  .prose table.phrases td:nth-child(3),
  .prose table.sayings td:nth-child(3),
  .prose table.sayings td:nth-child(4) {
    display: inline;
    color: var(--muted);
    font-size: 0.95rem;
  }

  .prose table.phrases td:nth-child(3),
  .prose table.sayings td:nth-child(4) {
    margin-inline-start: 10px;
  }

  .steps {
    grid-template-columns: 1fr;
  }

  .paths a {
    grid-template-columns: 56px 1fr;
  }

  .paths .go {
    display: none;
  }

  .paths .glyph {
    font-size: 2.3rem;
  }

  .kana-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .kana-cell {
    min-height: 96px;
  }

  .kana-cell .k {
    font-size: 1.8rem;
  }

  .kana-cell .h {
    font-size: 1rem;
  }

  .kana-cell::before {
    bottom: 46px;
  }

  .practice {
    grid-template-columns: 1fr;
  }

  .site-footer .cols {
    grid-template-columns: 1fr;
  }
}

/* The narrowest phones: the header button keeps one word, and a long Japanese phrase may wrap. */
@media (max-width: 350px) {
  .btn-more {
    display: none;
  }

  p .ja,
  li .ja,
  dd .ja {
    white-space: normal;
  }
}

/* ---------- Print (letter charts) ---------- */

.print-row button {
  cursor: pointer;
  color: var(--ai);
}

@media print {
  .site-header,
  .site-footer,
  .practice,
  .toc,
  .related,
  .crumbs,
  .closing,
  .print-row,
  .faq {
    display: none !important;
  }

  body {
    background: #fff;
    font-size: 11pt;
  }

  .page-head {
    background: none;
    color: #000;
    padding: 0;
  }

  .page-head .lede,
  .page-head .meta {
    display: none;
  }

  .kana-grid {
    break-inside: avoid;
  }

  .kana-cell {
    min-height: 90px;
  }
}
