/* ==========================================================================
   AinaviCE 2026 theme — shared styles
   Layout of each section lives inline in the templates (ported 1:1 from the
   approved wireframes). This file holds base styles, components that need
   states (hover / focus / open), and every animation.
   ========================================================================== */

:root {
	--navy: #1A1F4B;
	--navy-deep: #12163A;
	--indigo: #3F4265;
	--text: #2B2D42;
	--muted: #5B5E78;
	--cream: #FBF8F2;
	--cream-deep: #F5EFE3;
	--line: #ECE6DA;
	--line-strong: #D9D2C3;
	--orange: #F08200;
	--orange-text: #C26A00;
	--yellow: #FDD000;
	--grad: linear-gradient(135deg, #FDD000, #F08200);
	--font-ja: 'Noto Sans JP', system-ui, -apple-system, 'Hiragino Sans', sans-serif;
	--font-en: 'Jost', 'Noto Sans JP', sans-serif;
	--content: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	font-family: var(--font-ja);
	color: var(--text);
	background: var(--cream);
	line-height: 1.8;
	-webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--indigo); }
a:hover { color: var(--navy); }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip-link:focus {
	position: fixed; top: 8px; left: 8px; z-index: 1000; width: auto; height: auto; clip: auto;
	padding: 10px 16px; background: #fff; color: var(--navy); border-radius: 8px;
}

/* Japanese line-break helper: keep a phrase together */
.ph { display: inline-block; }

