/* KeyAI — landing (dark, product-first)
   Palette: near-black neutrals + one restrained green accent. No gradients on brand. */

:root {
  --bg: #0b0b0c;
  --bg-elev: #131315;
  --bg-elev-2: #1a1a1d;
  --line: #26262a;
  --line-strong: #34343a;
  --text: #ececee;
  --text-2: #a1a1aa;
  --text-3: #71717a;
  --accent: #3fb68b;          /* restrained green */
  --accent-strong: #52c99d;
  --accent-ink: #06130e;
  --accent-soft: rgba(63, 182, 139, .12);

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --wrap: 1120px;

  --font: "Inter", "Noto Sans JP", system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", Meiryo, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: .01em;
  line-break: strict;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 12px; }
.pc { display: inline; }
.sp { display: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 11, 12, .78);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid transparent;
  border-bottom-color: var(--line);
}
.header-inner { display: flex; align-items: center; gap: 32px; height: 64px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; letter-spacing: -.01em; }
.mark {
  width: 22px; height: 22px; border-radius: 7px;
  background: var(--text);
  position: relative;
}
.mark::after {
  content: ""; position: absolute; inset: 7px 6px;
  border-radius: 2px;
  background: repeating-linear-gradient(90deg, var(--bg) 0 2px, transparent 2px 4px);
}
.nav { display: flex; gap: 28px; margin-right: auto; }
.nav a { font-size: 14px; color: var(--text-2); transition: color .15s; }
.nav a:hover { color: var(--text); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.header-solo .header-actions { margin-left: auto; }

/* ---------- Language switch (JA / EN) ---------- */
.lang-switch {
  display: inline-flex; padding: 3px; margin-right: 4px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--bg-elev);
}
.lang-btn {
  height: 28px; min-width: 38px; padding: 0 10px;
  border: 0; border-radius: 999px; background: transparent;
  font: inherit; font-size: 12px; font-weight: 600; letter-spacing: .04em;
  color: var(--text-3); cursor: pointer;
  transition: background-color .15s, color .15s;
}
.lang-btn:hover { color: var(--text); }
.lang-btn[aria-pressed="true"] { background: var(--bg-elev-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px;
  border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-size: 15px; font-weight: 500; line-height: 1;
  cursor: pointer; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn-sm { height: 36px; padding: 0 16px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover { background: #fff; }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--bg-elev-2); }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover { color: var(--text); background: var(--bg-elev-2); }

/* ---------- Hero ---------- */
.hero { padding: 104px 0 96px; position: relative; overflow: hidden; }
.hero::before { /* faint neutral glow, not a brand gradient */
  content: ""; position: absolute; left: 50%; top: -240px; width: 1100px; height: 640px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(255,255,255,.06), transparent);
  pointer-events: none;
}
.hero-inner { text-align: center; position: relative; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border: 1px solid var(--line-strong); border-radius: 999px;
  font-size: 13px; color: var(--text-2); background: var(--bg-elev);
}
.pill-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.hero-title {
  margin-top: 28px;
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1.2; font-weight: 600; letter-spacing: -.02em;
  font-feature-settings: "palt";
}
html[lang="en"] .hero-title { letter-spacing: -.03em; font-feature-settings: normal; }
html[lang="en"] .section-title { font-feature-settings: normal; }
.hero-lead { margin: 24px auto 0; max-width: 640px; font-size: 18px; color: var(--text-2); }
.hero-actions { margin-top: 36px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-note { margin-top: 16px; font-size: 13px; color: var(--text-3); }

/* ---------- App frame (product mock) ---------- */
.app-frame {
  margin: 72px auto 0; max-width: 960px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.02) inset;
  overflow: hidden; position: relative;
}
.app-bar {
  display: flex; align-items: center; gap: 14px;
  height: 44px; padding: 0 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13px; color: var(--text-2);
}
.traffic { display: flex; gap: 6px; }
.traffic i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.app-bar-title { font-weight: 500; color: var(--text); }
.status { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; font-size: 12px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(63,182,139,.04); } }

.app-body { display: grid; grid-template-columns: 220px 1fr; text-align: left; }
.app-side { border-right: 1px solid var(--line); padding: 20px 16px; background: #101012; }
.side-label { font-size: 11px; font-weight: 500; color: var(--text-3); letter-spacing: .04em; margin: 0 0 10px 8px; }
.side-label + .quota-mini { margin-left: 8px; margin-right: 8px; }
.side-list { margin-bottom: 28px; }
.side-list li { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; font-size: 13.5px; color: var(--text-2); }
.side-list li:first-child { background: var(--bg-elev-2); color: var(--text); }
.chip-ico {
  display: inline-grid; place-items: center; width: 22px; height: 22px; flex: none;
  border-radius: 6px; background: var(--bg-elev-2); border: 1px solid var(--line);
  font-size: 11px; color: var(--text-2); line-height: 1;
}
.quota-mini { height: 6px; border-radius: 99px; background: var(--bg-elev-2); overflow: hidden; }
.quota-mini span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.side-fine { margin: 8px 0 0 8px; font-size: 12px; color: var(--text-3); }

.app-main { padding: 28px 32px 24px; display: flex; flex-direction: column; gap: 18px; }
.msg { max-width: 82%; font-size: 15px; line-height: 1.7; }
.msg-user { align-self: flex-end; background: var(--bg-elev-2); border: 1px solid var(--line); padding: 10px 16px; border-radius: 18px; }
.msg-agent { align-self: flex-start; color: var(--text); }
.tool-card { margin-top: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #0f0f11; padding: 14px 16px; }
.tool-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--text-2); }
.tool-name { display: inline-flex; align-items: center; gap: 8px; }
.tool-state { font-size: 11.5px; color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: 99px; }
.tool-text { margin-top: 10px; font-size: 14.5px; }
.tool-actions { margin-top: 12px; display: flex; gap: 8px; }
.mini-btn { font-size: 12.5px; padding: 5px 12px; border-radius: 99px; border: 1px solid var(--line-strong); color: var(--text-2); }
.mini-btn-primary { background: var(--text); color: var(--bg); border-color: var(--text); }

.voice-bar {
  margin-top: 8px; display: flex; align-items: center; gap: 14px;
  padding: 10px 12px 10px 10px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--bg);
}
.mic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); flex: none; }
.wave { display: flex; align-items: center; gap: 3px; height: 24px; flex: 1; }
.wave i { width: 3px; border-radius: 3px; background: var(--text-3); height: 30%; animation: wave 1.4s ease-in-out infinite; }
.wave i:nth-child(3n)   { animation-delay: -.2s; }
.wave i:nth-child(3n+1) { animation-delay: -.5s; }
.wave i:nth-child(4n)   { animation-delay: -.8s; }
.wave i:nth-child(5n)   { animation-delay: -1.1s; }
@keyframes wave { 0%, 100% { height: 20%; } 50% { height: 90%; } }
.voice-hint { font-size: 12.5px; color: var(--text-3); padding-right: 6px; }
.frame-caption { padding: 10px 16px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--text-3); text-align: right; }

