/* 招待案内 LP（/invites | /invites/:invite_code） */
:root {
  /* ブラウザの自動ダークモードで色反転されないようライト固定 */
  color-scheme: only light;
  --bg-from-image: #e8e0d4;
  --color-white: #fff;
  --color-ink: #1a1a1a;
  --color-muted: #6b6560;
  --color-line: #e8e2db;
  --color-surface: var(--bg-from-image);
  --color-surface-warm: #f3ece4;
  --color-cyan: #219eb8;
  --color-badge: #8b6f5a;
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-pill: 999px;
  /* 面の浮き：拡散寄り・弱め（メイン写真・CTA には使わない） */
  --shadow-soft: 0 2px 12px rgb(40 30 20 / 10%);
  /* goods パララックス商品ページと同系のタイポ */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Roboto", "Noto Sans JP", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --fw-text: 500;
  --fw-head: 600;
  --fs-body: 17px;
  --tracking-body: -0.025em;
  --tracking-head: 0.05em;
  --phone: 400px;
  --pad-x: 30px;
  --hero-ratio: 1200 / 1500;
  --gradient-cta: #219eb8;
}

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

html {
  scroll-behavior: smooth;
  font-size: var(--fs-body);
}

body {
  margin: 0;
  font-family: var(--font);
  font-weight: var(--fw-head);
  font-size: 1rem;
  line-height: 1.75;
  letter-spacing: var(--tracking-body);
  font-kerning: normal;
  font-feature-settings: normal;
  color: var(--color-ink);
  background: var(--bg-from-image);
  -webkit-font-smoothing: antialiased;
  font-variant-east-asian: normal;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
}

.shell {
  min-height: 100dvh;
}

.page {
  width: min(100%, var(--phone));
  margin: 0 auto;
  background: var(--color-white);
}

/* ——— Hero ——— */
.hero {
  width: min(100%, var(--phone));
  margin: 0 auto;
}

.hero__visual {
  position: relative;
  aspect-ratio: var(--hero-ratio);
  overflow: hidden;
  color: var(--color-white);
  isolation: isolate;
  background: #2a2a2a;
  border-radius: 2px;
  box-shadow: none;
}

.hero__image {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.hero__veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    180deg,
    rgb(20 24 28 / 8%) 0%,
    rgb(20 24 28 / 4%) 35%,
    rgb(20 24 28 / 35%) 62%,
    rgb(20 24 28 / 72%) 100%
  );
}

.hero__copy {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.1rem var(--pad-x) 1.55rem;
  text-shadow: 0 1px 2px rgb(0 0 0 / 35%);
}

.hero__title {
  margin: 0;
  font-size: 28px;
  font-weight: var(--fw-head);
  line-height: 1.375;
  letter-spacing: 0.025em;
  font-feature-settings: "palt" 1;
  text-align: center;
  text-wrap: balance;
  line-break: strict;
  color: #fff;
}

.hero__lead {
  margin: 0 auto;
  /* goods item_description 相当 */
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.05em;
  font-feature-settings: "palt" 1;
  color: #fff;
  text-align: center;
  max-width: 22em;
}

.hero__lead-note {
  display: block;
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0.05em;
  opacity: 0.92;
}

.section {
  padding: 1.75rem var(--pad-x);
}

.section--tight {
  padding-top: 0;
}

.section--soft {
  background: color-mix(in srgb, var(--bg-from-image) 70%, #fff);
}

.section__label {
  display: inline-flex;
  margin: 0 0 0.55rem;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-pill);
  background: #ebe0d4;
  color: var(--color-badge);
  font-size: 0.72rem;
  font-weight: var(--fw-head);
  letter-spacing: 0.04em;
}

.section__title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: var(--fw-head);
  line-height: 1.75;
  letter-spacing: var(--tracking-head);
  font-feature-settings: "palt" 1;
  text-align: left;
  text-wrap: balance;
}

.section__text {
  margin: 0;
  color: var(--color-ink);
  font-size: 1rem;
  font-weight: var(--fw-head);
  line-height: 1.75;
  letter-spacing: var(--tracking-body);
  font-kerning: normal;
  font-feature-settings: normal;
  text-align: justify;
}

