/* Tiled MCP Pro - shared styles (site + guides). Theme: tile maps and pixel grids. */
:root {
  --bg: #0f1216;
  --surface: #171c23;
  --surface-2: #1f2630;
  --border: #2c3542;
  --text: #e8ecf1;
  --text-muted: #96a2b0;
  --accent: #8fd16a;        /* grass */
  --accent-hover: #a8e486;
  --gold: #f4bf4f;          /* sand / coin */
  --water: #4ea8de;
  --dirt: #c9784b;
  --ink: #0d1a08;           /* text on accent */
  --shadow: #090b0e;
  --mono: 'Cascadia Code', 'SF Mono', Consolas, 'Fira Code', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  background-color: var(--bg);
  /* a Tiled-style grid: 16 px cells, a stronger line every 64 px */
  background-image:
    linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,0.016) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.016) 1px, transparent 1px);
  background-size: 64px 64px, 64px 64px, 16px 16px, 16px 16px;
  color: var(--text);
  line-height: 1.6;
}
:lang(ja) body, body:lang(ja) {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic UI', Meiryo, sans-serif;
}
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
code { font-family: var(--mono); font-size: 0.92em; background: var(--surface-2); padding: 1px 6px; border-radius: 3px; color: var(--text); }
pre { font-family: var(--mono); background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 16px 18px; overflow-x: auto; font-size: 14px; line-height: 1.5; margin: 12px 0 20px; }
pre code { background: none; padding: 0; font-size: inherit; }
img.pixel, .pixel img { image-rendering: pixelated; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* Nav */
.site-nav { position: sticky; top: 0; z-index: 50; background: rgba(15,18,22,0.93); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.site-nav .container { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.nav-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; color: var(--text); text-decoration: none; }
.nav-brand img { width: 28px; height: 28px; image-rendering: pixelated; }
.nav-brand span { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 20px; list-style: none; }
.nav-links a { color: var(--text-muted); text-decoration: none; font-size: 14px; font-weight: 500; }
.nav-links a:hover { color: var(--text); }
.nav-links a.nav-cta { background: var(--accent); color: var(--ink); padding: 7px 16px; border-radius: 3px; font-weight: 700; box-shadow: 3px 3px 0 var(--shadow); }
.nav-links a.nav-cta:hover { background: var(--accent-hover); color: var(--ink); }
.lang-switcher select { background: var(--bg); border: 1px solid var(--border); border-radius: 3px; color: var(--text-muted); padding: 4px 8px; font-size: 12px; font-weight: 600; cursor: pointer; }
.nav-hamburger { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-hamburger span { display: block; width: 22px; height: 2px; background: var(--text); margin: 5px 0; transition: transform .2s, opacity .2s; }
.nav-hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.active span:nth-child(2) { opacity: 0; }
.nav-hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Hero */
.hero { padding: 68px 0 44px; }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.hero-badge { display: inline-flex; gap: 8px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 3px; padding: 4px 12px; font-size: 13px; color: var(--gold); margin-bottom: 20px; font-weight: 600; font-family: var(--mono); }
.hero-badge .dot { width: 8px; height: 8px; background: var(--gold); }
.hero h1 { font-size: 48px; font-weight: 800; line-height: 1.1; margin-bottom: 18px; letter-spacing: -0.5px; }
.hero h1 span { color: var(--accent); }
.hero p.lead { font-size: 19px; color: var(--text-muted); margin-bottom: 28px; max-width: 560px; }
.hero-buttons { display: flex; gap: 12px; flex-wrap: wrap; }
.btn { display: inline-block; background: var(--accent); color: var(--ink); padding: 12px 28px; border-radius: 3px; font-size: 17px; font-weight: 700; text-decoration: none; transition: background .2s, transform .1s; border: 2px solid var(--accent); box-shadow: 4px 4px 0 var(--shadow); }
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--shadow); }
.btn-alt { background: transparent; color: var(--accent); }
.btn-alt:hover { background: rgba(143,209,106,0.12); color: var(--text); }
.hero-price { display: block; margin-top: 14px; color: var(--text-muted); font-size: 14px; }

/* Map canvas: a Tiled-like viewport with a grid overlay and a tile cursor */
.map-canvas { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; box-shadow: 6px 6px 0 var(--shadow); overflow: hidden; }
.map-canvas .bar { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-bottom: 1px solid var(--border); font-family: var(--mono); font-size: 12px; color: var(--text-muted); background: var(--surface-2); }
.map-canvas .bar i { width: 10px; height: 10px; display: inline-block; }
.map-canvas .bar .tab { color: var(--text); }
.map-canvas .bar .right { margin-left: auto; }
.map-canvas .view { position: relative; line-height: 0; }
.map-canvas .view img { width: 100%; height: auto; display: block; image-rendering: pixelated; }
.map-canvas .view .grid { position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(0,0,0,0.22) 1px, transparent 1px), linear-gradient(90deg, rgba(0,0,0,0.22) 1px, transparent 1px);
  background-size: var(--cell, 6.25%) var(--cell-y, 10%); }