/* ---------- Sections ---------- */
.section { padding: 112px 0; border-top: 1px solid var(--line); }
.section-head { max-width: 640px; margin-bottom: 48px; }
.section-head-center { margin-left: auto; margin-right: auto; text-align: center; }
.eyebrow { font-size: 13px; font-weight: 500; color: var(--accent); margin-bottom: 14px; letter-spacing: .02em; }
.section-title { font-size: clamp(28px, 3.6vw, 40px); line-height: 1.3; font-weight: 600; letter-spacing: -.015em; font-feature-settings: "palt"; }
.section-lead { margin-top: 16px; font-size: 17px; color: var(--text-2); }

.card { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: s; }
.step { padding: 28px; }
.step-num { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line-strong); font-size: 13px; font-weight: 500; color: var(--text-2); }
.step h3 { margin-top: 20px; font-size: 18px; font-weight: 600; }
.step p { margin-top: 8px; font-size: 15px; color: var(--text-2); }

/* Features */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.feature { padding: 24px; transition: border-color .15s, background-color .15s; }
.feature:hover { border-color: var(--line-strong); background: var(--bg-elev-2); }
.ico { width: 24px; height: 24px; fill: none; stroke: var(--text); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ico-sm { width: 20px; height: 20px; flex: none; stroke: var(--text-2); margin-top: 3px; }
.feature h3 { margin-top: 18px; font-size: 16px; font-weight: 600; }
.feature p { margin-top: 6px; font-size: 14px; color: var(--text-2); line-height: 1.7; }

/* Plugins split */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.split .section-lead { margin-bottom: 28px; }
.checks li { position: relative; padding-left: 28px; font-size: 15px; color: var(--text-2); }
.checks li + li { margin-top: 10px; }
.checks li::before {
  content: ""; position: absolute; left: 2px; top: .45em; width: 14px; height: 8px;
  border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg) scale(.8); transform-origin: left top;
}
.settings { overflow: hidden; margin: 0; }
.settings-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 500; }
.settings-tag { font-size: 12px; font-weight: 400; color: var(--accent); background: var(--accent-soft); padding: 2px 10px; border-radius: 99px; }
.toggles li { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; font-size: 14.5px; }
.toggles li + li { border-top: 1px solid var(--line); }
.t-name { display: inline-flex; align-items: center; gap: 12px; }
.toggle { width: 36px; height: 20px; border-radius: 99px; background: var(--line-strong); position: relative; flex: none; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-2); transition: transform .2s; }
.toggle.is-on { background: var(--accent); }
.toggle.is-on::after { transform: translateX(16px); background: #fff; }

/* Pricing */
.pricing { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 0 auto; align-items: stretch; }
.plan { padding: 22px 20px 24px; display: flex; flex-direction: column; }
.plan-label { font-size: 13px; font-weight: 500; color: var(--text-3); }
.plan-name { margin-top: 6px; font-size: 18px; font-weight: 600; }
.plan-price { margin-top: 18px; font-size: clamp(26px, 2.4vw, 32px); font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.plan-period { margin-left: 2px; font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--text-3); }
.plan .checks { margin-bottom: 24px; }
.plan .checks li { font-size: 14px; }
.ask {
  margin-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 22px 24px;
}
.ask .plan-desc { margin-top: 8px; }
.ask .btn { flex: none; }
.plan-desc { margin-top: 12px; font-size: 15px; color: var(--text-2); }
.plan .btn-block { margin-top: auto; }
.ph {
  display: inline-block; margin-left: 8px; padding: 1px 8px;
  border: 1px dashed var(--line-strong); border-radius: 6px;
  font-size: 12.5px; color: var(--text-3); line-height: 1.6;
}
td .ph { margin-left: 0; }
.meter { width: 100%; margin-top: 24px; border-collapse: collapse; font-size: 14.5px; }
.meter th { text-align: left; font-weight: 500; font-size: 12.5px; color: var(--text-3); padding: 0 0 10px; border-bottom: 1px solid var(--line); }
.meter td { padding: 13px 0; border-bottom: 1px solid var(--line); }
.meter th:last-child, .meter td:last-child { text-align: right; }
.meter td:nth-child(2) { color: var(--text-2); }
.plan-foot { margin-top: 16px; font-size: 13.5px; color: var(--text-3); }
.notice {
  margin: 16px auto 0; display: flex; gap: 14px;
  padding: 18px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: transparent;
  font-size: 14.5px; color: var(--text-2);
}
.notice strong { color: var(--text); font-weight: 600; margin-right: .5em; }

/* FAQ */
.faq-wrap { max-width: 760px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-child { border-top: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding: 22px 40px 22px 0; position: relative;
  font-size: 16.5px; font-weight: 500;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 9px; height: 9px;
  border-right: 1.6px solid var(--text-2); border-bottom: 1.6px solid var(--text-2);
  transform: translateY(-70%) rotate(45deg); transition: transform .2s;
}
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq details p { padding: 0 40px 22px 0; color: var(--text-2); font-size: 15px; }

/* CTA */
.cta { padding: 32px 0 120px; }
.cta-card {
  text-align: center; padding: 72px 32px;
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius-lg);
}
.signup { margin: 32px auto 0; display: flex; gap: 8px; max-width: 460px; }
.signup input {
  flex: 1; min-width: 0; height: 44px; padding: 0 18px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: 999px;
  font: inherit; font-size: 15px;
}
.signup input::placeholder { color: var(--text-3); }
.signup input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cta-fine { margin-top: 14px; font-size: 12.5px; color: var(--text-3); }
.cta-login { margin-top: 16px; font-size: 14px; }
.cta-login a { color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; }
.cta-login a:hover { color: var(--text); }
.signup { position: relative; }
.signup button:disabled { opacity: .55; cursor: progress; }
.hp {
  position: absolute; left: -10000px; top: auto;
  width: 1px; height: 1px; overflow: hidden;
}
.form-status { margin: 14px auto 0; max-width: 460px; font-size: 14px; color: var(--text-2); }
.form-status.is-ok { color: var(--accent); }
.form-status.is-error { color: #e7b4b4; }

/* Subpages (login, top-up, auth callback) */
.page { padding: 72px 0 96px; }
.page-card { max-width: 560px; margin: 0 auto; padding: 40px 32px; text-align: left; }
.page-card .section-title { font-size: clamp(28px, 4vw, 36px); }
.page-card .section-lead { margin-top: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; margin-top: 28px; }
.stack .btn { width: 100%; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--text-2); }
.field input {
  height: 44px; padding: 0 16px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--bg); color: var(--text);
  font: inherit; font-size: 15px;
}
.field input::placeholder { color: var(--text-3); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field textarea {
  min-height: 120px; padding: 12px 16px; border-radius: 12px; resize: vertical;
  border: 1px solid var(--line-strong); background: var(--bg); color: var(--text);
  font: inherit; font-size: 15px; line-height: 1.6;
}
.auth-divider { margin-top: 8px; text-align: center; font-size: 12px; color: var(--text-3); }
.page-links { margin-top: 20px; font-size: 14px; color: var(--text-2); }
.page-links a { text-decoration: underline; text-underline-offset: 3px; }
.page-links a:hover { color: var(--text); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0 40px; }
.footer-inner { display: flex; align-items: center; gap: 32px; flex-wrap: wrap; }
.wordmark-sm { font-size: 15px; }
.wordmark-sm .mark { width: 18px; height: 18px; border-radius: 6px; }
.wordmark-sm .mark::after { inset: 5px 4px; }
.footer-nav { display: flex; gap: 24px; flex-wrap: wrap; margin-right: auto; }
.footer-nav a, .copy { font-size: 13px; color: var(--text-3); }
.footer-nav a:hover { color: var(--text-2); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .features { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; gap: 40px; }
  .pricing { grid-template-columns: 1fr 1fr; }
  .ask { align-items: stretch; flex-direction: column; }
}
@media (max-width: 760px) {
  .nav { display: none; }
  .header-actions { margin-left: auto; }
  .header-actions .btn-ghost { display: none; }
  .lang-btn { min-width: 34px; padding: 0 8px; }
  .pc { display: none; }
  .sp { display: inline; }
  .hero { padding: 72px 0 64px; }
  .hero-lead { font-size: 16px; }
  .app-frame { margin-top: 48px; }
  .app-body { grid-template-columns: 1fr; }
  .app-side { display: none; }
  .app-main { padding: 20px 16px; }
  .msg { max-width: 92%; font-size: 14.5px; }
  .section { padding: 80px 0; }
  .steps { grid-template-columns: 1fr; }
  .pricing { grid-template-columns: 1fr; }
  .voice-hint { display: none; }
  .plan { padding: 24px; }
  .signup { flex-direction: column; }
  .cta-card { padding: 48px 20px; }
  .page-card { padding: 32px 20px; }
}
@media (max-width: 480px) {
  .features { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
