/*
 * Shared site-family header extracted from the deployed blog implementation.
 * The production blog is not modified by this RC extraction.
 */
:root {
  color-scheme: light dark;
  --mi-blog-page: #ffffff;
  --mi-blog-surface: #ffffff;
  --mi-blog-surface-muted: #f6f6f3;
  --mi-blog-text: #25221d;
  --mi-blog-text-soft: #514c43;
  --mi-blog-text-muted: #756e63;
  --mi-blog-border: #e6e4df;
  --mi-blog-accent: #936a3a;
  --mi-blog-link: #704b23;
  --mi-blog-link-hover: #3f2a15;
  --mi-blog-focus: #126f67;
  --mi-blog-code-bg: #202326;
  --mi-blog-code-text: #edf0ee;
  --mi-blog-code-border: #34383b;
  --mi-blog-logo: url("https://re.masahiko.info/img/brand/mi-logo-light.svg");
  --mi-blog-font-sans: "BIZ UDPGothic", "Noto Sans JP", "Hiragino Sans",
    "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
  --mi-blog-font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo,
    monospace;
  --mi-theme-border: var(--mi-blog-border);
  --mi-theme-font: var(--mi-blog-font-sans);
  --mi-theme-surface: var(--mi-blog-surface);
  --mi-theme-surface-muted: var(--mi-blog-surface-muted);
  --mi-theme-text: var(--mi-blog-text);
  --mi-theme-text-muted: var(--mi-blog-text-muted);
  --mi-theme-text-soft: var(--mi-blog-text-soft);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-mi-theme]) {
    color-scheme: dark;
    --mi-blog-page: #171613;
    --mi-blog-surface: #1c1a17;
    --mi-blog-surface-muted: #292621;
    --mi-blog-text: #eeeae2;
    --mi-blog-text-soft: #c9c2b7;
    --mi-blog-text-muted: #a59d90;
    --mi-blog-border: #3c3831;
    --mi-blog-accent: #d1a06a;
    --mi-blog-link: #ddb17e;
    --mi-blog-link-hover: #f0c99b;
    --mi-blog-focus: #65cbbf;
    --mi-blog-code-bg: #101316;
    --mi-blog-code-text: #e9eeec;
    --mi-blog-code-border: #363b3f;
    --mi-blog-logo: url("https://re.masahiko.info/img/brand/mi-logo.svg");
  }
}

:root[data-mi-theme="dark"] {
  color-scheme: dark;
  --mi-blog-page: #171613;
  --mi-blog-surface: #1c1a17;
  --mi-blog-surface-muted: #292621;
  --mi-blog-text: #eeeae2;
  --mi-blog-text-soft: #c9c2b7;
  --mi-blog-text-muted: #a59d90;
  --mi-blog-border: #3c3831;
  --mi-blog-accent: #d1a06a;
  --mi-blog-link: #ddb17e;
  --mi-blog-link-hover: #f0c99b;
  --mi-blog-focus: #65cbbf;
  --mi-blog-code-bg: #101316;
  --mi-blog-code-text: #e9eeec;
  --mi-blog-code-border: #363b3f;
  --mi-blog-logo: url("https://re.masahiko.info/img/brand/mi-logo.svg");
}

:root[data-mi-theme="light"] {
  color-scheme: light;
}

html,
body {
  min-width: 0;
  margin: 0;
  background: var(--mi-blog-page);
}

body,
button,
input,
select,
textarea {
  color: var(--mi-blog-text);
  font-family: var(--mi-blog-font-sans);
  font-feature-settings: "palt" 0;
  letter-spacing: 0;
}

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

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--mi-blog-focus);
  outline-offset: 3px;
}

#blog-title {
  height: auto;
  padding: 0;
  border: 0;
  background: var(--mi-blog-surface);
  color: var(--mi-blog-text);
}

#blog-title-inner {
  position: relative;
  box-sizing: border-box;
  width: min(calc(100% - 80px), 1176px);
  height: auto;
  margin: 0 auto;
  padding: 30px 48px 18px 0;
}

#blog-title #title {
  width: auto;
  margin: 0;
  padding: 0;
  font-family: var(--mi-blog-font-sans);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.35;
}

