/* ぼくの。 — brand site */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --font-sans: "M PLUS Rounded 1c", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic",
    "Noto Sans JP", "Segoe UI", system-ui, sans-serif;
  --font-display: "Kiwi Maru", "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Yu Gothic",
    "Noto Sans JP", sans-serif;

  --bg: #12141a;
  --bg-elevated: #1a1d26;
  --text: #eceef2;
  --text-secondary: #b4b9c4;
  --text-muted: #858b98;
  --border: #2c313c;
  --border-strong: #3d4452;
  --accent: #8fa8cc;
  --accent-hover: #a8bdd9;
  --accent-soft: rgba(143, 168, 204, 0.14);
  --accent-ring: rgba(143, 168, 204, 0.4);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 6px 20px rgba(0, 0, 0, 0.2);
  --radius: 6px;
  --header-h: 3.25rem;
  --content: 42rem;
  --wide: 56rem;
  --space: 1.25rem;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

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

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 1000;
  padding: 0.5rem 0.85rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
}

.skip-link:focus {
  top: 0.75rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
}

@supports not (background: color-mix(in srgb, white 50%, black)) {
  .site-header {
    background: var(--bg);
  }
}

.site-header-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0.7rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: var(--header-h);
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  text-decoration: none;
  color: var(--text);
  line-height: 1.2;
  flex-shrink: 0;
}

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

.brand-name {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.brand-period {
  color: var(--accent);
  font-weight: 700;
}

.brand-domain {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.hero {
  padding: 3rem 0 3.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3.25rem;
}

.hero-brand {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 7vw, 3rem);
  font-weight: 500;
  letter-spacing: 0.03em;
  margin: 0 0 1.35rem;
  line-height: 1.25;
}

.hero-brand .brand-period {
  font-size: 1.05em;
}

.hero-tagline {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 3.2vw, 1.45rem);
  font-weight: 500;
  line-height: 1.7;
  margin: 0 0 1.5rem;
  letter-spacing: 0.02em;
  color: var(--text);
  max-width: 22em;
}

.nav-desktop {
  display: none;
  margin-left: auto;
  align-items: center;
  gap: 0.15rem;
}

.nav-desktop a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.92rem;
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.nav-desktop a:hover,
.nav-desktop a[aria-current="page"] {
  color: var(--text);
  background: var(--accent-soft);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}

.icon-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: none;
}

.icon-btn:hover {
  border-color: var(--border-strong);
  background: var(--accent-soft);
}

.icon-btn svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.menu-panel {
  display: none;
  border-top: 1px solid var(--border);
  background: var(--bg);
  padding: 0.5rem 1.25rem 1rem;
}

.menu-panel.is-open {
  display: block;
}

.menu-panel a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.55rem 0.35rem;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}

.menu-panel a:last-child {
  border-bottom: 0;
}

@media (min-width: 800px) {
  .nav-desktop {
    display: flex;
  }
  .menu-toggle {
    display: none;
  }
  .nav-desktop + .header-actions {
    margin-left: 0.5rem;
  }
  .menu-panel,
  .menu-panel.is-open {
    display: none;
  }
}

.site-main {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.site-main.narrow {
  max-width: var(--content);
}

.hero-lead {
  color: var(--text-secondary);
  margin: 0 0 1.75rem;
  max-width: 28rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: #12141a;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #12141a;
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: var(--accent-soft);
  color: var(--text);
}

.section {
  margin-bottom: 3.25rem;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: 0.03em;
}

.section-link {
  font-size: 0.88rem;
  text-decoration: none;
  color: var(--text-secondary);
  white-space: nowrap;
}

.section-link:hover {
  color: var(--accent);
}

.card-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .card-grid.apps {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .card-grid.apps.cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.app-card,
.post-card,
.principle-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.15rem 1.2rem 1.25rem;
}

.post-card {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0;
}

.post-card-cover {
  display: block;
  flex: 0 0 13.5rem;
  width: 13.5rem;
  max-width: 40%;
  align-self: stretch;
  background: var(--bg);
  border-right: 1px solid var(--border);
  border-bottom: 0;
  aspect-ratio: auto;
  min-height: 6.5rem;
  overflow: hidden;
}

.post-card-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left center;
}

.post-card-body {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.95rem 1.1rem 1.05rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.post-card h3 {
  font-family: var(--font-display);
  font-size: 1.02rem;
  margin: 0 0 0.35rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.45;
}

.post-card p {
  margin: 0;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.9rem;
  line-height: 1.55;
}

.post-card .post-meta {
  margin-bottom: 0.3rem;
}

@media (max-width: 560px) {
  .post-card-cover {
    display: none;
  }

  .post-card-body {
    padding: 0.95rem 1.05rem 1.05rem;
  }

  .post-card h3 {
    font-size: 0.98rem;
  }

  .post-card p {
    -webkit-line-clamp: 2;
    font-size: 0.86rem;
  }
}

.article-cover {
  margin: 0 0 1.5rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
}

.article-cover img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}

