/* ---------- Tokens ---------- */
:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --surface: #ffffff;
  --text: #0f1419;
  --muted: #5b6573;
  --border: #e4e7ec;
  --accent: #c8102e;        /* deep crimson, a nod to Japanese red */
  --accent-soft: #fdecef;
  --accent-text: #ffffff;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
  --radius: 14px;
  --max: 1160px;
}
html[data-theme="dark"] {
  --bg: #0b0d10;
  --bg-soft: #12151a;
  --surface: #151920;
  --text: #eef1f5;
  --muted: #9aa4b2;
  --border: #252b35;
  --accent: #ff4d63;
  --accent-soft: #2a1418;
  --accent-text: #0b0d10;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
}

/* ---------- Language switching ----------
   Every translatable string exists twice in the HTML: data-l="ja" and data-l="en".
   CSS hides whichever one doesn't match <html data-lang>. No flash, no dictionary. */
html[data-lang="ja"] [data-l="en"],
html[data-lang="en"] [data-l="ja"] { display: none !important; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Noto Sans JP", system-ui, -apple-system, sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background .2s, color .2s;
}
html[data-lang="ja"] body { font-family: "Noto Sans JP", "Inter", system-ui, sans-serif; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header .container { display: flex; align-items: center; gap: 24px; height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .14em; font-size: 1.1rem; }
.logo-mark {
  width: 32px; height: 32px; border-radius: 8px; background: var(--accent); color: var(--accent-text);
  display: grid; place-items: center; font-size: .95rem; letter-spacing: 0;
}
.nav { display: flex; gap: 28px; margin-left: auto; }
.nav a { color: var(--muted); font-weight: 500; font-size: .95rem; }
.nav a:hover, .nav a.active { color: var(--text); }
.controls { display: flex; align-items: center; gap: 8px; }
.icon-btn, .lang-btn {
  height: 36px; min-width: 36px; padding: 0 10px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  cursor: pointer; font: inherit; font-size: .85rem; font-weight: 600;
  display: inline-grid; place-items: center;
}
.icon-btn:hover, .lang-btn:hover { border-color: var(--muted); }
.icon-btn svg { width: 18px; height: 18px; }
html[data-theme="dark"] .icon-sun, html:not([data-theme="dark"]) .icon-moon { display: none; }
.menu-btn { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 10px; font-weight: 600; font-size: .95rem;
  border: 1px solid transparent; cursor: pointer; font-family: inherit;
  transition: transform .15s, background .15s, border-color .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-ghost { border-color: var(--border); background: var(--surface); color: var(--text); }
.btn-ghost:hover { border-color: var(--muted); }

/* ---------- Sections ---------- */
section { padding: 96px 0; }
.section-soft { background: var(--bg-soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.eyebrow {
  display: inline-block; color: var(--accent); font-weight: 700; font-size: .8rem;
  letter-spacing: .14em; text-transform: uppercase; margin-bottom: 12px;
}
.section-head { max-width: 640px; margin-bottom: 48px; }
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
.section-head p { color: var(--muted); font-size: 1.05rem; }

/* ---------- Hero ---------- */
.hero { padding: 110px 0 96px; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 70% 20%, #000 0%, transparent 65%);
  opacity: .6;
}
.hero h1 { font-size: clamp(2.2rem, 5.2vw, 3.8rem); max-width: 860px; font-weight: 800; }
.hero h1 .hl { color: var(--accent); }
.hero .lead { font-size: 1.15rem; color: var(--muted); max-width: 640px; margin-bottom: 32px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); font-size: .85rem; color: var(--muted); margin-bottom: 24px;
}
.badge .dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; }

.page-hero { padding: 88px 0 56px; border-bottom: 1px solid var(--border); background: var(--bg-soft); }
.page-hero h1 { font-size: clamp(2rem, 4vw, 3rem); }
.page-hero p { color: var(--muted); font-size: 1.1rem; max-width: 640px; margin: 0; }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; transition: border-color .2s, transform .2s, box-shadow .2s;
}
.card:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); box-shadow: var(--shadow); transform: translateY(-2px); }
.card h3 { font-size: 1.15rem; }
.card p { color: var(--muted); font-size: .95rem; margin: 0; }
.card-icon {
  width: 44px; height: 44px; border-radius: 10px; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; margin-bottom: 18px;
}
.card-icon svg { width: 22px; height: 22px; }
.card-link { display: inline-block; margin-top: 16px; color: var(--accent); font-weight: 600; font-size: .9rem; }

