:root {
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --bg-accent: #eff6ff;
  --bg-accent-strong: #dbeafe;
  --surface: #ffffff;
  --fg: #0f172a;
  --fg-secondary: #334155;
  --sub: #475569;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --accent: #2563eb;
  --accent-deep: #1e3a8a;
  --accent-hover: #1d4ed8;
  --success: #059669;
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;
  --warning: #b45309;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --header-h: 68px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 10px 30px rgba(37, 99, 235, 0.08), 0 4px 12px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 20px 40px rgba(15, 23, 42, 0.08);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.75 -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

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

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

/* Language visibility */
body.lang-en .t-ja { display: none !important; }
body.lang-ja .t-en { display: none !important; }

/* Sticky Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  z-index: 1000;
}

.header-inner {
  max-width: 1120px;
  height: 100%;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 20px;
  color: var(--fg);
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.brand:hover { color: var(--fg); }

.brand img {
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.18);
}

.brand-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-deep);
  background: var(--bg-accent);
  border: 1px solid var(--bg-accent-strong);
  padding: 2px 8px;
  border-radius: 999px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--fg-secondary);
  font-size: 14px;
  font-weight: 600;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
}

.icon-btn:hover {
  background: var(--bg-soft);
  color: var(--accent);
  border-color: var(--line);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.lang-switcher {
  display: inline-flex;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  margin-left: 4px;
}

.lang-btn {
  border: none;
  background: transparent;
  color: var(--sub);
  font-size: 13px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
}

.lang-btn.active {
  background: var(--surface);
  color: var(--accent-deep);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.1);
}

/* Layout & Containers */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Ensure fixed header never overlaps hero or main page content */
.hero {
  padding-top: calc(var(--header-h) + 44px);
  padding-bottom: 64px;
  background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
  border-bottom: 1px solid var(--line);
}

.page-main {
  padding-top: calc(var(--header-h) + 36px);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 40px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-deep);
  background: var(--bg-accent-strong);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.hero h1 {
  font-size: clamp(30px, 4.4vw, 48px);
  line-height: 1.18;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 0 0 18px;
  color: var(--fg);
}

.hero-lead {
  font-size: 17px;
  line-height: 1.7;
  color: var(--fg-secondary);
  margin: 0 0 28px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin-bottom: 24px;
}

.btn-primary-lg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--accent);
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  padding: 15px 28px;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
  border: none;
  cursor: pointer;
}

.btn-primary-lg:hover {
  background: var(--accent-hover);
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-secondary-lg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--surface);
  color: var(--fg);
  font-size: 16px;
  font-weight: 700;
  padding: 14px 22px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-strong);
  cursor: pointer;
}

.btn-secondary-lg:hover {
  background: var(--bg-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.trust-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.trust-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--fg-secondary);
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: 999px;
}

/* Visual Catch & Interactive Demo Card */
.hero-visual {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.visual-photo-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  background: var(--bg-soft);
  aspect-ratio: 16 / 9;
}

.visual-photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.visual-photo-badge {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
}

.demo-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-md);
}

.demo-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.demo-tab {
  font-size: 14px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--fg-secondary);
  cursor: pointer;
}

.demo-tab.active {
  background: var(--accent-deep);
  color: #ffffff;
  border-color: var(--accent-deep);
}

.passport-preview {
  background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
  border: 1px solid var(--bg-accent-strong);
  border-radius: var(--radius-md);
  padding: 18px;
}

.passport-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px dashed var(--line-strong);
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.passport-name {
  font-size: 24px;
  font-weight: 800;
  color: var(--accent-deep);
}

.passport-romaji {
  font-size: 15px;
  font-weight: 700;
  color: var(--sub);
}

.passport-scripts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.script-chip {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 14px;
}

.script-chip strong {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.match-badge {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
}

.match-badge.positive {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: #065f46;
}

.match-badge.caution {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  color: var(--warning);
}

/* Sections */
.section {
  padding: 68px 0;
}

.section-soft {
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-header {
  max-width: 720px;
  margin: 0 auto 40px;
  text-align: center;
}

.section-header h2 {
  font-size: clamp(24px, 3.2vw, 34px);
  font-weight: 800;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}

.section-header p {
  font-size: 16px;
  color: var(--sub);
  margin: 0;
}

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

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--bg-accent);
  color: var(--accent-deep);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 14px;
}

.card h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 8px;
}

.card p {
  font-size: 15px;
  color: var(--fg-secondary);
  margin: 0;
}

/* Recommender Tabs */
.rec-tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.rec-tab-btn {
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--fg-secondary);
  cursor: pointer;
}

.rec-tab-btn.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.rec-panel {
  display: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.rec-panel.active {
  display: block;
}

/* FAQ & Tables */
.faq-list {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px 24px;
}

.faq-item h3 {
  font-size: 17px;
  margin: 0 0 8px;
  color: var(--fg);
}

.faq-item p {
  font-size: 15px;
  margin: 0;
  color: var(--fg-secondary);
}

/* Legal / Policy Tables */
article h2 {
  font-size: 22px;
  margin: 34px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

article p, article li {
  font-size: 16px;
  color: var(--fg-secondary);
}

article .meta {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 20px;
}

article .lead {
  font-size: 17px;
  font-weight: 500;
  color: var(--fg);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

th, td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  vertical-align: top;
}

th {
  background: var(--bg-soft);
  color: var(--fg);
  font-weight: 700;
}

code {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 14px;
}

/* Footer */
.site-footer {
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
  padding: 40px 20px;
}

.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.brand-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--fg);
}

.footer-tagline {
  font-size: 14px;
  color: var(--sub);
  margin: 4px 0 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 14px;
  font-weight: 600;
}

.footer-copy {
  width: 100%;
  font-size: 13px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

/* Toast */
.copy-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--accent-deep);
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 2000;
}

.copy-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Responsive: Mobile header stays clean with icon-only nav buttons */
@media (max-width: 880px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .grid-3, .grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .brand-badge {
    display: none;
  }
  .icon-btn {
    padding: 8px;
  }
  .icon-btn .nav-label {
    display: none;
  }
  .btn-primary-lg, .btn-secondary-lg {
    width: 100%;
  }
}
