/* Ebbing 公式サイト — docs/design-language.md の Web 翻訳。
 * 淡グレー背景 + 不透明白カード（縁取り + 薄い影）、ダークはニュートラル黒。
 * 操作系（ヘッダ）だけ blur の glass、コンテンツは不透明カード（ADR-0010 の精神）。 */

/* ---------- tokens ---------- */

:root {
  /* EbbingColor.screenBackground / cardBackground / cardBorder / hairline のライト値 */
  --bg: #EEF1F6;
  --bg-deep: #E6EBF2;
  --card: #FFFFFF;
  --card-border: rgba(142, 154, 168, 0.22);
  --shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
  --shadow-raise: 0 8px 28px rgba(24, 39, 58, 0.12);
  --text: #17191C;
  --text-secondary: #5D6672;
  --hairline: #ECECF1;
  --accent: #007AFF;          /* EbbingColor.accent (iOS Blue) */
  --accent-tint: rgba(0, 122, 255, 0.10);
  --tide: #5AC8FA;            /* 潮アニメの水色（ブランド差し色） */
  --tide-strong: #1FA6E8;
  --tide-tint: rgba(90, 200, 250, 0.16);
  --warning: #FF9500;
  --muted-line: #AEAEB2;      /* systemGray2（白地でのコントラスト確保。アプリの gray3 より一段濃く） */
  --glass: rgba(238, 241, 246, 0.72);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B0B0C;
    --bg-deep: #101012;
    --card: #1C1C1E;
    --card-border: rgba(84, 84, 88, 0.30);
    --shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    --shadow-raise: 0 10px 32px rgba(0, 0, 0, 0.55);
    --text: #F2F2F7;
    --text-secondary: #9A9AA2;
    --hairline: #2C2C2E;      /* systemGray5 (dark) */
    --accent: #0A84FF;
    --accent-tint: rgba(10, 132, 255, 0.16);
    --tide-strong: #5AC8FA;
    --tide-tint: rgba(90, 200, 250, 0.14);
    --muted-line: #48484A;
    --glass: rgba(11, 11, 12, 0.72);
  }
}

/* ---------- base ---------- */

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans",
    "Hiragino Kaku Gothic ProN", "Yu Gothic Medium", "Yu Gothic", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 860px; }

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

/* ---------- header（操作系: glass） ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  backdrop-filter: saturate(1.6) blur(18px);
  border-bottom: 1px solid var(--card-border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand-icon { border-radius: 7px; }

.header-nav { display: flex; gap: 20px; margin-left: auto; }
.header-nav a {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 4px 2px;
}
.header-nav a:hover { color: var(--text); text-decoration: none; }
.header-nav a.active { color: var(--text); }

.header-cta {
  background: var(--accent);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 999px;
  white-space: nowrap;
}
.header-cta:hover { text-decoration: none; filter: brightness(1.08); }

/* ---------- buttons ---------- */

.button-primary,
.button-secondary {
  display: inline-block;
  font-weight: 700;
  border-radius: 999px;
  padding: 12px 26px;
  font-size: 0.98rem;
}
.button-primary { background: var(--accent); color: #fff; }
.button-primary:hover { text-decoration: none; filter: brightness(1.08); }
.button-secondary {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
}
.button-secondary:hover { text-decoration: none; box-shadow: var(--shadow-raise); }

.store-badge { height: 54px; width: auto; }
.store-link { display: inline-block; transition: transform 0.15s ease; }
.store-link:hover { transform: translateY(-1px); }

/* ---------- hero ---------- */

.hero { padding: 84px 0 40px; overflow: hidden; }

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 56px;
  align-items: center;
}

.hero-eyebrow {
  color: var(--tide-strong);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}

.hero-title {
  font-size: clamp(2.5rem, 5.4vw, 3.9rem);
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -0.035em;
  margin-bottom: 20px;
}

.hero-lead {
  color: var(--text-secondary);
  font-size: 1.08rem;
  max-width: 34em;
  margin-bottom: 26px;
}

.hero-pattern {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 34px;
}
.pattern-pill {
  background: var(--card);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 0.9rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.pattern-arrow { color: var(--tide-strong); font-weight: 700; }

.hero-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }

.hero-figure { padding: 24px 22px 18px; }

