/* ============================================
   IroHive Design System
   AI自動化の型が集まる、実践ハブ
   ============================================ */

:root,
:root[data-theme="dark"] {
  /* === Dark (default) === */
  --bg: #0d1117;
  --bg-elev: #0f151d;
  --card: #161b22;
  --card-hover: #1c232d;
  --border: #21262d;
  --border-strong: #30363d;
  --text: #e2e8f0;
  --text-sub: #8b949e;
  --text-dim: #6b7280;
  --gold: #d4a017;
  --gold-soft: rgba(212, 160, 23, 0.12);
  --green: #3fb950;
  --green-soft: rgba(63, 185, 80, 0.12);
  --blue: #58a6ff;
  --blue-soft: rgba(88, 166, 255, 0.12);
  --danger: #f85149;
  --nav-bg: rgba(13, 17, 23, 0.85);
  --pattern-stroke: #21262d;
  --brand-fg: #ffffff;
  --brand-fg-sub: #8b949e;
  --logo-bg: #101820;
  --shadow-card-soft: 0 1px 0 rgba(255,255,255,0.02) inset, 0 8px 24px rgba(0,0,0,0.25);
}

:root[data-theme="light"] {
  /* === Light === */
  --bg: #f7f8fa;
  --bg-elev: #ffffff;
  --card: #ffffff;
  --card-hover: #fafbfc;
  --border: #e6e8ec;
  --border-strong: #d0d4db;
  --text: #1a1f2b;
  --text-sub: #5b6472;
  --text-dim: #8b93a1;
  --gold: #b8860b;
  --gold-soft: rgba(184, 134, 11, 0.10);
  --green: #2ea043;
  --green-soft: rgba(46, 160, 67, 0.10);
  --blue: #0969da;
  --blue-soft: rgba(9, 105, 218, 0.09);
  --danger: #cf222e;
  --nav-bg: rgba(255, 255, 255, 0.85);
  --pattern-stroke: #e6e8ec;
  --brand-fg: #1a1f2b;
  --brand-fg-sub: #5b6472;
  --logo-bg: #101820;
  --shadow-card-soft: 0 1px 0 rgba(255,255,255,0.5) inset, 0 4px 14px rgba(15,20,30,0.06);
}

  /* Type */
  --font-jp: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic UI", sans-serif;
  --font-en: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

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

  --shadow-card: 0 1px 0 rgba(255,255,255,0.02) inset, 0 8px 24px rgba(0,0,0,0.25);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-jp);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--blue);
  text-decoration: none;
  transition: color 0.15s ease, opacity 0.15s ease;
}
a:hover { opacity: 0.85; }

img, svg { display: block; max-width: 100%; }

/* Utility */
.mono { font-family: var(--font-mono); }
.en { font-family: var(--font-en); letter-spacing: -0.01em; }
.text-sub { color: var(--text-sub); }
.text-dim { color: var(--text-dim); }
.text-gold { color: var(--gold); }
.text-green { color: var(--green); }
.text-blue { color: var(--blue); }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}
.container-narrow {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ============================================
   Navigation
   ============================================ */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-nav .inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: nowrap;
}
.site-nav .brand { flex-shrink: 0; }
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.brand:hover { opacity: 1; }
.brand-mark {
  width: 26px;
  height: 26px;
  color: var(--gold);
}
.nav-links {
  display: flex;
  gap: 4px;
  align-items: center;
  list-style: none;
  padding: 0;
  margin: 0;
}
.nav-links a {
  display: inline-block;
  padding: 8px 14px;
  color: var(--text-sub);
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
}
.nav-links a:hover { color: var(--text); background: var(--card); opacity: 1; }
.nav-links a.active { color: var(--text); }
.nav-links a.soon {
  color: var(--text-dim);
  font-size: 12px;
  padding: 4px 8px;
  border: 1px dashed var(--border-strong);
  border-radius: 999px;
  cursor: default;
}
.nav-links a.soon:hover { background: transparent; color: var(--text-dim); }
.nav-spacer { flex: 1; }
.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--card);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
}
.nav-cta:hover { background: var(--card-hover); opacity: 1; }

