:root {
  --sumi: #1C2B25;
  --sumi-2: #253830;
  --sumi-3: #2F453B;
  --washi: #F5F5E4;
  --washi-2: #E8EBD5;
  --kinu: #FFFFF5;
  --yamabuki: #90D8C0;
  --yamabuki-soft: #F0F0C0;
  --matsu: #5A7359;
  --matsu-soft: #DFE9DD;
  --text: #1C2A23;
  --text-soft: #495A4F;
  --on-dark: #F2F2DF;
  --on-dark-soft: #C5D3C5;
  --line: rgba(28, 42, 35,0.14);
  --line-dark: rgba(242, 242, 223,0.16);
  --head: "Hina Mincho", "Yu Mincho", "Hiragino Mincho ProN", serif;
  --body: "Murecho", "Hiragino Sans", "Yu Gothic", sans-serif;
  --shell: 1160px;
  --r: 14px;
  --paper: #FFFFFF;
  --cf-accent: #5A7359;
  --cf-on: #FFFFF5;
  --gutter: 16px;
}

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

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.95;
  letter-spacing: 0.02em;
  line-break: strict;
  word-break: auto-phrase;
  -webkit-font-smoothing: antialiased;
}

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

h1,
h2,
h3 {
  margin: 0 0 0.5em;
  font-family: var(--head);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.04em;
  color: var(--sumi);
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--matsu);
}

ul,
ol,
dl,
dd,
figure {
  margin: 0;
  padding: 0;
  list-style: none;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

a:focus-visible,
summary:focus-visible,
button:focus-visible {
  outline: 3px solid var(--matsu);
  outline-offset: 3px;
}

.shell {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 760px) {
  .shell {
    padding: 0 32px;
  }
}

.skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 20;
  padding: 10px 16px;
  background: var(--sumi);
  color: var(--kinu);
}

.skip:focus {
  left: 8px;
}

/* ---------- Boxes (buttons) ---------- */
.box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 2px solid var(--sumi);
  border-radius: 3px;
  font-family: var(--body);
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
}

.box-line {
  background: var(--paper);
  color: var(--sumi);
}

.box-line:hover {
  background: var(--washi);
}

.box-solid {
  background: var(--sumi);
  color: var(--kinu);
}

.box-solid:hover {
  background: var(--sumi-3);
  border-color: var(--sumi-3);
}

.box-lg {
  min-height: 52px;
  padding: 0 26px;
  font-size: 1rem;
}

