/* リンクページ（デモ版） */
:root {
  --ink: #605340;
  --ink-soft: #7a6c58;
  --glass: rgba(255, 255, 255, 0.85);
  --glass-strong: #ffffff;
  --glass-line: #ffffff;
  --shadow: 0 8px 24px -16px rgba(96, 83, 64, 0.35);
  --accent: #605340;
  --sky: #e8d9d9;
  --glow: linear-gradient(transparent, transparent);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  font-family: var(--font, "Zen Maru Gothic", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif);
  font-size: 16px;
  line-height: 1.7;
  background: #e8d9d9;
  overflow-x: hidden;
}

.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--glow), var(--sky);
  transition: background 0.4s ease, opacity 0.3s ease;
  opacity: 0;
}
.is-ready .sky, .is-preview .sky { opacity: 1; }

.hero { width: 100%; max-width: 480px; margin: 0 auto; }
.hero img { display: block; width: 100%; height: auto; }
.has-hero .page { padding-top: 0; }

/* ヘッダー画像があるとき：アイコンが画像にかかり、名前〜肩書きは帯の上に載る */
.has-hero .profile {
  margin: 0 -20px;
  padding: 0 20px 30px;
  background: var(--band-bg, #fff);
  color: var(--band-ink, var(--ink));
}
.has-hero .avatar { position: relative; z-index: 2; margin-top: -56px; padding: 2px; background: var(--band-bg, #fff); box-shadow: 0 8px 22px -10px rgba(31, 45, 52, 0.45); }
.has-hero .name, .has-hero .title, .has-hero .bio { color: var(--band-ink, var(--ink)); }
.has-hero .blocks { margin-top: 28px; }

.page {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: calc(48px + env(safe-area-inset-top)) 20px calc(40px + env(safe-area-inset-bottom));
}

/* プロフィール */
.profile { text-align: center; }

.avatar {
  width: 112px;
  height: 112px;
  margin: 0 auto 18px;
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(135deg, #ffffff, rgba(255, 255, 255, 0.4));
  box-shadow: var(--shadow);
}
.avatar img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.logo { margin: -4px 0 10px; }
.logo img { display: block; max-width: 100%; height: auto; margin: 0 auto; }

.name {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.title {
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.bio {
  margin: 16px auto 0;
  max-width: 34em;
  font-size: 14px;
  line-height: 1.95;
  white-space: pre-line;
}

.socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.social {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  color: var(--btn-ink, var(--ink));
  background: var(--glass);
  border: 1px solid var(--glass-line);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: transform 0.2s ease, background 0.2s ease;
}
.social svg { width: 21px; height: 21px; }

/* ブロック */
.blocks {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 36px;
}

.blocks > * {
  opacity: 0;
  transform: translateY(10px);
}
.is-ready .blocks > * {
  animation: rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
  animation-delay: calc(var(--i, 0) * 60ms);
}
.is-preview .blocks > * { animation-duration: 0s; animation-delay: 0s; }

@keyframes rise { to { opacity: 1; transform: none; } }

.block-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 18px 0 2px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.24em;
  color: var(--ink);
}
.block-heading::before,
.block-heading::after {
  content: "";
  flex: 1;
  height: 1px;
  background: currentColor;
  opacity: 0.25;
}
.blocks > .block-heading:first-child { margin-top: 0; }

.block-text {
  margin: 0;
  padding: 0 6px;
  font-size: 14px;
  line-height: 1.95;
  text-align: center;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.block-text.has-bg {
  padding: 16px 18px;
  border-radius: 20px;
  color: var(--btn-ink, var(--ink));
  background: var(--glass);
  border: 1px solid var(--glass-line);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.block-text.custom-bg { border-color: transparent; }

.block-link,
.block-card {
  position: relative;
  display: flex;
  color: var(--btn-ink, var(--ink));
  text-decoration: none;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.block-link {
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 12px 44px 12px 16px;
  border-radius: 20px;
}

.link-thumb {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  object-fit: cover;
}

.link-label {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 0;
}
.block-link:has(.link-thumb) .link-label { align-items: flex-start; text-align: left; }
.block-link:not(:has(.link-thumb)) { padding-left: 44px; }

.link-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.link-desc {
  font-size: 12.5px;
  color: var(--btn-ink-soft, var(--ink-soft));
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.link-arrow {
  position: absolute;
  right: 14px;
  top: 50%;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-top: -12px;
  color: var(--btn-ink, var(--accent));
}
.link-arrow svg { width: 18px; height: 18px; }

.block-card {
  flex-direction: column;
  overflow: hidden;
  border-radius: 22px;
}
.card-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.card-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 18px 16px;
}
.card-title { font-size: 16px; font-weight: 700; letter-spacing: 0.04em; overflow-wrap: anywhere; }
.card-desc { font-size: 13px; color: var(--btn-ink-soft, var(--ink-soft)); line-height: 1.75; white-space: pre-line; overflow-wrap: anywhere; }

.block-image {
  display: block;
  overflow: hidden;
  border-radius: 20px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
}
.block-image img { display: block; width: 100%; height: auto; }

.is-static { cursor: default; }

@media (hover: hover) {
  a.social:hover,
  a.block-link:hover,
  a.block-card:hover,
  a.block-image:hover {
    transform: translateY(-2px);
    background: var(--glass-strong);
  }
}
a.block-link:active,
a.block-card:active,
a.social:active { transform: scale(0.98); }

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}


/* プロフィールを保存 */
.has-savebar .page { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }

.savebar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  background: var(--save-bg, var(--accent));
  box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.06), 0 -10px 30px -18px rgba(31, 45, 52, 0.45);
}
.save-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 480px;
  min-height: 60px;
  margin: 0 auto;
  padding: 0 20px calc(env(safe-area-inset-bottom));
  box-sizing: content-box;
  border: 0;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--save-ink, #fff);
  background: none;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.save-icon { display: grid; place-items: center; }
.save-icon svg { width: 20px; height: 20px; }
.save-btn:hover { opacity: 0.8; }
.save-btn:active { opacity: 0.65; }
.save-btn:focus-visible, .sheet button:focus-visible { outline: 2px solid var(--save-ink, var(--accent)); outline-offset: -4px; }

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(31, 45, 52, 0.35);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 41;
  width: 100%;
  max-width: 480px;
  padding: 10px 16px calc(16px + env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0;
  background: #fff;
  box-shadow: 0 -10px 40px -10px rgba(31, 45, 52, 0.3);
  transform: translate(-50%, 100%);
  transition: transform 0.22s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.sheet::before {
  content: "";
  display: block;
  width: 40px;
  height: 4px;
  margin: 0 auto 10px;
  border-radius: 2px;
  background: #cfe0e8;
}
.sheet-open .sheet-backdrop { opacity: 1; }
.sheet-open .sheet { transform: translate(-50%, 0); }

.sheet-title { margin: 0 0 6px; font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-align: center; color: var(--ink-soft); }
.sheet-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 64px;
  padding: 10px 12px;
  border: 0;
  border-radius: 16px;
  font: inherit;
  color: var(--ink);
  background: none;
  text-align: left;
  cursor: pointer;
}
.sheet-item:hover { background: #f2f7f9; }
.sheet-item b { display: block; font-size: 15px; }
.sheet-item small { display: block; font-size: 12.5px; color: var(--ink-soft); }
.sheet-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--accent);
  background: #e7eff4;
}
.sheet-icon svg { width: 22px; height: 22px; }
.sheet-close {
  width: 100%;
  min-height: 48px;
  margin-top: 6px;
  border: 1px solid #d9e6ec;
  border-radius: 999px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-soft);
  background: #fff;
  cursor: pointer;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(84px + env(safe-area-inset-bottom));
  z-index: 50;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: var(--ink);
  transform: translate(-50%, 10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .sheet, .sheet-backdrop { transition: none; }
  .blocks > *, .is-ready .blocks > * { animation: none; opacity: 1; transform: none; }
  .block-link, .block-card, .social { transition: none; }
}
