/* 和紙の地に墨、差し色は藍。ダークでは墨の地 */
:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --ink: #1f1f1f;
  --muted: #5e5c57;
  --line: #dcd8cf;
  --accent: #24476b; /* 藍 */
  --tag-bg: #eceae4;
  --head-font: "Noto Serif JP", serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #171716;
    --surface: #212120;
    --ink: #ecebe7;
    --muted: #a9a69f;
    --line: #34332f;
    --accent: #8fb0d6;
    --tag-bg: #2b2a28;
  }
}


* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Sans JP", system-ui, sans-serif;
  line-height: 1.8;
  font-size: 16px;
}
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

.wrap { position: relative; max-width: 760px; margin: 0 auto; padding: 56px 16px 40px; }

/* 表示言語の出し分け。<html lang> が ja / en を持つ */
html[lang="ja"] [data-l="en"],
html[lang="en"] [data-l="ja"] { display: none; }
html[lang="en"] body { line-height: 1.7; }

/* 右上の JA / EN トグル。押すたびに藍の地が左右へ滑る */
.lang-toggle {
  position: absolute; top: 16px; right: 16px;
  display: inline-grid; grid-template-columns: 1fr 1fr;
  padding: 3px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); cursor: pointer;
  font: 500 12px/1 "Noto Sans JP", system-ui, sans-serif; letter-spacing: 0.08em;
}
.lang-toggle::before {
  content: ""; position: absolute; top: 3px; bottom: 3px; left: 3px;
  width: calc(50% - 3px); border-radius: 999px; background: var(--accent);
  transition: transform 0.22s ease;
}
html[lang="en"] .lang-toggle::before { transform: translateX(100%); }
.lang-toggle .opt { position: relative; padding: 6px 12px; color: var(--muted); transition: color 0.22s ease; }
html[lang="ja"] .lang-toggle [data-for="ja"],
html[lang="en"] .lang-toggle [data-for="en"] { color: var(--bg); }
.lang-toggle:hover { border-color: var(--accent); }
.lang-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .lang-toggle::before, .lang-toggle .opt { transition: none; }
}

.hero { margin-bottom: 56px; }
.role { margin: 0 0 8px; font-size: 14px; letter-spacing: 0.08em; color: var(--muted); }
h1 {
  font-family: var(--head-font);
  font-size: clamp(32px, 7vw, 44px);
  line-height: 1.3;
  margin: 0 0 20px;
  letter-spacing: 0.06em;
}
.lead { margin: 0; font-size: 17px; }

section { margin-bottom: 48px; }
h2 {
  font-family: var(--head-font);
  font-size: 20px;
  margin: 0 0 20px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
h2::after {
  content: "";
  position: absolute; left: 0; bottom: -1px;
  width: 32px; height: 2px; background: var(--accent);
}

.products { display: grid; gap: 16px; }
.product {
  display: flex; gap: 20px; align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
}
.product .icon { width: 72px; height: 72px; border-radius: 16px; flex: none; object-fit: cover; }
.product h3 { margin: 0 0 6px; font-size: 19px; font-family: var(--head-font); }
.product p { margin: 0 0 6px; }
.product p[data-l] { margin-bottom: 12px; }
.tags { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { background: var(--tag-bg); color: var(--muted); font-size: 12px; padding: 2px 10px; border-radius: 999px; }
.links { display: flex; flex-wrap: wrap; gap: 16px; font-weight: 500; }
@media (max-width: 520px) {
  .product { flex-direction: column; gap: 12px; }
  .product .icon { width: 56px; height: 56px; border-radius: 12px; }
}

.skills { margin: 0; display: grid; gap: 10px; }
.skills div { display: grid; grid-template-columns: 9em 1fr; gap: 12px; }
.skills dt { color: var(--muted); font-size: 14px; padding-top: 2px; }
.skills dd { margin: 0; }
@media (max-width: 520px) {
  .skills div { grid-template-columns: 1fr; gap: 0; }
}

.contact { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.contact li { display: grid; grid-template-columns: 6em 1fr; gap: 12px; }
.contact .label { color: var(--muted); font-size: 14px; padding-top: 2px; }
.contact a { overflow-wrap: anywhere; }

.foot { color: var(--muted); font-size: 13px; padding-top: 24px; border-top: 1px solid var(--line); }

/* note の記事カード。横に並べてスクロールで送る（スナップ付き） */
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.sec-head h2 { flex: 1; }
.carousel-nav { display: flex; gap: 8px; margin-bottom: 20px; }
.carousel-nav[hidden] { display: none; }
.nav-btn {
  width: 36px; height: 36px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-size: 20px; line-height: 1; cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.nav-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.nav-btn:disabled { opacity: 0.35; cursor: default; }
.nav-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sec-note { margin: -8px 0 16px; color: var(--muted); font-size: 14px; }

.notes {
  list-style: none; margin: 0 -16px; padding: 4px 16px 12px;
  display: grid; grid-auto-flow: column; grid-auto-columns: min(78%, 300px); gap: 16px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 16px;
  overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.note-card { scroll-snap-align: start; display: flex; }
.note-card.skeleton {
  height: 320px; border-radius: 12px; border: 1px solid var(--line);
  background: linear-gradient(90deg, var(--surface) 0%, var(--tag-bg) 50%, var(--surface) 100%);
  background-size: 200% 100%; animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.note-link {
  display: flex; flex-direction: column; width: 100%;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; color: inherit; text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.note-link:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 6px 18px rgb(0 0 0 / 0.08); }
.note-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.thumb { position: relative; aspect-ratio: 1.91 / 1; background: var(--tag-bg); flex: none; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 見出し画像のない記事は、藍の地に青海波の模様と note の印を置く（題名は下に出るので重ねない） */
.thumb-plain {
  display: flex; align-items: flex-end; padding: 12px 16px;
  background-color: #24476b;
  background-image:
    radial-gradient(circle at 50% 100%, transparent 38%, rgb(255 255 255 / 0.10) 39%, rgb(255 255 255 / 0.10) 44%, transparent 45%,
      transparent 56%, rgb(255 255 255 / 0.10) 57%, rgb(255 255 255 / 0.10) 62%, transparent 63%),
    linear-gradient(135deg, #24476b 0%, #3b6591 100%);
  background-size: 48px 24px, 100% 100%;
}
.thumb-mark {
  color: #f6f4ef; font: 700 13px/1 "Noto Sans JP", system-ui, sans-serif; letter-spacing: 0.08em;
  padding: 4px 10px; border: 1px solid rgb(246 244 239 / 0.5); border-radius: 999px;
}
.paid {
  position: absolute; top: 8px; right: 8px; padding: 1px 10px; border-radius: 999px;
  background: rgb(0 0 0 / 0.6); color: #fff; font-size: 12px;
}
.note-body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.note-body time { color: var(--muted); font-size: 12px; }
.note-body h3 {
  margin: 2px 0 8px; font-size: 15px; line-height: 1.55; font-family: var(--head-font);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.note-link:hover h3 { color: var(--accent); }
.excerpt {
  white-space: pre-line; /* 文末で改行（index.html で 。の後に \n を入れている） */
  margin: 0 0 12px; color: var(--muted); font-size: 13px; line-height: 1.7;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.note-body .tags { margin: auto 0 0; }
.more { margin: 8px 0 0; }
@media (prefers-reduced-motion: reduce) {
  .note-link, .note-card.skeleton { transition: none; animation: none; }
  .note-link:hover { transform: none; }
}