.hero-figure-legend {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.legend-key { display: inline-flex; align-items: center; gap: 6px; }
.legend-line { display: inline-block; width: 22px; height: 0; border-top: 2.5px solid; }
.legend-accent { border-color: var(--tide-strong); }
.legend-muted { border-color: var(--muted-line); border-top-style: dashed; }

.hero-figure-caption {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.84rem;
  margin-top: 6px;
}

/* ヒーロー曲線の描画アニメ */
.hero-path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: hero-draw 2.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.hero-path-muted { animation-duration: 2.6s; animation-delay: 0.15s; }
.hero-dot { opacity: 0; animation: hero-pop 0.45s ease forwards; }

@keyframes hero-draw { to { stroke-dashoffset: 0; } }
@keyframes hero-pop { to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-path { animation: none; stroke-dasharray: none; stroke-dashoffset: 0; }
  .hero-dot { animation: none; opacity: 1; }
}

/* ---------- sections ---------- */

.section { padding: 72px 0; }
.section-tinted { background: var(--bg-deep); }

.section-title {
  font-size: clamp(1.7rem, 3.4vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 10px;
}
.section-lead { color: var(--text-secondary); margin-bottom: 36px; max-width: 44em; }

.section-head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.section-head-row .section-lead { margin-bottom: 0; }
.section-head-row + .guide-grid { margin-top: 32px; }

/* ---------- steps ---------- */

.step-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  counter-reset: step;
}
.step-card { padding: 28px 26px; }
.step-number {
  display: block;
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--tide-strong);
  font-variant-numeric: tabular-nums;
  margin-bottom: 14px;
}
.step-card h3 { font-size: 1.08rem; font-weight: 700; margin-bottom: 8px; }
.step-card p { color: var(--text-secondary); font-size: 0.95rem; }

/* ---------- features ---------- */

.feature-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
}
.feature-card { padding: 26px 24px; }
.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--tide-tint);
  color: var(--tide-strong);
  margin-bottom: 16px;
}
.feature-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 8px; }
.feature-card p { color: var(--text-secondary); font-size: 0.93rem; }

/* ---------- screenshots ---------- */

.shot-grid {
  list-style: none;
  display: flex;
  gap: 28px;
  justify-content: center;
  flex-wrap: wrap;
}
.shot-frame {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 36px;
  box-shadow: var(--shadow-raise);
  padding: 10px;
  max-width: 300px;
}
.shot-frame img { border-radius: 28px; }

/* ---------- guide cards ---------- */

.guide-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.guide-grid-index { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

.guide-card {
  display: block;
  height: 100%;
  padding: 24px;
  color: var(--text);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.guide-card:hover {
  text-decoration: none;
  transform: translateY(-3px);
  box-shadow: var(--shadow-raise);
}
.guide-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: var(--accent-tint);
  color: var(--accent);
  margin-bottom: 14px;
}
.guide-card h3 { font-size: 1.02rem; font-weight: 700; line-height: 1.5; margin-bottom: 8px; }
.guide-card p {
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.guide-card-tags { display: flex; gap: 6px; flex-wrap: wrap; }

.tag {
  display: inline-block;
  background: var(--tide-tint);
  color: var(--tide-strong);
  font-size: 0.74rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 10px;
}

/* ---------- CTA ---------- */

.section-cta { padding-bottom: 96px; }
.cta-card {
  border-radius: 28px;
  padding: 56px 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.cta-icon { border-radius: 16px; box-shadow: var(--shadow); }
.cta-title { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; letter-spacing: -0.02em; }
.cta-lead { color: var(--text-secondary); margin-bottom: 10px; }

/* ---------- page hero（下層ページ共通） ---------- */

.page-hero { padding: 64px 0 8px; }
.page-title {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
}
.page-lead { color: var(--text-secondary); max-width: 44em; }
.page-updated { color: var(--text-secondary); font-size: 0.9rem; }

/* ---------- 記事 ---------- */

.article-header { padding: 56px 0 20px; text-align: center; }
.breadcrumb { margin-bottom: 22px; font-size: 0.9rem; }
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a::before { content: "← "; }

.article-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: var(--accent-tint);
  color: var(--accent);
  margin-bottom: 18px;
}

.article-title {
  font-size: clamp(1.65rem, 3.6vw, 2.3rem);
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: -0.025em;
  margin-bottom: 14px;
}

.article-lead {
  color: var(--text-secondary);
  font-size: 1.02rem;
  text-align: left;
  margin-bottom: 18px;
}

.article-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--text-secondary);
  font-size: 0.85rem;
}
.article-meta time { margin-left: 6px; }

.article-body {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: clamp(24px, 5vw, 48px);
  font-size: 1.04rem;
  line-height: 2.0;
}

.article-body h2 {
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.6;
  margin: 2.2em 0 0.8em;
  padding-left: 14px;
  border-left: 4px solid var(--tide);
}
.article-body h2:first-child { margin-top: 0; }

.article-body p { margin-bottom: 1.2em; }
.article-body ul,
.article-body ol { margin: 0 0 1.2em 1.5em; }
.article-body li { margin-bottom: 0.45em; }

.article-body .callout {
  background: var(--tide-tint);
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 18px 22px;
  margin: 1.6em 0;
  font-weight: 700;
}
.article-body .callout p { margin: 0; }