.invite-panel {
  margin-top: -1.35rem;
  padding: 1.1rem 1.1rem 1.15rem;
  border: 1px solid rgb(255 255 255 / 55%);
  border-radius: var(--radius-lg);
  background: rgb(255 255 255 / 82%);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.invite-panel__head {
  margin-bottom: 0.75rem;
}

.invite-panel__head--split {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.invite-panel__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: var(--fw-head);
  letter-spacing: var(--tracking-head);
  font-feature-settings: "palt" 1;
}

.invite-panel__hint {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.75rem;
}

.invite-panel__row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.invite-panel__input {
  flex: 1;
  min-width: 0;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  background: var(--color-white);
  color: var(--color-ink);
  font: inherit;
  font-size: 1.05rem;
  font-weight: var(--fw-head);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.invite-panel__input::placeholder {
  color: #b7aea5;
  font-weight: var(--fw-text);
  letter-spacing: 0.02em;
  text-transform: none;
}

.invite-panel__input:focus {
  outline: 2px solid rgb(33 158 184 / 35%);
  border-color: var(--color-cyan);
}

.invite-panel__copy {
  flex-shrink: 0;
  min-width: 4.5rem;
  padding: 0 0.95rem;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--color-surface-warm);
  color: var(--color-ink);
  font: inherit;
  font-size: 0.85rem;
  font-weight: var(--fw-head);
  cursor: pointer;
}

.invite-panel__copy.is-done {
  background: #dff3f7;
  color: var(--color-cyan);
}

.invite-panel__note {
  margin: 0.7rem 0 0;
  color: var(--color-muted);
  font-size: 0.82rem;
  line-height: 1.65;
  letter-spacing: var(--tracking-body);
  text-align: left;
}

.steps {
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--color-line);
}

.step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--color-line);
}

.step__num {
  display: grid;
  place-items: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  background: var(--gradient-cta);
  color: var(--color-white);
  font-size: 0.85rem;
  font-weight: var(--fw-head);
}

.step__title {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: var(--fw-head);
  letter-spacing: var(--tracking-head);
  font-feature-settings: "palt" 1;
}

.step__text {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.95rem;
  line-height: 1.75;
  letter-spacing: var(--tracking-body);
}

.benefit {
  margin-top: 1.35rem;
  padding: 1.1rem 1.1rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #eef9fb 0%, var(--bg-from-image) 100%);
}

.benefit__title {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
  font-weight: var(--fw-head);
  font-feature-settings: "palt" 1;
}

.benefit__text {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.95rem;
  line-height: 1.8;
  letter-spacing: var(--tracking-body);
}

.faq {
  margin: 1rem 0 0;
}

.faq details {
  border-bottom: 1px solid var(--color-line);
}

.faq details:first-child {
  border-top: 1px solid var(--color-line);
}

.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 0.95rem 0;
  font-size: 0.98rem;
  font-weight: var(--fw-head);
  font-feature-settings: "palt" 1;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  float: right;
  color: var(--color-muted);
}

.faq details[open] summary::after {
  content: "−";
}

.faq p {
  margin: 0;
  padding: 0 0 1rem;
  color: var(--color-muted);
  font-size: 0.95rem;
  line-height: 1.8;
  letter-spacing: var(--tracking-body);
}

.cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.75rem 2.75rem;
  border: 0;
  border-radius: 14px;
  background: var(--gradient-cta);
  color: var(--color-white);
  font: inherit;
  font-weight: var(--fw-head);
  font-size: 17px;
  letter-spacing: 0.05em;
  text-decoration: none;
  box-shadow: none;
  cursor: pointer;
}

button.cta {
  appearance: none;
  -webkit-appearance: none;
}

.cta__symbol {
  position: absolute;
  right: 1.15rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 0;
}

.cta__icon {
  width: 1.1em;
  height: 1.1em;
  display: block;
}

.cta--block {
  width: 100%;
}

