/* ============================================
   朝活ポータル — Global Design System
   Light mode first, warm morning aesthetic
   ============================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #FEFDF8;
  --surface: #FFFFFF;
  --surface2: #F5F3EE;
  --border: #E5E2D8;
  --accent: #7B5EE5;
  --accent-pale: #EDEAFF;
  --amber: #D97706;
  --amber-pale: #FEF3C7;
  --green: #059669;
  --green-pale: #D1FAE5;
  --text: #1C1917;
  --text-muted: #6B6560;
  --text-dim: #A89E99;
  --nav-w: 240px;
  --r: 10px;
  --r-sm: 6px;
  --r-lg: 16px;
  --shadow: 0 1px 4px rgba(28,25,23,.06), 0 2px 10px rgba(28,25,23,.04);
  --shadow-hover: 0 4px 24px rgba(28,25,23,.11);
  --ease: cubic-bezier(.4,0,.2,1);
}

html.dark {
  --bg: #0F0F14;
  --surface: #18181F;
  --surface2: #1E1E28;
  --border: #28283A;
  --accent: #8B73FF;
  --accent-pale: rgba(139,115,255,.12);
  --amber: #FBBF24;
  --amber-pale: rgba(251,191,36,.1);
  --green: #10B981;
  --green-pale: rgba(16,185,129,.1);
  --text: #EAEAF0;
  --text-muted: #7070A0;
  --text-dim: #3C3C52;
  --shadow: 0 1px 4px rgba(0,0,0,.3), 0 2px 10px rgba(0,0,0,.2);
  --shadow-hover: 0 4px 24px rgba(0,0,0,.5);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Hiragino Sans', 'Noto Sans JP', 'Yu Gothic UI', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

/* ── THEME TOGGLE ── */
#theme-toggle {
  position: fixed;
  top: 16px; right: 16px;
  z-index: 300;
  display: flex; align-items: center; gap: 5px;
  padding: 7px 13px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: all .18s var(--ease);
  white-space: nowrap;
}
#theme-toggle:hover { color: var(--accent); border-color: var(--accent); }

/* ── SIDEBAR NAV ── */
.site-nav {
  position: fixed;
  top: 0; left: 0;
  width: var(--nav-w); height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  z-index: 200;
  display: flex; flex-direction: column;
  transition: transform .28s var(--ease);
}

.nav-logo {
  padding: 26px 20px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.nav-logo-link { text-decoration: none; }
.nav-logo-text {
  font-size: 15px; font-weight: 800;
  color: var(--text); letter-spacing: -.02em;
}
.nav-logo-text em { color: var(--accent); font-style: normal; }
.nav-logo-sub { font-size: 10px; color: var(--text-dim); margin-top: 3px; }

.nav-section-label {
  font-size: 9px; font-weight: 800;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-dim);
  padding: 16px 20px 5px;
  flex-shrink: 0;
}

.nav-links { list-style: none; }
.nav-links a {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 20px;
  font-size: 13px; color: var(--text-muted);
  text-decoration: none;
  transition: all .15s var(--ease);
  line-height: 1.4;
}
.nav-links a:hover { color: var(--text); background: var(--surface2); }
.nav-links a.active {
  color: var(--accent);
  background: var(--accent-pale);
  font-weight: 600;
}
.nav-icon { font-size: 15px; flex-shrink: 0; }

.nav-app-section {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.nav-app-btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%; padding: 11px 14px;
  background: linear-gradient(135deg, var(--accent), #5BAAFF);
  border-radius: var(--r);
  color: #fff; font-size: 12.5px; font-weight: 700;
  text-decoration: none; text-align: center;
  transition: opacity .18s;
  box-shadow: 0 4px 18px rgba(123,94,229,.38);
}
.nav-app-btn:hover { opacity: .88; }

/* TOC nav (article pages) */
.nav-toc-links { list-style: none; }
.nav-toc-links a {
  display: block;
  padding: 6px 20px;
  font-size: 12px; color: var(--text-muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: all .15s var(--ease);
  line-height: 1.45;
}
.nav-toc-links a:hover { color: var(--text); }
.nav-toc-links a.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--accent-pale);
  font-weight: 600;
}
.nav-back {
  display: flex; align-items: center; gap: 6px;
  padding: 0 20px 16px; margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
  font-size: 12px; color: var(--text-muted);
  text-decoration: none; transition: color .15s;
  flex-shrink: 0;
}
.nav-back:hover { color: var(--accent); }