.map-canvas .view .cursor { position: absolute; border: 2px dashed #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.6); animation: hop 6s steps(1) infinite; }
@keyframes hop {
  0% { transform: translate(0, 0); }
  25% { transform: translate(200%, 0); }
  50% { transform: translate(200%, 100%); }
  75% { transform: translate(0, 100%); }
}
@media (prefers-reduced-motion: reduce) { .map-canvas .view .cursor { animation: none; } }
.map-canvas .caption { font-size: 12px; color: var(--text-muted); padding: 8px 12px; border-top: 1px solid var(--border); }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 8px 0 64px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 20px; text-align: center; box-shadow: 4px 4px 0 var(--shadow); }
.stat-number { font-size: 34px; font-weight: 800; color: var(--accent); line-height: 1.2; font-family: var(--mono); }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* Sections */
.section { margin-bottom: 76px; scroll-margin-top: 72px; }
.section h2 { font-size: 32px; font-weight: 800; margin-bottom: 8px; letter-spacing: -0.3px; }
.section h2::before { content: ""; display: inline-block; width: 14px; height: 14px; background: var(--accent); margin-right: 12px; vertical-align: 3px; box-shadow: 4px 4px 0 var(--gold); }
.section .subtitle { color: var(--text-muted); margin-bottom: 28px; font-size: 16px; max-width: 780px; }

/* Arch */
.arch { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 24px; }
.arch pre { background: var(--bg); color: var(--accent); margin: 0 0 12px; text-align: left; }
.arch p { color: var(--text-muted); font-size: 14px; }

