/* ========================================
   GitHub Dark Theme
   ======================================== */

@font-face {
  font-family: "851Gkktt";
  src: url("../fonts/851Gkktt_005.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --color-bg:          #191c22;
  --color-header:      #20232b;
  --color-surface:     #20232b;
  --color-border:      #363840;
  --color-text:        #d4d7de;
  --color-heading:     #ddd0a0;
  --color-muted:       #878b95;
  --color-link:        #6fadf0;
  --color-link-hover:  #8ec2f6;
  --color-hover-bg:    rgba(180,185,195,0.1);
  --radius:            6px;
  --header-height:     62px;
}

/* ── Reset ── */

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

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: "Hiragino Maru Gothic Pro", "Hiragino Maru Gothic ProN", -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-link);
  text-decoration: none;
}

a:hover {
  color: var(--color-link-hover);
  text-decoration: underline;
}

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

ul, ol {
  list-style: none;
}

/* ── Layout ── */

.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-main {
  flex: 1;
  padding: 32px 0 64px;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ── Header ── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-header);
  height: var(--header-height);
  isolation: isolate;
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  height: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-right: auto;
  color: var(--color-text);
  font-family: "851Gkktt", sans-serif;
  font-size: 16px;
  font-weight: normal;
  letter-spacing: 0.04em;
}

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

.brand-icon {
  height: 32px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.nav-toggle {
  display: none;
}

.header-sns {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
}

.header-sns a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius);
  transition: background 0.15s ease;
}

.header-sns a:hover {
  background: var(--color-hover-bg);
}

.header-sns img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  opacity: 0.7;
  filter: brightness(0) invert(1);
  transition: opacity 0.15s ease;
}

.header-sns a:hover img {
  opacity: 1;
}

.global-nav .nav-list,
.global-nav .menu {
  display: flex;
  align-items: center;
  gap: 4px;
}

.global-nav .nav-list a,
.global-nav .menu a,
.global-nav .nav-list a:visited,
.global-nav .menu a:visited {
  display: block;
  padding: 6px 12px;
  border-radius: var(--radius);
  color: var(--color-heading);
  font-family: "851Gkktt", sans-serif;
  font-size: 14px;
  font-weight: normal;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.global-nav .nav-list a:hover,
.global-nav .menu a:hover {
  background: var(--color-hover-bg);
  color: var(--color-text);
  text-decoration: none;
}

/* ── BG canvas ── */

#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
}

.site-shell {
  position: relative;
  z-index: 1;
}

/* ── Home logo ── */

.home-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 3vw, 24px);
  padding: 48px 0 40px;
}

.home-logo img {
  width: clamp(60px, 18vw, 150px);
  height: auto;
  flex-shrink: 0;
}

.home-logo-text {
  font-family: "851Gkktt", sans-serif;
  font-size: clamp(1rem, 5vw, 2.4rem);
  font-weight: normal;
  letter-spacing: 0.06em;
  color: var(--color-text);
  line-height: 1.3;
  white-space: nowrap;
}

/* ── Home tagline ── */

.home-tagline {
  text-align: center;
  font-size: clamp(0.8rem, 2vw, 1rem);
  color: var(--color-heading);
  letter-spacing: 0.12em;
  margin: -24px 0 36px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.home-tagline::before,
.home-tagline::after {
  content: '';
  display: block;
  width: clamp(24px, 6vw, 60px);
  height: 1px;
  background: linear-gradient(to right, transparent, var(--color-border));
}

.home-tagline::after {
  background: linear-gradient(to left, transparent, var(--color-border));
}

/* ── Home sections ── */

.home-section {
  margin-bottom: 40px;
}

.home-section:last-child {
  margin-bottom: 0;
}

.section-heading {
  font-size: 20px;
  font-weight: normal;
  font-family: "851Gkktt", sans-serif;
  padding-bottom: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-heading);
}

.section-title {
  font-size: 20px;
  font-weight: normal;
  font-family: "851Gkktt", sans-serif;
  padding-bottom: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-heading);
}

/* ── News ── */

.news-table {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.news-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
  transition: background 0.15s ease;
}

.news-row:last-child {
  border-bottom: none;
}

.news-row:hover {
  background: var(--color-hover-bg);
  text-decoration: none;
  color: var(--color-text);
}

.news-row time {
  color: var(--color-muted);
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  flex-shrink: 0;
  min-width: 80px;
}

.news-title {
  font-size: 14px;
}

/* ── Tile grid ── */

.tile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.tile-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-surface);
  transition: border-color 0.2s ease;
}

.tile-card:hover {
  border-color: var(--color-muted);
}

.tile-link {
  display: block;
  color: var(--color-text);
  height: 100%;
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.tile-link:hover {
  text-decoration: none;
  color: var(--color-text);
}

.tile-tag {
  display: inline-block;
  margin: 10px 12px 8px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  background: rgba(111,173,240,0.15);
  color: var(--color-link);
  letter-spacing: 0.02em;
}

.tile-thumb-wrap {
  aspect-ratio: 1 / 1;
  width: 90%;
  margin: 0 auto;
  border-radius: var(--radius);
  overflow: hidden;
}

.tile-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tile-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--color-muted);
  font-size: 12px;
}

