/* RIDESYNC — 紹介・サポートサイト。スクリプトも外部の読み込みもなし。
   色はアプリと同じ黒と白。赤は記録中の印だけに使う。
   動きはアプリの MOTION_DESIGN_GUIDELINES.md の値（時間・カーブ・距離）にそろえる。 */

@font-face {
  font-family: "Barlow";
  src: url("/assets/fonts/barlow-700i.ttf") format("truetype");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("/assets/fonts/barlow-600.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #000;
  --raise: #0c0c0c;
  --card: #121212;
  --line: #232323;
  --line-strong: #333;
  --ink: #fff;
  --sub: #a8a8a8;
  --faint: #6e6e6e;
  --rec: #ff4d4d;
  --radius: 28px;
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", system-ui, sans-serif;
  --metric: "Barlow", "Helvetica Neue", Arial, sans-serif;

  /* MotionDurations / MotionCurves */
  --fast: 250ms;
  --medium: 350ms;
  --slow: 500ms;
  --very-slow: 800ms;
  --extra-slow: 1200ms;
  --route: 2500ms;
  --standard: cubic-bezier(.65, 0, .35, 1);   /* easeInOutCubic */
  --emphasized: cubic-bezier(.4, 0, .2, 1);   /* fastOutSlowIn */
  --decelerate: cubic-bezier(0, 0, .58, 1);   /* easeOut */
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.8 var(--font);
  font-feature-settings: "palt";
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.3; letter-spacing: .01em; text-wrap: balance; }
/* 日本語の見出しを句の途中で折り返さない。 */
.nw { display: inline-block; }
p { margin: 0; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 10px; z-index: 10; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 8px; }

/* 数字とロゴ。アプリの走行距離と同じ Barlow の斜体。 */
.metric { font-family: var(--metric); font-weight: 700; font-style: italic; font-feature-settings: "tnum"; letter-spacing: -.01em; }
.wordmark { font-family: var(--metric); font-weight: 700; font-style: italic; font-size: 22px; letter-spacing: .02em; line-height: 1; }

/* 記録中の印。アプリと同じく赤い点がゆっくり明滅する。 */
.rec {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px 3px 8px; border-radius: 999px;
  background: rgba(255, 77, 77, .12); color: var(--rec);
  font: 700 12px/1.4 var(--metric); letter-spacing: .12em;
}
.rec::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--rec);
  animation: blink var(--extra-slow) var(--standard) infinite alternate;
}

/* ---- 上の帯 ---- */
.bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px max(20px, env(safe-area-inset-left)) 14px max(20px, env(safe-area-inset-right));
  background: rgba(0, 0, 0, .72);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-icon { width: 32px; height: 32px; border-radius: 8px; box-shadow: 0 0 0 1px var(--line-strong); }
.bar-nav { display: flex; align-items: center; gap: 22px; font-size: 14px; font-weight: 600; }
.bar-nav a { text-decoration: none; color: var(--sub); white-space: nowrap; transition: color var(--fast) var(--standard); }
.bar-nav a:hover { color: var(--ink); }
/* もう一方の言語へ。小さな枠で、ほかのリンクと分ける。 */
.bar-nav .lang { padding: 1px 10px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 12px; }
.bar-nav .lang:hover { border-color: var(--sub); }

