/* 経理RPA ポータル(www.keirirpa.net)
 * 配色はロゴの 3 色(紺 #1b2f7a・空 #0ea5e9・橙 #f59e0b)を基調に、紙のような暖かい白を地にする。
 * CSP(style-src 'self')のため、HTML の style 属性は使わない。JS からは CSSOM(setProperty)だけで値を渡す。
 */
:root {
  --bg: #f6f4ef;
  --bg-2: #efece4;
  --ink: #0f172a;
  --ink-2: #334155;
  --ink-3: #64748b;
  --line: rgba(15, 23, 42, 0.08);
  --line-2: rgba(15, 23, 42, 0.14);
  --card: rgba(255, 255, 255, 0.72);
  --card-solid: #ffffff;
  --navy: #1b2f7a;
  --sky: #0ea5e9;
  --amber: #f59e0b;
  --accent: #1d4ed8;
  --ring: #2563eb;
  --shadow-1: 0 1px 2px rgba(15, 23, 42, 0.04), 0 2px 8px rgba(15, 23, 42, 0.04);
  --shadow-2: 0 2px 4px rgba(15, 23, 42, 0.04), 0 18px 40px -12px rgba(27, 47, 122, 0.22);
  --radius: 22px;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  --font: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", Meiryo, system-ui, sans-serif;
  --font-latin: "Inter", "Segoe UI Variable Display", "Segoe UI", "SF Pro Display", system-ui, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", "Cascadia Code", Consolas, ui-monospace, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1020;
    --bg-2: #0f1529;
    --ink: #e8ecf5;
    --ink-2: #b9c2d6;
    --ink-3: #8390ab;
    --line: rgba(232, 236, 245, 0.08);
    --line-2: rgba(232, 236, 245, 0.16);
    --card: rgba(20, 27, 50, 0.66);
    --card-solid: #141b32;
    --accent: #7aa7ff;
    --ring: #7aa7ff;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-2: 0 24px 48px -16px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(122, 167, 255, 0.12);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: 0.01em;
  font-feature-settings: "palt" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.skip {
  position: absolute; left: 16px; top: 16px; z-index: 50;
  padding: 10px 16px; border-radius: 12px;
  background: var(--card-solid); color: var(--ink); text-decoration: none;
  transform: translateY(-200%); opacity: 0; transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}
.skip:focus { transform: none; opacity: 1; box-shadow: var(--shadow-2); outline: 2px solid var(--ring); outline-offset: 2px; }

/* ---------- 背景の光(ロゴの 3 色) ---------- */
.aura { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.aura__blob {
  position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.55;
  animation: drift 26s var(--ease) infinite alternate;
}
.aura__blob--navy  { width: 46vmax; height: 46vmax; left: -14vmax; top: -18vmax; background: radial-gradient(circle at 40% 40%, #3b5bdb, transparent 62%); }
.aura__blob--sky   { width: 38vmax; height: 38vmax; right: -12vmax; top: 6vmax; background: radial-gradient(circle at 50% 50%, #38bdf8, transparent 62%); animation-duration: 32s; }
.aura__blob--amber { width: 34vmax; height: 34vmax; left: 28vmax; top: 52vmax; background: radial-gradient(circle at 50% 50%, #fbbf24, transparent 60%); opacity: 0.38; animation-duration: 38s; }
.aura__grain {
  position: absolute; inset: -50%;
  background-image: radial-gradient(rgba(15, 23, 42, 0.05) 1px, transparent 1px);
  background-size: 3px 3px; opacity: 0.35; mix-blend-mode: multiply;
}
@media (prefers-color-scheme: dark) {
  .aura__blob { opacity: 0.32; }
  .aura__blob--amber { opacity: 0.18; }
  .aura__grain { background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px); mix-blend-mode: screen; }
}
@keyframes drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(3vmax, 2vmax, 0) scale(1.06); }
  100% { transform: translate3d(-2vmax, 4vmax, 0) scale(0.97); }
}

/* ---------- ヘッダー ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  border-bottom: 1px solid var(--line);
}
.top__inner {
  max-width: 1200px; margin: 0 auto; padding: 12px max(16px, env(safe-area-inset-left));
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; border-radius: 10px; }
.brand:focus-visible { outline: 2px solid var(--ring); outline-offset: 4px; }
.brand__mark { width: 28px; height: 28px; }
.brand__name { font-family: var(--font-latin); font-weight: 650; letter-spacing: -0.01em; font-size: 15px; }
.top__meta {
  margin: 0; display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--ink-3);
  padding: 5px 12px; border: 1px solid var(--line-2); border-radius: 999px;
  background: color-mix(in srgb, var(--card-solid) 60%, transparent);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18); }

/* ---------- ヒーロー ---------- */
main { max-width: 1200px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-left)); }
.hero { padding: clamp(48px, 9vw, 112px) 0 clamp(40px, 6vw, 72px); text-align: center; }
.hero__logo {
  display: inline-block; margin: 0 auto 28px;
  padding: clamp(14px, 2.4vw, 22px) clamp(20px, 3.6vw, 36px);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 30px 60px -30px rgba(27, 47, 122, 0.35);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  animation: rise 0.9s var(--ease) both;
}
.hero__logo img { width: min(480px, 74vw); height: auto; }
@media (prefers-color-scheme: dark) {
  /* ロゴの紺の文字が暗い地に沈まないよう、ロゴは明るい板の上に置く */
  .hero__logo { background: rgba(246, 244, 239, 0.94); border-color: rgba(255, 255, 255, 0.9); box-shadow: 0 30px 80px -30px rgba(56, 189, 248, 0.35); }
}
.eyebrow {
  margin: 0 0 14px; font-family: var(--font-latin); font-size: 12.5px; font-weight: 600;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-3);
  animation: rise 0.9s 0.08s var(--ease) both;
}
.hero__title {
  margin: 0; font-weight: 800; letter-spacing: -0.02em;
  font-size: clamp(34px, 6.2vw, 68px); line-height: 1.18;
  animation: rise 0.9s 0.14s var(--ease) both;
}
.hero__line { display: inline-block; }
.hero__line--accent {
  background: linear-gradient(100deg, var(--navy) 0%, #2563eb 38%, var(--sky) 62%, var(--amber) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
@media (prefers-color-scheme: dark) {
  .hero__line--accent { background-image: linear-gradient(100deg, #93b4ff 0%, #60a5fa 38%, #7dd3fc 62%, #fbbf24 100%); }
}
.hero__lead {
  margin: 22px auto 0; max-width: 40em; color: var(--ink-2);
  font-size: clamp(15px, 1.8vw, 17.5px);
  animation: rise 0.9s 0.2s var(--ease) both;
}
.facts {
  margin: 36px auto 0; display: inline-flex; gap: 0;
  border: 1px solid var(--line-2); border-radius: 18px; overflow: hidden;
  background: var(--card); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-1);
  animation: rise 0.9s 0.26s var(--ease) both;
}
.facts__item { padding: 12px clamp(18px, 3vw, 30px); text-align: center; }
.facts__item + .facts__item { border-left: 1px solid var(--line); }
.facts dt { font-size: 11.5px; color: var(--ink-3); letter-spacing: 0.08em; }
.facts dd { margin: 0; }
.num { font-family: var(--font-latin); font-weight: 700; font-size: 26px; letter-spacing: -0.02em; line-height: 1.25; font-variant-numeric: tabular-nums; }
.num--text { font-size: 18px; letter-spacing: 0.04em; line-height: 1.8; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- 一覧 ---------- */
.apps { padding-bottom: clamp(56px, 8vw, 96px); scroll-margin-top: 72px; }
.apps__head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px 24px; margin-bottom: 22px; }
.apps__title { margin: 0; font-size: 22px; font-weight: 750; letter-spacing: -0.01em; }
.controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.chip {
  border: 0; background: transparent; cursor: pointer;
  padding: 7px 14px; border-radius: 10px; font-size: 13.5px; color: var(--ink-2);
  transition: background 0.2s var(--ease), color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.chip:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.chip.is-active { background: var(--card-solid); color: var(--ink); box-shadow: var(--shadow-1), 0 0 0 1px var(--line-2); font-weight: 600; }
.chip:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

.search {
  position: relative; display: flex; align-items: center;
  height: 42px; min-width: min(260px, 100%); flex: 1 1 220px;
  border-radius: 14px; background: var(--card); border: 1px solid var(--line);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.search:focus-within { border-color: color-mix(in srgb, var(--ring) 60%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ring) 16%, transparent); }
.search__icon { width: 18px; height: 18px; margin-left: 13px; color: var(--ink-3); flex: none; }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; padding: 0 10px; font-size: 14.5px; }
.search input::placeholder { color: var(--ink-3); }
.search input::-webkit-search-cancel-button { cursor: pointer; }
.search__kbd {
  margin-right: 10px; font-family: var(--mono); font-size: 11.5px; color: var(--ink-3);
  border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; padding: 0 6px; line-height: 18px;
}

.groups { display: grid; gap: clamp(36px, 5vw, 56px); }
.group[hidden] { display: none; }
.group__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 24px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.group__title { margin: 0; display: flex; align-items: baseline; gap: 12px; font-size: 18px; font-weight: 750; letter-spacing: 0.01em; }
.group__en { font-family: var(--font-latin); font-size: 11.5px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3); order: 2; }
.group__count { order: 3; font-family: var(--font-latin); font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 0 8px; border-radius: 999px; border: 1px solid var(--line-2); line-height: 20px; }
.group__lead { margin: 0; font-size: 13.5px; color: var(--ink-3); }
.grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
@media (min-width: 1100px) { .grid { grid-template-columns: repeat(4, 1fr); } }
.card { position: relative; animation: rise 0.7s var(--ease) both; }
.card:nth-child(1) { animation-delay: 0.30s; } .card:nth-child(2) { animation-delay: 0.36s; }
.card:nth-child(3) { animation-delay: 0.42s; } .card:nth-child(4) { animation-delay: 0.48s; }
.card[hidden] { display: none; }

.card__link {
  --mx: 50%; --my: 0%;
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; height: 100%;
  padding: 22px 22px 18px; border-radius: var(--radius);
  text-decoration: none; color: inherit;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
  backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease), border-color 0.45s var(--ease);
}
/* グラデーションの縁(ホバーで現れる) */
.card__link::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; z-index: -1;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.55), rgba(14, 165, 233, 0.35) 45%, rgba(245, 158, 11, 0.55));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity 0.45s var(--ease);
}
.card__glow {
  position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx) var(--my), color-mix(in srgb, var(--sky) 16%, transparent), transparent 60%);
  opacity: 0; transition: opacity 0.45s var(--ease);
}
.card__link:hover, .card__link:focus-visible {
  transform: translateY(-4px);
  box-shadow: var(--shadow-2);
  border-color: transparent;
}
.card__link:hover::before, .card__link:focus-visible::before,
.card__link:hover .card__glow, .card__link:focus-visible .card__glow { opacity: 1; }
.card__link:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; }