.app-card-top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  background: var(--bg);
}

.badge-public {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  color: var(--accent);
  background: var(--accent-soft);
}

.badge-planned {
  border-color: color-mix(in srgb, var(--text-secondary) 40%, var(--border));
  color: var(--text-secondary);
  background: color-mix(in srgb, var(--bg-elevated, var(--bg)) 80%, var(--border));
}

.app-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0 0 0.45rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.app-card h3 a,
.post-card h3 a {
  color: var(--text);
  text-decoration: none;
}

.app-card h3 a:hover,
.post-card h3 a:hover {
  color: var(--accent);
}

.app-card p {
  margin: 0 0 0.85rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.app-card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.9rem;
}

.app-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.host-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.post-list {
  display: grid;
  gap: 0.85rem;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.9rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.tag-list {
  list-style: none;
  margin: 0.65rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  min-height: 1.7rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.78rem;
  line-height: 1.2;
}

.tag-chip:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--accent-soft);
}

.tag-filter {
  margin: 0 0 1.25rem;
  padding: 0.85rem 0 0.25rem;
  border-top: 1px solid var(--border);
}

.tag-filter-label {
  margin: 0 0 0.55rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.tag-index-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.tag-index-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
}

.tag-index-list a {
  color: var(--text);
  text-decoration: none;
}

.tag-index-list a:hover {
  color: var(--accent);
}

.tag-count {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.tag-back {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.tag-back a {
  color: var(--text-secondary);
}

.tag-back a:hover {
  color: var(--accent);
}

.article-header .tag-list {
  margin-top: 0.85rem;
}

.post-card .tag-list {
  margin-top: 0.7rem;
}

.empty-state {
  padding: 1.5rem 0.25rem;
  color: var(--text-secondary);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  text-align: center;
}

.principles {
  display: grid;
  gap: 0.85rem;
}

@media (min-width: 720px) {
  .principles {
    grid-template-columns: repeat(3, 1fr);
  }
}

.principle-card h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 0 0 0.5rem;
  font-weight: 600;
}

.principle-card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2rem);
  margin: 0 0 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.page-lead {
  color: var(--text-secondary);
  margin: 0 0 2rem;
}

.prose {
  color: var(--text);
}

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

.prose h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin: 2.2rem 0 0.8rem;
  font-weight: 600;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

.prose h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin: 1.6rem 0 0.55rem;
  font-weight: 600;
}

.prose p,
.prose ul,
.prose ol,
.prose pre {
  margin: 0 0 1rem;
}

.prose li + li {
  margin-top: 0.25rem;
}

.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--accent-soft);
  padding: 0.12rem 0.38rem;
  border-radius: 4px;
}

.prose pre {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  overflow-x: auto;
  box-shadow: var(--shadow);
}

.prose pre code {
  background: none;
  padding: 0;
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--text);
  white-space: pre;
}

.prose .article-figure {
  margin: 1.75rem 0;
}

.prose .article-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

.prose .article-figure figcaption {
  margin-top: 0.55rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  list-style: none;
  padding: 0;
}

.breadcrumb li:not(:last-child)::after {
  content: "/";
  margin-left: 0.35rem;
  color: var(--border-strong);
}

.breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--accent);
}

.article-header {
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.article-body {
  /* 将来の縦書き切替用ラッパー */
}

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 2.5rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.post-nav-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 4.5rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
}

.post-nav-item:hover {
  border-color: var(--border-strong);
  background: var(--accent-soft);
}

.post-nav-item.is-empty {
  visibility: hidden;
  pointer-events: none;
  box-shadow: none;
  border-color: transparent;
  background: transparent;
}

.post-nav-newer {
  text-align: right;
  align-items: flex-end;
}

.post-nav-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.post-nav-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
}

@media (max-width: 560px) {
  .post-nav {
    grid-template-columns: 1fr;
  }

  .post-nav-newer {
    text-align: left;
    align-items: flex-start;
  }

  .post-nav-item.is-empty {
    display: none;
  }
}

.related {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  padding: 2rem 1.25rem 2.5rem;
}

.site-footer-inner {
  max-width: var(--wide);
  margin: 0 auto;
  display: grid;
  gap: 1.25rem;
}

.footer-brand {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
}

.footer-brand .brand-period {
  color: var(--accent);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
}

.footer-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.footer-nav a:hover {
  color: var(--accent);
}

.footer-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.contact-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.contact-box code {
  font-size: 0.85em;
  background: var(--accent-soft);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.not-found {
  text-align: center;
  padding: 4rem 0;
}

.not-found h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  margin: 0 0 0.75rem;
}
