/* =========================================================================
   Visionary theme — modern base styles
   ライト/ダーク両対応。デザイントークン → 要素 → コンポーネントの順。
   ========================================================================= */

:root {
    /* palette (light) */
    --bg: #ffffff;
    --surface: #f8fafc;
    --surface-2: #f1f5f9;
    --fg: #0f172a;
    --muted: #64748b;
    --border: #e5e9f0;
    --accent: #4f46e5;
    --accent-2: #06b6d4;
    --accent-fg: #ffffff;
    --ring: rgba(79, 70, 229, .35);

    /* shape & depth */
    --radius: 14px;
    --radius-sm: 10px;
    --radius-lg: 22px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
    --shadow: 0 6px 24px -8px rgba(15, 23, 42, .18);
    --shadow-lg: 0 20px 50px -18px rgba(15, 23, 42, .30);

    /* layout */
    --max-width: 1120px;
    --gap: 1.5rem;
    --header-h: 66px;

    --font-sans: "Inter", system-ui, -apple-system, "Hiragino Kaku Gothic ProN",
                 "Hiragino Sans", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
    --grad: linear-gradient(120deg, var(--accent), var(--accent-2));
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0b1020;
        --surface: #111827;
        --surface-2: #151d2e;
        --fg: #e8ebf5;
        --muted: #94a3b8;
        --border: #232c40;
        --accent: #818cf8;
        --accent-2: #22d3ee;
        --ring: rgba(129, 140, 248, .35);
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
        --shadow: 0 8px 28px -10px rgba(0, 0, 0, .55);
        --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .65);
    }
}

/* --- reset-ish --- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    color: var(--fg);
    background: var(--bg);
    font-family: var(--font-sans);
    font-size: 17px;
    line-height: 1.75;
    letter-spacing: .01em;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; }
::selection { background: var(--accent); color: #fff; }

a { color: var(--accent); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--accent-2); }

h1, h2, h3 { line-height: 1.25; letter-spacing: -.02em; font-weight: 700; }

:where(a, button, input, textarea, .nav-toggle):focus-visible {
    outline: 3px solid var(--ring);
    outline-offset: 2px;
    border-radius: 6px;
}

.container {
    width: 100%;
    max-width: var(--max-width);
    margin-inline: auto;
    padding-inline: clamp(1rem, 4vw, 2rem);
}

.screen-reader-text {
    position: absolute; width: 1px; height: 1px;
    overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip-link:focus {
    position: fixed; top: 8px; left: 8px; width: auto; height: auto;
    padding: 8px 12px; background: var(--bg); z-index: 1000; clip: auto;
    box-shadow: var(--shadow);
}

/* =========================================================================
   Header / Nav
   ========================================================================= */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
}
.site-header__inner {
    display: flex; align-items: center; gap: var(--gap);
    min-height: var(--header-h);
}
.site-branding { margin-right: auto; }
.site-title {
    display: inline-block;
    font-weight: 800; font-size: clamp(1rem, 1.6vw, 1.2rem); line-height: 1.15;
    letter-spacing: -.01em;
    color: var(--fg);
    background: var(--grad); -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.site-title:hover { opacity: .9; }
.custom-logo { display: block; height: 36px; width: auto; }

/* アイコン＋社名（3行）併記 */
.site-brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; }
.site-brand__icon {
    box-sizing: border-box; width: 42px; height: 42px; display: block; flex: none;
    background: #fff; border-radius: 10px; padding: 4px; box-shadow: var(--shadow-sm);
}
.site-brand__name {
    display: flex; flex-direction: column; line-height: 1.02;
    font-weight: 800; font-size: .92rem; letter-spacing: .01em; color: var(--fg);
}
.site-brand:hover .site-brand__name { color: var(--accent); }
@media (max-width: 420px) {
    .site-brand__name { font-size: .82rem; }
    .site-brand__icon { width: 38px; height: 38px; }
}

.site-nav__menu {
    list-style: none; display: flex; flex-wrap: wrap; align-items: center;
    gap: .35rem; margin: 0; padding: 0;
}
.site-nav__menu a {
    display: inline-block; padding: .5rem .8rem; border-radius: 999px;
    color: var(--fg); font-size: .95rem; font-weight: 600;
    transition: background .15s ease, color .15s ease;
}
.site-nav__menu a:hover { background: var(--surface-2); color: var(--accent); }
.site-nav__menu .current-menu-item > a,
.site-nav__menu .current_page_item > a { color: var(--accent); background: var(--surface-2); }

