/* =============================================================
 * MISSELECT web tokens
 *   Flutter 側の lib/presentation/theme/app_tokens.dart を CSS
 *   カスタムプロパティに写経したもの。色・角丸・影・フォントは
 *   すべて app 側の値と一致させて、ブランドの見え方を揃える。
 * ========================================================== */

:root {
  /* warm palette */
  --bg-cream:      #FFF6E2;
  --bg-peach:      #FFE7B5;
  --bg-warm:       #FFD88A;  /* main background */
  --bg-orange:     #F5A85A;
  --fill-primary:  #E58128;  /* primary buttons */
  --fill-hover:    #C16718;
  --fill-accent:   #8E4A0E;  /* BEST/Focus 強調 */

  /* navy / ink */
  --ink-navy:      #0C1A36;
  --ink-navy-2:    #182849;
  --ink-text:      #112245;
  --ink-faint:     rgba(12, 26, 54, 0.18);

  /* paper */
  --paper:         #FFFFFF;
  --paper-cream:   #F8FAFD;
  --paper-edge:    #DFE6F0;

  /* semantic */
  --goal-hit:      #3DB477;
  --goal-drop:     #E04F3E;

  /* radii */
  --r-xs:  4px;
  --r-sm:  8px;
  --r-md:  14px;
  --r-lg:  22px;
  --r-pill: 999px;

  /* borders */
  --b-heavy:  3px;
  --b-med:    2.5px;
  --b-light:  2px;

  /* shelf offset (hard shell) */
  --shelf: 6px;

  /* shadows — Flutter 側の shadowCard / shadowPill を CSS へ */
  --shadow-card:  0 6px 0 var(--ink-navy), 0 18px 28px -12px rgba(12,26,54,.30);
  --shadow-pill:  0 3px 0 var(--ink-navy);
  --shadow-soft:  0 14px 22px -10px rgba(12,26,54,.28);

  /* fonts */
  --font-display: 'Anybody', system-ui, -apple-system, sans-serif;
  --font-body:    'Manrope', system-ui, -apple-system, sans-serif;
  --font-jp:      'Zen Kaku Gothic New', 'Hiragino Kaku Gothic ProN',
                  'ヒラギノ角ゴ ProN W3', system-ui, sans-serif;
}

/* =============================================================
 * reset
 * ========================================================== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-jp);
  color: var(--ink-text);
  background: var(--bg-warm);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; }
a { color: var(--ink-text); text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

/* =============================================================
 * lightning pattern background
 *   Flutter 側の LightningPatternBackground（140×140 タイル、雷 2 本 +
 *   ドット 2 個、stroke=#F5A85A、opacity=0.5、stroke-width=2、round cap）
 *   をそのまま SVG data-uri に写経している。座標も一致。
 * ========================================================== */
.bg-pattern {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-color: var(--bg-warm);
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140'><g fill='none' stroke='%23F5A85A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' opacity='0.5'><path d='M34 22 L28 42 L38 42 L32 62'/><path d='M102 80 L94 102 L106 102 L100 122'/><circle cx='114' cy='28' r='3'/><circle cx='18' cy='92' r='3'/></g></svg>");
  background-size: 140px 140px;
  background-repeat: repeat;
}

/* =============================================================
 * layout container
 * ========================================================== */
.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 22px;
}
.container-narrow {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 22px;
}

/* =============================================================
 * top bar
 * ========================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 18px 0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(255, 216, 138, .75);
  border-bottom: var(--b-light) solid transparent;
  transition: border-color .2s, box-shadow .2s;
}
.topbar.scrolled {
  border-bottom-color: var(--ink-navy);
  box-shadow: 0 4px 12px -6px rgba(12,26,54,.25);
}
.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.topbar__brand {
  font-family: var(--font-display);
  font-weight: 900;
  font-style: italic;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--ink-navy);
}
.topbar__nav {
  display: flex;
  gap: 18px;
  align-items: center;
}
.topbar__nav a {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--ink-navy);
  opacity: 0.75;
  transition: opacity .15s;
}
.topbar__nav a:hover { opacity: 1; }

/* =============================================================
 * hero
 * ========================================================== */
