/* =========================================================
   AllBloom AI活用カタログ v2 — internal portal
   Design: black × white × accent orange (#F77B22)
   Tone: enterprise SaaS doc (Notion / Stripe Docs / Linear)
   ========================================================= */

:root {
  /* Color */
  --bg: #ffffff;
  --bg-subtle: #fafafa;
  --bg-soft: #f5f5f5;
  --bg-hover: #fff7f0;
  --ink: #0a0a0a;
  --ink-2: #1f1f1f;
  --ink-3: #4a4a4a;
  --ink-4: #6b6b6b;
  --ink-5: #8a8a8a;
  --ink-6: #b5b5b5;
  --border: #e7e7e7;
  --border-strong: #d4d4d4;

  --accent: #F77B22;
  --accent-ink: #b85608;
  --accent-soft: #fef0e3;
  --accent-line: #fad7b3;

  --green: #2f7d32;
  --green-soft: #e9f5ea;
  --yellow: #a86b00;
  --yellow-soft: #fff3d6;
  --red: #b3261e;
  --red-soft: #fce4e2;
  --gray: #6b6b6b;
  --gray-soft: #f0f0f0;

  /* Type */
  --font-sans: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;

  /* Spacing & radius */
  --radius-sm: 4px;
  --radius: 6px;
  --radius-lg: 10px;

  --sidenav-w: 260px;
  --header-h: 56px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "palt" 1;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
}
.skip-link:focus {
  left: 16px;
  top: 16px;
  background: var(--ink);
  color: #fff;
  padding: 8px 12px;
  border-radius: var(--radius);
  z-index: 1000;
}

/* =========================
   HEADER
   ========================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  height: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: var(--ink);
  position: relative;
  flex-shrink: 0;
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 5px;
  background: var(--accent);
  border-radius: 2px;
}
.brand-text { min-width: 0; }
.brand-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-divider {
  color: var(--ink-6);
  margin: 0 4px;
  font-weight: 400;
}
.brand-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--ink-5);
  margin-top: 1px;
}
.version {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.meta-dot {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: var(--ink-6);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 999px;
  letter-spacing: 0.01em;
}
.badge-internal {
  background: var(--ink);
  color: #fff;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--ink);
  border-radius: 1px;
}

/* =========================
   LAYOUT
   ========================= */
.layout {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: var(--sidenav-w) 1fr;
  gap: 56px;
  padding: 0 28px;
}

.sidenav {
  position: sticky;
  top: var(--header-h);
  align-self: start;
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 32px 16px 48px 0;
  font-size: 13.5px;
}
.nav-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-5);
  margin: 0 0 12px 12px;
}
.nav-list,
.nav-sub {
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-list > li {
  margin-bottom: 4px;
}
.nav-link {
  display: block;
  padding: 6px 12px;
  border-radius: var(--radius);
  color: var(--ink-3);
  font-weight: 500;
  border-left: 2px solid transparent;
  margin-left: -2px;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.nav-link:hover {
  background: var(--bg-soft);
  color: var(--ink);
}
.nav-link.is-active {
  color: var(--accent-ink);
  border-left-color: var(--accent);
  background: var(--accent-soft);
}
.nav-sub {
  margin: 4px 0 6px 0;
  padding-left: 0;
}
.nav-sub .nav-link {
  font-size: 12.5px;
  padding: 4px 12px 4px 22px;
  color: var(--ink-4);
  font-weight: 400;
}

/* =========================
   MAIN
   ========================= */
.main {
  min-width: 0;
  padding: 56px 0 96px;
}

/* HERO */
.hero {
  border-bottom: 1px solid var(--border);
  padding-bottom: 40px;
  margin-bottom: 56px;
}
.eyebrow {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent-ink);
  margin: 0 0 16px;
}
.hero-title {
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
  color: var(--ink);
}
.hero-version {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.55em;
  font-weight: 500;
  vertical-align: middle;
  margin-left: 8px;
  padding: 4px 10px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius);
  letter-spacing: 0.02em;
}
.hero-lead {
  font-size: 16px;
  line-height: 1.85;
  color: var(--ink-3);
  max-width: 760px;
  margin: 0 0 32px;
}
.hero-lead strong {
  color: var(--ink);
  font-weight: 600;
}
.hero-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.meta-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  background: var(--bg);
}
.meta-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-5);
  margin-bottom: 6px;
}
.meta-value {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-2);
}