/* Mobile nav */
.nav-hamburger {
  display: none;
  position: fixed; top: 14px; left: 14px;
  z-index: 400;
  width: 40px; height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  cursor: pointer;
  align-items: center; justify-content: center;
  flex-direction: column; gap: 5px;
  box-shadow: var(--shadow);
  transition: border-color .15s;
}
.nav-hamburger:hover { border-color: var(--accent); }
.nav-hamburger span {
  display: block; width: 18px; height: 1.5px;
  background: var(--text-muted); border-radius: 2px;
}
.nav-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 190;
  backdrop-filter: blur(2px);
}
.nav-overlay.visible { display: block; }

/* ── MAIN ── */
main { margin-left: var(--nav-w); }
.content { max-width: 840px; padding: 64px 48px 120px; }

/* ── BREADCRUMB ── */
.breadcrumb {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-bottom: 28px;
  font-size: 12px; color: var(--text-dim);
}
.breadcrumb a { color: var(--text-muted); text-decoration: none; transition: color .15s; }
.breadcrumb a:hover { color: var(--accent); }

/* ── HERO ── */
.hero {
  padding: 60px 0 56px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 64px;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--green);
  background: var(--green-pale);
  border: 1px solid rgba(5,150,105,.2);
  padding: 4px 12px; border-radius: 20px;
  margin-bottom: 22px;
}
.hero-h1 {
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 900; letter-spacing: -.04em; line-height: 1.15;
  margin-bottom: 20px;
}
.hero-h1 em { font-style: normal; color: var(--accent); }
.hero-desc {
  font-size: 15.5px; color: var(--text-muted);
  max-width: 520px; line-height: 1.85; margin-bottom: 36px;
}
.hero-actions {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 44px;
}
.btn-primary {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 14px 26px;
  background: linear-gradient(135deg, var(--accent) 0%, #5B9FFF 100%);
  border-radius: var(--r); color: #fff;
  font-size: 14px; font-weight: 700; text-decoration: none;
  box-shadow: 0 4px 20px rgba(123,94,229,.35);
  transition: all .18s var(--ease);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 28px rgba(123,94,229,.45); }
.btn-secondary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 13px 22px;
  border: 1.5px solid var(--border);
  border-radius: var(--r); color: var(--text-muted);
  font-size: 13.5px; font-weight: 600; text-decoration: none;
  background: var(--surface); transition: all .18s var(--ease);
}
.btn-secondary:hover { color: var(--accent); border-color: var(--accent); }
.hero-stats { display: flex; gap: 40px; flex-wrap: wrap; }
.hero-stat-num {
  font-size: 26px; font-weight: 900; color: var(--amber);
  letter-spacing: -.02em; line-height: 1;
}
.hero-stat-label { font-size: 11.5px; color: var(--text-dim); margin-top: 4px; }

/* ── SECTION HEADING ── */
.sec-heading {
  font-size: 14px; font-weight: 700;
  margin: 0 0 20px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.sec-heading::before {
  content: ''; display: block;
  width: 3px; height: 15px;
  background: var(--accent); border-radius: 2px; flex-shrink: 0;
}
.sec-heading .cnt { font-size: 10px; font-weight: 600; color: var(--text-dim); letter-spacing: .08em; }
.sec-wrap { margin-bottom: 64px; }

/* ── CATEGORY GRID ── */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 12px;
}
.cat-card {
  display: block; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r);
  padding: 22px 18px; text-decoration: none; color: var(--text);
  transition: all .18s var(--ease);
}
.cat-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}
.cat-card-icon {
  font-size: 28px; margin-bottom: 12px; display: block;
  transition: transform .2s;
}
.cat-card:hover .cat-card-icon { transform: scale(1.1); }
.cat-card-name { font-size: 13.5px; font-weight: 700; margin-bottom: 5px; }
.cat-card-desc { font-size: 11.5px; color: var(--text-muted); line-height: 1.55; }
.cat-card-meta { margin-top: 14px; font-size: 11px; color: var(--text-dim); font-weight: 600; }

/* ── ARTICLE GRID ── */
.art-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}
.art-card {
  display: block; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r);
  padding: 22px; text-decoration: none; color: var(--text);
  transition: all .18s var(--ease);
}
.art-card:hover {
  border-color: var(--green);
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}
.art-badge {
  display: inline-block; font-size: 10px; font-weight: 700;
  letter-spacing: .06em; color: var(--green);
  background: var(--green-pale);
  border: 1px solid rgba(5,150,105,.15);
  padding: 2px 8px; border-radius: 4px; margin-bottom: 11px;
}
.art-title { font-size: 14px; font-weight: 700; line-height: 1.5; margin-bottom: 9px; }
.art-desc { font-size: 12.5px; color: var(--text-muted); line-height: 1.65; }
.art-tags {
  margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border);
  display: flex; gap: 6px; flex-wrap: wrap;
}
.tag {
  display: inline-block; font-size: 10.5px;
  padding: 2px 8px; border-radius: 4px; font-weight: 600;
}
.tag-time { background: var(--accent-pale); color: var(--accent); }
.tag-level { background: var(--green-pale); color: var(--green); }
.tag-type { background: var(--surface2); color: var(--text-muted); }

