/* ═══════════════════════════════════════════════
   SHIZEN — 自然は、コードで描ける。
   シリーズ6作をまとめるハブ。深い夜の緑×生成りの紙
   ═══════════════════════════════════════════════ */

:root {
  --ink:    #070a09;
  --paper:  #e9efe6;
  --fog:    #93a396;
  --moss:   #496047;
  --gold:   #c9b06a;
  --line:   rgba(233, 239, 230, 0.14);

  --font-display: "Shippori Mincho B1", serif;
  --font-latin:   "Cormorant Garamond", serif;
  --font-body:    "Zen Kaku Gothic New", sans-serif;
  --font-mono:    "IBM Plex Mono", monospace;

  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.45, 0, 0.15, 1);
  --pad: clamp(22px, 5vw, 72px);
}

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

body {
  background:
    radial-gradient(110% 70% at 85% -10%, rgba(73, 96, 71, 0.25), transparent 55%),
    var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 2;
  letter-spacing: 0.06em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--gold); color: var(--ink); }

.mono {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--fog);
}

.grain {
  position: fixed; inset: -60%;
  z-index: 5; pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ═══════════ ローダー ═══════════ */
.loader {
  position: fixed; inset: 0; z-index: 100;
  background: var(--ink);
  display: grid; place-items: center;
  transition: opacity 0.8s var(--ease-soft) 0.2s, visibility 0s 1.05s;
}
body.is-loaded .loader { opacity: 0; visibility: hidden; }
.loader__kanji {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(46px, 8vw, 90px);
  letter-spacing: 0.35em; text-indent: 0.35em;
  opacity: 0.9;
}

/* ═══════════ ヘッダー ═══════════ */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: clamp(16px, 2.6vw, 26px) var(--pad);
  background: linear-gradient(180deg, rgba(7, 10, 9, 0.85), rgba(7, 10, 9, 0));
}
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand__seal {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px;
  background: var(--moss); color: var(--paper);
  font-family: var(--font-display);
  font-size: 17px;
  border-radius: 7px;
}
.brand__name {
  font-family: var(--font-latin);
  font-weight: 500; font-size: 18px; letter-spacing: 0.42em;
}
.share {
  color: var(--paper); text-decoration: none;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 18px;
  transition: border-color 0.3s, background 0.3s, color 0.3s;
}
.share:hover { border-color: var(--gold); background: rgba(201, 176, 106, 0.1); color: var(--gold); }

.header__right { display: flex; align-items: center; gap: clamp(10px, 1.6vw, 18px); }

/* 言語スイッチャー */
.lang {
  display: flex; align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.lang button {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--fog);
  background: transparent;
  border: 0;
  border-radius: 999px;
  min-width: 30px;
  padding: 5px 8px;
  cursor: pointer;
  transition: color 0.25s, background 0.25s;
}
.lang button:hover { color: var(--paper); }
.lang button.is-on { color: var(--ink); background: var(--gold); }

/* 韓国語・中国語のフォント差し替え（選択時にJSがロード） */
body[data-lang="ko"] {
  --font-display: "Noto Serif KR", serif;
  --font-body: "Noto Sans KR", sans-serif;
}
body[data-lang="zh"] {
  --font-display: "Noto Serif SC", serif;
  --font-body: "Noto Sans SC", sans-serif;
}
body[data-lang="en"] .hero__title { letter-spacing: 0.01em; }

/* ═══════════ HERO ═══════════ */
.stage { position: relative; z-index: 2; }