.article-body .summary-list {
  list-style: none;
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 20px 22px;
  margin-left: 0;
}
.article-body .summary-list li {
  padding-left: 28px;
  position: relative;
  margin-bottom: 0.7em;
}
.article-body .summary-list li:last-child { margin-bottom: 0; }
.article-body .summary-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  -webkit-mask: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="none" stroke="black" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round" d="M2.5 8.5l3.5 3.5 7-8"/></svg>') center / contain no-repeat;
  mask: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="none" stroke="black" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round" d="M2.5 8.5l3.5 3.5 7-8"/></svg>') center / contain no-repeat;
}

.figure-card {
  padding: 20px 18px 14px;
  margin: 1.8em 0;
  border-radius: 20px;
}
.figure-card figcaption {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.84rem;
  line-height: 1.6;
  margin-top: 10px;
}

/* 記事末尾のアプリ CTA */
.app-cta {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 24px 28px;
  margin-top: 28px;
}
.app-cta-icon { border-radius: 13px; box-shadow: var(--shadow); }
.app-cta-text { flex: 1; min-width: 220px; }
.app-cta h2 { font-size: 1.05rem; font-weight: 800; margin-bottom: 4px; }
.app-cta p { color: var(--text-secondary); font-size: 0.9rem; }
.app-cta-store .store-badge { height: 48px; }

.related { margin: 44px 0 72px; }
.related-title { font-size: 1.2rem; font-weight: 800; margin-bottom: 18px; }

/* ---------- 図（SVG）の配色 ---------- */

.figure-svg { width: 100%; height: auto; display: block; }
.figure-svg text { font-family: inherit; }

.fig-grid { stroke: var(--hairline); stroke-width: 1; }
.fig-axis { stroke: var(--muted-line); stroke-width: 2; }
.fig-label { fill: var(--text-secondary); font-size: 12.5px; }
.fig-label-strong { fill: var(--text); font-weight: 700; }

.fig-line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.fig-line-accent { stroke: var(--accent); }
.fig-line-muted { stroke: var(--muted-line); stroke-dasharray: 5 5; }
.fig-line-hero { stroke: var(--tide-strong); stroke-width: 3; }

.fig-dot-accent { fill: var(--accent); }
.fig-dot-sub { opacity: 0.85; }
.fig-dot-warning { fill: var(--warning); }
.hero-dot { fill: var(--warning); }

.fig-bar-accent { fill: var(--accent); opacity: 0.85; }
.fig-bar-muted { fill: var(--muted-line); opacity: 0.85; }

.fig-flag-pole { stroke: var(--warning); stroke-width: 2; stroke-linecap: round; }
.fig-flag-a { fill: none; stroke: var(--warning); stroke-width: 1.4; }
.fig-flag-b { fill: var(--warning); }

/* ---------- 静的ページ（privacy / terms / support） ---------- */

.content-card { padding: clamp(24px, 5vw, 48px); margin-bottom: 24px; }
.content-card section { margin-bottom: 2em; }
.content-card section:last-child { margin-bottom: 0; }
.content-card h2 {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 0.7em;
  padding-bottom: 0.4em;
  border-bottom: 1px solid var(--hairline);
}
.content-card h3 { font-size: 1.02rem; font-weight: 700; margin: 1.2em 0 0.5em; }
.content-card p { margin-bottom: 0.9em; color: var(--text); }
.content-card ul { margin: 0 0 1em 1.5em; }
.content-card li { margin-bottom: 0.4em; }

.faq-item { margin-bottom: 1.6em; }
.faq-item h3 { color: var(--accent); margin-top: 0; }
.faq-item p { color: var(--text-secondary); }

.contact-box { text-align: center; padding: 12px 0; }

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--card-border);
  padding: 44px 0 32px;
  background: var(--bg-deep);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.footer-brand {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}
.footer-note {
  grid-column: 1 / -1;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 400;
}
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; }
.footer-links a { color: var(--text-secondary); font-size: 0.9rem; }
.footer-links a:hover { color: var(--text); }
.footer-copy { color: var(--text-secondary); font-size: 0.82rem; }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .hero { padding-top: 56px; }
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .step-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .header-inner { gap: 12px; }
  .header-nav { gap: 12px; }
  .header-nav a { font-size: 0.88rem; white-space: nowrap; }
  .section { padding: 56px 0; }
  .article-lead { text-align: center; }
  .app-cta { justify-content: center; text-align: center; }
  /* SVG 図は viewBox ごと縮小されるため、狭幅ではラベルのユーザー座標系サイズを上げて相殺する */
  .fig-label { font-size: 17px; }
}

@media (max-width: 430px) {
  /* iPhone 幅: ブランドはアイコンだけにしてナビ4要素を1行に収める */
  .brand span { display: none; }
  .container { padding: 0 16px; }
  .header-cta { padding: 7px 14px; }
}
