/* SPA Second Production Association - Minimal, serious, white-first design */
:root{
  --bg: #ffffff;
  --surface: #ffffff;
  --text: #111827;
  --muted: #4b5563;
  --line: #e5e7eb;
  --soft: #f9fafb;
  --accent: #2563eb; /* replace freely */
  --accent-2: #16a34a; /* optional */
  --shadow: 0 10px 25px rgba(0,0,0,.06);
  --radius: 14px;
  --max: 1120px;
}

*{ box-sizing: border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
}

a{ color: inherit; text-decoration: none; }
a:hover{ text-decoration: underline; }
p{ margin: 0 0 1rem; }
small{ color: var(--muted); }
hr{ border:0; border-top:1px solid var(--line); margin: 24px 0; }

.container{
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 18px;
}

.skip-link{
  position:absolute;
  left:-999px;
  top:auto;
  width:1px;
  height:1px;
  overflow:hidden;
}
.skip-link:focus{
  left: 16px;
  top: 16px;
  width:auto;
  height:auto;
  background: var(--text);
  color: #fff;
  padding: 10px 12px;
  border-radius: 10px;
  z-index: 9999;
  text-decoration: none;
}

/* Header */
.site-header{
  position: sticky;
  top: 0;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  z-index: 1000;
}
.header-inner{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  height: 72px;
}

.brand{
  display:flex;
  align-items:center;
  gap: 12px;
  min-width: 240px;
}
.brand img{
  height: 40px;
  width: auto;
  display:block;
}
.brand-title{
  display:flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand-title strong{ font-size: 14px; letter-spacing: .02em; }
.brand-title span{ font-size: 12px; color: var(--muted); }

.nav{
  display:flex;
  align-items:center;
  gap: 6px;
}
.nav a{
  display:inline-flex;
  align-items:center;
  padding: 10px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
}
.nav a[aria-current="page"],
.nav a.is-active{
  color: var(--text);
  background: var(--soft);
}

.nav a:hover{
  background: var(--soft);
  text-decoration:none;
  color: var(--text);
}
.nav a[aria-current="page"]{
  background: var(--text);
  color:#fff;
}

.nav-toggle{
  display:none;
  border:1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 10px 12px;
  font-weight: 700;
  cursor:pointer;
}

/* Hero */
.hero{
  position: relative;
  overflow:hidden;
  border-bottom: 1px solid var(--line);
}
.hero-inner{
  padding: 70px 0 56px;
  position: relative;
  z-index: 2;
}
.hero-inner h1{ padding: 0 6px; }
.hero h1{
  font-size: clamp(26px, 4vw, 44px);
  line-height: 1.15;
  margin: 0 0 14px;
  letter-spacing: .02em;
}
.hero p{
  color: var(--muted);
  font-size: 16px;
  max-width: 64ch;
}
.hero-cta{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius: 999px;
  padding: 11px 16px;
  font-weight: 800;
  font-size: 14px;
  border:1px solid var(--line);
  background: #fff;
  text-decoration:none !important;
  box-shadow: none;
}
.btn.primary{
  background: var(--text);
  color:#fff;
  border-color: var(--text);
}
.btn:hover{
  transform: translateY(-1px);
}
.hero-canvas-wrap{
  position:absolute;
  inset:0;
  z-index:1;
  pointer-events:none;
}
#nodeCanvas{
  width:100%;
  height:100%;
  display:block;
  opacity: .85;
}

/* Sections */
.section{
  padding: 44px 0;
}
.section-title{
  display:flex;
  align-items:flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.section-title h2{
  margin:0;
  font-size: 20px;
  letter-spacing: .02em;
}
.section-title p{
  margin:0;
  color: var(--muted);
  font-size: 13px;
}

.grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}

.card{
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 18px;
}
.card h3{
  margin: 0 0 8px;
  font-size: 16px;
}
.card p{
  margin: 0;
  color: var(--muted);
}

