/* Site utilities — replaces Master Styles CDN */

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

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

body {
  margin: 0;
}

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

a {
  color: inherit;
}

.u-flex { display: flex; }
.u-flex-col { flex-direction: column; }
.u-jc-center { justify-content: center; }
.u-w-full { width: 100%; }
.u-max-w-700 { max-width: 700px; }
.u-box-content { box-sizing: content-box; }
.u-box-border { box-sizing: border-box; }
.u-break-word { word-break: break-word; }
.u-no-underline { text-decoration: none; }

.u-pt-0 { padding-top: 0; }
.u-pt-32 { padding-top: 32px; }
.u-pt-90 { padding-top: 90px; }
.u-px-24 { padding-left: 24px; padding-right: 24px; }
.u-px-32 { padding-left: 32px; padding-right: 32px; }
.u-py-2 { padding-top: 2px; padding-bottom: 2px; }
.u-py-24 { padding-top: 24px; padding-bottom: 24px; }

.u-mb-4 { margin-bottom: 4px; }
.u-mb-16 { margin-bottom: 16px; }
.u-mb-32 { margin-bottom: 32px; }
.u-mt-12 { margin-top: 12px; }

.u-gap-44 { gap: 44px; }

.u-text-24 { font-size: 24px; }
.u-text-37 { font-size: 37px; }
.u-text-40 { font-size: 40px; }
.u-font-semibold { font-weight: 600; }
.u-font-extrabold { font-weight: 800; }
.u-fade-30 { color: rgba(48, 48, 48, 0.7); }
.u-fade-70 { color: rgba(48, 48, 48, 0.3); }
.u-ease-in-150 { transition: 150ms ease-in; }

/* Desktop: row + center (matches old Master d:flex jc:center).
   Mobile: stack. This keeps the ~700px column optically centered. */
.page-shell {
  display: flex;
  justify-content: center;
  gap: 44px;
  word-break: break-word;
}

.page-shell--home {
  padding-top: 175px;
  padding-left: 24px;
  padding-right: 24px;
}

@media (max-width: 768px) {
  .page-shell--home {
    padding-top: calc(95px + 12px);
    padding-left: 6px;
    padding-right: 6px;
  }
}

.page-shell--article {
  padding-top: 0;
  padding-left: 32px;
  padding-right: 32px;
}

.page-main {
  max-width: 700px;
  width: 100%;
  box-sizing: content-box;
}

@media (max-width: 640px) {
  .page-shell {
    flex-direction: column;
  }
}

/* Article prose — replaces Master Styles group syntax.
   Master @normal.css cleared heading weights (inherit); without that,
   browser bold + single-weight JP fonts → heavy faux-bold. */
.prose {
  color: #3a3a3a;
  font-size: 25px;
  line-height: 1.75;
  font-weight: 400;
}

.prose > :first-child {
  margin-top: 0 !important;
}

.prose a {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(58, 58, 58, 0.4);
  font-weight: 400;
  color: #2e2e2e;
}

.prose blockquote {
  border-left: 5px solid rgba(48, 48, 48, 0.12);
  padding-left: 1.5em;
  margin: 1.725em 0;
  color: rgba(48, 48, 48, 0.5);
  font-weight: 400;
}

.prose blockquote p {
  color: inherit;
  font-size: 0.92em;
}

.prose code {
  font-size: 90%;
  vertical-align: middle;
}

.prose :not(pre) > code {
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(48, 48, 48, 0.06);
  color: rgba(48, 48, 48, 0.65);
}

.prose p code,
.prose li code {
  font-weight: 600;
}

.prose del {
  text-decoration: line-through;
  text-decoration-color: rgba(48, 48, 48, 0.45);
  color: rgba(48, 48, 48, 0.65);
}

.prose figcaption {
  font-size: 14px;
  padding: 10px 20px 0;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  color: rgba(48, 48, 48, 0.55);
}

/* Match Master normal.css remove-heading-styles */
.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
  margin-top: 1.1em;
  font-size: inherit;
  font-weight: inherit;
  color: rgba(48, 48, 48, 0.42);
}

.prose h1 + h1,
.prose h1 + h2,
.prose h1 + h3,
.prose h2 + h1,
.prose h2 + h2,
.prose h2 + h3,
.prose h3 + h1,
.prose h3 + h2,
.prose h3 + h3 {
  margin-top: 0.5em;
}

.prose h1 {
  font-size: 40px;
  font-weight: 800;
}

.prose h2 {
  margin-bottom: 1em;
  font-size: 32px;
  color: rgba(48, 48, 48, 0.42);
}

.prose h3 { font-size: 24px; }
.prose h4 { font-size: 20px; }
.prose h5 { font-size: 16px; }
.prose h6 {
  font-size: 14px;
  color: rgba(48, 48, 48, 0.42);
}

.prose li {
  padding-left: 0.375em;
}

