/* 和のトーン（docs/design.md）。インラインの style は使わず、すべてここに書く（docs/security.md の 1）。 */
:root {
  --ai: #23466e;        /* ベロ藍（北斎） */
  --ai-deep: #16304d;
  --shu: #c8402e;       /* 朱（落款） */
  --kin: #b8863b;       /* 金茶（すやり霞） */
  --wakatake: #5b8c5a;  /* 若竹（若冲の緑） */
  --gofun: #f4eee1;     /* 胡粉の地 */
  --kami: #fbf8f1;
  --sumi: #1d1b18;      /* 墨 */
  --usuzumi: #5c5750;
  --line: 2px solid var(--sumi); /* 浮世絵の輪郭線 */
  --mincho: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", serif;
  --gothic: "Hiragino Sans", "Yu Gothic", "YuGothic", "Noto Sans JP", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--gofun);
  color: var(--sumi);
  font-family: var(--gothic);
  line-height: 1.8;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--ai); text-underline-offset: .2em; }
a:focus-visible, .emaki:focus-visible { outline: 3px solid var(--shu); outline-offset: 3px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--kami); padding: 4px 8px; z-index: 10; }

/* ヘッダー */
.site-header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px;
  padding: 12px clamp(16px, 4vw, 48px);
  border-bottom: var(--line);
  background: var(--kami);
}
.site-name { font-family: var(--mincho); font-size: 1.25rem; font-weight: 700; color: var(--sumi); text-decoration: none; }
.site-header nav { display: flex; gap: 20px; }
.site-header nav a { color: var(--sumi); text-decoration: none; font-family: var(--mincho); }
.site-header nav a:hover { color: var(--shu); }

/* 一枚目: 縦書きの題と、北斎の藍の波（青海波） */
.hero {
  position: relative;
  min-height: min(64vh, 600px);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 24px;
  padding: clamp(32px, 6vw, 72px) clamp(16px, 6vw, 96px) 160px;
  overflow: hidden;
}
.hero-title {
  grid-column: 2; grid-row: 1 / span 2;
  writing-mode: vertical-rl;
  margin: 0;
  font-family: var(--mincho);
  font-size: clamp(2rem, 6vw, 3.6rem);
  letter-spacing: .25em;
}
/* 題箋（タイトルの短冊） */
.hero-title span {
  display: inline-block;
  padding: .6em .35em;
  background: var(--kami);
  border: var(--line);
  box-shadow: 6px 6px 0 var(--ai);
}
.hero-lead {
  grid-column: 1; grid-row: 1 / span 2;
  align-self: end;
  max-width: 22em;
  margin: 0;
  font-family: var(--mincho);
  font-size: clamp(1.1rem, 2.6vw, 1.6rem);
}
.hero-wave {
  position: absolute; left: 0; right: 0; bottom: 0; height: 140px;
  background: url("/assets/seigaiha.svg") repeat-x 0 0 / 80px 40px, var(--ai);
  background-repeat: repeat;
  border-top: var(--line);
  animation: nami 40s linear infinite;
}
@keyframes nami { to { background-position: 800px 0, 0 0; } }

/* すやり霞: 節を区切る金の帯 */
.kasumi {
  height: 60px;
  background: url("/assets/kasumi.svg") no-repeat center / 100% 100%;
}

/* 節 */
.section { padding: clamp(32px, 6vw, 72px) clamp(16px, 6vw, 96px); }
.daisen {
  display: inline-block;
  margin: 0 0 24px;
  padding: .2em .8em;
  font-family: var(--mincho);
  font-size: clamp(1.4rem, 3.2vw, 2rem);
  background: var(--kami);
  border: var(--line);
  border-left: 8px solid var(--shu);
}

/* 作品: 横に流れる絵巻（CSS の scroll-snap だけ。JS は使わない） */
.emaki {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 340px);
  gap: 24px;
  margin: 0; padding: 8px 4px 20px;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
}
.card {
  scroll-snap-align: start;
  display: flex; flex-direction: column; justify-content: space-between;
  background: var(--kami);
  border: var(--line);
  box-shadow: 6px 6px 0 var(--wakatake);
}
.card a { display: block; padding: 20px 20px 8px; color: inherit; text-decoration: none; }
.card a:hover h3 { color: var(--shu); }
.card h3 { margin: 4px 0 8px; font-family: var(--mincho); font-size: 1.3rem; }
.card p { margin: 0; color: var(--usuzumi); }
.card-kind { margin: 0; font-size: .85rem; color: var(--ai); letter-spacing: .1em; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 12px 20px 20px; list-style: none; }
.tags li { padding: 0 .6em; font-size: .8rem; border: 1px solid var(--usuzumi); border-radius: 2px; }

/* 自己紹介・依頼 */
.about p, .contact p { max-width: 40em; }
.about-name { font-family: var(--mincho); font-size: 1.3rem; }
.button {
  display: inline-block; padding: .6em 1.4em;
  background: var(--shu); color: var(--kami);
  border: var(--line); text-decoration: none; font-weight: 700;
  box-shadow: 4px 4px 0 var(--sumi);
}
.button:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--sumi); }

/* 作品のページ */
.work { max-width: 52em; }
.work h2 { font-family: var(--mincho); margin-top: 2em; border-bottom: 1px solid var(--kin); }
.work .tags { padding: 0; }
.work-summary { font-size: 1.1rem; }

/* 404 */
.not-found { min-height: 50vh; }

/* 落款のあるフッター */
.site-footer {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 32px 16px;
  border-top: var(--line);
  background: var(--kami);
}
.rakkan {
  display: inline-grid; place-items: center;
  width: 2.2em; height: 2.2em;
  background: var(--shu); color: var(--kami);
  font-family: var(--mincho); font-weight: 700;
  border-radius: 3px;
}

/* 画面に入ったら現れる（JS が動くときだけ隠す。動かなければ最初から見える） */
.js-reveal .reveal { opacity: 0; transform: translateY(16px); transition: opacity .8s ease, transform .8s ease; }
.js-reveal .reveal.is-shown { opacity: 1; transform: none; }

/* スマホ: 題を上に、文を下に */
@media (max-width: 600px) {
  .hero { grid-template-columns: 1fr; padding-bottom: 120px; }
  .hero-title { grid-column: 1; grid-row: 1; justify-self: end; }
  .hero-lead { grid-row: 2; }
  .hero-wave { height: 100px; }
  .emaki { grid-auto-columns: 82%; }
}

/* 動きを減らす設定では、波も現れる演出も止める */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-wave { animation: none; }
  .js-reveal .reveal { opacity: 1; transform: none; transition: none; }
  .button:hover { transform: none; }
}

/* 言語の切り替え */
.site-header .lang-switch { padding-left: 16px; border-left: 1px solid var(--usuzumi); font-family: var(--gothic); font-size: .9rem; }