.hero {
  padding: 72px 0 80px;
  text-align: center;
}
.hero__eyebrow {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.32em;
  color: var(--ink-navy);
  opacity: 0.55;
  margin-bottom: 14px;
}
.hero__title {
  font-family: var(--font-display);
  font-weight: 900;
  font-style: italic;
  font-size: clamp(56px, 14vw, 148px);
  line-height: 0.9;
  letter-spacing: -0.05em;
  color: var(--ink-navy);
  margin-bottom: 26px;
}
.hero__tagline {
  font-family: var(--font-jp);
  font-weight: 700;
  font-size: clamp(16px, 2.4vw, 22px);
  color: var(--ink-text);
  line-height: 1.5;
  max-width: 620px;
  margin: 0 auto 36px;
}
.hero__actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* =============================================================
 * pill button (primary / ghost)
 * ========================================================== */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--r-pill);
  border: var(--b-med) solid var(--ink-navy);
  box-shadow: var(--shadow-pill);
  font-family: var(--font-display);
  font-weight: 800;
  font-style: italic;
  font-size: 15px;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: transform .1s, box-shadow .1s;
  text-decoration: none;
  white-space: nowrap;
}
.pill--primary {
  background: var(--fill-primary);
  color: var(--paper);
}
.pill--primary:hover { background: var(--fill-hover); }
.pill--ghost {
  background: var(--paper);
  color: var(--ink-navy);
}
.pill--ghost:hover { background: var(--paper-cream); }
.pill:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--ink-navy);
}
.pill--jp {
  font-family: var(--font-jp);
  font-style: normal;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.05em;
}

/* =============================================================
 * section framing
 * ========================================================== */
.section {
  padding: 64px 0 72px;
}
.section__label {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.32em;
  color: var(--ink-navy);
  opacity: 0.55;
  margin-bottom: 8px;
  text-align: center;
}
.section__title {
  font-family: var(--font-display);
  font-weight: 900;
  font-style: italic;
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--ink-navy);
  text-align: center;
  margin-bottom: 36px;
}
.section__title--jp {
  font-family: var(--font-jp);
  font-weight: 900;
  font-style: normal;
  font-size: clamp(24px, 4vw, 34px);
  letter-spacing: 0.02em;
}

/* =============================================================
 * card (paper + hard shell)
 * ========================================================== */
.card {
  background: var(--paper);
  border: var(--b-heavy) solid var(--ink-navy);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: 26px;
}

/* =============================================================
 * mode cards (Home のモードカード相当)
 * ========================================================== */
.modes {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  margin-top: 28px;
}
@media (min-width: 760px) {
  .modes { grid-template-columns: 1fr 1fr; }
}
.mode-card {
  display: flex;
  gap: 18px;
  align-items: center;
  background: var(--paper);
  border: var(--b-heavy) solid var(--ink-navy);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: 24px;
  transition: transform .18s ease-out;
}
.mode-card:hover { transform: translateY(-3px); }
.mode-card__sigil {
  flex: none;
  width: 54px;
  height: 54px;
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
  border: var(--b-light) solid var(--ink-navy);
}
.mode-card__sigil--primary {
  background: var(--fill-primary);
  color: var(--paper);
}
.mode-card__sigil--navy {
  background: var(--ink-navy);
  color: var(--bg-warm);
}
.mode-card__sigil svg { width: 28px; height: 28px; }
.mode-card__body { flex: 1; min-width: 0; }
.mode-card__title {
  font-family: var(--font-jp);
  font-weight: 900;
  font-size: 22px;
  color: var(--ink-navy);
  margin-bottom: 2px;
}
.mode-card__desc {
  font-family: var(--font-jp);
  font-weight: 500;
  font-size: 14px;
  color: var(--ink-text);
  opacity: 0.75;
}

/* =============================================================
 * how-to steps
 * ========================================================== */
.steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-top: 32px;
}
@media (min-width: 760px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
}
.step {
  background: var(--paper);
  border: var(--b-heavy) solid var(--ink-navy);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: 22px;
  position: relative;
}
.step__no {
  position: absolute;
  top: -14px; left: -14px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--ink-navy);
  color: var(--bg-warm);
  border: var(--b-light) solid var(--ink-navy);
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-style: italic;
  font-size: 20px;
  box-shadow: var(--shadow-pill);
}
.step__title {
  font-family: var(--font-jp);
  font-weight: 900;
  font-size: 17px;
  color: var(--ink-navy);
  margin: 4px 0 8px;
}
.step__body {
  font-family: var(--font-jp);
  font-weight: 500;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-text);
}