#title a {
  display: flex;
  min-height: 40px;
  align-items: center;
  padding: 0 0 0 52px;
  background-image: var(--mi-blog-logo);
  background-position: left center;
  background-repeat: no-repeat;
  background-size: 40px 40px;
  color: var(--mi-blog-text);
  font-size: inherit;
  font-weight: 700;
  text-decoration: none;
}

#title a:hover {
  color: var(--mi-blog-link);
}

#blog-title #blog-description {
  width: auto;
  margin: 6px 0 0 52px;
  color: var(--mi-blog-text-muted);
  font-size: 14px;
  line-height: 1.7;
}

#top-editarea {
  min-height: 0;
  border-top: 1px solid var(--mi-blog-border);
  border-bottom: 1px solid var(--mi-blog-border);
  background: var(--mi-blog-surface);
}

.mi-site-bar {
  display: flex;
  width: min(calc(100% - 80px), 1176px);
  min-height: 50px;
  align-items: center;
  gap: 24px;
  margin: 0 auto;
}

.mi-site-nav {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 28px;
  overflow-x: auto;
  scrollbar-width: thin;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}

.mi-site-nav a {
  flex: 0 0 auto;
  padding: 15px 0 13px;
  border-bottom: 2px solid transparent;
  color: var(--mi-blog-text-soft);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
}

.mi-site-nav a:hover,
.mi-site-nav a[aria-current="page"] {
  border-bottom-color: var(--mi-blog-accent);
  color: var(--mi-blog-text);
}

@media (max-width: 1023px) {
  #blog-title-inner,
  .mi-site-bar {
    width: calc(100% - 64px);
  }
}

@media (max-width: 639px) {
  #blog-title-inner,
  .mi-site-bar {
    width: calc(100% - 36px);
  }

  #blog-title-inner {
    padding: 20px 44px 14px 0;
  }

  .mi-theme-switch {
    top: 20px;
  }

  #blog-title #title {
    font-size: 22px;
    line-height: 1.4;
  }

  #title a {
    min-height: 34px;
    padding-left: 44px;
    background-size: 34px 34px;
  }

  #blog-title #blog-description {
    margin: 8px 0 0 44px;
    font-size: 13px;
    line-height: 1.65;
  }

  .mi-site-bar {
    padding: 8px 0 10px;
  }

  .mi-site-nav {
    width: 100%;
    gap: 22px;
  }

  .mi-site-nav a {
    padding-top: 11px;
    padding-bottom: 9px;
    font-size: 13px;
  }
}

@media (max-width: 359px) {
  #blog-title #title {
    font-size: 20px;
  }

  .mi-site-nav {
    gap: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}


/* Shared System / Light / Dark switch for the three-site family. */
.mi-theme-switch {
  position: absolute;
  top: 30px;
  right: 0;
  z-index: 20;
  display: none;
}

.mi-theme-js .mi-theme-switch--ready {
  display: block;
}

.mi-theme-trigger {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--mi-theme-border);
  border-radius: 4px;
  background: transparent;
  color: var(--mi-theme-text-muted);
  cursor: pointer;
  font: 21px/1 "Segoe UI Symbol", var(--mi-theme-font);
}

.mi-theme-trigger:hover,
.mi-theme-trigger[aria-expanded="true"] {
  border-color: var(--mi-theme-border);
  background: var(--mi-theme-surface-muted);
  color: var(--mi-theme-text);
}

.mi-theme-options {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  width: 140px;
  padding: 4px;
  border: 1px solid var(--mi-theme-border);
  border-radius: 4px;
  background: var(--mi-theme-surface);
  box-shadow: 0 6px 18px rgb(0 0 0 / 12%);
}

.mi-theme-options[hidden] {
  display: none;
}

.mi-theme-options button {
  min-height: 36px;
  padding: 6px 10px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--mi-theme-text-soft);
  cursor: pointer;
  font: 400 13px/1.4 var(--mi-theme-font);
  text-align: left;
}

.mi-theme-options button:hover,
.mi-theme-options button[aria-pressed="true"] {
  background: var(--mi-theme-surface-muted);
  color: var(--mi-theme-text);
}