.stores {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.stores a {
  display: block;
  width: 138px;
}

.stores img {
  width: 100%;
}

.download-block__lead {
  margin: 0 0 0.95rem;
  text-align: center;
  color: var(--color-muted);
  font-size: 0.92rem;
  line-height: 1.7;
  letter-spacing: var(--tracking-body);
}

.section--download .section__title,
.section--download .section__label {
  text-align: center;
}

.section--download .section__label {
  display: flex;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.footer {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 1.75rem max(var(--pad-x), 1.5rem) 2.25rem;
  background: none;
  box-shadow: none;
  border-radius: 0;
  color: var(--color-ink);
  text-align: center;
}

.footer__logo {
  width: 104px;
  margin: 0 auto 1rem;
  /* 白ロゴ＋黒地アセット → 背景色の上に黒ロゴとして載せる */
  filter: invert(1);
  mix-blend-mode: multiply;
}

.footer__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem 1rem;
  margin-bottom: 0.85rem;
  font-size: 1rem;
}

.footer__nav a {
  color: rgb(26 26 26 / 72%);
  text-decoration: none;
}

.footer__copy {
  margin: 0;
  font-size: 1rem;
  color: rgb(26 26 26 / 48%);
}

@media (min-width: 900px) {
  :root {
    --phone: 400px;
    --hero-visual: min(560px, 56vh);
  }

  .hero {
    width: var(--hero-visual);
    margin: 1.75rem auto 0;
    position: relative;
    z-index: 1;
  }

  .hero--fixed {
    will-change: transform;
  }

  .hero--fixed .hero__visual {
    transform: translateZ(0);
  }

  .hero__visual {
    border-radius: 2px;
    box-shadow: none;
  }

  .invite-stack {
    width: min(100%, var(--phone));
  }

  .page {
    position: relative;
    z-index: 2;
    margin-top: 0;
    border-radius: 24px;
    box-shadow: var(--shadow-soft);
  }
}

/* ——— ヒーロー／ザブトン配置 ——— */

/*
  写真フレームはパララックス対象。文言＋ザブトンは通常スクロール。
  --invite-intro-pull で写真下部に文言が乗る配置にする。
*/
.invite-stack {
  --invite-intro-pull: 14rem;
  position: relative;
  z-index: 2;
  width: min(100%, var(--phone));
  margin: calc(-1 * var(--invite-intro-pull)) auto 0;
}

.hero__copy--center,
.invite-stack__intro {
  align-items: center;
  text-align: center;
  text-shadow: 0 1px 2px rgb(0 0 0 / 35%);
  padding: 0 var(--pad-x) 1.55rem;
}

@media (min-width: 900px) {
  .invite-stack {
    --invite-intro-pull: 14.5rem;
  }

  .invite-stack__intro {
    padding: 0 1.35rem 1.5rem;
  }
}

.hero__app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
}

.hero__app-icon {
  width: 60px;
  height: 60px;
  display: block;
  filter: none;
  /* 不透明アセット＋角丸（透過角からの背景透け防止） */
  border-radius: 25%;
  box-shadow: 0 4px 14px rgb(0 0 0 / 16%);
}

.hero__app-name {
  margin: 0;
  color: rgb(255 255 255 / 92%);
  font-size: 0.8rem;
  font-weight: var(--fw-head);
  letter-spacing: 0.12em;
}

.hero__copy--center .hero__title,
.invite-stack__intro .hero__title {
  text-align: center;
}

.hero__copy--center .hero__lead,
.invite-stack__intro .hero__lead {
  text-align: center;
  max-width: 22em;
}

.step-block {
  border-top: 0;
}

.step-block:not(:first-of-type) {
  /* 罫線は本文と同じ左右インセット幅 */
  background-image: linear-gradient(var(--color-line), var(--color-line));
  background-size: calc(100% - 2 * var(--pad-x)) 1px;
  background-position: top center;
  background-repeat: no-repeat;
}

.step-block:first-of-type {
  padding-top: 1.35rem;
}

.step-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 0.65rem;
}

.step-head .step__num {
  flex-shrink: 0;
}

.step-head .section__title {
  margin: 0;
}

.step-block .section__text {
  margin-bottom: 1.1rem;
}

