/* ============================================
   AKU あくせる - Design System
   ============================================ */

:root {
  /* Neutral ramp */
  --bg: #f8fafc;
  --bg-elevated: #ffffff;
  --bg-muted: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;

  /* Theme color (overridden per-region via JS) */
  --theme-primary: hsl(210 80% 50%);
  --theme-primary-soft: hsl(210 80% 50% / 0.1);
  --theme-secondary: hsl(200 70% 40%);
  --theme-accent: hsl(45 90% 55%);

  /* Semantic */
  --success: #16a34a;
  --error: #dc2626;

  /* Spacing */
  --space: 8px;

  /* Radius */
  --radius: 16px;
  --radius-sm: 12px;
  --radius-lg: 24px;

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.12);

  /* Layout */
  --max-width: 1280px;
  --header-height: 64px;
  --subnav-height: 52px;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;
    --bg-elevated: #1e293b;
    --bg-muted: #1e293b;
    --border: #334155;
    --border-strong: #475569;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --text-subtle: #64748b;
  }
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font: inherit; }

/* Loading screen */
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 24px;
}
.loading-logo {
  width: 64px; height: 64px;
  border-radius: 16px;
  background: var(--theme-primary);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 800;
  box-shadow: var(--shadow-lg);
  animation: pulse 1.5s ease-in-out infinite;
}
.loading-spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--theme-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg-elevated) 85%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}
.logo {
  display: flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 18px; letter-spacing: -0.02em;
}
.logo-mark {
  width: 36px; height: 36px;
  border-radius: 12px;
  background: var(--theme-primary);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800;
  box-shadow: var(--shadow);
  transition: transform 0.2s;
}
.logo:hover .logo-mark { transform: scale(1.08); }

/* Desktop nav */
.nav-desktop { display: none; align-items: center; gap: 4px; }
.nav-link {
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 14px; font-weight: 500;
  color: color-mix(in srgb, var(--text) 70%, transparent);
  transition: all 0.2s;
}
.nav-link:hover { background: var(--bg-muted); color: var(--text); }
.nav-dropdown { position: relative; }
.nav-dropdown-btn {
  display: flex; align-items: center; gap: 4px;
  padding: 8px 14px; border-radius: 10px;
  font-size: 14px; font-weight: 500;
  color: color-mix(in srgb, var(--text) 70%, transparent);
  transition: all 0.2s;
}
.nav-dropdown-btn:hover { background: var(--bg-muted); color: var(--text); }
.nav-dropdown-btn .chevron { transition: transform 0.2s; }
.nav-dropdown.open .nav-dropdown-btn .chevron { transform: rotate(180deg); }
.nav-dropdown-menu {
  position: absolute;
  top: 100%; left: 0;
  margin-top: 4px;
  min-width: 200px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  opacity: 0; visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s;
}
.nav-dropdown.open .nav-dropdown-menu {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.nav-dropdown-menu a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: color-mix(in srgb, var(--text) 80%, transparent);
  transition: all 0.15s;
}
.nav-dropdown-menu a:hover { background: var(--bg-muted); color: var(--text); }

/* Mobile toggle */
.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  border-radius: 8px;
}
.nav-toggle span {
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s;
}
.nav-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(4px, 4px); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Mobile nav */
.nav-mobile {
  display: none;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  padding: 8px 16px;
  animation: slideDown 0.2s ease;
}
.nav-mobile.open { display: block; }
.nav-mobile a {
  display: block;
  padding: 12px;
  border-radius: 10px;
  font-size: 15px; font-weight: 500;
  color: color-mix(in srgb, var(--text) 80%, transparent);
  transition: all 0.15s;
}
.nav-mobile a:hover { background: var(--bg-muted); }
.nav-mobile .nav-section-label {
  font-size: 12px; font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-subtle);
  padding: 12px 12px 4px;
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* Sub-nav */
.sub-nav {
  position: sticky;
  top: var(--header-height);
  z-index: 90;
  background: color-mix(in srgb, var(--bg-elevated) 90%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}
.sub-nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  gap: 4px;
  padding: 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.sub-nav-inner::-webkit-scrollbar { display: none; }
.sub-nav-item {
  position: relative;
  padding: 16px 16px;
  white-space: nowrap;
  font-size: 14px; font-weight: 500;
  color: color-mix(in srgb, var(--text) 60%, transparent);
  transition: color 0.2s;
}
.sub-nav-item:hover { color: var(--text); }
.sub-nav-item.active { color: var(--theme-primary); }
.sub-nav-item.active::after {
  content: '';
  position: absolute;
  bottom: 0; left: 12px; right: 12px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--theme-primary);
}

