:root {
  color-scheme: dark;
  --bg: #04050a;
  --card: rgba(9, 11, 20, 0.7);
  --line: rgba(205, 212, 255, 0.14);
  --line-strong: rgba(205, 212, 255, 0.3);
  --text: #e6e8f2;
  --muted: #b0b5ca;
  --faint: #8d93ab;
  --accent: #c9d0ff;
  --glow: rgba(160, 175, 255, 0.35);
  --serif: 'Cormorant Garamond', 'Times New Roman', serif;
  --sans: 'Zen Kaku Gothic New', 'Noto Sans KR', 'Hiragino Sans', 'Yu Gothic', sans-serif;
  --card-h: clamp(600px, calc(100vh - 140px), 700px);
}

* { box-sizing: border-box; }

html {
  scrollbar-gutter: stable;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.85;
  letter-spacing: 0.04em;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

#sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(32px, 8vh, 80px) 16px 32px;
}

/* ---------- カード（全ページ同じ大きさ） ---------- */
.card {
  width: min(960px, 100%);
  height: var(--card-h);
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 0 90px rgba(80, 90, 180, 0.1), 0 30px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.side {
  padding: 36px 28px 28px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  line-height: 1.6;
  /* 画面が低いときだけ中でスクロール（スクロールバーは出さない） */
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
}
.side::-webkit-scrollbar { display: none; }

.panel {
  padding: 44px 44px 40px;
  overflow-y: auto;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(205, 212, 255, 0.25) transparent;
  overscroll-behavior: contain;
}
.panel::-webkit-scrollbar { width: 6px; }
.panel::-webkit-scrollbar-thumb { background: rgba(205, 212, 255, 0.22); border-radius: 3px; }

/* ---------- サイン ---------- */
.logo {
  position: relative;
  display: grid;
  place-items: center;
  width: 196px;
  height: 116px;
  flex: none;
}
.logo-sign {
  position: relative;
  width: 172px;
  height: auto;
  filter: invert(1) drop-shadow(0 0 6px rgba(170, 185, 255, 0.45));
}
.logo-orbit {
  position: absolute;
  inset: 22px 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  transform: rotate(-12deg);
}
.logo-orbit::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  margin: -2px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 8px 2px var(--glow);
  offset-path: ellipse(98px 36px at 50% 50%);
  animation: orbit 14s linear infinite;
}
@supports not (offset-path: ellipse(1px 1px)) {
  .logo-orbit::after { display: none; }
}
@keyframes orbit {
  from { offset-distance: 0%; }
  to   { offset-distance: 100%; }
}

.role {
  margin: 8px 0 0;
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 0.08em;
  color: var(--muted);
  line-height: 1.5;
}