/* ---------------------------------------------------------------- Header */
.site-header {
	position: sticky; top: 0; z-index: 100;
	background: rgba(251, 248, 242, .92);
	backdrop-filter: saturate(140%) blur(10px);
	-webkit-backdrop-filter: saturate(140%) blur(10px);
	border-bottom: 1px solid var(--line);
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
.site-header__inner {
	max-width: var(--content); margin: 0 auto; padding: 14px 24px;
	display: flex; align-items: center; gap: 12px 36px;
}
.site-header__logo img { height: 28px; width: auto; display: block; }
.gnav { flex: 1 1 auto; }
.gnav__list { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 28px; margin: 0; padding: 0; list-style: none; font-size: 14px; font-weight: 700; }
.gnav__list a, .gnav__toggle {
	color: var(--navy); text-decoration: none; background: none; border: 0; padding: 6px 0;
	font: inherit; line-height: 1.5; cursor: pointer;
	display: inline-flex; align-items: center; gap: 6px; vertical-align: middle;
}
.gnav__caret { font-size: 10px; line-height: 1; }
.gnav__list a:hover, .gnav__toggle:hover, .gnav__list a[aria-current="page"] {
	text-decoration: underline; text-decoration-color: var(--orange); text-underline-offset: 6px; text-decoration-thickness: 2px;
}
.gnav__item--has-sub { position: relative; }
.gnav__sub {
	position: absolute; top: 100%; left: -16px; min-width: 240px; margin: 8px 0 0; padding: 8px; list-style: none;
	background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 44px rgba(26,31,75,.12);
	opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.gnav__sub::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }
.gnav__item--has-sub:hover .gnav__sub,
.gnav__item--has-sub:focus-within .gnav__sub,
.gnav__item--has-sub.is-open .gnav__sub { opacity: 1; visibility: visible; transform: none; }
.gnav__sub a { display: block; padding: 10px 14px; border-radius: 10px; font-weight: 700; }
.gnav__sub a:hover { background: var(--cream); text-decoration: none; }
.gnav__sub small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.site-header__cta { display: flex; gap: 10px; }
.btn {
	display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px;
	border-radius: 999px; font-size: 14px; font-weight: 700; text-decoration: none; border: 1px solid transparent;
	font-family: inherit; cursor: pointer;
}
.btn--navy { background: var(--navy); color: #fff; }
.btn--navy:hover { color: #fff; }
.btn--grad { background: var(--grad); color: var(--navy); font-weight: 900; }
.btn--grad:hover { color: var(--navy); }
.btn--line { border-color: var(--navy); color: var(--navy); background: transparent; }

.menu-toggle {
	display: none; margin-left: auto; width: 44px; height: 44px; align-items: center; justify-content: center;
	border: 1px solid var(--navy); background: transparent; border-radius: 999px; color: var(--navy); cursor: pointer;
}
.menu-toggle span, .menu-toggle span::before, .menu-toggle span::after {
	display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; position: relative; transition: transform .25s ease, background .25s ease;
}
.menu-toggle span::before, .menu-toggle span::after { content: ""; position: absolute; left: 0; }
.menu-toggle span::before { top: -6px; }
.menu-toggle span::after { top: 6px; }
.menu-open .menu-toggle span { background: transparent; }
.menu-open .menu-toggle span::before { transform: translateY(6px) rotate(45deg); }
.menu-open .menu-toggle span::after { transform: translateY(-6px) rotate(-45deg); }

.drawer {
	display: none; position: fixed; inset: 0; z-index: 99; background: var(--cream);
	padding: 96px 24px 40px; overflow-y: auto;
}
.menu-open .drawer { display: block; }
.drawer ul { list-style: none; margin: 0; padding: 0; }
.drawer li { border-bottom: 1px solid var(--line); }
.drawer a { display: block; padding: 18px 4px; font-size: 18px; font-weight: 700; color: var(--navy); text-decoration: none; }
.drawer .drawer__sub a { padding-left: 20px; font-size: 16px; font-weight: 500; }
.drawer .btn { display: flex; width: 100%; margin-top: 28px; min-height: 52px; font-size: 16px; }
@media (max-width: 860px) {
	.gnav, .site-header__cta { display: none; }
	.menu-toggle { display: inline-flex; }
}
body.menu-open { overflow: hidden; }

/* ---------------------------------------------------------------- Hover */
.hover-card { transition: transform .3s cubic-bezier(.2,.7,.2,1), box-shadow .3s ease, border-color .3s ease; will-change: transform; }
.hover-card:hover { transform: translateY(-6px); box-shadow: 0 18px 44px rgba(26,31,75,.14); border-color: #F4B160 !important; }
.hover-card .thumb { transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.hover-card:hover .thumb { transform: scale(1.06); }
.hover-card .arrow { display: inline-block; transition: transform .3s ease; }
.hover-card:hover .arrow { transform: translateX(6px); }
.hover-btn { transition: transform .2s ease, box-shadow .2s ease, filter .2s ease; }
.hover-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(240,130,0,.25); filter: brightness(1.04); }

/* ---------------------------------------------------------------- Hero */
.hero { min-height: calc(100vh - 64px); display: flex; align-items: center; }
.hero > div { width: 100%; }
.ptc-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.line { display: block; overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; }
.line-in { display: inline-block; animation: lineUp 1.1s cubic-bezier(.2,.7,.2,1) both; }
@keyframes lineUp { from { transform: translateY(105%); } to { transform: translateY(0); } }
.fade-up { animation: fadeUpIn 1s cubic-bezier(.2,.7,.2,1) both; }
@keyframes fadeUpIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

/* Orb (SPACE for creation) */
.orb-fog { animation: mistClear 2.1s cubic-bezier(.2,.7,.2,1) both; }
.orb-ring { animation: orbDrift 24s linear infinite; }
.orb-hole { animation: holeOpen 2.1s cubic-bezier(.2,.7,.2,1) both, holeBreathe 9s ease-in-out 2.1s infinite; }
@keyframes mistClear { 0% { filter: blur(36px); opacity: 0; transform: scale(.3); } 20% { opacity: 1; } 100% { filter: blur(0); opacity: 1; transform: scale(1); } }
@keyframes holeOpen { 0% { transform: scale(.05); } 100% { transform: scale(1); } }
@keyframes holeBreathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(.88); } }
@keyframes orbDrift { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* Mission (scroll-triggered by main.js) */
.mission { transition: background-color 1.2s ease; }
.mission.armed { background-color: #FFFFFF !important; }
.mission.armed.is-in { background-color: #FFFCF5 !important; }
.mission.armed .mission-glow { opacity: 0; transform: translate(-50%,-50%) scale(.6); transition: opacity 1.6s ease .2s, transform 1.8s cubic-bezier(.2,.7,.2,1) .2s; }
.mission.armed.is-in .mission-glow { opacity: .55; transform: translate(-50%,-50%) scale(1); }
.mission.armed .mission-h { opacity: .25; filter: blur(6px); transform: scale(.96); transition: opacity 1s ease, filter 1s ease, transform 1.2s cubic-bezier(.2,.7,.2,1); }
.mission.armed.is-in .mission-h { opacity: 1; filter: blur(0); transform: scale(1.04); }
.mission.armed .mission-p { opacity: 0; transform: translateY(14px); transition: opacity .9s ease .5s, transform .9s ease .5s; }
.mission.armed.is-in .mission-p { opacity: 1; transform: translateY(0); }

/* Two businesses loop */
.loop-spin { animation: loopSpin 6s linear infinite; }
@keyframes loopSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.pulse-a { animation: pulseLeft 6s linear infinite; }
.pulse-b { animation: pulseRight 6s linear infinite; }
@keyframes pulseLeft { 0%, 12%, 40%, 100% { box-shadow: 0 0 0 0 rgba(240,130,0,0); } 25% { box-shadow: 0 0 0 2px #F4B160, 0 14px 36px rgba(240,130,0,.20); } }
@keyframes pulseRight { 0%, 62%, 90%, 100% { box-shadow: 0 0 0 0 rgba(240,130,0,0); } 75% { box-shadow: 0 0 0 2px #F4B160, 0 14px 36px rgba(240,130,0,.20); } }
.arr-sp { display: none; }
@media (max-width: 860px) { .loop-mid { width: 100%; } .arr-pc { display: none; } .arr-sp { display: inline; } }

/* Dasuru diagram */
.chip { animation: chipLit 4s ease-in-out infinite; }
.chip-2 { animation-delay: .25s; } .chip-3 { animation-delay: .5s; } .chip-4 { animation-delay: .75s; }
@keyframes chipLit { 0%, 30%, 60%, 100% { border-color: #D9D2C3; color: #3F4265; background: #FFFFFF; } 40%, 50% { border-color: #F4B160; color: #1A1F4B; background: #FFF3D6; } }
.engine { animation: engineShine 4s linear infinite; }
@keyframes engineShine { from { background-position: 100% 0; } to { background-position: -150% 0; } }
.flow-up { animation: flowUp 2s ease-in infinite; }
.flow-down { animation: flowDown 2s ease-in infinite; }
@keyframes flowUp { 0% { top: 40px; opacity: 0; } 20% { opacity: 1; } 100% { top: -6px; opacity: 0; } }
@keyframes flowDown { 0% { top: -6px; opacity: 0; } 20% { opacity: 1; } 100% { top: 40px; opacity: 0; } }
.platform { animation: platformGrow 4s ease-in-out infinite; }
@keyframes platformGrow { 0%, 100% { border-color: #B9B2A3; } 50% { border-color: #F08200; } }

/* 5-step pipeline */
.progress { animation: progressRun 10s linear infinite; }
@keyframes progressRun { 0% { transform: scaleX(0); } 95% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }
.step { animation: stepLit 10s linear infinite; }
.step-2 { animation-delay: 2s; } .step-3 { animation-delay: 4s; } .step-4 { animation-delay: 6s; } .step-5 { animation-delay: 8s; }
@keyframes stepLit { 0% { box-shadow: 0 0 0 0 rgba(240,130,0,0); transform: translateY(0); } 5%, 15% { box-shadow: 0 0 0 2px #F4B160, 0 14px 30px rgba(240,130,0,.18); transform: translateY(-4px); } 22%, 100% { box-shadow: 0 0 0 0 rgba(240,130,0,0); transform: translateY(0); } }

/* FRONT / BACK */
.dot-l { animation: dotLeft 2.6s ease-in-out infinite; }
.dot-r { animation: dotRight 2.6s ease-in-out 1.3s infinite; }
@keyframes dotLeft { 0% { left: calc(100% - 10px); opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { left: 0; opacity: 0; } }
@keyframes dotRight { 0% { left: 0; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { left: calc(100% - 10px); opacity: 0; } }
.ai-item { animation: aiTick 6s ease-in-out infinite; }
@keyframes aiTick { 0%, 30%, 100% { background: transparent; color: #E3E4F0; } 8%, 22% { background: rgba(251,227,110,.14); color: #FFFFFF; } }
@media (max-width: 860px) { .fb-mid { flex-basis: 100% !important; } }

/* Comparison table (scroll-triggered by main.js) */
.reveal-sec.armed .cmp-ai { background: #FFFFFF !important; transition: background-color .6s ease var(--d); }
.reveal-sec.armed.is-in .cmp-ai { background: #FFF6DC !important; }
.reveal-sec.armed .cmp-txt { opacity: 0; transform: translateX(-18px); transition: opacity .6s ease calc(var(--d) + .1s), transform .7s cubic-bezier(.2,.7,.2,1) calc(var(--d) + .1s); }
.reveal-sec.armed.is-in .cmp-txt { opacity: 1; transform: translateX(0); }
.reveal-sec.armed .cmp-check { transform: scale(0); transition: transform .5s cubic-bezier(.3,1.6,.5,1) calc(var(--d) + .35s); }
.reveal-sec.armed.is-in .cmp-check { transform: scale(1); }

/* ---------------------------------------------------------------- Forms */
.form { display: grid; gap: 20px; }
.form__row { display: grid; gap: 8px; }
.form__label { font-size: 14px; font-weight: 700; color: var(--navy); }
.form__req, .form__opt {
	display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; vertical-align: 2px;
}
.form__req { background: var(--grad); color: var(--navy); }
.form__opt { background: var(--line); color: var(--muted); }
.form input[type="text"], .form input[type="email"], .form input[type="tel"], .form textarea {
	width: 100%; min-height: 50px; padding: 12px 16px; border: 1px solid var(--line-strong); border-radius: 12px;
	background: #fff; color: var(--navy); font: inherit; font-size: 16px;
}
.form textarea { min-height: 180px; resize: vertical; }
.form input:focus, .form textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(240,130,0,.15); }
.form__checks { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; border: 0; }
.form__checks label {
	display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px; border: 1px solid var(--line-strong);
	border-radius: 999px; background: #fff; font-size: 14px; cursor: pointer;
}
.form__checks input { accent-color: var(--orange); width: 16px; height: 16px; }
.form__note { font-size: 13px; color: var(--muted); }
.form__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.notice {
	max-width: var(--content); margin: 24px auto 0; padding: 16px 20px; border-radius: 12px; font-size: 15px; font-weight: 700;
}
.notice--ok { background: #FFF6DC; border: 1px solid #F4B160; color: var(--navy); }
.notice--ng { background: #FDECEC; border: 1px solid #E6A1A1; color: #7A1F1F; }

/* ---------------------------------------------------------------- Blog */
.entry-content { font-size: 16px; line-height: 1.95; color: var(--text); }
.entry-content > * { margin-top: 0; margin-bottom: 1.4em; }
.entry-content h2 {
	margin: 2.4em 0 1em; padding-bottom: 12px; border-bottom: 2px solid var(--navy);
	font-size: clamp(22px, 3vw, 26px); line-height: 1.5; font-weight: 900; color: var(--navy); scroll-margin-top: 96px;
}
.entry-content h3 { margin: 2em 0 .8em; font-size: 20px; font-weight: 900; color: var(--navy); scroll-margin-top: 96px; }
.entry-content h4 { font-size: 17px; font-weight: 700; color: var(--navy); }
.entry-content a { color: var(--orange-text); text-underline-offset: 3px; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; }
.entry-content li + li { margin-top: .4em; }
.entry-content blockquote { margin-left: 0; padding: 16px 20px; border-left: 3px solid #F4B160; background: #FFF8E6; border-radius: 0 12px 12px 0; }
.entry-content table { width: 100%; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; }
.entry-content th, .entry-content td { padding: 12px 14px; border: 1px solid var(--line); text-align: left; }
.entry-content th { background: var(--cream); }
.entry-content img { border-radius: 12px; }
.entry-content figure { margin-left: 0; margin-right: 0; }
.entry-content figcaption { font-size: 13px; color: var(--muted); text-align: center; }
.cat-pill {
	display: inline-flex; align-items: center; min-height: 36px; padding: 4px 14px; border: 1px solid var(--line-strong); border-radius: 999px;
	font-family: var(--font-en); font-size: 13px; color: var(--text); text-decoration: none; background: #fff;
}
.cat-pill:hover, .cat-pill.is-current { border-color: var(--orange); color: var(--navy); background: #FFF3D6; }
.pagination { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 48px; }
.pagination .page-numbers {
	display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 12px;
	border: 1px solid var(--line-strong); border-radius: 999px; text-decoration: none; color: var(--navy); font-family: var(--font-en); background: #fff;
}
.pagination .current { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ---------------------------------------------------------------- Motion safety */
@media (prefers-reduced-motion: reduce) {
	.line-in, .fade-up, .orb-fog, .orb-ring, .orb-hole, .loop-spin, .pulse-a, .pulse-b, .chip, .engine, .flow-up, .flow-down,
	.platform, .progress, .step, .dot-l, .dot-r, .ai-item { animation: none !important; }
	.mission-glow, .mission-h, .mission-p, .cmp-ai, .cmp-txt, .cmp-check, .hover-card, .hover-card .thumb, .hover-btn { transition: none !important; }
	html { scroll-behavior: auto; }
}

/* Buttons placed inside post content keep their own colors */
.entry-content .btn, .entry-content .btn:hover { color: var(--navy); text-decoration: none; }