.hero {
  min-height: 72svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 140px var(--pad) 40px;
}
.hero__eyebrow { margin-bottom: clamp(16px, 2.6vw, 30px); }
.hero__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(40px, 7.4vw, 104px);
  line-height: 1.28;
  letter-spacing: 0.05em;
}
.hero__line { display: block; overflow: hidden; }
.hero__line--indent { padding-left: clamp(24px, 6vw, 110px); }
.hero__line-inner {
  display: inline-block;
  transform: translateY(115%) rotate(1.2deg);
  transition: transform 1.2s var(--ease-out);
}
body.is-loaded .hero__line:nth-child(1) .hero__line-inner { transition-delay: 0.35s; transform: none; }
body.is-loaded .hero__line:nth-child(2) .hero__line-inner { transition-delay: 0.5s; transform: none; }
.hero__lead {
  margin-top: clamp(24px, 3.4vw, 40px);
  color: var(--fog);
  font-size: clamp(13px, 1.4vw, 15px);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1s var(--ease-out) 0.85s, transform 1s var(--ease-out) 0.85s;
}
body.is-loaded .hero__lead { opacity: 1; transform: none; }

/* ═══════════ 作品カード ═══════════
   「眠っている世界が、触れると目を覚ます」
   休止時: 減光したcanvas＋輪郭だけの漢字
   ホバー: 覚醒（増光・モチーフがカーソルに反応・漢字が金に満ちる） */
.works {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(14px, 1.6vw, 24px);
  padding: clamp(30px, 5vw, 60px) var(--pad);
  perspective: 1400px;
}
@media (max-width: 1200px) {
  .works { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .works { grid-template-columns: 1fr; }
}

.work a {
  --mx: 50%;
  --my: 50%;
  display: block;
  height: 100%;
  text-decoration: none;
  color: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(10, 14, 12, 0.6);
  position: relative;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: border-color 0.5s, box-shadow 0.6s;
  will-change: transform;
}
.work a:hover {
  border-color: rgba(201, 176, 106, 0.55);
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.55),
    0 4px 30px rgba(201, 176, 106, 0.12);
}
/* 上辺を走る金の線 */
.work a::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 6;
  background: linear-gradient(90deg, transparent, var(--gold) 35%, var(--gold) 65%, transparent);
  transform: scaleX(0);
  transition: transform 0.7s var(--ease-out);
  pointer-events: none;
}
.work a:hover::after { transform: scaleX(1); }

.work__visual {
  height: clamp(160px, 14vw, 230px);
  position: relative;
  overflow: hidden;
}
@media (max-width: 1200px) {
  .work__visual { height: clamp(190px, 24vw, 300px); }
}
.work__visual canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  filter: brightness(0.8) saturate(0.88);
  transform: scale(1.02);
  transition: filter 0.7s var(--ease-soft), transform 1s var(--ease-out);
}
.work a:hover .work__visual canvas {
  filter: none;
  transform: scale(1.055);
}
.work__visual--paper { background: #f4f0e5; }
/* 漢字・番号を読ませる薄い縁のグラデ */
.work__visual::before {
  content: "";
  position: absolute; inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(7, 10, 9, 0.22), transparent 32%, transparent 60%, rgba(7, 10, 9, 0.42));
  pointer-events: none;
  transition: opacity 0.6s;
}
.work a:hover .work__visual::before { opacity: 0.55; }
.work__visual--paper::before {
  background: linear-gradient(180deg, rgba(214, 205, 183, 0.24), transparent 34%, transparent 66%, rgba(197, 186, 160, 0.3));
}

/* 通し番号 */
.work__no {
  position: absolute;
  top: 16px; left: 18px;
  z-index: 2;
  font-size: 10px;
  color: rgba(233, 239, 230, 0.62);
  transition: color 0.5s;
}
.work__no::after {
  content: " / 08";
  opacity: 0.45;
}
.work a:hover .work__no { color: var(--gold); }
.work__visual--paper .work__no { color: rgba(30, 28, 26, 0.55); }