/* Search placeholder in nav (future) */
.nav-search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 12.5px;
  min-width: 0;
  max-width: 240px;
  cursor: not-allowed;
  flex-shrink: 1;
  overflow: hidden;
}
.nav-search span:not(.kbd) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-search svg { width: 14px; height: 14px; color: var(--text-dim); flex-shrink: 0; }
.nav-search .kbd {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 1px 6px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  color: var(--text-dim);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font-jp);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  line-height: 1;
}
.btn-primary {
  background: var(--gold);
  color: #1a1206;
  border-color: var(--gold);
}
.btn-primary:hover { background: #e5b430; opacity: 1; }
.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--card); border-color: #3d4552; opacity: 1; }
.btn-ghost {
  background: transparent;
  color: var(--blue);
  padding: 8px 0;
}
.btn-ghost:hover { color: var(--blue); text-decoration: underline; opacity: 1; }

.btn svg { width: 14px; height: 14px; }

/* ============================================
   Badges / Chips
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  font-size: 11.5px;
  font-family: var(--font-en);
  font-weight: 500;
  letter-spacing: 0.02em;
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold);
  border: 1px solid rgba(212, 160, 23, 0.25);
}
.badge-green { background: var(--green-soft); color: var(--green); border-color: rgba(63, 185, 80, 0.25); }
.badge-blue { background: var(--blue-soft); color: var(--blue); border-color: rgba(88, 166, 255, 0.25); }
.badge-soft { background: var(--card); color: var(--text-sub); border-color: var(--border); }

.chip {
  display: inline-block;
  padding: 3px 9px;
  font-size: 11.5px;
  color: var(--text-sub);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.chip-jp { font-family: var(--font-jp); }

/* Difficulty indicator */
.difficulty {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: var(--text-sub);
  font-family: var(--font-en);
}
.difficulty .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--border-strong);
}
.difficulty .dot.on { background: var(--green); }
.difficulty.mid .dot.on { background: var(--gold); }
.difficulty.hard .dot.on { background: var(--danger); }

/* ============================================
   Card
   ============================================ */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}
.card:hover {
  border-color: var(--border-strong);
  background: var(--card-hover);
}
.card-link {
  display: block;
  color: inherit;
}
.card-link:hover { opacity: 1; }

/* Workflow card */
.wf-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 200px;
}
.wf-card .wf-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.wf-card .wf-icon {
  width: 36px;
  height: 36px;
  color: var(--gold);
  flex-shrink: 0;
}
.wf-card h3 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text);
}
.wf-card .wf-desc {
  color: var(--text-sub);
  font-size: 13.5px;
  line-height: 1.65;
  margin: 0;
  flex-grow: 1;
}
.wf-card .wf-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.wf-card .wf-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ============================================
   Sections
   ============================================ */
section { position: relative; }
.section {
  padding: 96px 0;
}
.section-sm { padding: 64px 0; }

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 40px;
  gap: 24px;
}
.section-header .title-block { max-width: 640px; }
.section-eyebrow {
  display: inline-block;
  font-family: var(--font-en);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
  font-weight: 500;
}
.section-title {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--text);
}
.section-sub {
  margin: 12px 0 0;
  color: var(--text-sub);
  font-size: 14.5px;
  line-height: 1.75;
}

.section-view-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  white-space: nowrap;
}
.section-view-all:hover { color: var(--text); border-color: var(--border-strong); opacity: 1; }
.section-view-all svg { width: 12px; height: 12px; }

/* ============================================
   Grids
   ============================================ */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ============================================
   Honeycomb background pattern
   ============================================ */
.honeycomb-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  mask-image: radial-gradient(ellipse at 50% 30%, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, black 20%, transparent 70%);
}
.honeycomb-bg svg { width: 100%; height: 100%; }

/* ============================================
   Footer
   ============================================ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 64px 0 32px;
  margin-top: 80px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}
.footer-col h5 {
  margin: 0 0 16px;
  font-family: var(--font-en);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
}
.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-col ul a {
  color: var(--text-sub);
  font-size: 13.5px;
}
.footer-col ul a:hover { color: var(--text); opacity: 1; }
.footer-col ul li.soon {
  color: var(--text-dim);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.footer-col ul li.soon::after {
  content: "Soon";
  font-family: var(--font-en);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  padding: 1px 6px;
  border: 1px dashed var(--border-strong);
  border-radius: 999px;
  color: var(--text-dim);
}

.footer-brand-text {
  color: var(--text-sub);
  font-size: 13px;
  line-height: 1.75;
  margin: 16px 0 0;
}
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-dim);
}
.footer-bottom .ai-note {
  max-width: 640px;
  font-size: 12px;
  line-height: 1.7;
}

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* ============================================
   Page hero (non-home)
   ============================================ */
