/* 基本リセットと設定 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --tile1-image: url("./resoces/tile1.png");
  --tile3-image: url("./resoces/tile3.png");
  --tile-slice: 1 1 1 1;
  --tile-border-width: 1px 1px 1px 1px;
  --tile2-size: 128px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Chakra Petch", "Noto Sans JP", sans-serif;
  color: #f1f5f9;              /* 明るいオフホワイトの文字 */
  background-color: #09090b;   /* 深い漆黒のベース背景 */
  background-image: url("./resoces/tile2.png");
  background-size: var(--tile2-size) var(--tile2-size);
  background-repeat: repeat;
  background-attachment: fixed;
  image-rendering: pixelated;
  line-height: 1.6;
}

button {
  font-family: inherit;
}

/* ナビゲーションバー */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: #ffffff;
}

.nav-links {
  display: flex;
  gap: 24px;
}

.nav-links a {
  text-decoration: none;
  color: #a1a1aa;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: #ffffff;
}

/* ==============================
   左右2カラムレイアウト（PC向け）
   ============================== */
.split-layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 32px;
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 48px;
  align-items: start;
}

/* 左カラム：ダークグレーのカード */
.left-column {
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  background: #121215;
  padding: 32px;
  border-radius: 16px;
  border: 1px solid #27272a;
  --tile-slice: 1 1 2 1;
  --tile-border-width: 1px 1px 1px 1px;
}

.info-block h2 {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #b3b3b4;
  margin-bottom: 8px;
}

.name {
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1.1;
  color: #ffffff;
  margin-bottom: 12px;
}

.lead {
  font-size: 0.95rem;
  color: #a1a1aa;
}

.profile-list {
  list-style: none;
  font-size: 0.9rem;
  color: #d4d4d8;
}

.profile-list li {
  margin-bottom: 6px;
}

.profile-list strong {
  color: #ffffff;
}

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

.skill-tags > span {
  background: #1e1e24;
  color: #e4e4e7;
  border: 1px solid #2e2e36;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
}

/* ==============================
   1. 自己紹介下のSNSアイコン
   ============================== */
.social-icons {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.social-icons a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: #1e1e24;
  color: #e4e4e7;
  border: 1px solid #2e2e36;
  text-decoration: none;
  transition: all 0.2s ease;
}

.social-icons a:hover {
  background-color: #ffffff;
  color: #09090b;
  border-color: #ffffff;
  transform: translateY(-2px);
}

.social-more-btn {
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid #2e2e36;
  background-color: #1e1e24;
  color: #d4d4d8;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.social-more-btn:hover {
  border-color: #ffffff;
  color: #ffffff;
  background-color: #27272a;
  transform: translateY(-2px);
}

/* ==============================
   右カラム：Works（スライダー＆カード）
   ============================== */
.right-column {
  min-width: 0;
}

.right-column h2 {
  font-size: 1.8rem;
  color: #ffffff;
  margin-bottom: 16px;
}

.sub-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #71717a;
  margin-bottom: 12px;
}

/* スライダー部分 */
.slider-wrapper {
  margin-bottom: 40px;
}

.works-slider {
  display: grid;
  overflow: hidden;
}

.slide-item {
  display: flex;
  flex-direction: column;
  grid-area: 1 / 1;
  width: 100%;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.8s ease-in-out,
    visibility 0s linear 0.8s;
}

.slide-item.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition:
    opacity 0.8s ease-in-out,
    visibility 0s;
}

@media (prefers-reduced-motion: reduce) {
  .slide-item {
    transition: none;
  }
}

.slide-body {
  flex: 1;
  padding: 20px;
}

.slide-body h3 {
  color: #ffffff;
  margin-bottom: 6px;
}

.slide-body p {
  font-size: 0.9rem;
  color: #a1a1aa;
}

