/* jpintel-mcp landing — monochrome + deep-blue accent.
   System fonts, no CDN, mobile-first.
   Color contrast: text #111 on #fff = 19.3:1. Accent #1e3a8a on #fff = 9.4:1. */

:root {
  --accent: #1e3a8a;
  --accent-hover: #172b6b;
  --text: #111111;
  --text-muted: #555555;
  --border: #e5e5e5;
  --bg: #ffffff;
  --bg-alt: #f7f7f8;
  --code-bg: #0f172a;
  --code-text: #e2e8f0;
  --danger: #b91c1c;
  --focus: #1e3a8a;
  --max-w: 960px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Hiragino Sans",
    "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

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

.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;
}

/* Skip link — visible only on keyboard focus. Lets screen-reader/keyboard
   users bypass the header + nav and land directly on <main id="main">.
   Use transform + clip-path so it's fully off-screen and unaffected by
   font-size/line-height variance (padding alone doesn't guarantee full hide). */
.skip-link {
  position: absolute;
  top: 0;
  left: 8px;
  padding: 10px 14px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  border-radius: 0 0 6px 6px;
  z-index: 100;
  text-decoration: none;
  transform: translateY(-110%);
  transition: transform 0.1s ease;
}
.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
  outline: 2px solid #fff;
  outline-offset: -4px;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  padding-bottom: 18px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  font-size: 13px;
  letter-spacing: 0.5px;
}
.brand-name {
  font-size: 16px;
  letter-spacing: -0.01em;
}
.site-nav {
  display: flex;
  gap: 22px;
  font-size: 15px;
  align-items: center;
}
.site-nav a { color: var(--text); }

/* Language switcher — top-right toggle next to nav links.
   JP / EN pair rendered as plain <a> so it works without JS.
   The current-language item carries aria-current="page" and
   gets a high-contrast style so keyboard users see the state. */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  padding-left: 14px;
  border-left: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.lang-switch a {
  color: var(--text-muted);
  padding: 2px 4px;
  border-radius: 3px;
}
.lang-switch a:hover {
  color: var(--accent);
  text-decoration: none;
}
.lang-switch a[aria-current="page"] {
  color: var(--text);
  background: var(--bg-alt);
}
.lang-switch .sep {
  color: var(--border);
  user-select: none;
}
@media (max-width: 480px) {
  .lang-switch {
    margin-left: 0;
    padding-left: 10px;
  }
}

/* Hero */
.hero {
  padding: 80px 0 56px;
  border-bottom: 1px solid var(--border);
}
.hero h1 {
  font-size: 44px;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  font-weight: 800;
}
.hero-sub {
  font-size: 20px;
  color: var(--text);
  margin: 0 0 18px;
  font-weight: 500;
}
.hero-tag {
  font-size: 16px;
  color: var(--text-muted);
  margin: 0 0 32px;
  max-width: 640px;
}
.hero-note {
  font-size: 14px;
  color: var(--text-muted);
  margin: 28px 0 0;
}

.cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
  text-decoration: none;
}
.btn-secondary {
  background: #fff;
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: var(--bg-alt);
  text-decoration: none;
}

/* Sections */
.section-title {
  font-size: 28px;
  letter-spacing: -0.01em;
  margin: 0 0 28px;
  font-weight: 700;
}

.features {
  padding: 64px 0;
  border-bottom: 1px solid var(--border);
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  background: var(--bg);
}
.card h3 {
  font-size: 18px;
  margin: 0 0 4px;
  font-weight: 700;
}
.card-lead {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 12px;
  letter-spacing: 0.02em;
}
.card p {
  margin: 0 0 14px;
  color: var(--text-muted);
  font-size: 15px;
}
.card-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  font-size: 13px;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  line-height: 1.9;
}

/* Code demo */
.code-demo {
  padding: 64px 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}
.demo-lead {
  color: var(--text-muted);
  margin: -16px 0 20px;
}
.code-block {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 18px 20px;
  border-radius: 8px;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 18px;
}
.code-block code {
  font-family: inherit;
  color: inherit;
  white-space: pre;
}
.demo-note {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}
.demo-note code {
  background: #fff;
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Newsletter capture */
.newsletter {
  padding: 56px 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}
.newsletter-lead {
  color: var(--text-muted);
  margin: -16px 0 20px;
  max-width: 640px;
}
.newsletter-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  max-width: 560px;
  margin: 0 0 12px;
}
.newsletter-form input[type="email"] {
  flex: 1 1 260px;
  padding: 12px 14px;
  font-size: 15px;
  line-height: 1.2;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
}
.newsletter-form input[type="email"]:focus-visible {
  border-color: var(--accent);
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}
.newsletter-form button { flex: 0 0 auto; }
.newsletter-form button[disabled] { opacity: 0.6; cursor: progress; }
.newsletter-note {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 8px;
  max-width: 560px;
}
.newsletter-status {
  font-size: 14px;
  margin: 0;
  min-height: 1.4em;
  color: var(--text-muted);
}
.newsletter-status.ok { color: var(--accent); font-weight: 600; }
.newsletter-status.err { color: var(--danger); font-weight: 600; }