.tile-body {
  padding: 12px;
}

.tile-title {
  font-size: 14px;
  font-weight: normal;
  font-family: "851Gkktt", sans-serif;
  margin-bottom: 4px;
  color: var(--color-heading);
}

.tile-summary {
  color: var(--color-muted);
  font-size: 12px;
  min-height: 1.4em;
}

/* ── Modal ── */

.modal-overlay {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.modal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* PC: 4:3, 画像左・情報右 */
.modal-card {
  position: relative;
  display: flex;
  flex-direction: row;
  width: min(860px, 100%);
  height: 516px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  transform: scale(0.96) translateY(8px);
  transition: transform 0.28s ease;
}

.modal-overlay.is-open .modal-card {
  transform: scale(1) translateY(0);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 10;
  background: rgba(0,0,0,0.45);
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.15s ease;
}

.modal-close:hover {
  background: rgba(0,0,0,0.7);
}

.modal-image {
  flex: 0 0 50%;
  overflow: hidden;
}

.modal-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #0d0f14;
}

.modal-info {
  flex: 1;
  padding: 28px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.modal-tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  background: rgba(111,173,240,0.15);
  color: var(--color-link);
  margin-bottom: 10px;
  align-self: flex-start;
}

.modal-title {
  font-size: 18px;
  font-weight: normal;
  font-family: "851Gkktt", sans-serif;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--color-border);
  line-height: 1.4;
  color: var(--color-heading);
}

.modal-content {
  line-height: 1.7;
  color: var(--color-text);
  font-size: 13px;
  padding-left: 12px;
}

.modal-content p {
  margin-bottom: 12px;
}

.modal-content img {
  width: 100%;
  border-radius: var(--radius);
}

/* ── Single ── */

.content-section {
  padding: 0;
}

.single-wrap {
  display: flex;
  justify-content: center;
}

.single-card {
  width: 100%;
  max-width: 860px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  padding: 32px;
}

.single-thumbnail img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}

.single-content {
  margin-top: 16px;
  line-height: 1.7;
}

.single-content p {
  margin-bottom: 16px;
}

.single-content img {
  border-radius: var(--radius);
}

/* ── Empty state ── */

.empty-text {
  text-align: center;
  color: var(--color-muted);
  padding: 40px 0;
}

/* ── Footer ── */

.site-footer {
  position: relative;
  z-index: 10;
  background: var(--color-header);
  padding: 24px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: auto;
}

.footer-sns {
  display: flex;
  gap: 8px;
}

.sns-link {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  transition: background 0.15s ease;
}

.sns-link:hover {
  background: var(--color-hover-bg);
}

.sns-link img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  opacity: 0.7;
  transition: opacity 0.15s ease;
}

.sns-link img[src$=".svg"] {
  filter: brightness(0) invert(1);
}

.sns-link:hover img {
  opacity: 1;
}

.sns-fallback {
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 600;
}

.copyright {
  color: var(--color-muted);
  font-family: "851Gkktt", sans-serif;
  font-size: 13px;
  font-weight: normal;
  width: 100%;
  text-align: center;
}

.copyright-symbol {
  font-family: sans-serif;
}

/* ── SNS cards ── */

.sns-card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  max-width: 720px;
  margin: 0 auto;
}

.sns-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.sns-card:hover {
  border-color: var(--color-muted);
  background: var(--color-hover-bg);
  text-decoration: none;
  color: var(--color-text);
}

.sns-card-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
}

.sns-card-icon img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.sns-card-icon-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--sns-color, var(--color-text));
}

.sns-card-body {
  flex: 1;
}

.sns-card-name {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 2px;
}

.sns-card-handle {
  font-size: 13px;
  color: var(--color-muted);
  margin: 0;
}

.sns-card-arrow {
  color: var(--color-muted);
  font-size: 16px;
}

/* ── Contact ── */

.contact-wrap {
  max-width: 680px;
  margin: 0 auto;
}

.contact-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  padding: 32px;
}

/* Contact Form 7 */

.wpcf7-form p {
  margin-bottom: 20px;
}

.wpcf7-form label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-muted);
}

.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form textarea {
  display: block;
  width: 100%;
  padding: 8px 12px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-text);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-appearance: none;
}

.wpcf7-form input[type="text"]:focus,
.wpcf7-form input[type="email"]:focus,
.wpcf7-form textarea:focus {
  border-color: var(--color-link);
  box-shadow: 0 0 0 3px rgba(111,173,240,0.15);
}

.wpcf7-form textarea {
  min-height: 160px;
  resize: vertical;
}

