/**
 * style.css — ティザーサイトの唯一のスタイルシート。
 *
 * トーン: wiki-front の landing（zinc/ダーク・タイポグラフィ主体・emerald アクセント）に合わせる。
 * 外部フォント/CDN 依存なし（システムフォントのみ）。
 */

:root {
  --bg: #09090b; /* zinc-950 */
  --surface: #18181b; /* zinc-900 */
  --surface-2: #27272a; /* zinc-800 */
  --border: #3f3f46; /* zinc-700 */
  --text: #fafafa; /* zinc-50 */
  --text-dim: #a1a1aa; /* zinc-400 */
  --text-dimmer: #71717a; /* zinc-500 */
  --accent: #34d399; /* emerald-400 */
  --accent-dim: #10b981; /* emerald-500 */
  --font-sans:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  --font-mono:
    ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --max-w: 42rem;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.55;
  overflow-x: hidden;
}

img,
svg {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---------- Header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 0;
}

.brand {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.lang-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.lang-toggle button {
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  transition: background 0.15s ease, color 0.15s ease;
}

.lang-toggle button[aria-pressed="true"] {
  background: var(--surface-2);
  color: var(--text);
}

.lang-toggle button:hover {
  color: var(--text);
}

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

/* ---------- Hero ---------- */

.hero {
  padding: 3.5rem 0 3rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero h1 {
  font-size: clamp(1.9rem, 5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0;
  max-width: 32rem;
}

.hero-sub {
  color: var(--text-dim);
  font-size: 1.05rem;
  max-width: 30rem;
  margin: 0;
}

/* ---------- Signature diagram ---------- */

.compound-diagram {
  width: 100%;
  max-width: 26rem;
  margin: 0.5rem 0;
}

.compound-diagram .node {
  fill: var(--surface);
  stroke: var(--border);
  stroke-width: 1;
}

.compound-diagram .node.source {
  stroke: var(--accent);
}

.compound-diagram .link {
  stroke: var(--border);
  stroke-width: 1;
  fill: none;
}

.compound-diagram .link.active {
  stroke: var(--accent-dim);
}

.compound-diagram .pulse {
  fill: var(--accent);
  opacity: 0;
  animation: pulse-travel 3.6s ease-in-out infinite;
}

.compound-diagram .pulse.d2 {
  animation-delay: 0.5s;
}
.compound-diagram .pulse.d3 {
  animation-delay: 1s;
}
.compound-diagram .pulse.d4 {
  animation-delay: 1.5s;
}

.compound-diagram text {
  fill: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 8px;
}

@keyframes pulse-travel {
  0% {
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .compound-diagram .pulse {
    animation: none;
    opacity: 0.9;
  }
}

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

.cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  max-width: 26rem;
}

.cta-row form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: 100%;
  justify-content: center;
}

.email-input {
  flex: 1 1 14rem;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.7rem 0.9rem;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
}

.email-input::placeholder {
  color: var(--text-dimmer);
}

/* Honeypot: bot対策のダミー入力欄。人間には見えず、スクリーンリーダーからも除外する
   （aria-hidden + tabindex=-1 と併用）。position:absolute で視覚的に画面外へ退避させる
   （display:none/visibility:hiddenは一部のbotがスキップ判定に使うため避ける）。 */
.hp-field {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Interest survey (optional, in waitlist form) ---------- */

.interest-fieldset {
  width: 100%;
  border: none;
  margin: 0.25rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.interest-fieldset legend {
  width: 100%;
  padding: 0;
  margin-bottom: 0.3rem;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.interest-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-dim);
  cursor: pointer;
  text-align: left;
}

.interest-option input[type="radio"] {
  accent-color: var(--accent);
  flex-shrink: 0;
}

.interest-note {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.55rem 0.8rem;
  color: var(--text);
  font-size: 0.85rem;
  font-family: inherit;
  margin-top: 0.15rem;
}

.interest-note::placeholder {
  color: var(--text-dimmer);
}

.email-input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.btn-primary {
  background: var(--accent);
  color: #052e1f;
  border: none;
  border-radius: 0.5rem;
  padding: 0.7rem 1.3rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.btn-primary:hover {
  background: var(--accent-dim);
}

.btn-primary:focus-visible,
.email-input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-status {
  min-height: 1.2rem;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin: 0;
}

.form-status[data-state="success"] {
  color: var(--accent);
}

.form-status[data-state="error"] {
  color: #fca5a5;
}

.hero-note {
  margin: -0.5rem 0 0;
  font-size: 0.8rem;
  color: var(--text-dimmer);
}

/* ---------- Sections ---------- */

section {
  padding: 2.5rem 0;
}

/* aria-labelledby 参照先を locale 非依存にするためのラッパー。中身の [data-lang] h2 の
   display:none/contents 切り替えをそのまま透過させ、レイアウトには一切影響しない。 */
.heading-group {
  display: contents;
}

.section-title {
  text-align: center;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 1.75rem;
}

/* Section lede (intro paragraph under a section title) */

.section-lede {
  max-width: 34rem;
  margin: -1rem auto 1.75rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.95rem;
}

/* Standard-RAG-vs-Vessios diagram */

.rag-diagram {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 40rem) {
  .rag-diagram {
    grid-template-columns: 1fr;
  }
}

.rag-col {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.25rem 1rem;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
}

.rag-col-us {
  border-color: var(--accent-dim);
}

.rag-col-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dimmer);
}

.rag-col-us .rag-col-label {
  color: var(--accent);
}

.rag-loop {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.85rem;
}

.rag-node {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  background: var(--surface-2);
  color: var(--text-dim);
  white-space: nowrap;
}

.rag-node-accent {
  border-color: var(--accent-dim);
  color: var(--accent);
}

.rag-arrow {
  color: var(--text-dimmer);
}

.rag-arrow-back,
.rag-arrow-up {
  color: var(--text-dimmer);
}

.rag-col-us .rag-arrow-up {
  color: var(--accent-dim);
}

.rag-col-note {
  font-size: 0.8rem;
  color: var(--text-dimmer);
}

/* Features grid */

.features {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 40rem) {
  .features {
    grid-template-columns: 1fr;
  }
}

.feature {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.25rem;
  background: var(--surface);
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.6rem;
  color: var(--accent);
}

.feature-icon svg {
  width: 100%;
  height: 100%;
}

.feature h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
}

.feature p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-dim);
}

