/* === Tokens === */
:root {
  --bg:       #f6f9f4;
  --bg-alt:   #eef3eb;
  --surface:  #ffffff;
  --border:   #d4ddd0;
  --text:     #2c3e2c;
  --text-dim: #5f7a5f;
  --accent:   #3a8a4f;
  --accent2:  #6cb87a;
  --navy:     #2c5e3a;
  --radius:   12px;
  --max-w:    1200px;
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* === Nav === */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background .3s, box-shadow .3s;
}
.nav.scrolled { background: rgba(246,249,244,.95); backdrop-filter: blur(12px); box-shadow: 0 1px 0 var(--border); }
.nav-inner {
  max-width: var(--max-w); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px;
}
.nav-logo { display: flex; align-items: center; gap: 10px; }
.nav-wordmark { font-weight: 700; font-size: 1.1rem; letter-spacing: 0.12em; color: var(--text); }
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links a { font-size: .9rem; font-weight: 500; color: var(--text-dim); transition: color .2s; }
.nav-links a:hover { color: var(--text); }
.nav-cta {
  background: var(--accent); color: #fff !important; padding: 8px 20px;
  border-radius: 6px; font-weight: 600; transition: opacity .2s;
}
.nav-cta:hover { opacity: .85; }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; flex-direction: column; gap: 5px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text-dim); border-radius: 1px; }

/* === Hero === */
.hero { position: relative; min-height: 100vh; display: flex; align-items: center; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; }
.hero-bg img, .hero-bg canvas, .hero-video {
  width: 100%; height: 100%; object-fit: cover; display: block;
  position: absolute; inset: 0;
}
.hero-video {
  opacity: 0;
  transition: opacity 1s ease-in-out;
}
.hero-video.active {
  opacity: 1;
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(246,249,244,.93) 40%, rgba(108,184,122,.35) 100%);
}
.hero-content {
  position: relative; z-index: 1;
  max-width: var(--max-w); margin: 0 auto; padding: 140px 28px 80px;
}
.hero-badge {
  display: inline-block; font-size: .75rem; font-weight: 700;
  letter-spacing: 0.2em; color: var(--accent);
  border: 1px solid rgba(58,138,79,.4); padding: 6px 16px;
  border-radius: 100px; margin-bottom: 28px;
}
.hero-tagline {
  font-size: clamp(3.4rem, 8vw, 6.5rem); font-weight: 900; line-height: 1;
  margin-bottom: 16px; text-align: center;
  background: linear-gradient(135deg, var(--accent) 0%, #7b4fbf 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0; scale: 0.6;
  animation: tagline-in 1.8s cubic-bezier(0.22, 1, 0.36, 1) 0.3s forwards;
}
@keyframes tagline-in {
  0%   { opacity: 0; scale: 0.6; }
  100% { opacity: 1; scale: 1;   }
}
.hero-title { font-size: clamp(2.8rem, 6vw, 5rem); font-weight: 800; line-height: 1.08; margin-bottom: 24px; }
.hero-accent { color: var(--accent); }
.hero-sub { max-width: 560px; font-size: 1.1rem; color: var(--text-dim); margin-bottom: 36px; line-height: 1.7; }
.hero-actions { display: flex; gap: 16px; margin-bottom: 56px; flex-wrap: wrap; }

/* === Buttons === */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 32px; border-radius: 8px; font-size: .95rem; font-weight: 600;
  transition: transform .15s, opacity .2s; cursor: pointer; border: none;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; }
.section-cta .btn-primary { background: #fff; color: var(--navy); }
.btn-primary:hover { opacity: .88; }
.btn-outline { border: 1px solid var(--border); color: var(--text); background: transparent; }
.btn-outline:hover { border-color: var(--text-dim); }
.btn-lg { padding: 18px 44px; font-size: 1.05rem; }

/* === Hero Stats === */
.hero-stats { display: flex; gap: 48px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; }
.stat-value { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; }
.stat-label { font-size: .78rem; color: var(--text-dim); letter-spacing: 0.04em; margin-top: 4px; }

/* === Sections === */
.section { padding: 100px 0; }
.section-dark { background: var(--bg-alt); }
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 28px; }
.section-badge {
  font-size: .72rem; font-weight: 700; letter-spacing: 0.22em;
  color: var(--accent); margin-bottom: 16px;
}
.section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem); font-weight: 800;
  line-height: 1.15; margin-bottom: 56px;
}