/* =============================================================
 * swipe demo (interactive card)
 * ========================================================== */
.demo {
  display: grid;
  gap: 24px;
  align-items: center;
  grid-template-columns: 1fr;
}
@media (min-width: 860px) {
  .demo { grid-template-columns: 1fr 1fr; }
}
.demo__stage {
  position: relative;
  height: 380px;
  display: grid;
  place-items: center;
  perspective: 1200px;
}
.demo__card {
  position: absolute;
  width: min(300px, 88%);
  height: 340px;
  background: var(--paper);
  border: var(--b-heavy) solid var(--ink-navy);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: 22px;
  display: flex;
  flex-direction: column;
  transition: transform .35s cubic-bezier(.2,.7,.2,1), opacity .3s;
  user-select: none;
  will-change: transform;
}
.demo__card.is-out-left {
  transform: translateX(-140%) rotate(-18deg) !important;
  opacity: 0;
}
.demo__card.is-out-right {
  transform: translateX(140%) rotate(18deg) !important;
  opacity: 0;
}
.demo__goal {
  align-self: center;
  display: inline-block;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  border: var(--b-light) solid var(--ink-navy);
  font-family: var(--font-jp);
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 0.08em;
  margin-bottom: 20px;
}
.demo__goal--hit { background: var(--goal-hit); color: var(--paper); }
.demo__goal--drop { background: var(--goal-drop); color: var(--paper); }
.demo__text {
  flex: 1;
  display: grid;
  place-items: center;
  text-align: center;
  font-family: var(--font-jp);
  font-weight: 900;
  font-size: clamp(20px, 3vw, 28px);
  color: var(--ink-navy);
  line-height: 1.4;
  padding: 8px;
}
.demo__hint {
  display: flex;
  justify-content: space-between;
  color: var(--ink-text);
  opacity: 0.55;
  font-family: var(--font-jp);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.06em;
}
.demo__actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 16px;
}
.demo__actions .pill { padding: 12px 18px; font-size: 14px; }
.demo__feedback {
  position: absolute;
  top: -12px;
  padding: 8px 18px;
  border-radius: var(--r-pill);
  border: var(--b-light) solid var(--ink-navy);
  background: var(--paper);
  box-shadow: var(--shadow-pill);
  font-family: var(--font-jp);
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.06em;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .2s, transform .2s;
  pointer-events: none;
  z-index: 3;
}
.demo__feedback.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.demo__feedback--good { background: var(--goal-hit); color: var(--paper); }
.demo__feedback--bad { background: var(--goal-drop); color: var(--paper); }

.demo__side p {
  font-family: var(--font-jp);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink-text);
  margin-bottom: 14px;
}
.demo__side strong {
  font-weight: 900;
  color: var(--ink-navy);
  background: linear-gradient(transparent 60%, var(--bg-peach) 60%);
  padding: 0 2px;
}

/* =============================================================
 * FAQ accordion
 * ========================================================== */
.faq {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}
.faq__item {
  background: var(--paper);
  border: var(--b-heavy) solid var(--ink-navy);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-pill);
  overflow: hidden;
}
.faq__q {
  width: 100%;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font-jp);
  font-weight: 900;
  font-size: 15px;
  color: var(--ink-navy);
  text-align: left;
}
.faq__q::after {
  content: '+';
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 22px;
  color: var(--ink-navy);
  transition: transform .2s;
}
.faq__item[open] .faq__q::after { transform: rotate(45deg); }
.faq__a {
  padding: 0 20px 18px;
  font-family: var(--font-jp);
  font-weight: 500;
  font-size: 14px;
  line-height: 1.75;
  color: var(--ink-text);
  border-top: var(--b-light) solid var(--paper-edge);
  padding-top: 14px;
}

/* =============================================================
 * contact
 * ========================================================== */
