/*
  1 枚ページのスタイル。
  フレームワークもビルド工程も持たない。配るのが静的な HTML 1 枚である以上、
  道具立てを足すと釣り合わない。必要になったときに入れればよい。

  ライト固定。背景は淡い虹グラデーションをループさせる。
*/

:root {
  color-scheme: light;

  --bg-header: rgba(255, 255, 255, 0.86);
  --fg: #12141a;
  --muted: #4a5160;
  --rule: #c5cad3;
  --accent: #2563eb;
  --surface: rgba(255, 255, 255, 0.72);
  --content-width: 80%;
  --header-width: 80%;
  --page-gutter: 1.5rem;
}

* {
  box-sizing: border-box;
}

html {
  scroll-padding-top: 4.5rem;
}

body {
  margin: 0;
  padding: 0;
  color: var(--fg);
  /* 虹のベース。上に薄い白を重ねて可読性を確保する。 */
  background-color: #f4f6fb;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-size: 17px;
  line-height: 1.8;
  word-break: normal;
  overflow-wrap: anywhere;
}

/*
  画面全体の虹ウォッシュ。赤→黄→青→緑→紫→赤をゆっくりループする。
  彩度は抑えめ（本文が読めること優先）。強くしたいときは opacity を上げる。
*/
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background: linear-gradient(
    125deg,
    #ff8f8f,
    #ffe066,
    #7eb6ff,
    #7dffb2,
    #c9a0ff,
    #ff8f8f
  );
  background-size: 400% 400%;
  animation: rainbow-shift 22s ease-in-out infinite;
  opacity: 0.42;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.55) 0%,
    rgba(255, 255, 255, 0.35) 40%,
    rgba(255, 255, 255, 0.5) 100%
  );
  pointer-events: none;
}

@keyframes rainbow-shift {
  0% { background-position: 0% 40%; }
  50% { background-position: 100% 60%; }
  100% { background-position: 0% 40%; }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  width: 100%;
  border-bottom: 1px solid var(--rule);
  background: var(--bg-header);
  backdrop-filter: saturate(1.2) blur(10px);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
}

.site-header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  margin: 0 auto;
  padding: 0.85rem var(--page-gutter);
  /* 本文より広く、画面幅の約 8 割 */
  width: var(--header-width);
  max-width: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--fg);
  font-weight: 700;
  font-size: 2.1rem;
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-decoration: none;
}

.brand-icon {
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.brand-name {
  line-height: 1;
}

.site-header-trailing {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem 1.25rem;
  margin-left: auto;
}

.lang-picker select {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  padding: 0.35rem 1.75rem 0.35rem 0.65rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.9);
  background-image: url("/lang-chevron.svg");
  background-repeat: no-repeat;
  background-position: right 0.55rem center;
  color: var(--fg);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.3;
  cursor: pointer;
}

.lang-picker select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1.1rem;
}

.site-nav a {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--fg);
}

.hero {
  width: 100%;
  border-bottom: 1px solid var(--rule);
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto;
  padding: 3rem var(--page-gutter) 3.5rem;
  width: var(--content-width);
  max-width: none;
  text-align: center;
}

.hero-headline {
  margin: 0;
  color: var(--fg);
  font-family: "Plus Jakarta Sans", "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-size: clamp(2rem, 4.8vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.15;
  text-wrap: balance;
}

.hero-tagline {
  margin: 0.9rem 0 0;
  max-width: 36rem;
  color: var(--muted);
  font-family: "Plus Jakarta Sans", "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.55;
  letter-spacing: -0.015em;
}

/* 選択テキストっぽく見せるハイライト（Cmd+C+C の直前の状態）。 */
.hero-selection {
  padding: 0.05em 0.2em;
  border-radius: 3px;
  background: rgba(37, 99, 235, 0.18);
  color: var(--fg);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/*
  通常モードの翻訳ポップアップを模す。
  アプリ側: NSVisualEffectView (.popover) + cornerRadius 8 + 本文 + 下部バー
  （Ask / Auto / Copy）。ラベル付きの「説明 UI」にはしない。
*/
.app-popup {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100%, 26rem);
  margin-top: 0.85rem;
}

.hero-cta {
  margin: 2.15rem 0 0;
}

.app-popup--float {
  position: absolute;
  z-index: 40;
  width: min(26rem, calc(100vw - 24px));
  margin: 0;
  filter: drop-shadow(0 10px 28px rgba(18, 20, 26, 0.16));
}

.app-popup--float[hidden] {
  display: none !important;
}

.app-popup--float .app-popup-panel {
  width: 100%;
}

