:root {
  --bg: #f7f3ea;
  --ink: #241f1a;
  --ink-soft: #837a6c;
  --line: rgba(36,31,26,0.12);
  --accent: #ff7a3d;
  --card: #fffdf8;
  --display: 'Baloo 2', 'Zen Maru Gothic', system-ui, cursive;
  --body: 'Zen Maru Gothic', system-ui, sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--body);
  line-height: 1.8; -webkit-font-smoothing: antialiased;
  min-height: 100vh; position: relative; overflow-x: hidden;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(45vw 45vw at 16% 6%, rgba(255,140,90,0.30), transparent 62%),
    radial-gradient(42vw 42vw at 90% 18%, rgba(120,200,255,0.30), transparent 62%),
    radial-gradient(46vw 46vw at 78% 90%, rgba(150,225,170,0.32), transparent 62%),
    radial-gradient(44vw 44vw at 8% 94%, rgba(200,160,255,0.30), transparent 62%);
  filter: saturate(1.15);
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 28px; position: relative; z-index: 1; }

/* ---- header ---- */
header.site {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  background: rgba(247,243,234,0.82); border-bottom: 2px solid var(--ink);
}
header.site .bar { display: flex; align-items: center; justify-content: space-between; height: 62px; }
header.site .brand { font-family: var(--display); font-weight: 800; font-size: 1.15rem; letter-spacing: -0.01em; color: var(--ink); text-decoration: none; }
header.site nav { display: flex; align-items: center; gap: 16px; }
header.site nav a { color: var(--ink-soft); text-decoration: none; font-size: 0.84rem; font-weight: 700; transition: color 0.2s; }
header.site nav a:hover { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-menu-btn {
  display: none; font-family: var(--display); font-weight: 700; font-size: 0.82rem;
  padding: 10px 14px; min-height: 44px; border-radius: 999px; border: 2px solid var(--ink);
  background: var(--card); color: var(--ink); cursor: pointer; box-shadow: 2px 2px 0 var(--ink);
}
.lang-toggle { display: inline-flex; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; background: var(--card); }
.lang-toggle button { background: transparent; border: 0; color: var(--ink); font-family: var(--display); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.06em; padding: 8px 13px; min-height: 36px; cursor: pointer; transition: color 0.2s, background 0.2s; }
.lang-toggle button.active { color: #fff; background: var(--accent); }
@media (max-width: 620px) {
  .nav-menu-btn { display: inline-flex; align-items: center; }
  .nav-links {
    display: none; position: fixed; inset: 62px 0 0 0; z-index: 60;
    flex-direction: column; align-items: stretch; gap: 0;
    background: rgba(247,243,234,0.97); backdrop-filter: blur(12px);
    border-top: 2px solid var(--ink); padding: 12px 20px 28px;
    padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
  }
  body.nav-open .nav-links { display: flex; }
  .nav-links .navlink {
    display: flex; align-items: center; min-height: 48px; padding: 12px 8px;
    border-bottom: 1px solid var(--line); font-size: 1rem;
  }
  body.nav-open { overflow: hidden; }
}
@media (min-width: 621px) {
  .nav-links {
    display: flex; position: static; inset: auto; background: transparent;
    border: 0; padding: 0; flex-direction: row; overflow: visible;
  }
}

/* ---- section label ---- */
.section-label { font-size: 0.78rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink); font-weight: 800; margin-bottom: 30px; display: flex; align-items: center; gap: 14px; }
.section-label::before { content: ""; width: 16px; height: 16px; border-radius: 5px; background: var(--accent); transform: rotate(-8deg); box-shadow: 2px 2px 0 var(--ink); flex-shrink: 0; }
.section-label::after { content: ""; flex: 1; height: 2px; background: var(--line); }
section.block { padding: 54px 0 0; }
section.block.first { padding-top: 78px; }
.about-prose .lead { font-size: 0.82rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); font-weight: 700; margin-bottom: 10px; }
.about-prose .lead-tag { font-family: var(--display); font-weight: 700; font-size: clamp(1.5rem, 3.6vw, 2.1rem); line-height: 1.35; letter-spacing: -0.01em; color: var(--ink); margin-bottom: 22px; }