/* mobile toggle */
.nav-toggle {
    display: none;
    width: 42px; height: 42px; padding: 0; border: 0; cursor: pointer;
    background: transparent; border-radius: 10px;
    flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.nav-toggle span {
    display: block; width: 22px; height: 2px; border-radius: 2px;
    background: var(--fg); transition: transform .25s ease, opacity .2s ease;
}
.site-header.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.site-header.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.site-header.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 820px) {
    .nav-toggle { display: inline-flex; }
    .site-nav {
        position: absolute; left: 0; right: 0; top: var(--header-h);
        background: var(--bg); border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow);
        max-height: 0; overflow: hidden; transition: max-height .3s ease;
    }
    .site-header.nav-open .site-nav { max-height: 75vh; }
    .site-nav__menu { flex-direction: column; align-items: stretch; padding: .75rem; gap: .15rem; }
    .site-nav__menu a { padding: .7rem 1rem; border-radius: var(--radius-sm); }
}

.site-main { min-height: 60vh; }

/* HOME のマウス追従背景（canvas）。最背面に固定し、本文は前面に。 */
.hero-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.site-main, .site-footer { position: relative; z-index: 1; }

/* =========================================================================
   Hero / Sections (front page)
   ========================================================================= */
.hero {
    position: relative; padding-block: clamp(3rem, 8vw, 6rem) clamp(2rem, 4vw, 3rem);
    overflow: hidden;
}
.hero::before {
    content: ""; position: absolute; inset: -40% 0 auto -10%;
    height: 480px; z-index: -1; filter: blur(60px); opacity: .22;
    background: radial-gradient(60% 60% at 30% 30%, var(--accent), transparent 70%),
                radial-gradient(50% 50% at 80% 20%, var(--accent-2), transparent 70%);
}
.hero__mark {
    box-sizing: border-box; display: block; width: 92px; height: 92px;
    background: #fff; border-radius: 20px; padding: 11px;
    box-shadow: var(--shadow); margin-bottom: 1.25rem;
}
.hero__title {
    font-size: clamp(2.2rem, 6vw, 3.6rem); margin: 0 0 1rem; font-weight: 800;
    background: var(--grad); -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero__lead { color: var(--muted); font-size: clamp(1.05rem, 2.5vw, 1.3rem); margin: 0; max-width: 46ch; }

.section-title {
    font-size: clamp(1.4rem, 3vw, 1.9rem); margin-block: 2.5rem 1.25rem;
    display: inline-flex; align-items: center; gap: .6rem;
}
.section-title::before {
    content: ""; width: 26px; height: 4px; border-radius: 4px; background: var(--grad);
}

.about__body { color: var(--fg); }

/* SNS grid */
.social__grid {
    display: grid; gap: var(--gap);
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    margin-bottom: 3rem;
}
.social__col {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.1rem;
}
.social__col h3 { margin: 0 0 .75rem; font-size: 1.05rem; }
.social__placeholder {
    color: var(--muted); font-size: .9rem;
    border: 1px dashed var(--border); border-radius: var(--radius-sm);
    padding: 1rem; margin: 0;
}
.social__col .twitter-timeline,
.social__col .fb-page, .social__col .fb-page span,
.social__col iframe { max-width: 100% !important; }

/* =========================================================================
   Buttons & cards (shared)
   ========================================================================= */
.button {
    display: inline-flex; align-items: center; gap: .5rem;
    margin-top: 1rem; padding: .7rem 1.4rem; border-radius: 999px;
    background: var(--grad); color: #fff !important; font-weight: 700;
    box-shadow: var(--shadow-sm); transition: transform .15s ease, box-shadow .2s ease, opacity .2s ease;
}
.button:hover { transform: translateY(-2px); box-shadow: var(--shadow); opacity: .96; }

.cards {
    display: grid; gap: var(--gap);
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    margin-block: 1.5rem;
}
.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.4rem;
    transition: transform .18s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: transparent; }
.card h2 { margin-top: 0; font-size: 1.15rem; }

/* =========================================================================
   Blog (list / card / single)
   ========================================================================= */