.card__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.icon {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  background: var(--card-solid);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 0 0 1px var(--line), 0 8px 18px -10px rgba(27, 47, 122, 0.35);
  transition: transform 0.45s var(--ease);
}
.icon svg { width: 26px; height: 26px; }
.card__link:hover .icon { transform: rotate(-4deg) scale(1.06); }
.tag { font-size: 11.5px; letter-spacing: 0.06em; color: var(--ink-3); padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line-2); }
.icon--sales ~ .tag    { color: #1e40af; border-color: rgba(30, 64, 175, 0.22); background: rgba(30, 64, 175, 0.05); }
.icon--hr ~ .tag       { color: #0f766e; border-color: rgba(15, 118, 110, 0.24); background: rgba(15, 118, 110, 0.05); }
.icon--industry ~ .tag { color: #b45309; border-color: rgba(180, 83, 9, 0.24); background: rgba(180, 83, 9, 0.05); }
@media (prefers-color-scheme: dark) {
  .icon { box-shadow: 0 0 0 1px var(--line-2); }
  .icon--sales ~ .tag    { color: #a5b8ff; border-color: rgba(165, 184, 255, 0.28); background: rgba(165, 184, 255, 0.06); }
  .icon--hr ~ .tag       { color: #5eead4; border-color: rgba(94, 234, 212, 0.26); background: rgba(94, 234, 212, 0.06); }
  .icon--industry ~ .tag { color: #fcd34d; border-color: rgba(252, 211, 77, 0.26); background: rgba(252, 211, 77, 0.06); }
}

.card__name { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; font-size: 21px; font-weight: 750; letter-spacing: -0.005em; line-height: 1.35; }
.card__roman { font-family: var(--font-latin); font-size: 13px; font-weight: 500; color: var(--ink-3); letter-spacing: 0.02em; }
.card__kind { margin-top: 2px; font-size: 13px; font-weight: 600; color: var(--accent); }
.card__desc { margin-top: 10px; font-size: 14px; line-height: 1.8; color: var(--ink-2); flex: 1; }
.card__foot { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line-2); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.host { font-family: var(--mono); font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.go {
  flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  color: var(--ink-2); border: 1px solid var(--line-2);
  transition: background 0.35s var(--ease), color 0.35s var(--ease), transform 0.35s var(--ease), border-color 0.35s var(--ease);
}
.go svg { width: 18px; height: 18px; }
.card__link:hover .go, .card__link:focus-visible .go {
  background: linear-gradient(135deg, #1d4ed8, #0ea5e9); color: #fff; border-color: transparent; transform: translateX(2px);
}

.empty { text-align: center; color: var(--ink-3); padding: 48px 0; }

/* ---------- フッター ---------- */
.foot { border-top: 1px solid var(--line); background: color-mix(in srgb, var(--bg-2) 70%, transparent); }
.foot__inner { max-width: 1200px; margin: 0 auto; padding: 28px max(16px, env(safe-area-inset-left)) max(28px, env(safe-area-inset-bottom)); display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; }
.foot__logo { width: 132px; height: auto; }
@media (prefers-color-scheme: dark) { .foot__logo { background: rgba(246, 244, 239, 0.94); border-radius: 10px; padding: 6px 10px; width: 152px; } }
.foot__note { margin: 0; flex: 1 1 280px; font-size: 13px; color: var(--ink-3); }
.foot__copy { margin: 0; font-family: var(--font-latin); font-size: 12.5px; color: var(--ink-3); }

/* ---------- 狭い画面 ---------- */
@media (max-width: 640px) {
  .br-wide { display: none; }
  .hero { text-align: left; }
  .hero__logo { margin-left: 0; }
  .facts { display: flex; width: 100%; }
  .facts__item { flex: 1; padding: 12px 8px; }
  .apps__head { align-items: stretch; }
  .controls { width: 100%; }
  .filters { width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .chip { white-space: nowrap; }
  .search { flex-basis: 100%; }
  .search__kbd { display: none; }
  .card__link { padding: 20px 18px 16px; }
}

/* ---------- 動きを減らす設定 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .card__link:hover, .card__link:focus-visible { transform: none; }
}

/* 印刷 */
@media print {
  .aura, .top, .controls, .skip { display: none !important; }
  .card__link { box-shadow: none; border: 1px solid #ccc; backdrop-filter: none; }
}