.page-hero {
  padding: 72px 0 40px;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.page-hero .container { position: relative; z-index: 1; }
.page-hero .eyebrow {
  font-family: var(--font-en);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
  font-weight: 500;
}
.page-hero h1 {
  margin: 0;
  font-size: 40px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.015em;
  max-width: 780px;
}
.page-hero .lead {
  margin: 18px 0 0;
  color: var(--text-sub);
  font-size: 16px;
  line-height: 1.85;
  max-width: 720px;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-dim);
  margin-bottom: 20px;
  font-family: var(--font-en);
}
.breadcrumbs a { color: var(--text-sub); }
.breadcrumbs .sep { opacity: 0.5; }

/* ============================================
   Filter bar (workflows / usecases)
   ============================================ */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}
.filter-label {
  font-family: var(--font-en);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding-right: 4px;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--text-sub);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--font-jp);
  transition: all 0.12s ease;
}
.filter-chip:hover { color: var(--text); border-color: var(--border-strong); }
.filter-chip.active {
  color: var(--text);
  background: var(--card);
  border-color: var(--gold);
}
.filter-chip .count {
  color: var(--text-dim);
  font-size: 11.5px;
  font-family: var(--font-en);
}

/* ============================================
   Prose (blog detail)
   ============================================ */
.prose {
  color: var(--text);
  font-size: 15.5px;
  line-height: 1.9;
}
.prose h2 {
  margin: 48px 0 16px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.005em;
  padding-top: 8px;
}
.prose h3 {
  margin: 32px 0 12px;
  font-size: 17px;
  font-weight: 700;
}
.prose p {
  margin: 0 0 20px;
  color: var(--text);
}
.prose ul, .prose ol {
  margin: 0 0 20px;
  padding-left: 24px;
}
.prose li { margin-bottom: 6px; }
.prose li::marker { color: var(--gold); }
.prose blockquote {
  border-left: 3px solid var(--gold);
  margin: 24px 0;
  padding: 4px 20px;
  color: var(--text-sub);
  background: rgba(212, 160, 23, 0.04);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.prose code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--card);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.prose pre {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.7;
  margin: 24px 0;
}
.prose pre code {
  background: transparent;
  border: none;
  padding: 0;
}
.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 40px 0;
}

/* Callout in prose */
.callout {
  display: flex;
  gap: 14px;
  padding: 18px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue);
  border-radius: var(--radius);
  margin: 24px 0;
  color: var(--text-sub);
  font-size: 14px;
  line-height: 1.75;
}
.callout.gold { border-left-color: var(--gold); }
.callout.green { border-left-color: var(--green); }
.callout svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 3px; color: var(--blue); }
.callout.gold svg { color: var(--gold); }
.callout.green svg { color: var(--green); }

/* ============================================
   Future placeholder (grey-out sections)
   ============================================ */
.future-slab {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 28px;
  background:
    repeating-linear-gradient(
      -45deg,
      transparent 0,
      transparent 12px,
      rgba(255,255,255,0.015) 12px,
      rgba(255,255,255,0.015) 13px
    );
}
.future-slab .future-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-en);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 3px 10px;
  border: 1px dashed var(--border-strong);
  border-radius: 999px;
  color: var(--text-dim);
  margin-bottom: 12px;
}
.future-slab h4 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-sub);
}
.future-slab p {
  margin: 0;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.7;
}
.future-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px;
}
.future-list .fitem {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 12.5px;
}
.future-list .fitem .hex {
  width: 14px; height: 14px;
  color: var(--text-dim);
  flex-shrink: 0;
}
@media (max-width: 700px) {
  .future-list { grid-template-columns: 1fr; }
}

/* ============================================
   Two-column layouts (blog detail, doc)
   ============================================ */
