/* Kimi きみ — link page. One accent colour (pink), dark plum background. */

@font-face { font-family: "Kimi Round"; src: url("/assets/fonts/zen-maru-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Kimi Round"; src: url("/assets/fonts/zen-maru-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Kimi Round"; src: url("/assets/fonts/zen-maru-900.woff2") format("woff2"); font-weight: 900; font-display: swap; }

:root {
  --bg: #140e16;
  --bg-2: #1d1521;
  --surface: #251b2a;
  --surface-2: #31233a;
  --line: rgba(255, 170, 212, 0.16);
  --text: #fbf0f6;
  --muted: #cdb8c8;
  --faint: #95808f;
  --accent: #ff8dc7;
  --accent-ink: #2b0d1d;
  --accent-soft: rgba(255, 141, 199, 0.11);
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Roboto Mono", monospace;
  --av: clamp(78px, 12svh, 104px);
  --btn-h: clamp(52px, 7.4svh, 60px);
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: "Kimi Round", ui-rounded, "Hiragino Maru Gothic ProN", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 500;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* soft pink glow + faint dot grid (the little "techy" texture) */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(70% 42% at 50% -4%, rgba(255, 141, 199, 0.24), transparent 70%),
    radial-gradient(50% 30% at 100% 100%, rgba(255, 141, 199, 0.08), transparent 70%);
}
.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 205, 228, 0.09) 1px, transparent 1.3px);
  background-size: 18px 18px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 62%);
  mask-image: linear-gradient(to bottom, #000 0%, transparent 62%);
}

.layout {
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  gap: 80px;
  padding: 0 16px;
}

.page {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  padding: max(18px, env(safe-area-inset-top)) 0 calc(22px + env(safe-area-inset-bottom));
}

/* ---------- header ---------- */
.hero { text-align: center; }

.avatar-wrap {
  position: relative;
  width: var(--av);
  height: var(--av);
  margin: 0 auto 10px;
}
.avatar {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent), 0 12px 40px -8px rgba(255, 141, 199, 0.5);
}

.spark { position: absolute; fill: var(--accent); animation: twinkle 3.4s ease-in-out infinite; }
.spark-a { width: 18px; height: 18px; top: -4px; right: -16px; }
.spark-b { width: 11px; height: 11px; bottom: 8px; left: -18px; animation-delay: 1.1s; }
.spark-c { width: 8px; height: 8px; top: 16px; left: -26px; opacity: 0.7; animation-delay: 2.2s; }
@keyframes twinkle {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
  50% { transform: scale(0.55) rotate(25deg); opacity: 0.45; }
}

