/* 公式サイトの見た目。アプリのホーム画面と同じ「夜の書斎」: 紺の地・象牙色の文字・封蝋の赤・真鍮。
   外部のフォントは読み込まない（明朝体は端末にあるものを使う）。 */
:root {
  --navy-top: #0f1b33;
  --navy-bottom: #1f3158;
  --surface: rgba(239, 230, 210, 0.05);
  --line: rgba(239, 230, 210, 0.22);
  --ivory: #efe6d2;
  --muted: rgba(239, 230, 210, 0.66);
  --brass: #c9a86a;
  --seal: #9a3530;
  --serif-latin: Georgia, 'Times New Roman', serif;
  --serif: 'Hiragino Mincho ProN', 'Yu Mincho', YuMincho, 'Noto Serif JP', 'AppleMyungjo', 'Nanum Myeongjo',
    'Noto Serif KR', Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Yu Gothic UI', 'Apple SD Gothic Neo',
    'Malgun Gothic', 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--navy-top);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ivory);
  font-family: var(--sans);
  line-height: 1.8;
  background: linear-gradient(180deg, var(--navy-top) 0%, var(--navy-bottom) 100%) fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: var(--brass);
}

/* 卓上ランプの灯り: 明るさと大きさをゆっくり揺らし、ときどき小さくまたたく */
.glow {
  position: fixed;
  top: -45vmax;
  left: 50%;
  width: 110vmax;
  height: 110vmax;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(255, 214, 160, 0.26) 0%, rgba(255, 214, 160, 0.08) 38%, transparent 66%);
  pointer-events: none;
  animation: flicker 9s ease-in-out infinite;
  z-index: 0;
}

.doc .glow {
  opacity: 0.5;
  animation: none;
}

@keyframes flicker {
  0%, 100% { opacity: 0.9; transform: translateX(-50%) scale(1); }
  18% { opacity: 1; transform: translateX(-50%) scale(1.03); }
  31% { opacity: 0.84; }
  32% { opacity: 0.66; }
  34% { opacity: 0.88; }
  52% { opacity: 0.96; transform: translateX(-50%) scale(1.02); }
  70% { opacity: 0.82; transform: translateX(-50%) scale(0.99); }
  71% { opacity: 0.7; }
  73% { opacity: 0.9; }
}

@media (prefers-reduced-motion: reduce) {
  .glow { animation: none; }
}

header.top,
main,
footer.foot {
  position: relative;
  z-index: 1;
  max-width: 880px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}

header.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 18px;
  padding-bottom: 18px;
}

.brand-small {
  font-family: var(--serif-latin);
  color: var(--ivory);
  text-decoration: none;
  letter-spacing: 0.08em;
}

.home .brand-small {
  visibility: hidden;
}

.langs {
  display: flex;
  gap: 4px;
  font-size: 13px;
}

.langs a,
.langs span {
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid transparent;
}

.langs span {
  color: var(--ivory);
  border-color: var(--line);
}

.langs a:hover {
  color: var(--ivory);
}

/* ---- トップ ---- */
.hero {
  text-align: center;
  padding: 40px 0 56px;
}

.app-icon {
  border-radius: 22px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

h1 {
  font-family: var(--serif-latin);
  font-weight: normal;
  font-size: clamp(44px, 9vw, 72px);
  letter-spacing: 0.06em;
  margin: 18px 0 8px;
  line-height: 1.1;
}

.rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 auto 14px;
  width: 200px;
}

.rule span {
  flex: 1;
  height: 1px;
  background: var(--muted);
}

.rule i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--seal);
}

.tagline {
  font-family: var(--serif);
  font-size: clamp(16px, 3.4vw, 20px);
  letter-spacing: 0.14em;
  color: var(--muted);
  margin: 0 0 28px;
}

.lead {
  font-size: clamp(15px, 2.8vw, 17px);
  margin: 0 auto 20px;
  max-width: 640px;
}