.wpcf7-form input[type="submit"] {
  display: inline-block;
  padding: 8px 20px;
  background: var(--color-link);
  border: none;
  border-radius: var(--radius);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.wpcf7-form input[type="submit"]:hover {
  opacity: 0.85;
}

.wpcf7-not-valid-tip {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #f85149;
}

.wpcf7-response-output {
  margin-top: 20px;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  border: 1px solid var(--color-border);
}

.wpcf7-mail-sent-ok {
  border-color: #3fb950 !important;
  color: #3fb950;
  background: rgba(63,185,80,0.1);
}

.wpcf7-mail-sent-ng,
.wpcf7-validation-errors,
.wpcf7-spam-blocked {
  border-color: #f85149 !important;
  color: #f85149;
  background: rgba(248,81,73,0.1);
}

/* ── Biography ── */

.bio-wrap {
  max-width: 720px;
  margin: 0 auto;
}

.bio-name {
  font-family: "851Gkktt", sans-serif;
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  font-weight: normal;
  color: var(--color-heading);
  letter-spacing: 0.06em;
  line-height: 1.4;
}

.bio-divider {
  height: 1px;
  background: var(--color-border);
  margin: 0;
}

.bio-section {
  padding: 28px 0;
}

.bio-section-label {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-link);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.bio-text {
  font-size: 15px;
  line-height: 1.8;
  color: var(--color-text);
  letter-spacing: 0.04em;
}

.bio-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bio-tag {
  display: inline-block;
  padding: 5px 14px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: 13px;
  color: var(--color-text);
  background: rgba(255,255,255,0.04);
  letter-spacing: 0.04em;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.bio-tag:hover {
  border-color: var(--color-link);
  background: rgba(111,173,240,0.08);
}

.bio-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
}

.bio-list span {
  font-size: 14px;
  color: var(--color-text);
  position: relative;
  padding-left: 14px;
  letter-spacing: 0.04em;
}

.bio-list span::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--color-muted);
  font-size: 11px;
  top: 2px;
}

/* ── Pagination ── */

.nav-links {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 24px;
}

.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--color-text);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.page-numbers:hover {
  background: var(--color-hover-bg);
  text-decoration: none;
}

.page-numbers.current {
  background: var(--color-link);
  border-color: var(--color-link);
  color: #fff;
}

/* ── Responsive ── */

@media (max-width: 1023px) {
  .tile-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  :root {
    --header-height: auto;
  }

  /* Header */
  .site-header {
    position: sticky;
    top: 0;
  }

  .header-inner {
    flex-wrap: wrap;
    padding: 12px 16px;
    gap: 0;
  }

  .brand {
    font-size: 14px;
    flex: 1;
  }

  .header-sns {
    display: none;
  }

  /* ハンバーガーボタン */
  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius);
  }

  .nav-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }

  .nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  /* ナビ：デフォルト非表示、開いたら縦並び */
  .global-nav {
    width: 100%;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.25s ease;
  }

  .global-nav.is-open {
    max-height: 300px;
  }

  .global-nav .nav-list,
  .global-nav .menu {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 0;
  }

  .global-nav .nav-list a,
  .global-nav .menu a {
    padding: 10px 4px;
    font-size: 14px;
    border-bottom: 1px solid var(--color-border);
  }

  .global-nav .nav-list li:last-child a,
  .global-nav .menu li:last-child a {
    border-bottom: none;
  }

  .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .site-main {
    padding: 20px 0 48px;
  }

  /* Home logo */
  .home-logo {
    padding: 24px 0 20px;
  }

  /* Tile: 1列・横長カード */
  .tile-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .tile-card {
    aspect-ratio: 16 / 9;
    border-radius: var(--radius);
    overflow: hidden;
  }

  .tile-link {
    display: grid;
    grid-template-columns: 42% 1fr;
    grid-template-rows: auto 1fr;
    grid-template-areas:
      "thumb tag"
      "thumb body";
    height: 100%;
    align-items: stretch;
  }

  .tile-thumb-wrap {
    grid-area: thumb;
    width: 100%;
    aspect-ratio: unset;
    height: 100%;
    border-radius: 0;
    margin: 0;
  }

  .tile-tag {
    grid-area: tag;
    margin: 12px 12px 4px;
    align-self: end;
  }

  .tile-body {
    grid-area: body;
    padding: 4px 12px 12px;
    align-self: start;
    text-align: left;
  }

  .tile-title {
    font-size: 13px;
  }

  /* News */
  .news-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  /* Footer */
  .footer-inner {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  /* SNS */
  .sns-card-grid {
    grid-template-columns: 1fr;
  }

  /* Contact */
  .contact-card {
    padding: 20px 16px;
  }

  /* Modal: 上に画像・下に情報 */
  .modal-overlay {
    padding: 16px;
    align-items: flex-end;
  }

  .modal-card {
    flex-direction: column;
    aspect-ratio: unset;
    max-height: 88vh;
    overflow-y: auto;
    width: 100%;
  }

  .modal-image {
    flex: none;
    width: 100%;
    aspect-ratio: 16 / 9;
  }

  .modal-info {
    padding: 16px;
  }

  .modal-title {
    font-size: 16px;
  }
}