.slide-thumb {
  position: relative;
  height: 180px;
  background: linear-gradient(135deg, #18181b, #27272a);
  border: 1px solid #2e2e36;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: #71717a;
}

/* カード一覧 */
.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.work-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.work-card:hover {
  transform: translateY(-4px);
  border-color: #52525b;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5);
}

.card-thumb {
  position: relative;
  height: 140px;
  background: #18181b;
  border-bottom: 1px solid #27272a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: #71717a;
}

.slide-thumb img,
.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-body {
  flex: 1;
  padding: 20px;
}

.card-body h3 {
  font-size: 1.1rem;
  color: #ffffff;
  margin-bottom: 8px;
}

.card-body p {
  font-size: 0.88rem;
  color: #a1a1aa;
  margin-bottom: 14px;
}

.card-tags {
  display: flex;
  gap: 6px;
}

.card-tags > span {
  font-size: 0.75rem;
  background: rgba(56, 189, 248, 0.12); /* ダーク背景に映えるシアンアクセント */
  color: #d1cece;
  border: 1px solid rgba(93, 166, 197, 0.25);
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.project-links a {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  color: #f1f5f9;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: filter 0.2s, transform 0.2s;
}

.project-links a.tile-button:hover {
  transform: translateY(-2px);
}

/* ==============================
   2. Contacts ポップアップ（モーダル）
   ============================== */
.contact-modal {
  border: 1px solid #27272a;
  border-radius: 20px;
  padding: 0;
  max-width: 480px;
  width: calc(100% - 32px);
  margin: auto;
  background: #121215;
  color: #f1f5f9;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75);
}

.contact-modal::backdrop {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
}

.contact-modal[open] {
  animation: modalFadeIn 0.25s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-inner {
  padding: 28px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.modal-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #ffffff;
}

.close-btn {
  background: #1e1e24;
  border: 1px solid #2e2e36;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.3rem;
  line-height: 1;
  color: #a1a1aa;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.close-btn:hover {
  background: #27272a;
  color: #ffffff;
}

.modal-desc {
  font-size: 0.9rem;
  color: #a1a1aa;
  margin-bottom: 20px;
}

.contact-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

a.contact-card:hover {
  border-color: #52525b;
  background-color: #1e1e24;
  transform: translateX(4px);
}

.contact-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: #ffffff;
  flex-shrink: 0;
}

.contact-icon.github { background: #27272a; border: 1px solid #3f3f46; }
.contact-icon.x-twitter { background: #000000; border: 1px solid #3f3f46; }
.contact-icon.zenn { background: #3ea8ff; }
.contact-icon.mail { background: #10b981; }

.contact-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.contact-info strong {
  font-size: 0.95rem;
  color: #ffffff;
}

.contact-info span {
  font-size: 0.8rem;
  color: #a1a1aa;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.copy-btn {
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #e4e4e7;
  background: #27272a;
  border: 1px solid #3f3f46;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.copy-btn:hover {
  background: #3f3f46;
  color: #ffffff;
}

.copy-btn.copied {
  background: #10b981;
  color: #ffffff;
  border-color: #10b981;
}

/* ==============================
   スマホ・タブレット対応（900px以下）
   ============================== */
@media (max-width: 900px) {
  .split-layout {
    grid-template-columns: 1fr;
    padding: 24px 16px;
  }

  .left-column {
    position: static;
  }
}

.navbar.tile-panel{
  --tile1-image:url("./resoces/tile4.png")
}
.left-column.tile-panel,
.skill-tags span.tile-panel,
.slide-item.tile-panel,
.slide-thumb.tile-panel,
.slide-body.tile-panel,
.work-card.tile-panel,
.card-thumb.tile-panel,
.card-tags span.tile-panel,
.contact-modal.tile-panel,
.contact-card.tile-panel,
.contact-icon.tile-panel,
.tile-panel {
  background-color: #5a5353;
  border-style: solid;
  border-width: var(--tile-border-width);
  border-color: transparent;
  border-image-source: var(--tile1-image);
  border-image-slice: var(--tile-slice) fill;
  border-image-width: var(--tile-border-width);
  border-image-repeat: stretch;
  border-radius: 0;
  image-rendering: pixelated;
}

.nav-links a.tile-button,
.social-icons a.tile-button,
.social-more-btn.tile-button,
.project-links a.tile-button,
a.contact-card.tile-button,
.close-btn.tile-button,
.copy-btn.tile-button {
  background-color: #514445;
  border-style: solid;
  border-width: var(--tile-border-width);
  border-color: transparent;
  border-image-source: var(--tile3-image);
  border-image-slice: var(--tile-slice) fill;
  border-image-width: var(--tile-border-width);
  border-image-repeat: stretch;
  border-radius: 0;
  image-rendering: pixelated;
}

.nav-links a.tile-button {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
}

.nav-links a.tile-button:hover,
.social-icons a.tile-button:hover,
.social-more-btn.tile-button:hover,
.project-links a.tile-button:hover,
a.contact-card.tile-button:hover,
.close-btn.tile-button:hover,
.copy-btn.tile-button:hover {
  filter: brightness(1.15);
}

.social-icons a.tile-button:hover {
  color: #ffffff;
}

.copy-btn.copied.tile-button {
  filter: brightness(1.25);
}

h1,
h2,
h3,
h4,
h5,
h6,
strong,
b,
.nav-logo,
.skill-tags > span,
.social-more-btn,
.sub-label,
.card-tags > span,
.project-links a,
.contact-icon,
.copy-btn {
  letter-spacing: 0.1em;
}

.slide-thumb.tile-panel:not(:has(img)),
.card-thumb.tile-panel:not(:has(img)) {
  --tile1-image: url("./resoces/tile5.png");
}

.slide-body.tile-panel {
  --tile-slice: 1 1 1 1;
  --tile-border-width: 1.5px 2px 2px 1px;
  padding: 24px 28px 24px 48px;
}

/* 1. モーダル全体のサイズと内側の余白を広げて、外枠の光・影と中身が被らないようにする */
.contact-modal.tile-panel {
  max-width: 560px;          /* 横幅を少し広げてゆとりを持たせる（元は480px） */
  box-sizing: border-box;
  --tile-slice: 1 1 1 1;
  --tile-border-width: 1px 2px 1px 1px;
}

.contact-modal .modal-inner {
  /* 上・右・下・左の余白を広げる（左の光の帯と右の影を避ける） */
  padding: 36px 44px 44px 48px;
}

/* 2. モーダル内の各カード（GitHub, X, Note, Email）の余白調整 */
.contact-modal .contact-card {
  /* 左側の余白を広げて、アイコン（GHなど）がカードの光の帯と被らないようにする */
  padding: 14px 20px 14px 28px;
  gap: 16px;
}

/* 3. カード同士の縦の間隔も少し広げてスッキリさせる */
.contact-modal .contact-list {
  gap: 16px;
}

.contact-modal .contact-card.email-box .contact-info {
  flex: 0 1 auto; /* 横いっぱいに広がるのをやめる */
}

.contact-modal .copy-btn {
  margin-left: 12px;
}