.coming {
  display: inline-block;
  font-size: 14px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 16px;
  margin: 0;
}

section {
  padding: 28px 0;
}

h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(20px, 4vw, 26px);
  letter-spacing: 0.08em;
  text-align: center;
  margin: 0 0 24px;
}

h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.04em;
  margin: 0 0 6px;
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

p {
  margin: 0;
}

.icon {
  width: 30px;
  height: 30px;
}

.mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1px solid rgba(201, 168, 106, 0.6);
  color: var(--brass);
  margin-bottom: 14px;
}

.mark.small {
  width: 48px;
  height: 48px;
  flex: none;
  margin: 2px 0 0;
}

.mark.small .icon {
  width: 24px;
  height: 24px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 26px 20px;
  text-align: center;
}

.card p,
.list p,
.faq p {
  color: var(--muted);
  font-size: 15px;
}

.list {
  display: grid;
  gap: 22px;
  max-width: 680px;
  margin: 0 auto;
}

.list li {
  display: flex;
  gap: 18px;
}

.promise ul {
  max-width: 640px;
  margin: 0 auto;
  border-top: 1px solid var(--line);
}

.promise li {
  padding: 14px 4px 14px 28px;
  border-bottom: 1px solid var(--line);
  position: relative;
}

.promise li::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 1.45em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--seal);
}

.faq {
  max-width: 680px;
  margin: 0 auto;
}

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

.faq summary {
  cursor: pointer;
  font-family: var(--serif);
  font-weight: 600;
}

.faq details p {
  margin-top: 8px;
}

/* ---- プライバシーポリシー ---- */
.policy {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 0 40px;
}

.policy h1 {
  font-family: var(--serif);
  font-size: clamp(26px, 5vw, 34px);
  letter-spacing: 0.06em;
  margin-bottom: 28px;
}

.policy h2 {
  text-align: left;
  font-size: 18px;
  margin: 28px 0 8px;
}

.policy p,
.policy li {
  color: var(--muted);
  font-size: 15px;
}

.policy ul {
  list-style: disc;
  padding-left: 1.4em;
}

.policy li + li {
  margin-top: 6px;
}

.policy .date {
  margin-top: 32px;
}

.policy p + p {
  margin-top: 12px;
}

footer.foot {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
  padding-top: 32px;
  padding-bottom: 40px;
  border-top: 1px solid var(--line);
  margin-top: 40px;
}

/* 韓国語は語の途中で改行しない（日本語と英語はそのまま） */
:lang(ko) {
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.section-lead {
  text-align: center;
  color: var(--muted);
  max-width: 640px;
  margin: -8px auto 28px;
}

/* ---- 暗号化の図: 平文 → 封をした錠 → 暗号文 ---- */
.cipher-flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  max-width: 760px;
  margin: 0 auto;
}

.paper {
  margin: 0;
  padding: 18px 16px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
}

.paper ul {
  display: grid;
  gap: 8px;
}

.paper li {
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.paper.plain li {
  font-family: var(--serif);
}

.paper.cipher li {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color: var(--brass);
  letter-spacing: 0.06em;
  animation: scramble 3.2s steps(1) infinite;
}

.paper.cipher li:nth-child(2) { animation-delay: -0.8s; }
.paper.cipher li:nth-child(3) { animation-delay: -1.6s; }
.paper.cipher li:nth-child(4) { animation-delay: -2.4s; }

/* 暗号文が絶えず入れ替わって見えるよう、少しずつ明滅させる */
@keyframes scramble {
  0% { opacity: 1; }
  25% { opacity: 0.55; }
  50% { opacity: 0.9; }
  75% { opacity: 0.4; }
}

.paper figcaption {
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.seal-lock {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
}

.flow-line {
  width: 2px;
  height: 22px;
  background: repeating-linear-gradient(180deg, var(--brass) 0 4px, transparent 4px 8px);
  background-size: 2px 16px;
  animation: flow 1s linear infinite;
}

@keyframes flow {
  from { background-position: 0 0; }
  to { background-position: 0 16px; }
}

.lock-circle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 1px solid var(--brass);
  color: var(--brass);
  background: rgba(201, 168, 106, 0.08);
  box-shadow: 0 0 0 8px rgba(201, 168, 106, 0.06), 0 0 30px rgba(255, 214, 160, 0.18);
  animation: breathe 4s ease-in-out infinite;
}

.lock-circle .icon {
  width: 38px;
  height: 38px;
}

.lock-circle .wax {
  position: absolute;
  right: 2px;
  bottom: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--seal);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.12);
}