.status {
  margin: 14px 0 0;
  padding: 0 14px;
  height: 24px;
  line-height: 22px;
  font-size: 12px;
  white-space: nowrap;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
}
.status::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  vertical-align: 2px;
  background: currentColor;
}
.status[data-s='open']   { color: #bdeed5; }
.status[data-s='few']    { color: #f0e2b0; }
.status[data-s='closed'] { color: var(--muted); }

/* ---------- メニュー ---------- */
.nav {
  margin-top: 22px;
  width: 100%;
  display: flex;
  flex-direction: column;
}
.nav a {
  position: relative;
  display: block;
  padding: 5px 0;
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: 0.12em;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.3s;
}
.nav a:hover { color: var(--text); }
.nav a[aria-current='page'] {
  color: #fff;
  text-shadow: 0 0 12px var(--glow);
}
.nav a::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 0;
  height: 1px;
  background: var(--accent);
  transform: translateX(-50%);
  transition: width 0.4s;
  opacity: 0.7;
}
.nav a[aria-current='page']::after { width: 26px; }

.links {
  list-style: none;
  margin: 20px 0 0;
  padding: 18px 0 0;
  width: 100%;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.links a {
  display: inline-block;
  padding: 3px 11px;
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.3s, border-color 0.3s;
}
.links a:hover { color: var(--text); border-color: var(--line-strong); }

.lang {
  margin-top: auto;
  padding-top: 18px;
  display: flex;
  gap: 4px;
}
.lang button {
  padding: 2px 10px;
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 0.12em;
  color: var(--faint);
  background: none;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.3s, border-color 0.3s;
}
.lang button:hover { color: var(--text); }
.lang button[aria-pressed='true'] {
  color: #fff;
  border-color: var(--line-strong);
}

/* ---------- ページ共通 ---------- */
.page[hidden] { display: none; }
.block + .block { margin-top: 30px; }

.h {
  margin: 0 0 14px;
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-weight: 400;
}
.h span {
  font-family: var(--serif);
  font-size: 28px;
  letter-spacing: 0.1em;
  color: #f3f4fb;
  white-space: nowrap;
}
.h em {
  font-style: normal;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
.h::after {
  content: '';
  flex: 1;
  height: 1px;
  align-self: center;
  background: linear-gradient(to right, var(--line-strong), transparent);
}

.h3 {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.08em;
}

.lead { margin: 0; color: var(--muted); }

.dots {
  list-style: none;
  margin: 0;
  padding: 0;
}
.dots li {
  position: relative;
  padding-left: 18px;
}
.dots li::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 0.85em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--glow);
}
.dots.small { font-size: 13px; color: var(--muted); }

.news {
  list-style: none;
  margin: 0;
  padding: 0;
}
.news li {
  display: flex;
  gap: 18px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}
.news time {
  flex: none;
  font-family: var(--serif);
  font-size: 15px;
  color: var(--muted);
}

.btn {
  display: inline-block;
  padding: 10px 32px;
  font: inherit;
  font-size: 14px;
  letter-spacing: 0.12em;
  color: var(--text);
  background: rgba(195, 203, 255, 0.05);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.3s, box-shadow 0.3s, border-color 0.3s, opacity 0.3s;
}
.btn:hover:not(:disabled) {
  background: rgba(195, 203, 255, 0.12);
  border-color: rgba(205, 212, 255, 0.5);
  box-shadow: 0 0 20px rgba(160, 175, 255, 0.18);
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- ポートフォリオ ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.work {
  position: relative;
  aspect-ratio: 3 / 4;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  cursor: zoom-in;
  background: #0b0d18;
  color: inherit;
  font: inherit;
}
.work img,
.work .ph {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s;
}
.work:hover img,
.work:hover .ph { transform: scale(1.04); }
.work-cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 22px 12px 10px;
  font-size: 13px;
  text-align: left;
  line-height: 1.5;
  background: linear-gradient(to top, rgba(4, 5, 10, 0.9), transparent);
}
.work-cap small { display: block; color: var(--muted); font-size: 11px; }

/* 画像が未設定のときのダミー */
.ph {
  background:
    radial-gradient(circle at var(--x, 30%) var(--y, 35%), rgba(150, 160, 255, 0.24), transparent 55%),
    radial-gradient(circle at 75% 80%, rgba(200, 140, 255, 0.13), transparent 50%),
    #0a0c16;
}
.work .ph::after {
  content: 'No Image';
  position: absolute;
  top: 40%;
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.2em;
  color: var(--faint);
}

/* ---------- 料金表 ---------- */
.price { margin: 0; }
.price-row {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.price-row:first-child { border-top: 1px solid var(--line); }
.price dd {
  margin: 0;
  font-family: var(--serif);
  font-size: 20px;
  color: #f3f4fb;
  text-align: right;
}
.price .note {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

/* ---------- お迎えいただいた方々 ---------- */
.clients {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px 16px;
}
.client {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.avatar {
  position: relative;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  box-shadow: 0 0 24px rgba(140, 155, 255, 0.12);
  display: grid;
  place-items: center;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.ph span {
  font-family: var(--serif);
  font-size: 30px;
  color: var(--muted);
}
.client-name {
  margin: 10px 0 8px;
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.client-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
}
.client-links a {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  transition: color 0.3s, border-color 0.3s, background 0.3s, box-shadow 0.3s;
}
.client-links svg { width: 15px; height: 15px; fill: currentColor; }
.client-links a:hover {
  color: #fff;
  border-color: rgba(205, 212, 255, 0.55);
  background: rgba(195, 203, 255, 0.08);
  box-shadow: 0 0 14px rgba(160, 175, 255, 0.2);
}
.clients .empty { grid-column: 1 / -1; color: var(--muted); font-size: 13px; }
.clients.swap { animation: rise 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) both; }

/* お迎えいただいた方々 / 魂募集中 の切り替え */
.switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.switch-btn {
  padding: 4px 16px;
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.3s, border-color 0.3s, background 0.3s;
}
.switch-btn:hover { color: var(--text); }
.switch-btn[aria-selected='true'] {
  color: #fff;
  border-color: rgba(201, 208, 255, 0.5);
  background: rgba(195, 203, 255, 0.08);
}

/* ---------- 作品のスライドショー ---------- */
.slides-wrap, .slides { position: absolute; inset: 0; }
.slides img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.2s ease, transform 0.6s;
}
.slides img.on { opacity: 1; }
.work:hover .slides img { transform: scale(1.04); }
.dots-ind {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 4px;
  z-index: 1;
}
.dots-ind i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transition: background 0.4s, box-shadow 0.4s;
}
.dots-ind i.on { background: #fff; box-shadow: 0 0 6px var(--glow); }

/* ---------- 料金表の参考画像 ---------- */
.price-refs {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.price-ref {
  position: relative;
  width: 76px;
  aspect-ratio: 1;
  padding: 0;
  overflow: hidden;
  background: #0b0d18;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: zoom-in;
  transition: border-color 0.3s;
}
.price-ref:hover { border-color: var(--line-strong); }
.price-ref img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- お問い合わせ ---------- */
.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  font-size: 13px;
  color: var(--muted);
}
.req {
  font-weight: 400;
  font-size: 10px;
  padding: 0 7px;
  line-height: 1.7;
  color: #ffc9d6;
  border: 1px solid rgba(255, 170, 190, 0.45);
  border-radius: 999px;
}
.form input:not([type='radio']),
.form select,
.form textarea {
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: rgba(4, 5, 10, 0.6);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 12px;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.form select {
  appearance: none;
  cursor: pointer;
  padding-right: 34px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.form select:invalid { color: var(--faint); }
.form select option { background: #0b0d18; color: var(--text); }
.form textarea { resize: vertical; min-height: 120px; }
.form input:focus,
.form select:focus,
.form textarea:focus {
  outline: none;
  border-color: rgba(205, 212, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(160, 175, 255, 0.12);
}
.form [aria-invalid='true'] { border-color: rgba(255, 150, 170, 0.65) !important; }
.form ::placeholder { color: var(--faint); }

.radios { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.radio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.radio input {
  appearance: none;
  margin: 0;
  width: 16px;
  height: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.radio input::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--glow);
  transform: scale(0);
  transition: transform 0.2s;
}
.radio input:checked::after { transform: scale(1); }
.radio input:focus-visible { outline: 2px solid rgba(160, 175, 255, 0.5); outline-offset: 2px; }

.form .btn { align-self: flex-start; }
.form-msg {
  margin: 0;
  min-height: 1.85em;
  font-size: 13px;
  color: var(--muted);
}
.form-msg.ok { color: var(--accent); }
.form-msg.err { color: #ffbccb; }
.lead.mail { margin-top: 10px; }
.mail a { color: var(--accent); font-size: 15px; }

.foot {
  margin-top: 18px;
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.2em;
  color: var(--faint);
}

/* ---------- 拡大表示 ---------- */
.viewer {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: rgba(2, 3, 8, 0.9);
  animation: fade 0.35s ease;
}
.viewer[hidden] { display: none; }
.viewer figure { margin: 0; text-align: center; }
.viewer-img img,
.viewer-img .ph {
  display: block;
  max-width: min(760px, 92vw);
  max-height: 78vh;
  border-radius: 8px;
}
.viewer-img .ph {
  position: relative;
  width: min(440px, 80vw);
  aspect-ratio: 3 / 4;
}
.viewer figcaption {
  max-width: min(640px, 92vw);
  margin: 12px auto 0;
  font-size: 14px;
  color: var(--muted);
}
.viewer-count { margin-left: 12px; font-family: var(--serif); color: var(--faint); }
.viewer-desc {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--text);
  white-space: pre-wrap;
}
.viewer-desc:empty { display: none; }
.viewer-stage { display: flex; align-items: center; justify-content: center; gap: 12px; }
.viewer-nav {
  flex: none;
  width: 40px;
  height: 40px;
  padding: 0 0 4px;
  font-size: 26px;
  line-height: 1;
  color: var(--muted);
  background: rgba(9, 11, 20, 0.6);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  cursor: pointer;
  transition: color 0.3s, border-color 0.3s;
}
.viewer-nav:hover { color: #fff; border-color: rgba(205, 212, 255, 0.55); }
.viewer-nav[hidden] { visibility: hidden; display: block; }
.viewer-close {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 4px 16px;
  font: inherit;
  font-size: 13px;
  color: var(--muted);
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  cursor: pointer;
}
.viewer-close:hover { color: var(--text); }

/* ---------- フェードイン ---------- */
.fx { opacity: 0; }
.fx.in {
  animation: rise 0.9s cubic-bezier(0.22, 0.61, 0.36, 1) both;
  animation-delay: calc(var(--i, 0) * 90ms);
}
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); filter: blur(3px); }
  to   { opacity: 1; transform: none; filter: none; }
}
@keyframes fade { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .fx.in { animation-duration: 0.01s; animation-delay: 0s; }
  .logo-orbit::after { animation: none; }
}

/* ---------- スマホ ---------- */
@media (max-width: 720px) {
  body { font-size: 14px; }
  .wrap { padding: 20px 16px 24px; }
  .card {
    height: auto;
    grid-template-columns: minmax(0, 1fr);
  }
  .side {
    padding: 22px 18px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow: visible;
  }
  .nav {
    margin-top: 14px;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0 16px;
  }
  .nav a { font-size: 17px; }
  .links { margin-top: 12px; padding-top: 12px; }
  /* リンクは3つずつ並べる（5つなら 3：2） */
  .links li { flex: 0 0 calc((100% - 16px) / 3); }
  .links a { display: block; padding: 4px 4px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .viewer-stage { gap: 6px; }
  .viewer-nav { width: 34px; height: 34px; font-size: 22px; }
  .viewer-img img, .viewer-img .ph { max-width: calc(100vw - 112px); }
  .price-ref { width: 64px; }
  .lang { margin-top: 0; padding-top: 12px; }
  /* 内容部分は画面の高さに合わせた共通サイズ。はみ出す分は中でスクロール */
  .panel {
    height: calc(100svh - 40px);
    padding: 26px 18px 28px;
  }
  .h span { font-size: 24px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .clients { gap: 22px 10px; }
  .avatar { width: 76px; height: 76px; }
  .client-name { font-size: 13px; }
  .client-links a { font-size: 11px; padding: 2px 4px; }
}