/* ---- はじめの画面 ---- */
.hero {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 40px;
  max-width: 1120px; margin: 0 auto; padding: 72px 20px 88px;
}
.hero-text > * { animation: rise var(--slow) var(--decelerate) both; }
.hero-text > :nth-child(2) { animation-delay: 50ms; }
.hero-text > :nth-child(3) { animation-delay: 100ms; }
.hero-text > :nth-child(4) { animation-delay: 150ms; }
.hero-text > :nth-child(5) { animation-delay: 200ms; }
.eyebrow { display: flex; align-items: center; gap: 12px; color: var(--sub); font-size: 14px; font-weight: 600; }
h1 {
  margin-top: 22px;
  font-size: clamp(40px, 6.4vw, 72px);
  font-weight: 800;
  letter-spacing: .01em;
  line-height: 1.2;
}
.hero h1:lang(en) { font-size: clamp(32px, 5.6vw, 64px); letter-spacing: -.01em; line-height: 1.12; }
.lead { margin-top: 24px; max-width: 30em; color: var(--sub); font-size: clamp(15px, 2vw, 18px); }
.cta { margin-top: 32px; display: flex; gap: 12px; flex-wrap: wrap; }
.store, .ghost {
  display: inline-flex; align-items: center; gap: 8px;
  height: 52px; padding: 0 26px; border-radius: 999px;
  font-weight: 700; font-size: 15px; text-decoration: none; white-space: nowrap;
}
.store {
  background: var(--ink); color: var(--bg);
  transition: transform var(--fast) var(--emphasized), box-shadow var(--fast) var(--emphasized);
}
.store:hover { transform: translateY(-2px); box-shadow: 0 12px 28px -14px rgba(255, 255, 255, .5); }
.store:active { transform: scale(.95); }
.ghost { border: 1px solid var(--line-strong); color: var(--sub); }
.free { margin-top: 18px; color: var(--faint); font-size: 13px; }