@keyframes breathe {
  0%, 100% { box-shadow: 0 0 0 8px rgba(201, 168, 106, 0.06), 0 0 24px rgba(255, 214, 160, 0.14); }
  50% { box-shadow: 0 0 0 12px rgba(201, 168, 106, 0.1), 0 0 40px rgba(255, 214, 160, 0.26); }
}

.lock-caption {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  max-width: 120px;
}

/* 横に並べられる幅では、流れを横向きに */
@media (min-width: 640px) {
  .seal-lock { flex-direction: row; }
  .flow-line {
    width: 26px;
    height: 2px;
    background: repeating-linear-gradient(90deg, var(--brass) 0 4px, transparent 4px 8px);
    background-size: 16px 2px;
    animation-name: flow-x;
  }
  .lock-caption {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 8px;
    width: 140px;
    max-width: none;
  }
}

@keyframes flow-x {
  from { background-position: 0 0; }
  to { background-position: 16px 0; }
}

@media (max-width: 639px) {
  .cipher-flow { grid-template-columns: 1fr; }
}

.crypto-points {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  max-width: 760px;
  margin: 56px auto 0;
}

.crypto-points li {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.crypto-points h3 {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color: var(--brass);
  font-size: 15px;
}

.crypto-points p {
  color: var(--muted);
  font-size: 14px;
}

@media (prefers-reduced-motion: reduce) {
  .paper.cipher li, .flow-line, .lock-circle { animation: none; }
}

/* ---- 画面の例（スマホの枠の中に、アプリの画面を HTML で描く） ---- */
.phones {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 22px;
  justify-items: center;
}

.phone {
  margin: 0;
  text-align: center;
}

.phone figcaption {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}

.phone-frame {
  width: 180px;
  height: 370px;
  border-radius: 30px;
  padding: 8px;
  background: #0a1122;
  box-shadow: 0 0 0 1px rgba(239, 230, 210, 0.18), 0 18px 40px rgba(0, 0, 0, 0.45);
}

.m-screen {
  height: 100%;
  border-radius: 23px;
  overflow: hidden;
  padding: 26px 10px 10px;
  text-align: left;
  font-size: 10px;
  line-height: 1.4;
}

/* 夜と昼の配色（アプリの src/ui/theme.tsx と同じ） */
.theme-night .m-screen {
  --m-surface: #1c2b4c;
  --m-text: #efe6d2;
  --m-muted: #a9a493;
  --m-line: #36456b;
  --m-accent: #c9a86a;
  --m-on-accent: #15223f;
  background: linear-gradient(180deg, #0f1b33, #1f3158);
  color: var(--m-text);
}

.theme-day .m-screen {
  --m-surface: #fbf7ee;
  --m-text: #1f2a44;
  --m-muted: #6b6658;
  --m-line: #d9cfba;
  --m-accent: #8a6a2f;
  --m-on-accent: #fbf7ee;
  background: #f4eee1;
  color: var(--m-text);
}

.theme-night .m-home {
  background: radial-gradient(circle at 50% 4%, rgba(255, 214, 160, 0.22), transparent 55%),
    linear-gradient(180deg, #0f1b33, #1f3158);
}

.m-brand {
  font-family: var(--serif-latin);
  font-size: 22px;
  text-align: center;
  letter-spacing: 0.06em;
  margin-top: 4px;
}

.m-rule {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 80px;
  margin: 4px auto;
}

.m-rule span {
  flex: 1;
  height: 1px;
  background: var(--m-muted);
}

.m-rule i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--seal);
}

.m-tag {
  font-family: var(--serif);
  text-align: center;
  font-size: 8px;
  color: var(--m-muted);
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}

.m-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.m-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 4px;
  border: 1px solid var(--m-line);
  border-radius: 3px;
  background: rgba(239, 230, 210, 0.05);
}

