/* ===== AI Digital Lab — base styles ===== */
:root {
  --accent: #6366f1;
  --ink: #1a1a2e;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #ffffff;
  --bg-soft: #f7f7fb;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(20, 20, 50, .06), 0 8px 24px rgba(20, 20, 50, .05);
  --maxw: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Hiragino Sans",
          "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--ink); font-size: 1.15rem; }
.brand:hover { text-decoration: none; }
.brand-mark { color: var(--accent); }
.site-nav { display: flex; gap: 22px; }
.site-nav a { color: var(--ink); font-size: .93rem; font-weight: 600; }
.site-nav a:hover { color: var(--accent); text-decoration: none; }
.nav-toggle { display: none; background: none; border: 0; font-size: 1.4rem; cursor: pointer; }

/* ===== Hero ===== */
.hero {
  text-align: center;
  padding: 72px 0 40px;
}
.hero h1 { font-size: 2.3rem; line-height: 1.35; margin: 0 0 16px; letter-spacing: -.01em; }
.hero p { color: var(--muted); max-width: 640px; margin: 0 auto; font-size: 1.02rem; }

/* ===== Sections & cards ===== */
.section { padding: 24px 0 56px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 24px; }
.section-head h1, .section-head h2 { font-size: 1.5rem; margin: 0; }
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}
.card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-link { color: inherit; display: block; }
.card-link:hover { text-decoration: none; }
.card-thumb { aspect-ratio: 16 / 9; display: flex; align-items: flex-end; padding: 14px; }
.card-cat {
  background: var(--bg); color: var(--accent);
  font-size: .72rem; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  box-shadow: var(--shadow);
}
.card-body { padding: 18px; }
.card-body h3 { margin: 0 0 8px; font-size: 1.08rem; line-height: 1.45; }
.card-body p { margin: 0 0 12px; color: var(--muted); font-size: .9rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-date { color: var(--muted); font-size: .78rem; }

/* ===== Article / prose ===== */
.prose { max-width: 760px; margin: 40px auto 64px; }
.article-meta { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.badge { background: var(--accent); color: #fff; font-size: .78rem; font-weight: 700; padding: 4px 12px; border-radius: 999px; }
.badge:hover { text-decoration: none; opacity: .9; }
.date { color: var(--muted); font-size: .82rem; }
.prose h1 { font-size: 2rem; line-height: 1.4; letter-spacing: -.01em; margin: 8px 0 24px; }
.article-body h2 {
  font-size: 1.5rem; margin: 52px 0 18px; padding-left: 14px;
  border-left: 5px solid var(--accent);
}
.article-body h3 { font-size: 1.2rem; margin: 36px 0 12px; }
.article-body p { margin: 0 0 20px; }
.article-body ul, .article-body ol { margin: 0 0 20px; padding-left: 1.4em; }
.article-body li { margin-bottom: 8px; }
.article-body img { border-radius: var(--radius); margin: 12px 0; }
.article-body code { background: var(--bg-soft); padding: 2px 6px; border-radius: 6px; font-size: .9em; }
.article-body pre { background: #0f172a; color: #e2e8f0; padding: 18px; border-radius: var(--radius); overflow-x: auto; }
.article-body pre code { background: none; color: inherit; }
blockquote {
  margin: 20px 0; padding: 14px 20px; border-left: 4px solid var(--accent);
  background: var(--bg-soft); border-radius: 0 8px 8px 0; color: #374151;
}
hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }

/* Affiliate CTA button */
.btn {
  display: inline-block; background: var(--accent); color: #fff !important;
  font-weight: 700; padding: 14px 30px; border-radius: 999px; text-align: center;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 40%, transparent);
  transition: transform .15s ease, filter .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); filter: brightness(1.05); }

/* Comparison table */
.table-wrap { overflow-x: auto; margin: 24px 0; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { border: 1px solid var(--line); padding: 12px 14px; text-align: left; vertical-align: top; }
thead th { background: var(--accent); color: #fff; font-weight: 700; }
tbody tr:nth-child(even) { background: var(--bg-soft); }

/* Disclosure / TOC / tags / author */
.disclosure { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412;
  font-size: .82rem; padding: 10px 14px; border-radius: 10px; margin-bottom: 28px; }
.toc { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; margin-bottom: 36px; }
.toc-title { font-weight: 800; margin: 0 0 10px; font-size: .95rem; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 6px 0; }
.toc-sub { padding-left: 18px; font-size: .9rem; }
.toc a { color: #374151; }
.tags { margin: 40px 0 24px; }
.tag { display: inline-block; color: var(--muted); font-size: .85rem; margin-right: 10px; }
.author-box { display: flex; gap: 16px; align-items: center; background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-top: 32px; }
.author-avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--accent);
  color: #fff; display: grid; place-items: center; font-size: 1.2rem; flex-shrink: 0; }
.author-name { font-weight: 700; margin: 0; }
.author-desc { color: var(--muted); font-size: .85rem; margin: 4px 0 0; }

/* ===== Footer ===== */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-soft); margin-top: 40px; padding: 44px 0; text-align: center; }
.footer-brand { font-weight: 800; margin: 0 0 4px; }
.footer-tagline { color: var(--muted); font-size: .9rem; margin: 0 0 18px; }
.footer-nav { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; margin-bottom: 18px; }
.footer-nav a { color: var(--ink); font-size: .85rem; }
.copyright { color: var(--muted); font-size: .8rem; margin: 0; }

/* ===== Responsive ===== */
@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--bg); border-bottom: 1px solid var(--line);
  }
  body.nav-open .site-nav { display: flex; }
  .site-nav a { padding: 14px 20px; border-top: 1px solid var(--line); }
  .hero h1 { font-size: 1.7rem; }
  .prose h1 { font-size: 1.5rem; }
}