.step-num { font-size: .8rem; font-weight: 700; color: var(--accent); letter-spacing: .1em; margin-bottom: 10px; }

/* ---------- Tech strip ---------- */
.tech { display: flex; flex-wrap: wrap; gap: 10px; }
.tech span {
  padding: 8px 16px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  font-size: .88rem; color: var(--muted); font-weight: 500;
}

/* ---------- Service detail (services page) ---------- */
.service {
  display: grid; grid-template-columns: 1fr 1.3fr; gap: 48px; padding: 56px 0;
  border-bottom: 1px solid var(--border); scroll-margin-top: 80px;
}
.service:last-child { border-bottom: 0; }
.service h2 { font-size: 1.7rem; }
.service .desc { color: var(--muted); }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.checklist li { display: flex; gap: 12px; align-items: flex-start; }
.checklist li::before {
  content: "✓"; flex: 0 0 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-size: .75rem; font-weight: 800; margin-top: 3px;
}
.deliverables { margin-top: 20px; font-size: .9rem; color: var(--muted); }
.deliverables strong { color: var(--text); }

/* ---------- Engagement / pricing ---------- */
.plan { display: flex; flex-direction: column; }
.plan .price { font-size: 1.6rem; font-weight: 800; margin: 8px 0 4px; }
.plan .price small { font-size: .85rem; color: var(--muted); font-weight: 500; }
.plan ul { margin: 18px 0 0; padding-left: 18px; color: var(--muted); font-size: .93rem; }
.plan.featured { border-color: var(--accent); box-shadow: var(--shadow); }
.tag { align-self: flex-start; font-size: .75rem; font-weight: 700; background: var(--accent); color: var(--accent-text); padding: 3px 10px; border-radius: 999px; margin-bottom: 10px; }

/* ---------- FAQ ---------- */
.faq { max-width: 820px; }
.faq details { border-bottom: 1px solid var(--border); padding: 20px 0; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { color: var(--muted); margin: 12px 0 0; }

/* ---------- CTA ---------- */
.cta {
  border-radius: 20px; padding: 64px 48px; text-align: center;
  background: var(--text); color: var(--bg);
}
.cta h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
.cta p { opacity: .75; max-width: 560px; margin: 0 auto 28px; }

/* ---------- Contact ---------- */
.contact-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: start; }
.form { display: grid; gap: 18px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field label { display: block; font-size: .88rem; font-weight: 600; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font: inherit; font-size: .95rem;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent); border-color: var(--accent); }
.field textarea { min-height: 150px; resize: vertical; }
.form-note { font-size: .82rem; color: var(--muted); margin: 0; }
.info-item { display: flex; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--border); }
.info-item:last-child { border-bottom: 0; }
.info-item .card-icon { margin: 0; flex: 0 0 44px; }
.info-item h4 { margin: 0 0 2px; font-size: .95rem; }
.info-item p { margin: 0; color: var(--muted); font-size: .93rem; }
.info-item a { color: var(--accent); font-weight: 600; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); background: var(--bg-soft); padding: 64px 0 28px; font-size: .92rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 40px; }
.footer h5 { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 16px; color: var(--muted); }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer ul a:hover { color: var(--accent); }
.footer .about p { color: var(--muted); max-width: 320px; margin-top: 14px; }
.footer-bottom {
  margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: .85rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .service, .contact-layout { grid-template-columns: 1fr; gap: 24px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  section { padding: 72px 0; }
  .menu-btn { display: inline-grid; }
  .nav {
    display: none; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--border); padding: 8px 20px 16px;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 0; }
  .controls { margin-left: auto; }
  .grid-3, .grid-4, .grid-2, .form .row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .cta { padding: 48px 24px; }
}