.ref-shot {
  margin: 1.25rem 0 0;
  padding: 0;
}

/* 画像と同寸の下地＋multiply で白部が下地色になり矩形が立つ */
.ref-shot__frame {
  position: relative;
  overflow: hidden;
  border-radius: 2px;
  background: color-mix(in srgb, #000 3%, #fff);
  line-height: 0;
}

.ref-shot__frame img {
  position: relative;
  mix-blend-mode: multiply;
}

.ref-shot__code {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.ref-shot__code text {
  font-family: var(--font);
  font-size: 36px;
  font-weight: var(--fw-head);
  letter-spacing: 0.06em;
  fill: var(--color-ink);
}

/* ——— チラシ向けカメラファインダー（シェル。映像・読取は本実装） ——— */
.camera-finder {
  margin: 1.25rem 0 0;
}

.camera-finder__stage {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 2px;
  background: linear-gradient(180deg, #2a2e32 0%, #1a1c1e 100%);
  color: rgb(255 255 255 / 78%);
}

.camera-finder + .cta {
  margin-top: 1rem;
}

.camera-finder__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.camera-finder[data-state="active"] .camera-finder__video,
.camera-finder[data-state="scanning"] .camera-finder__video,
.camera-finder[data-state="done"] .camera-finder__video {
  opacity: 1;
}

.camera-finder__frame {
  position: absolute;
  /* 1 行の招待コード（XXX-XXX-XXX）を収める横長の枠。OCR はこの範囲だけを読む。
     枠を画面幅の半分に抑えているのは、メインカメラの最短撮影距離（約 15cm）より
     近づけて構えるとピントが合わないため */
  inset: 42% 25%;
  border: 1.5px solid rgb(255 255 255 / 72%);
  border-radius: 12px;
  box-shadow: 0 0 0 999px rgb(0 0 0 / 28%);
  pointer-events: none;
}

.camera-finder__idle {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 1.5rem;
  text-align: center;
  z-index: 1;
}

.camera-finder[data-state="active"] .camera-finder__idle,
.camera-finder[data-state="scanning"] .camera-finder__idle,
.camera-finder[data-state="done"] .camera-finder__idle {
  display: none;
}

.camera-finder__idle-label {
  font-size: 0.95rem;
  font-weight: var(--fw-head);
  letter-spacing: var(--tracking-body);
}

.camera-finder__idle-hint {
  font-size: 0.75rem;
  font-weight: var(--fw-text);
  color: rgb(255 255 255 / 55%);
}

.camera-finder__caption {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  font-weight: var(--fw-text);
  line-height: 1.6;
  letter-spacing: var(--tracking-body);
  color: rgb(26 26 26 / 72%);
  text-align: center;
}

.cta + .camera-finder__caption {
  margin-top: 0.75rem;
}

.camera-finder__status {
  margin: 0.65rem 0 0;
  font-size: 0.82rem;
  font-weight: var(--fw-text);
  line-height: 1.55;
  color: #b45309;
  text-align: center;
}

.camera-finder__status[hidden] {
  display: none;
}

.ref-shot img,
.ref-shot__frame img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 2px;
  box-shadow: none;
  line-height: 0;
}

.ref-shot__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 280px;
  padding: 2rem 1rem;
  border-radius: 2px;
  background: linear-gradient(180deg, #f3f3f5 0%, #e8e8ec 100%);
  color: var(--color-muted);
  font-size: 0.95rem;
  font-weight: var(--fw-head);
  letter-spacing: var(--tracking-body);
  line-height: 1.5;
  text-align: center;
}

.ref-shot__hint {
  font-size: 0.75rem;
  font-weight: var(--fw-text);
  color: #999;
}

.ref-shot__caption {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  font-weight: var(--fw-text);
  line-height: 1.6;
  letter-spacing: var(--tracking-body);
  color: rgb(26 26 26 / 72%);
  text-align: center;
}

.closing-note {
  margin: 1.35rem 0 0;
  text-align: center;
  font-size: 1rem;
  font-weight: var(--fw-head);
  letter-spacing: 0.025em;
  color: #219eb8;
  line-height: 1.75;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