/* Feature cards */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 22px; position: relative; overflow: hidden; }
.feature::before { content: ""; position: absolute; left: 0; top: 0; width: 12px; height: 12px; background: var(--accent); }
.feature.gold::before { background: var(--gold); }
.feature.water::before { background: var(--water); }
.feature.dirt::before { background: var(--dirt); }
.feature h3 { font-size: 17px; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.feature .tag { font-size: 11px; font-weight: 700; color: var(--gold); border: 1px solid rgba(244,191,79,.45); border-radius: 3px; padding: 0 6px; font-family: var(--mono); }
.feature p { color: var(--text-muted); font-size: 14.5px; }
.feature .tools { margin-top: 10px; font-size: 12.5px; color: var(--text-muted); line-height: 1.9; }
.feature .tools code { font-size: 12px; }

/* Smart Tiles explainer */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 22px; }
.panel h3 { font-size: 17px; margin-bottom: 8px; }
.panel p { color: var(--text-muted); font-size: 14.5px; margin-bottom: 10px; }
.bitmask { display: grid; grid-template-columns: repeat(3, 64px); grid-template-rows: repeat(3, 64px); gap: 4px; margin: 14px 0; }
.bitmask div { display: grid; place-items: center; font-family: var(--mono); font-weight: 700; font-size: 13px; border-radius: 2px; background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); text-align: center; line-height: 1.2; }
.bitmask .on { background: rgba(143,209,106,.18); color: var(--accent); border-color: rgba(143,209,106,.5); }
.bitmask .me { background: var(--accent); color: var(--ink); }
.ascii { font-family: var(--mono); background: var(--bg); border: 1px solid var(--border); border-radius: 4px; padding: 12px 14px; font-size: 14px; line-height: 1.35; white-space: pre; overflow-x: auto; color: var(--text); }
.ascii .w { color: var(--dirt); }
.ascii .f { color: var(--text-muted); }
.ascii .t { color: var(--water); }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.shot { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; overflow: hidden; margin: 0; box-shadow: 4px 4px 0 var(--shadow); }
.shot img { width: 100%; height: auto; display: block; image-rendering: pixelated; background: #000; }
.gallery .shot > img { aspect-ratio: 3 / 2; object-fit: cover; }
.shot figcaption { padding: 10px 12px; font-size: 13.5px; color: var(--text); }
.shot figcaption small { display: block; color: var(--text-muted); font-size: 12px; line-height: 1.45; margin-top: 3px; }
.before-after { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--border); }
.before-after div { position: relative; }
.before-after span { position: absolute; left: 8px; top: 8px; background: rgba(0,0,0,.7); color: #fff; font-family: var(--mono); font-size: 11px; padding: 2px 6px; border-radius: 2px; line-height: 1.4; }
.gallery-note { color: var(--text-muted); font-size: 13px; margin-top: 12px; }

/* Tables */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 15px; }
table.data td code { white-space: nowrap; }
table.data th, table.data td { padding: 11px 16px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data th { color: var(--text-muted); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .5px; }
table.data td.num { color: var(--accent); font-weight: 800; font-family: var(--mono); }

/* Clients */
.clients { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.client { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 16px 18px; }
.client strong { display: block; margin-bottom: 2px; }
.client span { color: var(--text-muted); font-size: 13.5px; }

/* Steps */
.steps { counter-reset: step; display: grid; gap: 14px; }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 20px 22px 8px 64px; position: relative; }
.step::before { counter-increment: step; content: counter(step); position: absolute; left: 18px; top: 18px; width: 30px; height: 30px; border-radius: 2px; background: var(--accent); color: var(--ink); font-weight: 800; display: grid; place-items: center; font-size: 15px; font-family: var(--mono); box-shadow: 3px 3px 0 var(--shadow); }
.step h3 { font-size: 17px; margin-bottom: 4px; }
.step p { color: var(--text-muted); font-size: 14.5px; margin-bottom: 8px; }
.step pre { margin: 8px 0 14px; }

/* Demo */
.video-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.video-slot { aspect-ratio: 16 / 9; background: var(--surface); border: 1px dashed var(--border); border-radius: 4px; display: grid; place-items: center; color: var(--text-muted); font-size: 14px; text-align: center; padding: 16px; overflow: hidden; }
.video-slot iframe { width: 100%; height: 100%; border: 0; }
.video-slot:has(iframe) { padding: 0; border-style: solid; }

/* Notice */
.notice { background: rgba(244,191,79,0.07); border: 1px solid rgba(244,191,79,0.35); border-radius: 4px; padding: 20px 22px; }
.notice h3 { color: var(--gold); font-size: 17px; margin-bottom: 6px; }
.notice ul { margin: 6px 0 0 20px; color: var(--text-muted); font-size: 14.5px; }
.notice li { margin: 3px 0; }

/* FAQ */
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; margin-bottom: 10px; }
.faq-item summary { cursor: pointer; padding: 16px 20px; font-weight: 600; list-style: none; position: relative; padding-right: 44px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 20px; top: 12px; font-size: 22px; color: var(--accent); font-family: var(--mono); }
.faq-item[open] summary::after { content: "\2212"; }
.faq-item .answer { padding: 0 20px 16px; color: var(--text-muted); font-size: 15px; }

/* Pricing */
.pricing { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: center; background: linear-gradient(135deg, rgba(143,209,106,0.10), rgba(78,168,222,0.07)); border: 1px solid var(--border); border-radius: 4px; padding: 36px; box-shadow: 6px 6px 0 var(--shadow); }
.price { font-size: 56px; font-weight: 800; line-height: 1; font-family: var(--mono); }
.price small { font-size: 18px; color: var(--text-muted); font-weight: 500; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif; }
.pricing ul { list-style: none; }
.pricing li { padding: 5px 0 5px 26px; position: relative; color: var(--text); font-size: 15px; }
.pricing li::before { content: ""; position: absolute; left: 4px; top: 13px; width: 9px; height: 9px; background: var(--accent); }