/* ---- buttons ---- */
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-family: var(--display); font-size: 0.92rem; font-weight: 700; letter-spacing: 0.01em; padding: 12px 24px; border-radius: 999px; border: 2px solid var(--ink); transition: transform 0.18s cubic-bezier(.2,.7,.3,1), box-shadow 0.18s; }
.btn.primary { background: var(--accent); color: #fff; box-shadow: 4px 4px 0 var(--ink); }
.btn.primary:hover { transform: translate(-2px,-2px); box-shadow: 6px 6px 0 var(--ink); }
.btn.ghost { background: var(--card); color: var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.btn.ghost:hover { transform: translate(-2px,-2px); box-shadow: 6px 6px 0 var(--ink); }
.btn .arrow { transition: transform 0.25s; }
.btn:hover .arrow { transform: translateX(4px); }

/* ---- badges (pills) ---- */
.badges { display: flex; flex-wrap: wrap; gap: 10px; }
.badge-pill { display: inline-flex; align-items: center; gap: 8px; font-family: var(--display); font-size: 0.82rem; font-weight: 700; padding: 8px 16px; border-radius: 999px; border: 2px solid var(--ink); background: #fff; color: var(--ink); box-shadow: 3px 3px 0 var(--accent); }
.badge-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* ---- works grid ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; zoom: 0.6; /* カードを0.6倍に縮小 */ }
.card {
  position: relative; border-radius: 22px; padding: 28px 26px 24px; text-decoration: none; color: inherit;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--card); border: 2px solid var(--ink);
  box-shadow: 5px 6px 0 color-mix(in srgb, var(--c, var(--accent)) 80%, transparent);
  transition: transform 0.18s cubic-bezier(.2,.7,.3,1), box-shadow 0.18s;
}
.card::before { content: ""; position: absolute; width: 150px; height: 150px; right: -46px; top: -46px; border-radius: 50%; background: var(--c, var(--accent)); opacity: 0.16; transition: opacity 0.25s, transform 0.25s; }
.card > * { position: relative; z-index: 1; }
.card:hover { transform: translate(-3px,-4px); box-shadow: 9px 11px 0 var(--c, var(--accent)); }
.card:hover::before { opacity: 0.26; transform: scale(1.12); }
.badge { width: 58px; height: 58px; border-radius: 16px; margin-bottom: 20px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 800; font-size: 1.4rem; color: #fff; letter-spacing: -0.02em; border: 2px solid var(--ink); box-shadow: 2px 3px 0 var(--ink); background: var(--c, var(--accent)); transform: rotate(-4deg); transition: transform 0.25s; }
.card:hover .badge { transform: rotate(3deg) scale(1.05); }
.card h3 { font-family: var(--display); font-weight: 700; font-size: 1.4rem; letter-spacing: -0.01em; margin-bottom: 4px; }
.card .cat { font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase; color: color-mix(in srgb, var(--c) 55%, var(--ink)); font-weight: 700; margin-bottom: 14px; }
.card p { font-size: 0.92rem; color: var(--ink-soft); flex: 1; margin-bottom: 18px; }
/* 作品メタ情報（カード / 詳細ページ 共通） */
.meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 0; }
.meta .star { font-size: 0.78rem; color: var(--ink); font-weight: 700; }
.meta .sep { color: var(--ink-soft); font-weight: 700; font-size: 0.86rem; line-height: 1; }
.dl { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px; border-radius: 999px; border: 1.5px solid var(--ink); background: #fff; font-size: 0.74rem; font-weight: 700; color: var(--ink); line-height: 1.5; }
.dl .arrow { font-family: var(--display); font-weight: 800; }
.dl.npm { background: #fffaf3; color: #a8541f; border-color: #c98a4f; }
.dl.npm .arrow { color: #a8541f; }
.spark { display: block; margin: 4px 0 8px; opacity: 0.7; line-height: 0; }
.spark .spark-svg { width: 100%; max-width: 110px; height: 20px; display: block; }
/* card 固有の余白（detail には適用しない） */
.card .meta { margin-bottom: 12px; }
.card .go { font-family: var(--display); font-size: 0.86rem; font-weight: 700; letter-spacing: 0.02em; display: inline-flex; align-items: center; gap: 7px; color: var(--ink); }
.card .go .arrow { transition: transform 0.25s; }
.card:hover .go .arrow { transform: translateX(5px); }
/* Default visible. Animate only when motion is OK — otherwise opacity:0 +
 * animation:none (reduced-motion) leaves cards permanently invisible. */
.reveal { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; animation: rise 0.6s cubic-bezier(.2,.7,.3,1) forwards; }
}
@keyframes rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* ---- experience ---- */
.exp-list { display: flex; flex-direction: column; gap: 16px; }
.exp { position: relative; border-radius: 18px; padding: 22px 24px; background: var(--card); border: 2px solid var(--ink); box-shadow: 4px 5px 0 var(--line); }
.exp .role { font-family: var(--display); font-weight: 700; font-size: 1.2rem; margin-bottom: 4px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.exp .tag-current { font-family: var(--display); font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 700; color: #fff; background: var(--accent); padding: 3px 11px; border-radius: 999px; border: 2px solid var(--ink); }
.exp .org { font-size: 0.84rem; color: color-mix(in srgb, var(--accent) 50%, var(--ink)); font-weight: 700; letter-spacing: 0.02em; margin-bottom: 12px; }
.exp p { font-size: 0.92rem; color: var(--ink-soft); }

/* ---- can do ---- */
.cando-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.cando { border-radius: 18px; padding: 22px 24px; background: var(--card); border: 2px solid var(--ink); box-shadow: 4px 5px 0 var(--line); transition: transform 0.18s, box-shadow 0.18s; }
.cando:hover { transform: translate(-2px,-3px); box-shadow: 6px 8px 0 var(--accent); }
.cando h4 { font-family: var(--display); font-weight: 700; font-size: 1.12rem; margin-bottom: 8px; }
.cando p { font-size: 0.86rem; color: var(--ink-soft); }
.tagchips { display: flex; flex-direction: column; gap: 16px; }
.chip { font-family: var(--display); font-size: 0.78rem; font-weight: 600; color: var(--ink); padding: 6px 14px; border-radius: 999px; border: 2px solid var(--ink); background: #fff; }
.skill-tier { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.skill-tier .ylabel { flex-shrink: 0; font-family: var(--display); font-size: 0.78rem; font-weight: 700; color: var(--ink); padding: 6px 14px; border-radius: 999px; border: 2px solid var(--ink); background: #fff; box-shadow: 3px 3px 0 var(--line); min-width: 78px; text-align: center; }
.skill-tier.hot .ylabel { background: var(--accent); color: #fff; box-shadow: 3px 3px 0 var(--ink); }
.skill-tier .schips { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; padding-top: 2px; }
.skill-tier.hot .schips .chip { box-shadow: 2px 2px 0 var(--accent); }
@media (max-width: 560px) { .skill-tier { gap: 10px; } }

/* ---- persona ---- */
.persona-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.fact { display: inline-flex; align-items: center; gap: 11px; font-family: var(--body); font-weight: 500; font-size: 0.92rem; color: var(--ink); padding: 11px 18px 11px 14px; border-radius: 16px; border: 2px solid var(--ink); background: var(--card); box-shadow: 4px 5px 0 var(--line); transition: transform 0.18s, box-shadow 0.18s; }
.fact:hover { transform: translate(-2px,-3px) rotate(-1deg); box-shadow: 6px 8px 0 var(--accent); }
.fact .fe { font-size: 1.25rem; line-height: 1; filter: saturate(1.1); }

.embed-privacy { max-width: 760px; margin-top: 16px; color: var(--ink-soft); font-size: 0.75rem; line-height: 1.65; }

/* ---- about ---- */
.profile-head { display: flex; align-items: center; gap: 24px; margin-bottom: 30px; flex-wrap: wrap; }
.avatar svg,
.avatar img { display: block; filter: drop-shadow(5px 6px 0 rgba(36,31,26,0.12)); }
.avatar img.mascot-cats { width: min(180px, 42vw); height: auto; }
.profile-meta { flex: 1; min-width: 240px; }
.profile-meta .lead { margin-bottom: 8px; }
.profile-meta .lead-tag { margin-bottom: 0; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 34px; }
.stat { background: var(--card); border: 2px solid var(--ink); border-radius: 18px; padding: 18px 16px; text-align: center; box-shadow: 4px 5px 0 var(--line); }
.stat .snum { font-family: var(--display); font-weight: 800; font-size: 2.1rem; line-height: 1; color: var(--accent); }
.stat .snum .sunit { font-size: 0.95rem; font-weight: 700; color: var(--ink); margin-left: 2px; }
.stat .slabel { font-size: 0.76rem; font-weight: 700; color: var(--ink-soft); margin-top: 8px; letter-spacing: 0.02em; }
.about-prose { max-width: 720px; }
.core-card { background: var(--card); border: 2px solid var(--ink); border-radius: 18px; padding: 20px 24px; box-shadow: 5px 6px 0 var(--accent); margin-bottom: 26px; }
.core-label { display: inline-block; font-family: var(--display); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 800; color: #fff; background: var(--accent); border: 2px solid var(--ink); border-radius: 999px; padding: 3px 13px; margin-bottom: 13px; }
.core-body { font-family: var(--display); font-weight: 700; font-size: clamp(1.05rem, 2.6vw, 1.34rem); line-height: 1.5; letter-spacing: -0.01em; color: var(--ink); }
.about-prose p { font-size: 1rem; color: var(--ink); margin-bottom: 18px; }
.about-prose p.soft { color: var(--ink-soft); font-size: 0.95rem; }
.about-prose p.philo { font-family: var(--display); font-weight: 700; font-size: clamp(1.3rem, 3vw, 1.7rem); color: var(--ink); line-height: 1.4; margin-bottom: 10px; }

/* ---- contact ---- */
.contact-lead { font-size: 1.02rem; color: var(--ink); max-width: 680px; margin-bottom: 26px; }
.welcome { background: var(--card); border: 2px solid var(--ink); border-radius: 20px; padding: 24px 26px; box-shadow: 5px 6px 0 var(--accent); max-width: 720px; margin-bottom: 28px; }
.welcome h4 { font-family: var(--display); font-weight: 700; font-size: 1.15rem; margin-bottom: 14px; }
.welcome ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.welcome li { position: relative; padding-left: 26px; font-size: 0.94rem; color: var(--ink); }
.welcome li::before { content: "→"; position: absolute; left: 0; color: var(--accent); font-weight: 800; }
.contact-cta { gap: 12px; }

@media (max-width: 560px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .profile-head { gap: 18px; }
  .avatar svg { width: 92px; height: 92px; }
  .avatar img.mascot-cats { width: 138px; }
}

/* ---- articles timeline ---- */
.articles-channel { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 24px; margin: 0 0 26px; padding: 20px 22px; background: var(--card); border: 2px solid var(--ink); border-radius: 22px; box-shadow: 5px 6px 0 var(--line); }
.articles-channel .yt-embed { flex: 1 1 320px; max-width: 420px; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; border: 1.5px solid var(--ink); background: #000; }
.articles-channel .yt-embed[hidden] { display: none; }
.articles-channel .yt-embed iframe { display: block; width: 100%; height: 100%; border: 0; }
.articles-channel .yt-meta { flex: 1 1 260px; min-width: 0; }
.articles-channel .yt-lead { font-family: var(--display); font-weight: 800; font-size: 1.05rem; color: var(--ink); margin: 0 0 8px; }
.articles-channel .yt-sub { font-size: 0.88rem; color: var(--ink-soft); line-height: 1.6; margin: 0 0 14px; }
@media (max-width: 760px) { .articles-channel { padding: 18px; } .articles-channel .yt-embed { max-width: none; } }
.articles-timeline { display: flex; flex-direction: column; gap: 0; background: var(--card); border: 2px solid var(--ink); border-radius: 22px; box-shadow: 5px 6px 0 var(--line); overflow: hidden; }
.articles-loading { padding: 22px 24px; color: var(--ink-soft); font-size: 0.92rem; }
.article-row { display: grid; grid-template-columns: 96px 120px 1fr auto; gap: 20px; padding: 20px 24px; border-top: 1px solid var(--line); align-items: flex-start; transition: background 0.15s; }
.article-row:first-child { border-top: 0; }
.article-row:hover { background: #fffbf2; }
.article-date { font-family: var(--display); font-weight: 700; color: var(--accent); font-size: 0.86rem; padding-top: 6px; white-space: nowrap; }
.article-thumb { width: 120px; aspect-ratio: 16 / 9; border-radius: 10px; border: 1.5px solid var(--ink); overflow: hidden; background: repeating-linear-gradient(135deg, #f3ead4 0 8px, #efe5cb 8px 16px); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.article-thumb.empty { background: #f3efe5; color: var(--ink-soft); font-family: var(--display); font-weight: 700; font-size: 0.7rem; text-align: center; }
.article-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.article-col { min-width: 0; }
.article-title { font-family: var(--display); font-weight: 800; font-size: 1.02rem; line-height: 1.4; margin: 0 0 6px; }
.article-title a { color: var(--ink); text-decoration: none; }
.article-title a:hover { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.article-desc { font-size: 0.88rem; color: var(--ink-soft); line-height: 1.6; margin: 0 0 10px; }
.article-links { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lpill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 11px; border-radius: 99px; font-family: var(--display); font-weight: 700; font-size: 0.76rem; text-decoration: none; border: 1.5px solid transparent; line-height: 1.5; transition: transform 0.15s, box-shadow 0.15s; }
.lpill:hover { transform: translate(-1px, -1px); box-shadow: 2px 2px 0 var(--ink); }
.lpill-zenn { background: #3ea8ff; color: #fff; border-color: #3ea8ff; }
.lpill-note { background: #2cb696; color: #fff; border-color: #2cb696; }
.lpill-qiita { background: #55c500; color: #fff; border-color: #55c500; }
.lpill-html { background: var(--accent); color: #fff; border-color: var(--accent); }
.lpill-youtube { background: #e62117; color: #fff; border-color: #e62117; }
.article-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; padding-top: 6px; }
.article-tag { font-family: var(--display); font-weight: 700; font-size: 0.74rem; color: var(--ink-soft); padding: 3px 11px; border: 1.5px solid var(--ink-soft); border-radius: 99px; background: #fff; white-space: nowrap; }

@media (max-width: 760px) {
  .article-row { grid-template-columns: 1fr; gap: 10px; padding: 18px 18px; }
  .article-thumb { width: 100%; max-width: 240px; }
  .article-right { align-items: flex-start; padding-top: 0; }
}

/* ---- footer ---- */
footer { border-top: 2px solid var(--ink); padding: 40px 0 60px; margin-top: 72px; }
footer .frow { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
footer .copy { font-size: 0.82rem; color: var(--ink-soft); font-weight: 500; }
footer .links { display: flex; gap: 12px; flex-wrap: wrap; }
footer a.pill, .links a.pill { font-family: var(--display); color: var(--ink); text-decoration: none; font-size: 0.84rem; font-weight: 700; padding: 9px 18px; border-radius: 999px; border: 2px solid var(--ink); background: #fff; box-shadow: 3px 3px 0 var(--line); transition: transform 0.18s, box-shadow 0.18s, background 0.18s, color 0.18s; }
footer a.pill:hover, .links a.pill:hover { transform: translate(-2px,-2px); box-shadow: 4px 4px 0 var(--accent); background: var(--accent); color: #fff; }

/* ---- detail page ---- */
.detail { padding: 80px 0 0; }
.back { font-family: var(--display); display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-size: 0.86rem; font-weight: 700; margin-bottom: 32px; padding: 8px 16px; border-radius: 999px; border: 2px solid var(--ink); background: #fff; box-shadow: 3px 3px 0 var(--line); transition: transform 0.18s, box-shadow 0.18s; }
.back:hover { transform: translate(-2px,-2px); box-shadow: 4px 4px 0 var(--accent); }
.detail-head { display: flex; align-items: flex-start; gap: 24px; margin-bottom: 36px; }
.detail-head .badge { width: 82px; height: 82px; border-radius: 22px; font-size: 2rem; margin-bottom: 0; }
.detail-head .cat { font-size: 0.76rem; letter-spacing: 0.06em; text-transform: uppercase; color: color-mix(in srgb, var(--c) 55%, var(--ink)); font-weight: 700; margin-bottom: 8px; }
.detail-head h1 { font-family: var(--display); font-weight: 700; font-size: clamp(2rem, 5vw, 2.9rem); letter-spacing: -0.01em; line-height: 1.1; }
.detail-body { max-width: 760px; }
.detail-body h2 { font-size: 0.76rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-soft); font-weight: 700; margin: 36px 0 14px; }
.detail-body p { font-size: 1rem; color: var(--ink); }
/* portfolio.md long overview（marked 描画）。h2 以下の見出しはページ本体の h2 と衝突しないよう h3 起点で扱う。 */
.detail-long { font-size: 1rem; color: var(--ink); line-height: 1.7; }
.detail-long p { margin: 0 0 1em; }
.detail-long h1, .detail-long h2, .detail-long h3, .detail-long h4 { font-family: var(--display); font-weight: 700; margin: 1.4em 0 0.6em; line-height: 1.3; }
.detail-long h1 { font-size: 1.3rem; }
.detail-long h2 { font-size: 1.15rem; }
.detail-long h3, .detail-long h4 { font-size: 1.02rem; }
.detail-long ul, .detail-long ol { margin: 0 0 1em; padding-left: 1.4em; }
.detail-long li { margin: 0.3em 0; }
.detail-long code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 0.9em; background: var(--card); border: 1px solid var(--line); border-radius: 4px; padding: 0.1em 0.4em; }
.detail-long pre { background: var(--card); border: 2px solid var(--ink); border-radius: 12px; padding: 14px 16px; overflow-x: auto; margin: 0 0 1em; }
.detail-long pre code { background: none; border: none; padding: 0; }
.detail-long blockquote { margin: 0 0 1em; padding: 4px 16px; border-left: 3px solid var(--accent); color: var(--ink-soft); }
.detail-long table { width: 100%; border-collapse: collapse; margin: 0 0 1em; font-size: 0.92rem; }
.detail-long th, .detail-long td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; }
.detail-long a { color: var(--accent); }
.detail-long img { max-width: 100%; border-radius: 8px; }
.tech-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.detail-cta { margin-top: 42px; display: flex; flex-wrap: wrap; gap: 14px; }

@media (max-width: 560px) {
  .detail-head { flex-direction: column; gap: 18px; }
  .grid { grid-template-columns: 1fr; zoom: 1; /* スマホは縮小解除 */ }
  footer .frow { justify-content: center; text-align: center; }
}

/* ===== レスポンシブ調整（タブレット〜スマホ） ===== */

/* タブレット以下：上部の余白を詰める */
@media (max-width: 820px) {
  section.block { padding-top: 46px; }
  section.block.first { padding-top: 58px; }
  .detail { padding-top: 58px; }
}

/* スマホ（横幅 600px 以下） */
@media (max-width: 600px) {
  .wrap { padding: 0 18px; }
  header.site .bar { height: 56px; }
  header.site .brand { font-size: 1.05rem; }

  .section-label { margin-bottom: 22px; font-size: 0.72rem; letter-spacing: 0.16em; }
  section.block { padding-top: 38px; }
  section.block.first { padding-top: 44px; }

  .card { padding: 22px 20px 20px; border-radius: 18px; }
  .card::before { width: 120px; height: 120px; right: -38px; top: -38px; }
  .badge { width: 50px; height: 50px; font-size: 1.2rem; margin-bottom: 16px; }
  .card h3 { font-size: 1.25rem; }

  .exp { padding: 18px 18px; }
  .exp .role { font-size: 1.08rem; }
  .cando { padding: 18px 18px; }
  .cando h4 { font-size: 1.06rem; }

  .welcome { padding: 20px 20px; }
  .contact-lead { font-size: 0.96rem; }

  /* CTA ボタンは縦積み＆全幅でタップしやすく */
  .cta-row .btn,
  .detail-cta .btn { flex: 1 1 100%; justify-content: center; }

  footer { padding: 32px 0 48px; margin-top: 52px; }

  .detail { padding-top: 44px; }
  .detail-head .badge { width: 68px; height: 68px; font-size: 1.7rem; }
  .detail-body p { font-size: 0.96rem; }
}

/* 小型スマホ（横幅 380px 以下）：余白とフォントをさらに圧縮 */
@media (max-width: 380px) {
  .wrap { padding: 0 14px; }
  .stats { gap: 10px; }
  .stat { padding: 14px 10px; }
  .stat .snum { font-size: 1.8rem; }
  .fact { font-size: 0.86rem; padding: 10px 14px 10px 12px; }
}

/* ---- articles filter bar（媒体タブ + タグ chip）----
 * articles-list の直前に挿入される。記事 5 件以上のときだけ JS で生成される
 * （5 件未満では UI を出さずカードだけ表示）。
 */
.articles-filters { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.articles-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.atab {
  font-family: var(--display); font-weight: 700; font-size: 0.82rem;
  padding: 6px 14px; border-radius: 999px; border: 2px solid var(--ink);
  background: #fff; color: var(--ink); cursor: pointer;
  box-shadow: 3px 3px 0 var(--line);
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s, color 0.15s;
}
.atab:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--accent); }
.atab.active { background: var(--accent); color: #fff; box-shadow: 3px 3px 0 var(--ink); }
.articles-tagchips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.atagchip {
  font-family: var(--display); font-weight: 600; font-size: 0.76rem;
  padding: 4px 12px; border-radius: 999px; border: 1.5px solid var(--ink-soft);
  background: #fff; color: var(--ink-soft); cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.atagchip:hover { color: var(--ink); border-color: var(--ink); }
.atagchip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.atagchip-clear { color: var(--accent); border-color: var(--accent); }
.atagchip-clear:hover { background: var(--accent); color: #fff; }

/* 検索 input: タイトル / 概要 / タグを部分一致でフィルタ・タブ/タグと AND 重ねがけ */
.articles-search { width: 100%; }
.articles-search input {
  width: 100%;
  font-family: var(--body); font-size: 0.95rem;
  padding: 9px 16px; border-radius: 999px;
  border: 2px solid var(--ink); background: #fff; color: var(--ink);
  box-shadow: 3px 3px 0 var(--line);
  transition: box-shadow 0.15s, transform 0.15s;
}
.articles-search input:focus {
  outline: none;
  box-shadow: 4px 4px 0 var(--accent);
  transform: translate(-1px, -1px);
}
.articles-search input::placeholder { color: var(--ink-soft); }

/* 「もっと見る」ボタン: 残り件数があれば articles-list 末尾に追加表示・押下で +PAGE_SIZE */
.articles-loadmore { display: flex; justify-content: center; margin-top: 18px; }
.loadmore-btn {
  font-family: var(--display); font-weight: 700; font-size: 0.86rem;
  padding: 10px 22px; border-radius: 999px; border: 2px solid var(--ink);
  background: #fff; color: var(--ink); cursor: pointer;
  box-shadow: 4px 4px 0 var(--line);
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s, color 0.15s;
}
.loadmore-btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--accent); }

/* ===== 10 枚目「もっと見る」カード（index） ===== */
.card-more {
  justify-content: center; align-items: flex-start; border-style: dashed;
  background: linear-gradient(180deg, #fff8ef, var(--card));
}
.card-more .mcluster { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.card-more .mchip {
  width: 34px; height: 34px; border-radius: 10px; border: 2px solid var(--ink);
  box-shadow: 1px 2px 0 var(--ink); display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-weight: 800; font-size: 0.7rem; color: #fff; letter-spacing: -0.02em;
}
.card-more .mcount { font-family: var(--display); font-weight: 800; font-size: 2.1rem; line-height: 1; margin-bottom: 8px; }
.card-more .mcount small { font-size: 0.9rem; margin-left: 6px; color: var(--ink-soft); font-weight: 700; }
.card-more p { font-size: 0.9rem; color: var(--ink-soft); flex: 0; margin-bottom: 16px; }

/* ===== スマホ：作品カードを横スワイプ（scroll-snap）にする =====
 * index の #works-grid のみ対象。works.html の #works-grid-all は通常グリッドのまま。 */
@media (max-width: 560px) {
  #works-grid {
    display: flex; grid-template-columns: none; zoom: 1;
    gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory;
    margin: 0 -18px; padding: 4px 18px 16px; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  #works-grid::-webkit-scrollbar { display: none; }
  #works-grid > .card { flex: 0 0 80%; scroll-snap-align: start; }
}

/* ===== 詳細ページ リッチ表示（tagline / スクショ / 機能 / 使い方 / 記事） ===== */
.detail-tagline { font-family: var(--display); font-weight: 700; font-size: 1.15rem; color: var(--ink); margin: 10px 0 12px; max-width: 640px; line-height: 1.5; }
.dshots { display: grid; grid-template-columns: 1fr; gap: 14px; }
.dshots:has(figure:nth-child(2)) { grid-template-columns: 1fr 1fr; }
.dshot { margin: 0; border: 2px solid var(--ink); border-radius: 16px; overflow: hidden; box-shadow: 4px 5px 0 var(--line); background: #fff; }
.dshot img { display: block; width: 100%; height: auto; }
.dshot figcaption { font-size: 0.82rem; color: var(--ink-soft); padding: 8px 14px; border-top: 1px solid var(--line); }
.dfeats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.dfeat { border: 2px solid var(--ink); border-radius: 16px; padding: 18px 18px; background: var(--card); box-shadow: 4px 5px 0 color-mix(in srgb, var(--c, var(--accent)) 60%, transparent); }
.dfeat-ic { width: 40px; height: 40px; border-radius: 12px; border: 2px solid var(--ink); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; background: color-mix(in srgb, var(--c, var(--accent)) 16%, #fff); margin-bottom: 12px; }
.dfeat h4 { font-family: var(--display); font-weight: 700; font-size: 1.02rem; margin-bottom: 6px; }
.dfeat p { font-size: 0.9rem; color: var(--ink-soft); }
.dcode { background: #241f1a; color: #f4ece1; border: 2px solid var(--ink); border-radius: 14px; padding: 16px 18px; box-shadow: 4px 5px 0 var(--line); font-family: "SFMono-Regular", Consolas, monospace; font-size: 0.9rem; overflow-x: auto; }
.dcode .cline { display: block; white-space: pre; line-height: 1.95; }
.dcode .cline::before { content: "$ "; color: #e2a06a; }
.detail-setup-jump { margin: 14px 0 0; }
.setup-panel { margin: 0 0 8px; }
.setup-block { margin: 0 0 14px; }
.setup-label { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; color: var(--ink-soft); margin: 0 0 8px; }
.setup-cmd {
  display: flex; align-items: stretch; gap: 8px; margin: 0 0 8px;
  background: #241f1a; color: #f4ece1; border: 2px solid var(--ink); border-radius: 14px;
  box-shadow: 4px 5px 0 var(--line); overflow: hidden;
}
.setup-cmd .cline {
  flex: 1 1 auto; min-width: 0; padding: 12px 14px; overflow-x: auto; white-space: pre;
  font-family: "SFMono-Regular", Consolas, monospace; font-size: 0.9rem; line-height: 1.6;
}
.setup-cmd .cline::before { content: "$ "; color: #e2a06a; }
.setup-copy {
  flex: 0 0 auto; min-width: 44px; min-height: 44px; padding: 0 14px;
  border: none; border-left: 2px solid #3a322b; background: #2e2822; color: #f4ece1;
  font-family: var(--display); font-weight: 700; font-size: 0.78rem; letter-spacing: 0.04em;
  cursor: pointer;
}
.setup-copy:hover { background: #3a322b; }
.setup-fallback { color: var(--ink-soft); font-size: 0.96rem; }
.setup-guide { margin: 14px 0 0; }
.dsteps { margin: 16px 0 0; padding: 0; list-style: none; counter-reset: st; }
.dsteps li { counter-increment: st; position: relative; padding: 3px 0 12px 40px; font-size: 0.96rem; color: var(--ink); }
.dsteps li::before { content: counter(st); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--ink); background: var(--c, var(--accent)); color: #fff; font-family: var(--display); font-weight: 800; font-size: 0.85rem; display: flex; align-items: center; justify-content: center; box-shadow: 1px 2px 0 var(--ink); }
.darts { display: flex; flex-direction: column; gap: 10px; }
.dart { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; border: 2px solid var(--ink); border-radius: 14px; padding: 12px 16px; background: var(--card); box-shadow: 3px 4px 0 var(--line); transition: transform 0.16s, box-shadow 0.16s; }
.dart:hover { transform: translate(-2px, -2px); box-shadow: 5px 6px 0 var(--c, var(--accent)); }
.dpf { font-family: var(--display); font-weight: 800; font-size: 0.66rem; letter-spacing: 0.04em; text-transform: uppercase; color: #fff; padding: 3px 9px; border-radius: 8px; border: 2px solid var(--ink); flex-shrink: 0; }
.dpfs { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; }
.dpf-note { background: #41c9b4; } .dpf-zenn { background: #3ea8ff; } .dpf-qiita { background: #55c500; } .dpf-html { background: #7a6f63; }
.dart-t { flex: 1; font-size: 0.95rem; }
.dart-ar { color: var(--ink-soft); }

/* ===== works.html（全作品ページ）ヘッダ ===== */
.works-head { margin-bottom: 30px; }
.works-head h1 { font-family: var(--display); font-weight: 700; font-size: clamp(1.8rem, 4.5vw, 2.6rem); letter-spacing: -0.01em; margin-bottom: 8px; }
.works-head p { color: var(--ink-soft); font-size: 0.98rem; max-width: 640px; }

/* ===== identity strip（トップ） ===== */
.identity-strip {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 16px 24px; margin-bottom: 28px; padding: 18px 20px;
  background: var(--card); border: 2px solid var(--ink); border-radius: 18px;
  box-shadow: 4px 5px 0 color-mix(in srgb, var(--accent) 55%, transparent);
}
.strip-eyebrow {
  font-size: 0.82rem; letter-spacing: 0.06em; font-weight: 700; color: var(--ink-soft);
  margin: 0 0 10px; line-height: 1.5;
}
.strip-badges { margin: 0; }
.strip-pills {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.strip-pill {
  font-family: var(--display); font-weight: 800; font-size: 0.92rem;
  padding: 8px 14px; border-radius: 999px; border: 2px solid var(--ink);
  background: #fff; box-shadow: 2px 2px 0 var(--ink); white-space: nowrap;
}
.strip-pill small { font-size: 0.72rem; font-weight: 700; color: var(--ink-soft); margin-left: 2px; }
.works-swipe-hint {
  display: none; font-size: 0.78rem; font-weight: 700; color: var(--ink-soft);
  margin: -12px 0 14px;
}
.works-foot-cta { margin-top: 22px; margin-bottom: 8px; }

/* ===== works hub mode toggle ===== */
.mode-toggle {
  display: inline-flex; margin: 16px 0 10px; border: 2px solid var(--ink); border-radius: 999px;
  overflow: hidden; background: var(--card); box-shadow: 3px 3px 0 var(--ink);
}
.mode-toggle button {
  font-family: var(--display); font-weight: 700; font-size: 0.9rem;
  min-height: 44px; min-width: 7.5rem; padding: 10px 22px; border: 0;
  background: transparent; color: var(--ink); cursor: pointer;
}
.mode-toggle button.active { background: var(--accent); color: #fff; }
.works-metrics-lead { font-size: 0.9rem; color: var(--ink-soft); margin: 0 0 8px; max-width: 52ch; }
.metrics-totals {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px;
}
.metrics-grid { zoom: 0.7; }
.works-metrics-empty { color: var(--ink-soft); padding: 12px 0; }

@media (max-width: 560px) {
  .identity-strip { flex-direction: column; align-items: stretch; padding: 14px 16px; }
  .strip-pills {
    flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; padding-bottom: 2px; margin: 0 -4px; padding-left: 4px;
  }
  .strip-pills::-webkit-scrollbar { display: none; }
  .works-swipe-hint { display: block; }
  .mode-toggle { display: flex; width: 100%; }
  .mode-toggle button { flex: 1; min-width: 0; }
  .metrics-totals { grid-template-columns: repeat(2, 1fr); }
  .metrics-grid { zoom: 1; }
  .works-head .mode-toggle {
    position: sticky; top: 62px; z-index: 40;
    background: var(--card);
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; animation: none !important; transform: none !important; }
  html { scroll-behavior: auto; }
}

@media (max-width: 600px) {
  .dfeats { grid-template-columns: 1fr; }
  .dshots:has(figure:nth-child(2)) { grid-template-columns: 1fr; }
}