.name {
  margin: 0;
  min-height: 1.15em;
  font-weight: 900;
  font-size: clamp(30px, 8.6vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.name .jp {
  display: inline-block;
  margin-left: 0.16em;
  font-size: 0.8em;
  color: var(--accent);
  transform: rotate(-7deg) translateY(-2px);
}

.line {
  margin: 4px 0 0;
  min-height: 1.45em;
  color: var(--muted);
  font-size: 15px;
}

/* ---------- link buttons ---------- */
.links {
  list-style: none;
  margin: clamp(14px, 2.8svh, 24px) 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.links:empty { min-height: calc(var(--btn-h) * 5 + 40px); }

.link { position: relative; }

.btn {
  display: grid;
  grid-template-columns: calc(var(--btn-h) - 14px) 1fr calc(var(--btn-h) - 14px);
  align-items: center;
  min-height: var(--btn-h);
  padding: 0 7px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 17px;
  transition: transform 0.12s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}
.btn:active { transform: scale(0.98); }
.btn .ico {
  width: calc(var(--btn-h) - 14px);
  height: calc(var(--btn-h) - 14px);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-2);
}
.btn .ico svg { width: 20px; height: 20px; fill: currentColor; }
.btn .lbl { display: flex; flex-direction: column; align-items: center; text-align: center; line-height: 1.15; }
.btn .lbl-top { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn .note { margin-top: 3px; font-size: 12.5px; font-weight: 700; color: var(--accent); }
.link.featured .btn .note { color: var(--accent-ink); opacity: 0.75; }

.badge {
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  padding: 4px 7px;
  border-radius: 999px;
  border: 1.5px solid currentColor;
  opacity: 0.8;
}

/* the top (featured) link is the main one: filled pink */
.link.featured .btn {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
  box-shadow: 0 10px 30px -12px rgba(255, 141, 199, 0.8);
}
.link.featured .btn .ico { background: rgba(43, 13, 29, 0.12); }

.qr-btn {
  position: absolute;
  top: 50%;
  right: 5px;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.qr-btn svg { width: 19px; height: 19px; }
.link.featured .qr-btn { color: var(--accent-ink); }
.qr-btn:active { background: rgba(255, 255, 255, 0.08); }
.link.featured .qr-btn:active { background: rgba(43, 13, 29, 0.1); }

.link.is-target .btn { outline: 2px solid var(--accent); outline-offset: 3px; }

@media (hover: hover) {
  .btn:hover { background: var(--surface-2); }
  .link.featured .btn:hover { background: #ff9ccf; }
  .qr-btn:hover { color: var(--text); }
  .link.featured .qr-btn:hover { color: var(--accent-ink); background: rgba(43, 13, 29, 0.1); }
}

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

.inapp-hint {
  margin: 12px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.inapp-hint b { color: var(--text); font-weight: 700; }

/* ---------- about ---------- */
.about {
  margin-top: 26px;
  padding: 16px 18px 18px;
  border-radius: 26px;
  background: linear-gradient(180deg, var(--bg-2), rgba(29, 21, 33, 0.55));
  border: 1px solid var(--line);
}
.about-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: var(--accent);
}
.about-title svg { width: 14px; height: 14px; }
.about-lines p { margin: 0 0 4px; font-size: 15px; line-height: 1.55; }

.facts {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.facts li {
  font-size: 13.5px;
  line-height: 1.2;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid rgba(255, 141, 199, 0.28);
}
.facts li:nth-child(odd) { transform: rotate(-1.4deg); }
.facts li:nth-child(even) { transform: rotate(1.1deg); }

/* ---------- show QR + footer ---------- */
.qr-row { display: flex; justify-content: center; margin-top: 20px; }
.show-qr {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1.5px dashed rgba(255, 141, 199, 0.55);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
}
.show-qr svg { width: 18px; height: 18px; color: var(--accent); }
.show-qr:active { background: var(--accent-soft); }

.foot {
  margin-top: auto;
  padding-top: 24px;
  text-align: center;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: var(--faint);
}
.foot svg { width: 10px; height: 10px; fill: var(--accent); vertical-align: -1px; margin-right: 5px; }

.noscript { text-align: center; color: var(--muted); }

/* ---------- QR codes ---------- */
.qr-card {
  width: 220px;
  padding: 14px;
  border-radius: 26px;
  background: #fff7fb;
  box-shadow: 0 0 0 6px rgba(255, 141, 199, 0.16), 0 22px 60px -22px rgba(255, 141, 199, 0.6);
}
.qr-code svg { display: block; width: 100%; height: auto; border-radius: 10px; }

/* desktop: page QR next to the buttons */
.desk-qr { display: none; }
@media (min-width: 900px) {
  .layout { align-items: center; }
  .page { padding-top: 56px; padding-bottom: 40px; }
  .desk-qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: none;
  }
  .desk-qr-title { margin: 22px 0 2px; font-size: 20px; font-weight: 900; }
  .desk-qr-sub { margin: 0; color: var(--muted); font-size: 14px; }
}

/* ---------- bottom sheet ---------- */
.sheet {
  width: 100%;
  max-width: 480px;
  max-height: 92dvh;
  margin: auto auto 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  overflow: visible;
}
.sheet::backdrop {
  background: rgba(10, 5, 12, 0.64);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.sheet-panel {
  max-height: 92dvh;
  overflow-y: auto;
  padding: 10px 20px calc(20px + env(safe-area-inset-bottom));
  border-radius: 28px 28px 0 0;
  border: 1px solid var(--line);
  border-bottom: 0;
  background: var(--bg-2);
  text-align: center;
}
.sheet[open] .sheet-panel { animation: sheet-up 0.26s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes sheet-up { from { transform: translateY(28px); opacity: 0; } }

@media (min-width: 600px) {
  .sheet { margin: auto; }
  .sheet-panel { border-radius: 28px; border-bottom: 1px solid var(--line); padding-bottom: 22px; }
}

.grabber { width: 40px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.18); margin: 0 auto 14px; }

.sheet h2 { margin: 8px 0 4px; font-size: 21px; font-weight: 900; line-height: 1.25; }
.sheet .sub { margin: 0 0 4px; color: var(--muted); font-size: 15px; }
.sheet .dest {
  margin: 6px 0 18px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--faint);
  overflow-wrap: anywhere;
}

.chip18 {
  display: inline-block;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.confirm {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 10px 0 6px;
  font-size: 16px;
  font-weight: 700;
}
.confirm svg {
  width: 22px;
  height: 22px;
  padding: 3px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
}

.sheet-actions { display: grid; gap: 10px; margin-top: 4px; }
.sbtn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 54px;
  padding: 0 18px;
  border-radius: 999px;
  border: 0;
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.sbtn svg { width: 18px; height: 18px; }
.sbtn.primary { background: var(--accent); color: var(--accent-ink); }
.sbtn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }

.sheet .qr-card { width: min(260px, 70vw); margin: 6px auto 12px; }
.sheet .qr-url {
  margin: 0 0 16px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
  overflow-wrap: anywhere;
}

.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
.sheet .sub.small { font-size: 13px; margin-bottom: 0; }
.sheet .sub.small b { color: var(--text); }
.page.lost { margin: 0 auto; justify-content: center; text-align: center; min-height: 100dvh; padding: 0 16px; gap: 6px; }
.page.lost .sheet-actions { margin-top: 22px; }