/* 走った道の線。2.5秒かけて引く。 */
.hero-media { position: relative; display: flex; justify-content: center; }
.road { position: absolute; left: -38%; top: -4%; width: 176%; height: 108%; pointer-events: none; }
.road path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.road .ghost-line { stroke: #1b1b1b; stroke-width: 10; }
.road .live-line {
  stroke: #fff; stroke-width: 3; opacity: .85;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: draw var(--route) var(--standard) 300ms forwards;
}
.road circle { fill: #000; stroke: #fff; stroke-width: 3; }
.road .end { opacity: 0; animation: appear var(--fast) var(--decelerate) 2800ms forwards; }

/* 電話の枠 */
.phone {
  position: relative; width: 300px; flex: none;
  padding: 10px; border-radius: 52px;
  background: #0e0e0e;
  box-shadow: 0 50px 90px -40px rgba(255, 255, 255, .14), inset 0 0 0 2px #2a2a2a;
}
.phone img { border-radius: 42px; }
.hero .phone { width: 320px; animation: enter var(--very-slow) var(--emphasized) 150ms both; }

/* ---- 各段 ---- */
.feature, .more, .privacy, .premium, .closing {
  max-width: 1120px; margin: 0 auto; padding: 104px 20px 0;
}
.feature {
  display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 72px;
}
.feature.flip .feature-media { order: -1; }
.feature-media { display: flex; justify-content: center; }
.kicker { font: 700 13px/1.4 var(--metric); letter-spacing: .18em; color: var(--faint); text-transform: uppercase; }
section h2 { margin-top: 14px; font-size: clamp(28px, 4.4vw, 44px); font-weight: 800; }
section h2:lang(en) { letter-spacing: -.01em; }
.feature p.body { margin-top: 20px; color: var(--sub); max-width: 30em; }
.specs { list-style: none; padding: 0; margin: 26px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.specs li { padding: 6px 14px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--sub); }

/* ロック画面に出る記録。アプリの Live Activity と同じ並び。 */
.lock {
  position: relative; width: 340px; max-width: 100%; aspect-ratio: 340 / 430;
  border-radius: 44px; overflow: hidden;
  background:
    radial-gradient(120% 80% at 30% 0%, #2a2a2a 0%, transparent 60%),
    radial-gradient(90% 70% at 100% 100%, #1d1d1d 0%, transparent 70%),
    #050505;
  box-shadow: inset 0 0 0 2px #232323;
  display: flex; flex-direction: column; align-items: center;
  padding: 34px 16px 16px;
}
.lock-date { font-size: 14px; font-weight: 600; color: #cfcfcf; }
.lock-time { font: 600 84px/1 var(--font); letter-spacing: -.02em; color: #e8e8e8; margin-top: 4px; }
.live {
  margin-top: auto; width: 100%;
  padding: 14px 16px 16px; border-radius: 26px;
  background: rgba(14, 14, 14, .9);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
}
.live-top { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.live-top .rec { font-size: 11px; padding: 2px 8px 2px 7px; }
.live-top b { margin-left: auto; font: 800 11px/1 var(--font); letter-spacing: .06em; color: var(--faint); }
.live-grid { margin-top: 10px; display: grid; grid-template-columns: 1.3fr 1fr; gap: 6px 12px; align-items: end; }
.live small { display: block; font-size: 10px; font-weight: 700; letter-spacing: .1em; color: var(--faint); }
.live-km { grid-row: span 2; }
.live-km .num { display: flex; align-items: baseline; gap: 4px; }
.live-km .metric { font-size: 48px; line-height: 1; }
.live-km .unit { font-size: 15px; color: var(--sub); }
.live-time .metric, .live-top-speed .metric { font-size: 22px; line-height: 1.1; }
.live-top-speed .unit { font-size: 11px; color: var(--sub); margin-left: 2px; }
/* 経過時間を進める（1:12:08 から）。@property が使えないブラウザでは止まって見えるだけ。 */
@property --min { syntax: "<integer>"; inherits: false; initial-value: 12; }
@property --sec { syntax: "<integer>"; inherits: false; initial-value: 8; }
.tick {
  counter-reset: min var(--min) sec var(--sec);
  animation: seconds 60s steps(60, end) -8s infinite, minutes 3600s steps(60, end) -728s infinite;
}
.tick::after { content: counter(min, decimal-leading-zero) ":" counter(sec, decimal-leading-zero); }

/* ---- ほかにも ---- */
.more > h2 { text-align: center; }
.cards { list-style: none; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.cards li {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; display: flex; flex-direction: column; gap: 10px;
  transition: border-color var(--medium) var(--standard), transform var(--medium) var(--emphasized);
}
.cards li:hover { border-color: var(--line-strong); transform: translateY(-4px); }
.cards h3 { font-size: 19px; font-weight: 800; }
.cards p { color: var(--sub); font-size: 15px; line-height: 1.75; }
.cards .big { font-size: 40px; line-height: 1; margin-bottom: 6px; }
.cards .big span { font: 600 15px var(--font); color: var(--sub); margin-left: 4px; }

/* ---- プライバシー ---- */
.privacy-box {
  border-radius: 36px; padding: clamp(32px, 6vw, 64px);
  background: linear-gradient(180deg, #111 0%, #070707 100%);
  border: 1px solid var(--line);
  text-align: center;
}
.privacy-box p { margin: 20px auto 0; max-width: 34em; color: var(--sub); }

/* ---- Premium ---- */
.premium { display: grid; grid-template-columns: .9fr 1.1fr; gap: 56px; align-items: start; }
.premium p.body { margin-top: 20px; color: var(--sub); }
.premium .muted { margin-top: 14px; color: var(--faint); font-size: 14px; }
.perks { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.perks li { padding: 16px 0; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 15px; display: flex; gap: 12px; align-items: baseline; }
.perks li::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--ink); transform: translateY(-3px); }
.perks small { display: block; color: var(--faint); font-size: 12px; font-weight: 600; }

/* ---- 最後の呼びかけ ---- */
.closing { text-align: center; padding-bottom: 112px; }
.closing img { width: 88px; height: 88px; border-radius: 20px; margin: 0 auto; box-shadow: 0 0 0 1px var(--line-strong); }
.closing h2 { margin-top: 26px; font: 700 italic clamp(34px, 6vw, 60px)/1.1 var(--metric); letter-spacing: .01em; }
.closing .cta { justify-content: center; }

/* ---- 下の帯 ---- */
.foot {
  border-top: 1px solid var(--line);
  padding: 28px max(20px, env(safe-area-inset-left)) calc(28px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap; color: var(--sub); font-size: 13px;
}
.foot .wordmark { font-size: 17px; color: var(--ink); }
.foot nav { display: flex; gap: 18px; flex-wrap: wrap; }
.foot nav a { text-decoration: none; }
.foot nav a:hover { text-decoration: underline; }
.foot small { margin-left: auto; }

/* ---- サポートのページ ---- */
.doc { max-width: 760px; margin: 0 auto; padding: 56px 20px 72px; }
.doc h1 { font-size: clamp(30px, 6vw, 42px); margin: 0; }
.doc .intro { margin-top: 22px; color: var(--sub); }
.doc h2 { font-size: 20px; margin: 44px 0 12px; }
.doc ol { padding-left: 1.3em; }
.doc li + li { margin-top: 6px; }
.doc ol li::marker { font-family: var(--metric); font-weight: 700; font-style: italic; color: var(--sub); }
details { border-bottom: 1px solid var(--line); }
summary {
  cursor: pointer; list-style: none; padding: 20px 4px; font-weight: 700; font-size: 16px;
  display: flex; justify-content: space-between; gap: 16px;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--sub); font-weight: 400; font-size: 22px; line-height: 1; transition: transform var(--fast) var(--emphasized); }
details[open] summary::after { transform: rotate(45deg); }
details p { padding: 0 4px 22px; color: var(--sub); }
details[open] p { animation: rise var(--medium) var(--decelerate) both; }
.doc .contact { margin-top: 44px; padding: 24px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); }
.doc .contact h2 { margin-top: 0; }
.doc .mail { font-weight: 800; font-size: 18px; }
.doc .muted { color: var(--sub); font-size: 14px; margin-top: 10px; }

.lost { min-height: 80vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center; padding: 40px 20px; }
.lost .metric { font-size: 120px; line-height: 1; }
.lost p { color: var(--sub); }
.lost .cta { justify-content: center; margin-top: 8px; }

/* ---- 動き ---- */
@keyframes rise { from { opacity: 0; transform: translateY(24px); } }
@keyframes enter { from { opacity: 0; transform: translateY(48px) scale(.95); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes appear { to { opacity: 1; } }
@keyframes blink { to { opacity: .3; } }
@keyframes seconds { from { --sec: 0; } to { --sec: 60; } }
@keyframes minutes { from { --min: 0; } to { --min: 60; } }

/* スクロールで見えてきたら浮かせる。対応していないブラウザでは最初から見えている。 */
@supports (animation-timeline: view()) {
  .reveal {
    animation: rise linear both;
    animation-timing-function: var(--decelerate);
    animation-timeline: view();
    animation-range: entry 0% entry 60%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .road .live-line { stroke-dashoffset: 0; }
  .road .end { opacity: 1; }
}

/* ---- 幅のせまい画面 ---- */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; text-align: center; padding-top: 48px; gap: 56px; }
  .eyebrow, .cta { justify-content: center; }
  .lead { margin-left: auto; margin-right: auto; }
  .feature, .premium { grid-template-columns: 1fr; gap: 44px; }
  .feature.flip .feature-media { order: 0; }
  .feature-text { text-align: center; }
  .feature p.body { margin-left: auto; margin-right: auto; }
  .specs { justify-content: center; }
  .cards { grid-template-columns: 1fr 1fr; }
  .premium-text { text-align: center; }
}
@media (max-width: 640px) {
  .bar-nav { gap: 16px; font-size: 13px; }
  .hero .phone { width: 272px; }
  .phone { width: 260px; padding: 8px; border-radius: 46px; }
  .phone img { border-radius: 38px; }
  .feature, .more, .privacy, .premium, .closing { padding-top: 80px; }
  .cards { grid-template-columns: 1fr; }
  .perks { grid-template-columns: 1fr; }
  .lock-time { font-size: 72px; }
  .foot small { margin-left: 0; width: 100%; }
}
/* ごく狭い画面では、ページ内へのリンクを外して言語の切り替えを残す。 */
@media (max-width: 420px) {
  .bar-nav { gap: 14px; }
  .bar-nav a[href^="#"] { display: none; }
  .wordmark { font-size: 19px; }
}