.profile-local-nav {
  border-bottom: 1px solid var(--mi-blog-border);
  background: var(--mi-blog-surface);
}

.profile-local-nav__inner {
  width: min(calc(100% - 80px), 1176px);
  min-height: 44px;
  margin: 0 auto;
}

.profile-local-nav__list a {
  color: var(--mi-blog-text-muted);
  font-weight: 700;
  text-decoration: none;
}

.profile-local-nav__list {
  display: grid;
  grid-template-columns: repeat(6, max-content);
  justify-content: start;
  gap: 30px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.profile-local-nav__list a {
  display: flex;
  min-height: 44px;
  align-items: center;
  padding: 11px 0 9px;
  border-bottom: 2px solid transparent;
  font-size: 13px;
  line-height: 1.55;
  white-space: nowrap;
}

.profile-local-nav__list a:hover,
.profile-local-nav__list a[aria-current="page"] {
  color: var(--mi-blog-text);
}

.profile-local-nav__list a:hover,
.profile-local-nav__list a[aria-current="page"] {
  border-bottom-color: var(--mi-blog-accent);
}

.profile-local-nav__line {
  display: inline;
}

main {
  display: block;
  min-height: 55vh;
}

.profile-shell {
  width: min(calc(100% - 80px), 1176px);
  margin: 0 auto;
  padding: 56px 0 84px;
}

.profile-shell--reading {
  max-width: 960px;
}

.page-hero {
  max-width: 860px;
  padding: 4px 0 52px;
}

.page-hero--home {
  max-width: 940px;
  padding-top: 12px;
}

.page-kicker {
  margin: 0 0 10px;
  color: var(--mi-blog-text-muted);
  font-size: 13px;
  font-weight: 700;
}

.page-hero h1 {
  margin: 0;
  color: var(--mi-blog-text);
  font-size: 42px;
  font-weight: 700;
  line-height: 1.38;
}

.page-hero--home h1 {
  font-size: 48px;
}

.page-lead {
  max-width: 760px;
  margin: 22px 0 0;
  color: var(--mi-blog-text-soft);
  font-size: 18px;
  line-height: 1.9;
}

.page-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin-top: 28px;
}

.text-link,
.section-link {
  color: var(--mi-blog-link);
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.text-link:hover,
.section-link:hover {
  color: var(--mi-blog-link-hover);
}

.profile-section {
  padding: 44px 0;
  border-top: 1px solid var(--mi-blog-border);
}

.profile-section:first-of-type {
  border-top: 0;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 20px;
  margin-bottom: 24px;
}

.section-heading h2,
.content-section h2 {
  margin: 0;
  color: var(--mi-blog-text);
  font-size: 26px;
  line-height: 1.5;
}

.section-heading h2::before,
.content-section > h2::before,
.period h2::before {
  display: block;
  width: 34px;
  height: 2px;
  margin-bottom: 12px;
  background: var(--mi-blog-accent);
  content: "";
}

.section-heading p,
.content-section > p {
  max-width: 780px;
  margin: 8px 0 0;
  color: var(--mi-blog-text-muted);
  font-size: 15px;
  line-height: 1.75;
}

.summary-grid,
.project-grid,
.facts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--mi-blog-border);
}

.summary-item,
.fact-item {
  min-width: 0;
  padding: 24px 28px 24px 0;
  border-bottom: 1px solid var(--mi-blog-border);
}

.summary-item:not(:nth-child(3n + 1)),
.fact-item:not(:nth-child(3n + 1)) {
  padding-left: 28px;
  border-left: 1px solid var(--mi-blog-border);
}

.summary-item h3,
.fact-item h3,
.series-item h3,
.project-card h3,
.work-item h2,
.period h2 {
  margin: 0;
  color: var(--mi-blog-text);
  font-size: 19px;
  line-height: 1.55;
}

.summary-item p,
.fact-item p,
.project-card p,
.work-item p,
.period p,
.prose p,
.prose li {
  color: var(--mi-blog-text-soft);
  font-size: 16px;
  line-height: 1.85;
}