.kv{
  display:flex;
  gap: 14px;
  align-items:center;
}
.kv .thumb{
  width: 84px;
  height: 56px;
  border-radius: 12px;
  border:1px solid var(--line);
  background: linear-gradient(135deg, #f3f4f6, #ffffff);
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}
.kv .thumb img{ width:100%; height:100%; object-fit: cover; }
.thumb.thumb-contain img{ object-fit: contain; padding: 6px; background: #fff; }
.kv .thumb svg{ width: 40px; height: 40px; opacity:.7; }

/* Content */
.content{
  padding: 36px 0 56px;
}
.page-head{
  padding: 26px 0 14px;
  border-bottom: 1px solid var(--line);
}
.page-head h1{
  margin: 0 0 6px;
  font-size: 26px;
}
.page-head p{
  margin:0;
  color: var(--muted);
}

.prose{
  max-width: 82ch;
}
.prose h2{
  margin: 28px 0 10px;
  font-size: 18px;
}
.prose h3{
  margin: 22px 0 8px;
  font-size: 16px;
}
.prose ul, .prose ol{
  padding-left: 1.3em;
}

/* Organization page */
.org-wrap{
  display:grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items:start;
}
.org-diagram{
  position:relative;
  min-height: 240px;
  border:1px dashed #d1d5db;
  border-radius: var(--radius);
  background: repeating-linear-gradient(45deg, #fafafa, #fafafa 10px, #ffffff 10px, #ffffff 20px);
  overflow:hidden;
}
.org-diagram .label{
  position:absolute;
  left: 14px;
  top: 12px;
  font-size: 12px;
  color: var(--muted);
  background: rgba(255,255,255,.9);
  padding: 6px 10px;
  border:1px solid var(--line);
  border-radius: 999px;
}
.org-diagram svg{ width:100%; height:100%; display:block; }

.table-tools{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items:center;
  justify-content: space-between;
  margin: 14px 0 10px;
}
.search{
  display:flex;
  align-items:center;
  gap: 10px;
  border:1px solid var(--line);
  border-radius: 999px;
  padding: 10px 12px;
  background:#fff;
  min-width: 240px;
}
.search input{
  border:0;
  outline: none;
  width: 240px;
  font-size: 14px;
}
.badge{
  font-size: 12px;
  color: var(--muted);
  border:1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: #fff;
}

.table{
  width:100%;
  border-collapse: collapse;
  border:1px solid var(--line);
  border-radius: var(--radius);
  overflow:hidden;
}
.table th, .table td{
  padding: 12px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.table th{
  text-align:left;
  background: var(--soft);
  font-size: 12px;
  letter-spacing: .02em;
  color: var(--muted);
}
.table tr:last-child td{ border-bottom:0; }
.table .num{ width: 80px; color: var(--muted); }

/* Footer */
.site-footer{
  border-top: 1px solid var(--line);
  background: #fff;
}
.footer-inner{
  padding: 22px 0;
  display:grid;
  gap: 14px;
}
.footer-meta{
  display:flex;
  flex-direction: column;
  align-items:flex-start;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}
.footer-meta a{ color: var(--text); }
.footer-text{
  color: var(--muted);
  font-size: 13px;
  max-width: 110ch;
}
.footer-bottom{
  display:flex;
  justify-content: space-between;
  align-items:center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}


.figure{
  margin: 0;
}
.figure img{
  width: 100%;
  height: auto;
  display:block;
  border:1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.figure figcaption{
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.table-wrap{
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border:1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.table-wrap table{
  border:0;
  min-width: 640px;
}


/* Responsive */

@media (max-width: 920px){
  .grid{ grid-template-columns: 1fr; }
  .grid > *{ grid-column: span 12 !important; }
  .kv{ flex-direction: column; align-items:flex-start; }
  .kv .thumb{ width: 100%; height: 140px; }
  .page-head{ flex-direction: column; align-items:flex-start; gap: 8px; }
  .hero-inner{ padding: 34px 0 28px; }
  .hero h1{ font-size: 28px; }
  .hero .lead{ font-size: 15px; }
  .section{ padding: 28px 0; }
  .section-title{ flex-direction: column; align-items:flex-start; gap: 6px; }
  .table-tools{ flex-direction: column; align-items: stretch; }
  .search input{ width: 100%; }
}

@media (max-width: 920px){
  .org-wrap{ grid-template-columns: 1fr; }
}
@media (max-width: 820px){
  .brand{ min-width: unset; }
  .nav{
    position: absolute;
    right: 18px;
    top: 72px;
    display:none;
    flex-direction: column;
    gap: 6px;
    background:#fff;
    border:1px solid var(--line);
    border-radius: 18px;
    padding: 10px;
    box-shadow: var(--shadow);
    width: min(320px, calc(100vw - 36px));
  }
  .nav[data-open="true"]{ display:flex; }
  .nav a{ width:100%; justify-content:flex-start; }
  .nav-toggle{ display:inline-flex; }
}
@media (prefers-reduced-motion: reduce){
  .btn:hover{ transform: none; }
  #nodeCanvas{ display:none; }
}