/* How-it-works steps */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  counter-reset: none;
}

.step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.1rem 1.25rem;
  background: var(--surface);
}

.step-num {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--accent-dim);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
}

.step-body h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 600;
}

.step-body p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-dim);
}

/* FAQ */

.faq {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.9rem 1.1rem;
  background: var(--surface);
}

.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::before {
  content: "+";
  display: inline-block;
  width: 1rem;
  color: var(--accent);
  font-weight: 700;
}

.faq-item[open] summary::before {
  content: "−";
}

.faq-item summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 0.25rem;
}

.faq-item p {
  margin: 0.65rem 0 0.1rem 1rem;
  font-size: 0.88rem;
  color: var(--text-dim);
}

/* Compare table */

.compare-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  min-width: 24rem;
}

.compare-table th,
.compare-table td {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--surface-2);
}

.compare-table th {
  color: var(--text-dimmer);
  font-weight: 500;
  font-size: 0.8rem;
}

.compare-table th.col-us {
  color: var(--text);
  font-weight: 600;
}

.compare-table td.col-us {
  color: var(--accent);
  font-weight: 600;
}

.compare-table td.col-nb {
  color: var(--text-dim);
}

.compare-table td.row-label {
  font-weight: 500;
}

/* Waitlist repeat / footer CTA */

.footer-cta {
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 2rem 1.5rem;
  background: var(--surface);
}

.footer-cta h2 {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
}

.footer-cta p {
  margin: 0 0 1.25rem;
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* ---------- Privacy page (bilingual, no locale toggle) ---------- */

.privacy-block {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.25rem 1.25rem;
  background: var(--surface);
  margin-bottom: 1rem;
}

.privacy-block h2 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
  font-weight: 600;
}

.privacy-block p {
  margin: 0 0 0.6rem;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.privacy-block p:last-child {
  margin-bottom: 0;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--surface-2);
  padding: 1.75rem 0 2.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-dimmer);
}

.footer-links {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-dimmer);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text-dim);
  text-decoration: underline;
}

/* ---------- i18n visibility ----------
 * Prose nodes (h1/h2/h3/p/span/a/button/li) are duplicated with
 * data-lang="en" / "ja" and toggled purely by CSS off the html[data-locale]
 * attribute (set by app.js). `display: contents` keeps the visible copy's
 * own natural flow (inline stays inline, block stays block) without us
 * having to special-case every tag.
 *
 * Table cells and SVG text use a different, JS-driven strategy (single node,
 * textContent swapped by app.js) because display:contents on a <td> removes
 * the cell's box and breaks column alignment. See app.js applyLocale(). */

[data-lang] {
  display: none;
}

html[data-locale="en"] [data-lang="en"],
html[data-locale="ja"] [data-lang="ja"] {
  display: contents;
}