.prose li::marker {
  color: rgba(48, 48, 48, 0.35);
}

.prose mark {
  background: transparent;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(252, 224, 22, 0.85);
  text-underline-offset: 3px;
  font-weight: 600;
  color: rgba(48, 48, 48, 0.65);
}

.prose p,
.prose li {
  font-size: 25px;
  line-height: 1.75;
  font-weight: 400;
  color: #3a3a3a;
}

.prose p,
.prose pre,
.prose blockquote,
.prose figure,
.prose ul,
.prose ol,
.prose table {
  margin: 1.725em 0;
}

.prose pre {
  padding: 16px 18px;
  border-radius: 8px;
  overflow: auto;
  background: rgba(48, 48, 48, 0.06);
  font-size: 14px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.prose pre code {
  font-size: inherit;
  line-height: inherit;
  vertical-align: baseline;
}

@media (max-width: 768px) {
  .prose pre {
    padding: 12px 14px;
    font-size: 12px;
    line-height: 1.5;
  }
}

/* Color emphasis only — weight stays normal to avoid faux-bold on JP fonts */
.prose strong,
.prose b {
  font-weight: inherit;
  color: #2e2e2e;
}

.prose table {
  width: 100%;
  border-spacing: 0;
}

.prose td {
  vertical-align: baseline;
}

.prose td,
.prose th {
  border-bottom: 1px solid rgba(48, 48, 48, 0.06);
  padding: 6px;
}

.prose td:first-child,
.prose th:first-child {
  padding-left: 0;
}

.prose td:last-child,
.prose th:last-child {
  padding-right: 0;
}

.prose th {
  font-size: 14px;
  text-align: left;
  font-weight: 600;
  color: rgba(48, 48, 48, 0.65);
}

.prose ul {
  list-style-type: disc;
  padding-left: 1.5em;
}

.prose ol {
  padding-left: 1.5em;
}

.prose img {
  max-width: 100%;
}

.prose hr {
  height: 2px;
  border: 0;
  background: rgba(48, 48, 48, 0.08);
  margin: 3em 0;
}

/* Article page only: single-weight JP fonts — never synthesize bold.
   List pages keep semibold/extrabold utilities as-is. */
.article-body,
.article-body *:not(svg):not(path):not(circle) {
  font-weight: 400 !important;
}

/*
  Master @normal.css better-text-appearance — without this, macOS
  subpixel AA makes text look much heavier. Apply on articles only;
  list/home keep the current (thicker) rendering.
*/
body.is-article {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.is-article * {
  text-rendering: geometricPrecision;
}

body.is-article ::selection {
  background: rgba(80, 85, 100, 0.22);
  color: #2e2e2e;
}

/* Custom audio player — keep out of shortcodes (blockquote would swallow <style>) */
.mao-audio {
  --mao-audio-ink: #2a2d35;
  --mao-audio-ink-soft: #5c6270;
  max-width: 560px;
  margin: 1.1em 0 0.35em;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px 12px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(70, 76, 92, 0.12);
  box-shadow: 0 6px 16px -10px rgba(30, 34, 42, 0.28);
  position: relative;
  box-sizing: border-box;
}
.prose blockquote .mao-audio {
  margin-left: 0;
  max-width: 100%;
}
.mao-audio audio {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}
.mao-audio__play {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: #f4f5f8;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  background:
    radial-gradient(circle at 32% 28%, #4a5060 0%, var(--mao-audio-ink) 62%, #1a1d24 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -2px 4px rgba(0, 0, 0, 0.35),
    0 6px 14px -6px rgba(20, 24, 32, 0.55),
    0 1px 0 rgba(255, 255, 255, 0.35);
  display: grid;
  place-items: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.mao-audio__play:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}
.mao-audio__play:active {
  transform: translateY(1px);
  filter: brightness(0.96);
}
.mao-audio.is-loading .mao-audio__play {
  opacity: 0.72;
  filter: saturate(0.85);
}
.mao-audio__play svg {
  width: 16px;
  height: 16px;
  display: block;
  pointer-events: none;
}
.mao-audio__play[aria-pressed="true"] svg {
  width: 15px;
  height: 15px;
}
.mao-audio__main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mao-audio__meta {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.mao-audio__time {
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--mao-audio-ink-soft);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.mao-audio__time .mao-audio__sep {
  margin: 0 0.35em;
  opacity: 0.45;
}
.mao-audio__rail {
  position: relative;
  height: 16px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
}
.mao-audio__rail-well {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 999px;
  background: rgba(42, 45, 53, 0.16);
}
.mao-audio__rail-fill {
  position: absolute;
  left: 0;
  top: 50%;
  height: 3px;
  width: 0%;
  transform: translateY(-50%);
  border-radius: 999px;
  background: var(--mao-audio-ink);
  pointer-events: none;
}
.mao-audio__rail-knob {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: var(--mao-audio-ink);
  pointer-events: none;
}
.mao-audio__rail:hover .mao-audio__rail-knob,
.mao-audio.is-seeking .mao-audio__rail-knob {
  transform: translateY(-50%) scale(1.15);
}
@media (max-width: 640px) {
  .mao-audio {
    gap: 12px;
    padding: 11px 13px 11px 11px;
  }
  .mao-audio__play {
    width: 40px;
    height: 40px;
  }
}

/* ——— Line bookmark ——— */
.prose .mao-bm-line {
  cursor: pointer;
  position: relative;
}

.prose .mao-bm-line:hover {
  background: rgba(232, 184, 74, 0.06);
  border-radius: 4px;
}

.prose .mao-bm-target {
  position: relative;
  background: rgba(255, 215, 0, 0.1);
  border-radius: 2px;
}

/* Persistent gold mark line on the bookmarked row */
.prose .mao-bm-target::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 2px;
  background: linear-gradient(180deg, #FFE566, #FFD700 40%, #E8B84A);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.55);
  pointer-events: none;
}

.prose .mao-bm-flash {
  animation: maoBmFlash 1.05s ease;
}

.prose .mao-bm-flash::after {
  content: '';
  position: absolute;
  inset: -2px -10px;
  border-radius: 4px;
  pointer-events: none;
  z-index: 3;
  background: linear-gradient(
    105deg,
    transparent 0%,
    rgba(255, 248, 200, 0.2) 35%,
    rgba(255, 215, 0, 0.85) 50%,
    rgba(255, 248, 200, 0.2) 65%,
    transparent 100%
  );
  background-size: 220% 100%;
  animation: maoBmSweep 0.85s ease-out forwards;
}

@keyframes maoBmFlash {
  0% {
    background: rgba(255, 215, 0, 0.55);
  }
  100% {
    background: rgba(255, 215, 0, 0.1);
  }
}

@keyframes maoBmSweep {
  0% {
    background-position: 120% 0;
    opacity: 1;
  }
  100% {
    background-position: -120% 0;
    opacity: 0;
  }
}

/* Home bookmark — ribbon fixed under nav (top-left) */
.mao-home-bm {
  position: fixed !important;
  top: calc(125px + 12px);
  left: 40px;
  right: auto;
  z-index: 9000;
  width: auto;
  min-width: 44px;
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: none;
  flex-direction: column;
  align-items: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transform: none;
}

.mao-home-bm.is-visible {
  display: flex !important;
}

.mao-home-bm[hidden] {
  display: none !important;
}

.mao-home-bm__ribbon {
  display: block;
  position: relative;
  width: 40px;
  height: 52px;
  margin: 0 auto;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(165deg, #FFE566 0%, #FFD700 38%, #E8B84A 72%, #C9A227 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.55),
    2px 4px 10px rgba(60, 40, 0, 0.4);
}

.mao-home-bm__ribbon::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -18px;
  height: 0;
  border-left: 20px solid #C9A227;
  border-right: 20px solid #C9A227;
  border-bottom: 18px solid transparent;
}

.mao-home-bm__ribbon::before {
  content: '\681E';
  position: absolute;
  left: 50%;
  top: 42%;
  z-index: 1;
  transform: translate(-50%, -50%);
  font-family: 'Hina-Mincho-Regular', 'Hina Mincho', serif;
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
  text-align: center;
  color: #7a5810;
  text-shadow:
    0 1px 0 rgba(255, 248, 210, 0.9),
    0 -1px 0 rgba(70, 45, 5, 0.42);
  -webkit-text-stroke: 0.3px rgba(110, 75, 15, 0.28);
  pointer-events: none;
  user-select: none;
}

.mao-home-bm__tag {
  position: absolute;
  left: 50%;
  top: 35px;
  z-index: 2;
  display: block;
  margin: 0;
  padding: 3px 6px;
  border: 0;
  border-radius: 1px;
  transform: translateX(-50%);
  background: #7a5810;
  color: #ffd700;
  font-family: 'Hina-Mincho-Regular', 'Hina Mincho', serif;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: 0.06em;
  white-space: nowrap;
  text-align: center;
  box-shadow: 0 2px 6px rgba(40, 25, 0, 0.28);
  pointer-events: none;
  user-select: none;
}

.mao-home-bm:hover .mao-home-bm__ribbon,
.mao-home-bm:focus-visible .mao-home-bm__ribbon {
  filter: brightness(1.08);
}

@media (max-width: 768px) {
  .mao-home-bm {
    top: calc(95px + 10px);
    left: 16px;
  }

  .mao-home-bm__ribbon {
    width: 40px;
    height: 52px;
  }

  .mao-home-bm__ribbon::after {
    bottom: -16px;
    border-left-width: 20px;
    border-right-width: 20px;
    border-bottom-width: 16px;
  }

  .mao-home-bm__tag {
    top: 35px;
    font-size: 10px;
    padding: 2px 5px;
  }
}