/* Cards (guides, siblings) */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 18px 20px; text-decoration: none; color: var(--text); transition: border-color .2s, transform .2s, box-shadow .2s; }
.card:hover { border-color: var(--accent); color: var(--text); transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--shadow); }
.card strong { display: block; font-size: 16px; margin-bottom: 4px; }
.card span { color: var(--text-muted); font-size: 13.5px; }

/* Article (guides) */
.article { max-width: 800px; margin: 0 auto; padding: 48px 24px 24px; }
.breadcrumb { font-size: 13px; color: var(--text-muted); margin-bottom: 18px; }
.breadcrumb a { color: var(--text-muted); }
.article h1 { font-size: 38px; line-height: 1.15; margin-bottom: 12px; letter-spacing: -0.3px; }
.article .meta { color: var(--text-muted); font-size: 14px; margin-bottom: 28px; }
.article h2 { font-size: 24px; margin: 36px 0 10px; scroll-margin-top: 72px; }
.article h3 { font-size: 18px; margin: 22px 0 8px; }
.article p, .article li { font-size: 16px; color: #d3dae2; }
.article p { margin-bottom: 14px; }
.article ul, .article ol { margin: 0 0 16px 22px; }
.article li { margin: 4px 0; }
.article .table-wrap { margin: 12px 0 20px; }
.article figure { margin: 18px 0 24px; }
.article figure img { width: 100%; height: auto; border-radius: 4px; border: 1px solid var(--border); display: block; image-rendering: pixelated; }
.article figure .before-after img { border: 0; border-radius: 0; }
.article figcaption { color: var(--text-muted); font-size: 13px; margin-top: 6px; }
.tip { background: rgba(143,209,106,0.07); border-left: 4px solid var(--accent); padding: 12px 16px; border-radius: 0 4px 4px 0; margin: 16px 0 20px; font-size: 15px; color: #d3dae2; }
.tip.warn { background: rgba(244,191,79,0.07); border-left-color: var(--gold); }
.article-cta { margin: 40px 0 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 22px; display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.article-cta p { margin: 0; }
.toc { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 14px 18px; margin: 0 0 24px; font-size: 14.5px; }
.toc ol, .toc ul { margin: 6px 0 0 20px; }

/* Footer */
footer { border-top: 1px solid var(--border); padding: 32px 0 40px; color: var(--text-muted); font-size: 14px; margin-top: 40px; background: rgba(15,18,22,0.85); }
footer a { color: var(--text-muted); }
footer a:hover { color: var(--text); }
footer p + p { margin-top: 8px; }
footer .legal { font-size: 12.5px; }

@media (max-width: 860px) {
  .hero-grid, .split { grid-template-columns: 1fr; }
  .hero h1 { font-size: 38px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .pricing { grid-template-columns: 1fr; padding: 24px; }
  .nav-hamburger { display: block; }
  .nav-links { display: none; position: absolute; top: 60px; left: 0; right: 0; flex-direction: column; align-items: flex-start; gap: 0; background: var(--bg); border-bottom: 1px solid var(--border); padding: 8px 24px 16px; }
  .nav-links.open { display: flex; }
  .nav-links li { padding: 8px 0; }
  .article h1 { font-size: 30px; }
}
@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .hero { padding-top: 44px; }
  .hero h1 { font-size: 32px; }
  .section h2 { font-size: 26px; }
  .article { padding: 32px 16px 16px; }
  .gallery { grid-template-columns: 1fr; }
  .video-grid { grid-template-columns: 1fr; }
  .bitmask { grid-template-columns: repeat(3, 56px); grid-template-rows: repeat(3, 56px); }
  .map-canvas .bar span:not(.tab):not(.right) { display: none; }
}

/* Keep long code and pre blocks from widening the page on small screens */
.hero-grid > *, .features > *, .clients > *, .cards > *, .pricing > *, .split > *, .gallery > *, .step, .arch, .panel { min-width: 0; }
p code, li code, .client code, .tools code, .hero-price code, .caption code, td code, figcaption code { overflow-wrap: anywhere; }
pre, .ascii { max-width: 100%; }