/* Main */
main { min-height: calc(100vh - var(--header-height) - 200px); }

/* Container */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
}
.container-narrow {
  max-width: 768px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--theme-primary), var(--theme-secondary));
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 50%, rgba(255,255,255,0.15), transparent 60%);
}
.hero-inner {
  position: relative;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 80px 16px 100px;
}
.hero h1 {
  color: white;
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  animation: fadeInUp 0.6s ease;
}
.hero p {
  margin-top: 16px;
  color: rgba(255,255,255,0.9);
  font-size: clamp(16px, 2vw, 20px);
  animation: fadeInUp 0.6s ease 0.1s both;
}
.hero-actions {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  animation: fadeInUp 0.6s ease 0.2s both;
}
.btn-hero {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
}
.btn-hero-primary {
  background: white;
  color: var(--text);
  box-shadow: var(--shadow-lg);
}
.btn-hero-primary:hover { transform: scale(1.05); }
.btn-hero-ghost {
  background: rgba(255,255,255,0.1);
  color: white;
  border: 1px solid rgba(255,255,255,0.3);
  backdrop-filter: blur(8px);
}
.btn-hero-ghost:hover { background: rgba(255,255,255,0.2); }

/* Wave divider */
.wave-divider {
  display: block;
  width: 100%;
  height: 48px;
  margin-top: -1px;
  color: var(--bg);
}

/* Sections */
.section { padding: 64px 0; }
.section-muted { background: var(--bg-muted); }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}
.section-title {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.section-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 500;
  color: var(--theme-primary);
  transition: opacity 0.2s;
}
.section-link:hover { opacity: 0.7; }

/* Cards */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.3s;
}
.card-hover:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

/* Grid */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }

/* News card */
.news-card {
  display: block;
  padding: 24px;
  animation: fadeInUp 0.5s ease both;
}
.news-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: color-mix(in srgb, var(--theme-accent) 20%, transparent);
  color: var(--theme-primary);
}
.meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}
.meta svg { width: 14px; height: 14px; flex-shrink: 0; }
.news-card h3 {
  margin-top: 8px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  transition: color 0.2s;
}
.news-card:hover h3 { color: var(--theme-primary); }
.news-card p {
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Blog card */
.blog-card {
  overflow: hidden;
  animation: fadeInUp 0.5s ease both;
}
.blog-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.blog-card .cover {
  aspect-ratio: 16/10;
  overflow: hidden;
}
.blog-card .cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}
.blog-card:hover .cover img { transform: scale(1.08); }
.blog-card-body { padding: 20px; }
.blog-card-body h3 {
  margin-top: 8px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  transition: color 0.2s;
}
.blog-card:hover h3 { color: var(--theme-primary); }
.blog-card-body p {
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Member card */
.member-card {
  padding: 24px;
  text-align: center;
  animation: fadeInUp 0.5s ease both;
}
.member-card:hover { box-shadow: var(--shadow-lg); }
.member-avatar {
  width: 80px; height: 80px;
  margin: 0 auto;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow);
}
.member-avatar-placeholder {
  width: 80px; height: 80px;
  margin: 0 auto;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--theme-primary), var(--theme-secondary));
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 800;
  box-shadow: var(--shadow);
}
.member-card h3 { margin-top: 16px; font-size: 17px; font-weight: 700; }
.member-role { margin-top: 4px; font-size: 14px; font-weight: 600; color: var(--theme-primary); }
.member-bio { margin-top: 8px; font-size: 13px; color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Member list card */
.member-list-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px;
  animation: fadeInUp 0.5s ease both;
}
.member-list-card:hover { box-shadow: var(--shadow-lg); }
.member-list-card .member-avatar,
.member-list-card .member-avatar-placeholder {
  width: 72px; height: 72px;
  border-radius: var(--radius-sm);
  margin: 0;
  flex-shrink: 0;
}
.member-list-card .member-info { flex: 1; min-width: 0; }
.member-list-card h3 { font-size: 17px; font-weight: 700; }
.member-list-card .member-role { margin-top: 2px; }