.two-col {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 64px;
  align-items: flex-start;
}
@media (max-width: 1000px) {
  .two-col { grid-template-columns: 1fr; }
}
.sidebar {
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.sidebar-block {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.sidebar-block h5 {
  margin: 0 0 14px;
  font-family: var(--font-en);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
}
.sidebar-block ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sidebar-block ul a {
  color: var(--text-sub);
  font-size: 13px;
  line-height: 1.5;
  display: block;
}
.sidebar-block ul a:hover { color: var(--text); opacity: 1; }

/* ============================================
   Small helpers
   ============================================ */
.divider {
  height: 1px;
  background: var(--border);
  margin: 48px 0;
}
.dot-sep {
  color: var(--text-dim);
  margin: 0 6px;
}
.tag-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 11.5px;
  color: var(--text-sub);
  background: rgba(255,255,255,0.03);
  border-radius: 4px;
  font-family: var(--font-en);
}


/* ============================================
   Brand logo (bee-in-tile lockup)
   ============================================ */
.brand {
  gap: 10px;
  color: var(--brand-fg);
}
.brand .logo-tile {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  background-image: url("logo-bee.png?v=2");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
/* Hide any inline SVG or <img> — image is delivered via background-image */
.brand .logo-tile svg,
.brand .logo-tile img { display: none; }

.brand .wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.015em;
  line-height: 1;
}
.brand .wordmark .tld {
  color: var(--brand-fg-sub);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.01em;
  margin-left: 1px;
}

/* Legacy .brand-mark used inline SVGs — hide when new logo-tile is present */
.brand:has(.logo-tile) .brand-mark { display: none; }

/* ============================================
   Theme toggle
   ============================================ */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--card);
  border: 1px solid var(--border-strong);
  color: var(--gold);
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
  flex-shrink: 0;
  margin-left: 4px;
  position: relative;
}
.theme-toggle:hover {
  background: var(--card-hover);
  border-color: var(--gold);
  transform: translateY(-1px);
}
.theme-toggle:active { transform: translateY(0); }
.theme-toggle svg { width: 17px; height: 17px; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* ============================================
   Mobile nav (hamburger + drawer)
   ============================================ */
.nav-hamburger {
  display: none;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-sub);
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nav-hamburger svg { width: 16px; height: 16px; }
.nav-hamburger:hover { color: var(--text); background: var(--card); }

.mobile-drawer {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg);
  z-index: 100;
  padding: 20px 24px 40px;
  overflow-y: auto;
  animation: drawerIn 0.2s ease;
}
@keyframes drawerIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.mobile-drawer.open { display: block; }
.mobile-drawer .drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.mobile-drawer .drawer-close {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-sub);
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mobile-drawer .drawer-close svg { width: 16px; height: 16px; }
.mobile-drawer .drawer-links {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  display: flex;
  flex-direction: column;
}
.mobile-drawer .drawer-links li {
  border-bottom: 1px solid var(--border);
}
.mobile-drawer .drawer-links a {
  display: block;
  padding: 16px 4px;
  color: var(--text);
  font-size: 16px;
  font-weight: 500;
}
.mobile-drawer .drawer-links a:hover { color: var(--gold); opacity: 1; }
.mobile-drawer .drawer-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 20px;
}
.mobile-drawer .drawer-search svg { width: 15px; height: 15px; }
.mobile-drawer .drawer-foot {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12px;
}

/* Prevent body scroll when drawer open */
body.no-scroll { overflow: hidden; }

/* ============================================
   Light-mode adjustments for specific components
   ============================================ */
:root[data-theme="light"] .honeycomb-bg { opacity: 0.5; }
:root[data-theme="light"] .honeycomb-bg svg path { stroke: var(--pattern-stroke) !important; }