.theme-day .m-tile {
  background: rgba(255, 255, 255, 0.55);
}

.m-tile b {
  font-family: var(--serif);
  font-size: 9px;
}

.m-tile small {
  font-family: var(--serif-latin);
  font-size: 11px;
  color: var(--m-muted);
}

.m-tile em {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 12px;
  height: 12px;
  border-radius: 6px;
  background: var(--seal);
  color: #efe6d2;
  font-style: normal;
  font-size: 8px;
  line-height: 12px;
  text-align: center;
}

.m-ring {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid;
}

.m-ring .icon {
  width: 17px;
  height: 17px;
  color: var(--m-text);
}

.m-images { border-color: #a9504aaa; background: #a9504a40; }
.m-key { border-color: #b08d52aa; background: #b08d5240; }
.m-chat { border-color: #5e8a6eaa; background: #5e8a6e40; }
.m-ledger { border-color: #5b7fa8aa; background: #5b7fa840; }

.m-title {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
}

.m-title.center {
  text-align: center;
  font-size: 11px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--m-line);
}

.m-search {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 7px;
  border-radius: 6px;
  border: 1px solid var(--m-line);
  background: var(--m-surface);
  color: var(--m-muted);
  margin-bottom: 8px;
}

.m-search .icon {
  width: 10px;
  height: 10px;
}

.m-list ul li {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 2px;
  border-bottom: 1px solid var(--m-line);
}

.m-fav {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  background: var(--m-surface);
  border: 1px solid var(--m-line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
}

.m-row {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.m-row b {
  font-size: 10px;
  font-weight: 600;
}

.m-row small {
  font-size: 8px;
  color: var(--m-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m-flag {
  font-style: normal;
  font-size: 7px;
  padding: 1px 5px;
  border-radius: 6px;
  background: #e06a5f;
  color: #15223f;
}

/* トークの画面では、ul を吹き出しの並びに使う（アイコンの色の .m-chat と区別するため .m-screen を付ける） */
.m-screen.m-chat {
  border: 0;
}

.m-screen.m-chat ul {
  display: grid;
  gap: 7px;
  padding-top: 10px;
}

.m-screen.m-chat li {
  display: flex;
}

.m-screen.m-chat li span {
  max-width: 78%;
  padding: 6px 9px;
  border-radius: 12px;
  font-size: 9px;
}

.m-screen.m-chat li.them span {
  background: var(--m-surface);
  border: 1px solid var(--m-line);
}

.m-screen.m-chat li.me {
  justify-content: flex-end;
}

.m-screen.m-chat li.me span {
  background: var(--m-accent);
  color: var(--m-on-accent);
}

/* 特定商取引法に基づく表記の表 */
table.legal {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

table.legal th,
table.legal td {
  text-align: left;
  vertical-align: top;
  padding: 12px 8px;
  border-bottom: 1px solid var(--line);
}

table.legal th {
  width: 34%;
  font-family: var(--serif);
  font-weight: 600;
  color: var(--ivory);
}

table.legal td {
  color: var(--muted);
}

@media (max-width: 560px) {
  table.legal th,
  table.legal td {
    display: block;
    width: auto;
    border-bottom: 0;
    padding: 6px 4px;
  }
  table.legal tr {
    display: block;
    border-bottom: 1px solid var(--line);
    padding: 8px 0;
  }
}
