* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #0f1117;
    --bg-alt: #151823;
    --bg-card: #1a1d27;
    --border: #2a2e3a;
    --text: #e4e6eb;
    --muted: #b9bec9; /* lightened for readability over the brick background */
    --primary: #4f8cff;
    --primary-hover: #3d7aee;
}

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Hiragino Sans',
        'Noto Sans JP', sans-serif;
    /* Dungeon atmosphere: tiled brick wall + vignette, fixed so the walls stay
       put while the page scrolls. Dark overlay keeps text readable. */
    background-color: #140d07;
    background-image:
        radial-gradient(ellipse 95% 60% at 50% 22%, rgba(0, 0, 0, 0) 32%, rgba(0, 0, 0, 0.82) 100%),
        url(/img/crawly/brick.png?v=2);
    background-repeat: no-repeat, repeat;
    background-size: cover, 240px auto;
    background-attachment: fixed, fixed;
    color: var(--text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.05rem 0.35rem;
    font-size: 0.9em;
}

.container { max-width: 1080px; margin: 0 auto; padding: 0 1.5rem; }
.narrow { max-width: 760px; }
.center { text-align: center; }

/* Nav */
.nav {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(15, 17, 23, 0.85);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.05rem; }
.nav-links { display: flex; align-items: center; gap: 1.4rem; font-size: 0.92rem; }
.nav-links a:not(.btn):hover { color: var(--primary); }

