:root {
  color-scheme: light dark;
  --bg: #faf9f3;
  --surface: #fffef9;
  --text: #25231f;
  --muted: #6c675d;
  --faint: #6f6a5c;
  --line: #ded8ca;
  --accent: #9b5700;
  --accent-strong: #703c00;
  --accent-soft: #f7e6c9;
  --grammar-highlight: #006989;
  --grammar-highlight-soft: #e0f2f6;
  /* Text on accent fills, the same role --on-fill plays in the application
     tokens. It flips with the accent: the dark theme's accent is a light
     amber, on which white text is unreadable. */
  --on-fill: #ffffff;
  --shadow: 0 18px 50px rgb(55 41 20 / 10%);
  /* Practice paper of the kanji pages: the vermilion of a teacher's pen marks
     guides, new strokes and corrections, as in a Japanese copybook. */
  --paper: #fffdf7;
  --paper-line: rgb(200 57 43 / 30%);
  --shu: #c8392b;
  --shu-text: #a8281c;
  --ok: #1f7a4d;
  --ok-soft: #e4f3ea;
  font-family:
    Inter,
    "Segoe UI",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 85% 8%, rgb(201 142 50 / 9%), transparent 24rem),
    var(--bg);
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.75rem 1rem;
  color: var(--surface);
  background: var(--text);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: none;
}

.site-shell {
  width: min(1160px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  min-height: 76px;
  align-items: center;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--accent);
}

.brand-mark .paw {
  display: block;
  width: 23px;
  height: 23px;
  transform-origin: 50% 70%;
  transition: transform 240ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* The mascot leans in under a pointer. Touch devices keep the paw still: iOS
   holds :hover on whatever was tapped last. */
@media (hover: hover) {
  .brand:hover .brand-mark .paw {
    transform: rotate(-9deg) scale(1.06);
  }
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: auto;
  font-size: 15px;
}

/* The header call to action is a .button first: a bare `.site-nav a` rule wins
   on specificity and used to paint its label muted brown on the accent fill. */
.site-nav a:not(.button) {
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:not(.button):focus-visible {
  color: var(--text);
}

@media (hover: hover) {
  .site-nav a:not(.button):hover {
    color: var(--text);
  }
}

.site-nav .language-link {
  color: var(--accent-strong);
  font-weight: 700;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-fill);
  font-weight: 750;
  text-decoration: none;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease;
}

.button:focus-visible {
  box-shadow: 0 10px 24px rgb(112 60 0 / 20%);
  transform: translateY(-1px);
}

@media (hover: hover) {
  .button:hover {
    box-shadow: 0 10px 24px rgb(112 60 0 / 20%);
    transform: translateY(-1px);
  }
}

.button--quiet {
  border-color: var(--line);
  color: var(--text);
  background: transparent;
}

.hero {
  position: relative;
  display: grid;
  min-height: 560px;
  align-items: center;
  overflow: hidden;
  padding: 82px 0 92px;
  text-align: center;
}

.hero-watermark {
  position: absolute;
  top: 50%;
  right: clamp(-2rem, 4vw, 3rem);
  width: clamp(230px, 32vw, 420px);
  color: var(--text);
  line-height: 0;
  opacity: 0.035;
  pointer-events: none;
  transform: translateY(-50%);
  animation: watermark-settle 1400ms ease-out 160ms backwards;
}

.hero-watermark .paw {
  display: block;
  width: 100%;
  height: auto;
}

/* The public site ships no scripts, so every motion here is CSS: the hero
   column rises once on load, and the paw trail under it walks in. Browsers
   with scroll-driven timelines run the trail from the scroll position
   instead, see the @supports block below. */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes watermark-settle {
  from {
    opacity: 0;
  }

  to {
    opacity: 0.035;
  }
}

@keyframes paw-step {
  from {
    opacity: 0;
  }

  to {
    opacity: 0.32;
  }
}

.hero-inner > * {
  animation: rise 640ms cubic-bezier(0.22, 0.61, 0.36, 1) backwards;
}

.hero-inner > :nth-child(1) {
  animation-delay: 40ms;
}

.hero-inner > :nth-child(2) {
  animation-delay: 120ms;
}

.hero-inner > :nth-child(3) {
  animation-delay: 200ms;
}

.hero-inner > :nth-child(4) {
  animation-delay: 280ms;
}

.hero-inner > :nth-child(5) {
  animation-delay: 360ms;
}

.paw-trail {
  display: flex;
  justify-content: center;
  gap: clamp(20px, 5vw, 52px);
  padding: 0 0 10px;
}

.paw-trail-step {
  display: block;
  width: 22px;
  color: var(--accent);
  opacity: 0.32;
  animation: paw-step 520ms ease-out backwards;
}

.paw-trail-step .paw {
  display: block;
  width: 100%;
  height: auto;
}

.paw-trail-step:nth-child(odd) .paw {
  transform: rotate(-11deg);
}

.paw-trail-step:nth-child(even) .paw {
  transform: translateY(13px) rotate(12deg);
}

.paw-trail-step:nth-child(1) {
  animation-delay: 520ms;
}

.paw-trail-step:nth-child(2) {
  animation-delay: 620ms;
}

.paw-trail-step:nth-child(3) {
  animation-delay: 720ms;
}

.paw-trail-step:nth-child(4) {
  animation-delay: 820ms;
}

.paw-trail-step:nth-child(5) {
  animation-delay: 920ms;
}

@supports (animation-timeline: view()) {
  .paw-trail-step {
    animation-delay: 0s;
    animation-fill-mode: both;
    animation-timeline: view();
  }

  .paw-trail-step:nth-child(1) {
    animation-range: entry 12% cover 26%;
  }

  .paw-trail-step:nth-child(2) {
    animation-range: entry 18% cover 32%;
  }

  .paw-trail-step:nth-child(3) {
    animation-range: entry 24% cover 38%;
  }

  .paw-trail-step:nth-child(4) {
    animation-range: entry 30% cover 44%;
  }

  .paw-trail-step:nth-child(5) {
    animation-range: entry 36% cover 50%;
  }
}

.hero-inner {
  position: relative;
  max-width: 780px;
  margin-inline: auto;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--muted);
  font-family: "Yu Mincho", "Noto Serif JP", serif;
  font-size: 16px;
  letter-spacing: 0.45em;
}

