:root {
  --bg: #f4f6fb;
  --fg: #111827;
  --muted: #4b5563;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #dbeafe;
  --pro: #7c3aed;
  --pro-soft: #ede9fe;
  --card-bg: #fff;
  --border: #e5e7eb;
  --max: 920px;
  --shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", "Meiryo UI", "Hiragino Sans", sans-serif;
  margin: 0;
  padding: 0;
  line-height: 1.65;
  color: var(--fg);
  background: var(--bg);
}

a {
  color: var(--accent);
}

a:hover {
  color: var(--accent-hover);
}

.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;
}

/* Header */
.site-header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--fg);
  font-weight: 700;
  font-size: 1rem;
}

.logo-sm {
  border-radius: 8px;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  flex: 1;
}

.nav a {
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
}

.nav a:hover {
  color: var(--accent);
}

.lang-picker {
  position: relative;
  margin-left: auto;
}

.lang-picker-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--fg);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.lang-picker-btn:hover,
.lang-picker-btn[aria-expanded="true"] {
  border-color: #cbd5e1;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.lang-picker-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.lang-icon {
  flex-shrink: 0;
  color: var(--muted);
}

.lang-chevron {
  flex-shrink: 0;
  color: var(--muted);
  transition: transform 0.15s;
}

.lang-picker-btn[aria-expanded="true"] .lang-chevron {
  transform: rotate(180deg);
}

.lang-picker-menu {
  --lang-item-row: 2.375rem;
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  min-width: 13.5rem;
  max-width: min(18rem, 92vw);
  max-height: min(calc(0.7rem + var(--lang-item-row) * 15), 85vh);
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 20;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.lang-picker-menu[hidden] {
  display: none;
}

.lang-picker-menu li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: var(--lang-item-row, 2.375rem);
  padding: 0.5rem 0.65rem;
  border-radius: 7px;
  font-size: 0.875rem;
  cursor: pointer;
  color: var(--fg);
  box-sizing: border-box;
}

.lang-picker-menu li:hover {
  background: var(--accent-soft);
}

.lang-picker-menu li[aria-selected="true"] {
  background: var(--accent-soft);
  font-weight: 600;
  color: var(--accent);
}

.lang-option-code {
  min-width: 1.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.lang-picker-menu li[aria-selected="true"] .lang-option-code {
  color: var(--accent);
}

.lang-option-name {
  flex: 1;
}

/* Hero */
.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.25rem 2rem;
  text-align: center;
}

.hero-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1rem;
}

.hero-logo {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.12);
}