/* =========================
   SECTIONS
   ========================= */
.section {
  margin: 0 0 72px;
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.section-title {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 0 8px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.section-lead {
  font-size: 14.5px;
  color: var(--ink-3);
  margin: 16px 0 24px;
  max-width: 760px;
}

.subsection {
  margin-top: 32px;
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.subsection-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin: 0 0 14px;
}

/* =========================
   TABLE
   ========================= */
.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  overflow-x: auto;
  background: var(--bg);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  line-height: 1.65;
}
.data-table thead {
  background: var(--bg-subtle);
}
.data-table th {
  font-weight: 600;
  font-size: 12px;
  text-align: left;
  padding: 12px 16px;
  color: var(--ink-3);
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--ink-2);
  vertical-align: top;
}
.data-table tbody tr:last-child td {
  border-bottom: none;
}
.data-table tbody tr {
  transition: background .15s ease;
}
.data-table tbody tr:hover {
  background: var(--bg-hover);
}
.col-mark { width: 180px; }
.col-center {
  text-align: center;
  white-space: nowrap;
}
.data-table-catalog td:first-child {
  font-weight: 500;
  color: var(--ink);
  min-width: 220px;
}
.data-table code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg-soft);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--ink-2);
}

/* =========================
   MARKS / PILLS
   ========================= */
.mark {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
}
.mark-ok { background: var(--green-soft); color: var(--green); }
.mark-partial { background: var(--yellow-soft); color: var(--yellow); }
.mark-ng { background: var(--gray-soft); color: var(--gray); }
.mark-green { background: var(--green-soft); color: var(--green); }
.mark-yellow { background: var(--yellow-soft); color: var(--yellow); }
.mark-red { background: var(--red-soft); color: var(--red); }

.col-center .mark {
  font-size: 14px;
  padding: 2px 6px;
  background: transparent;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid;
  margin-right: 4px;
  white-space: nowrap;
}
.status-done {
  color: var(--green);
  background: var(--green-soft);
  border-color: rgba(47, 125, 50, 0.2);
}
.status-partial {
  color: var(--yellow);
  background: var(--yellow-soft);
  border-color: rgba(168, 107, 0, 0.2);
}
.status-todo {
  color: var(--ink-4);
  background: var(--bg-soft);
  border-color: var(--border);
}

.tag-new {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  padding: 0 6px;
  border-radius: var(--radius-sm);
  margin-left: 4px;
  vertical-align: 1px;
}

.t-icon {
  display: inline-block;
  margin-right: 4px;
  filter: grayscale(0.15);
}

/* =========================
   LEGEND
   ========================= */
.legend-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  background: var(--bg);
}
.legend-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
}
.legend-list li:hover {
  background: var(--bg-subtle);
}
.time-icon {
  font-size: 18px;
  width: 28px;
  text-align: center;
}
.time-label {
  font-weight: 600;
  color: var(--ink);
  font-size: 13.5px;
}
.time-desc {
  color: var(--ink-4);
  font-size: 12.5px;
  margin-left: auto;
}

/* =========================
   CATEGORY BLOCK
   ========================= */
.cat-block {
  margin: 40px 0 0;
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.cat-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0 0 16px;
}
.cat-number {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  padding: 4px 10px;
  border-radius: var(--radius);
  letter-spacing: 0.04em;
}
.cat-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
  line-height: 1.3;
}
.cat-sub {
  font-size: 12.5px;
  color: var(--ink-5);
  margin: 2px 0 0;
}

/* =========================
   LISTS / DEFINITIONS
   ========================= */
.num-list,
.bullet-list {
  margin: 0;
  padding-left: 22px;
  line-height: 1.9;
  color: var(--ink-2);
}
.num-list li,
.bullet-list li {
  margin-bottom: 4px;
}
.num-list li::marker {
  color: var(--ink-5);
  font-weight: 600;
}
.num-list strong,
.bullet-list strong {
  color: var(--ink);
  font-weight: 600;
}