.summary-item p,
.fact-item p,
.project-card p {
  margin: 10px 0 0;
}

.summary-item a,
.series-item a,
.project-card a,
.period a,
.contact-list a,
.archive-item a {
  color: var(--mi-blog-link);
}

.focus-list,
.contact-list,
.plain-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.focus-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 40px;
  border-top: 1px solid var(--mi-blog-border);
}

.focus-list li {
  padding: 17px 0;
  border-bottom: 1px solid var(--mi-blog-border);
  color: var(--mi-blog-text-soft);
  font-size: 16px;
  line-height: 1.7;
}

.focus-list strong {
  display: block;
  margin-bottom: 4px;
  color: var(--mi-blog-text);
}

.content-section {
  max-width: 900px;
  margin-bottom: 58px;
}

.content-section > h2 {
  margin-bottom: 18px;
}

.series-list {
  border-top: 1px solid var(--mi-blog-border);
}

.series-item {
  display: grid;
  grid-template-columns: minmax(260px, 0.95fr) minmax(0, 1.05fr);
  gap: 32px;
  padding: 22px 0;
  border-bottom: 1px solid var(--mi-blog-border);
}

.series-item h3,
.series-item p {
  margin: 0;
}

.series-item__meta {
  margin-bottom: 6px !important;
  color: var(--mi-blog-text-muted) !important;
  font-size: 12px !important;
  font-weight: 700;
  line-height: 1.6 !important;
}

.series-item > p {
  color: var(--mi-blog-text-soft);
  font-size: 15px;
  line-height: 1.8;
}

.prose p {
  margin: 0 0 1.4em;
}

.prose ul {
  margin: 1.2em 0;
  padding-left: 1.4em;
}

.work-list {
  border-top: 1px solid var(--mi-blog-border);
}

.work-item {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 40px;
  padding: 32px 0;
  border-bottom: 1px solid var(--mi-blog-border);
}

.work-item p {
  margin: 0;
}

.work-item__meta {
  margin-top: 9px;
  color: var(--mi-blog-text-muted);
  font-size: 13px;
  line-height: 1.6;
}

.mochimap-feature {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(300px, 1.05fr);
  align-items: center;
  gap: 44px;
}

.mochimap-feature figure {
  margin: 0;
}

.mochimap-feature img {
  display: block;
  width: 100%;
  max-height: 530px;
  object-fit: contain;
  border: 1px solid var(--mi-blog-border);
  background: #ffffff;
}

.mochimap-feature figcaption {
  margin-top: 10px;
  color: var(--mi-blog-text-muted);
  font-size: 13px;
  line-height: 1.65;
}

.project-group {
  margin-bottom: 54px;
}

.project-group__heading {
  margin: 0 0 14px;
  color: var(--mi-blog-text-muted);
  font-size: 14px;
  font-weight: 700;
}

.project-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  border: 0;
}

.project-card {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--mi-blog-border);
  border-radius: 4px;
  background: var(--mi-blog-surface);
}

.project-card__meta {
  margin: 0 0 8px;
  color: var(--mi-blog-text-muted);
  font-size: 12px;
  font-weight: 700;
}

.project-card__links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
  font-size: 14px;
  font-weight: 700;
}

.timeline {
  margin: 0 0 58px;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--mi-blog-border);
}

.timeline li {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 28px;
  padding: 18px 0;
  border-bottom: 1px solid var(--mi-blog-border);
}

.timeline time {
  color: var(--mi-blog-text-muted);
  font-size: 14px;
  font-weight: 700;
}

.timeline p {
  margin: 0;
  color: var(--mi-blog-text-soft);
  font-size: 15px;
  line-height: 1.75;
}

.periods {
  margin-bottom: 72px;
}

.period {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 36px;
  padding: 30px 0;
  border-top: 1px solid var(--mi-blog-border);
}

.period:last-child {
  border-bottom: 1px solid var(--mi-blog-border);
}

.period__years {
  color: var(--mi-blog-text-muted);
  font-size: 14px;
  font-weight: 700;
}

.period h2::before {
  margin-bottom: 10px;
}

.period p {
  margin: 10px 0 14px;
}