.hero-wordmark {
  margin: 0.7rem 0 0;
  font-size: clamp(1.35rem, 3.5vw, 1.65rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.15;
  background: linear-gradient(120deg, #1d4ed8 0%, #2563eb 42%, #6366f1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.35));
}

.hero-copy {
  max-width: min(100%, 44rem);
  margin: 0 auto 1.15rem;
}

.hero-catch {
  margin: 0 0 0.75rem;
  font-size: clamp(1.45rem, 3.8vw, 1.95rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.3;
  color: var(--fg);
}

html:lang(ja) .hero-catch {
  font-size: clamp(1.1rem, 2.5vw, 1.75rem);
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.hero-title {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0;
  font-size: 1.02rem;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: 0;
  color: var(--muted);
}

.hero-title-line {
  display: block;
}

.tagline {
  font-size: 1.12rem;
  font-weight: 600;
  margin: 1rem 0 0.65rem;
  max-width: 40em;
  margin-left: auto;
  margin-right: auto;
  color: var(--fg);
}

.lead {
  color: var(--muted);
  max-width: 40em;
  margin: 0 auto 1.25rem;
  font-size: 1rem;
}

.hero-features {
  list-style: none;
  margin: 0 auto 1.5rem;
  padding: 1rem 1.15rem;
  max-width: 34rem;
  text-align: left;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.hero-features li {
  position: relative;
  padding-left: 1.35rem;
  margin-bottom: 0.55rem;
  color: var(--fg);
  font-size: 0.98rem;
  line-height: 1.55;
}

.hero-features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--accent);
}

.hero-features strong {
  font-weight: 700;
  color: var(--fg);
}

.hero-screenshot-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin: 0 auto 1.35rem;
  padding: 0;
}

.hero-screenshot {
  display: block;
  width: 100%;
  max-width: 640px;
  height: auto;
  margin: 0 auto;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.hero-video-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin: 0 auto 1.35rem;
  padding: 0;
}

.hero-video {
  display: block;
  width: 100%;
  max-width: 640px;
  height: auto;
  margin: 0 auto;
  border-radius: 12px;
  box-shadow: var(--shadow);
  background: #000;
}

.hero-cta {
  margin-bottom: 0.75rem;
}

.btn-store {
  display: inline-block;
  background: var(--accent);
  color: #fff !important;
  text-decoration: none;
  padding: 0.7rem 1.5rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  transition: background 0.15s, transform 0.15s;
}

.btn-store:hover {
  background: var(--accent-hover);
  color: #fff !important;
  transform: translateY(-1px);
}

.btn-lg {
  padding: 0.85rem 1.75rem;
  font-size: 1.05rem;
}

.cta-sub {
  margin: 0.65rem 0 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

.trust-line {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0.5rem 0 0;
}

/* Sections */
main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

.section {
  margin-bottom: 2.75rem;
}

.section h2 {
  font-size: 1.35rem;
  margin: 0 0 1rem;
  text-align: center;
}

.problem {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow);
}

.problem-list {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  color: var(--muted);
}

.problem-list li {
  margin-bottom: 0.4rem;
}

.problem-solution {
  margin: 0;
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--fg);
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.cards {
  display: grid;
  gap: 1rem;
}

.cards-3 {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.cards-4 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.cards article {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow);
}

.cards h3 {
  margin: 0 0 0.45rem;
  font-size: 1rem;
}

.cards p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Pricing */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.price-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
}

.price-card-pro {
  border-color: #c4b5fd;
  background: linear-gradient(180deg, #faf5ff 0%, #fff 100%);
}

.price-card h3 {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
}

.price {
  font-size: 1.75rem;
  font-weight: 800;
  margin: 0 0 0.75rem;
  color: var(--accent);
}

.price-card-pro .price {
  color: var(--pro);
}

.price-card ul {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.price-card li {
  margin-bottom: 0.35rem;
}

.pricing-note {
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0;
}

/* Final CTA */
.cta-block {
  text-align: center;
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--pro-soft) 100%);
  border-radius: 16px;
  padding: 2rem 1.5rem;
}

.cta-block h2 {
  margin-bottom: 0.5rem;
}

.cta-lead {
  color: var(--muted);
  max-width: 32em;
  margin: 0 auto 1.25rem;
}

/* Subpages (support, privacy, release-notes) */
.page-title {
  max-width: var(--max);
  margin: 1.5rem auto 0;
  padding: 0 1rem;
  font-size: 1.5rem;
}

.content {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

.content h2 {
  font-size: 1.1rem;
  margin-top: 1.5rem;
}

.content ul {
  padding-left: 1.25rem;
}

.privacy-content > .privacy-updated {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.privacy-section {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.privacy-section:first-child {
  border-top: none;
  padding-top: 0;
}

.privacy-section > p:first-of-type {
  margin-top: 0.5rem;
}

.privacy-block {
  margin-top: 1rem;
}

.privacy-block h3,
.content h3 {
  font-size: 1rem;
  margin: 1rem 0 0.5rem;
}

.privacy-list {
  margin: 0.5rem 0 0.75rem;
}

.privacy-contact {
  margin-top: 0.75rem;
}

.privacy-contact a {
  color: var(--accent);
}

footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1rem 2.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

footer p {
  margin: 0.25rem 0;
}

@media (max-width: 640px) {
  .header-inner {
    justify-content: space-between;
  }

  .brand {
    order: 1;
  }

  .lang-picker {
    order: 2;
    margin-left: 0;
  }

  .nav {
    justify-content: center;
    order: 3;
    width: 100%;
    flex: none;
  }

  .hero-catch {
    font-size: 1.35rem;
  }

  html:lang(ja) .hero-catch {
    font-size: clamp(0.95rem, 4.2vw, 1.35rem);
    white-space: nowrap;
  }

  .hero-title {
    font-size: 0.98rem;
  }

  .hero-features {
    padding: 0.85rem 1rem;
  }

  .tagline {
    font-size: 1.02rem;
  }
}

/* RTL foundation (Arabic) */
html.is-rtl body {
  direction: rtl;
}

html.is-rtl .header-inner {
  direction: rtl;
}

html.is-rtl .lang-picker {
  margin-left: 0;
  margin-right: auto;
}

html.is-rtl .lang-picker-menu {
  right: auto;
  left: 0;
}

html.is-rtl .hero-copy,
html.is-rtl .hero-features {
  text-align: right;
}

html.is-rtl .hero-features {
  text-align: right;
}

html.is-rtl .hero-features li {
  padding-left: 0;
  padding-right: 1.35rem;
}

html.is-rtl .hero-features li::before {
  left: auto;
  right: 0;
}

html.is-rtl .problem-list {
  padding-left: 0;
  padding-right: 1.25rem;
}

html.is-rtl .nav {
  direction: rtl;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;
    --fg: #f1f5f9;
    --muted: #94a3b8;
    --card-bg: #1e293b;
    --border: #334155;
    --accent-soft: #1e3a5f;
    --pro-soft: #3b2667;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  }

  .lang-picker-btn:hover,
  .lang-picker-btn[aria-expanded="true"] {
    border-color: #475569;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  }

  .hero-wordmark {
    background: linear-gradient(120deg, #60a5fa 0%, #93c5fd 48%, #a5b4fc 100%);
    filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.25));
  }
}
