/* Ewalua リンクページ：海のマジックアワー */
:root {
  --ink: #33383a;
  --ink-soft: #4a5357;
  --glass: rgba(255, 255, 255, 0.62);
  --glass-strong: rgba(255, 255, 255, 0.82);
  --glass-line: rgba(255, 255, 255, 0.9);
  --shadow: 0 10px 30px -14px rgba(41, 113, 142, 0.45);
  --accent: #457891;
  --sky: linear-gradient(180deg, #73b7d2 0%, #a0d0e3 24%, #e3f1f6 56%, #ffffff 82%, #fffdf2 100%);
  --glow: radial-gradient(60% 40% at 80% 6%, rgba(255, 255, 255, 0.55), transparent 70%),
          radial-gradient(50% 35% at 10% 30%, rgba(175, 223, 244, 0.6), transparent 70%);
}

body[data-theme="magichour"] {
  --shadow: 0 10px 30px -14px rgba(120, 110, 160, 0.45);
  --accent: #457891;
  --sky: linear-gradient(180deg, #d8cdea 0%, #ead3e4 14%, #f5d9e0 24%, #d9d9ec 36%, #afdff4 54%, #e3f1f6 70%, #ffffff 86%, #fff9dc 100%);
  --glow: radial-gradient(50% 30% at 85% 4%, rgba(255, 255, 255, 0.5), transparent 70%),
          radial-gradient(45% 30% at 8% 46%, rgba(143, 197, 222, 0.35), transparent 70%);
}

body[data-theme="milky"] {
  --glass: rgba(255, 255, 255, 0.9);
  --glass-strong: #ffffff;
  --glass-line: #cfe0e8;
  --shadow: 0 8px 24px -16px rgba(49, 86, 104, 0.35);
  --sky: linear-gradient(180deg, #e7eff4 0%, #f4f8fa 45%, #ffffff 100%);
  --glow: radial-gradient(60% 30% at 50% 0%, rgba(179, 206, 219, 0.45), transparent 70%);
}

*, *::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: #e3f1f6;
  overflow-x: hidden;
}

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

.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;
}

.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; }
}