/* Featured blog image bg — softer in light mode */
:root[data-theme="light"] .featured-visual {
  background:
    radial-gradient(circle at 30% 40%, rgba(184,134,11,0.14), transparent 55%),
    radial-gradient(circle at 70% 70%, rgba(46,160,67,0.09), transparent 55%),
    #f0eee6 !important;
}
:root[data-theme="light"] .ai-search {
  background:
    radial-gradient(ellipse at top, rgba(184,134,11,0.06), transparent 60%),
    repeating-linear-gradient(-45deg, transparent 0, transparent 14px, rgba(15,20,30,0.02) 14px, rgba(15,20,30,0.02) 15px) !important;
}
:root[data-theme="light"] .future-slab {
  background:
    repeating-linear-gradient(-45deg, transparent 0, transparent 12px, rgba(15,20,30,0.02) 12px, rgba(15,20,30,0.02) 13px) !important;
}
:root[data-theme="light"] .article-meta .avatar { color: #fff8e6; }
:root[data-theme="light"] .btn-primary { color: #fffdf5; }
:root[data-theme="light"] .badge {
  border-color: rgba(184,134,11,0.35);
}

/* Hexagon patterns inside inline <svg> stroke color override for light */
:root[data-theme="light"] svg path[stroke="#21262d"] { stroke: var(--pattern-stroke); }
:root[data-theme="light"] svg rect[stroke="#30363d"] { stroke: var(--border-strong); }
:root[data-theme="light"] svg rect[fill="#161b22"] { fill: var(--card); }
:root[data-theme="light"] svg text[fill="#e2e8f0"] { fill: var(--text); }
:root[data-theme="light"] svg text[fill="#8b949e"] { fill: var(--text-sub); }

/* ============================================
   Mobile refinements
   ============================================ */
@media (max-width: 900px) {
  .nav-search { display: none; }
  .nav-links { display: none; }
  .nav-hamburger { display: inline-flex; }
  .site-nav .inner { gap: 12px; }

  .container, .container-narrow { padding: 0 20px; }

  /* Hero */
  .hero { padding: 56px 0 56px; }
  .hero h1 { font-size: 34px; line-height: 1.3; }
  .hero .sub { font-size: 15px; }
  .hero-stats { gap: 28px; margin-top: 40px; padding-top: 24px; }
  .hero-stat .num { font-size: 22px; }
  .hero-hex-cluster { display: none; }

  /* Sections */
  .section { padding: 64px 0; }
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 28px;
  }
  .section-title { font-size: 24px; line-height: 1.4; }

  /* Cards / grids gap */
  .grid-3, .grid-2, .grid-4 { gap: 14px; }

  /* Popular list mobile */
  .popular-item {
    padding: 14px 16px;
    gap: 12px;
  }

  /* Page hero */
  .page-hero { padding: 48px 0 32px; }
  .page-hero h1 { font-size: 28px; line-height: 1.35; }
  .page-hero .lead { font-size: 14.5px; }

  /* Footer */
  .site-footer { padding: 48px 0 24px; margin-top: 48px; }
  .footer-grid { gap: 32px 24px; margin-bottom: 32px; }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .footer-bottom .ai-note { font-size: 11.5px; }

  /* Detail hero */
  .detail-hero h1 { font-size: 26px; }
  .detail-hero { padding: 40px 0 32px; }

  /* Article hero */
  .article-hero { padding: 40px 0 24px; }
  .article-hero h1 { font-size: 26px; line-height: 1.4; }
  .article-hero .lead { font-size: 14.5px; }

  /* About hero */
  .about-hero { padding: 56px 0 40px; }
  .about-hero h1 { font-size: 32px; line-height: 1.35; }
  .about-section { padding: 48px 0; }
  .about-section h2 { font-size: 22px; }

  /* Use case big cards — icon on top */
  .uc-big {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 22px;
    min-height: 0;
  }
  .uc-big h3 { font-size: 17px; }

  /* Contact form padding */
  .form-card { padding: 22px; }
  .field-row { gap: 12px; }

  /* Featured blog card stacked */
  .featured { grid-template-columns: 1fr; }
  .featured-visual { min-height: 200px; padding: 24px; }
  .featured-visual svg { width: 160px; height: 160px; }
  .featured-body { padding: 24px; }
  .featured-body h2 { font-size: 22px; }

  /* Workflow detail sidebar/main gap */
  .layout-detail { gap: 32px; padding: 32px 0 64px; }

  /* Blog article-row hide extra reading col already handled */
  .article-row { padding: 22px 0; }

  /* Ai search */
  .ai-search { padding: 28px 22px; }
  .ai-search h3 { font-size: 20px; }

  /* Reduce hero-badge weight */
  .hero-badge { font-size: 11px; }
}

@media (max-width: 600px) {
  .hero h1 { font-size: 28px; }
  .hero .sub { font-size: 14.5px; }
  .hero-ctas { width: 100%; }
  .hero-ctas .btn { flex: 1; justify-content: center; }
  .hero-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  .brand .wordmark { font-size: 17px; }
  .brand .wordmark .tld { font-size: 13.5px; }
  .brand .logo-tile { width: 28px; height: 28px; }
  .brand .logo-tile svg { width: 19px; height: 19px; }

  /* Detail meta row: wrap tightly */
  .wf-meta-row { gap: 16px 20px; }

  /* Contact reason chips */
  .reason { font-size: 12px; padding: 7px 12px; }

  /* Section eyebrow slightly smaller */
  .section-eyebrow { font-size: 11px; }

  /* Category strip */
  .cat-strip .cat .num { font-size: 16px; }
}