/* Pricing preview */
.pricing-preview { padding: 64px 0; }
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.pricing-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  background: var(--bg);
}
.pricing-table th,
.pricing-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.pricing-table thead th {
  background: var(--bg-alt);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.pricing-table tbody tr:last-child th,
.pricing-table tbody tr:last-child td {
  border-bottom: none;
}
.pricing-table tbody th {
  font-weight: 700;
  color: var(--text);
}
.pricing-note {
  margin: 20px 0 0;
  font-size: 15px;
}

/* Full pricing page */
.pricing-page { padding: 64px 0; }
.pricing-page h1 {
  font-size: 36px;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  font-weight: 800;
}
.pricing-page .lead {
  font-size: 17px;
  color: var(--text-muted);
  margin: 0 0 36px;
  max-width: 640px;
}
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}
.price-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  display: flex;
  flex-direction: column;
}
.price-card.highlight {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.price-card h2 {
  font-size: 18px;
  margin: 0 0 4px;
  font-weight: 700;
}
.price-card .tier-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 18px;
}
.price-card .price {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 4px;
}
.price-card .price-unit {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 20px;
}
.price-card .feats {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-muted);
  flex: 1;
}
.price-card .feats li::before {
  content: "- ";
  color: var(--accent);
  font-weight: 700;
}
.price-card .btn { width: 100%; text-align: center; }

/* Legal pages */
.legal { padding: 48px 0 64px; }
.legal h1 {
  font-size: 30px;
  margin: 0 0 8px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.legal h2 {
  font-size: 18px;
  margin: 32px 0 8px;
  font-weight: 700;
}
.legal p, .legal li {
  font-size: 15px;
  color: var(--text);
}
.legal .meta {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0 0 16px;
}
.draft-banner {
  background: #fff0f0;
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 12px 16px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 14px;
  margin: 0 0 32px;
}
.legal table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 20px;
  font-size: 15px;
}
.legal table th,
.legal table td {
  border: 1px solid var(--border);
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
}
.legal table th {
  background: var(--bg-alt);
  width: 30%;
  font-weight: 600;
}

/* Dashboard quota counter widget
   Rendered by dashboard.js from /v1/me + /v1/me/usage. The bar colour is
   thresholded via a data attribute (ok / warn / over) so CSS owns the palette
   and dashboard.js only toggles state. */
.quota-counter {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 22px;
  background: var(--bg);
  margin: 0 0 20px;
}
.quota-counter .stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 10px;
  font-weight: 600;
}
.quota-counter-headline {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
  color: var(--text);
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
}
.quota-counter-headline .unit {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}
.quota-counter-value {
  font-variant-numeric: tabular-nums;
}
.quota-counter-pct {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.quota-counter-bar {
  position: relative;
  height: 10px;
  background: var(--bg-alt);
  border-radius: 5px;
  overflow: hidden;
  margin: 0 0 8px;
}
.quota-counter-fill {
  height: 100%;
  width: 0%;
  border-radius: 5px;
  transition: width 0.25s ease, background 0.25s ease;
  background: linear-gradient(90deg, #15803d, #22c55e);
}
.quota-counter[data-quota-state="warn"] .quota-counter-fill {
  background: linear-gradient(90deg, #b45309, #f59e0b);
}
.quota-counter[data-quota-state="over"] .quota-counter-fill {
  background: linear-gradient(90deg, #991b1b, #dc2626);
}
.quota-counter[data-quota-state="over"] .quota-counter-pct,
.quota-counter[data-quota-state="over"] .quota-counter-note {
  color: var(--danger);
  font-weight: 600;
}
.quota-counter[data-quota-state="warn"] .quota-counter-pct {
  color: #b45309;
}
.quota-counter-note {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}
.quota-counter-note a {
  color: inherit;
  text-decoration: underline;
}
.quota-counter-note a:hover { color: var(--danger); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 36px 0;
  background: var(--bg-alt);
  font-size: 14px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
}
.footer-brand {
  margin: 0;
  font-weight: 700;
  color: var(--text);
}
.footer-tag {
  margin: 2px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}
.footer-nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
}
.footer-nav a { color: var(--text-muted); }
.footer-nav a:hover { color: var(--accent); }
.footer-copy {
  margin: 0;
  color: var(--text-muted);
  text-align: right;
}

/* Reduced motion — honor the OS-level "Reduce motion" preference.
   Covers .btn transition, SVG demo animation, and JS-injected spinners. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .hero { padding: 48px 0 40px; }
  .hero h1 { font-size: 32px; }
  .hero-sub { font-size: 17px; }
  .features,
  .code-demo,
  .newsletter,
  .pricing-preview,
  .pricing-page { padding: 40px 0; }
  .newsletter-form button { width: 100%; }
  .section-title { font-size: 22px; }
  .cards { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .header-inner { flex-wrap: wrap; gap: 12px; }
  .site-nav { gap: 16px; font-size: 14px; }
  .footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .footer-nav { justify-content: center; }
  .footer-copy { text-align: center; }
  .cta-row .btn { flex: 1 1 auto; text-align: center; }
}