.period ul {
  margin: 0;
  padding-left: 1.25em;
}

.period li {
  margin: 8px 0;
  color: var(--mi-blog-text-soft);
  line-height: 1.65;
}

.archive {
  padding-top: 16px;
}

.archive-controls {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) repeat(4, minmax(120px, 1fr));
  gap: 10px;
  margin: 24px 0 18px;
  padding: 16px;
  border: 1px solid var(--mi-blog-border);
  border-radius: 4px;
  background: var(--mi-blog-surface-muted);
}

.archive-field {
  display: grid;
  gap: 5px;
}

.archive-field label {
  color: var(--mi-blog-text-muted);
  font-size: 11px;
  font-weight: 700;
}

.archive-field input,
.archive-field select {
  width: 100%;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid var(--mi-blog-border);
  border-radius: 3px;
  background: var(--mi-blog-surface);
  color: var(--mi-blog-text);
  font-size: 14px;
}

.archive-status {
  min-height: 24px;
  margin: 0 0 14px;
  color: var(--mi-blog-text-muted);
  font-size: 13px;
}

.archive-year {
  margin: 0;
  padding: 28px 0 10px;
}

.archive-year h3 {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--mi-blog-border);
  color: var(--mi-blog-text);
  font-size: 22px;
  line-height: 1.5;
}

.archive-year h3 span {
  color: var(--mi-blog-text-muted);
  font-size: 12px;
  font-weight: 400;
}

.archive-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.archive-item {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 160px;
  gap: 18px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--mi-blog-border) 72%, transparent);
}

.archive-item time,
.archive-item__media {
  color: var(--mi-blog-text-muted);
  font-size: 12px;
  line-height: 1.6;
}

.archive-item a {
  font-size: 14px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.archive-year[hidden],
.archive-item[hidden] {
  display: none;
}

.contact-list {
  border-top: 1px solid var(--mi-blog-border);
}

.contact-list li {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 24px;
  padding: 18px 0;
  border-bottom: 1px solid var(--mi-blog-border);
  color: var(--mi-blog-text-soft);
  line-height: 1.75;
}

.contact-list strong {
  color: var(--mi-blog-text);
}

.email-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--mi-blog-link);
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.site-footer {
  padding: 28px 18px;
  border-top: 1px solid var(--mi-blog-border);
  background: var(--mi-blog-surface);
  color: var(--mi-blog-text-muted);
}

