/* ============================================================
   Karin-chan LP — スタイル
   モバイルファースト / ダーク / 余計な依存なし
   ============================================================ */

/* ---------- デザイントークン ---------- */
:root {
  --bg:        #0E0B14;
  --bg-2:      #16121F;
  --surface:   rgba(255,255,255,.055);
  --surface-2: rgba(255,255,255,.085);
  --border:    rgba(255,255,255,.10);
  --text:      #F6F3F8;
  --text-dim:  #B4AAC2;
  --text-mute: #8E8599;

  --accent:    #FF4D8D;
  --cta-from:  #E11D6B;   /* 白文字で 4.5:1 以上を確保するため、あえて深め */
  --cta-to:    #A21CAF;

  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 24px;
  --maxw: 1080px;

  /* z-index スケール（散らかさないため、必ずここから使う） */
  --z-content: 1;
  --z-overlay: 10;
  --z-sticky:  50;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI",
               "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP",
               Meiryo, "Yu Gothic", system-ui, sans-serif;
  /* Apple 端末では丸ゴシックが標準搭載。新人配信者のやわらかい空気に合う */
  --font-round: "Hiragino Maru Gothic ProN", "Hiragino Sans",
                "Yu Gothic", system-ui, sans-serif;
}

/* ---------- リセット ---------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;          /* モバイル本文は 16px 未満にしない */
  line-height: 1.75;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

/* display:flex 等の指定が [hidden] を打ち消してしまうのを防ぐ。
   main.js は hidden 属性で出し分けを行うため、この1行は必須。 */
[hidden] { display: none !important; }

h1, h2, h3 { font-family: var(--font-round); line-height: 1.35; margin: 0; }

a { color: inherit; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .88em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .1em .45em;
}

:focus-visible {
  outline: 3px solid rgba(255,255,255,.92);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--text); color: var(--bg);
  padding: 12px 18px; border-radius: 0 0 var(--r-sm) 0;
  z-index: var(--z-sticky);
}
.skip-link:focus { left: 0; }

/* ============================================================
   1. HERO
   min-height に svh を使い、モバイルのアドレスバー分を考慮する
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.hero__media { position: absolute; inset: 0; z-index: 0; }

.hero__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 20%;   /* 顔が上寄りの構図を想定 */
}

.hero__scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg,
      rgba(14,11,20,.62) 0%,
      rgba(14,11,20,.18) 26%,
      rgba(14,11,20,.74) 55%,
      rgba(14,11,20,.95) 80%,
      var(--bg) 100%);
}

.hero__inner {
  position: relative;
  z-index: var(--z-content);
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px calc(28px + env(safe-area-inset-bottom));
}

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 0 0 14px;
  padding: 5px 14px 5px 11px;
  font-size: 13px; font-weight: 700; letter-spacing: .06em;
  color: #FFD9E7;
  background: rgba(255,77,141,.16);
  border: 1px solid rgba(255,77,141,.42);
  border-radius: 999px;
  backdrop-filter: blur(6px);
}

.hero__title {
  font-size: clamp(30px, 8.4vw, 46px);
  letter-spacing: .01em;
  margin-bottom: 16px;
  text-shadow: 0 3px 24px rgba(0,0,0,.6);
}

.hero__lead {
  margin: 0 0 14px;
  font-size: clamp(14.5px, 3.9vw, 17px);
  color: #E8E2EF;
  text-shadow: 0 2px 16px rgba(0,0,0,.7);
}

.hero__sub {
  margin: 0 0 26px;
  font-size: clamp(14.5px, 3.9vw, 17px);
  color: #E8E2EF;
  text-shadow: 0 2px 16px rgba(0,0,0,.7);
}

/* ---------- CTA ---------- */
.cta { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.cta--center { align-items: center; text-align: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%;
  min-height: 58px;                 /* 44px 以上のタップ領域 */
  padding: 0 26px;
  font-family: var(--font-round);
  font-size: 18px; font-weight: 700; letter-spacing: .02em;
  color: #fff; text-decoration: none;
  background: linear-gradient(135deg, var(--cta-from), var(--cta-to));
  border: 0; border-radius: 999px;
  cursor: pointer;
  box-shadow:
    0 12px 32px -10px rgba(225,29,107,.72),
    inset 0 1px 0 rgba(255,255,255,.22);
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover {
  filter: brightness(1.08);
  box-shadow:
    0 16px 38px -10px rgba(225,29,107,.85),
    inset 0 1px 0 rgba(255,255,255,.28);
}
.btn:active { transform: translateY(1px); }

@media (min-width: 641px) {
  .btn { width: auto; min-width: 320px; }
}

/* 視線を引くための控えめな明滅。動きが苦手な人には出さない */
@media (prefers-reduced-motion: no-preference) {
  .btn { animation: cta-breathe 3.2s ease-in-out infinite; }
  @keyframes cta-breathe {
    0%, 100% { box-shadow: 0 12px 32px -10px rgba(225,29,107,.72), inset 0 1px 0 rgba(255,255,255,.22); }
    50%      { box-shadow: 0 12px 42px -6px rgba(225,29,107,1),  inset 0 1px 0 rgba(255,255,255,.22); }
  }
}

.cta__note {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-mute);
  letter-spacing: .02em;
}

/* ---------- iOS 案内 / QR ---------- */
.notice {
  margin-top: 4px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 14.5px;
  color: var(--text-dim);
  max-width: 460px;
}
.notice strong { color: var(--text); }

.qr {
  margin-top: 6px;
  padding: 16px;
  background: #fff;
  border-radius: var(--r-md);
  text-align: center;
  width: fit-content;
}
.qr img { border-radius: 6px; }
.qr p { margin: 8px 0 0; color: #3A3348; font-size: 12.5px; }

/* ============================================================
   共通セクション
   ============================================================ */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 64px 20px;
}
.section--tight { padding-top: 24px; }

.section__title {
  font-size: clamp(21px, 5.6vw, 28px);
  margin-bottom: 8px;
}
.section__title::after {
  content: "";
  display: block;
  width: 42px; height: 3px;
  margin-top: 12px;
  background: linear-gradient(90deg, var(--accent), transparent);
  border-radius: 2px;
}

.section__sub {
  margin: 14px 0 26px;
  font-size: 14.5px;
  color: var(--text-mute);
}

/* ============================================================
   2. ギャラリー
   ============================================================ */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 26px;
}
.gallery figure {
  margin: 0;
  aspect-ratio: 3 / 4;          /* 画像読込前から高さを確保 → CLS 防止 */
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
}
.gallery img { width: 100%; height: 100%; object-fit: cover; }