/* ---------- Masthead ---------- */
.masthead {
  position: static;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.util {
  background: var(--sumi);
  color: var(--on-dark);
  font-size: 0.78rem;
  line-height: 1.6;
}

.util-row {
  display: flex;
  justify-content: flex-end;
  padding-top: 5px;
  padding-bottom: 5px;
}

.util-row p {
  margin: 0;
}

.mast-row {
  display: flex;
  align-items: center;
  gap: 12px 28px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.brand {
  display: flex;
  flex: none;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-mark {
  width: auto;
  height: 54px;
}

.brand-word {
  width: auto;
  height: 40px;
}

.mainnav {
  display: flex;
  gap: 24px;
  margin-right: auto;
}

.mainnav a {
  color: var(--sumi);
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.mainnav a:hover {
  text-decoration: underline;
  text-underline-offset: 6px;
}

.mast-actions {
  display: flex;
  flex: none;
  gap: 10px;
  margin-left: auto;
}

@media (max-width: 900px) {
  .mainnav {
    margin-right: 0;
    margin-left: auto;
  }

  .mainnav a:not(.nav-blog) {
    display: none;
  }

  .mainnav + .mast-actions {
    margin-left: 0;
  }
}

@media (max-width: 600px) {
  .mast-row {
    gap: 10px;
  }

  .brand {
    gap: 6px;
  }

  .brand-mark {
    height: 40px;
  }

  .brand-word {
    height: 28px;
  }

  .box-line {
    display: none;
  }

  .mast-actions .box {
    min-height: 44px;
    padding: 0 12px;
    font-size: 0.82rem;
  }
}

@media (max-width: 359px) {
  .brand-word {
    height: 24px;
  }
}

/* ---------- Footer ---------- */
.foot {
  background: var(--washi);
  border-top: 1px solid var(--line);
  padding: clamp(44px, 6vw, 72px) 0 28px;
  font-size: 0.92rem;
}

.foot-grid {
  display: grid;
  gap: 32px;
}

@media (min-width: 820px) {
  .foot-grid {
    grid-template-columns: 1.6fr 1fr 1fr;
    gap: 56px;
  }
}

.foot-brand p {
  max-width: 26em;
  margin: 16px 0 0;
  color: var(--text-soft);
}

.foot-col h2 {
  margin: 0 0 10px;
  font-family: var(--body);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.foot-col li {
  margin-bottom: 6px;
}

.foot-col a {
  color: var(--text);
  text-decoration: none;
}

.foot-col a:hover {
  text-decoration: underline;
}

.foot-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 24px;
  margin-top: 40px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--text-soft);
}

.foot-base p {
  margin: 0;
}

/* ---------- Page hero ---------- */
.page-hero {
  padding: clamp(40px, 6vw, 72px) 0 clamp(32px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
}

.page-hero-grid {
  display: grid;
  gap: 24px;
  align-items: end;
}

@media (min-width: 820px) {
  .page-hero-grid {
    grid-template-columns: 1fr 280px;
    gap: 56px;
  }
}

.crumb {
  margin: 0 0 12px;
  font-size: 0.84rem;
  color: var(--text-soft);
}

.crumb a {
  color: var(--text-soft);
}

.page-hero h1 {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  margin-bottom: 0.4em;
}

.page-hero .lead {
  max-width: 30em;
  margin: 0;
  color: var(--text-soft);
}

.hero-orb {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 0 0 22px 22px;
}

@media (max-width: 819px) {
  .hero-orb {
    display: none;
  }
}

/* ---------- Reading ---------- */
.page-body {
  padding: clamp(32px, 5vw, 64px) 0 clamp(64px, 8vw, 100px);
}

.page-layout {
  display: grid;
  gap: 32px;
}

@media (min-width: 980px) {
  .page-layout.has-toc {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 64px;
    align-items: start;
  }
}

.toc {
  padding: 18px 20px 14px;
  background: var(--washi);
}

@media (min-width: 980px) {
  .toc {
    position: sticky;
    top: 24px;
  }
}

.toc h2 {
  margin-bottom: 8px;
  font-family: var(--body);
  font-weight: 700;
  font-size: 0.92rem;
}

.toc li {
  margin-bottom: 6px;
  line-height: 1.55;
}

.toc a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
}

.toc a:hover {
  text-decoration: underline;
}

.prose {
  max-width: 34em;
}

.prose h2 {
  font-size: clamp(1.35rem, 2.6vw, 1.7rem);
  margin-top: 2em;
  scroll-margin-top: 20px;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose ul {
  margin: 0 0 1.2em;
}

.prose ul li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 0.5em;
}

.prose ul li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.85em;
  width: 7px;
  height: 7px;
  background: var(--matsu);
}

.prose .updated {
  font-size: 0.88rem;
  color: var(--text-soft);
}

.callout {
  margin: 1.6em 0;
  padding: 20px 22px;
  background: var(--washi);
  border-left: 4px solid var(--matsu);
}

.callout p:last-child {
  margin: 0;
}

.mailbox {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin: 0 0 1.4em;
  padding: 18px 20px;
  background: var(--washi);
}

.mailbox svg {
  flex: none;
  width: 28px;
  height: 28px;
  color: var(--matsu);
}

.mailbox a {
  font-weight: 700;
  font-size: 1.05rem;
  word-break: break-all;
}

/* ---------- Contact form ---------- */
.cform {
  padding: 0;
  margin: clamp(32px, 5vw, 56px) 0 0;
}

.cform-inner {
  max-width: 760px;
  margin: 0;
  padding: clamp(22px, 4vw, 40px);
  border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
  border-top: 4px solid var(--cf-accent);
  border-radius: 4px;
  background: var(--paper);
}

.cform-inner h2 {
  margin: 0 0 8px;
  font-size: clamp(1.35rem, 2.6vw, 1.7rem);
}

.cform-intro {
  margin: 0 0 24px;
  opacity: 0.85;
}

.cform-form {
  display: grid;
  gap: 18px;
}

.cform-row {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.cform-row label {
  font-weight: 700;
  font-size: 0.95rem;
}

.cform input[type="text"],
.cform input[type="email"],
.cform select,
.cform textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px;
  color: inherit;
  background: color-mix(in srgb, currentColor 4%, transparent);
  border: 1px solid color-mix(in srgb, currentColor 35%, transparent);
  border-radius: 10px;
}

.cform textarea {
  resize: vertical;
  min-height: 150px;
}

.cform option {
  color: #111111;
  background: #FFFFFF;
}

.cform input:focus,
.cform select:focus,
.cform textarea:focus,
.cform-btn:focus-visible {
  outline: 3px solid var(--cf-accent);
  outline-offset: 2px;
}

.cform-consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.95rem;
}

.cform-consent input {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 5px;
  accent-color: var(--cf-accent);
}

.cform-consent a {
  color: inherit;
  text-decoration: underline;
}

.cform-btn {
  justify-self: start;
  min-height: 50px;
  padding: 0 32px;
  font: inherit;
  font-weight: 700;
  color: var(--cf-on);
  background: var(--cf-accent);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

.cform-btn:hover {
  filter: brightness(1.08);
}

.cform-trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.cform-status {
  display: none;
  margin: 0 0 20px;
  padding: 14px 16px;
  border-radius: 10px;
  font-weight: 700;
}

.cform-status:target {
  display: block;
}

.cform-ok {
  background: color-mix(in srgb, var(--cf-accent) 16%, transparent);
  border: 1px solid var(--cf-accent);
}

.cform-err {
  background: color-mix(in srgb, #B03A2E 12%, transparent);
  border: 1px solid #B03A2E;
}

@media (min-width: 720px) {
  .cform-form {
    grid-template-columns: 1fr 1fr;
  }

  .cform-wide,
  .cform-btn {
    grid-column: 1 / -1;
  }
}