.site-footer__inner {
  display: flex;
  width: min(100%, 1176px);
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 auto;
  font-size: 12px;
  line-height: 1.7;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.site-footer a {
  color: var(--mi-blog-link);
}

@media (max-width: 1023px) {
  .profile-local-nav__inner,
  .profile-shell {
    width: calc(100% - 64px);
  }

  .profile-shell {
    padding-top: 46px;
  }

  .summary-grid,
  .facts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-item:not(:nth-child(3n + 1)),
  .fact-item:not(:nth-child(3n + 1)) {
    padding-left: 0;
    border-left: 0;
  }

  .summary-item:nth-child(even),
  .fact-item:nth-child(even) {
    padding-left: 24px;
    border-left: 1px solid var(--mi-blog-border);
  }

  .summary-item:nth-child(odd),
  .fact-item:nth-child(odd) {
    padding-right: 24px;
  }

  .archive-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .archive-field:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 767px) {
  .profile-local-nav__inner {
    width: 100%;
    min-height: 62px;
    padding: 8px 12px;
  }

  .profile-local-nav__list {
    grid-template-columns: repeat(6, max-content);
    width: 100%;
    justify-content: space-between;
    gap: 0;
  }

  .profile-local-nav__list a {
    flex-direction: row;
    min-height: 46px;
    justify-content: center;
    padding: 5px 1px 4px;
    font-size: 11px;
    line-height: 1.35;
    text-align: center;
  }

  .profile-local-nav__line {
    display: inline;
  }

  .page-hero h1,
  .page-hero--home h1 {
    font-size: 36px;
  }

  .page-lead {
    font-size: 17px;
  }

  .project-grid,
  .mochimap-feature {
    grid-template-columns: 1fr;
  }

  .mochimap-feature figure {
    max-width: 520px;
  }

  .work-item,
  .series-item,
  .period {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .archive-item {
    grid-template-columns: 80px minmax(0, 1fr);
  }

  .archive-item__media {
    grid-column: 2;
  }
}

@media (max-width: 639px) {
  .profile-shell {
    width: calc(100% - 36px);
    padding: 34px 0 58px;
  }

  .page-hero {
    padding-bottom: 36px;
  }

  .page-hero h1,
  .page-hero--home h1 {
    font-size: 31px;
  }

  .page-lead {
    margin-top: 16px;
    font-size: 16px;
    line-height: 1.85;
  }

  .profile-section {
    padding: 36px 0;
  }

  .section-heading {
    display: block;
  }

  .section-heading h2,
  .content-section h2 {
    font-size: 23px;
  }

  .section-link {
    display: inline-block;
    margin-top: 12px;
  }

  .summary-grid,
  .facts-grid,
  .focus-list {
    grid-template-columns: 1fr;
  }

  .summary-item,
  .fact-item,
  .summary-item:nth-child(even),
  .fact-item:nth-child(even),
  .summary-item:nth-child(odd),
  .fact-item:nth-child(odd) {
    padding: 20px 0;
    border-left: 0;
  }

  .project-card {
    padding: 18px;
  }

  .timeline li,
  .contact-list li {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .archive-controls {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .archive-field:first-child {
    grid-column: auto;
  }

  .archive-item {
    grid-template-columns: 1fr;
    gap: 3px;
    padding: 12px 0;
  }

  .archive-item__media {
    grid-column: 1;
  }

  .site-footer__inner {
    display: block;
  }

  .site-footer nav {
    margin-top: 10px;
  }
}


/* Hatena Blog adapter for www.masahiko.info Profile Site RC v2.1. */

#container {
  min-height: 100vh;
  background: var(--mi-blog-page);
}

#blog-title,
.page-index #blog-title,
.page-static_page #blog-title,
.page-entry #blog-title {
  height: auto;
  padding: 0;
  border: 0;
  background: var(--mi-blog-surface);
  color: var(--mi-blog-text);
}

#blog-title-inner,
.header-image-enable #blog-title #blog-title-inner {
  position: relative;
  box-sizing: border-box;
  width: min(calc(100% - 80px), 1176px) !important;
  height: auto;
  margin: 0 auto;
  padding: 30px 48px 18px 0;
  background: none;
}

#blog-title #title {
  float: none;
  width: auto;
}

#title a,
#title a:link,
#title a:visited,
.header-image-enable #blog-title #title a {
  color: var(--mi-blog-text);
  text-shadow: none;
}

#blog-title #blog-description,
.header-image-enable #blog-title #blog-description {
  width: auto;
  color: var(--mi-blog-text-muted);
  text-shadow: none;
}

#top-editarea {
  padding: 0;
}

#masa_menu,
#spv_menu {
  display: none !important;
}

body:has(.profile-page) #top-box,
body:has(.profile-page) #box2,
body:has(.profile-page) .entry-header,
body:has(.profile-page) .entry-footer,
body:has(.profile-page) .pager {
  display: none !important;
}

body:has(.profile-page) #content,
body:has(.profile-page) #content-inner,
body:has(.profile-page) #wrapper,
body:has(.profile-page) #main,
body:has(.profile-page) #main-inner,
body:has(.profile-page) .entry,
body:has(.profile-page) .entry-content {
  box-sizing: border-box;
  float: none;
  width: 100%;
  min-width: 0;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--mi-blog-text);
}

body:has(.profile-page) #content {
  overflow: visible;
}

body:has(.profile-page) .entry-content {
  font-family: var(--mi-blog-font-sans);
  font-size: 16px;
  line-height: 1.85;
}

body:has(.profile-page) .entry-content h1,
body:has(.profile-page) .entry-content h2,
body:has(.profile-page) .entry-content h3,
body:has(.profile-page) .entry-content h4,
body:has(.profile-page) .entry-content h5,
body:has(.profile-page) .entry-content h6 {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--mi-blog-text);
  font-family: var(--mi-blog-font-sans);
  font-weight: 700;
  text-shadow: none;
}