/* Buttons */
.btn {
    display: inline-block;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid transparent;
    padding: 0.55rem 1.1rem;
    font-size: 0.95rem;
}
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.88rem; }
.btn-lg { padding: 0.85rem 1.8rem; font-size: 1.05rem; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { border-color: rgba(255, 255, 255, 0.45); color: #fff; background: rgba(0, 0, 0, 0.4); }
.btn-ghost:hover { border-color: var(--primary); color: #fff; background: rgba(79, 140, 255, 0.35); }

/* Hero */
.hero {
    padding: 6rem 0 5rem;
    text-align: center;
    background:
        radial-gradient(900px 380px at 50% -10%, rgba(79, 140, 255, 0.18), transparent 70%);
}
.eyebrow {
    color: var(--primary);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 0.8rem;
    margin-bottom: 1rem;
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.25; font-weight: 800; letter-spacing: -0.01em; }
.lead { color: #eceef3; font-size: 1.12rem; max-width: 680px; margin: 1.2rem auto 0; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); }
.lead strong { color: #fff; }
.hero-benefits {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem 1.2rem;
    max-width: 680px;
    margin: 1.4rem auto 0;
    padding: 0;
    text-align: left;
}
.hero-benefits li { color: var(--text); font-size: 0.95rem; }
@media (max-width: 640px) { .hero-benefits { grid-template-columns: 1fr; } }
.cta-row { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; margin-top: 2rem; }
.cta-row.center { justify-content: center; }
.hint { color: var(--muted); font-size: 0.85rem; margin-top: 1.4rem; }

/* Sections */
.section { padding: 4.5rem 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); font-weight: 800; text-align: center; margin-bottom: 0.5rem; }
.section-alt h2 { text-align: center; }
.section-alt .lead { text-align: center; }

/* Feature grid */
.section-sub { text-align: center; color: #e6e9ef; font-size: 0.95rem; margin-top: 0.6rem; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); }
.section-sub a { color: var(--primary); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; margin-top: 2rem; }
.card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.4rem;
    transition: border-color 0.15s, transform 0.15s;
}
.card:hover { border-color: var(--primary); transform: translateY(-2px); }
.card-icon { font-size: 1.6rem; margin-bottom: 0.6rem; min-height: 66px; display: flex; align-items: flex-end; }
.card-icon img { height: 64px; width: auto; image-rendering: pixelated; image-rendering: crisp-edges; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.4)); }
.card h3 { font-size: 1.05rem; margin-bottom: 0.4rem; }
.card p { color: var(--muted); font-size: 0.92rem; }
.card-link { margin-top: auto; padding-top: 0.8rem; color: var(--primary); font-size: 0.85rem; font-weight: 600; opacity: 0; transition: opacity 0.15s; }
.card:hover .card-link { opacity: 1; }

/* Footer */
.footer { border-top: 1px solid var(--border); padding: 2rem 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; }
.muted { color: var(--muted); font-size: 0.88rem; }

@media (max-width: 640px) {
    .nav-links a:not(.btn) { display: none; }
    .hero { padding: 4rem 0 3.5rem; }
}

/* ---- Docs / guide ------------------------------------------------------- */
.doc { display: grid; grid-template-columns: 230px 1fr; gap: 2.5rem; padding: 2.5rem 1.5rem 4rem; align-items: start; }
.doc-toc { position: sticky; top: 76px; align-self: start; background: rgba(8, 6, 3, 0.8); border: 1px solid var(--border); border-radius: 10px; padding: 0.9rem 0.75rem; backdrop-filter: blur(2px); }
.toc-title { color: #f2f4f8; font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.6rem; }
.doc-toc nav { display: flex; flex-direction: column; gap: 0.15rem; }
.doc-toc a { color: #eceef3; font-weight: 500; font-size: 0.9rem; padding: 0.3rem 0.5rem; border-radius: 6px; border-left: 2px solid transparent; }
.doc-toc a:hover { color: #fff; background: rgba(255, 255, 255, 0.12); border-left-color: var(--primary); }

.doc-body { min-width: 0; }
.doc-body h1 { font-size: 2rem; font-weight: 800; margin-bottom: 0.4rem; }
.doc-lead { color: var(--muted); margin-bottom: 1.5rem; }
.doc-body section { padding: 1.4rem 0; border-top: 1px solid var(--border); scroll-margin-top: 76px; }
.doc-body h2 { font-size: 1.35rem; font-weight: 700; margin-bottom: 0.7rem; }
.doc-body ul, .doc-body ol { margin: 0.3rem 0 0 1.2rem; }
.doc-body li { margin: 0.3rem 0; color: #c8ccd8; }
.doc-body li b { color: var(--text); }
.doc-body p { color: #c8ccd8; }
.note { background: var(--bg-card); border: 1px solid var(--border); border-left: 3px solid var(--primary); border-radius: 6px; padding: 0.6rem 0.9rem; font-size: 0.9rem; color: var(--muted); margin-top: 0.9rem; }
.cmp-eg { background: var(--bg); border: 1px solid var(--border); border-radius: 4px; padding: 0.05rem 0.4rem; }
.doc-back { margin-top: 2rem; }
.doc-back a { color: var(--primary); }

/* Screenshot figures */
.shot { margin: 1rem 0 0.3rem; }
.shot img { width: 100%; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,0.4); display: block; }
.shot figcaption { color: var(--muted); font-size: 0.82rem; margin-top: 0.5rem; text-align: center; }
.hero-shot { margin-top: 2.5rem; }
.hero-shot img { max-width: 960px; width: 100%; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }

@media (max-width: 820px) {
    .doc { grid-template-columns: 1fr; }
    .doc-toc { display: none; }
}

/* pricing */
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); max-width: 920px; margin-left: auto; margin-right: auto; }
.price-card { position: relative; text-align: center; display: flex; flex-direction: column; align-items: center; }
.price-card.featured { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.price-card h3 { margin: 0.2rem 0 0.4rem; }
.price { font-size: 2rem; font-weight: 800; color: var(--text); }
.price-note { color: var(--text-muted); font-size: 0.9rem; margin: 0.2rem 0 0.8rem; }
.price-feats { list-style: none; padding: 0; margin: 0.4rem 0 0; text-align: left; width: 100%; }
.price-feats li { padding: 0.32rem 0 0.32rem 1.4rem; position: relative; font-size: 0.9rem; color: var(--text); border-top: 1px solid var(--border); }
.price-feats li:before { content: "✓"; position: absolute; left: 0; color: var(--primary); font-weight: 700; }
.price-badge { position: absolute; top: -0.7rem; right: 0.9rem; background: var(--primary); color: #fff; font-size: 0.72rem; font-weight: 700; padding: 0.15rem 0.6rem; border-radius: 999px; }

/* FAQ accordion */
.faq-list { max-width: 720px; margin: 1.6rem auto 0; }
.faq { border: 1px solid var(--border); border-radius: 10px; background: var(--bg-card); margin-bottom: 0.7rem; overflow: hidden; }
.faq > summary { list-style: none; cursor: pointer; padding: 1rem 1.2rem; font-weight: 600; color: var(--text); font-size: 0.98rem; position: relative; padding-right: 2.6rem; }
.faq > summary::-webkit-details-marker { display: none; }
.faq > summary::after { content: "+"; position: absolute; right: 1.2rem; top: 50%; transform: translateY(-50%); color: var(--primary); font-size: 1.3rem; font-weight: 400; line-height: 1; transition: transform 0.15s; }
.faq[open] > summary::after { content: "−"; }
.faq > summary:hover { color: var(--primary); }
.faq-a { padding: 0 1.2rem 1.1rem; color: var(--muted); font-size: 0.92rem; line-height: 1.7; }
.faq-a strong { color: var(--text); }

/* Blog */
.blog-list { margin-top: 1.6rem; display: flex; flex-direction: column; gap: 0.9rem; }
.blog-item { display: block; }
.blog-item:hover { transform: translateY(-2px); }
.blog-date { color: var(--muted); font-size: 0.78rem; }
.blog-item h3 { margin: 0.3rem 0 0.4rem; font-size: 1.08rem; color: var(--text); }
.blog-item p { color: var(--muted); font-size: 0.9rem; margin: 0; }
.crumbs { color: #e6e9ef; font-size: 0.82rem; margin-bottom: 1rem; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }
.crumbs a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.crumbs a:hover { color: var(--primary); }

/* ---- Crawly mascot (LP rebrand) ---------------------------------------- */
:root { --accent: #e0a93c; } /* detective gold — warm accent, CTA stays blue */
.brand-icon { border-radius: 50%; vertical-align: middle; }
.brand-name { display: inline-flex; flex-direction: column; line-height: 1.05; }
.brand-name small { font-weight: 500; font-size: 0.62rem; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }
.hero .eyebrow { color: #f1f3f7; }

.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2.5rem; align-items: center; max-width: 980px; margin: 0 auto; text-align: left; }
.hero-copy .lead, .hero-copy .hero-benefits { margin-left: 0; margin-right: 0; }
.hero-copy .cta-row { justify-content: flex-start; }
.hero-copy h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); }
.hero-mascot { position: relative; flex-shrink: 0; align-self: center; margin: 2rem 0 0; }
.hero-mascot img { width: 260px; max-width: 36vw; height: auto; display: block; filter: drop-shadow(0 14px 30px rgba(0, 0, 0, 0.45)); }
.speech { position: absolute; z-index: 2; top: -1.6rem; left: 50%; transform: translateX(-50%); background: #fff; color: #1a1d27; font-size: 0.8rem; font-weight: 700; padding: 0.45rem 0.8rem; border-radius: 14px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4); white-space: nowrap; }
.speech:after { content: ""; position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%); border: 8px solid transparent; border-top-color: #fff; border-bottom: 0; }

@media (max-width: 760px) {
    .hero-grid { grid-template-columns: 1fr; text-align: center; }
    .hero-copy .cta-row { justify-content: center; }
    .hero-copy .lead, .hero-copy .hero-benefits { margin-left: auto; margin-right: auto; }
    .hero-mascot { order: -1; margin: 0 auto 1rem; }
    .hero-mascot img { width: 200px; max-width: 60vw; }
}

/* Legibility over the brick wall: brighten + shadow the hero text */
.hero h1 { text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7); }
.hero .eyebrow { text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7); }
.hero-benefits li { color: #f1f3f7; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65); }
.hero .hint { color: #e8eaef; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7); }
.hero .hint strong { color: #fff; }

/* Guide legibility over the brick wall: body sits on a dark "document" panel
   with near-white text. */
.doc-body {
    background: rgba(8, 6, 3, 0.74);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.4rem 1.8rem 2rem;
}
.doc-body h1 { color: #fff; }
.doc-lead { color: #eceef3; }
.doc-body h2 { color: #fff; }
.doc-body p, .doc-body li { color: #e8eaef; }
.doc-body li b { color: #fff; }
.doc-back a { color: var(--primary); }

/* Running Crawly (GIF-style) — 8-frame sprite played with pixel-accurate steps */
.crawly-run-gif {
    width: 130px;
    height: 98px;
    margin: 1.2rem auto 0.2rem;
    background: url(/img/crawly/run.png?v=2) 0 0 no-repeat;
    background-size: 1040px 98px;
    animation: crawly-run-gif 0.8s steps(8) infinite;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.45));
}
@keyframes crawly-run-gif { from { background-position-x: 0; } to { background-position-x: -1040px; } }