/* ── HABIN BANNER ── */
.habin-banner {
  background: linear-gradient(135deg, rgba(123,94,229,.07) 0%, rgba(91,170,255,.05) 100%);
  border: 1px solid rgba(123,94,229,.18);
  border-radius: var(--r-lg); padding: 40px 44px;
  margin-bottom: 64px;
  display: flex; align-items: center; gap: 32px; flex-wrap: wrap;
}
.habin-banner-icon {
  width: 76px; height: 76px;
  background: linear-gradient(135deg, var(--accent), #5BAAFF);
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; flex-shrink: 0;
  box-shadow: 0 8px 28px rgba(123,94,229,.38);
}
.habin-banner-body { flex: 1; min-width: 220px; }
.habin-banner-label {
  font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 8px;
}
.habin-banner-title {
  font-size: 20px; font-weight: 800; letter-spacing: -.025em; line-height: 1.3;
  margin-bottom: 10px;
}
.habin-banner-desc {
  font-size: 14px; color: var(--text-muted); line-height: 1.75;
  max-width: 440px; margin-bottom: 24px;
}
.btn-appstore {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 24px;
  background: var(--text); color: var(--bg);
  border-radius: var(--r); font-size: 13.5px; font-weight: 700;
  text-decoration: none; transition: opacity .18s;
}
html.dark .btn-appstore { background: #EAEAF0; color: #0F0F14; }
.btn-appstore:hover { opacity: .85; }
.btn-appstore-sub { font-size: 10px; font-weight: 400; opacity: .7; display: block; }
.btn-appstore-main { font-size: 14px; font-weight: 800; display: block; margin-top: -1px; }

/* ── FOOTER ── */
.site-footer {
  margin-top: 80px; padding-top: 28px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
}
.footer-logo { font-size: 13px; font-weight: 800; color: var(--text); }
.footer-logo em { color: var(--accent); font-style: normal; }
.footer-links { display: flex; gap: 20px; }
.footer-links a { font-size: 11.5px; color: var(--text-muted); text-decoration: none; transition: color .15s; }
.footer-links a:hover { color: var(--accent); }
.footer-copy { font-size: 11px; color: var(--text-dim); }

/* ── CATEGORY HEADER ── */
.cat-header { padding-bottom: 40px; border-bottom: 1px solid var(--border); margin-bottom: 40px; }
.cat-eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--green); background: var(--green-pale);
  border: 1px solid rgba(5,150,105,.15);
  padding: 4px 12px; border-radius: 20px; margin-bottom: 18px;
}
.cat-h1 {
  font-size: clamp(24px, 4vw, 36px); font-weight: 900;
  letter-spacing: -.035em; line-height: 1.2; margin-bottom: 14px;
}
.cat-h1 em { font-style: normal; color: var(--accent); }
.cat-lead { font-size: 15px; color: var(--text-muted); max-width: 540px; line-height: 1.8; margin-bottom: 24px; }
.cat-stats { display: flex; gap: 32px; flex-wrap: wrap; }
.cat-stat-n { font-size: 22px; font-weight: 900; color: var(--amber); letter-spacing: -.02em; line-height: 1; }
.cat-stat-l { font-size: 11px; color: var(--text-dim); margin-top: 4px; }

/* ── FILTER BAR ── */
.filter-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 32px; padding: 14px 18px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
}
.filter-label {
  font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-dim); flex-shrink: 0;
}
.filter-tag {
  display: inline-block; font-size: 11.5px; padding: 4px 12px;
  border-radius: 20px; border: 1px solid var(--border);
  color: var(--text-muted); background: var(--bg);
  cursor: pointer; transition: all .15s var(--ease);
  text-decoration: none; font-weight: 500;
  user-select: none;
}
.filter-tag:hover, .filter-tag.on {
  border-color: var(--accent); color: var(--accent); background: var(--accent-pale);
}

/* ── ARTICLE HEADER ── */
.article-header { padding-bottom: 32px; border-bottom: 1px solid var(--border); margin-bottom: 36px; }
.article-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--green); background: var(--green-pale);
  border: 1px solid rgba(5,150,105,.15);
  padding: 4px 12px; border-radius: 20px; margin-bottom: 18px;
}
.article-h1 {
  font-size: clamp(20px, 3.5vw, 28px); font-weight: 900;
  letter-spacing: -.03em; line-height: 1.3; margin-bottom: 14px;
}
.article-lead { font-size: 15px; color: var(--text-muted); line-height: 1.8; margin-bottom: 18px; max-width: 640px; }
.article-meta-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.read-time { font-size: 11.5px; color: var(--text-dim); margin-left: auto; }