body:has(.profile-page) .entry-content h2::before {
  display: none;
}

body:has(.profile-page) .entry-content p,
body:has(.profile-page) .entry-content ul,
body:has(.profile-page) .entry-content ol,
body:has(.profile-page) .entry-content figure {
  margin-top: 0;
}

body:has(.profile-page) .entry-content a,
body:has(.profile-page) .entry-content a:link,
body:has(.profile-page) .entry-content a:visited {
  color: var(--mi-blog-link);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

/* Keep the private legacy /link body intact while fitting it to the profile shell. */
body.static-page-link #top-box,
body.static-page-link #box2,
body.static-page-link .entry-footer,
body.static-page-link .pager {
  display: none !important;
}

body.static-page-link #content,
body.static-page-link #content-inner,
body.static-page-link #wrapper,
body.static-page-link #main,
body.static-page-link #main-inner,
body.static-page-link .entry-inner {
  box-sizing: border-box;
  float: none;
  width: 100%;
  min-width: 0;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

body.static-page-link #content {
  overflow: visible;
}

body.static-page-link .entry {
  box-sizing: border-box;
  float: none;
  width: min(calc(100% - 80px), 960px);
  min-width: 0;
  max-width: none;
  margin: 0 auto;
  padding: 52px 0 84px;
  border: 0;
  background: transparent;
  color: var(--mi-blog-text);
}

body.static-page-link .entry-header {
  display: block;
  margin: 0 0 32px;
  padding: 0 0 20px;
  border-bottom: 1px solid var(--mi-blog-border);
}

body.static-page-link .entry-title {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--mi-blog-text);
  font-family: var(--mi-blog-font-sans);
  font-size: 34px;
  font-weight: 700;
  line-height: 1.45;
  text-shadow: none;
}

body.static-page-link .entry-title-link,
body.static-page-link .entry-title-link:link,
body.static-page-link .entry-title-link:visited {
  color: var(--mi-blog-text);
  text-decoration: none;
}

body.static-page-link .entry-content {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: none;
  margin: 0;
  padding: 0;
  color: var(--mi-blog-text-soft);
  font-family: var(--mi-blog-font-sans);
  font-size: 16px;
  line-height: 1.85;
  overflow-wrap: anywhere;
}

body.static-page-link .entry-content .topics {
  margin: 34px 0 12px;
  padding: 22px 0 0;
  border-top: 1px solid var(--mi-blog-border);
  color: var(--mi-blog-text);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.6;
}

body.static-page-link .entry-content > .topics:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

body.static-page-link .entry-content .blog,
body.static-page-link .entry-content .blogbody {
  width: 100%;
  min-width: 0;
  color: var(--mi-blog-text-soft);
  line-height: 1.85;
}

body.static-page-link .entry-content a,
body.static-page-link .entry-content a:link,
body.static-page-link .entry-content a:visited {
  color: var(--mi-blog-link);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

body.static-page-link .entry-content a:hover {
  color: var(--mi-blog-link-hover);
}

body.static-page-link .entry-content hr {
  height: 0;
  margin: 28px 0;
  border: 0;
  border-top: 1px solid var(--mi-blog-border);
}

body.static-page-link .entry-content ul,
body.static-page-link .entry-content ol {
  max-width: 100%;
  padding-left: 1.5em;
}

body.static-page-link .entry-content img,
body.static-page-link .entry-content svg {
  max-width: 100%;
}

body.static-page-link .entry-content table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

body.static-page-link .container-tradingview {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  width: 100%;
  align-items: center;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  color: var(--mi-blog-text-soft);
}

body.static-page-link .icon-tradingview,
body.static-page-link .title-tradingview,
body.static-page-link .text-tradingview {
  margin: 0;
  color: var(--mi-blog-text-soft);
}

body.static-page-link .icon-tradingview {
  display: grid;
  place-items: center;
}

body.static-page-link .shortcuts-tradingview {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin: 0;
}

body.static-page-link .button-tradingview {
  display: inline-flex;
  min-width: 0;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 2px 9px;
  border: 1px solid var(--mi-blog-border);
  border-radius: 4px;
  background: var(--mi-blog-surface-muted);
  color: var(--mi-blog-text);
  font-family: var(--mi-blog-font-mono);
  font-size: 13px;
  line-height: 1.4;
  white-space: nowrap;
}

.profile-page {
  min-width: 0;
}

#bottom-editarea {
  margin: 0;
  padding: 0;
}