@media (min-width: 641px) {
  .gallery { grid-template-columns: repeat(3, 1fr); gap: 14px; }
}

/* ============================================================
   3. かりんについて
   ============================================================ */
.quote {
  margin: 26px 0 0;
  padding: 24px;
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  font-size: 15.5px;
  color: #E8E2EF;
}
.quote p { margin: 0 0 10px; }
.quote p:last-child { margin-bottom: 0; }

.facts {
  margin: 22px 0 0;
  display: grid;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.facts > div {
  display: flex;
  gap: 16px;
  padding: 14px 18px;
  background: var(--bg-2);
  font-size: 15px;
}
.facts dt { color: var(--text-mute); min-width: 76px; margin: 0; }
.facts dd { margin: 0; color: var(--text); }

/* ============================================================
   4. アプリでできること
   ============================================================ */
.features {
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.features li {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.features li h3 {
  font-size: 16.5px;
  margin: 14px 0 8px;
}
.features li p {
  margin: 0;
  font-size: 14.5px;
  color: var(--text-dim);
  line-height: 1.7;
}
.features__icon {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 44px; height: 44px;
  color: var(--accent);
  background: rgba(255,77,141,.12);
  border: 1px solid rgba(255,77,141,.28);
  border-radius: 13px;
}

@media (min-width: 721px) {
  .features { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}

/* ============================================================
   5. インストール方法
   ============================================================ */
.steps {
  list-style: none;
  margin: 26px 0 34px;
  padding: 0;
  display: grid;
  gap: 14px;
}
.steps li {
  display: flex;
  gap: 16px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.steps__num {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 34px; height: 34px;
  font-family: var(--font-round);
  font-size: 15px; font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--cta-from), var(--cta-to));
  border-radius: 50%;
}
.steps li h3 { font-size: 16px; margin-bottom: 6px; }
.steps li p { margin: 0; font-size: 14.5px; color: var(--text-dim); line-height: 1.7; }

@media (min-width: 861px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
  .steps li { flex-direction: column; gap: 12px; }
}

/* ============================================================
   6. FAQ
   ============================================================ */
.faq { margin-top: 26px; display: grid; gap: 10px; max-width: 760px; }

.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 56px;
  padding: 15px 20px;
  font-size: 15.5px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  flex: 0 0 auto;
  width: 9px; height: 9px;
  border-right: 2px solid var(--text-mute);
  border-bottom: 2px solid var(--text-mute);
  transform: rotate(45deg) translateY(-2px);
  transition: transform .22s ease;
}
.faq details[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.faq details[open] summary { color: var(--accent); }
.faq p {
  margin: 0;
  padding: 0 20px 18px;
  font-size: 14.5px;
  color: var(--text-dim);
  line-height: 1.75;
}

/* ============================================================
   7. フッター
   ============================================================ */
.footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px 20px calc(48px + env(safe-area-inset-bottom));
  text-align: center;
}
.footer .cta { align-items: center; margin-bottom: 48px; }

.footer__legal {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  font-size: 12.5px;
  color: var(--text-mute);
  line-height: 1.7;
}
.footer__legal p { margin: 0 0 8px; }

.footer__age {
  display: inline-block;
  margin-bottom: 14px;
  padding: 5px 14px;
  font-size: 12px; font-weight: 700; letter-spacing: .08em;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
}

/* ============================================================
   設定未完了バナー（config.js の PROMO_URL が空のときだけ出る）
   ============================================================ */
.setup-warning {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: var(--z-sticky);
  padding: 12px 18px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
  background: #7A1030;
  color: #FFE4EC;
  font-size: 13px;
  text-align: center;
  border-top: 1px solid rgba(255,255,255,.2);
}

/* ============================================================
   動きを減らす設定を尊重する
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ============================================================
   デスクトップでの Hero レイアウト調整
   ============================================================ */
@media (min-width: 861px) {
  .hero__inner { padding-bottom: 72px; }
  .hero__lead, .hero__sub { max-width: 620px; }
}
