/* KOTOKOTO — アプリの「精密な小型ガジェット」の面から。グラファイトの地に、指針のシグナルオレンジを一点だけ。
   配色はアプリの DesignSystem/Theme.swift（ダーク）と起動画面の LaunchBackground に合わせてある。 */
:root {
  --bg: #17181a;
  --panel: #1b1c1f;
  --panel-2: #232427;
  --line: #2e2f33;
  --ink: #ece9e2;
  --dim: #a4a39d;      /* 背景に対して 4.5:1 以上 */
  --gold: #e8843a;     /* アプリの accent（指針の色）。名前は gemseed.css に合わせている */
  --lantern: #e8843a;
  --forecast: #93acd8; /* 未確定・予想の色 */
  --radius: 16px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); scroll-behavior: smooth; color-scheme: dark; }
body {
  background: var(--bg); color: var(--ink);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", system-ui, sans-serif;
  font-size: 15px; line-height: 1.95; letter-spacing: .02em;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--gold); text-underline-offset: 3px; }
img { display: block; max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--lantern); outline-offset: 3px; border-radius: 6px; }
b, strong { font-weight: 700; }

.skip {
  position: absolute; top: -60px; left: 16px; z-index: 20;
  padding: 8px 14px; border-radius: 999px; background: var(--gold); color: #1a1a1a;
  font-size: 12px; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---- 上のバー ---- */
.topbar {
  display: flex; align-items: center; gap: 6px; min-height: 58px;
  padding: 0 max(16px, env(safe-area-inset-left));
  background: rgba(23, 24, 26, .9); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.topbar a {
  padding: 6px 12px; border-radius: 999px;
  color: var(--dim); font-size: 12px; text-decoration: none; white-space: nowrap;
}
.topbar a:hover { color: var(--ink); background: var(--panel-2); }
.topbar a[aria-current="page"] { color: var(--ink); background: var(--panel-2); }
.topbar .home {
  display: flex; align-items: center; gap: 7px; margin-right: auto; padding-left: 0;
  color: var(--dim); font-size: 11px; letter-spacing: .1em;
}
.topbar .home:hover { background: none; }
.topbar .home img { width: 16px; opacity: .6; }

/* ---- はじめの画面：起動画面と同じグラファイトに、ダイヤルの目盛り ---- */
.hero {
  position: relative; overflow: hidden; text-align: center;
  padding: 64px 20px 56px; isolation: isolate;
}
.hero::before {
  content: ""; position: absolute; left: 50%; top: 106px; z-index: -1; /* アイコンの中心（上の余白 64px + 半径 42px） */
  width: 200px; height: 200px; transform: translate(-50%, -50%);
  border-radius: 50%;
  background: repeating-conic-gradient(from -1deg, rgba(236,233,226,.16) 0 1.2deg, transparent 1.2deg 15deg);
  -webkit-mask: radial-gradient(circle, transparent 0 88%, #000 88.5% 100%);
  mask: radial-gradient(circle, transparent 0 88%, #000 88.5% 100%);
}
.hero .icon {
  width: 84px; height: 84px; margin: 0 auto 24px; border-radius: 20px;
  box-shadow: 0 0 0 1px rgba(236,233,226,.18), 0 10px 40px rgba(0,0,0,.45);
}
.hero h1 {
  font-family: var(--mono); font-weight: 700; color: var(--ink);
  font-size: clamp(30px, 8vw, 46px); letter-spacing: .28em; text-indent: .28em; line-height: 1.3;
}
.hero .tag { margin-top: 18px; font-size: 17px; font-weight: 700; letter-spacing: .08em; }
.hero .sub { margin-top: 8px; color: var(--dim); font-size: 13px; }
.hero .status {
  display: inline-block; margin-top: 26px; padding: 5px 16px; border-radius: 999px;
  border: 1px solid rgba(232,132,58,.5); color: var(--lantern); font-size: 12px; letter-spacing: .12em;
}

/* ---- 本文 ---- */
.wrap { width: min(100% - 32px, 760px); margin: 0 auto; }
main.wrap { padding-bottom: 20px; }
section { padding: 56px 0 8px; }
h2 { margin-bottom: 18px; font-size: 20px; letter-spacing: .06em; line-height: 1.5; font-weight: 700; }
h2 .en { display: block; margin-bottom: 4px; color: var(--lantern); font-size: 11px; letter-spacing: .22em; font-weight: 400; }
h3 { margin: 22px 0 4px; font-size: 15px; line-height: 1.6; }
h4 { margin: 20px 0 4px; font-size: 14px; }
p + p { margin-top: 12px; }
ul { padding-left: 1.3em; }
li + li { margin-top: 5px; }
.note, .updated { color: var(--dim); font-size: 12.5px; }
.lead { font-size: 16px; line-height: 1.9; }

/* 画面のならび（横にめくれる） */
.screens {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(170px, 210px); gap: 16px;
  margin-top: 26px; overflow-x: auto; padding-bottom: 12px;
  scroll-snap-type: x mandatory;
}
.screens figure { scroll-snap-align: start; }
.screens img {
  width: 100%; border-radius: 22px; background: var(--panel);
  box-shadow: 0 0 0 1px var(--line), 0 12px 30px rgba(0, 0, 0, .45);
}
.screens figcaption { margin-top: 10px; color: var(--dim); font-size: 12px; text-align: center; }

/* カード */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 6px; }
.card {
  padding: 20px 22px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line);
}
.card h3 { margin: 0 0 4px; color: var(--gold); }
.card p { color: var(--dim); font-size: 13px; line-height: 1.8; }

/* 確定と予想（アプリのホームと同じ考え方） */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.split .card .num { font-family: var(--mono); font-size: 24px; font-weight: 700; letter-spacing: 0; }
.split .pos { color: #5ec294; }
.split .fc { border-style: dashed; border-color: rgba(147,172,216,.55); background: rgba(147,172,216,.08); }
.split .fc .num, .split .fc h3 { color: var(--forecast); }
.formula {
  margin-top: 14px; padding: 12px 18px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line);
  font-family: var(--mono); font-size: 13.5px; letter-spacing: 0; overflow-x: auto; white-space: nowrap;
}

/* 表 */
.spec { width: 100%; margin-top: 6px; border-collapse: collapse; font-size: 14px; }
.spec th, .spec td { padding: 11px 4px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.spec th { width: 34%; color: var(--dim); font-weight: 400; }

/* App Store バッジ。Apple が配布しているアートワークをそのまま置く(assets/style.css と同じ指定)。
   色・比率・内部の余白は変えない。高さだけ指定し、周囲の余白はバッジ高さの 1/4 以上空ける */
.badge-appstore { display: inline-block; line-height: 0; margin: 16px 16px 0 0; border-radius: 8px; }
.badge-appstore img { height: 52px; width: auto; }

.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.links a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 10px 20px;
  border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); color: var(--ink);
  font-size: 13px; text-decoration: none; transition: background .15s, border-color .15s, color .15s;
}
.links a:hover { border-color: var(--gold); color: var(--gold); }

.contact { margin-top: 16px; padding: 18px 22px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.contact .addr { font-size: 15px; font-weight: 700; letter-spacing: .03em; overflow-wrap: anywhere; }

/* 規約・ポリシー・サポート */
.doc { width: min(100% - 32px, 680px); }
.doc > section:first-child { padding-top: 40px; }
.doc h1 {
  padding-bottom: 14px; border-bottom: 1px solid var(--gold); color: var(--gold);
  font-weight: 700;
  font-size: clamp(21px, 5vw, 26px); letter-spacing: .05em; line-height: 1.5;
}
.doc h1 + .updated, .doc h1 + .lead { margin-top: 12px; }
.doc h2 { margin-top: 38px; margin-bottom: 10px; font-size: 16px; }
.doc section > h2:first-child { margin-top: 0; }

/* 英語 */
section.en { margin-top: 48px; padding-top: 40px; border-top: 1px solid var(--line); }
section.en > h2 { font-size: 18px; }
section.en h3 { color: var(--dim); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }

.wrap.foot { padding-bottom: 48px; }
footer {
  margin-top: 40px; padding: 28px 0; border-top: 1px solid var(--line);
  color: var(--dim); font-size: 11px; text-align: center;
}
footer .row { display: flex; justify-content: center; flex-wrap: wrap; gap: 16px; margin-top: 8px; }
footer .row a { color: var(--dim); text-decoration: none; }
footer .row a:hover { color: var(--gold); }

@media (max-width: 640px) {
  .topbar { gap: 2px; overflow-x: auto; }
  .topbar a { padding: 6px 9px; font-size: 11px; }
  .hero { padding-top: 44px; padding-bottom: 44px; }
  .hero::before { top: 86px; }
  .hero .tag { font-size: 15px; }
  .cards { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