#footer,
.page-index #footer,
.page-static_page #footer,
.page-entry #footer {
  min-height: 0;
  padding: 0;
  border: 0;
  background: var(--mi-blog-surface);
}

#footer-inner {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

#footer address,
#footer .footer-action-wrapper {
  display: none;
}

@media (max-width: 1023px) {
  #blog-title-inner,
  .header-image-enable #blog-title #blog-title-inner {
    width: calc(100% - 64px) !important;
  }

  body.static-page-link .entry {
    width: calc(100% - 64px);
    padding-top: 46px;
  }
}

@media (max-width: 639px) {
  #blog-title-inner,
  .header-image-enable #blog-title #blog-title-inner {
    width: calc(100% - 36px) !important;
  }

  body.static-page-link .entry {
    width: calc(100% - 36px);
    padding: 34px 0 58px;
  }

  body.static-page-link .entry-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
  }

  body.static-page-link .entry-title {
    font-size: 28px;
  }

  body.static-page-link .entry-content .topics {
    margin-top: 28px;
    padding-top: 18px;
    font-size: 17px;
  }

  body.static-page-link .container-tradingview {
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: start;
  }

  body.static-page-link .shortcuts-tradingview {
    grid-column: 2;
    justify-content: flex-start;
  }
}

/* Hatena returns missing Profile URLs as page-index, so mark the actual no-entry DOM in head JS. */
body.mi-page-not-found #box1,
body.mi-page-not-found #box2,
body.mi-page-not-found .entry-footer,
body.mi-page-not-found .pager {
  display: none !important;
}

body.mi-page-not-found ins.adsbygoogle,
body.mi-page-not-found .google-auto-placed,
body.mi-page-not-found [id^="aswift_"] {
  display: none !important;
}

body.mi-page-not-found #content,
body.mi-page-not-found #content-inner,
body.mi-page-not-found #wrapper,
body.mi-page-not-found #main,
body.mi-page-not-found #main-inner,
body.mi-page-not-found .entry,
body.mi-page-not-found .entry-inner,
body.mi-page-not-found .entry-content {
  box-sizing: border-box;
  float: none;
  min-width: 0;
  max-width: none;
  border: 0;
  background: transparent;
}

body.mi-page-not-found #content,
body.mi-page-not-found #content-inner,
body.mi-page-not-found #wrapper,
body.mi-page-not-found #main,
body.mi-page-not-found #main-inner {
  width: 100%;
  margin: 0;
  padding: 0;
}

body.mi-page-not-found .entry.no-entry {
  width: min(calc(100% - 80px), 1176px);
  margin: 0 auto;
  padding: 56px 0 88px;
  color: var(--mi-blog-text);
}

body.mi-page-not-found .entry-content {
  width: min(100%, 760px);
  margin: 0;
  padding: 0;
  color: var(--mi-blog-text-soft);
  font-family: var(--mi-blog-font-sans);
  font-size: 16px;
  line-height: 1.85;
}

body.mi-page-not-found .entry-content h1 {
  margin: 0 0 14px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--mi-blog-text);
  font-family: var(--mi-blog-font-sans);
  font-size: 34px;
  font-weight: 700;
  line-height: 1.35;
  text-shadow: none;
}

body.mi-page-not-found .entry-content p {
  margin: 0;
}

@media (max-width: 1023px) {
  body.mi-page-not-found .entry.no-entry {
    width: calc(100% - 64px);
    padding-top: 46px;
  }
}

@media (max-width: 639px) {
  body.mi-page-not-found .entry.no-entry {
    width: calc(100% - 36px);
    padding: 34px 0 58px;
  }

  body.mi-page-not-found .entry-content h1 {
    font-size: 28px;
  }
}