/* ── ARTICLE BODY ── */
.article-body { font-size: 16px; line-height: 1.85; }
.article-body p { margin-bottom: 20px; }
.article-body h2 {
  font-size: 17px; font-weight: 800;
  margin: 48px 0 16px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
  letter-spacing: -.02em;
}
.article-body h2::before {
  content: ''; display: block; width: 3px; height: 16px;
  background: var(--accent); border-radius: 2px; flex-shrink: 0;
}
.article-body h3 {
  font-size: 14.5px; font-weight: 700;
  margin: 28px 0 10px;
  display: flex; align-items: center; gap: 7px;
}
.article-body h3::before {
  content: ''; display: block; width: 7px; height: 7px;
  background: var(--green); border-radius: 50%; flex-shrink: 0;
}
.article-body ul, .article-body ol { padding-left: 22px; margin-bottom: 20px; }
.article-body li { margin-bottom: 8px; line-height: 1.75; }
.article-body strong { color: var(--accent); font-weight: 700; }

/* ── INLINE CTA (in article body) ── */
.cta-inline {
  background: linear-gradient(135deg, rgba(123,94,229,.07), rgba(91,170,255,.04));
  border: 1px solid rgba(123,94,229,.18);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--r) var(--r) 0;
  padding: 20px 24px; margin: 36px 0;
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.cta-inline-text { flex: 1; min-width: 160px; }
.cta-inline-label {
  font-size: 9px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 4px;
}
.cta-inline-title { font-size: 14px; font-weight: 700; margin-bottom: 3px; }
.cta-inline-desc { font-size: 12px; color: var(--text-muted); }
.btn-cta {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 9px 18px; background: var(--accent); color: #fff;
  border-radius: var(--r-sm); font-size: 12.5px; font-weight: 700;
  text-decoration: none; white-space: nowrap; transition: opacity .18s;
}
.btn-cta:hover { opacity: .85; }

/* ── BOTTOM CTA ── */
.cta-bottom {
  background: linear-gradient(135deg, rgba(123,94,229,.08), rgba(91,170,255,.05));
  border: 1px solid rgba(123,94,229,.18);
  border-radius: var(--r-lg); padding: 36px 40px;
  margin: 48px 0; text-align: center;
}
.cta-bottom-icon { font-size: 40px; margin-bottom: 12px; }
.cta-bottom-title { font-size: 19px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 10px; }
.cta-bottom-desc {
  font-size: 14px; color: var(--text-muted); line-height: 1.7;
  margin-bottom: 24px; max-width: 380px; margin-left: auto; margin-right: auto;
}

/* ── HABIN CTA (category pages) ── */
.habin-cta {
  background: linear-gradient(135deg, rgba(123,94,229,.07), rgba(91,170,255,.04));
  border: 1px solid rgba(123,94,229,.18);
  border-radius: var(--r-lg); padding: 32px 36px;
  margin-bottom: 56px;
  display: flex; align-items: center; gap: 28px; flex-wrap: wrap;
}
.habin-cta-icon {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--accent), #5BAAFF);
  border-radius: 14px; display: flex; align-items: center; justify-content: center;
  font-size: 28px; flex-shrink: 0;
  box-shadow: 0 6px 20px rgba(123,94,229,.38);
}
.habin-cta-body { flex: 1; min-width: 200px; }
.habin-cta-label {
  font-size: 9px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 6px;
}
.habin-cta-title { font-size: 16px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 6px; }
.habin-cta-desc { font-size: 13px; color: var(--text-muted); line-height: 1.65; max-width: 400px; margin-bottom: 16px; }

/* ── RELATED ARTICLES ── */
.related-section { margin-top: 56px; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.related-card {
  display: block; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 14px 16px; text-decoration: none; color: var(--text);
  transition: border-color .18s;
}
.related-card:hover { border-color: var(--green); }
.related-cat { font-size: 10px; font-weight: 700; color: var(--green); margin-bottom: 5px; }
.related-title { font-size: 12.5px; font-weight: 700; line-height: 1.4; }

/* ── RESPONSIVE ── */
@media (max-width: 960px) {
  .site-nav { transform: translateX(-100%); }
  .site-nav.open { transform: translateX(0); box-shadow: var(--shadow-hover); }
  main { margin-left: 0; }
  .content { padding: 60px 24px 100px; }
  .nav-hamburger { display: flex; }
  .habin-banner { padding: 28px 24px; }
  .habin-cta { padding: 24px 20px; }
}
@media (max-width: 600px) {
  .content { padding: 56px 18px 80px; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .art-grid { grid-template-columns: 1fr; }
  .hero-h1 { font-size: 26px; }
  .hero-stats { gap: 24px; }
  .habin-banner { flex-direction: column; }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
}