.app-popup-caret {
  width: 14px;
  height: 8px;
  margin-bottom: -1px;
  background: rgba(246, 246, 248, 0.92);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  filter: drop-shadow(0 -1px 0 rgba(18, 20, 26, 0.06));
}

.app-popup-panel {
  width: 100%;
  overflow: hidden;
  border: 1px solid rgba(18, 20, 26, 0.1);
  border-radius: 8px;
  background: rgba(246, 246, 248, 0.88);
  box-shadow:
    0 0 0 0.5px rgba(18, 20, 26, 0.04),
    0 10px 28px rgba(18, 20, 26, 0.16),
    0 2px 6px rgba(18, 20, 26, 0.08);
  backdrop-filter: saturate(1.4) blur(20px);
  -webkit-backdrop-filter: saturate(1.4) blur(20px);
}

.app-popup-body {
  padding: 12px 12px 8px;
  min-height: 3.4em;
}

.app-popup-text {
  margin: 0;
  color: var(--fg);
  font-size: 13px;
  line-height: 1.45;
  letter-spacing: -0.01em;
  white-space: pre-wrap;
  /* ストリーミング中も高さが飛びにくくなるよう、1 行分は確保する */
  min-height: 1.45em;
}

.app-popup-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 8px 6px;
}

.app-popup-ask {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}

.app-popup-auto {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(18, 20, 26, 0.08);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}

.app-popup-spacer {
  flex: 1 1 auto;
}

.app-popup-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: var(--muted);
}

/*
  ヒーローより下。左右余白つき。セクションはカードにせず、グレー横線で区切る。
*/
.content {
  margin: 0 auto;
  padding: 0 var(--page-gutter) 3.5rem;
  width: var(--content-width);
  max-width: none;
}

.content-section {
  margin: 0;
  padding: 2rem 0;
  border-top: 1px solid var(--rule);
  background: transparent;
}

.content-section:first-child {
  border-top: none;
}

h2 {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
}

h3 {
  margin: 1.5rem 0 0.4rem;
  font-size: 1rem;
}

p {
  margin: 0 0 1rem;
}

.content-section > :last-child {
  margin-bottom: 0;
}

ul {
  margin: 0 0 1rem;
  padding-left: 1.4rem;
}

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

.note {
  color: var(--muted);
  font-size: 0.9rem;
}

kbd {
  padding: 0.1em 0.45em;
  border: 1px solid var(--rule);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85em;
}

code {
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--surface);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
}

.download {
  display: inline-block;
  padding: 0.72rem 1.35rem;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(
    115deg,
    #3b82f6 0%,
    #6366f1 32%,
    #8b5cf6 58%,
    #a78bfa 78%,
    #60a5fa 100%
  );
  background-size: 160% 100%;
  background-position: 0% 50%;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.35;
  text-decoration: none;
  transition: background-position 0.45s ease, filter 0.2s ease;
}

.download:hover {
  background-position: 100% 50%;
  filter: brightness(1.06);
}

/* ライセンスプラン。黄金比（縦長）の横並びカード。 */
.plan-cards {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin: 0 0 1.25rem;
  padding: 0 clamp(1rem, 5vw, 2.5rem);
}

.plan-card {
  /* 幅 : 高さ = 1 : φ（縦長の黄金比） */
  aspect-ratio: 1 / 1.618;
  display: flex;
  flex: 1 1 7.5rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  max-width: 11rem;
  min-width: 0;
  padding: 1rem 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  text-align: center;
  text-decoration: none;
  transition: border-color 0.15s ease;
}

.plan-card:hover {
  border-color: #aeb4bf;
}

.plan-card-label,
.plan-card-price {
  transition: color 0.15s ease;
}

.plan-card-label {
  font-weight: 600;
  font-size: 1.35rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--fg);
}

.plan-card-price {
  font-size: 0.92rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.plan-card:nth-child(1):hover .plan-card-label,
.plan-card:nth-child(1):hover .plan-card-price {
  color: #2563eb;
}

.plan-card:nth-child(2):hover .plan-card-label,
.plan-card:nth-child(2):hover .plan-card-price {
  color: #ca8a04;
}

.plan-card:nth-child(3):hover .plan-card-label,
.plan-card:nth-child(3):hover .plan-card-price {
  color: #ea580c;
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.site-footer {
  margin: 0 auto;
  padding: 1.5rem var(--page-gutter) 3rem;
  width: var(--content-width);
  max-width: none;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer p {
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  body::before {
    animation: none;
    background-position: 30% 50%;
  }
}