.post-list { padding-block: 2rem 3rem; }
.post-list__title { font-size: clamp(1.6rem, 4vw, 2.2rem); }
.post-list__grid {
    display: grid; gap: var(--gap);
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    margin-block: 1.5rem 2.5rem;
}
.post-card {
    display: flex; flex-direction: column;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    transition: transform .18s ease, box-shadow .2s ease;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.post-card__thumb { display: block; aspect-ratio: 16/9; overflow: hidden; }
.post-card__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.post-card:hover .post-card__thumb img { transform: scale(1.05); }
.post-card__title { font-size: 1.12rem; margin: .9rem 1.1rem .25rem; }
.post-card__title a { color: var(--fg); }
.post-card__title a:hover { color: var(--accent); }
.post-card__meta { color: var(--muted); font-size: .82rem; margin: 0 1.1rem; }
.post-card__excerpt { padding: .5rem 1.1rem 1.2rem; color: var(--muted); font-size: .95rem; }

/* ※ .page / .post-single は WordPress の body_class とも一致するため、
   本文記事だけに効くよう .container 付きに限定する（body 全体に max-width が
   かからないように）。 */
.coming-soon {
    text-align: center; padding: clamp(3rem, 10vw, 6rem) 1rem;
    border: 1px dashed var(--border); border-radius: var(--radius);
    background: var(--surface); margin-block: 1.5rem 3rem;
}
.coming-soon__title {
    font-size: clamp(1.5rem, 5vw, 2.2rem); font-weight: 800; margin: 0 0 .5rem;
    background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.coming-soon__note { color: var(--muted); margin: 0; }

/* --- Beyond the Pixel 免責事項（展開表示） --- */
.disclaimer {
    margin-block: 2rem 3rem;
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface); overflow: hidden;
}
.disclaimer__summary {
    cursor: pointer; list-style: none;
    padding: 1rem 1.25rem; font-weight: 700; color: var(--fg);
    display: flex; align-items: center; gap: .6rem;
    transition: background .15s ease;
}
.disclaimer__summary::-webkit-details-marker { display: none; }
.disclaimer__summary::before {
    content: "＋"; color: var(--accent); font-weight: 800; line-height: 1;
    transition: transform .2s ease;
}
.disclaimer[open] .disclaimer__summary::before { content: "－"; }
.disclaimer__summary:hover { background: var(--surface-2); }
.disclaimer__summary:focus-visible { outline: 3px solid var(--ring); outline-offset: -3px; }
.disclaimer__body {
    padding: .5rem 1.25rem 1.5rem; border-top: 1px solid var(--border);
    color: var(--fg); font-size: .95rem; line-height: 1.85;
}
.disclaimer__heading { font-size: 1.15rem; margin: 1rem 0 .5rem; }
.disclaimer__body h3 { font-size: 1rem; margin: 1.4rem 0 .4rem; color: var(--accent); }
.disclaimer__body p { margin: .5rem 0; }
.disclaimer__list { margin: .5rem 0; padding-left: 1.2rem; }
.disclaimer__list li { margin-bottom: .5rem; }

.post-single.container, .page.container { padding-block: 2.5rem 3.5rem; max-width: 800px; }
.post-single__title, .page__title { font-size: clamp(1.8rem, 4.5vw, 2.6rem); margin-bottom: .4rem; }
.post-single__meta { color: var(--muted); }
.post-single__thumb img { width: 100%; border-radius: var(--radius); margin-block: 1.25rem; }
.post-single__content, .page__content { font-size: 1.05rem; }
.post-single__content > p, .page__content > p { margin-block: 1rem; }
.post-tags { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin-top: 1.5rem; }
.post-tags li a {
    font-size: .8rem; padding: .25rem .7rem; border-radius: 999px;
    background: var(--surface-2); color: var(--muted);
}

/* pages content */
.page__content .lead { font-size: 1.15rem; color: var(--muted); margin-bottom: 1.5rem; }
.page__content h2 { margin-block: 2.25rem .5rem; font-size: 1.4rem; }
.page__content ul { padding-left: 1.25rem; }
.page__content li { margin-block: .35rem; }

.info-table { width: 100%; border-collapse: collapse; margin-block: 1rem; }
.info-table th, .info-table td {
    text-align: left; vertical-align: top; padding: .7rem .85rem;
    border-bottom: 1px solid var(--border);
}
.info-table th { width: 8rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
.policy-date { margin-top: 2rem; color: var(--muted); font-size: .9rem; }
.info-table .note { margin: .5rem 0 0; color: var(--muted); font-size: .82rem; line-height: 1.6; }

/* Contact Form 7 */
.wpcf7-form p { margin-block: .9rem; }
.wpcf7-form label { display: block; font-weight: 600; }
.wpcf7-form input[type="text"], .wpcf7-form input[type="email"],
.wpcf7-form input[type="tel"], .wpcf7-form input[type="url"],
.wpcf7-form textarea, .wpcf7-form select {
    width: 100%; padding: .6rem .7rem; margin-top: .35rem;
    border: 1px solid var(--border); border-radius: 10px;
    background: var(--surface); color: var(--fg); font: inherit;
}
.wpcf7-form input:focus-visible, .wpcf7-form textarea:focus-visible { outline: 3px solid var(--ring); outline-offset: 1px; }
.wpcf7-submit {
    border: 0; border-radius: 999px; background: var(--grad); color: #fff;
    font-weight: 700; padding: .7rem 1.6rem; cursor: pointer; box-shadow: var(--shadow-sm);
}
.wpcf7-submit:hover { opacity: .95; }

/* pagination */
.pagination .nav-links, .navigation .nav-links {
    display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; margin-top: 1.5rem;
}
.pagination a, .pagination span, .navigation a, .navigation span {
    display: inline-flex; min-width: 42px; height: 42px; align-items: center; justify-content: center;
    padding: 0 .6rem; border-radius: 10px; border: 1px solid var(--border);
    color: var(--fg); font-weight: 600;
}
.pagination .current { background: var(--grad); color: #fff; border-color: transparent; }
.pagination a:hover { border-color: var(--accent); color: var(--accent); }

/* =========================================================================
   Footer
   ========================================================================= */
.site-footer { border-top: 1px solid var(--border); margin-top: 4rem; background: var(--surface); }
.site-footer__inner { padding-block: 2.5rem; }
.footer-brand { display: flex; align-items: center; gap: .6rem; margin-bottom: 1.25rem; }
.footer-brand__icon {
    box-sizing: border-box; width: 40px; height: 40px; flex: none;
    background: #fff; border-radius: 9px; padding: 4px; box-shadow: var(--shadow-sm);
}
.footer-brand__name { font-weight: 800; color: var(--fg); }
.footer-nav__menu {
    list-style: none; display: flex; flex-wrap: wrap; gap: 1.1rem; padding: 0; margin: 0 0 1rem;
}
.footer-nav__menu a { font-size: .9rem; color: var(--muted); }
.footer-nav__menu a:hover { color: var(--accent); }
.site-footer__copy { color: var(--muted); font-size: .85rem; margin: 0; }

/* =========================================================================
   AI widget
   ========================================================================= */
.vai { position: fixed; right: 20px; bottom: 20px; z-index: 9999; }
.vai__toggle {
    border: 0; cursor: pointer; border-radius: 999px;
    background: var(--grad); color: #fff; font-weight: 700;
    padding: .75rem 1.2rem; font-size: .95rem; box-shadow: var(--shadow);
    transition: transform .15s ease, box-shadow .2s ease;
}
.vai__toggle:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.vai__panel {
    position: absolute; right: 0; bottom: 60px;
    width: min(370px, calc(100vw - 40px));
    height: min(540px, calc(100vh - 120px));
    display: flex; flex-direction: column;
    background: var(--bg); color: var(--fg);
    border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden;
    box-shadow: var(--shadow-lg);
}
.vai__panel[hidden] { display: none; }
.vai__header {
    display: flex; align-items: center; justify-content: space-between;
    padding: .85rem 1.1rem; font-weight: 700;
    background: var(--grad); color: #fff;
}
.vai__close { border: 0; background: transparent; font-size: 1.5rem; line-height: 1; cursor: pointer; color: #fff; }
.vai__log { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .6rem; }
.vai__msg {
    max-width: 86%; padding: .6rem .85rem; border-radius: 14px;
    font-size: .93rem; white-space: pre-wrap; word-break: break-word;
}
.vai__msg--user { align-self: flex-end; background: var(--grad); color: #fff; border-bottom-right-radius: 4px; }
.vai__msg--bot { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 4px; }
.vai__msg--error { background: rgba(220, 38, 38, .14); color: #dc2626; }
.vai__form { display: flex; gap: .5rem; padding: .75rem; border-top: 1px solid var(--border); }
.vai__input {
    flex: 1; resize: none; border: 1px solid var(--border); border-radius: 10px;
    padding: .55rem .7rem; font: inherit; background: var(--surface); color: var(--fg);
}
.vai__input:focus-visible { outline: 3px solid var(--ring); outline-offset: 1px; }
.vai__send { border: 0; border-radius: 10px; background: var(--grad); color: #fff; padding: 0 1.1rem; cursor: pointer; font-weight: 700; }
.vai__send:disabled { opacity: .6; cursor: default; }

@media (prefers-reduced-motion: reduce) {
    * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