/* 巨大漢字の透かし: 輪郭のみ → ホバーで金に満ちて浮かぶ */
.work__kanji {
  position: absolute;
  right: 12px; bottom: -4px;
  z-index: 2;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(64px, 6.2vw, 100px);
  line-height: 1;
  color: rgba(201, 176, 106, 0);
  -webkit-text-stroke: 1px rgba(233, 239, 230, 0.34);
  opacity: 0.8;
  pointer-events: none;
  user-select: none;
  transform: translateY(6px);
  transition:
    color 0.6s var(--ease-soft),
    -webkit-text-stroke-color 0.6s var(--ease-soft),
    opacity 0.6s,
    transform 0.9s var(--ease-out);
}
.work a:hover .work__kanji {
  color: rgba(201, 176, 106, 0.9);
  -webkit-text-stroke-color: rgba(201, 176, 106, 0.1);
  opacity: 1;
  transform: translateY(-6px);
}
.work__visual--paper .work__kanji { -webkit-text-stroke-color: rgba(30, 28, 26, 0.4); }
.work a:hover .work__visual--paper .work__kanji {
  color: rgba(48, 42, 36, 0.82);
  -webkit-text-stroke-color: rgba(48, 42, 36, 0.1);
}

/* カーソルを追う光沢 */
.work__shine {
  position: absolute; inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(340px circle at var(--mx) var(--my), rgba(233, 239, 230, 0.11), transparent 62%);
  transition: opacity 0.45s;
}
.work a:hover .work__shine { opacity: 1; }

.work__meta {
  padding: clamp(16px, 1.6vw, 22px) clamp(16px, 1.6vw, 22px) clamp(18px, 1.8vw, 24px);
}
.work__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  margin-bottom: 7px;
}
.work__name {
  font-family: var(--font-latin);
  font-weight: 500;
  font-size: clamp(20px, 1.6vw, 24px);
  letter-spacing: 0.13em;
}
.work__name span {
  font-family: var(--font-display);
  font-size: 0.58em;
  color: var(--fog);
  margin-left: 10px;
  letter-spacing: 0.3em;
}
.work__cta {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  font-size: 9.5px;
  letter-spacing: 0.2em;
  color: var(--gold);
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.45s, transform 0.5s var(--ease-out);
}
.work__cta-arrow {
  display: inline-block;
  margin-left: 2px;
  animation: cta-nudge 1.3s var(--ease-soft) infinite;
  animation-play-state: paused;
}
.work a:hover .work__cta { opacity: 1; transform: none; }
.work a:hover .work__cta-arrow { animation-play-state: running; }
@keyframes cta-nudge {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(5px); }
}
.work__desc {
  color: var(--fog);
  font-size: 12.5px;
  line-height: 1.9;
  margin-bottom: 9px;
  transition: color 0.5s;
}
.work a:hover .work__desc { color: #b7c4b9; }
.work__tech { font-size: 9.5px; color: rgba(201, 176, 106, 0.75); }

/* タッチ端末: CTAは常時表示・canvasは減光しない */
@media (hover: none) {
  .work__visual canvas { filter: none; }
  .work__cta { opacity: 0.9; transform: none; }
  .work__kanji { color: rgba(201, 176, 106, 0.25); }
}

/* ═══════════ ABOUT ═══════════ */
.about {
  padding: clamp(50px, 8vw, 110px) var(--pad) clamp(70px, 10vw, 130px);
  text-align: center;
}
.section-label { margin-bottom: 26px; }
.about__text {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(15px, 2vw, 21px);
  line-height: 2.4;
}

/* ═══════════ フッター ═══════════ */
.site-footer {
  position: relative; z-index: 2;
  display: flex; flex-wrap: wrap; gap: 10px;
  align-items: center; justify-content: space-between;
  padding: 24px var(--pad) 30px;
  border-top: 1px solid var(--line);
}

/* ═══════════ リビール ═══════════ */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 1s var(--ease-out), transform 1s var(--ease-out);
}
.reveal.is-in { opacity: 1; transform: none; }
.works .work:nth-child(even).reveal { transition-delay: 0.08s; }

@media (max-width: 640px) {
  .hero { min-height: 58svh; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .hero__line-inner, .hero__lead { transition: none; opacity: 1; transform: none; }
}