/* === Feature Cards === */
.features-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.feature-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 36px 30px;
  box-shadow: 0 2px 8px rgba(44,62,44,.06);
  transition: transform .2s, border-color .3s, box-shadow .3s, opacity .5s, translate .5s;
  opacity: 0; translate: 0 30px;
}
.feature-card.visible { opacity: 1; translate: 0 0; }
.feature-card:hover { transform: translateY(-4px); border-color: rgba(58,138,79,.3); box-shadow: 0 8px 24px rgba(44,62,44,.1); }
.feature-icon { width: 48px; height: 48px; color: var(--accent); margin-bottom: 20px; }
.feature-card h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 10px; }
.feature-card p { font-size: .9rem; color: var(--text-dim); line-height: 1.65; }

/* === Steps === */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.step {
  opacity: 0; translate: 0 30px;
  transition: opacity .5s, translate .5s;
}
.step.visible { opacity: 1; translate: 0 0; }
.step-num {
  font-size: 3.5rem; font-weight: 900; color: var(--accent);
  opacity: .25; line-height: 1; margin-bottom: 20px;
}
.step h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 12px; }
.step p { font-size: .9rem; color: var(--text-dim); line-height: 1.7; }

/* === Specs === */
.specs-grid { max-width: 760px; }
.spec-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 16px 0; border-bottom: 1px solid var(--border);
  opacity: 0; translate: 0 16px;
  transition: opacity .4s, translate .4s;
}
.spec-row.visible { opacity: 1; translate: 0 0; }
.spec-label { font-size: .88rem; color: var(--text-dim); font-weight: 500; }
.spec-value { font-size: .92rem; font-weight: 600; text-align: right; }

/* === Section Lead === */
.section-lead {
  max-width: 680px; font-size: 1.05rem; color: var(--text-dim);
  line-height: 1.75; margin-top: -28px; margin-bottom: 48px;
}

/* === Compare Grid === */
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.compare-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 36px 30px;
  opacity: 0; translate: 0 30px;
  transition: opacity .5s, translate .5s;
}
.compare-card.visible { opacity: 1; translate: 0 0; }
.compare-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 18px; }
.compare-card ul { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.compare-card li {
  font-size: .9rem; color: var(--text-dim); line-height: 1.55;
  padding-left: 22px; position: relative;
}
.compare-card li::before {
  content: ''; position: absolute; left: 0; top: 7px;
  width: 8px; height: 8px; border-radius: 50%;
}
.compare-old li::before { background: var(--text-dim); opacity: .4; }
.compare-new li::before { background: var(--accent); }
.compare-new { border-color: rgba(233,69,96,.3); }

/* === Flow Steps (Attention) === */
.flow-steps { display: flex; flex-direction: column; gap: 0; margin-bottom: 48px; }
.flow-step {
  display: flex; gap: 28px; padding: 28px 0;
  border-bottom: 1px solid var(--border);
  opacity: 0; translate: 0 20px;
  transition: opacity .4s, translate .4s;
}
.flow-step.visible { opacity: 1; translate: 0 0; }
.flow-num {
  font-size: 2.4rem; font-weight: 900; color: var(--accent);
  opacity: .3; line-height: 1; min-width: 56px; flex-shrink: 0;
}
.flow-body h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.flow-body p { font-size: .9rem; color: var(--text-dim); line-height: 1.65; }

/* === Callout === */
.callout {
  background: rgba(58,138,79,.06); border: 1px solid rgba(58,138,79,.25);
  border-radius: var(--radius); padding: 24px 28px;
}
.callout p { font-size: .92rem; color: var(--text-dim); line-height: 1.7; }
.callout strong { color: var(--text); }

/* === Architecture Diagram === */
.arch-diagram { margin-bottom: 56px; }
.arch-svg { width: 100%; height: auto; max-width: 860px; display: block; margin: 0 auto; }

/* === Bandwidth Compare === */
.bw-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-bottom: 24px; }
.bw-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 40px 32px; text-align: center;
  opacity: 0; translate: 0 24px;
  transition: opacity .5s, translate .5s;
}
.bw-card.visible { opacity: 1; translate: 0 0; }
.bw-card h3 { font-size: .9rem; font-weight: 600; color: var(--text-dim); margin-bottom: 16px; }
.bw-number {
  font-size: 3.5rem; font-weight: 900; line-height: 1; margin-bottom: 12px;
}
.bw-number span { font-size: 1.2rem; font-weight: 600; color: var(--text-dim); }
.bw-card p { font-size: .85rem; color: var(--text-dim); }
.bw-card-accent { border-color: rgba(58,138,79,.3); }
.bw-card-accent .bw-number { color: var(--accent); }
.bw-note { font-size: .82rem; color: var(--text-dim); opacity: .7; max-width: 680px; }