.hero h1 {
  max-width: 18ch;
  margin: 0 auto 22px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(40px, 6vw, 70px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.04;
}

.hero-copy {
  max-width: 58ch;
  margin: 0 auto 32px;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.hero-note {
  margin: 17px 0 0;
  color: var(--faint);
  font-size: 14px;
}

.section {
  border-top: 1px solid var(--line);
  padding: 72px 0;
}

.section-heading {
  max-width: 720px;
  margin: 0 auto 42px;
  text-align: center;
}

.section-heading h2 {
  margin: 0 0 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 500;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.news-list {
  max-width: 880px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.news-list li {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 18px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
}

.news-list time {
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.news-list b {
  display: block;
  font-size: 18px;
}

.news-list p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.steps,
.features,
.plans {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--line);
  box-shadow: var(--shadow);
}

.steps {
  grid-template-columns: repeat(4, 1fr);
}

.features {
  grid-template-columns: repeat(3, 1fr);
}

.plans {
  grid-template-columns: repeat(3, 1fr);
}

.step,
.feature,
.plan {
  padding: 30px;
  background: var(--surface);
}

.step-number,
.feature-mark {
  display: grid;
  width: 40px;
  height: 40px;
  margin-bottom: 22px;
  place-items: center;
  border-radius: 50%;
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-family: "Yu Mincho", "Noto Serif JP", serif;
  font-size: 19px;
}

.step h3,
.feature h3,
.plan h3 {
  margin: 0 0 10px;
  font-size: 19px;
}

.step p,
.feature p,
.plan p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.community-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 30px;
  overflow: hidden;
  padding: clamp(30px, 5vw, 56px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(145deg, var(--surface), var(--surface));
  box-shadow: var(--shadow);
}
@supports (color: color-mix(in srgb, black, white)) {
  .community-card {
    background: linear-gradient(
      145deg,
      var(--surface),
      color-mix(in srgb, var(--accent-soft) 48%, var(--surface))
    );
  }
}

.community-mark {
  position: absolute;
  top: 50%;
  right: clamp(16px, 6vw, 72px);
  color: var(--accent);
  font-family: "Yu Mincho", "Noto Serif JP", serif;
  font-size: clamp(150px, 23vw, 260px);
  line-height: 1;
  opacity: 0.08;
  pointer-events: none;
  transform: translateY(-50%);
}

.community-copy,
.community-points {
  position: relative;
}

.community-copy {
  max-width: 720px;
}

.community-eyebrow {
  margin: 0 0 12px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.community-copy h2 {
  margin: 0 0 16px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 500;
  line-height: 1.12;
}

.community-copy > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.community-points {
  display: grid;
  min-width: 190px;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.community-points li {
  font-size: 14px;
  font-weight: 800;
}

.community-points li::before {
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-right: 9px;
  background-color: var(--accent-strong);
  content: "";
  mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2064%2064'%3E%3Cg%20fill='black'%3E%3Cellipse%20cx='18.6'%20cy='23.3'%20rx='4.4'%20ry='6.1'%20transform='rotate%28-22%2018.6%2023.3%29'/%3E%3Cellipse%20cx='27.6'%20cy='17.5'%20rx='4.7'%20ry='6.7'%20transform='rotate%28-8%2027.6%2017.5%29'/%3E%3Cellipse%20cx='36.9'%20cy='17.5'%20rx='4.7'%20ry='6.7'%20transform='rotate%288%2036.9%2017.5%29'/%3E%3Cellipse%20cx='46'%20cy='23.3'%20rx='4.4'%20ry='6.1'%20transform='rotate%2822%2046%2023.3%29'/%3E%3Cpath%20d='M32%2027.3c9.2%200%2015%206.4%2015%2013.3%200%207-6.8%2011-15%2011s-15.2-4-15.2-11c0-6.9%205.8-13.3%2015.2-13.3Z'/%3E%3C/g%3E%3C/svg%3E")
    center / contain no-repeat;
  vertical-align: -1px;
}

.theme-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 26px;
  padding: 0;
  list-style: none;
}

.theme-list li {
  display: grid;
  min-width: 76px;
  justify-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.theme-swatch {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 1px solid rgb(0 0 0 / 10%);
  border-radius: 50%;
  font-family: "Yu Mincho", "Noto Serif JP", serif;
  font-size: 20px;
}

.theme-default {
  color: #171717;
  background: #faf9f3;
}
.theme-sakura {
  color: #b3405f;
  background: #fbe7ec;
}
.theme-kawaii {
  color: #8e4fb0;
  background: #f5e6fa;
}
.theme-gameboy {
  color: #0f380f;
  background: #9bbc0f;
}
.theme-crt {
  color: #33ff66;
  background: #0a0f0a;
}
.theme-jrpg {
  color: #f2c94c;
  background: #1b2a55;
}
.theme-starwars {
  color: #ffe81f;
  background: #000;
}
.theme-zen {
  color: #8b5f30;
  background: #f1eadc;
}

.plan {
  display: flex;
  flex-direction: column;
  min-height: 310px;
}

.plan--featured {
  background: linear-gradient(160deg, var(--surface), var(--accent-soft));
}
@supports (color: color-mix(in srgb, black, white)) {
  .plan--featured {
    background: linear-gradient(
      160deg,
      var(--surface),
      color-mix(in srgb, var(--accent-soft) 55%, var(--surface))
    );
  }
}

.plan-name {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.plan-name span {
  color: var(--faint);
  font-family: "Yu Mincho", "Noto Serif JP", serif;
}

.plan-price {
  margin: 18px 0 22px;
  font-size: 28px;
}

.plan-price small {
  color: var(--faint);
  font-size: 13px;
}

.plan ul {
  display: grid;
  gap: 10px;
  margin: 0 0 26px;
  padding: 0;
  color: var(--muted);
  list-style: none;
}

.plan ul li::before {
  margin-right: 8px;
  color: var(--accent);
  content: "✓";
}

.plan .button {
  width: fit-content;
  margin-top: auto;
}

.faq-list {
  max-width: 820px;
  margin: 0 auto;
}

.faq-list details {
  border-top: 1px solid var(--line);
  padding: 20px 4px;
}

.faq-list summary {
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
}

.faq-list p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.reference-hero {
  position: relative;
  overflow: hidden;
  padding: 58px 0 74px;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 54px;
  color: var(--faint);
  font-size: 14px;
}

.breadcrumbs a {
  color: var(--muted);
}

.reference-mark {
  position: absolute;
  top: 36px;
  right: 5%;
  color: var(--accent);
  font-family: "Yu Mincho", "Noto Serif JP", serif;
  font-size: clamp(150px, 24vw, 280px);
  line-height: 1;
  opacity: 0.07;
  pointer-events: none;
}

.reference-hero .eyebrow {
  margin-bottom: 14px;
  color: var(--accent-strong);
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.reference-hero h1 {
  position: relative;
  max-width: 16ch;
  margin: 0 0 22px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(40px, 6vw, 66px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.reference-hero > p:last-child {
  position: relative;
  max-width: 68ch;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.reference-content {
  background: var(--surface);
}
@supports (color: color-mix(in srgb, black, white)) {
  .reference-content {
    background: color-mix(in srgb, var(--surface) 62%, transparent);
  }
}

.kana-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.kana-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  table-layout: fixed;
}

.kana-table caption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.kana-table td {
  height: 104px;
  border: 1px solid var(--line);
  text-align: center;
}

.kana-table tr:first-child td {
  border-top: 0;
}

.kana-table tr:last-child td {
  border-bottom: 0;
}

.kana-table td:first-child {
  border-left: 0;
}

.kana-table td:last-child {
  border-right: 0;
}

.kana-table a {
  display: grid;
  height: 100%;
  place-content: center;
  gap: 4px;
  text-decoration: none;
}

.kana-table a:focus-visible {
  background: var(--accent-soft);
}

@media (hover: hover) {
  .kana-table a:hover {
    background: var(--accent-soft);
  }
}

.kana-table b {
  color: var(--text);
  font-family: "Yu Mincho", "Noto Serif JP", serif;
  font-size: 38px;
  font-weight: 500;
  line-height: 1;
}

.kana-table span {
  color: var(--faint);
  font-size: 13px;
}

.kana-table .kana-empty {
  background: var(--surface-2);
}
@supports (color: color-mix(in srgb, black, white)) {
  .kana-table .kana-empty {
    background: color-mix(in srgb, var(--line) 28%, transparent);
  }
}

.reference-notes {
  max-width: 820px;
  margin: 56px auto 0;
}

.reference-notes h2 {
  margin: 0 0 22px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
  font-weight: 500;
}

.reference-notes ol {
  display: grid;
  gap: 14px;
  margin: 0;
  padding-left: 24px;
  color: var(--muted);
  line-height: 1.65;
}

.kanji-reference-list,
.theme-gallery {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.kanji-reference-list {
  grid-template-columns: repeat(4, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--line);
  gap: 1px;
  box-shadow: var(--shadow);
}

.kanji-reference-list li {
  display: grid;
  min-height: 150px;
  align-content: center;
  padding: 22px;
  background: var(--surface);
}

.kanji-reference-list b {
  font-family: "Yu Mincho", "Noto Serif JP", serif;
  font-size: 42px;
  font-weight: 500;
}

.kanji-reference-list span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.kanji-reference-list small {
  margin-top: 6px;
  color: var(--faint);
  font-size: 13px;
}

.theme-gallery {
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.theme-gallery-card {
  --theme-card-bg: #faf9f3;
  --theme-card-surface: #fffef9;
  --theme-card-text: #25231f;
  --theme-card-accent: #9b5700;
  display: grid;
  grid-template-columns: 190px 1fr;
  align-items: center;
  gap: 26px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.theme-mini-screen {
  display: grid;
  height: 124px;
  align-content: center;
  padding: 18px;
  border: 1px solid var(--theme-card-text);
  border-radius: 12px;
  background: var(--theme-card-bg);
  box-shadow: inset 0 0 0 5px var(--theme-card-surface);
}
@supports (color: color-mix(in srgb, black, white)) {
  .theme-mini-screen {
    border: 1px solid
      color-mix(in srgb, var(--theme-card-text) 16%, transparent);
  }
}

.theme-mini-screen span {
  color: var(--theme-card-accent);
  font-family: "Yu Mincho", "Noto Serif JP", serif;
  font-size: 32px;
}

.theme-mini-screen i {
  display: block;
  width: 78%;
  height: 5px;
  margin-top: 7px;
  border-radius: 999px;
  background: var(--theme-card-text);
  opacity: 0.22;
}

.theme-mini-screen i:last-child {
  width: 48%;
  background: var(--theme-card-accent);
  opacity: 0.75;
}

.theme-gallery-card b {
  font-size: 20px;
}

.theme-gallery-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.theme-gallery-card--sakura {
  --theme-card-bg: #fbe7ec;
  --theme-card-surface: #fff8fa;
  --theme-card-text: #542d38;
  --theme-card-accent: #b3405f;
}

.theme-gallery-card--kawaii {
  --theme-card-bg: #f5e6fa;
  --theme-card-surface: #fff8ff;
  --theme-card-text: #4d315c;
  --theme-card-accent: #8e4fb0;
}

.theme-gallery-card--gameboy {
  --theme-card-bg: #9bbc0f;
  --theme-card-surface: #8bac0f;
  --theme-card-text: #0f380f;
  --theme-card-accent: #306230;
}

.theme-gallery-card--crt {
  --theme-card-bg: #0a0f0a;
  --theme-card-surface: #101810;
  --theme-card-text: #b8ffc6;
  --theme-card-accent: #33ff66;
}

.theme-gallery-card--jrpg {
  --theme-card-bg: #1b2a55;
  --theme-card-surface: #223568;
  --theme-card-text: #f5f0df;
  --theme-card-accent: #f2c94c;
}

.theme-gallery-card--starwars {
  --theme-card-bg: #000;
  --theme-card-surface: #101010;
  --theme-card-text: #f4f4f4;
  --theme-card-accent: #ffe81f;
}

.theme-gallery-card--zen {
  --theme-card-bg: #f1eadc;
  --theme-card-surface: #fbf7ef;
  --theme-card-text: #382d23;
  --theme-card-accent: #8b5f30;
}

.reference-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin-top: 46px;
}

.grammar-directory-hero h1,
.grammar-article-hero h1 {
  max-width: none;
}

.grammar-directory-levels {
  margin: 34px 0 0;
  text-align: center;
  color: var(--muted);
}

.grammar-directory-levels a {
  font-weight: 600;
}

.grammar-article-hero h1 {
  color: var(--accent-strong);
  font-family: "Yu Mincho", "Noto Serif JP", serif;
  font-size: clamp(48px, 8vw, 76px);
}

.grammar-directory-groups {
  display: grid;
  gap: 42px;
}

.grammar-directory-group h3 {
  margin: 0 0 16px;
  color: var(--accent-strong);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  font-weight: 500;
}

.grammar-directory-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.grammar-directory-card {
  display: grid;
  height: 100%;
  gap: 7px;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  text-decoration: none;
}

a.grammar-directory-card {
  box-shadow: 0 8px 22px rgb(55 41 20 / 7%);
  transition:
    border-color 150ms ease,
    transform 150ms ease;
}

a.grammar-directory-card:focus-visible {
  border-color: var(--accent);
  transform: translateY(-2px);
}

@media (hover: hover) {
  a.grammar-directory-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
  }
}

.grammar-directory-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.grammar-directory-pattern {
  color: var(--text);
  font-family: "Yu Mincho", "Noto Serif JP", serif;
  font-size: 21px;
  font-weight: 650;
  line-height: 1.35;
}

.grammar-directory-badge {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--faint);
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 750;
}
@supports (color: color-mix(in srgb, black, white)) {
  .grammar-directory-badge {
    background: color-mix(in srgb, var(--line) 45%, transparent);
  }
}

.grammar-directory-badge.is-detailed {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.grammar-directory-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.grammar-directory-card small {
  color: var(--faint);
  font-size: 13px;
}

.grammar-article-layout {
  display: grid;
  max-width: 860px;
  gap: 16px;
}

.grammar-article-section {
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 12px 32px rgb(55 41 20 / 6%);
}

.grammar-article-section h2,
.grammar-article-section h3,
.grammar-article-section p,
.grammar-article-section dl {
  margin-top: 0;
}

.grammar-article-section h2 {
  margin-bottom: 16px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(24px, 4vw, 30px);
  font-weight: 500;
}

.grammar-article-section h3 {
  margin: 28px 0 12px;
  font-size: 18px;
}

.grammar-article-section p,
.grammar-article-section li,
.grammar-article-section dd {
  line-height: 1.65;
}

.grammar-article-section ol,
.grammar-article-section ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 22px;
}

.grammar-article-uses {
  display: grid;
  gap: 12px;
  margin-bottom: 0;
}

.grammar-article-uses div {
  padding: 14px 16px;
  border-left: 3px solid var(--grammar-highlight);
  border-radius: 0 12px 12px 0;
  background: var(--grammar-highlight-soft);
}

.grammar-article-uses dt {
  font-weight: 800;
}

.grammar-article-uses dd {
  margin: 4px 0 0;
  color: var(--muted);
}

.grammar-example-japanese {
  margin-bottom: 16px;
  font-family: "Yu Mincho", "Noto Serif JP", serif;
  font-size: clamp(25px, 5vw, 36px);
  line-height: 2.1 !important;
}

.grammar-example-token {
  padding: 2px 1px;
  border-radius: 4px;
}

.grammar-example-token--particle {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.grammar-example-token--grammar {
  color: var(--grammar-highlight);
  background: var(--grammar-highlight-soft);
  font-weight: 700;
}

.grammar-example-token ruby {
  ruby-position: over;
}

.grammar-example-token rt {
  color: var(--faint);
  font-family: Inter, "Segoe UI", sans-serif;
  font-size: 0.42em;
  font-weight: 500;
}

.grammar-example-translation {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 18px;
}

.grammar-article-similar {
  padding: 0 !important;
  list-style: none;
}

.grammar-article-similar a {
  display: grid;
  gap: 4px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
}

.grammar-article-similar a:focus-visible {
  border-color: var(--accent);
}

@media (hover: hover) {
  .grammar-article-similar a:hover {
    border-color: var(--accent);
  }
}

.grammar-article-similar b {
  color: var(--accent-strong);
  font-family: "Yu Mincho", "Noto Serif JP", serif;
  font-size: 18px;
}

.grammar-article-similar span {
  color: var(--muted);
}

.grammar-article-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.site-footer {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 32px 0 46px;
  color: var(--faint);
  font-size: 14px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-left: auto;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171714;
    --surface: #201f1b;
    --text: #f3efe7;
    --muted: #beb6a8;
    --faint: #a49c8f;
    --line: #3b3932;
    --accent: #dda65d;
    --accent-strong: #f0c07e;
    --accent-soft: #3d2d1d;
    --grammar-highlight: #7ed3ef;
    --grammar-highlight-soft: #15343e;
    --on-fill: #241a0c;
    --shadow: 0 18px 50px rgb(0 0 0 / 24%);
    --paper: #1c1b17;
    --paper-line: rgb(255 138 118 / 26%);
    --shu: #ff7b6b;
    --shu-text: #ff9c8f;
    --ok: #7fd9a6;
    --ok-soft: #173326;
  }
}

@media (max-width: 820px) {
  .site-shell {
    width: min(100% - 28px, 680px);
  }

  .site-header {
    min-height: 66px;
    flex-wrap: wrap;
    row-gap: 8px;
    padding-block: 12px;
  }

  .site-nav a:not(.language-link):not(.header-cta) {
    display: none;
  }

  .site-nav {
    max-width: 100%;
    flex-wrap: wrap;
    gap: 10px;
  }

  .header-cta {
    min-height: 42px;
    padding-inline: 16px;
  }

  .hero {
    min-height: 500px;
    padding: 60px 0 72px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    max-width: 330px;
    margin-inline: auto;
  }

  .section {
    padding: 56px 0;
  }

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

  .community-card {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .community-points {
    min-width: 0;
  }

  .news-list li {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .plan {
    min-height: 0;
  }

  .reference-hero {
    padding: 34px 0 54px;
  }

  .breadcrumbs {
    margin-bottom: 38px;
  }

  .kanji-reference-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .theme-gallery {
    grid-template-columns: 1fr;
  }

  .theme-gallery-card {
    grid-template-columns: minmax(128px, 40%) 1fr;
    gap: 18px;
  }

  .grammar-directory-list {
    grid-template-columns: 1fr;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-footer nav {
    margin-left: 0;
  }
}

@media (max-width: 480px) {
  .grammar-article-actions {
    grid-template-columns: 1fr;
  }

  .kanji-reference-list li {
    min-height: 132px;
    padding: 16px;
  }

  .theme-gallery-card {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .button {
    transition: none;
  }

  .brand-mark .paw {
    transition: none;
  }

  .hero-inner > *,
  .hero-watermark,
  .paw-trail-step {
    animation: none;
  }
}

.jlpt-levels {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-block: 20px;
}

.jlpt-answer summary {
  display: list-item;
  min-height: 44px;
  padding: 12px 0;
  cursor: pointer;
}

.jlpt-answer p {
  overflow-wrap: anywhere;
}

/* ---------- страница репетиторов ---------- */

.tutor-groups {
  display: grid;
  gap: 28px;
}

.tutor-groups h3 {
  margin: 0 0 14px;
  font-size: 19px;
  font-weight: 600;
}

.tutor-disclaimer {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.community-link {
  grid-column: 1 / -1;
  justify-self: start;
  color: var(--accent);
  font-size: 15px;
  text-decoration: none;
  border-bottom: 1px solid currentcolor;
}

/* ---------- общие элементы справочных страниц ---------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.grammar-article-content [hidden],
.kanji-page [hidden] {
  display: none !important;
}

/* Кнопка озвучки: появляется, только если браузер умеет говорить по-японски. */
.speak-button {
  display: inline-grid;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: var(--surface);
  cursor: pointer;
  transition:
    color 150ms ease,
    border-color 150ms ease;
}

.speak-button svg {
  width: 20px;
  height: 20px;
}

.speak-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.speak-button[data-speaking] {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.speak-button[data-speaking] .speak-wave {
  animation: speak-pulse 900ms ease-in-out infinite;
}

@keyframes speak-pulse {
  50% {
    opacity: 0.25;
  }
}

@media (hover: hover) {
  .speak-button:hover {
    border-color: var(--accent);
    color: var(--accent-strong);
  }
}

/* ---------- статья грамматики: примеры ---------- */

.grammar-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.grammar-section-head h2 {
  margin-bottom: 0 !important;
}

.grammar-section-head span {
  color: var(--faint);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.grammar-article-section .grammar-example-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.grammar-example {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.grammar-example:first-child {
  border-top: 0;
}

.grammar-example .grammar-example-japanese {
  margin: 0;
  font-size: clamp(20px, 3.4vw, 24px);
}

.grammar-example .grammar-example-translation {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
}

.grammar-example--featured {
  margin: 10px 0 8px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(
    145deg,
    var(--grammar-highlight-soft),
    var(--surface) 62%
  );
}

.grammar-example--featured + .grammar-example {
  border-top: 0;
}

.grammar-example--featured .grammar-example-japanese {
  font-size: clamp(25px, 5vw, 34px);
}

.grammar-example--featured .grammar-example-translation {
  font-size: 18px;
}

.grammar-more-examples {
  margin-top: 6px;
  border-top: 1px solid var(--line);
}

.grammar-more-examples summary {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  margin: 14px 0 4px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent-strong);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.grammar-more-examples summary::-webkit-details-marker {
  display: none;
}

.grammar-more-examples summary::after {
  margin-left: 10px;
  content: "+";
  font-weight: 500;
}

.grammar-more-examples[open] summary::after {
  content: "−";
}

.grammar-more-examples summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.grammar-mistakes li::marker {
  color: var(--shu);
}

/* ---------- статья грамматики: проверьте себя ---------- */

.grammar-quiz-hint {
  margin-bottom: 22px !important;
  color: var(--muted);
}

.grammar-article-section .grammar-quiz-list {
  gap: 26px;
  padding: 0;
  list-style: none;
  counter-reset: quiz;
}

.grammar-quiz-item {
  counter-increment: quiz;
}

.grammar-quiz-item fieldset {
  display: grid;
  min-width: 0;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.grammar-quiz-item legend {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
  padding: 0;
}

.grammar-quiz-item legend::before {
  display: grid;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  color: var(--accent-strong);
  background: var(--accent-soft);
  content: counter(quiz);
  font-size: 14px;
  font-weight: 800;
  transform: translateY(-4px);
}

.grammar-quiz-sentence {
  font-family: "Yu Mincho", "Noto Serif JP", serif;
  font-size: clamp(21px, 3.6vw, 25px);
  line-height: 2.1;
}

.grammar-quiz-sentence .grammar-example-token rt {
  font-size: 0.45em;
}

.grammar-quiz-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  line-height: 1.5;
  cursor: pointer;
  transition:
    border-color 150ms ease,
    background-color 150ms ease;
}

.grammar-quiz-option input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--accent);
}

.grammar-quiz-option:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (hover: hover) {
  .grammar-quiz-option:hover {
    border-color: var(--accent);
  }
}

.grammar-quiz-item:has(input:checked)
  .grammar-quiz-option:has(input[data-correct]) {
  border-color: var(--ok);
  background: var(--ok-soft);
}

.grammar-quiz-item:has(input:checked)
  .grammar-quiz-option:has(input[data-correct])::after {
  margin-left: auto;
  color: var(--ok);
  content: "✓";
  font-weight: 800;
}

.grammar-quiz-option:has(input:checked):not(:has(input[data-correct])) {
  border-color: var(--shu);
}

.grammar-quiz-verdict {
  min-height: 1.5em;
  margin: 10px 0 0 !important;
  font-weight: 700;
}

.grammar-quiz-verdict span {
  display: none;
}

.grammar-quiz-item:has(input[data-correct]:checked)
  .grammar-quiz-verdict--right {
  display: inline;
  color: var(--ok);
}

.grammar-quiz-item:has(input:not([data-correct]):checked)
  .grammar-quiz-verdict--wrong {
  display: inline;
  color: var(--shu-text);
}

/* ---------- статья грамматики: подкасты ---------- */

.grammar-podcasts > p {
  color: var(--muted);
}

.grammar-article-section .grammar-podcast-list {
  gap: 10px;
  padding: 0;
  list-style: none;
}

.grammar-podcast-list a {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  column-gap: 14px;
  align-items: center;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  text-decoration: none;
  transition: border-color 150ms ease;
}

.grammar-podcast-play {
  display: block;
  grid-row: 1 / span 3;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.grammar-podcast-play svg {
  display: block;
  width: 100%;
  height: 100%;
}

.grammar-podcast-list b {
  font-size: 17px;
}

.grammar-podcast-list span {
  color: var(--muted);
  font-family: "Yu Mincho", "Noto Serif JP", serif;
}

.grammar-podcast-list small {
  color: var(--faint);
  font-size: 13px;
}

.grammar-podcast-list a:focus-visible {
  border-color: var(--accent);
}

@media (hover: hover) {
  .grammar-podcast-list a:hover {
    border-color: var(--accent);
  }
}

/* ---------- кандзи: список уровня ---------- */

.kanji-level-switch {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 0 0 28px;
}

.kanji-level-switch a {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-weight: 750;
  text-decoration: none;
}

.kanji-level-switch a span {
  color: var(--faint);
  font-size: 14px;
  font-weight: 500;
}

.kanji-level-switch a[aria-current="page"] {
  border-color: var(--text);
  color: var(--bg);
  background: var(--text);
}

.kanji-level-switch a[aria-current="page"] span {
  color: inherit;
  opacity: 0.75;
}

.kanji-reference-list li:has(> .kanji-card) {
  padding: 0;
}

.kanji-reference-list .kanji-card {
  display: grid;
  height: 100%;
  min-height: 150px;
  align-content: center;
  padding: 22px;
  text-decoration: none;
  transition: background-color 150ms ease;
}

.kanji-reference-list .kanji-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -4px;
  background: var(--accent-soft);
}

@media (hover: hover) {
  .kanji-reference-list .kanji-card:hover {
    background: var(--accent-soft);
  }
}

/* ---------- кандзи: страница знака ---------- */

.kanji-hero {
  padding: 40px 0 64px;
}

.kanji-hero .breadcrumbs {
  margin-bottom: 30px;
}

.kanji-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  align-items: start;
  gap: clamp(28px, 5vw, 64px);
}

.kanji-hero__meta {
  margin: 0 0 6px;
  color: var(--accent-strong);
  font-size: 15px;
  font-weight: 700;
}

.kanji-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 24px;
  margin: 0 0 26px;
  font-weight: 500;
}

.kanji-title__glyph {
  font-family: "Yu Mincho", "Noto Serif JP", serif;
  font-size: clamp(92px, 11vw, 132px);
  line-height: 1.05;
}

.kanji-title__meaning {
  max-width: 14ch;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(26px, 3.2vw, 36px);
  letter-spacing: -0.015em;
  line-height: 1.15;
}

.kanji-readings {
  display: grid;
  gap: 12px;
  margin: 0;
}

.kanji-readings div {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: baseline;
  gap: 12px;
}

.kanji-readings dt {
  color: var(--faint);
  font-size: 14px;
  font-weight: 750;
}

.kanji-readings dd {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 16px;
  margin: 0;
  font-family: "Yu Mincho", "Noto Serif JP", serif;
  font-size: 22px;
}

.kanji-reading__okurigana,
.kanji-reading__affix,
.kanji-reading--rare {
  color: var(--faint);
}

.kanji-more-readings {
  display: contents;
}

.kanji-more-readings summary {
  align-self: center;
  padding: 2px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  cursor: pointer;
  list-style: none;
}

.kanji-more-readings summary::-webkit-details-marker {
  display: none;
}

.kanji-more-readings[open] summary {
  display: none;
}

.kanji-readings-hint {
  max-width: 48ch;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.kanji-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.kanji-hero__lesson {
  margin: 12px 0 0;
  color: var(--faint);
  font-size: 14px;
}

.kanji-sheet {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.kanji-sheet__cell {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 10px;
  margin: 0;
}

.kanji-paper {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1.5px solid var(--paper-line);
  border-radius: 6px;
  background: var(--paper);
}

.kanji-grid,
.kanji-strokes,
.kanji-practice__trace,
.kanji-practice__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.kanji-grid path {
  fill: none;
  stroke: var(--paper-line);
  stroke-dasharray: 2.6 2.2;
  stroke-width: 0.7;
}

.kanji-grid .kanji-grid__diagonal {
  opacity: 0.5;
}

.kanji-strokes path,
.kanji-practice__trace path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3.4;
}

.kanji-strokes__ghost path {
  stroke: var(--line);
}

.kanji-strokes {
  --stroke-time: 560ms;
  --stroke-step: 680ms;
}

.kanji-strokes__ink path {
  stroke: var(--text);
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

.kanji-strokes__numbers text {
  fill: var(--shu);
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  font-size: 8px;
  font-weight: 700;
}

/* Каждая черта появляется красной кистью учителя и остывает до туши. */
.kanji-strokes.is-drawing .kanji-strokes__ink path {
  stroke-dashoffset: 1;
  animation: kanji-draw var(--stroke-time) cubic-bezier(0.45, 0.05, 0.35, 1)
    both;
  animation-delay: calc(var(--i) * var(--stroke-step) + 350ms);
}

.kanji-strokes.is-drawing .kanji-strokes__numbers text {
  opacity: 0;
  animation: kanji-number 200ms ease-out forwards;
  animation-delay: calc(var(--i) * var(--stroke-step) + 350ms);
}

/* Пока черта ждёт своей очереди, её скрывает прозрачность: нулевой штрих
   с круглым концом иначе рисовал бы точку в начале. */
@keyframes kanji-draw {
  0% {
    opacity: 0;
    stroke: var(--shu);
    stroke-dashoffset: 1;
  }

  1% {
    opacity: 1;
  }

  70% {
    stroke: var(--shu);
    stroke-dashoffset: 0;
  }

  100% {
    stroke: var(--text);
    stroke-dashoffset: 0;
  }
}

@keyframes kanji-number {
  to {
    opacity: 1;
  }
}

.kanji-sheet figcaption,
.kanji-practice__caption {
  display: flex;
  min-height: 36px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 15px;
  font-weight: 750;
}

.kanji-sheet__replay,
.kanji-sheet__toggle {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.kanji-sheet__toggle[aria-pressed="true"] {
  border-color: var(--shu);
  color: var(--shu-text);
  background: var(--paper);
}

/* Отмена и очистка лежат прямо на листе, в углу, как ластик у тетради. */
.kanji-practice__tools {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
}

.kanji-practice__tools button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  transition: opacity 150ms ease;
}

.kanji-practice__tools svg {
  width: 20px;
  height: 20px;
}

.kanji-practice__tools button:disabled {
  cursor: default;
  opacity: 0;
  pointer-events: none;
}

.kanji-sheet__replay:focus-visible,
.kanji-sheet__toggle:focus-visible,
.kanji-practice__tools button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (hover: hover) {
  .kanji-sheet__replay:hover,
  .kanji-sheet__toggle:hover,
  .kanji-practice__tools button:not(:disabled):hover {
    border-color: var(--accent);
  }
}

.kanji-practice__trace {
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

.kanji-practice__trace path {
  stroke: var(--text);
  opacity: 0.13;
}

.kanji-practice[data-trace] .kanji-practice__trace {
  opacity: 1;
}

.kanji-practice__canvas {
  cursor: crosshair;
  touch-action: none;
}

.kanji-practice {
  --practice-ink: var(--text);
  --practice-wrong: var(--shu);
}

/* Учительский кружок はなまる вокруг верно написанного знака. */
.kanji-practice__mark {
  position: absolute;
  inset: 4%;
  width: 92%;
  height: 92%;
  opacity: 0;
  pointer-events: none;
}

.kanji-practice__mark path {
  fill: none;
  stroke: var(--shu);
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  stroke-linecap: round;
  stroke-width: 3.2;
}

.kanji-practice[data-state="accepted"] .kanji-practice__mark {
  opacity: 0.85;
}

.kanji-practice[data-state="accepted"] .kanji-practice__mark path {
  animation: kanji-maru 620ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes kanji-maru {
  to {
    stroke-dashoffset: 0;
  }
}

.kanji-practice__status {
  min-height: 3em;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.kanji-practice[data-state="accepted"] .kanji-practice__status {
  color: var(--ok);
  font-weight: 650;
}

.kanji-practice[data-state="rejected"] .kanji-practice__status {
  color: var(--shu-text);
}

.kanji-practice__noscript {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.has-script .kanji-practice__noscript,
html:not(.has-script) .kanji-practice__status {
  display: none;
}

.kanji-body {
  padding-bottom: 32px;
}

.kanji-section {
  padding: 44px 0;
  border-top: 1px solid var(--line);
}

.kanji-section h2 {
  margin: 0 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(25px, 3.4vw, 32px);
  font-weight: 500;
}

.kanji-section h2 [lang="ja"] {
  font-family: "Yu Mincho", "Noto Serif JP", serif;
}

.kanji-section__head p {
  max-width: 70ch;
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.55;
}

.kanji-order-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.kanji-order-strip li {
  display: grid;
  justify-items: center;
  gap: 6px;
}

.kanji-order-strip svg {
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.kanji-order-strip svg path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.kanji-order-strip .kanji-order-strip__guide {
  stroke: var(--paper-line);
  stroke-dasharray: 2.6 2.2;
  stroke-width: 0.7;
}

.kanji-order-strip__done path {
  stroke: var(--text);
  stroke-width: 4;
}

.kanji-order-strip .kanji-order-strip__current {
  stroke: var(--shu);
  stroke-width: 4.4;
}

.kanji-order-strip__start {
  fill: var(--shu);
}

.kanji-order-strip span {
  color: var(--faint);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.kanji-words,
.kanji-sentences {
  margin: 0;
  padding: 0;
  list-style: none;
}

.kanji-words {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 32px;
}

.kanji-words li,
.kanji-sentences li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--line);
}

.kanji-word {
  display: grid;
  grid-template-columns: minmax(96px, auto) minmax(0, 1fr);
  grid-template-areas:
    "writing meaning"
    "reading meaning";
  align-items: center;
  column-gap: 18px;
  padding: 14px 0;
  text-decoration: none;
}

.kanji-word__writing {
  grid-area: writing;
  font-family: "Yu Mincho", "Noto Serif JP", serif;
  font-size: 25px;
  line-height: 1.25;
}

.kanji-word__reading {
  grid-area: reading;
  color: var(--muted);
  font-size: 14px;
}

.kanji-word__meaning {
  grid-area: meaning;
  line-height: 1.45;
}

.kanji-hit {
  color: var(--shu-text);
  background: none;
}

@media (hover: hover) {
  .kanji-word:hover .kanji-word__meaning {
    text-decoration: underline;
    text-decoration-color: var(--line);
    text-underline-offset: 4px;
  }
}

.kanji-word:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.kanji-sentences li {
  padding: 16px 0;
}

.kanji-sentence__text {
  margin: 0;
  font-family: "Yu Mincho", "Noto Serif JP", serif;
  font-size: clamp(20px, 3.4vw, 24px);
  line-height: 2.1;
}

.kanji-sentence__text rt {
  color: var(--faint);
  font-family: Inter, "Segoe UI", sans-serif;
  font-size: 0.45em;
}

.kanji-sentence__text ruby.kanji-hit rt {
  color: var(--faint);
}

.kanji-sentence__translation {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.kanji-story__parts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 8px 0 14px;
  font-family: "Yu Mincho", "Noto Serif JP", serif;
  font-size: 36px;
}

.kanji-story__parts i {
  color: var(--faint);
  font-family: Inter, "Segoe UI", sans-serif;
  font-size: 22px;
  font-style: normal;
}

.kanji-story__parts b {
  color: var(--shu-text);
  font-weight: 500;
}

.kanji-story > p:last-child {
  max-width: 68ch;
  margin: 0;
  font-size: 17px;
  line-height: 1.7;
}

.kanji-relations {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  margin-top: 18px;
}

.kanji-relations h3 {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 750;
}

.kanji-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.kanji-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  text-decoration: none;
}

.kanji-chip b {
  font-family: "Yu Mincho", "Noto Serif JP", serif;
  font-size: 28px;
  font-weight: 500;
  line-height: 1.1;
}

.kanji-chip span {
  color: var(--muted);
  font-size: 14px;
}

a.kanji-chip {
  transition: border-color 150ms ease;
}

a.kanji-chip:focus-visible {
  border-color: var(--accent);
}

@media (hover: hover) {
  a.kanji-chip:hover {
    border-color: var(--accent);
  }
}

.kanji-pager {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 34px 0 10px;
  border-top: 1px solid var(--line);
}

.kanji-pager__step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "label label"
    "glyph meaning";
  align-items: baseline;
  column-gap: 12px;
  justify-self: start;
  text-decoration: none;
}

.kanji-pager__step--next {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "label label"
    "meaning glyph";
  justify-self: end;
  text-align: right;
}

.kanji-pager__step small {
  grid-area: label;
  color: var(--faint);
  font-size: 13px;
}

.kanji-pager__step b {
  grid-area: glyph;
  font-family: "Yu Mincho", "Noto Serif JP", serif;
  font-size: 36px;
  font-weight: 500;
}

.kanji-pager__step span {
  grid-area: meaning;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kanji-pager__step:focus-visible b,
.kanji-pager__all:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

@media (hover: hover) {
  .kanji-pager__step:hover b {
    color: var(--accent-strong);
  }
}

.kanji-pager__all {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
}

.kanji-source {
  margin: 14px 0 0;
  color: var(--faint);
  font-size: 13px;
  line-height: 1.5;
}

/* ---------- слова: страница слова и список ---------- */

.word-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 24px;
  margin: 0 0 8px;
  font-weight: 500;
}

.word-title__writing {
  font-family: "Yu Mincho", "Noto Serif JP", serif;
  font-size: clamp(64px, 8.5vw, 104px);
  letter-spacing: 0.02em;
  line-height: 1.15;
}

.word-title__writing rt,
.word-form__text rt,
.word-card__writing rt {
  color: var(--faint);
  font-family: Inter, "Segoe UI", sans-serif;
  ruby-align: center;
}

.word-title__writing rt {
  font-size: 0.24em;
}

/* Окончание, которое меняется при спряжении, — тем же красным, что и новая
   черта на странице кандзи. */
.word-title__ending,
.word-form__ending,
.word-shift {
  color: var(--shu-text);
}

.word-title__meaning {
  max-width: 18ch;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(26px, 3.2vw, 36px);
  letter-spacing: -0.015em;
  line-height: 1.15;
}

.word-reading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  color: var(--muted);
  font-size: 20px;
}

.word-features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.word-features li {
  padding: 4px 12px;
  border: 1px solid var(--paper-line);
  border-radius: 999px;
  color: var(--shu-text);
  font-size: 14px;
}

.kanji-hero__meta a {
  text-decoration-color: var(--line);
  text-underline-offset: 4px;
}

.kanji-hero__meta a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Главные формы — клетка прописи 2 × 2 с пунктирными направляющими. */
.word-keyforms {
  padding: 22px 24px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.word-keyforms h2 {
  margin: 0 0 14px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 500;
}

.word-keyforms__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}

.word-keyforms__grid > div {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  padding: 16px 18px 18px;
}

.word-keyforms__grid > div:nth-child(odd) {
  padding-left: 0;
  border-right: 1px dashed var(--paper-line);
}

.word-keyforms__grid > div:nth-child(n + 3) {
  border-top: 1px dashed var(--paper-line);
}

.word-keyforms dt {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
}

.word-keyforms dt b {
  font-family: "Yu Mincho", "Noto Serif JP", serif;
  font-size: 17px;
}

.word-keyforms dt span {
  color: var(--faint);
  font-size: 13px;
}

.word-keyforms dd {
  display: grid;
  gap: 2px;
  margin: 0;
}

.word-keyforms .word-form__text {
  font-size: clamp(26px, 3vw, 32px);
}

.word-keyforms__legend {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 0;
  color: var(--faint);
  font-size: 13px;
}

.word-keyforms__legend span {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--shu);
}

.word-form__text {
  font-family: "Yu Mincho", "Noto Serif JP", serif;
  font-size: 24px;
  line-height: 1.9;
  overflow-wrap: anywhere;
}

.word-form__text rt {
  font-size: 0.5em;
}

.word-form__text rt.word-shift {
  color: var(--shu-text);
}

.word-form__gloss {
  display: block;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.word-form + .word-form {
  margin-top: 10px;
}

.word-form--variant .word-form__text {
  font-size: 20px;
}

.word-form__variant {
  display: block;
  color: var(--faint);
  font-size: 13px;
}

.word-form__none {
  color: var(--faint);
}

/* Переключатель стиля речи: радиокнопки, таблицы прячет CSS — страница
   работает и без скрипта. */
.word-registers {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: 0 0 22px;
  padding: 0;
  border: 0;
}

.word-registers legend {
  float: left;
  margin-right: 6px;
  padding: 0;
  color: var(--muted);
  font-size: 15px;
}

.word-registers label {
  position: relative;
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-weight: 650;
  cursor: pointer;
}

.word-registers input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.word-registers label:has(input:checked) {
  border-color: var(--text);
  color: var(--bg);
  background: var(--text);
}

.word-registers label:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.word-forms:has(#word-register-polite:checked)
  .word-table:not([data-register="polite"]),
.word-forms:has(#word-register-plain:checked)
  .word-table:not([data-register="plain"]),
.word-forms:has(#word-register-friendly:checked)
  .word-table:not([data-register="friendly"]) {
  display: none;
}

.word-table__title {
  margin: 28px 0 10px;
  font-size: 18px;
}

@supports selector(:has(*)) {
  .word-table__title {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

@supports not selector(:has(*)) {
  .word-registers {
    display: none;
  }
}

.word-table table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.word-table thead th {
  padding: 0 14px 10px 0;
  color: var(--faint);
  font-size: 14px;
  font-weight: 650;
  text-align: left;
}

.word-table thead th:first-child {
  width: 28%;
}

.word-table tbody th,
.word-table td {
  padding: 16px 14px 16px 0;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.word-row-label {
  display: grid;
  gap: 2px;
  text-decoration: none;
}

.word-row-label + .word-row-label {
  margin-top: 10px;
}

.word-row-label b {
  font-family: "Yu Mincho", "Noto Serif JP", serif;
  font-size: 20px;
  font-weight: 600;
}

.word-row-label small {
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
}

a.word-row-label b {
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

a.word-row-label:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

@media (hover: hover) {
  a.word-row-label:hover b {
    text-decoration-color: var(--accent);
  }

  .word-card:hover {
    border-color: var(--accent);
  }
}

.word-hub__title {
  margin: 0 0 14px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.word-hub__intro {
  max-width: 60ch;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.word-hub__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
  gap: 14px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.word-card {
  display: grid;
  gap: 4px;
  height: 100%;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  text-decoration: none;
  transition: border-color 150ms ease;
}

.word-card:focus-visible {
  border-color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.word-card__writing {
  font-family: "Yu Mincho", "Noto Serif JP", serif;
  font-size: 34px;
  line-height: 1.5;
}

.word-card__writing rt {
  font-size: 0.38em;
}

.word-card__meaning {
  line-height: 1.4;
}

.word-card small {
  color: var(--faint);
  font-size: 13px;
}

@media (max-width: 560px) {
  .word-keyforms {
    padding: 18px 16px 14px;
  }

  .word-keyforms__grid > div {
    padding: 12px 12px 14px;
  }

  .word-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
  }

  .word-table table,
  .word-table tbody {
    display: block;
  }

  /* На телефоне строка таблицы становится карточкой: название формы сверху,
     утвердительная и отрицательная формы рядом. */
  .word-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 14px;
    padding: 14px 0;
    border-top: 1px solid var(--line);
  }

  .word-table tbody th,
  .word-table td {
    display: block;
    padding: 0;
    border-top: 0;
  }

  .word-table tbody th {
    grid-column: 1 / -1;
    margin-bottom: 8px;
  }

  .word-row-label {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 10px;
  }

  .word-table td::before {
    display: block;
    margin-bottom: 2px;
    color: var(--faint);
    font-size: 13px;
    content: attr(data-label);
  }

  .word-form__text {
    font-size: 22px;
  }

  .word-registers legend {
    float: none;
    width: 100%;
    margin: 0 0 4px;
  }

  .word-registers label {
    padding: 0 14px;
  }
}

@media (max-width: 900px) {
  .kanji-hero__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .kanji-words {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .kanji-sheet {
    grid-template-columns: minmax(0, 1fr);
    padding: 14px;
  }

  /* На телефоне образец становится миниатюрой рядом с подписью, а лист
     для письма получает всю ширину. */
  .kanji-sheet__cell:first-child {
    grid-template-columns: 132px minmax(0, 1fr);
    align-items: center;
    column-gap: 16px;
  }

  .kanji-sheet__cell:first-child figcaption {
    flex-direction: column;
    align-items: flex-start;
  }

  .kanji-relations {
    grid-template-columns: minmax(0, 1fr);
  }

  .kanji-pager {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .kanji-pager__all {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: center;
  }

  .grammar-example--featured {
    padding: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kanji-strokes.is-drawing .kanji-strokes__ink path,
  .kanji-strokes.is-drawing .kanji-strokes__numbers text,
  .kanji-practice[data-state="accepted"] .kanji-practice__mark path,
  .speak-button[data-speaking] .speak-wave {
    animation: none;
    opacity: 1;
    stroke-dashoffset: 0;
  }

  .kanji-practice__trace {
    transition: none;
  }
}

/* Public reading pages share the reference site's palette and require no JS. */
.blog-page {
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.blog-page .site-shell {
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}
.blog-page .site-header {
  border-bottom: 1px solid var(--line);
}
.blog-page a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 4px;
}
.blog-nav-link {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
}
.blog-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: center;
  margin-top: 22px;
  color: var(--muted);
  font-size: 14px;
}
.blog-breadcrumbs a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  text-underline-offset: 4px;
}
.blog-intro {
  max-width: 820px;
  padding: 42px 0 54px;
}
.blog-intro h1 {
  margin: 10px 0 22px;
  font-size: clamp(36px, 5.4vw, 64px);
  line-height: 1.1;
  letter-spacing: -0.04em;
}
.blog-intro .eyebrow {
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.blog-intro > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.6;
}
.blog-series__heading {
  padding: 22px 0;
  border-top: 1px solid var(--line);
}
.blog-series__heading h2 {
  margin: 0 0 8px;
  font-size: 22px;
}
.blog-series__heading p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}
.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 30px;
}
.blog-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
}
.blog-card--featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
}
.blog-card__image {
  display: block;
  padding: 24px;
  background: var(--accent-soft);
}
.blog-card__image img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.blog-card__body {
  padding: 24px 28px 22px;
}
.blog-card h2 {
  margin: 12px 0;
  font-size: clamp(22px, 2.3vw, 29px);
  line-height: 1.3;
  letter-spacing: -0.025em;
}
.blog-card h2 a {
  text-decoration: none;
}
.blog-card__body > p:not(.blog-meta) {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}
.blog-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 0;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}
.blog-read {
  display: inline-flex;
  min-height: 44px;
  gap: 14px;
  align-items: center;
  color: var(--accent);
  text-underline-offset: 5px;
  font-weight: 600;
}
.blog-invitation {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 48px;
  align-items: center;
  justify-content: space-between;
  margin-top: 56px;
  padding: 30px;
  border-radius: 20px;
  background: var(--accent-soft);
}
.blog-invitation h2 {
  margin: 0 0 10px;
  font-size: 25px;
}
.blog-invitation p {
  margin: 0;
  max-width: 560px;
  line-height: 1.6;
}
.blog-article__header {
  max-width: 930px;
  padding: 38px 0 42px;
}
.blog-article h1 {
  margin: 18px 0 24px;
  font-size: clamp(31px, 4.2vw, 50px);
  line-height: 1.14;
  letter-spacing: -0.035em;
}
.blog-deck {
  font-size: 21px;
  line-height: 1.65;
  color: var(--muted);
}
.blog-byline {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}
.blog-byline span {
  padding: 0 8px;
}
.blog-reading-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 54px;
  align-items: start;
}
.blog-toc {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding-right: 8px;
}
.blog-toc summary {
  min-height: 44px;
  padding: 12px 0;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
.blog-toc ol {
  padding: 0;
  margin: 8px 0 12px;
  list-style: none;
}
.blog-toc li + li {
  border-top: 1px solid var(--line);
}
.blog-toc a {
  display: block;
  min-height: 44px;
  padding: 10px 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  text-decoration: none;
}
.blog-toc .blog-toc__all {
  color: var(--accent);
  font-weight: 600;
}
.blog-prose {
  min-width: 0;
  max-width: 820px;
  font-size: 19px;
  line-height: 1.8;
  overflow-wrap: break-word;
}
.blog-prose > :first-child {
  margin-top: 0;
}
.blog-prose p {
  margin: 0 0 22px;
}
.blog-prose h2 {
  margin: 46px 0 20px;
  font-size: clamp(25px, 2.7vw, 32px);
  line-height: 1.25;
  letter-spacing: -0.025em;
  scroll-margin-top: 24px;
}
.blog-prose h3 {
  margin: 32px 0 16px;
  font-size: 23px;
}
.blog-prose a {
  color: var(--accent);
  text-underline-offset: 4px;
}
.blog-prose li {
  margin-bottom: 10px;
  padding-left: 3px;
}
.blog-prose ul,
.blog-prose ol {
  padding-left: 26px;
}
.blog-prose blockquote {
  margin: 24px 0;
  padding: 16px 24px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
}
.blog-prose blockquote > :last-child {
  margin-bottom: 0;
}
.blog-prose figure {
  margin: 32px 0;
}
.blog-prose img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.blog-image-link {
  display: block;
}
.blog-prose figcaption {
  margin-top: 12px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}
.blog-prose [lang="ja"] {
  font-family:
    "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  font-style: normal;
}
.blog-table {
  max-width: 100%;
  margin: 24px 0;
  overflow-x: auto;
}
.blog-table table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  font-size: 16px;
  line-height: 1.65;
}
.blog-table th,
.blog-table td {
  padding: 14px;
  border: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}
.blog-table th {
  background: var(--accent-soft);
}
.blog-prose details {
  margin: 18px 0;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--accent-soft);
}
.blog-prose summary {
  min-height: 44px;
  cursor: pointer;
  font-weight: 600;
}
.blog-prose details[open] summary {
  margin-bottom: 18px;
}
.blog-prose details > :last-child {
  margin-bottom: 0;
}
.blog-prose summary:focus-visible,
.blog-table:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
.blog-pagination {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin: 56px 0 12px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.blog-pagination a {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  text-decoration: none;
}
.blog-pagination span {
  color: var(--accent);
  font-size: 14px;
}
.blog-pagination strong {
  font-size: 19px;
  line-height: 1.5;
}
@media (hover: hover) {
  .blog-card h2 a:hover,
  .blog-toc a:hover,
  .blog-page .blog-nav-link:hover {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 4px;
  }
  .blog-image-link:hover img,
  .blog-pagination a:hover {
    border-color: var(--accent);
  }
}
@media (max-width: 1100px) {
  .site-nav {
    gap: 14px;
  }
  .blog-reading-layout {
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 32px;
  }
}
@media (max-width: 900px) {
  .blog-page .site-header {
    flex-wrap: wrap;
    gap: 0 16px;
    padding-top: 12px;
    padding-bottom: 12px;
  }
  .blog-page .site-nav {
    flex-wrap: wrap;
    gap: 0 18px;
  }
  .blog-page .site-nav a {
    min-height: 44px;
    align-items: center;
  }
  .blog-reading-layout {
    display: block;
  }
  .blog-toc {
    position: static;
    max-height: none;
    padding: 16px 20px;
    margin-bottom: 36px;
    border: 1px solid var(--line);
    border-radius: 16px;
  }
  .blog-toc ol {
    columns: 2;
    column-gap: 24px;
  }
  .blog-toc li {
    break-inside: avoid;
  }
  .blog-prose {
    max-width: none;
  }
  .blog-card--featured {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 820px) {
  .site-nav .blog-nav-link:not(.language-link):not(.header-cta) {
    display: inline-flex;
  }
  .blog-page .site-header {
    gap: 12px;
  }
  .blog-page .site-nav {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
  }
  .blog-intro {
    padding: 28px 0 36px;
  }
  .blog-grid {
    gap: 22px;
  }
}
@media (max-width: 600px) {
  .blog-table table {
    font-size: 14px;
  }
  .blog-table th,
  .blog-table td {
    padding: 10px;
  }
  .blog-grid,
  .blog-pagination {
    grid-template-columns: 1fr;
  }
  .blog-card__image {
    padding: 16px;
  }
  .blog-card__body {
    padding: 22px;
  }
  .blog-article__header {
    padding: 24px 0 30px;
  }
  .blog-deck {
    font-size: 19px;
  }
  .blog-toc ol {
    columns: auto;
  }
  .blog-prose {
    font-size: 18px;
    line-height: 1.75;
  }
  .blog-invitation {
    padding: 24px;
  }
}

/* Public dictionary pages. Uses the public site's established palette. */
.public-word-page {
  --word-font-ja: "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif JP", serif;
  --word-radius: 18px;
}

.public-word-page [lang="ja"] {
  font-family: var(--word-font-ja);
}
.public-word-page .public-word-hero--medium h1 {
  font-size: clamp(36px, 5.4vw, 72px);
  overflow-wrap: anywhere;
}
.public-word-page .public-word-hero--long h1 {
  font-size: clamp(28px, 4.5vw, 58px);
  overflow-wrap: anywhere;
}
.public-word-layout.public-word-layout--single {
  grid-template-columns: minmax(0, 860px);
}
.public-word-senses {
  display: grid;
  gap: 12px;
  padding-left: 24px;
  line-height: 1.8;
}
.public-word-neighbours {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-block: 12px 24px;
}
.public-word-neighbours a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--accent-strong);
  text-decoration: none;
}
.public-word-catalogue-hero {
  max-width: 800px;
  padding-block: 44px 26px;
}
.public-word-catalogue-hero h1 {
  margin: 0 0 20px;
  color: var(--accent-strong);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 500;
}
.public-word-catalogue-hero p {
  line-height: 1.8;
}
.public-word-levels {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}
.public-word-levels a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--accent-strong);
  text-decoration: none;
}
.public-word-levels [aria-current="page"] {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.public-word-catalogue-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.public-word-catalogue-card {
  position: relative;
  display: flex;
  height: 100%;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--word-radius);
  background: var(--surface);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.public-word-catalogue-japanese {
  padding-right: 22px;
  color: var(--accent-strong);
  font-size: 30px;
  line-height: 1.7;
}
.public-word-catalogue-reading {
  color: var(--muted);
  font-size: 16px;
}
.public-word-catalogue-card strong {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.7;
}
.public-word-catalogue-card .public-word-link-arrow {
  position: absolute;
  right: 20px;
  top: 24px;
}
.public-word-pagination {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-block: 36px;
}
.public-word-pagination a,
.public-word-pagination span {
  display: grid;
  min-width: 44px;
  min-height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
}
.public-word-pagination [aria-current="page"] {
  color: var(--on-fill);
  background: var(--accent);
  border-color: var(--accent);
}
@media (hover: hover) {
  .public-word-catalogue-card:hover,
  .public-word-pagination a:hover {
    border-color: var(--accent);
  }
}
@media (max-width: 760px) {
  .public-word-catalogue-grid {
    grid-template-columns: 1fr;
  }
}
.public-word-main {
  padding-top: 28px;
}
.public-word-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}
.public-word-breadcrumbs a {
  text-underline-offset: 4px;
}
.public-word-breadcrumbs > span[aria-hidden] {
  color: var(--muted);
}
.public-word-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  align-items: center;
  gap: 72px;
  padding: 45px 0 38px;
}
.public-word-eyebrow {
  margin: 0 0 22px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.public-word-eyebrow > span {
  margin-left: 8px;
}
.public-word-hero h1 {
  margin: 0;
  color: var(--accent-strong);
  font-size: clamp(68px, 8vw, 108px);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.045em;
}
.public-word-page ruby {
  ruby-position: over;
}
.public-word-page rt {
  font-size: 0.44em;
  font-weight: 400;
}
.public-word-hero h1 rt {
  font-size: 0.22em;
  letter-spacing: 0.08em;
}
.public-word-reading {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 2px 0 14px;
  font-size: 20px;
}
.public-word-reading span {
  color: var(--muted);
  font-family: inherit;
  font-size: 15px;
}
.public-word-meaning {
  margin: 0 0 14px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 3vw, 38px);
}
.public-word-intro {
  max-width: 580px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}
.public-word-facts {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--word-radius);
  background: var(--surface);
}
.public-word-facts .public-word-eyebrow {
  margin-bottom: 10px;
}
.public-word-facts dl {
  margin: 0 0 8px;
}
.public-word-facts dl > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding-block: 12px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.public-word-facts dt {
  color: var(--muted);
}
.public-word-facts dd {
  margin: 0;
  text-align: right;
  font-weight: 600;
}
.public-word-facts dd > span {
  margin-left: 6px;
  color: var(--muted);
  font-size: 13px;
}
.public-word-inline-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}
.public-word-sections {
  display: flex;
  gap: 30px;
  margin-bottom: 40px;
  border-block: 1px solid var(--line);
}
.public-word-sections a {
  display: inline-flex;
  min-height: 58px;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
}
.public-word-sections a span {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
}
.public-word-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: start;
  gap: 54px;
}
.public-word-primary {
  min-width: 0;
}
.public-word-section {
  padding: 0 0 34px;
  scroll-margin-top: 24px;
}
.public-word-section + .public-word-section {
  padding-top: 30px;
  border-top: 1px solid var(--line);
}
.public-word-section-heading {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 16px;
}
.public-word-section-number {
  flex-shrink: 0;
  color: var(--accent);
  font-size: 13px;
}
.public-word-section-heading h2,
.public-word-practice h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(25px, 3vw, 30px);
  font-weight: 500;
}
.public-word-section > p {
  margin: 0 0 20px;
  font-size: 16px;
  line-height: 1.8;
}
.public-word-pattern {
  padding: 20px 24px;
  border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0;
  background: var(--accent-soft);
}
.public-word-pattern .public-word-pattern-formula {
  margin: 0;
  color: var(--accent-strong);
  font-size: clamp(24px, 3vw, 31px);
  line-height: 2;
}
.public-word-pattern-formula > span {
  padding-inline: 12px;
}
.public-word-pattern p:last-child {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.public-word-section .public-word-section-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 16px;
}
.public-word-section-lead {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}
.public-word-section > .public-word-section-lead {
  font-size: 16px;
}
.public-word-examples {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.public-word-examples li {
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--word-radius);
  background: var(--surface);
}
.public-word-example-label {
  color: var(--muted);
  font-size: 15px;
}
.public-word-example-japanese {
  margin: 18px 0 10px;
  font-size: clamp(23px, 2.7vw, 29px);
  line-height: 2.15;
  overflow-wrap: anywhere;
}
.public-word-example-japanese mark {
  padding: 4px 1px;
  border-radius: 5px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.public-word-example-translation {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}
.public-word-secondary {
  display: grid;
  gap: 20px;
}
.public-word-side-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--word-radius);
  background: var(--surface);
  scroll-margin-top: 24px;
}
.public-word-side-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.public-word-side-card h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
  font-weight: 500;
}
.public-word-small-badge {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.public-word-forms-table {
  width: 100%;
  table-layout: fixed;
  margin-top: 18px;
  border-collapse: collapse;
}
.public-word-forms-table tr + tr {
  border-top: 1px solid var(--line);
}
.public-word-forms-table th {
  width: 40%;
  padding: 15px 8px 15px 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 400;
  text-align: left;
}
.public-word-forms-table td {
  padding: 16px 0 8px;
  font-size: 23px;
  line-height: 1.8;
  text-align: right;
  overflow-wrap: anywhere;
}
.public-word-forms-table--long th,
.public-word-forms-table--long td {
  display: block;
  width: 100%;
  text-align: left;
}
.public-word-forms-table--long th {
  padding: 14px 0 4px;
}
.public-word-forms-table--long td {
  padding: 8px 0 14px;
}
.public-word-form-note {
  margin: 18px 0 4px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.public-word-form-ending {
  color: var(--accent-strong);
  font-weight: 700;
}
.public-word-kanji-link {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 24px;
  text-decoration: none;
}
.public-word-kanji-symbol {
  display: grid;
  flex-shrink: 0;
  width: 70px;
  height: 76px;
  place-items: center;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 46px;
}
.public-word-kanji-link strong {
  font-size: 16px;
  font-weight: 600;
}
.public-word-kanji-reading {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.public-word-link-arrow {
  margin-left: auto;
  color: var(--accent);
  font-size: 20px;
}
.public-word-related {
  padding-block: 24px 42px;
}
.public-word-related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.public-word-related-link {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--word-radius);
  background: var(--surface);
  text-decoration: none;
}
.public-word-related-link strong {
  margin-top: 10px;
  color: var(--accent-strong);
  font-size: clamp(23px, 2.5vw, 29px);
  font-weight: 500;
  line-height: 1.9;
}
.public-word-related-link > span:not([class]) {
  color: var(--muted);
  font-size: 14px;
}
.public-word-related-link .public-word-link-arrow {
  position: absolute;
  top: 16px;
  right: 20px;
}
.public-word-practice {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
  margin-bottom: 22px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--word-radius);
  background: var(--accent-soft);
}
.public-word-practice .public-word-eyebrow {
  margin-bottom: 10px;
  font-size: 12px;
}
.public-word-practice p:last-child {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}
.public-word-practice .button {
  flex-shrink: 0;
  gap: 12px;
  font-size: 14px;
}
.public-word-page a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}
.public-word-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (hover: hover) {
  .public-word-inline-link:hover,
  .public-word-sections a:hover {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 5px;
  }
  .public-word-related-link:hover,
  .public-word-kanji-link:hover {
    border-color: var(--accent);
    color: var(--accent-strong);
  }
}

@media (max-width: 1000px) {
  .public-word-hero {
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 36px;
  }
  .public-word-layout {
    grid-template-columns: minmax(0, 1fr) 290px;
    gap: 28px;
  }
  .public-word-side-card {
    padding: 20px;
  }
  .public-word-related-link {
    padding: 18px;
  }
}

@media (max-width: 760px) {
  .public-word-page .site-header {
    padding-top: max(12px, env(safe-area-inset-top, 0px));
  }
  .public-word-page .site-nav {
    margin-left: auto;
  }
  .public-word-page .header-cta {
    min-height: 44px;
    padding-inline: 14px;
    font-size: 13px;
  }
  .public-word-main {
    padding-top: 18px;
  }
  .public-word-hero {
    grid-template-columns: 1fr;
    gap: 26px;
    padding-block: 34px 28px;
  }
  .public-word-eyebrow {
    font-size: 12px;
  }
  .public-word-hero h1 {
    font-size: 80px;
  }
  .public-word-intro {
    font-size: 14px;
  }
  .public-word-facts {
    padding: 20px;
  }
  .public-word-facts dl {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 22px;
  }
  .public-word-facts dl > div {
    display: block;
  }
  .public-word-facts dt {
    margin-bottom: 7px;
    font-size: 12px;
  }
  .public-word-facts dd {
    text-align: left;
    font-size: 14px;
  }
  .public-word-sections {
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 28px;
  }
  .public-word-sections a {
    min-height: 52px;
    font-size: 15px;
  }
  .public-word-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .public-word-section-heading {
    gap: 10px;
  }
  .public-word-section > p {
    font-size: 15px;
  }
  .public-word-pattern {
    padding: 18px;
  }
  .public-word-examples li {
    padding: 20px;
  }
  .public-word-example-japanese {
    font-size: 25px;
  }
  .public-word-example-translation {
    font-size: 14px;
  }
  .public-word-secondary {
    gap: 16px;
    margin-bottom: 20px;
  }
  .public-word-side-card {
    padding: 22px;
  }
  .public-word-related-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .public-word-related-link {
    padding: 20px;
  }
  .public-word-related-link strong {
    font-size: 29px;
  }
  .public-word-practice {
    flex-direction: column;
    align-items: flex-start;
    gap: 22px;
    padding: 24px;
  }
  .public-word-practice .button {
    width: 100%;
  }
  .public-word-page .site-footer {
    padding-bottom: max(30px, env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 380px) {
  .public-word-page .brand {
    gap: 7px;
    font-size: 13px;
    letter-spacing: 0.04em;
  }
  .public-word-page .brand-mark {
    width: 32px;
    height: 32px;
  }
  .public-word-sections {
    gap: 7px;
  }
  .public-word-sections a {
    gap: 5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
