/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --color-bg: #fafafa;
  --color-surface: #ffffff;
  --color-text: #1a1a1a;
  --color-text-secondary: #555;
  --color-accent: #0071e3;
  --color-accent-hover: #005bb5;
  --color-border: #e0e0e0;
  --color-hero-bg: #000;
  --color-hero-text: #fff;
  --radius: 12px;
  --max-width: 800px;
  --transition: 0.2s ease;
}

html { scroll-behavior: smooth; }

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

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

img { max-width: 100%; height: auto; display: block; }

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--color-border);
  /* needed so the mobile dropdown is positioned relative to the header */
  isolation: isolate;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--color-text);
}

.site-nav { display: flex; gap: 24px; align-items: center; }

.site-nav a {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  font-weight: 500;
}

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

/* Right side grouping: [nav links] [lang-toggle] [hamburger] */
.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ===== Hero ===== */
.hero {
  background: var(--color-hero-bg);
  color: var(--color-hero-text);
  text-align: center;
  padding: 100px 24px 80px;
}

.hero-icon {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  margin: 0 auto 28px;
  display: block;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.hero h1 {
  font-size: 3.2rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin-bottom: 16px;
}

.hero .tagline {
  font-size: 1.15rem;
  opacity: 0.8;
  max-width: 520px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

.hero .badge {
  display: inline-block;
  padding: 10px 28px;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}

/* ===== Section ===== */
.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 64px 24px;
}

.section + .section { padding-top: 0; }

.section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 24px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--color-text);
}

.section h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 12px;
}

.section p { margin-bottom: 16px; }

.section ul, .section ol {
  margin-bottom: 16px;
  padding-left: 1.5em;
}

.section li { margin-bottom: 6px; }

/* ===== Feature Grid ===== */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.feature-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 28px 24px;
}

.feature-card .icon {
  width: 56px;
  height: 56px;
  margin-bottom: 12px;
}

.feature-card .icon img {
  width: 56px;
  height: 56px;
}

.feature-card h3 {
  font-size: 1rem;
  margin-top: 0;
  margin-bottom: 8px;
}

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

/* ===== Plan Table ===== */
.plan-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.92rem;
}

.plan-table th, .plan-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.plan-table th {
  background: var(--color-text);
  color: #fff;
  font-weight: 600;
}

.plan-table tr:last-child td { border-bottom: none; }

.plan-table tbody tr:nth-child(even) { background: #f5f5f7; }

/* ===== Legal Pages ===== */
.legal-page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.legal-page h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.legal-page .last-updated {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin-bottom: 40px;
}

.legal-page h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-top: 40px;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--color-border);
}

.legal-page h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 8px;
}

.legal-page p { margin-bottom: 14px; font-size: 0.95rem; }

.legal-page ul, .legal-page ol {
  margin-bottom: 14px;
  padding-left: 1.5em;
  font-size: 0.95rem;
}

.legal-page li { margin-bottom: 6px; }

.legal-page table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.92rem;
}

.legal-page table th,
.legal-page table td {
  padding: 10px 14px;
  text-align: left;
  border: 1px solid var(--color-border);
}

.legal-page table th {
  background: #f5f5f7;
  font-weight: 600;
}

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 32px 24px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--color-text-secondary);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.footer-links a { font-size: 0.82rem; color: var(--color-text-secondary); }
.footer-links a:hover { color: var(--color-accent); }

/* ===== Language blocks ===== */
html[lang="ja"] .lang-en { display: none !important; }
html[lang="en"] .lang-ja { display: none !important; }

/* ===== Language toggle button ===== */
.lang-toggle {
  background: transparent;
  border: 1.5px solid var(--color-border);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  color: var(--color-text-secondary);
  font-family: inherit;
  transition: border-color var(--transition), color var(--transition);
  flex-shrink: 0;
}

.lang-toggle:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* ===== Hamburger button (mobile only) ===== */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  flex-shrink: 0;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
  transform-origin: center;
}

.nav-hamburger.is-open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-hamburger.is-open span:nth-child(2) { opacity: 0; }
.nav-hamburger.is-open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .nav-hamburger { display: flex; }

  .site-nav {
    display: none;
    position: absolute;
    top: 52px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    padding: 6px 0 10px;
    z-index: 200;
  }

  .site-nav.is-open { display: flex; }

  .site-nav a {
    font-size: 0.95rem;
    padding: 11px 24px;
    border-bottom: 1px solid var(--color-border);
  }

  .site-nav a:last-child { border-bottom: none; }

  .hero { padding: 64px 20px 56px; }
  .hero h1 { font-size: 2.2rem; }
  .hero .tagline { font-size: 1rem; }
  .section { padding: 40px 20px; }
  .legal-page { padding: 32px 20px 60px; }
  .feature-grid { grid-template-columns: 1fr; }
}