.contact {
  text-align: center;
}
.contact__row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--paper);
  border: var(--b-heavy) solid var(--ink-navy);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-pill);
  padding: 10px 10px 10px 22px;
  margin: 20px 0 12px;
}
.contact__email {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  color: var(--ink-navy);
  letter-spacing: 0.02em;
}
.contact__copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--r-pill);
  background: var(--fill-primary);
  color: var(--paper);
  border: var(--b-light) solid var(--ink-navy);
  font-family: var(--font-jp);
  font-weight: 800;
  font-size: 13px;
  transition: background .15s;
}
.contact__copy:hover { background: var(--fill-hover); }
.contact__copy.is-copied {
  background: var(--goal-hit);
}
.contact__note {
  font-family: var(--font-jp);
  font-weight: 500;
  font-size: 13px;
  color: var(--ink-text);
  opacity: 0.65;
}

/* =============================================================
 * footer
 * ========================================================== */
.footer {
  border-top: var(--b-heavy) solid var(--ink-navy);
  background: var(--bg-cream);
  padding: 42px 0 36px;
  margin-top: 40px;
}
.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.footer__brand {
  font-family: var(--font-display);
  font-weight: 900;
  font-style: italic;
  font-size: 20px;
  color: var(--ink-navy);
  letter-spacing: -0.02em;
}
.footer__links {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}
.footer__links a {
  font-family: var(--font-jp);
  font-weight: 700;
  font-size: 13px;
  color: var(--ink-text);
  border-bottom: 1px dotted var(--ink-faint);
  padding-bottom: 2px;
}
.footer__links a:hover { color: var(--ink-navy); border-bottom-color: var(--ink-navy); }
.footer__copy {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 12px;
  color: var(--ink-text);
  opacity: 0.65;
  width: 100%;
  text-align: center;
  margin-top: 18px;
}

/* =============================================================
 * legal document layout (privacy / terms)
 * ========================================================== */
.legal {
  padding: 60px 0 80px;
}
.legal__paper {
  background: var(--paper);
  border: var(--b-heavy) solid var(--ink-navy);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: clamp(28px, 4vw, 48px);
}
.legal__eyebrow {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.32em;
  color: var(--ink-navy);
  opacity: 0.55;
  margin-bottom: 6px;
}
.legal__title {
  font-family: var(--font-jp);
  font-weight: 900;
  font-size: clamp(28px, 4vw, 40px);
  color: var(--ink-navy);
  margin-bottom: 8px;
}
.legal__meta {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  color: var(--ink-text);
  opacity: 0.7;
  margin-bottom: 30px;
}
.legal h2 {
  font-family: var(--font-jp);
  font-weight: 900;
  font-size: 20px;
  color: var(--ink-navy);
  margin: 32px 0 12px;
  padding-bottom: 6px;
  border-bottom: var(--b-light) solid var(--paper-edge);
}
.legal h3 {
  font-family: var(--font-jp);
  font-weight: 900;
  font-size: 16px;
  color: var(--ink-navy);
  margin: 22px 0 8px;
}
.legal p,
.legal li {
  font-family: var(--font-jp);
  font-weight: 500;
  font-size: 15px;
  line-height: 1.85;
  color: var(--ink-text);
}
.legal p { margin: 8px 0 12px; }
.legal ul {
  list-style: disc;
  padding-left: 22px;
  margin: 8px 0 16px;
}
.legal ul li { margin-bottom: 6px; }
.legal a {
  color: var(--fill-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.legal__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 30px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--ink-navy);
  opacity: 0.75;
}
.legal__back:hover { opacity: 1; }

/* =============================================================
 * reveal on scroll
 * ========================================================== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s ease-out, transform .6s ease-out;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* =============================================================
 * responsive tweaks
 * ========================================================== */
@media (max-width: 640px) {
  /* スマホ幅ではブランドロゴだけ残し、ナビは非表示にする（4 項目を
     並べると横幅が足りずに見切れる、または brand とぶつかるため）。
     ページ内リンクはフッターと本文内のセクションからでも到達できる。 */
  .topbar__nav { display: none; }
  .topbar__inner { justify-content: center; }
  .hero { padding: 48px 0 60px; }
  .section { padding: 48px 0 56px; }
  .demo__stage { height: 340px; }
  .demo__card { height: 300px; }
}