/* === CTA === */
.section-cta {
  text-align: center;
  background: linear-gradient(160deg, #2c5e3a 0%, #4a9e5e 100%);
  color: #fff;
  padding: 120px 0;
}
.cta-title { font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 800; margin-bottom: 16px; color: #fff; }
.cta-sub { font-size: 1.1rem; color: rgba(255,255,255,.75); margin-bottom: 36px; }

/* === Contact Form === */
.contact-form { max-width: 640px; margin: 0 auto; text-align: left; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block; font-size: .85rem; font-weight: 600;
  color: rgba(255,255,255,.85); margin-bottom: 6px;
}
.form-group .required { color: #fca5a5; }
.form-group input,
.form-group textarea {
  width: 100%; padding: 12px 14px;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px; color: #fff; font-size: .95rem;
  font-family: inherit; transition: border-color .2s, background .2s;
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: rgba(255,255,255,.4); }
.form-group input:focus,
.form-group textarea:focus {
  outline: none; border-color: rgba(255,255,255,.5);
  background: rgba(255,255,255,.18);
}
.form-group textarea { resize: vertical; }
.form-success {
  font-size: 1.2rem; font-weight: 600; color: #fff;
  text-align: center; padding: 40px 0;
}

/* === Footer === */
.footer { padding: 40px 0; border-top: 1px solid var(--border); }
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 20px;
}
.footer-brand { display: flex; align-items: center; gap: 8px; }
.footer-links { display: flex; gap: 24px; }
.footer-links a { font-size: .85rem; color: var(--text-dim); transition: color .2s; }
.footer-links a:hover { color: var(--text); }
.footer-copy { font-size: .8rem; color: var(--text-dim); }

/* === Language Switch === */
.lang-switch {
  background: transparent; border: 1px solid var(--border); color: var(--text-dim);
  padding: 5px 12px; border-radius: 6px; font-size: .78rem; font-weight: 600;
  cursor: pointer; letter-spacing: 0.06em; transition: border-color .2s, color .2s;
  white-space: nowrap;
}
.lang-switch:hover { border-color: var(--accent); color: var(--accent); }
.nav-right-mobile { display: none; align-items: center; gap: 10px; }

/* Default: show EN, hide JA */
.ja { display: none; }
body.lang-ja .en { display: none; }
body.lang-ja .ja { display: inline; }
/* Block-level containers need display:block */
body.lang-ja h1 .ja,
body.lang-ja h2 .ja,
body.lang-ja p .ja { display: inline; }

/* Highlight current lang in button */
body.lang-ja .lang-switch { border-color: var(--accent); color: var(--accent); }

/* === Mobile === */
@media (max-width: 900px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; gap: 48px; }
  .compare-grid { grid-template-columns: 1fr; }
  .bw-compare { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
  .nav-links {
    display: none; position: fixed; inset: 0; top: 70px;
    background: rgba(246,249,244,.97); backdrop-filter: blur(12px);
    flex-direction: column; align-items: center; justify-content: center;
    gap: 28px; padding: 40px;
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: flex; }
  .nav-links .lang-switch { display: none; }
  .nav-right-mobile { display: flex; }
  .features-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 28px; }
  .spec-row { flex-direction: column; gap: 4px; }
  .spec-value { text-align: left; }
  .footer-inner { flex-direction: column; text-align: center; }
  .flow-step { flex-direction: column; gap: 12px; }
  .flow-num { min-width: auto; }
}