.def-list {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(160px, 220px) 1fr;
  gap: 12px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
}
.def-list dt {
  font-weight: 600;
  color: var(--ink);
  font-size: 14px;
  padding-top: 2px;
}
.def-list dd {
  margin: 0;
  font-size: 14px;
  color: var(--ink-3);
  line-height: 1.75;
}
.def-list code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: var(--bg-soft);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--ink-2);
}

/* Example block */
.examples {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.example {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  background: var(--bg);
}
.example-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.example p {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-2);
}
.example-note {
  display: block;
  margin-top: 6px;
  color: var(--ink-5);
  font-size: 12.5px;
}
.example-good {
  border-color: rgba(47, 125, 50, 0.3);
  background: linear-gradient(0deg, var(--green-soft), var(--green-soft)) padding-box,
              var(--bg);
}
.example-good {
  background: #f5fbf5;
}
.example-good .example-label { color: var(--green); }
.example-bad { background: #fbf5f5; border-color: rgba(179, 38, 30, 0.25); }
.example-bad .example-label { color: var(--red); }

/* =========================
   FOOTER
   ========================= */
.site-footer {
  margin-top: 96px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px;
  margin-bottom: 28px;
}
.footer-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-5);
  margin-bottom: 4px;
}
.footer-value {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.6;
}
.footer-note {
  color: var(--ink-4);
  font-size: 12.5px;
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--ink-5);
}
.footer-badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--ink-4);
}

/* =========================
   BACK-TO-TOP
   ========================= */
.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .25s ease, transform .25s ease, color .15s ease, border-color .15s ease;
  z-index: 60;
}
.to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.to-top:hover {
  color: var(--accent-ink);
  border-color: var(--accent-line);
}

/* =========================
   RESPONSIVE
   ========================= */
@media (max-width: 1024px) {
  .layout {
    grid-template-columns: 220px 1fr;
    gap: 32px;
  }
  .sidenav { font-size: 13px; }
  .examples { grid-template-columns: 1fr; }
  .def-list { grid-template-columns: 1fr; gap: 4px 0; padding: 16px 18px; }
  .def-list dt { padding-top: 12px; border-top: 1px solid var(--border); }
  .def-list dt:first-child { padding-top: 0; border-top: none; }
}

@media (max-width: 768px) {
  .header-inner { padding: 0 16px; }
  .layout {
    grid-template-columns: 1fr;
    padding: 0 16px;
    gap: 0;
  }
  .nav-toggle { display: flex; }

  .sidenav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--header-h));
    background: var(--bg);
    padding: 24px 20px 48px;
    z-index: 40;
    border-bottom: 1px solid var(--border);
    transform: translateX(-100%);
    transition: transform .25s ease;
    overflow-y: auto;
  }
  .sidenav.is-open { transform: translateX(0); }

  .main { padding: 32px 0 64px; }
  .hero { padding-bottom: 28px; margin-bottom: 36px; }
  .hero-title { font-size: 26px; }
  .hero-lead { font-size: 15px; }
  .section { margin-bottom: 52px; }
  .section-title { font-size: 22px; }

  .data-table { font-size: 12.5px; }
  .data-table th,
  .data-table td { padding: 10px 12px; }

  .badge-internal { display: none; }
}

/* Print friendly */
@media print {
  .site-header,
  .sidenav,
  .to-top,
  .nav-toggle { display: none !important; }
  .layout {
    display: block;
    max-width: 100%;
    padding: 0;
  }
  .main { padding: 0; }
  .hero { page-break-after: avoid; }
  .section { page-break-inside: avoid; }
  body { font-size: 11pt; line-height: 1.55; }
  .data-table { font-size: 10pt; }
  .data-table tbody tr:hover { background: transparent; }
  a { color: var(--ink); text-decoration: none; }
}

/* Subtle fade-in (respects prefers-reduced-motion) */
@media (prefers-reduced-motion: no-preference) {
  .section, .hero, .cat-block {
    animation: fade-up .5s ease both;
  }
  @keyframes fade-up {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}