/* Info card */
.info-card {
  padding: 24px;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}
.info-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.info-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
}
.info-row dt { color: var(--text-muted); }
.info-row dd { font-weight: 600; }

/* Overview */
.overview-text {
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-muted);
  white-space: pre-wrap;
}

/* Page header */
.page-header { padding: 48px 0 24px; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  color: var(--text-muted);
  transition: color 0.2s;
}
.back-link:hover { color: var(--text); }
.page-title {
  margin-top: 16px;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.page-subtitle { margin-top: 8px; color: var(--text-muted); font-size: 16px; }

/* Empty state */
.empty-state {
  margin-top: 48px;
  padding: 48px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
  color: var(--text-muted);
}

/* Article */
.article { animation: fadeInUp 0.5s ease; }
.article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}
.article h1 {
  margin-top: 16px;
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.article-excerpt {
  margin-top: 16px;
  font-size: 18px;
  color: var(--text-muted);
  line-height: 1.6;
}
.article-cover {
  margin-top: 32px;
  border-radius: var(--radius);
  overflow: hidden;
}
.article-cover img { width: 100%; object-fit: cover; }
.article-body {
  margin-top: 32px;
  font-size: 16px;
  line-height: 1.8;
  color: color-mix(in srgb, var(--text) 90%, transparent);
  white-space: pre-wrap;
}

/* News list */
.news-list { margin-top: 32px; display: flex; flex-direction: column; gap: 16px; }
.news-list-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  animation: fadeInUp 0.4s ease both;
  transition: all 0.2s;
}
.news-list-item:hover {
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--theme-primary) 30%, var(--border));
}
.news-list-item h2 {
  margin-top: 8px;
  font-size: 18px;
  font-weight: 700;
  transition: color 0.2s;
}
.news-list-item:hover h2 { color: var(--theme-primary); }
.news-list-item p {
  margin-top: 4px;
  font-size: 14px;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Contact form */
.contact-form {
  margin-top: 32px;
  padding: 32px;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}
.form-input, .form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  transition: all 0.2s;
}
.form-input:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--theme-primary);
  box-shadow: 0 0 0 3px var(--theme-primary-soft);
}
.form-textarea { resize: vertical; min-height: 140px; }
.form-error {
  margin-top: 4px;
  font-size: 14px;
  color: var(--error);
}
.btn-submit {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: var(--theme-primary);
  color: white;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}
.btn-submit:hover { opacity: 0.9; }
.btn-submit:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-outline {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
}
.btn-outline:hover { background: var(--bg-muted); }

/* Success */
.contact-success {
  padding: 32px;
  text-align: center;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  animation: scaleIn 0.3s ease;
}
.contact-success svg { width: 48px; height: 48px; color: var(--success); margin: 0 auto; }
.contact-success h2 { margin-top: 16px; font-size: 20px; font-weight: 800; }
.contact-success p { margin-top: 8px; color: var(--text-muted); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-muted);
  padding: 48px 0 24px;
  margin-top: 64px;
}
.footer-grid {
  display: grid;
  gap: 32px;
  grid-template-columns: 1fr;
}
.footer-brand { font-weight: 800; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.footer-desc { margin-top: 12px; font-size: 14px; color: var(--text-muted); }
.footer-col h3 { font-size: 14px; font-weight: 700; margin-bottom: 12px; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-col a { font-size: 14px; color: var(--text-muted); transition: color 0.2s; }
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
}

/* 404 */
.not-found {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
}
.not-found h1 { font-size: 72px; font-weight: 800; color: var(--theme-primary); }
.not-found p { margin-top: 16px; font-size: 18px; color: var(--text-muted); }
.not-found a { margin-top: 24px; }

/* Animations */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* Responsive */
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
  .overview-grid { grid-template-columns: 2fr 1fr; }
}
@media (min-width: 1024px) {
  .nav-desktop { display: flex; }
  .nav-toggle { display: none; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}
.overview-grid { display: grid; gap: 48px; grid-template-columns: 1fr; }
